2022-01-03 14:02:41 +00:00
// Do not edit this file; automatically generated.
2021-01-16 14:07:51 +00:00
/* eslint-disable */
; ( function ( root , factory ) {
if ( typeof define === 'function' && define . amd ) { // AMD
define ( [ ] , factory ) ;
} else if ( typeof exports === 'object' ) { // Node.js
module . exports = factory ( ) ;
} else { // Browser
2022-06-07 11:14:29 +00:00
var factoryExports = factory ( ) ;
root . Blockly = factoryExports ;
2021-01-16 14:07:51 +00:00
}
} ( this , function ( ) {
2022-06-07 11:14:29 +00:00
var $ = { } ;
2022-11-16 13:57:00 +00:00
var longStart$$module$build$src$core$touch = function ( a , b ) { longStop$$module$build$src$core$touch ( ) ; a . changedTouches && 1 !== a . changedTouches . length || ( longPid _$$module$build$src$core$touch = setTimeout ( function ( ) { a . changedTouches && ( a . button = 2 , a . clientX = a . changedTouches [ 0 ] . clientX , a . clientY = a . changedTouches [ 0 ] . clientY ) ; b && b . handleRightClick ( a ) } , LONGPRESS$$module$build$src$core$touch ) ) } , longStop$$module$build$src$core$touch = function ( ) { longPid _$$module$build$src$core$touch && ( clearTimeout ( longPid _$$module$build$src$core$touch ) ,
longPid _$$module$build$src$core$touch = 0 ) } , clearTouchIdentifier$$module$build$src$core$touch = function ( ) { touchIdentifier _$$module$build$src$core$touch = null } , shouldHandleEvent$$module$build$src$core$touch = function ( a ) { return ! isMouseOrTouchEvent$$module$build$src$core$touch ( a ) || checkTouchIdentifier$$module$build$src$core$touch ( a ) } , getTouchIdentifierFromEvent$$module$build$src$core$touch = function ( a ) { return a instanceof PointerEvent ? String ( a . pointerId ) : a instanceof MouseEvent ? "mouse" : a . changedTouches && a . changedTouches [ 0 ] &&
void 0 !== a . changedTouches [ 0 ] . identifier && null !== a . changedTouches [ 0 ] . identifier ? String ( a . changedTouches [ 0 ] . identifier ) : "mouse" } , checkTouchIdentifier$$module$build$src$core$touch = function ( a ) { const b = getTouchIdentifierFromEvent$$module$build$src$core$touch ( a ) ; return void 0 !== touchIdentifier _$$module$build$src$core$touch && null !== touchIdentifier _$$module$build$src$core$touch ? touchIdentifier _$$module$build$src$core$touch === b : "mousedown" === a . type || "touchstart" === a . type || "pointerdown" === a . type ? ( touchIdentifier _$$module$build$src$core$touch =
b , ! 0 ) : ! 1 } , setClientFromTouch$$module$build$src$core$touch = function ( a ) { if ( a . type . startsWith ( "touch" ) && a . changedTouches ) { const b = a . changedTouches [ 0 ] ; a . clientX = b . clientX ; a . clientY = b . clientY } } , isMouseOrTouchEvent$$module$build$src$core$touch = function ( a ) { return a . type . startsWith ( "touch" ) || a . type . startsWith ( "mouse" ) || a . type . startsWith ( "pointer" ) } , isTouchEvent$$module$build$src$core$touch = function ( a ) { return a . type . startsWith ( "touch" ) || a . type . startsWith ( "pointer" ) } , splitEventByTouches$$module$build$src$core$touch =
function ( a ) { const b = [ ] ; if ( a . changedTouches ) for ( let c = 0 ; c < a . changedTouches . length ; c ++ ) b [ c ] = { type : a . type , changedTouches : [ a . changedTouches [ c ] ] , target : a . target , stopPropagation ( ) { a . stopPropagation ( ) } , preventDefault ( ) { a . preventDefault ( ) } } ; else b . push ( a ) ; return b } , conditionalBind$$module$build$src$core$browser _events = function ( a , b , c , d , e , f ) { function g ( n ) { const p = ! e ; n = splitEventByTouches$$module$build$src$core$touch ( n ) ; for ( let r = 0 ; r < n . length ; r ++ ) { const q = n [ r ] ; if ( ! p || shouldHandleEvent$$module$build$src$core$touch ( q ) ) setClientFromTouch$$module$build$src$core$touch ( q ) ,
c ? d . call ( c , q ) : d ( q ) , h = ! 0 } } let h = ! 1 ; const k = [ ] ; if ( globalThis . PointerEvent && b in TOUCH _MAP$$module$build$src$core$touch ) for ( var l = 0 ; l < TOUCH _MAP$$module$build$src$core$touch [ b ] . length ; l ++ ) { var m = TOUCH _MAP$$module$build$src$core$touch [ b ] [ l ] ; a . addEventListener ( m , g , ! 1 ) ; k . push ( [ a , m , g ] ) } else if ( a . addEventListener ( b , g , ! 1 ) , k . push ( [ a , b , g ] ) , b in TOUCH _MAP$$module$build$src$core$touch ) for ( l = n => { g ( n ) ; const p = ! f ; h && p && n . preventDefault ( ) } , m = 0 ; m < TOUCH _MAP$$module$build$src$core$touch [ b ] . length ; m ++ ) { const n = TOUCH _MAP$$module$build$src$core$touch [ b ] [ m ] ;
a . addEventListener ( n , l , ! 1 ) ; k . push ( [ a , n , l ] ) } return k } , bind$$module$build$src$core$browser _events = function ( a , b , c , d ) { function e ( k ) { c ? d . call ( c , k ) : d ( k ) } const f = [ ] ; if ( globalThis . PointerEvent && b in TOUCH _MAP$$module$build$src$core$touch ) for ( var g = 0 ; g < TOUCH _MAP$$module$build$src$core$touch [ b ] . length ; g ++ ) { var h = TOUCH _MAP$$module$build$src$core$touch [ b ] [ g ] ; a . addEventListener ( h , e , ! 1 ) ; f . push ( [ a , h , e ] ) } else if ( a . addEventListener ( b , e , ! 1 ) , f . push ( [ a , b , e ] ) , b in TOUCH _MAP$$module$build$src$core$touch ) for ( g = k => { if ( k instanceof
TouchEvent && k . changedTouches && 1 === k . changedTouches . length ) { const l = k . changedTouches [ 0 ] ; k . clientX = l . clientX ; k . clientY = l . clientY } e ( k ) ; k . preventDefault ( ) } , h = 0 ; h < TOUCH _MAP$$module$build$src$core$touch [ b ] . length ; h ++ ) { const k = TOUCH _MAP$$module$build$src$core$touch [ b ] [ h ] ; a . addEventListener ( k , g , ! 1 ) ; f . push ( [ a , k , g ] ) } return f } , unbind$$module$build$src$core$browser _events = function ( a ) { const b = a [ a . length - 1 ] [ 2 ] ; for ( ; a . length ; ) { const c = a . pop ( ) ; c [ 0 ] . removeEventListener ( c [ 1 ] , c [ 2 ] , ! 1 ) } return b } , isTargetInput$$module$build$src$core$browser _events =
function ( a ) { if ( a . target instanceof HTMLElement ) { if ( a . target . isContentEditable || "true" === a . target . getAttribute ( "data-is-text-input" ) ) return ! 0 ; if ( a . target instanceof HTMLInputElement ) return a = a . target , "text" === a . type || "number" === a . type || "email" === a . type || "password" === a . type || "search" === a . type || "tel" === a . type || "url" === a . type ; if ( a . target instanceof HTMLTextAreaElement ) return ! 0 } return ! 1 } , isRightButton$$module$build$src$core$browser _events = function ( a ) { return a . ctrlKey && MAC$$module$build$src$core$utils$useragent ?
! 0 : 2 === a . button } , mouseToSvg$$module$build$src$core$browser _events = function ( a , b , c ) { const d = b . createSVGPoint ( ) ; d . x = a . clientX ; d . y = a . clientY ; c || ( c = b . getScreenCTM ( ) . inverse ( ) ) ; return d . matrixTransform ( c ) } , getScrollDeltaPixels$$module$build$src$core$browser _events = function ( a ) { switch ( a . deltaMode ) { default : return { x : a . deltaX , y : a . deltaY } ; case 1 : return { x : a . deltaX * LINE _MODE _MULTIPLIER$$module$build$src$core$browser _events , y : a . deltaY * LINE _MODE _MULTIPLIER$$module$build$src$core$browser _events } ; case 2 : return { x : a . deltaX *
PAGE _MODE _MULTIPLIER$$module$build$src$core$browser _events , y : a . deltaY * PAGE _MODE _MULTIPLIER$$module$build$src$core$browser _events } } } , 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 ) { selected$$module$build$src$core$common =
a } , 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 ) } , defineBlocksWithJsonArrayInternal$$module$build$src$core$common = function ( a ) { defineBlocks$$module$build$src$core$common ( createBlockDefinitionsFromJsonArray$$module$build$src$core$common ( a ) ) } , createBlockDefinitionsFromJsonArray$$module$build$src$core$common = function ( a ) { const b = { } ; for ( let c = 0 ; c < a . length ; c ++ ) { const d = a [ c ] ; if ( ! d ) { console . warn ( ` Block definition # ${ c } in JSON array is ${ d } . Skipping ` ) ; continue } const e =
d . type ; e ? b [ e ] = { init : jsonInitFactory$$module$build$src$core$common ( d ) } : console . warn ( ` Block definition # ${ c } in JSON array is missing a type attribute. ` + "Skipping." ) } return b } , defineBlocks$$module$build$src$core$common = function ( a ) { for ( const b of Object . keys ( a ) ) { const c = a [ b ] ; b in Blocks$$module$build$src$core$blocks && console . warn ( ` Block definiton " ${ b } " overwrites previous definition. ` ) ; Blocks$$module$build$src$core$blocks [ b ] = c } } , createSvgElement$$module$build$src$core$utils$dom = function ( a , b , c ) { a = document . createElementNS ( SVG _NS$$module$build$src$core$utils$dom ,
String ( a ) ) ; for ( const d in b ) a . setAttribute ( d , ` ${ b [ d ] } ` ) ; c && c . appendChild ( a ) ; return a } , addClass$$module$build$src$core$utils$dom = function ( a , b ) { b = b . split ( " " ) ; if ( b . every ( c => a . classList . contains ( c ) ) ) return ! 1 ; a . classList . add ( ... b ) ; return ! 0 } , removeClasses$$module$build$src$core$utils$dom = function ( a , b ) { a . classList . remove ( ... b . split ( " " ) ) } , removeClass$$module$build$src$core$utils$dom = function ( a , b ) { b = b . split ( " " ) ; if ( b . every ( c => ! a . classList . contains ( c ) ) ) return ! 1 ; a . classList . remove ( ... b ) ; return ! 0 } , hasClass$$module$build$src$core$utils$dom =
function ( a , b ) { return a . classList . contains ( b ) } , removeNode$$module$build$src$core$utils$dom = function ( a ) { return a && a . parentNode ? a . parentNode . removeChild ( a ) : null } , insertAfter$$module$build$src$core$utils$dom = function ( a , b ) { const c = b . nextSibling ; b = b . parentNode ; if ( ! b ) throw Error ( "Reference node has no parent." ) ; c ? b . insertBefore ( a , c ) : b . appendChild ( a ) } , containsNode$$module$build$src$core$utils$dom = function ( a , b ) { return ! ! ( a . compareDocumentPosition ( b ) & NodeType$$module$build$src$core$utils$dom . DOCUMENT _POSITION _CONTAINED _BY ) } ,
setCssTransform$$module$build$src$core$utils$dom = function ( a , b ) { a . style . transform = b ; a . style [ "-webkit-transform" ] = b } , startTextWidthCache$$module$build$src$core$utils$dom = function ( ) { cacheReference$$module$build$src$core$utils$dom ++ ; cacheWidths$$module$build$src$core$utils$dom || ( cacheWidths$$module$build$src$core$utils$dom = Object . create ( null ) ) } , stopTextWidthCache$$module$build$src$core$utils$dom = function ( ) { cacheReference$$module$build$src$core$utils$dom -- ; cacheReference$$module$build$src$core$utils$dom ||
( cacheWidths$$module$build$src$core$utils$dom = null ) } , getTextWidth$$module$build$src$core$utils$dom = function ( a ) { const b = a . textContent + "\n" + a . className . baseVal ; let c ; if ( cacheWidths$$module$build$src$core$utils$dom && ( c = cacheWidths$$module$build$src$core$utils$dom [ b ] ) ) return c ; try { c = a . getComputedTextLength ( ) } catch ( d ) { return 8 * a . textContent . length } cacheWidths$$module$build$src$core$utils$dom && ( cacheWidths$$module$build$src$core$utils$dom [ b ] = c ) ; return c } , getFastTextWidth$$module$build$src$core$utils$dom =
function ( a , b , c , d ) { return getFastTextWidthWithSizeString$$module$build$src$core$utils$dom ( a , b + "pt" , c , d ) } , getFastTextWidthWithSizeString$$module$build$src$core$utils$dom = function ( a , b , c , d ) { const e = a . textContent ; a = e + "\n" + a . className . baseVal ; var f ; if ( cacheWidths$$module$build$src$core$utils$dom && ( f = cacheWidths$$module$build$src$core$utils$dom [ a ] ) ) return f ; canvasContext$$module$build$src$core$utils$dom || ( f = document . createElement ( "canvas" ) , f . className = "blocklyComputeCanvas" , document . body . appendChild ( f ) ,
canvasContext$$module$build$src$core$utils$dom = f . getContext ( "2d" ) ) ; canvasContext$$module$build$src$core$utils$dom . font = c + " " + b + " " + d ; f = e ? canvasContext$$module$build$src$core$utils$dom . measureText ( e ) . width : 0 ; cacheWidths$$module$build$src$core$utils$dom && ( cacheWidths$$module$build$src$core$utils$dom [ a ] = f ) ; return f } , measureFontMetrics$$module$build$src$core$utils$dom = function ( a , b , c , d ) { const e = document . createElement ( "span" ) ; e . style . font = c + " " + b + " " + d ; e . textContent = a ; a = document . createElement ( "div" ) ; a . style . width =
"1px" ; a . style . height = "0" ; b = document . createElement ( "div" ) ; b . setAttribute ( "style" , "position: fixed; top: 0; left: 0; display: flex;" ) ; b . appendChild ( e ) ; b . appendChild ( a ) ; document . body . appendChild ( b ) ; c = { height : 0 , baseline : 0 } ; try { b . style . alignItems = "baseline" , c . baseline = a . offsetTop - e . offsetTop , b . style . alignItems = "flex-end" , c . height = a . offsetTop - e . offsetTop } finally { document . body . removeChild ( b ) } return c } , toRadians$$module$build$src$core$utils$math = function ( a ) { return a * Math . PI / 180 } , toDegrees$$module$build$src$core$utils$math =
function ( a ) { return 180 * a / Math . PI } , clamp$$module$build$src$core$utils$math = function ( a , b , c ) { if ( c < a ) { const d = c ; c = a ; a = d } return Math . max ( a , Math . min ( b , c ) ) } , 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." ) ; console . warn ( a ) } , getSize$$module$build$src$core$utils$style = function ( a ) { return TEST _ONLY$$module$build$src$core$utils$style . getSizeInternal ( a ) } , getSizeInternal$$module$build$src$core$utils$style =
function ( a ) { if ( "none" !== getComputedStyle$$module$build$src$core$utils$style ( a , "display" ) ) return getSizeWithDisplay$$module$build$src$core$utils$style ( a ) ; const b = a . style , c = b . display , d = b . visibility , e = b . position ; b . visibility = "hidden" ; b . position = "absolute" ; b . display = "inline" ; const f = a . offsetWidth ; a = a . offsetHeight ; b . display = c ; b . position = e ; b . visibility = d ; return new Size$$module$build$src$core$utils$size ( f , a ) } , getSizeWithDisplay$$module$build$src$core$utils$style = function ( a ) { return new Size$$module$build$src$core$utils$size ( a . offsetWidth ,
a . offsetHeight ) } , getComputedStyle$$module$build$src$core$utils$style = function ( a , b ) { a = window . getComputedStyle ( a ) ; return a [ b ] || a . getPropertyValue ( b ) } , getCascadedStyle$$module$build$src$core$utils$style = function ( a , b ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.style.getCascadedStyle" , "version 9" , "version 10" ) ; return a . currentStyle ? a . currentStyle [ b ] : "" } , getPageOffset$$module$build$src$core$utils$style = function ( a ) { const b = new Coordinate$$module$build$src$core$utils$coordinate ( 0 , 0 ) ; a = a . getBoundingClientRect ( ) ;
var c = document . documentElement ; c = new Coordinate$$module$build$src$core$utils$coordinate ( window . pageXOffset || c . scrollLeft , window . pageYOffset || c . scrollTop ) ; b . x = a . left + c . x ; b . y = a . top + c . y ; return b } , getViewportPageOffset$$module$build$src$core$utils$style = function ( ) { const a = document . body , b = document . documentElement ; return new Coordinate$$module$build$src$core$utils$coordinate ( a . scrollLeft || b . scrollLeft , a . scrollTop || b . scrollTop ) } , getBorderBox$$module$build$src$core$utils$style = function ( a ) { const b = parseFloat ( getComputedStyle$$module$build$src$core$utils$style ( a ,
"borderLeftWidth" ) ) , c = parseFloat ( getComputedStyle$$module$build$src$core$utils$style ( a , "borderRightWidth" ) ) , d = parseFloat ( getComputedStyle$$module$build$src$core$utils$style ( a , "borderTopWidth" ) ) ; a = parseFloat ( getComputedStyle$$module$build$src$core$utils$style ( a , "borderBottomWidth" ) ) ; return new Rect$$module$build$src$core$utils$rect ( d , a , b , c ) } , scrollIntoContainerView$$module$build$src$core$utils$style = function ( a , b , c ) { a = getContainerOffsetToScrollInto$$module$build$src$core$utils$style ( a , b , c ) ; b . scrollLeft =
a . x ; b . scrollTop = a . y } , getContainerOffsetToScrollInto$$module$build$src$core$utils$style = function ( a , b , c ) { var d = getPageOffset$$module$build$src$core$utils$style ( a ) , e = getPageOffset$$module$build$src$core$utils$style ( b ) , f = getBorderBox$$module$build$src$core$utils$style ( b ) ; const g = d . x - e . x - f . left ; d = d . y - e . y - f . top ; e = getSizeWithDisplay$$module$build$src$core$utils$style ( a ) ; a = b . clientWidth - e . width ; e = b . clientHeight - e . height ; f = b . scrollLeft ; b = b . scrollTop ; c ? ( f += g - a / 2 , b += d - e / 2 ) : ( f += Math . min ( g , Math . max ( g - a , 0 ) ) , b +=
Math . min ( d , Math . max ( d - e , 0 ) ) ) ; return new Coordinate$$module$build$src$core$utils$coordinate ( f , b ) } , createDom$$module$build$src$core$dropdowndiv = function ( ) { div$$module$build$src$core$dropdowndiv || ( div$$module$build$src$core$dropdowndiv = document . createElement ( "div" ) , div$$module$build$src$core$dropdowndiv . className = "blocklyDropDownDiv" , ( getParentContainer$$module$build$src$core$common ( ) || document . body ) . appendChild ( div$$module$build$src$core$dropdowndiv ) , content$$module$build$src$core$dropdowndiv = document . createElement ( "div" ) ,
content$$module$build$src$core$dropdowndiv . className = "blocklyDropDownContent" , div$$module$build$src$core$dropdowndiv . appendChild ( content$$module$build$src$core$dropdowndiv ) , arrow$$module$build$src$core$dropdowndiv = document . createElement ( "div" ) , arrow$$module$build$src$core$dropdowndiv . className = "blocklyDropDownArrow" , div$$module$build$src$core$dropdowndiv . appendChild ( arrow$$module$build$src$core$dropdowndiv ) , div$$module$build$src$core$dropdowndiv . style . opacity = "0" , div$$module$build$src$core$dropdowndiv . style . transition =
"transform " + ANIMATION _TIME$$module$build$src$core$dropdowndiv + "s, opacity " + ANIMATION _TIME$$module$build$src$core$dropdowndiv + "s" , div$$module$build$src$core$dropdowndiv . addEventListener ( "focusin" , function ( ) { addClass$$module$build$src$core$utils$dom ( div$$module$build$src$core$dropdowndiv , "blocklyFocused" ) } ) , div$$module$build$src$core$dropdowndiv . addEventListener ( "focusout" , function ( ) { removeClass$$module$build$src$core$utils$dom ( div$$module$build$src$core$dropdowndiv , "blocklyFocused" ) } ) ) } , setBoundsElement$$module$build$src$core$dropdowndiv =
function ( a ) { boundsElement$$module$build$src$core$dropdowndiv = a } , getContentDiv$$module$build$src$core$dropdowndiv = function ( ) { return content$$module$build$src$core$dropdowndiv } , clearContent$$module$build$src$core$dropdowndiv = function ( ) { content$$module$build$src$core$dropdowndiv . textContent = "" ; content$$module$build$src$core$dropdowndiv . style . width = "" } , setColour$$module$build$src$core$dropdowndiv = function ( a , b ) { div$$module$build$src$core$dropdowndiv . style . backgroundColor = a ; div$$module$build$src$core$dropdowndiv . style . borderColor =
b } , showPositionedByBlock$$module$build$src$core$dropdowndiv = function ( a , b , c , d ) { return showPositionedByRect$$module$build$src$core$dropdowndiv ( getScaledBboxOfBlock$$module$build$src$core$dropdowndiv ( b ) , a , c , d ) } , showPositionedByField$$module$build$src$core$dropdowndiv = function ( a , b , c ) { positionToField$$module$build$src$core$dropdowndiv = ! 0 ; return showPositionedByRect$$module$build$src$core$dropdowndiv ( getScaledBboxOfField$$module$build$src$core$dropdowndiv ( a ) , a , b , c ) } , getScaledBboxOfBlock$$module$build$src$core$dropdowndiv =
function ( a ) { var b = a . getSvgRoot ( ) ; const c = a . workspace . scale , d = a . height * c ; a = a . width * c ; b = getPageOffset$$module$build$src$core$utils$style ( b ) ; return new Rect$$module$build$src$core$utils$rect ( b . y , b . y + d , b . x , b . x + a ) } , getScaledBboxOfField$$module$build$src$core$dropdowndiv = function ( a ) { a = a . getScaledBBox ( ) ; return new Rect$$module$build$src$core$utils$rect ( a . top , a . bottom , a . left , a . right ) } , showPositionedByRect$$module$build$src$core$dropdowndiv = function ( a , b , c , d ) { const e = a . left + ( a . right - a . left ) / 2 , f = a . bottom ; a =
a . top ; d && ( a += d ) ; d = b . getSourceBlock ( ) ; let g = d . workspace ; for ( ; g . options . parentWorkspace ; ) g = g . options . parentWorkspace ; setBoundsElement$$module$build$src$core$dropdowndiv ( g . getParentSvg ( ) . parentNode ) ; return show$$module$build$src$core$dropdowndiv ( b , d . RTL , e , f , e , a , c ) } , show$$module$build$src$core$dropdowndiv = function ( a , b , c , d , e , f , g ) { owner$$module$build$src$core$dropdowndiv = a ; onHide$$module$build$src$core$dropdowndiv = g || null ; div$$module$build$src$core$dropdowndiv . style . direction = b ? "rtl" : "ltr" ; a = getMainWorkspace$$module$build$src$core$common ( ) ;
renderedClassName$$module$build$src$core$dropdowndiv = a . getRenderer ( ) . getClassName ( ) ; themeClassName$$module$build$src$core$dropdowndiv = a . getTheme ( ) . getClassName ( ) ; renderedClassName$$module$build$src$core$dropdowndiv && addClass$$module$build$src$core$utils$dom ( div$$module$build$src$core$dropdowndiv , renderedClassName$$module$build$src$core$dropdowndiv ) ; themeClassName$$module$build$src$core$dropdowndiv && addClass$$module$build$src$core$utils$dom ( div$$module$build$src$core$dropdowndiv , themeClassName$$module$build$src$core$dropdowndiv ) ;
return positionInternal$$module$build$src$core$dropdowndiv ( c , d , e , f ) } , getPositionBelowMetrics$$module$build$src$core$dropdowndiv = function ( a , b , c , d ) { a = getPositionX$$module$build$src$core$dropdowndiv ( a , c . left , c . right , d . width ) ; return { initialX : a . divX , initialY : b , finalX : a . divX , finalY : b + PADDING _Y$$module$build$src$core$dropdowndiv , arrowX : a . arrowX , arrowY : - ( ARROW _SIZE$$module$build$src$core$dropdowndiv / 2 + BORDER _SIZE$$module$build$src$core$dropdowndiv ) , arrowAtTop : ! 0 , arrowVisible : ! 0 } } , getPositionAboveMetrics$$module$build$src$core$dropdowndiv =
function ( a , b , c , d ) { a = getPositionX$$module$build$src$core$dropdowndiv ( a , c . left , c . right , d . width ) ; return { initialX : a . divX , initialY : b - d . height , finalX : a . divX , finalY : b - d . height - PADDING _Y$$module$build$src$core$dropdowndiv , arrowX : a . arrowX , arrowY : d . height - 2 * BORDER _SIZE$$module$build$src$core$dropdowndiv - ARROW _SIZE$$module$build$src$core$dropdowndiv / 2 , arrowAtTop : ! 1 , arrowVisible : ! 0 } } , getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv = function ( a , b , c ) { a = getPositionX$$module$build$src$core$dropdowndiv ( a ,
b . left , b . right , c . width ) ; return { initialX : a . divX , initialY : 0 , finalX : a . divX , finalY : 0 , arrowAtTop : null , arrowX : null , arrowY : null , arrowVisible : ! 1 } } , getPositionX$$module$build$src$core$dropdowndiv = function ( a , b , c , d ) { b = clamp$$module$build$src$core$utils$math ( b , a - d / 2 , c - d ) ; a = a - ARROW _SIZE$$module$build$src$core$dropdowndiv / 2 - b ; c = ARROW _HORIZONTAL _PADDING$$module$build$src$core$dropdowndiv ; a = clamp$$module$build$src$core$utils$math ( c , a , d - c - ARROW _SIZE$$module$build$src$core$dropdowndiv ) ; return { arrowX : a , divX : b } } , isVisible$$module$build$src$core$dropdowndiv =
function ( ) { return ! ! owner$$module$build$src$core$dropdowndiv } , hideIfOwner$$module$build$src$core$dropdowndiv = function ( a , b ) { return owner$$module$build$src$core$dropdowndiv === a ? ( b ? hideWithoutAnimation$$module$build$src$core$dropdowndiv ( ) : hide$$module$build$src$core$dropdowndiv ( ) , ! 0 ) : ! 1 } , hide$$module$build$src$core$dropdowndiv = function ( ) { div$$module$build$src$core$dropdowndiv . style . transform = "translate(0, 0)" ; div$$module$build$src$core$dropdowndiv . style . opacity = "0" ; animateOutTimer$$module$build$src$core$dropdowndiv =
setTimeout ( function ( ) { hideWithoutAnimation$$module$build$src$core$dropdowndiv ( ) } , 1E3 * ANIMATION _TIME$$module$build$src$core$dropdowndiv ) ; onHide$$module$build$src$core$dropdowndiv && ( onHide$$module$build$src$core$dropdowndiv ( ) , onHide$$module$build$src$core$dropdowndiv = null ) } , hideWithoutAnimation$$module$build$src$core$dropdowndiv = function ( ) { isVisible$$module$build$src$core$dropdowndiv ( ) && ( animateOutTimer$$module$build$src$core$dropdowndiv && clearTimeout ( animateOutTimer$$module$build$src$core$dropdowndiv ) ,
div$$module$build$src$core$dropdowndiv . style . transform = "" , div$$module$build$src$core$dropdowndiv . style . left = "" , div$$module$build$src$core$dropdowndiv . style . top = "" , div$$module$build$src$core$dropdowndiv . style . opacity = "0" , div$$module$build$src$core$dropdowndiv . style . display = "none" , div$$module$build$src$core$dropdowndiv . style . backgroundColor = "" , div$$module$build$src$core$dropdowndiv . style . borderColor = "" , onHide$$module$build$src$core$dropdowndiv && ( onHide$$module$build$src$core$dropdowndiv ( ) , onHide$$module$build$src$core$dropdowndiv =
null ) , clearContent$$module$build$src$core$dropdowndiv ( ) , owner$$module$build$src$core$dropdowndiv = null , renderedClassName$$module$build$src$core$dropdowndiv && ( removeClass$$module$build$src$core$utils$dom ( div$$module$build$src$core$dropdowndiv , renderedClassName$$module$build$src$core$dropdowndiv ) , renderedClassName$$module$build$src$core$dropdowndiv = "" ) , themeClassName$$module$build$src$core$dropdowndiv && ( removeClass$$module$build$src$core$utils$dom ( div$$module$build$src$core$dropdowndiv , themeClassName$$module$build$src$core$dropdowndiv ) ,
themeClassName$$module$build$src$core$dropdowndiv = "" ) , getMainWorkspace$$module$build$src$core$common ( ) . markFocused ( ) ) } , positionInternal$$module$build$src$core$dropdowndiv = function ( a , b , c , d ) { a = internal$$module$build$src$core$dropdowndiv . getPositionMetrics ( a , b , c , d ) ; a . arrowVisible ? ( arrow$$module$build$src$core$dropdowndiv . style . display = "" , arrow$$module$build$src$core$dropdowndiv . style . transform = "translate(" + a . arrowX + "px," + a . arrowY + "px) rotate(45deg)" , arrow$$module$build$src$core$dropdowndiv . setAttribute ( "class" ,
a . arrowAtTop ? "blocklyDropDownArrow blocklyArrowTop" : "blocklyDropDownArrow blocklyArrowBottom" ) ) : arrow$$module$build$src$core$dropdowndiv . style . display = "none" ; b = Math . floor ( a . initialX ) ; c = Math . floor ( a . initialY ) ; d = Math . floor ( a . finalX ) ; const e = Math . floor ( a . finalY ) ; div$$module$build$src$core$dropdowndiv . style . left = b + "px" ; div$$module$build$src$core$dropdowndiv . style . top = c + "px" ; div$$module$build$src$core$dropdowndiv . style . display = "block" ; div$$module$build$src$core$dropdowndiv . style . opacity = "1" ; div$$module$build$src$core$dropdowndiv . style . transform =
"translate(" + ( d - b ) + "px," + ( e - c ) + "px)" ; return ! ! a . arrowAtTop } , repositionForWindowResize$$module$build$src$core$dropdowndiv = function ( ) { if ( owner$$module$build$src$core$dropdowndiv ) { var a = owner$$module$build$src$core$dropdowndiv . getSourceBlock ( ) ; a = positionToField$$module$build$src$core$dropdowndiv ? getScaledBboxOfField$$module$build$src$core$dropdowndiv ( owner$$module$build$src$core$dropdowndiv ) : getScaledBboxOfBlock$$module$build$src$core$dropdowndiv ( a ) ; const b = a . left + ( a . right - a . left ) / 2 ; positionInternal$$module$build$src$core$dropdowndiv ( b ,
a . bottom , b , a . top ) } else hide$$module$build$src$core$dropdowndiv ( ) } , register$$module$build$src$core$registry = function ( a , b , c , d ) { if ( ! ( a instanceof Type$$module$build$src$core$registry ) && "string" !== typeof a || "" === String ( a ) . trim ( ) ) throw Error ( 'Invalid type "' + a + '". The type must be a non-empty string or a Blockly.registry.Type.' ) ; a = String ( 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 ] ) 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' ) ; } } , unregister$$module$build$src$core$registry = function ( a , b ) { a = String ( a ) . toLowerCase ( ) ; b = b . toLowerCase ( ) ; const c = typeMap$$module$build$src$core$registry [ a ] ; c && c [ b ] ? ( delete typeMap$$module$build$src$core$registry [ a ] [ b ] , delete nameMap$$module$build$src$core$registry [ a ] [ b ] ) : console . warn ( "Unable to unregister [" + b + "][" + a + "] from the registry." ) } , getItem$$module$build$src$core$registry = function ( a , b , c ) { a = String ( 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 = String ( 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 = String ( 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 ) ; b = Object . keys ( d ) ; for ( let e =
0 ; e < b . length ; e ++ ) { const f = b [ e ] ; c [ a [ f ] ] = d [ f ] } return c } , getClassFromOptions$$module$build$src$core$registry = function ( a , b , c ) { b = b . plugins [ a . toString ( ) ] || 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 ) { isEnabled$$module$build$src$core$events$utils ( ) && ( FIRE _QUEUE$$module$build$src$core$events$utils . length ||
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 ( ) { 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 ( let b = 0 , c ; c = a [ b ] ; b ++ ) { if ( ! c . workspaceId ) continue ; const d = getWorkspaceById$$module$build$src$core$common ( c . workspaceId ) ; d && d . fireChangeListener ( c ) } } , filter$$module$build$src$core$events$utils =
function ( a , b ) { a = a . slice ( ) ; b || a . reverse ( ) ; const c = [ ] , d = Object . create ( null ) ; for ( let g = 0 , h ; h = a [ g ] ; g ++ ) if ( ! h . isNull ( ) ) { var e = [ h . isUiEvent ? UI$$module$build$src$core$events$utils : h . type , h . blockId , h . workspaceId ] . join ( " " ) , f = d [ e ] ; const k = f ? f . event : null ; if ( ! f ) d [ e ] = { event : h , index : g } , c . push ( h ) ; else if ( h . type === MOVE$$module$build$src$core$events$utils && f . index === g - 1 ) e = h , k . newParentId = e . newParentId , k . newInputName = e . newInputName , k . newCoordinate = e . newCoordinate , f . index = g ; else if ( h . type === CHANGE$$module$build$src$core$events$utils &&
h . element === k . element && h . name === k . name ) k . newValue = h . newValue ; else if ( h . type === VIEWPORT _CHANGE$$module$build$src$core$events$utils ) f = h , k . viewTop = f . viewTop , k . viewLeft = f . viewLeft , k . scale = f . scale , k . oldScale = f . oldScale ; else if ( h . type !== CLICK$$module$build$src$core$events$utils || k . type !== BUBBLE _OPEN$$module$build$src$core$events$utils ) d [ e ] = { event : h , index : g } , c . push ( h ) } a = c . filter ( function ( g ) { return ! g . isNull ( ) } ) ; b || a . reverse ( ) ; for ( let g = 1 , h ; h = a [ g ] ; g ++ ) h . type === CHANGE$$module$build$src$core$events$utils && "mutation" ===
h . element && a . unshift ( a . splice ( g , 1 ) [ 0 ] ) ; 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 ) { var c = get$$module$build$src$core$events$utils ( a . type ) ; if ( ! c ) throw Error ( "Unknown event type." ) ; c = new c ; c . fromJson ( a ) ; c . workspaceId = b . id ; return c } , 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 ( ) ; if ( d && d . isEnabled ( ) ) { const e = a . getDescendants ( ! 1 ) ; for ( let f =
0 , g ; g = e [ f ] ; f ++ ) g . setEnabled ( ! 0 ) } else if ( ( a . outputConnection || a . previousConnection ) && ! b . isDragging ( ) ) { do a . setEnabled ( ! 1 ) , a = a . getNextBlock ( ) ; while ( a ) } } finally { recordUndo$$module$build$src$core$events$utils = c } } } } , getDocument$$module$build$src$core$utils$xml = function ( ) { return xmlDocument$$module$build$src$core$utils$xml } , setDocument$$module$build$src$core$utils$xml = function ( a ) { xmlDocument$$module$build$src$core$utils$xml = a } , createElement$$module$build$src$core$utils$xml = function ( a ) { return xmlDocument$$module$build$src$core$utils$xml . createElementNS ( NAME _SPACE$$module$build$src$core$utils$xml ,
a ) } , createTextNode$$module$build$src$core$utils$xml = function ( a ) { return xmlDocument$$module$build$src$core$utils$xml . createTextNode ( a ) } , textToDomDocument$$module$build$src$core$utils$xml = function ( a ) { return ( new DOMParser ) . parseFromString ( a , "text/xml" ) } , domToText$$module$build$src$core$utils$xml = function ( a ) { return ( new XMLSerializer ) . serializeToString ( a ) } , 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 } , allUsedVarModels$$module$build$src$core$variables = function ( a ) { a = a . getAllBlocks ( ! 1 ) ; const b = new Set ; for ( let c = 0 ; c < a . length ; c ++ ) { const d = a [ c ] . getVarModels ( ) ; if ( d ) for ( let e = 0 ; e < d . length ; e ++ ) { const f = d [ e ] ; f . getId ( ) && b . add ( f ) } } return Array . from ( b . values ( ) ) } , allDeveloperVariables$$module$build$src$core$variables = function ( a ) { a = a . getAllBlocks ( ! 1 ) ; const b = new Set ; for ( let d = 0 , e ; e = a [ d ] ; d ++ ) { var c = e . getDeveloperVariables ; if ( c ) { c = c ( ) ; for ( let f = 0 ; f < c . length ; f ++ ) b . add ( c [ f ] ) } } return Array . from ( b . values ( ) ) } , flyoutCategory$$module$build$src$core$variables =
function ( a ) { let b = [ ] ; const c = document . createElement ( "button" ) ; c . setAttribute ( "text" , "%{BKY_NEW_VARIABLE}" ) ; c . setAttribute ( "callbackKey" , "CREATE_VARIABLE" ) ; a . registerButtonCallback ( "CREATE_VARIABLE" , function ( d ) { createVariableButtonHandler$$module$build$src$core$variables ( d . getTargetWorkspace ( ) ) } ) ; b . push ( c ) ; a = flyoutCategoryBlocks$$module$build$src$core$variables ( a ) ; return b = b . concat ( a ) } , flyoutCategoryBlocks$$module$build$src$core$variables = function ( a ) { a = a . getVariablesOfType ( "" ) ; const b = [ ] ; if ( 0 < a . length ) { var c =
a [ a . length - 1 ] ; if ( Blocks$$module$build$src$core$blocks . variables _set ) { var d = createElement$$module$build$src$core$utils$xml ( "block" ) ; d . setAttribute ( "type" , "variables_set" ) ; d . setAttribute ( "gap" , Blocks$$module$build$src$core$blocks . math _change ? "8" : "24" ) ; d . appendChild ( generateVariableFieldDom$$module$build$src$core$variables ( c ) ) ; b . push ( d ) } Blocks$$module$build$src$core$blocks . math _change && ( d = createElement$$module$build$src$core$utils$xml ( "block" ) , d . setAttribute ( "type" , "math_change" ) , d . setAttribute ( "gap" ,
Blocks$$module$build$src$core$blocks . variables _get ? "20" : "8" ) , d . appendChild ( generateVariableFieldDom$$module$build$src$core$variables ( c ) ) , c = textToDom$$module$build$src$core$xml ( '<value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value>' ) , d . appendChild ( c ) , b . push ( d ) ) ; if ( Blocks$$module$build$src$core$blocks . variables _get ) { a . sort ( VariableModel$$module$build$src$core$variable _model . compareByName ) ; for ( let e = 0 , f ; f = a [ e ] ; e ++ ) c = createElement$$module$build$src$core$utils$xml ( "block" ) ,
c . setAttribute ( "type" , "variables_get" ) , c . setAttribute ( "gap" , "8" ) , c . appendChild ( generateVariableFieldDom$$module$build$src$core$variables ( f ) ) , b . push ( c ) } } return b } , generateUniqueName$$module$build$src$core$variables = function ( a ) { return TEST _ONLY$$module$build$src$core$variables . generateUniqueNameInternal ( a ) } , generateUniqueNameInternal$$module$build$src$core$variables = function ( a ) { return generateUniqueNameFromOptions$$module$build$src$core$variables ( VAR _LETTER _OPTIONS$$module$build$src$core$variables . charAt ( 0 ) ,
a . getAllVariableNames ( ) ) } , generateUniqueNameFromOptions$$module$build$src$core$variables = function ( a , b ) { if ( ! b . length ) return a ; const c = VAR _LETTER _OPTIONS$$module$build$src$core$variables ; let d = "" , e = c . indexOf ( a ) ; for ( ; ; ) { let f = ! 1 ; for ( let g = 0 ; g < b . length ; g ++ ) if ( b [ g ] . toLowerCase ( ) === a ) { f = ! 0 ; break } if ( ! f ) return a ; e ++ ; e === c . length && ( e = 0 , d = ` ${ Number ( d ) + 1 } ` ) ; a = c . charAt ( e ) + d } } , createVariableButtonHandler$$module$build$src$core$variables = function ( a , b , c ) { function d ( f ) { promptName$$module$build$src$core$variables ( Msg$$module$build$src$core$msg . NEW _VARIABLE _TITLE ,
f , function ( g ) { if ( g ) { const h = nameUsedWithAnyType$$module$build$src$core$variables ( g , a ) ; if ( h ) { let k ; h . type === e ? k = Msg$$module$build$src$core$msg . VARIABLE _ALREADY _EXISTS . replace ( "%1" , h . name ) : ( k = Msg$$module$build$src$core$msg . VARIABLE _ALREADY _EXISTS _FOR _ANOTHER _TYPE , k = k . replace ( "%1" , h . name ) . replace ( "%2" , h . type ) ) ; alert$$module$build$src$core$dialog ( k , function ( ) { d ( g ) } ) } else a . createVariable ( g , e ) , b && b ( g ) } else b && b ( null ) } ) } const e = c || "" ; d ( "" ) } , renameVariable$$module$build$src$core$variables = function ( a , b , c ) { function d ( e ) { const f =
Msg$$module$build$src$core$msg . RENAME _VARIABLE _TITLE . replace ( "%1" , b . name ) ; promptName$$module$build$src$core$variables ( f , e , function ( g ) { if ( g ) { var h = nameUsedWithOtherType$$module$build$src$core$variables ( g , b . type , a ) ; h ? ( h = Msg$$module$build$src$core$msg . VARIABLE _ALREADY _EXISTS _FOR _ANOTHER _TYPE . replace ( "%1" , h . name ) . replace ( "%2" , h . type ) , alert$$module$build$src$core$dialog ( h , function ( ) { d ( g ) } ) ) : ( a . renameVariableById ( b . getId ( ) , g ) , c && c ( g ) ) } else c && c ( null ) } ) } d ( "" ) } , promptName$$module$build$src$core$variables =
function ( a , b , c ) { prompt$$module$build$src$core$dialog ( a , b , function ( d ) { d && ( d = d . replace ( /[\s\xa0]+/g , " " ) . trim ( ) , d === Msg$$module$build$src$core$msg . RENAME _VARIABLE || d === Msg$$module$build$src$core$msg . NEW _VARIABLE ) && ( d = null ) ; c ( d ) } ) } , nameUsedWithOtherType$$module$build$src$core$variables = function ( a , b , c ) { c = c . getVariableMap ( ) . getAllVariables ( ) ; a = a . toLowerCase ( ) ; for ( let d = 0 , e ; e = c [ d ] ; d ++ ) if ( e . name . toLowerCase ( ) === a && e . type !== b ) return e ; return null } , nameUsedWithAnyType$$module$build$src$core$variables = function ( a ,
b ) { b = b . getVariableMap ( ) . getAllVariables ( ) ; a = a . toLowerCase ( ) ; for ( let c = 0 , d ; d = b [ c ] ; c ++ ) if ( d . name . toLowerCase ( ) === a ) return d ; return null } , generateVariableFieldDom$$module$build$src$core$variables = function ( a ) { const b = createElement$$module$build$src$core$utils$xml ( "field" ) ; b . setAttribute ( "name" , "VAR" ) ; b . setAttribute ( "id" , a . getId ( ) ) ; b . setAttribute ( "variabletype" , a . type ) ; a = createTextNode$$module$build$src$core$utils$xml ( a . name ) ; b . appendChild ( a ) ; return b } , getOrCreateVariablePackage$$module$build$src$core$variables =
function ( a , b , c , d ) { let e = getVariable$$module$build$src$core$variables ( a , b , c , d ) ; e || ( e = createVariable$$module$build$src$core$variables ( a , b , c , d ) ) ; return e } , getVariable$$module$build$src$core$variables = function ( a , b , c , d ) { const e = a . getPotentialVariableMap ( ) ; let f = null ; if ( b && ( f = a . getVariableById ( b ) , ! f && e && ( f = e . getVariableById ( b ) ) , f ) ) return f ; if ( c ) { if ( void 0 === d ) throw Error ( "Tried to look up a variable by name without a type" ) ; f = a . getVariable ( c , d ) ; ! f && e && ( f = e . getVariable ( c , d ) ) } return f } , createVariable$$module$build$src$core$variables =
function ( a , b , c , d ) { const e = a . getPotentialVariableMap ( ) ; c || ( c = generateUniqueName$$module$build$src$core$variables ( a . isFlyout ? a . targetWorkspace : a ) ) ; return e ? e . createVariable ( c , d , b ) : a . createVariable ( c , d , b ) } , getAddedVariables$$module$build$src$core$variables = function ( a , b ) { a = a . getAllVariables ( ) ; const c = [ ] ; if ( b . length !== a . length ) for ( let d = 0 ; d < a . length ; d ++ ) { const e = a [ d ] ; - 1 === b . indexOf ( e ) && c . push ( e ) } return c } , register$$module$build$src$core$css = function ( a ) { if ( injected$$module$build$src$core$css ) throw Error ( "CSS already injected" ) ;
content$$module$build$src$core$css += "\n" + a } , inject$$module$build$src$core$css = function ( a , b ) { injected$$module$build$src$core$css || ( injected$$module$build$src$core$css = ! 0 , a && ( a = b . replace ( /[\\/]$/ , "" ) , b = content$$module$build$src$core$css . replace ( /<<<PATH>>>/g , a ) , content$$module$build$src$core$css = "" , a = document . createElement ( "style" ) , a . id = "blockly-common-style" , b = document . createTextNode ( b ) , a . appendChild ( b ) , document . head . insertBefore ( a , document . head . firstChild ) ) ) } , getRelativeXY$$module$build$src$core$utils$svg _math =
function ( a ) { const b = new Coordinate$$module$build$src$core$utils$coordinate ( 0 , 0 ) ; var c = a . x && a . getAttribute ( "x" ) ; const d = a . y && a . getAttribute ( "y" ) ; c && ( b . x = parseInt ( c ) ) ; d && ( b . y = parseInt ( d ) ) ; if ( c = ( c = a . getAttribute ( "transform" ) ) && c . match ( XY _REGEX$$module$build$src$core$utils$svg _math ) ) b . x += Number ( c [ 1 ] ) , c [ 3 ] && ( b . y += Number ( c [ 3 ] ) ) ; ( a = a . getAttribute ( "style" ) ) && - 1 < a . indexOf ( "translate" ) && ( a = a . match ( XY _STYLE _REGEX$$module$build$src$core$utils$svg _math ) ) && ( b . x += Number ( a [ 1 ] ) , a [ 3 ] && ( b . y += Number ( a [ 3 ] ) ) ) ; return b } ,
getInjectionDivXY$$module$build$src$core$utils$svg _math = function ( a ) { let b = 0 , c = 0 ; for ( ; a ; ) { const d = getRelativeXY$$module$build$src$core$utils$svg _math ( a ) ; b += d . x ; c += d . y ; if ( - 1 !== ( " " + ( a . getAttribute ( "class" ) || "" ) + " " ) . indexOf ( " injectionDiv " ) ) break ; a = a . parentNode } return new Coordinate$$module$build$src$core$utils$coordinate ( b , c ) } , is3dSupported$$module$build$src$core$utils$svg _math = function ( ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.svgMath.is3dSupported" , "version 9" , "version 10" ) ;
return ! 0 } , getViewportBBox$$module$build$src$core$utils$svg _math = function ( ) { const a = getViewportPageOffset$$module$build$src$core$utils$style ( ) ; return new Rect$$module$build$src$core$utils$rect ( a . y , document . documentElement . clientHeight + a . y , a . x , document . documentElement . clientWidth + a . x ) } , getDocumentScroll$$module$build$src$core$utils$svg _math = function ( ) { const a = document . documentElement , b = window ; return new Coordinate$$module$build$src$core$utils$coordinate ( b . pageXOffset || a . scrollLeft , b . pageYOffset || a . scrollTop ) } ,
screenToWsCoordinates$$module$build$src$core$utils$svg _math = function ( a , b ) { var c = b . x ; b = b . y ; const d = a . getInjectionDiv ( ) . getBoundingClientRect ( ) ; c = new Coordinate$$module$build$src$core$utils$coordinate ( c - d . left , b - d . top ) ; b = a . getOriginOffsetInPixels ( ) ; return Coordinate$$module$build$src$core$utils$coordinate . difference ( c , b ) . scale ( 1 / a . scale ) } , workspaceToDom$$module$build$src$core$xml = function ( a , b ) { 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 ) ; d = a . getTopComments ( ! 0 ) ; for ( let e = 0 ; e < d . length ; e ++ ) c . appendChild ( d [ e ] . toXmlWithXY ( b ) ) ; a = a . getTopBlocks ( ! 0 ) ; for ( d = 0 ; d < a . length ; d ++ ) c . appendChild ( blockToDomWithXY$$module$build$src$core$xml ( a [ d ] , b ) ) ; return c } , variablesToDom$$module$build$src$core$xml = function ( a ) { const b = createElement$$module$build$src$core$utils$xml ( "variables" ) ; for ( let c = 0 ; c < a . length ; c ++ ) { const d = a [ c ] , e = createElement$$module$build$src$core$utils$xml ( "variable" ) ; e . appendChild ( createTextNode$$module$build$src$core$utils$xml ( d . name ) ) ;
d . type && e . setAttribute ( "type" , d . type ) ; e . id = d . getId ( ) ; b . appendChild ( e ) } return b } , blockToDomWithXY$$module$build$src$core$xml = function ( a , b ) { if ( a . isInsertionMarker ( ) && ( a = a . getChildren ( ! 1 ) [ 0 ] , ! a ) ) return new DocumentFragment ; let c = 0 ; a . workspace . RTL && ( c = a . workspace . getWidth ( ) ) ; b = blockToDom$$module$build$src$core$xml ( a , b ) ; const d = a . getRelativeToSurfaceXY ( ) ; b . setAttribute ( "x" , Math . round ( a . workspace . RTL ? c - d . x : d . x ) ) ; b . setAttribute ( "y" , Math . round ( d . y ) ) ; return b } , fieldToDom$$module$build$src$core$xml = function ( a ) { if ( a . isSerializable ( ) ) { const b =
createElement$$module$build$src$core$utils$xml ( "field" ) ; b . setAttribute ( "name" , a . name || "" ) ; return a . toXml ( b ) } return null } , allFieldsToDom$$module$build$src$core$xml = function ( a , b ) { for ( let c = 0 ; c < a . inputList . length ; c ++ ) { const d = a . inputList [ c ] ; for ( let e = 0 ; e < d . fieldRow . length ; e ++ ) { const f = fieldToDom$$module$build$src$core$xml ( d . fieldRow [ e ] ) ; f && b . appendChild ( f ) } } } , blockToDom$$module$build$src$core$xml = function ( a , b ) { if ( a . isInsertionMarker ( ) ) return ( b = a . getChildren ( ! 1 ) [ 0 ] ) ? blockToDom$$module$build$src$core$xml ( b ) :
new DocumentFragment ; const c = createElement$$module$build$src$core$utils$xml ( a . isShadow ( ) ? "shadow" : "block" ) ; c . setAttribute ( "type" , a . type ) ; b || c . setAttribute ( "id" , a . id ) ; if ( a . mutationToDom ) { var d = a . mutationToDom ( ) ; d && ( d . hasChildNodes ( ) || d . hasAttributes ( ) ) && c . appendChild ( d ) } allFieldsToDom$$module$build$src$core$xml ( a , c ) ; if ( d = a . getCommentText ( ) ) { var e = a . commentModel . size , f = a . commentModel . pinned , g = createElement$$module$build$src$core$utils$xml ( "comment" ) ; g . appendChild ( createTextNode$$module$build$src$core$utils$xml ( d ) ) ;
g . setAttribute ( "pinned" , f ) ; g . setAttribute ( "h" , e . height ) ; g . setAttribute ( "w" , e . width ) ; c . appendChild ( g ) } a . data && ( d = createElement$$module$build$src$core$utils$xml ( "data" ) , d . appendChild ( createTextNode$$module$build$src$core$utils$xml ( a . data ) ) , c . appendChild ( d ) ) ; for ( d = 0 ; d < a . inputList . length ; d ++ ) { e = a . inputList [ d ] ; var h = void 0 ; f = ! 0 ; if ( e . type !== inputTypes$$module$build$src$core$input _types . DUMMY ) { g = e . connection . targetBlock ( ) ; e . type === inputTypes$$module$build$src$core$input _types . VALUE ? h = createElement$$module$build$src$core$utils$xml ( "value" ) :
e . type === inputTypes$$module$build$src$core$input _types . STATEMENT && ( h = createElement$$module$build$src$core$utils$xml ( "statement" ) ) ; const l = e . connection . getShadowDom ( ) ; ! l || g && g . isShadow ( ) || h . appendChild ( cloneShadow$$module$build$src$core$xml ( l , b ) ) ; g && ( g = blockToDom$$module$build$src$core$xml ( g , b ) , g . nodeType === NodeType$$module$build$src$core$utils$dom . ELEMENT _NODE && ( h . appendChild ( g ) , f = ! 1 ) ) ; h . setAttribute ( "name" , e . name ) ; f || c . appendChild ( h ) } } void 0 !== a . inputsInline && a . inputsInline !== a . inputsInlineDefault &&
c . setAttribute ( "inline" , a . inputsInline . toString ( ) ) ; a . isCollapsed ( ) && c . setAttribute ( "collapsed" , "true" ) ; a . isEnabled ( ) || c . setAttribute ( "disabled" , "true" ) ; a . isDeletable ( ) || a . isShadow ( ) || c . setAttribute ( "deletable" , "false" ) ; a . isMovable ( ) || a . isShadow ( ) || c . setAttribute ( "movable" , "false" ) ; a . isEditable ( ) || c . setAttribute ( "editable" , "false" ) ; h = a . getNextBlock ( ) ; let k ; h && ( d = blockToDom$$module$build$src$core$xml ( h , b ) , d . nodeType === NodeType$$module$build$src$core$utils$dom . ELEMENT _NODE && ( k = createElement$$module$build$src$core$utils$xml ( "next" ) ,
k . appendChild ( d ) , c . appendChild ( k ) ) ) ; a = a . nextConnection && a . nextConnection . getShadowDom ( ) ; ! a || h && h . isShadow ( ) || k . appendChild ( cloneShadow$$module$build$src$core$xml ( a , b ) ) ; return c } , cloneShadow$$module$build$src$core$xml = function ( a , b ) { let c = a = a . cloneNode ( ! 0 ) , d ; for ( ; c ; ) if ( b && "shadow" === c . nodeName && c . removeAttribute ( "id" ) , c . firstChild ) c = c . firstChild ; else { for ( ; c && ! c . nextSibling ; ) { d = c ; c = c . parentNode ; let e ; d . nodeType === NodeType$$module$build$src$core$utils$dom . TEXT _NODE && "" === d . data . trim ( ) && ( null == ( e = c ) ? void 0 :
e . firstChild ) !== d && removeNode$$module$build$src$core$utils$dom ( d ) } c && ( d = c , c = c . nextSibling , d . nodeType === NodeType$$module$build$src$core$utils$dom . TEXT _NODE && "" === d . data . trim ( ) && removeNode$$module$build$src$core$utils$dom ( d ) ) } return a } , domToText$$module$build$src$core$xml = function ( a ) { return domToText$$module$build$src$core$utils$xml ( a ) . replace ( /<(\w+)([^<]*)\/>/g , "<$1$2></$1>" ) } , domToPrettyText$$module$build$src$core$xml = function ( a ) { a = domToText$$module$build$src$core$xml ( a ) . split ( "<" ) ; let b = "" ; for ( let c =
1 ; c < a . length ; c ++ ) { const d = a [ c ] ; "/" === d [ 0 ] && ( b = b . substring ( 2 ) ) ; a [ c ] = b + "<" + d ; "/" !== d [ 0 ] && "/>" !== d . slice ( - 2 ) && ( b += " " ) } a = a . join ( "\n" ) ; a = a . replace ( /(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g , "$1</$2>" ) ; return a . replace ( /^\n/ , "" ) } , textToDom$$module$build$src$core$xml = function ( a ) { const b = textToDomDocument$$module$build$src$core$utils$xml ( a ) ; if ( ! b || ! b . documentElement || b . getElementsByTagName ( "parsererror" ) . length ) throw Error ( "textToDom was unable to parse: " + a ) ; return b . documentElement } , clearWorkspaceAndLoadFromXml$$module$build$src$core$xml =
function ( a , b ) { b . setResizesEnabled ( ! 1 ) ; b . clear ( ) ; a = domToWorkspace$$module$build$src$core$xml ( a , b ) ; b . setResizesEnabled ( ! 0 ) ; return a } , domToWorkspace$$module$build$src$core$xml = function ( a , b ) { let c = 0 ; b . RTL && ( c = b . getWidth ( ) ) ; const d = [ ] ; startTextWidthCache$$module$build$src$core$utils$dom ( ) ; const e = getGroup$$module$build$src$core$events$utils ( ) ; e || setGroup$$module$build$src$core$events$utils ( ! 0 ) ; b . setResizesEnabled && b . setResizesEnabled ( ! 1 ) ; let f = ! 0 ; try { for ( let g = 0 , h ; h = a . childNodes [ g ] ; g ++ ) { const k = h . nodeName . toLowerCase ( ) ,
l = h ; if ( "block" === k || "shadow" === k && ! getRecordUndo$$module$build$src$core$events$utils ( ) ) { const m = domToBlock$$module$build$src$core$xml ( l , b ) ; d . push ( m . id ) ; const n = l . hasAttribute ( "x" ) ? parseInt ( l . getAttribute ( "x" ) ) : 10 , p = l . hasAttribute ( "y" ) ? parseInt ( l . getAttribute ( "y" ) ) : 10 ; isNaN ( n ) || isNaN ( p ) || m . moveBy ( b . RTL ? c - n : n , p ) ; f = ! 1 } else { if ( "shadow" === k ) throw TypeError ( "Shadow block cannot be a top-level block." ) ; if ( "comment" === k ) b . rendered ? WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg . fromXmlRendered ( l ,
b , c ) : WorkspaceComment$$module$build$src$core$workspace _comment . fromXml ( l , b ) ; else if ( "variables" === k ) { if ( f ) domToVariables$$module$build$src$core$xml ( l , b ) ; else throw Error ( "'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location." ) ; f = ! 1 } } } } finally { e || setGroup$$module$build$src$core$events$utils ( ! 1 ) , stopTextWidthCache$$module$build$src$core$utils$dom ( ) } b . setResizesEnabled && b . setResizesEnabled ( ! 0 ) ; fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( FINISHED _LOADING$$module$build$src$core$events$utils ) ) ( b ) ) ;
return d } , appendDomToWorkspace$$module$build$src$core$xml = function ( a , b ) { if ( ! b . getBlocksBoundingBox ) return domToWorkspace$$module$build$src$core$xml ( a , b ) ; var c = b . getBlocksBoundingBox ( ) ; a = domToWorkspace$$module$build$src$core$xml ( a , b ) ; if ( c && c . top !== c . bottom ) { var d = c . bottom ; c = b . RTL ? c . right : c . left ; var e = Infinity ; let f = - Infinity , g = Infinity ; for ( let h = 0 ; h < a . length ; h ++ ) { const k = b . getBlockById ( a [ h ] ) . getRelativeToSurfaceXY ( ) ; k . y < g && ( g = k . y ) ; k . x < e && ( e = k . x ) ; k . x > f && ( f = k . x ) } d = d - g + 10 ; c = b . RTL ? c - f : c - e ; for ( e = 0 ; e < a . length ; e ++ ) b . getBlockById ( a [ e ] ) . moveBy ( c ,
d ) } return a } , domToBlock$$module$build$src$core$xml = function ( a , b ) { disable$$module$build$src$core$events$utils ( ) ; var c = b . getAllVariables ( ) ; let d ; try { if ( d = domToBlockHeadless$$module$build$src$core$xml ( a , b ) , b . rendered ) { const e = d , f = d . getDescendants ( ! 1 ) ; e . setConnectionTracking ( ! 1 ) ; for ( let g = f . length - 1 ; 0 <= g ; g -- ) f [ g ] . initSvg ( ) ; for ( let g = f . length - 1 ; 0 <= g ; g -- ) f [ g ] . render ( ! 1 ) ; setTimeout ( function ( ) { e . disposed || e . setConnectionTracking ( ! 0 ) } , 1 ) ; e . updateDisabled ( ) ; b . resizeContents ( ) } else { const e = d . getDescendants ( ! 1 ) ;
for ( let f = e . length - 1 ; 0 <= f ; f -- ) e [ f ] . initModel ( ) } } finally { enable$$module$build$src$core$events$utils ( ) } if ( isEnabled$$module$build$src$core$events$utils ( ) ) { a = getAddedVariables$$module$build$src$core$variables ( b , c ) ; for ( b = 0 ; b < a . length ; b ++ ) c = a [ b ] , fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( VAR _CREATE$$module$build$src$core$events$utils ) ) ( c ) ) ; fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( CREATE$$module$build$src$core$events$utils ) ) ( d ) ) } return d } ,
domToVariables$$module$build$src$core$xml = function ( a , b ) { for ( let c = 0 ; c < a . children . length ; c ++ ) { const d = a . children [ c ] , e = d . getAttribute ( "type" ) , f = d . getAttribute ( "id" ) ; b . createVariable ( d . textContent , e , f ) } } , mapSupportedXmlTags$$module$build$src$core$xml = function ( a ) { const b = { mutation : [ ] , comment : [ ] , data : [ ] , field : [ ] , input : [ ] , next : [ ] } ; for ( let c = 0 ; c < a . children . length ; c ++ ) { const d = a . children [ c ] ; if ( d . nodeType !== NodeType$$module$build$src$core$utils$dom . TEXT _NODE ) switch ( d . nodeName . toLowerCase ( ) ) { case "mutation" : b . mutation . push ( d ) ;
break ; case "comment" : b . comment . push ( d ) ; break ; case "data" : b . data . push ( d ) ; break ; case "title" : case "field" : b . field . push ( d ) ; break ; case "value" : case "statement" : b . input . push ( d ) ; break ; case "next" : b . next . push ( d ) ; break ; default : console . warn ( "Ignoring unknown tag: " + d . nodeName ) } } return b } , applyMutationTagNodes$$module$build$src$core$xml = function ( a , b ) { let c = ! 1 ; for ( let d = 0 ; d < a . length ; d ++ ) { const e = a [ d ] ; b . domToMutation && ( b . domToMutation ( e ) , b . initSvg && ( c = ! 0 ) ) } return c } , applyCommentTagNodes$$module$build$src$core$xml =
function ( a , b ) { for ( let d = 0 ; d < a . length ; d ++ ) { var c = a [ d ] ; const e = c . textContent , f = "true" === c . getAttribute ( "pinned" ) , g = parseInt ( c . getAttribute ( "w" ) ) ; c = parseInt ( c . getAttribute ( "h" ) ) ; b . setCommentText ( e ) ; b . commentModel . pinned = f ; isNaN ( g ) || isNaN ( c ) || ( b . commentModel . size = new Size$$module$build$src$core$utils$size ( g , c ) ) ; if ( f && b . getCommentIcon && ! b . isInFlyout ) { const h = b ; setTimeout ( function ( ) { h . getCommentIcon ( ) . setVisible ( ! 0 ) } , 1 ) } } } , applyDataTagNodes$$module$build$src$core$xml = function ( a , b ) { for ( let c = 0 ; c < a . length ; c ++ ) b . data =
a [ c ] . textContent } , applyFieldTagNodes$$module$build$src$core$xml = function ( a , b ) { for ( let c = 0 ; c < a . length ; c ++ ) { const d = a [ c ] , e = d . getAttribute ( "name" ) ; domToField$$module$build$src$core$xml ( b , e , d ) } } , findChildBlocks$$module$build$src$core$xml = function ( a ) { const b = { childBlockElement : null , childShadowElement : null } ; for ( let c = 0 ; c < a . childNodes . length ; c ++ ) { const d = a . childNodes [ c ] ; d . nodeType === NodeType$$module$build$src$core$utils$dom . ELEMENT _NODE && ( "block" === d . nodeName . toLowerCase ( ) ? b . childBlockElement = d : "shadow" ===
d . nodeName . toLowerCase ( ) && ( b . childShadowElement = d ) ) } return b } , applyInputTagNodes$$module$build$src$core$xml = function ( a , b , c , d ) { for ( let f = 0 ; f < a . length ; f ++ ) { var e = a [ f ] ; const g = e . getAttribute ( "name" ) , h = c . getInput ( g ) ; if ( ! h ) { console . warn ( "Ignoring non-existent input " + g + " in block " + d ) ; break } e = findChildBlocks$$module$build$src$core$xml ( e ) ; if ( e . childBlockElement ) { if ( ! h . connection ) throw TypeError ( "Input connection does not exist." ) ; domToBlockHeadless$$module$build$src$core$xml ( e . childBlockElement , b , h . connection ,
! 1 ) } if ( e . childShadowElement ) { let k ; null == ( k = h . connection ) || k . setShadowDom ( e . childShadowElement ) } } } , applyNextTagNodes$$module$build$src$core$xml = function ( a , b , c ) { for ( let d = 0 ; d < a . length ; d ++ ) { const e = findChildBlocks$$module$build$src$core$xml ( a [ d ] ) ; if ( e . childBlockElement ) { if ( ! c . nextConnection ) throw TypeError ( "Next statement does not exist." ) ; if ( c . nextConnection . isConnected ( ) ) throw TypeError ( "Next statement is already connected." ) ; domToBlockHeadless$$module$build$src$core$xml ( e . childBlockElement , b , c . nextConnection ,
! 0 ) } e . childShadowElement && c . nextConnection && c . nextConnection . setShadowDom ( e . childShadowElement ) } } , domToBlockHeadless$$module$build$src$core$xml = function ( a , b , c , d ) { const e = a . getAttribute ( "type" ) ; if ( ! e ) throw TypeError ( "Block type unspecified: " + a . outerHTML ) ; var f = a . getAttribute ( "id" ) ; f = b . newBlock ( e , f ) ; const g = mapSupportedXmlTags$$module$build$src$core$xml ( a ) , h = applyMutationTagNodes$$module$build$src$core$xml ( g . mutation , f ) ; applyCommentTagNodes$$module$build$src$core$xml ( g . comment , f ) ; applyDataTagNodes$$module$build$src$core$xml ( g . data ,
f ) ; if ( c ) if ( d ) if ( f . previousConnection ) c . connect ( f . previousConnection ) ; else throw TypeError ( "Next block does not have previous statement." ) ; else if ( f . outputConnection ) c . connect ( f . outputConnection ) ; else if ( f . previousConnection ) c . connect ( f . previousConnection ) ; else throw TypeError ( "Child block does not have output or previous statement." ) ; applyFieldTagNodes$$module$build$src$core$xml ( g . field , f ) ; applyInputTagNodes$$module$build$src$core$xml ( g . input , b , f , e ) ; applyNextTagNodes$$module$build$src$core$xml ( g . next ,
b , f ) ; h && f . initSvg ( ) ; ( b = a . getAttribute ( "inline" ) ) && f . setInputsInline ( "true" === b ) ; ( b = a . getAttribute ( "disabled" ) ) && f . setEnabled ( "true" !== b && "disabled" !== b ) ; ( b = a . getAttribute ( "deletable" ) ) && f . setDeletable ( "true" === b ) ; ( b = a . getAttribute ( "movable" ) ) && f . setMovable ( "true" === b ) ; ( b = a . getAttribute ( "editable" ) ) && f . setEditable ( "true" === b ) ; ( b = a . getAttribute ( "collapsed" ) ) && f . setCollapsed ( "true" === b ) ; if ( "shadow" === a . nodeName . toLowerCase ( ) ) { a = f . getChildren ( ! 1 ) ; for ( b = 0 ; b < a . length ; b ++ ) if ( ! a [ b ] . isShadow ( ) ) throw TypeError ( "Shadow block not allowed non-shadow child." ) ;
if ( f . getVarModels ( ) . length ) throw TypeError ( "Shadow blocks cannot have variable references." ) ; f . setShadow ( ! 0 ) } return f } , domToField$$module$build$src$core$xml = function ( a , b , c ) { const d = a . getField ( b ) ; d ? d . fromXml ( c ) : console . warn ( "Ignoring non-existent field " + b + " in block " + a . type ) } , deleteNext$$module$build$src$core$xml = function ( a ) { for ( let b = 0 ; b < a . childNodes . length ; b ++ ) { const c = a . childNodes [ b ] ; if ( "next" === c . nodeName . toLowerCase ( ) ) { a . removeChild ( c ) ; break } } } , startsWith$$module$build$src$core$utils$string =
function ( a , b ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.string.startsWith()" , "April 2022" , "April 2023" , "Use built-in string.startsWith" ) ; return a . startsWith ( b ) } , shortestStringLength$$module$build$src$core$utils$string = function ( a ) { return a . length ? a . reduce ( function ( b , c ) { return b . length < c . length ? b : c } ) . length : 0 } , commonWordPrefix$$module$build$src$core$utils$string = function ( a , b ) { if ( ! a . length ) return 0 ; if ( 1 === a . length ) return a [ 0 ] . length ; let c = 0 ; b = b || shortestStringLength$$module$build$src$core$utils$string ( a ) ;
let d ; for ( d = 0 ; d < b ; d ++ ) { var e = a [ 0 ] [ d ] ; for ( var f = 1 ; f < a . length ; f ++ ) if ( e !== a [ f ] [ d ] ) return c ; " " === e && ( c = d + 1 ) } for ( e = 1 ; e < a . length ; e ++ ) if ( ( f = a [ e ] [ d ] ) && " " !== f ) return c ; return b } , commonWordSuffix$$module$build$src$core$utils$string = function ( a , b ) { if ( ! a . length ) return 0 ; if ( 1 === a . length ) return a [ 0 ] . length ; let c = 0 ; b = b || shortestStringLength$$module$build$src$core$utils$string ( a ) ; let d ; for ( d = 0 ; d < b ; d ++ ) { var e = a [ 0 ] . substr ( - d - 1 , 1 ) ; for ( var f = 1 ; f < a . length ; f ++ ) if ( e !== a [ f ] . substr ( - d - 1 , 1 ) ) return c ; " " === e && ( c = d + 1 ) } for ( e =
1 ; e < a . length ; e ++ ) if ( ( f = a [ e ] . charAt ( a [ e ] . length - d - 1 ) ) && " " !== f ) return c ; return b } , wrap$$module$build$src$core$utils$string = function ( a , b ) { a = a . split ( "\n" ) ; for ( let c = 0 ; c < a . length ; c ++ ) a [ c ] = wrapLine$$module$build$src$core$utils$string ( a [ c ] , b ) ; return a . join ( "\n" ) } , wrapLine$$module$build$src$core$utils$string = function ( a , b ) { if ( a . length <= b ) return a ; const c = a . trim ( ) . split ( /\s+/ ) ; for ( var d = 0 ; d < c . length ; d ++ ) c [ d ] . length > b && ( b = c [ d ] . length ) ; var e = - Infinity ; let f , g = 1 ; do { d = e ; f = a ; a = [ ] ; e = c . length / g ; let h = 1 ; for ( let k =
0 ; k < c . length - 1 ; k ++ ) h < ( k + 1.5 ) / e ? ( h ++ , a [ k ] = ! 0 ) : a [ k ] = ! 1 ; a = wrapMutate$$module$build$src$core$utils$string ( c , a , b ) ; e = wrapScore$$module$build$src$core$utils$string ( c , a , b ) ; a = wrapToText$$module$build$src$core$utils$string ( c , a ) ; g ++ } while ( e > d ) ; return f } , wrapScore$$module$build$src$core$utils$string = function ( a , b , c ) { const d = [ 0 ] , e = [ ] ; for ( var f = 0 ; f < a . length ; f ++ ) d [ d . length - 1 ] += a [ f ] . length , ! 0 === b [ f ] ? ( d . push ( 0 ) , e . push ( a [ f ] . charAt ( a [ f ] . length - 1 ) ) ) : ! 1 === b [ f ] && d [ d . length - 1 ] ++ ; a = Math . max ( ... d ) ; b = 0 ; for ( f = 0 ; f < d . length ; f ++ ) b -=
2 * Math . pow ( Math . abs ( c - d [ f ] ) , 1.5 ) , b -= Math . pow ( a - d [ f ] , 1.5 ) , - 1 !== ".?!" . indexOf ( e [ f ] ) ? b += c / 3 : - 1 !== ",;)]}" . indexOf ( e [ f ] ) && ( b += c / 4 ) ; 1 < d . length && d [ d . length - 1 ] <= d [ d . length - 2 ] && ( b += . 5 ) ; return b } , wrapMutate$$module$build$src$core$utils$string = function ( a , b , c ) { let d = wrapScore$$module$build$src$core$utils$string ( a , b , c ) , e ; for ( let f = 0 ; f < b . length - 1 ; f ++ ) { if ( b [ f ] === b [ f + 1 ] ) continue ; const g = [ ] . concat ( b ) ; g [ f ] = ! g [ f ] ; g [ f + 1 ] = ! g [ f + 1 ] ; const h = wrapScore$$module$build$src$core$utils$string ( a , g , c ) ; h > d && ( d = h , e = g ) } return e ? wrapMutate$$module$build$src$core$utils$string ( a ,
e , c ) : b } , wrapToText$$module$build$src$core$utils$string = function ( a , b ) { const c = [ ] ; for ( let d = 0 ; d < a . length ; d ++ ) c . push ( a [ d ] ) , void 0 !== b [ d ] && c . push ( b [ d ] ? "\n" : " " ) ; return c . join ( "" ) } , isNumber$$module$build$src$core$utils$string = function ( a ) { return /^\s*-?\d+(\.\d+)?\s*$/ . test ( a ) } , setCustomTooltip$$module$build$src$core$tooltip = function ( a ) { customTooltip$$module$build$src$core$tooltip = a } , getCustomTooltip$$module$build$src$core$tooltip = function ( ) { return customTooltip$$module$build$src$core$tooltip } , isVisible$$module$build$src$core$tooltip =
function ( ) { return visible$$module$build$src$core$tooltip } , getDiv$$module$build$src$core$tooltip = function ( ) { return containerDiv$$module$build$src$core$tooltip } , getTooltipOfObject$$module$build$src$core$tooltip = function ( a ) { if ( a = getTargetObject$$module$build$src$core$tooltip ( a ) ) { for ( a = a . tooltip ; "function" === typeof a ; ) a = a ( ) ; if ( "string" !== typeof a ) throw Error ( "Tooltip function must return a string." ) ; return a } return "" } , getTargetObject$$module$build$src$core$tooltip = function ( a ) { for ( ; a && a . tooltip ; ) { if ( "string" ===
typeof a . tooltip || "function" === typeof a . tooltip ) return a ; a = a . tooltip } return null } , createDom$$module$build$src$core$tooltip = function ( ) { containerDiv$$module$build$src$core$tooltip || ( containerDiv$$module$build$src$core$tooltip = document . createElement ( "div" ) , containerDiv$$module$build$src$core$tooltip . className = "blocklyTooltipDiv" , ( getParentContainer$$module$build$src$core$common ( ) || document . body ) . appendChild ( containerDiv$$module$build$src$core$tooltip ) ) } , bindMouseEvents$$module$build$src$core$tooltip =
function ( a ) { a . mouseOverWrapper _ = bind$$module$build$src$core$browser _events ( a , "mouseover" , null , onMouseOver$$module$build$src$core$tooltip ) ; a . mouseOutWrapper _ = bind$$module$build$src$core$browser _events ( a , "mouseout" , null , onMouseOut$$module$build$src$core$tooltip ) ; a . addEventListener ( "mousemove" , onMouseMove$$module$build$src$core$tooltip , ! 1 ) } , unbindMouseEvents$$module$build$src$core$tooltip = function ( a ) { a && ( unbind$$module$build$src$core$browser _events ( a . mouseOverWrapper _ ) , unbind$$module$build$src$core$browser _events ( a . mouseOutWrapper _ ) ,
a . removeEventListener ( "mousemove" , onMouseMove$$module$build$src$core$tooltip ) ) } , onMouseOver$$module$build$src$core$tooltip = function ( a ) { blocked$$module$build$src$core$tooltip || ( a = getTargetObject$$module$build$src$core$tooltip ( a . currentTarget ) , element$$module$build$src$core$tooltip !== a && ( hide$$module$build$src$core$tooltip ( ) , poisonedElement$$module$build$src$core$tooltip = null , element$$module$build$src$core$tooltip = a ) , clearTimeout ( mouseOutPid$$module$build$src$core$tooltip ) ) } , onMouseOut$$module$build$src$core$tooltip =
function ( a ) { blocked$$module$build$src$core$tooltip || ( mouseOutPid$$module$build$src$core$tooltip = setTimeout ( function ( ) { poisonedElement$$module$build$src$core$tooltip = element$$module$build$src$core$tooltip = null ; hide$$module$build$src$core$tooltip ( ) } , 1 ) , clearTimeout ( showPid$$module$build$src$core$tooltip ) ) } , onMouseMove$$module$build$src$core$tooltip = function ( a ) { if ( element$$module$build$src$core$tooltip && element$$module$build$src$core$tooltip . tooltip && ! blocked$$module$build$src$core$tooltip ) if ( visible$$module$build$src$core$tooltip ) { const b =
lastX$$module$build$src$core$tooltip - a . pageX ; a = lastY$$module$build$src$core$tooltip - a . pageY ; Math . sqrt ( b * b + a * a ) > RADIUS _OK$$module$build$src$core$tooltip && hide$$module$build$src$core$tooltip ( ) } else poisonedElement$$module$build$src$core$tooltip !== element$$module$build$src$core$tooltip && ( clearTimeout ( showPid$$module$build$src$core$tooltip ) , lastX$$module$build$src$core$tooltip = a . pageX , lastY$$module$build$src$core$tooltip = a . pageY , showPid$$module$build$src$core$tooltip = setTimeout ( show$$module$build$src$core$tooltip ,
HOVER _MS$$module$build$src$core$tooltip ) ) } , dispose$$module$build$src$core$tooltip = function ( ) { poisonedElement$$module$build$src$core$tooltip = element$$module$build$src$core$tooltip = null ; hide$$module$build$src$core$tooltip ( ) } , hide$$module$build$src$core$tooltip = function ( ) { visible$$module$build$src$core$tooltip && ( visible$$module$build$src$core$tooltip = ! 1 , containerDiv$$module$build$src$core$tooltip && ( containerDiv$$module$build$src$core$tooltip . style . display = "none" ) ) ; showPid$$module$build$src$core$tooltip &&
clearTimeout ( showPid$$module$build$src$core$tooltip ) } , block$$module$build$src$core$tooltip = function ( ) { hide$$module$build$src$core$tooltip ( ) ; blocked$$module$build$src$core$tooltip = ! 0 } , unblock$$module$build$src$core$tooltip = function ( ) { blocked$$module$build$src$core$tooltip = ! 1 } , renderContent$$module$build$src$core$tooltip = function ( ) { containerDiv$$module$build$src$core$tooltip && element$$module$build$src$core$tooltip && ( "function" === typeof customTooltip$$module$build$src$core$tooltip ? customTooltip$$module$build$src$core$tooltip ( containerDiv$$module$build$src$core$tooltip ,
element$$module$build$src$core$tooltip ) : renderDefaultContent$$module$build$src$core$tooltip ( ) ) } , renderDefaultContent$$module$build$src$core$tooltip = function ( ) { var a = getTooltipOfObject$$module$build$src$core$tooltip ( element$$module$build$src$core$tooltip ) ; a = wrap$$module$build$src$core$utils$string ( a , LIMIT$$module$build$src$core$tooltip ) ; a = a . split ( "\n" ) ; for ( let b = 0 ; b < a . length ; b ++ ) { const c = document . createElement ( "div" ) ; c . appendChild ( document . createTextNode ( a [ b ] ) ) ; containerDiv$$module$build$src$core$tooltip . appendChild ( c ) } } ,
getPosition$$module$build$src$core$tooltip = function ( a ) { const b = document . documentElement . clientWidth , c = document . documentElement . clientHeight ; let d = lastX$$module$build$src$core$tooltip ; d = a ? d - ( OFFSET _X$$module$build$src$core$tooltip + containerDiv$$module$build$src$core$tooltip . offsetWidth ) : d + OFFSET _X$$module$build$src$core$tooltip ; let e = lastY$$module$build$src$core$tooltip + OFFSET _Y$$module$build$src$core$tooltip ; e + containerDiv$$module$build$src$core$tooltip . offsetHeight > c + window . scrollY && ( e -= containerDiv$$module$build$src$core$tooltip . offsetHeight +
2 * OFFSET _Y$$module$build$src$core$tooltip ) ; a ? d = Math . max ( MARGINS$$module$build$src$core$tooltip - window . scrollX , d ) : d + containerDiv$$module$build$src$core$tooltip . offsetWidth > b + window . scrollX - 2 * MARGINS$$module$build$src$core$tooltip && ( d = b - containerDiv$$module$build$src$core$tooltip . offsetWidth - 2 * MARGINS$$module$build$src$core$tooltip ) ; return { x : d , y : e } } , show$$module$build$src$core$tooltip = function ( ) { if ( ! blocked$$module$build$src$core$tooltip && ( poisonedElement$$module$build$src$core$tooltip = element$$module$build$src$core$tooltip ,
containerDiv$$module$build$src$core$tooltip ) ) { containerDiv$$module$build$src$core$tooltip . textContent = "" ; renderContent$$module$build$src$core$tooltip ( ) ; var a = element$$module$build$src$core$tooltip . RTL ; containerDiv$$module$build$src$core$tooltip . style . direction = a ? "rtl" : "ltr" ; containerDiv$$module$build$src$core$tooltip . style . display = "block" ; visible$$module$build$src$core$tooltip = ! 0 ; var { x : b , y : c } = getPosition$$module$build$src$core$tooltip ( a ) ; containerDiv$$module$build$src$core$tooltip . style . left = b + "px" ;
containerDiv$$module$build$src$core$tooltip . style . top = c + "px" } } , getHsvSaturation$$module$build$src$core$utils$colour = function ( ) { return hsvSaturation$$module$build$src$core$utils$colour } , setHsvSaturation$$module$build$src$core$utils$colour = function ( a ) { hsvSaturation$$module$build$src$core$utils$colour = a } , getHsvValue$$module$build$src$core$utils$colour = function ( ) { return hsvValue$$module$build$src$core$utils$colour } , setHsvValue$$module$build$src$core$utils$colour = function ( a ) { hsvValue$$module$build$src$core$utils$colour =
a } , parse$$module$build$src$core$utils$colour = function ( a ) { a = String ( a ) . toLowerCase ( ) . trim ( ) ; var b = names$$module$build$src$core$utils$colour [ a ] ; if ( b ) return b ; b = "0x" === a . substring ( 0 , 2 ) ? "#" + a . substring ( 2 ) : a ; b = "#" === b [ 0 ] ? b : "#" + b ; if ( /^#[0-9a-f]{6}$/ . test ( b ) ) return b ; if ( /^#[0-9a-f]{3}$/ . test ( b ) ) return [ "#" , b [ 1 ] , b [ 1 ] , b [ 2 ] , b [ 2 ] , b [ 3 ] , b [ 3 ] ] . join ( "" ) ; var c = a . match ( /^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/ ) ; return c && ( a = Number ( c [ 1 ] ) , b = Number ( c [ 2 ] ) , c = Number ( c [ 3 ] ) , 0 <= a && 256 > a && 0 <= b && 256 > b && 0 <= c && 256 >
c ) ? rgbToHex$$module$build$src$core$utils$colour ( a , b , c ) : null } , rgbToHex$$module$build$src$core$utils$colour = function ( a , b , c ) { b = a << 16 | b << 8 | c ; return 16 > a ? "#" + ( 16777216 | b ) . toString ( 16 ) . substr ( 1 ) : "#" + b . toString ( 16 ) } , hexToRgb$$module$build$src$core$utils$colour = function ( a ) { a = parse$$module$build$src$core$utils$colour ( a ) ; if ( ! a ) return [ 0 , 0 , 0 ] ; a = parseInt ( a . substr ( 1 ) , 16 ) ; return [ a >> 16 , a >> 8 & 255 , a & 255 ] } , hsvToHex$$module$build$src$core$utils$colour = function ( a , b , c ) { let d = 0 , e = 0 , f = 0 ; if ( 0 === b ) f = e = d = c ; else { const g = Math . floor ( a /
60 ) , h = a / 60 - g ; a = c * ( 1 - b ) ; const k = c * ( 1 - b * h ) ; b = c * ( 1 - b * ( 1 - h ) ) ; switch ( g ) { case 1 : d = k ; e = c ; f = a ; break ; case 2 : d = a ; e = c ; f = b ; break ; case 3 : d = a ; e = k ; f = c ; break ; case 4 : d = b ; e = a ; f = c ; break ; case 5 : d = c ; e = a ; f = k ; break ; case 6 : case 0 : d = c , e = b , f = a } } return rgbToHex$$module$build$src$core$utils$colour ( Math . floor ( d ) , Math . floor ( e ) , Math . floor ( f ) ) } , blend$$module$build$src$core$utils$colour = function ( a , b , c ) { a = parse$$module$build$src$core$utils$colour ( a ) ; if ( ! a ) return null ; b = parse$$module$build$src$core$utils$colour ( b ) ; if ( ! b ) return null ;
a = hexToRgb$$module$build$src$core$utils$colour ( a ) ; b = hexToRgb$$module$build$src$core$utils$colour ( b ) ; return rgbToHex$$module$build$src$core$utils$colour ( Math . round ( b [ 0 ] + c * ( a [ 0 ] - b [ 0 ] ) ) , Math . round ( b [ 1 ] + c * ( a [ 1 ] - b [ 1 ] ) ) , Math . round ( b [ 2 ] + c * ( a [ 2 ] - b [ 2 ] ) ) ) } , hueToHex$$module$build$src$core$utils$colour = function ( a ) { return hsvToHex$$module$build$src$core$utils$colour ( a , hsvSaturation$$module$build$src$core$utils$colour , 255 * hsvValue$$module$build$src$core$utils$colour ) } , tokenizeInterpolationInternal$$module$build$src$core$utils$parsing =
function ( a , b ) { const c = [ ] ; var d = a . split ( "" ) ; d . push ( "" ) ; var e = 0 ; a = [ ] ; let f = null ; for ( let k = 0 ; k < d . length ; k ++ ) { var g = d [ k ] ; if ( 0 === e ) "%" === g ? ( ( e = a . join ( "" ) ) && c . push ( e ) , a . length = 0 , e = 1 ) : a . push ( g ) ; else if ( 1 === e ) "%" === g ? ( a . push ( g ) , e = 0 ) : b && "0" <= g && "9" >= g ? ( e = 2 , f = g , ( g = a . join ( "" ) ) && c . push ( g ) , a . length = 0 ) : "{" === g ? e = 3 : ( a . push ( "%" , g ) , e = 0 ) ; else if ( 2 === e ) if ( "0" <= g && "9" >= g ) f += g ; else { var h = void 0 ; c . push ( parseInt ( null != ( h = f ) ? h : "" , 10 ) ) ; k -- ; e = 0 } else 3 === e && ( "" === g ? ( a . splice ( 0 , 0 , "%{" ) , k -- , e = 0 ) : "}" !== g ? a . push ( g ) : ( e = a . join ( "" ) ,
/[A-Z]\w*/i . test ( e ) ? ( g = e . toUpperCase ( ) , ( g = g . startsWith ( "BKY_" ) ? g . substring ( 4 ) : null ) && g in Msg$$module$build$src$core$msg ? ( e = Msg$$module$build$src$core$msg [ g ] , "string" === typeof e ? Array . prototype . push . apply ( c , tokenizeInterpolationInternal$$module$build$src$core$utils$parsing ( e , b ) ) : b ? c . push ( String ( e ) ) : c . push ( e ) ) : c . push ( "%{" + e + "}" ) ) : c . push ( "%{" + e + "}" ) , e = a . length = 0 ) ) } ( b = a . join ( "" ) ) && c . push ( b ) ; h = [ ] ; a . length = 0 ; for ( d = 0 ; d < c . length ; d ++ ) "string" === typeof c [ d ] ? a . push ( c [ d ] ) : ( ( b = a . join ( "" ) ) && h . push ( b ) , a . length =
0 , h . push ( c [ d ] ) ) ; ( b = a . join ( "" ) ) && h . push ( b ) ; a . length = 0 ; return h } , tokenizeInterpolation$$module$build$src$core$utils$parsing = function ( a ) { return tokenizeInterpolationInternal$$module$build$src$core$utils$parsing ( a , ! 0 ) } , replaceMessageReferences$$module$build$src$core$utils$parsing = function ( a ) { if ( "string" !== typeof a ) return a ; a = tokenizeInterpolationInternal$$module$build$src$core$utils$parsing ( a , ! 1 ) ; return a . length ? String ( a [ 0 ] ) : "" } , checkMessageReferences$$module$build$src$core$utils$parsing = function ( a ) { let b =
! 0 ; const c = Msg$$module$build$src$core$msg , d = a . match ( /%{BKY_[A-Z]\w*}/ig ) ; if ( d ) for ( let e = 0 ; e < d . length ; e ++ ) { const f = d [ e ] . toUpperCase ( ) ; void 0 === c [ f . slice ( 6 , - 1 ) ] && ( console . warn ( "No message string for " + d [ e ] + " in " + a ) , b = ! 1 ) } return b } , parseBlockColour$$module$build$src$core$utils$parsing = function ( a ) { const b = "string" === typeof a ? replaceMessageReferences$$module$build$src$core$utils$parsing ( a ) : a ; var c = Number ( b ) ; if ( ! isNaN ( c ) && 0 <= c && 360 >= c ) return { hue : c , hex : hsvToHex$$module$build$src$core$utils$colour ( c , getHsvSaturation$$module$build$src$core$utils$colour ( ) ,
255 * getHsvValue$$module$build$src$core$utils$colour ( ) ) } ; if ( c = parse$$module$build$src$core$utils$colour ( b ) ) return { hue : null , hex : c } ; c = 'Invalid colour: "' + b + '"' ; a !== b && ( c += ' (from "' + a + '")' ) ; throw Error ( c ) ; } , getDiv$$module$build$src$core$widgetdiv = function ( ) { return containerDiv$$module$build$src$core$widgetdiv } , testOnly _setDiv$$module$build$src$core$widgetdiv = function ( a ) { containerDiv$$module$build$src$core$widgetdiv = a } , createDom$$module$build$src$core$widgetdiv = function ( ) { containerDiv$$module$build$src$core$widgetdiv ||
( containerDiv$$module$build$src$core$widgetdiv = document . createElement ( "div" ) , containerDiv$$module$build$src$core$widgetdiv . className = "blocklyWidgetDiv" , ( getParentContainer$$module$build$src$core$common ( ) || document . body ) . appendChild ( containerDiv$$module$build$src$core$widgetdiv ) ) } , show$$module$build$src$core$widgetdiv = function ( a , b , c ) { hide$$module$build$src$core$widgetdiv ( ) ; owner$$module$build$src$core$widgetdiv = a ; dispose$$module$build$src$core$widgetdiv = c ; if ( a = containerDiv$$module$build$src$core$widgetdiv ) a . style . direction =
b ? "rtl" : "ltr" , a . style . display = "block" , b = getMainWorkspace$$module$build$src$core$common ( ) , rendererClassName$$module$build$src$core$widgetdiv = b . getRenderer ( ) . getClassName ( ) , themeClassName$$module$build$src$core$widgetdiv = b . getTheme ( ) . getClassName ( ) , rendererClassName$$module$build$src$core$widgetdiv && addClass$$module$build$src$core$utils$dom ( a , rendererClassName$$module$build$src$core$widgetdiv ) , themeClassName$$module$build$src$core$widgetdiv && addClass$$module$build$src$core$utils$dom ( a , themeClassName$$module$build$src$core$widgetdiv ) } ,
hide$$module$build$src$core$widgetdiv = function ( ) { if ( isVisible$$module$build$src$core$widgetdiv ( ) ) { owner$$module$build$src$core$widgetdiv = null ; var a = containerDiv$$module$build$src$core$widgetdiv ; a && ( a . style . display = "none" , a . style . left = "" , a . style . top = "" , dispose$$module$build$src$core$widgetdiv && dispose$$module$build$src$core$widgetdiv ( ) , dispose$$module$build$src$core$widgetdiv = null , a . textContent = "" , rendererClassName$$module$build$src$core$widgetdiv && ( removeClass$$module$build$src$core$utils$dom ( a , rendererClassName$$module$build$src$core$widgetdiv ) ,
rendererClassName$$module$build$src$core$widgetdiv = "" ) , themeClassName$$module$build$src$core$widgetdiv && ( removeClass$$module$build$src$core$utils$dom ( a , themeClassName$$module$build$src$core$widgetdiv ) , themeClassName$$module$build$src$core$widgetdiv = "" ) , getMainWorkspace$$module$build$src$core$common ( ) . markFocused ( ) ) } } , isVisible$$module$build$src$core$widgetdiv = function ( ) { return ! ! owner$$module$build$src$core$widgetdiv } , hideIfOwner$$module$build$src$core$widgetdiv = function ( a ) { owner$$module$build$src$core$widgetdiv ===
a && hide$$module$build$src$core$widgetdiv ( ) } , positionInternal$$module$build$src$core$widgetdiv = function ( a , b , c ) { containerDiv$$module$build$src$core$widgetdiv . style . left = a + "px" ; containerDiv$$module$build$src$core$widgetdiv . style . top = b + "px" ; containerDiv$$module$build$src$core$widgetdiv . style . height = c + "px" } , positionWithAnchor$$module$build$src$core$widgetdiv = function ( a , b , c , d ) { const e = calculateY$$module$build$src$core$widgetdiv ( a , b , c ) ; a = calculateX$$module$build$src$core$widgetdiv ( a , b , c , d ) ; 0 > e ? positionInternal$$module$build$src$core$widgetdiv ( a ,
0 , c . height + e ) : positionInternal$$module$build$src$core$widgetdiv ( a , e , c . height ) } , calculateX$$module$build$src$core$widgetdiv = function ( a , b , c , d ) { return d ? Math . min ( Math . max ( b . right - c . width , a . left ) , a . right - c . width ) : Math . max ( Math . min ( b . left , a . right - c . width ) , a . left ) } , calculateY$$module$build$src$core$widgetdiv = function ( a , b , c ) { return b . bottom + c . height >= a . bottom ? b . top - c . height : b . bottom } , 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 ) ; if ( b ) { if ( "function" !== typeof b . fromJson ) throw new TypeError ( "returned Field was not a IRegistrableField" ) ;
return 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." ) ; return null } , 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 } ` ) } , validateOptions$$module$build$src$core$field _dropdown = function ( a ) { if ( ! Array . isArray ( a ) ) throw TypeError ( "FieldDropdown options must be an array." ) ; if ( ! a . length ) throw TypeError ( "FieldDropdown options must not be an empty array." ) ; let b = ! 1 ; for ( let c = 0 ; c < a . length ; c ++ ) { const d = a [ c ] ; Array . isArray ( d ) ? "string" !== typeof d [ 1 ] ? ( b = ! 0 , console . error ( "Invalid option[" + c + "]: Each FieldDropdown option id must be a string. Found " + d [ 1 ] + " in: " ,
d ) ) : d [ 0 ] && "string" !== typeof d [ 0 ] && "string" !== typeof d [ 0 ] . src && ( b = ! 0 , console . error ( "Invalid option[" + c + "]: Each FieldDropdown option must have a string label or image description. Found" + d [ 0 ] + " in: " , d ) ) : ( b = ! 0 , console . error ( "Invalid option[" + c + "]: Each FieldDropdown option must be an array. Found: " , d ) ) } if ( b ) throw TypeError ( "Found invalid FieldDropdown options." ) ; } , inherits$$module$build$src$core$utils$object = function ( a , b ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.object.inherits" ,
"version 9" , "version 10" ) ; a . superClass _ = b . prototype ; Object . setPrototypeOf ( a , b ) ; a . prototype = Object . create ( b . prototype ) ; a . prototype . constructor = a } , mixin$$module$build$src$core$utils$object = function ( a , b ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.object.mixin" , "May 2022" , "May 2023" , "Object.assign" ) ; for ( const c in b ) a [ c ] = b [ c ] } , 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 } , values$$module$build$src$core$utils$object = function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.object.values" , "version 9" , "version 10" , "Object.values" ) ; return Object . values ( a ) } , 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 < a . length && ! a [ 0 ] . nodeType ? a : xmlToJsonArray$$module$build$src$core$utils$toolbox ( a ) : [ ] } , hasCategories$$module$build$src$core$utils$toolbox = function ( a ) { return TEST _ONLY$$module$build$src$core$utils$toolbox . hasCategoriesInternal ( a ) } , hasCategoriesInternal$$module$build$src$core$utils$toolbox = function ( a ) { if ( ! a ) return ! 1 ; const b = a . kind ; return b ? b === CATEGORY _TOOLBOX _KIND$$module$build$src$core$utils$toolbox : ! ! a . contents . filter ( function ( c ) { return "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 && 0 < e . childNodes . length && ( a . contents = xmlToJsonArray$$module$build$src$core$utils$toolbox ( e ) ) ; addAttributes$$module$build$src$core$utils$toolbox ( e , a ) ; b . push ( a ) } return b } , addAttributes$$module$build$src$core$utils$toolbox = function ( a , b ) { for ( let c = 0 ; c < a . attributes . length ; c ++ ) { const d = a . attributes [ c ] ; - 1 < d . nodeName . indexOf ( "css-" ) ? ( b . cssconfig =
b . cssconfig || { } , b . cssconfig [ d . nodeName . replace ( "css-" , "" ) ] = d . value ) : b [ d . nodeName ] = d . value } } , parseToolboxTree$$module$build$src$core$utils$toolbox = function ( a ) { let b = null ; if ( a ) if ( "string" === typeof a ) { if ( b = textToDom$$module$build$src$core$xml ( a ) , "xml" !== b . nodeName . toLowerCase ( ) ) throw TypeError ( "Toolbox should be an <xml> document." ) ; } else a instanceof Element && ( b = a ) ; return b } , register$$module$build$src$core$extensions = function ( a , b ) { if ( "string" !== typeof a || "" === a . trim ( ) ) throw Error ( 'Error: Invalid extension name "' +
a + '"' ) ; if ( allExtensions$$module$build$src$core$extensions [ a ] ) throw Error ( 'Error: Extension "' + a + '" is already registered.' ) ; if ( "function" !== typeof b ) throw Error ( 'Error: Extension "' + a + '" must be a function' ) ; allExtensions$$module$build$src$core$extensions [ a ] = b } , registerMixin$$module$build$src$core$extensions = function ( a , b ) { if ( ! b || "object" !== typeof b ) throw Error ( 'Error: Mixin "' + a + '" must be a object' ) ; register$$module$build$src$core$extensions ( a , function ( ) { this . mixin ( b ) } ) } , registerMutator$$module$build$src$core$extensions =
function ( a , b , c , d ) { const e = 'Error when registering mutator "' + a + '": ' ; checkHasMutatorProperties$$module$build$src$core$extensions ( e , b ) ; const f = checkMutatorDialog$$module$build$src$core$extensions ( b , e ) ; if ( c && "function" !== typeof c ) throw Error ( e + 'Extension "' + a + '" is not a function' ) ; register$$module$build$src$core$extensions ( a , function ( ) { f && this . setMutator ( new $ . Mutator$$module$build$src$core$mutator ( d || [ ] , this ) ) ; this . mixin ( b ) ; c && c . apply ( this ) } ) } , unregister$$module$build$src$core$extensions = function ( a ) { isRegistered$$module$build$src$core$extensions ( a ) ?
delete allExtensions$$module$build$src$core$extensions [ a ] : console . warn ( 'No extension mapping for name "' + a + '" found to unregister' ) } , isRegistered$$module$build$src$core$extensions = function ( a ) { return ! ! allExtensions$$module$build$src$core$extensions [ a ] } , apply$$module$build$src$core$extensions = function ( a , b , c ) { const d = allExtensions$$module$build$src$core$extensions [ a ] ; if ( "function" !== typeof d ) throw Error ( 'Error: Extension "' + a + '" not found.' ) ; let e ; c ? checkNoMutatorProperties$$module$build$src$core$extensions ( a ,
b ) : e = getMutatorProperties$$module$build$src$core$extensions ( b ) ; d . apply ( b ) ; if ( c ) checkHasMutatorProperties$$module$build$src$core$extensions ( 'Error after applying mutator "' + a + '": ' , b ) ; else if ( ! mutatorPropertiesMatch$$module$build$src$core$extensions ( e , b ) ) throw Error ( 'Error when applying extension "' + a + '": mutation properties changed when applying a non-mutator extension.' ) ; } , checkNoMutatorProperties$$module$build$src$core$extensions = function ( a , b ) { if ( getMutatorProperties$$module$build$src$core$extensions ( b ) . length ) throw Error ( 'Error: tried to apply mutation "' +
a + '" to a block that already has mutator functions. Block id: ' + b . id ) ; } , checkXmlHooks$$module$build$src$core$extensions = function ( a , b ) { return checkHasFunctionPair$$module$build$src$core$extensions ( a . mutationToDom , a . domToMutation , b + " mutationToDom/domToMutation" ) } , checkJsonHooks$$module$build$src$core$extensions = function ( a , b ) { return checkHasFunctionPair$$module$build$src$core$extensions ( a . saveExtraState , a . loadExtraState , b + " saveExtraState/loadExtraState" ) } , checkMutatorDialog$$module$build$src$core$extensions =
function ( a , b ) { return checkHasFunctionPair$$module$build$src$core$extensions ( a . compose , a . decompose , b + " compose/decompose" ) } , checkHasFunctionPair$$module$build$src$core$extensions = function ( a , b , c ) { if ( a && b ) { if ( "function" !== typeof a || "function" !== typeof b ) throw Error ( c + " must be a function" ) ; return ! 0 } if ( ! a && ! b ) return ! 1 ; throw Error ( c + "Must have both or neither functions" ) ; } , checkHasMutatorProperties$$module$build$src$core$extensions = function ( a , b ) { const c = checkXmlHooks$$module$build$src$core$extensions ( b ,
a ) , d = checkJsonHooks$$module$build$src$core$extensions ( b , a ) ; if ( ! c && ! d ) throw Error ( a + "Mutations must contain either XML hooks, or JSON hooks, or both" ) ; checkMutatorDialog$$module$build$src$core$extensions ( b , a ) } , getMutatorProperties$$module$build$src$core$extensions = function ( a ) { const b = [ ] ; void 0 !== a . domToMutation && b . push ( a . domToMutation ) ; void 0 !== a . mutationToDom && b . push ( a . mutationToDom ) ; void 0 !== a . saveExtraState && b . push ( a . saveExtraState ) ; void 0 !== a . loadExtraState && b . push ( a . loadExtraState ) ; void 0 !== a . compose &&
b . push ( a . compose ) ; void 0 !== a . decompose && b . push ( a . decompose ) ; return b } , mutatorPropertiesMatch$$module$build$src$core$extensions = function ( a , b ) { b = getMutatorProperties$$module$build$src$core$extensions ( b ) ; if ( b . length !== a . length ) return ! 1 ; for ( let c = 0 ; c < b . length ; c ++ ) if ( a [ c ] !== b [ c ] ) return ! 1 ; return ! 0 } , runAfterPageLoad$$module$build$src$core$extensions = function ( a ) { if ( "object" !== typeof document ) throw Error ( "runAfterPageLoad() requires browser document." ) ; if ( "complete" === document . readyState ) a ( ) ; else { const b =
setInterval ( function ( ) { "complete" === document . readyState && ( clearInterval ( b ) , a ( ) ) } , 10 ) } } , buildTooltipForDropdown$$module$build$src$core$extensions = function ( a , b ) { const c = [ ] ; "object" === typeof document && runAfterPageLoad$$module$build$src$core$extensions ( function ( ) { for ( const d in b ) checkMessageReferences$$module$build$src$core$utils$parsing ( b [ d ] ) } ) ; return function ( ) { this . type && - 1 === c . indexOf ( this . type ) && ( checkDropdownOptionsInTable$$module$build$src$core$extensions ( this , a , b ) , c . push ( this . type ) ) ; this . setTooltip ( function ( ) { var d =
String ( this . getFieldValue ( a ) ) ; let e = b [ d ] ; null === e ? - 1 === c . indexOf ( this . type ) && ( d = "No tooltip mapping for value " + d + " of field " + a , null !== this . type && ( d += " of block type " + this . type ) , console . warn ( d + "." ) ) : e = replaceMessageReferences$$module$build$src$core$utils$parsing ( e ) ; return e } . 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 ( let e = 0 ; e < d . length ; e ++ ) { const f = d [ e ] [ 1 ] ; null === c [ f ] && console . warn ( "No tooltip mapping for value " + f + " of field " + b + " of block type " + a . type ) } } } , buildTooltipWithFieldText$$module$build$src$core$extensions = function ( a , b ) { "object" === typeof document && runAfterPageLoad$$module$build$src$core$extensions ( function ( ) { checkMessageReferences$$module$build$src$core$utils$parsing ( a ) } ) ; 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 ) ) } , removeElem$$module$build$src$core$utils$array = function ( a , b ) { b = a . indexOf ( b ) ; if ( - 1 === b ) return ! 1 ; a . splice ( b , 1 ) ; return ! 0 } , 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 } , getRelativeXY$$module$build$src$core$utils = function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.getRelativeXY" , "December 2021" , "December 2022" , "Blockly.utils.svgMath.getRelativeXY" ) ; return getRelativeXY$$module$build$src$core$utils$svg _math ( a ) } , getInjectionDivXY$$module$build$src$core$utils = function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.getInjectionDivXY_" , "December 2021" , "December 2022" , "Blockly.utils.svgMath.getInjectionDivXY" ) ;
return getInjectionDivXY$$module$build$src$core$utils$svg _math ( a ) } , tokenizeInterpolation$$module$build$src$core$utils = function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.tokenizeInterpolation" , "December 2021" , "December 2022" , "Blockly.utils.parsing.tokenizeInterpolation" ) ; return tokenizeInterpolation$$module$build$src$core$utils$parsing ( a ) } , replaceMessageReferences$$module$build$src$core$utils = function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.replaceMessageReferences" ,
"December 2021" , "December 2022" , "Blockly.utils.parsing.replaceMessageReferences" ) ; return replaceMessageReferences$$module$build$src$core$utils$parsing ( a ) } , checkMessageReferences$$module$build$src$core$utils = function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.checkMessageReferences" , "December 2021" , "December 2022" , "Blockly.utils.parsing.checkMessageReferences" ) ; return checkMessageReferences$$module$build$src$core$utils$parsing ( a ) } , is3dSupported$$module$build$src$core$utils = function ( ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.is3dSupported" ,
"December 2021" , "December 2022" , "Blockly.utils.svgMath.is3dSupported" ) ; return is3dSupported$$module$build$src$core$utils$svg _math ( ) } , getViewportBBox$$module$build$src$core$utils = function ( ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.getViewportBBox" , "December 2021" , "December 2022" , "Blockly.utils.svgMath.getViewportBBox" ) ; return getViewportBBox$$module$build$src$core$utils$svg _math ( ) } , arrayRemove$$module$build$src$core$utils = function ( a , b ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.arrayRemove" ,
"December 2021" , "December 2022" , "Blockly.array.removeElem" ) ; return removeElem$$module$build$src$core$utils$array ( a , b ) } , getDocumentScroll$$module$build$src$core$utils = function ( ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.getDocumentScroll" , "December 2021" , "December 2022" , "Blockly.utils.svgMath.getDocumentScroll" ) ; return getDocumentScroll$$module$build$src$core$utils$svg _math ( ) } , getBlockTypeCounts$$module$build$src$core$utils = function ( a , b ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.getBlockTypeCounts" ,
"December 2021" , "December 2022" , "Blockly.common.getBlockTypeCounts" ) ; return getBlockTypeCounts$$module$build$src$core$common ( a , b ) } , screenToWsCoordinates$$module$build$src$core$utils = function ( a , b ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.screenToWsCoordinates" , "December 2021" , "December 2022" , "Blockly.utils.svgMath.screenToWsCoordinates" ) ; return screenToWsCoordinates$$module$build$src$core$utils$svg _math ( a , b ) } , parseBlockColour$$module$build$src$core$utils = function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.parseBlockColour" ,
"December 2021" , "December 2022" , "Blockly.utils.parsing.parseBlockColour" ) ; return parseBlockColour$$module$build$src$core$utils$parsing ( a ) } , runAfterPageLoad$$module$build$src$core$utils = function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.utils.runAfterPageLoad" , "December 2021" , "December 2022" ) ; runAfterPageLoad$$module$build$src$core$extensions ( a ) } , 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$blocks = function ( a , { addCoordinates : b = ! 1 , addInputBlocks : c = ! 0 , addNextBlocks : d = ! 0 , doFullSerialization : e = ! 0 } = { } ) { if ( a . isInsertionMarker ( ) ) return null ; const f = { type : a . type , id : a . id } ; b && saveCoords$$module$build$src$core$serialization$blocks ( a , f ) ; saveAttributes$$module$build$src$core$serialization$blocks ( a ,
f ) ; saveExtraState$$module$build$src$core$serialization$blocks ( a , f ) ; saveIcons$$module$build$src$core$serialization$blocks ( a , f ) ; saveFields$$module$build$src$core$serialization$blocks ( a , f , e ) ; c && saveInputBlocks$$module$build$src$core$serialization$blocks ( a , f , e ) ; d && saveNextBlocks$$module$build$src$core$serialization$blocks ( a , f , e ) ; return f } , saveAttributes$$module$build$src$core$serialization$blocks = function ( a , b ) { a . isCollapsed ( ) && ( b . collapsed = ! 0 ) ; a . isEnabled ( ) || ( b . enabled = ! 1 ) ; void 0 !== a . inputsInline && a . inputsInline !==
a . inputsInlineDefault && ( b . inline = a . inputsInline ) ; a . data && ( b . data = a . data ) } , saveCoords$$module$build$src$core$serialization$blocks = function ( a , b ) { const c = a . workspace ; a = a . getRelativeToSurfaceXY ( ) ; b . x = Math . round ( c . RTL ? c . getWidth ( ) - a . x : a . x ) ; b . y = Math . round ( a . y ) } , saveExtraState$$module$build$src$core$serialization$blocks = function ( a , b ) { a . saveExtraState ? ( a = a . saveExtraState ( ) , null !== a && ( b . extraState = a ) ) : a . mutationToDom && ( a = a . mutationToDom ( ) , null !== a && ( b . extraState = domToText$$module$build$src$core$xml ( a ) . replace ( ' xmlns="https://developers.google.com/blockly/xml"' ,
"" ) ) ) } , saveIcons$$module$build$src$core$serialization$blocks = function ( a , b ) { a . getCommentText ( ) && ( b . icons = { comment : { text : a . getCommentText ( ) , pinned : a . commentModel . pinned , height : Math . round ( a . commentModel . size . height ) , width : Math . round ( a . commentModel . size . width ) } } ) } , saveFields$$module$build$src$core$serialization$blocks = function ( a , b , c ) { const d = Object . create ( null ) ; for ( let e = 0 ; e < a . inputList . length ; e ++ ) { const f = a . inputList [ e ] ; for ( let g = 0 ; g < f . fieldRow . length ; g ++ ) { const h = f . fieldRow [ g ] ; h . isSerializable ( ) && ( d [ h . name ] =
h . saveState ( c ) ) } } Object . keys ( d ) . length && ( b . fields = d ) } , saveInputBlocks$$module$build$src$core$serialization$blocks = function ( a , b , c ) { const d = Object . create ( null ) ; for ( let e = 0 ; e < a . inputList . length ; e ++ ) { const f = a . inputList [ e ] ; if ( f . type === inputTypes$$module$build$src$core$input _types . DUMMY ) continue ; const g = saveConnection$$module$build$src$core$serialization$blocks ( f . connection , c ) ; g && ( d [ f . name ] = g ) } Object . keys ( d ) . length && ( b . inputs = d ) } , saveNextBlocks$$module$build$src$core$serialization$blocks = function ( a , b ,
c ) { a . nextConnection && ( a = saveConnection$$module$build$src$core$serialization$blocks ( a . nextConnection , c ) ) && ( b . next = a ) } , saveConnection$$module$build$src$core$serialization$blocks = function ( a , b ) { const c = a . getShadowState ( ! 0 ) ; a = a . targetBlock ( ) ; if ( ! c && ! a ) return null ; const d = Object . create ( null ) ; c && ( d . shadow = c ) ; a && ! a . isShadow ( ) && ( d . block = save$$module$build$src$core$serialization$blocks ( a , { doFullSerialization : b } ) ) ; return d } , append$$module$build$src$core$serialization$blocks = function ( a , b , { recordUndo : c = ! 1 } = { } ) { return appendInternal$$module$build$src$core$serialization$blocks ( a ,
b , { recordUndo : c } ) } , 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 = appendPrivate$$module$build$src$core$serialization$blocks ( a , b , { parentConnection : c , isShadow : d } ) ;
enable$$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 ) ) ( g ) ) ; setGroup$$module$build$src$core$events$utils ( e ) ; setRecordUndo$$module$build$src$core$events$utils ( f ) ; b . rendered && setTimeout ( ( ) => { g . disposed || g . setConnectionTracking ( ! 0 ) } , 1 ) ; return g } , 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 } , loadCoords$$module$build$src$core$serialization$blocks = function ( a , b ) { let c = void 0 === b . x ? 0 : b . x ; b = void 0 === b . y ? 0 : b . y ; const d = a . workspace ; c = d . RTL ? d . getWidth ( ) - c : c ; a . moveBy ( c , b ) } , loadAttributes$$module$build$src$core$serialization$blocks = function ( a , b ) { b . collapsed && a . setCollapsed ( ! 0 ) ; ! 1 === b . enabled && a . setEnabled ( ! 1 ) ; void 0 !== b . inline && a . setInputsInline ( b . inline ) ; void 0 !== b . data && ( a . data = b . data ) } , loadExtraState$$module$build$src$core$serialization$blocks =
function ( a , b ) { b . extraState && ( a . loadExtraState ? a . loadExtraState ( b . extraState ) : a . domToMutation && a . domToMutation ( textToDom$$module$build$src$core$xml ( b . extraState ) ) ) } , tryToConnectParent$$module$build$src$core$serialization$blocks = function ( a , b , c ) { if ( a ) { if ( a . getSourceBlock ( ) . isShadow ( ) && ! b . isShadow ( ) ) throw new RealChildOfShadow$$module$build$src$core$serialization$exceptions ( c ) ; if ( a . type === inputTypes$$module$build$src$core$input _types . VALUE ) { var d = b . outputConnection ; if ( ! d ) throw new MissingConnection$$module$build$src$core$serialization$exceptions ( "output" ,
b , c ) ; } else if ( d = b . previousConnection , ! d ) throw new MissingConnection$$module$build$src$core$serialization$exceptions ( "previous" , b , c ) ; if ( ! a . connect ( d ) ) { const e = b . workspace . connectionChecker ; throw new BadConnectionCheck$$module$build$src$core$serialization$exceptions ( e . getErrorMessage ( e . canConnectWithReason ( d , a , ! 1 ) , d , a ) , a . type === inputTypes$$module$build$src$core$input _types . VALUE ? "output connection" : "previous connection" , b , c ) ; } } } , loadIcons$$module$build$src$core$serialization$blocks = function ( a , b ) { b . icons &&
( b = b . icons . comment ) && ( a . setCommentText ( b . text ) , "pinned" in b && ( a . commentModel . pinned = b . pinned ) , "width" in b && "height" in b && ( a . commentModel . size = new Size$$module$build$src$core$utils$size ( b . width , b . height ) ) , b . pinned && a . rendered && ! a . isInFlyout && setTimeout ( ( ) => a . getCommentIcon ( ) . setVisible ( ! 0 ) , 1 ) ) } , loadFields$$module$build$src$core$serialization$blocks = function ( a , b ) { if ( b . fields ) { var c = Object . keys ( b . fields ) ; for ( let d = 0 ; d < c . length ; d ++ ) { const e = c [ d ] , f = b . fields [ e ] , g = a . getField ( e ) ; g ? g . loadState ( f ) : console . warn ( ` Ignoring non-existant field ${ e } in block ${ a . type } ` ) } } } ,
loadInputBlocks$$module$build$src$core$serialization$blocks = function ( a , b ) { if ( b . inputs ) { var c = Object . keys ( b . inputs ) ; for ( let d = 0 ; d < c . length ; d ++ ) { const e = c [ d ] , f = a . getInput ( e ) ; if ( ! f || ! f . connection ) throw new MissingConnection$$module$build$src$core$serialization$exceptions ( e , a , b ) ; loadConnection$$module$build$src$core$serialization$blocks ( f . connection , b . inputs [ e ] ) } } } , loadNextBlocks$$module$build$src$core$serialization$blocks = function ( a , b ) { if ( b . next ) { if ( ! a . nextConnection ) throw new MissingConnection$$module$build$src$core$serialization$exceptions ( "next" ,
a , b ) ; loadConnection$$module$build$src$core$serialization$blocks ( a . nextConnection , b . next ) } } , loadConnection$$module$build$src$core$serialization$blocks = function ( a , b ) { b . shadow && a . setShadowState ( b . shadow ) ; b . block && appendPrivate$$module$build$src$core$serialization$blocks ( b . block , a . getSourceBlock ( ) . workspace , { parentConnection : a } ) } , initBlock$$module$build$src$core$serialization$blocks = function ( a , b ) { if ( b ) for ( a . setConnectionTracking ( ! 1 ) , a . initSvg ( ) , a . render ( ! 1 ) , a = a . getIcons ( ) , b = 0 ; b < a . length ; b ++ ) a [ b ] . computeIconLocation ( ) ;
else a . initModel ( ) } , 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 = b . getConnectionChecker ( ) ; for ( let e = 0 , f ; f = a . inputList [ e ] ; e ++ ) { const g = f . connection ; if ( g && d . canConnect ( b , g , ! 1 ) ) { if ( c ) return null ; c = g } } return c } , getConnectionForOrphanedOutput$$module$build$src$core$connection =
function ( a , b ) { let c ; for ( ; c = getSingleConnection$$module$build$src$core$connection ( a , b ) ; ) if ( a = c . targetBlock ( ) , ! a || a . isShadow ( ) ) return c ; return null } , getParentConnection$$module$build$src$core$keyboard _nav$ast _node = function ( a ) { let b = a . outputConnection ; if ( ! b || a . previousConnection && a . previousConnection . isConnected ( ) ) b = a . previousConnection ; return b } , disposeUiEffect$$module$build$src$core$block _animations = function ( a ) { const b = a . workspace ; var c = a . getSvgRoot ( ) ; b . getAudioManager ( ) . play ( "delete" ) ; const d = b . getSvgXY ( c ) ;
c = c . cloneNode ( ! 0 ) ; c . setAttribute ( "transform" , "translate(" + d . x + "," + d . y + ")" ) ; b . getParentSvg ( ) . appendChild ( c ) ; disposeUiStep$$module$build$src$core$block _animations ( c , { x : d . x , y : d . y , width : a . width , height : a . height } , b . RTL , new Date , b . scale ) } , disposeUiStep$$module$build$src$core$block _animations = function ( a , b , c , d , e ) { const f = ( ( new Date ) . getTime ( ) - d . getTime ( ) ) / 150 ; 1 < f ? removeNode$$module$build$src$core$utils$dom ( a ) : ( a . setAttribute ( "transform" , "translate(" + ( b . x + ( c ? - 1 : 1 ) * b . width * e / 2 * f ) + "," + ( b . y + b . height * e * f ) + ") scale(" +
( 1 - f ) * e + ")" ) , setTimeout ( disposeUiStep$$module$build$src$core$block _animations , 10 , a , b , c , d , e ) ) } , connectionUiEffect$$module$build$src$core$block _animations = function ( a ) { const b = a . workspace , c = b . scale ; b . getAudioManager ( ) . play ( "click" ) ; if ( ! ( 1 > c ) ) { var d = b . getSvgXY ( a . getSvgRoot ( ) ) ; a . outputConnection ? ( d . x += ( a . RTL ? 3 : - 3 ) * c , d . y += 13 * c ) : a . previousConnection && ( d . x += ( a . RTL ? - 23 : 23 ) * c , d . y += 3 * c ) ; a = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . CIRCLE , { cx : d . x , cy : d . y , r : 0 , fill : "none" ,
stroke : "#888" , "stroke-width" : 10 } , b . getParentSvg ( ) ) ; connectionUiStep$$module$build$src$core$block _animations ( a , new Date , c ) } } , connectionUiStep$$module$build$src$core$block _animations = function ( a , b , c ) { const d = ( ( new Date ) . getTime ( ) - b . getTime ( ) ) / 150 ; 1 < d ? removeNode$$module$build$src$core$utils$dom ( a ) : ( a . setAttribute ( "r" , ( 25 * d * c ) . toString ( ) ) , a . style . opacity = ( 1 - d ) . toString ( ) , disconnectPid$$module$build$src$core$block _animations = setTimeout ( connectionUiStep$$module$build$src$core$block _animations , 10 , a , b , c ) ) } ,
disconnectUiEffect$$module$build$src$core$block _animations = function ( a ) { disconnectUiStop$$module$build$src$core$block _animations ( ) ; a . workspace . getAudioManager ( ) . play ( "disconnect" ) ; if ( ! ( 1 > a . workspace . scale ) ) { var b = a . getHeightWidth ( ) . height ; b = Math . atan ( 10 / b ) / Math . PI * 180 ; a . RTL || ( b *= - 1 ) ; disconnectGroup$$module$build$src$core$block _animations = a . getSvgRoot ( ) ; disconnectUiStep$$module$build$src$core$block _animations ( disconnectGroup$$module$build$src$core$block _animations , b , new Date ) } } , disconnectUiStep$$module$build$src$core$block _animations =
function ( a , b , c ) { const d = ( ( new Date ) . getTime ( ) - c . getTime ( ) ) / 200 ; let e = "" ; 1 >= 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 . skew _ = e ; a . setAttribute ( "transform" , a . translate _ + a . skew _ ) } , disconnectUiStop$$module$build$src$core$block _animations = function ( ) { if ( disconnectGroup$$module$build$src$core$block _animations ) { disconnectPid$$module$build$src$core$block _animations &&
clearTimeout ( disconnectPid$$module$build$src$core$block _animations ) ; const a = disconnectGroup$$module$build$src$core$block _animations ; a . skew _ = "" ; a . setAttribute ( "transform" , a . translate _ ) ; disconnectGroup$$module$build$src$core$block _animations = null } } , copy$$module$build$src$core$clipboard = function ( a ) { TEST _ONLY$$module$build$src$core$clipboard . copyInternal ( a ) } , copyInternal$$module$build$src$core$clipboard = function ( a ) { copyData$$module$build$src$core$clipboard = a . toCopyData ( ) } , paste$$module$build$src$core$clipboard =
function ( ) { if ( ! copyData$$module$build$src$core$clipboard ) return null ; let a = copyData$$module$build$src$core$clipboard . source ; a . isFlyout && ( a = a . targetWorkspace ) ; return copyData$$module$build$src$core$clipboard . typeCounts && a . isCapacityAvailable ( copyData$$module$build$src$core$clipboard . typeCounts ) ? a . paste ( copyData$$module$build$src$core$clipboard . saveInfo ) : null } , duplicate$$module$build$src$core$clipboard = function ( a ) { return TEST _ONLY$$module$build$src$core$clipboard . duplicateInternal ( a ) } , duplicateInternal$$module$build$src$core$clipboard =
function ( a ) { const b = copyData$$module$build$src$core$clipboard ; copy$$module$build$src$core$clipboard ( a ) ; let c , d , e ; a = null != ( e = null == ( c = a . toCopyData ( ) ) ? void 0 : null == ( d = c . source ) ? void 0 : d . paste ( copyData$$module$build$src$core$clipboard . saveInfo ) ) ? e : null ; copyData$$module$build$src$core$clipboard = b ; return a } , getCurrentBlock$$module$build$src$core$contextmenu = function ( ) { return currentBlock$$module$build$src$core$contextmenu } , setCurrentBlock$$module$build$src$core$contextmenu = function ( a ) { currentBlock$$module$build$src$core$contextmenu =
a } , show$$module$build$src$core$contextmenu = function ( a , b , c ) { show$$module$build$src$core$widgetdiv ( dummyOwner$$module$build$src$core$contextmenu , c , dispose$$module$build$src$core$contextmenu ) ; if ( b . length ) { var d = populate _$$module$build$src$core$contextmenu ( b , c ) ; menu _$$module$build$src$core$contextmenu = d ; position _$$module$build$src$core$contextmenu ( d , a , c ) ; setTimeout ( function ( ) { d . focus ( ) } , 1 ) ; currentBlock$$module$build$src$core$contextmenu = null } else hide$$module$build$src$core$contextmenu ( ) } , populate _$$module$build$src$core$contextmenu =
function ( a , b ) { const c = new Menu$$module$build$src$core$menu ; c . setRole ( Role$$module$build$src$core$utils$aria . MENU ) ; for ( let d = 0 ; d < a . length ; d ++ ) { const e = a [ d ] , f = new MenuItem$$module$build$src$core$menuitem ( e . text ) ; f . setRightToLeft ( b ) ; f . setRole ( Role$$module$build$src$core$utils$aria . MENUITEM ) ; c . addChild ( f ) ; f . setEnabled ( e . enabled ) ; if ( e . enabled ) f . onAction ( function ( ) { hide$$module$build$src$core$contextmenu ( ) ; e . callback ( e . scope ) } , { } ) } return c } , position _$$module$build$src$core$contextmenu = function ( a , b , c ) { const d =
getViewportBBox$$module$build$src$core$utils$svg _math ( ) ; b = new Rect$$module$build$src$core$utils$rect ( b . clientY + d . top , b . clientY + d . top , b . clientX + d . left , b . clientX + d . left ) ; createWidget _$$module$build$src$core$contextmenu ( a ) ; const e = a . getSize ( ) ; c && ( b . left += e . width , b . right += e . width , d . left += e . width , d . right += e . width ) ; positionWithAnchor$$module$build$src$core$widgetdiv ( d , b , e , c ) ; a . focus ( ) } , createWidget _$$module$build$src$core$contextmenu = function ( a ) { var b = getDiv$$module$build$src$core$widgetdiv ( ) ; if ( ! b ) throw Error ( "Attempting to create a context menu when widget div is null" ) ;
b = a . render ( b ) ; addClass$$module$build$src$core$utils$dom ( b , "blocklyContextMenu" ) ; conditionalBind$$module$build$src$core$browser _events ( b , "contextmenu" , null , haltPropagation$$module$build$src$core$contextmenu ) ; a . focus ( ) } , haltPropagation$$module$build$src$core$contextmenu = function ( a ) { a . preventDefault ( ) ; a . stopPropagation ( ) } , hide$$module$build$src$core$contextmenu = function ( ) { hideIfOwner$$module$build$src$core$widgetdiv ( dummyOwner$$module$build$src$core$contextmenu ) ; currentBlock$$module$build$src$core$contextmenu =
null } , dispose$$module$build$src$core$contextmenu = function ( ) { menu _$$module$build$src$core$contextmenu && ( menu _$$module$build$src$core$contextmenu . dispose ( ) , menu _$$module$build$src$core$contextmenu = null ) } , callbackFactory$$module$build$src$core$contextmenu = function ( a , b ) { return ( ) => { disable$$module$build$src$core$events$utils ( ) ; let c ; try { c = domToBlock$$module$build$src$core$xml ( 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 ) ) ; c . select ( ) } } , commentDeleteOption$$module$build$src$core$contextmenu = function ( a ) { return { text : Msg$$module$build$src$core$msg . REMOVE _COMMENT , enabled : ! 0 , callback : function ( ) { setGroup$$module$build$src$core$events$utils ( ! 0 ) ;
a . dispose ( ) ; setGroup$$module$build$src$core$events$utils ( ! 1 ) } } } , commentDuplicateOption$$module$build$src$core$contextmenu = function ( a ) { return { text : Msg$$module$build$src$core$msg . DUPLICATE _COMMENT , enabled : ! 0 , callback : function ( ) { duplicate$$module$build$src$core$clipboard ( a ) } } } , workspaceCommentOption$$module$build$src$core$contextmenu = function ( a , b ) { const c = { enabled : ! 0 } ; c . text = Msg$$module$build$src$core$msg . ADD _COMMENT ; c . callback = function ( ) { const d = new WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg ( a ,
Msg$$module$build$src$core$msg . WORKSPACE _COMMENT _DEFAULT _TEXT , WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg . DEFAULT _SIZE , WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg . DEFAULT _SIZE ) ; var e = a . getInjectionDiv ( ) . getBoundingClientRect ( ) ; e = new Coordinate$$module$build$src$core$utils$coordinate ( b . clientX - e . left , b . clientY - e . top ) ; const f = a . getOriginOffsetInPixels ( ) ; e = Coordinate$$module$build$src$core$utils$coordinate . difference ( e , f ) ; e . scale ( 1 / a . scale ) ; d . moveBy ( e . x , e . y ) ;
a . rendered && ( d . initSvg ( ) , d . render ( ) , d . select ( ) ) } ; return c } , getStartPositionRect$$module$build$src$core$positionable _helpers = function ( a , b , c , d , e , f ) { const g = f . scrollbar && f . scrollbar . canScrollVertically ( ) ; a . horizontal === horizontalPosition$$module$build$src$core$positionable _helpers . LEFT ? ( c = e . absoluteMetrics . left + c , g && f . RTL && ( c += Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness ) ) : ( c = e . absoluteMetrics . left + e . viewMetrics . width - b . width - c , g && ! f . RTL && ( c -= Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness ) ) ;
a . vertical === verticalPosition$$module$build$src$core$positionable _helpers . TOP ? a = e . absoluteMetrics . top + d : ( a = e . absoluteMetrics . top + e . viewMetrics . height - b . height - d , f . scrollbar && f . scrollbar . canScrollHorizontally ( ) && ( a -= Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness ) ) ; return new Rect$$module$build$src$core$utils$rect ( a , a + b . height , c , c + b . width ) } , getCornerOppositeToolbox$$module$build$src$core$positionable _helpers = function ( a , b ) { return { horizontal : b . toolboxMetrics . position === Position$$module$build$src$core$utils$toolbox . LEFT ||
a . horizontalLayout && ! a . RTL ? horizontalPosition$$module$build$src$core$positionable _helpers . RIGHT : horizontalPosition$$module$build$src$core$positionable _helpers . LEFT , vertical : b . toolboxMetrics . position === Position$$module$build$src$core$utils$toolbox . BOTTOM ? verticalPosition$$module$build$src$core$positionable _helpers . TOP : verticalPosition$$module$build$src$core$positionable _helpers . BOTTOM } } , bumpPositionRect$$module$build$src$core$positionable _helpers = function ( a , b , c , d ) { const e = a . left , f = a . right - a . left , g =
a . bottom - a . top ; for ( let h = 0 ; h < d . length ; h ++ ) { const k = d [ h ] ; a . intersects ( k ) && ( a = c === bumpDirection$$module$build$src$core$positionable _helpers . UP ? k . top - g - b : k . bottom + b , a = new Rect$$module$build$src$core$utils$rect ( a , a + g , e , e + f ) , h = - 1 ) } return a } , registerEscape$$module$build$src$core$shortcut _items = function ( ) { ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . register ( { name : names$$module$build$src$core$shortcut _items . ESCAPE , preconditionFn ( a ) { return ! a . options . readOnly } , callback ( a ) { a . hideChaff ( ) ;
return ! 0 } , keyCodes : [ KeyCodes$$module$build$src$core$utils$keycodes . ESC ] } ) } , registerDelete$$module$build$src$core$shortcut _items = function ( ) { ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . register ( { name : names$$module$build$src$core$shortcut _items . DELETE , preconditionFn ( a ) { const b = getSelected$$module$build$src$core$common ( ) ; return ! a . options . readOnly && null != b && b . isDeletable ( ) } , callback ( a , b ) { b . preventDefault ( ) ; if ( Gesture$$module$build$src$core$gesture . inProgress ( ) ) return ! 1 ; getSelected$$module$build$src$core$common ( ) . checkAndDelete ( ) ;
return ! 0 } , keyCodes : [ KeyCodes$$module$build$src$core$utils$keycodes . DELETE , KeyCodes$$module$build$src$core$utils$keycodes . BACKSPACE ] } ) } , registerCopy$$module$build$src$core$shortcut _items = function ( ) { const a = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . C , [ KeyCodes$$module$build$src$core$utils$keycodes . CTRL ] ) , b = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . C ,
[ KeyCodes$$module$build$src$core$utils$keycodes . ALT ] ) , c = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . C , [ KeyCodes$$module$build$src$core$utils$keycodes . META ] ) ; ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . register ( { name : names$$module$build$src$core$shortcut _items . COPY , preconditionFn ( d ) { const e = getSelected$$module$build$src$core$common ( ) ; return ! d . options . readOnly && ! Gesture$$module$build$src$core$gesture . inProgress ( ) &&
null != e && e . isDeletable ( ) && e . isMovable ( ) } , callback ( d , e ) { e . preventDefault ( ) ; d . hideChaff ( ) ; copy$$module$build$src$core$clipboard ( getSelected$$module$build$src$core$common ( ) ) ; return ! 0 } , keyCodes : [ a , b , c ] } ) } , registerCut$$module$build$src$core$shortcut _items = function ( ) { const a = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . X , [ KeyCodes$$module$build$src$core$utils$keycodes . CTRL ] ) , b = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . X ,
[ KeyCodes$$module$build$src$core$utils$keycodes . ALT ] ) , c = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . X , [ KeyCodes$$module$build$src$core$utils$keycodes . META ] ) ; ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . register ( { name : names$$module$build$src$core$shortcut _items . CUT , preconditionFn ( d ) { const e = getSelected$$module$build$src$core$common ( ) ; return ! d . options . readOnly && ! Gesture$$module$build$src$core$gesture . inProgress ( ) &&
null != e && e instanceof BlockSvg$$module$build$src$core$block _svg && e . isDeletable ( ) && e . isMovable ( ) && ! e . workspace . isFlyout } , callback ( ) { const d = getSelected$$module$build$src$core$common ( ) ; if ( ! d ) return ! 1 ; copy$$module$build$src$core$clipboard ( d ) ; d . checkAndDelete ( ) ; return ! 0 } , keyCodes : [ a , b , c ] } ) } , registerPaste$$module$build$src$core$shortcut _items = function ( ) { const a = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . V , [ KeyCodes$$module$build$src$core$utils$keycodes . CTRL ] ) ,
b = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . V , [ KeyCodes$$module$build$src$core$utils$keycodes . ALT ] ) , c = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . V , [ KeyCodes$$module$build$src$core$utils$keycodes . META ] ) ; ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . register ( { name : names$$module$build$src$core$shortcut _items . PASTE ,
preconditionFn ( d ) { return ! d . options . readOnly && ! Gesture$$module$build$src$core$gesture . inProgress ( ) } , callback ( ) { return ! ! paste$$module$build$src$core$clipboard ( ) } , keyCodes : [ a , b , c ] } ) } , registerUndo$$module$build$src$core$shortcut _items = function ( ) { const a = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . Z , [ KeyCodes$$module$build$src$core$utils$keycodes . CTRL ] ) , b = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . Z ,
[ KeyCodes$$module$build$src$core$utils$keycodes . ALT ] ) , c = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . Z , [ KeyCodes$$module$build$src$core$utils$keycodes . META ] ) ; ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . register ( { name : names$$module$build$src$core$shortcut _items . UNDO , preconditionFn ( d ) { return ! d . options . readOnly && ! Gesture$$module$build$src$core$gesture . inProgress ( ) } , callback ( d ) { d . hideChaff ( ) ;
d . undo ( ! 1 ) ; return ! 0 } , keyCodes : [ a , b , c ] } ) } , registerRedo$$module$build$src$core$shortcut _items = function ( ) { const a = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . Z , [ KeyCodes$$module$build$src$core$utils$keycodes . SHIFT , KeyCodes$$module$build$src$core$utils$keycodes . CTRL ] ) , b = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . Z , [ KeyCodes$$module$build$src$core$utils$keycodes . SHIFT ,
KeyCodes$$module$build$src$core$utils$keycodes . ALT ] ) , c = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . Z , [ KeyCodes$$module$build$src$core$utils$keycodes . SHIFT , KeyCodes$$module$build$src$core$utils$keycodes . META ] ) , d = ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . createSerializedKey ( KeyCodes$$module$build$src$core$utils$keycodes . Y , [ KeyCodes$$module$build$src$core$utils$keycodes . CTRL ] ) ; ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . register ( { name : names$$module$build$src$core$shortcut _items . REDO ,
preconditionFn ( e ) { return ! Gesture$$module$build$src$core$gesture . inProgress ( ) && ! e . options . readOnly } , callback ( e ) { e . hideChaff ( ) ; e . undo ( ! 0 ) ; return ! 0 } , keyCodes : [ a , b , c , d ] } ) } , registerDefaultShortcuts$$module$build$src$core$shortcut _items = function ( ) { registerEscape$$module$build$src$core$shortcut _items ( ) ; registerDelete$$module$build$src$core$shortcut _items ( ) ; registerCopy$$module$build$src$core$shortcut _items ( ) ; registerCut$$module$build$src$core$shortcut _items ( ) ; registerPaste$$module$build$src$core$shortcut _items ( ) ;
registerUndo$$module$build$src$core$shortcut _items ( ) ; registerRedo$$module$build$src$core$shortcut _items ( ) } , allProcedures$$module$build$src$core$procedures = function ( a ) { const b = a . getBlocksByType ( "procedures_defnoreturn" , ! 1 ) . map ( function ( c ) { return c . getProcedureDef ( ) } ) ; a = a . getBlocksByType ( "procedures_defreturn" , ! 1 ) . map ( function ( c ) { return c . getProcedureDef ( ) } ) ; b . sort ( procTupleComparator$$module$build$src$core$procedures ) ; a . sort ( procTupleComparator$$module$build$src$core$procedures ) ; return [ b , a ] } , 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 } , isLegalName$$module$build$src$core$procedures = function ( a , b , c ) { return ! isNameUsed$$module$build$src$core$procedures ( a , b , c ) } , isNameUsed$$module$build$src$core$procedures =
function ( a , b , c ) { b = b . getAllBlocks ( ! 1 ) ; for ( let e = 0 ; e < b . length ; e ++ ) if ( b [ e ] !== c ) { var d = b [ e ] ; if ( d . getProcedureDef && ( d = d . getProcedureDef ( ) , Names$$module$build$src$core$names . equals ( d [ 0 ] , a ) ) ) return ! 0 } return ! 1 } , rename$$module$build$src$core$procedures = function ( a ) { var b = this . getSourceBlock ( ) ; if ( ! b ) throw new UnattachedFieldError$$module$build$src$core$field ; a = a . trim ( ) ; const c = findLegalName$$module$build$src$core$procedures ( a , b ) , d = this . getValue ( ) ; if ( d !== a && d !== c ) for ( a = b . workspace . getAllBlocks ( ! 1 ) , b = 0 ; b < a . length ; b ++ ) { const e =
a [ b ] ; e . renameProcedure && e . renameProcedure ( d , c ) } return c } , flyoutCategory$$module$build$src$core$procedures = function ( a ) { function b ( f , g ) { for ( let k = 0 ; k < f . length ; k ++ ) { var h = f [ k ] [ 0 ] ; const l = f [ k ] [ 1 ] , m = createElement$$module$build$src$core$utils$xml ( "block" ) ; m . setAttribute ( "type" , g ) ; m . setAttribute ( "gap" , "16" ) ; const n = createElement$$module$build$src$core$utils$xml ( "mutation" ) ; n . setAttribute ( "name" , h ) ; m . appendChild ( n ) ; for ( h = 0 ; h < l . length ; h ++ ) { const p = createElement$$module$build$src$core$utils$xml ( "arg" ) ; p . setAttribute ( "name" ,
l [ h ] ) ; n . appendChild ( p ) } c . push ( m ) } } const c = [ ] ; if ( Blocks$$module$build$src$core$blocks . procedures _defnoreturn ) { var d = createElement$$module$build$src$core$utils$xml ( "block" ) ; d . setAttribute ( "type" , "procedures_defnoreturn" ) ; d . setAttribute ( "gap" , "16" ) ; var e = createElement$$module$build$src$core$utils$xml ( "field" ) ; e . setAttribute ( "name" , "NAME" ) ; e . appendChild ( createTextNode$$module$build$src$core$utils$xml ( Msg$$module$build$src$core$msg . PROCEDURES _DEFNORETURN _PROCEDURE ) ) ; d . appendChild ( e ) ; c . push ( d ) } Blocks$$module$build$src$core$blocks . procedures _defreturn &&
( d = createElement$$module$build$src$core$utils$xml ( "block" ) , d . setAttribute ( "type" , "procedures_defreturn" ) , d . setAttribute ( "gap" , "16" ) , e = createElement$$module$build$src$core$utils$xml ( "field" ) , e . setAttribute ( "name" , "NAME" ) , e . appendChild ( createTextNode$$module$build$src$core$utils$xml ( Msg$$module$build$src$core$msg . PROCEDURES _DEFRETURN _PROCEDURE ) ) , d . appendChild ( e ) , c . push ( d ) ) ; Blocks$$module$build$src$core$blocks . procedures _ifreturn && ( d = createElement$$module$build$src$core$utils$xml ( "block" ) , 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 . mutator . 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 = getWorkspaceById$$module$build$src$core$common ( a . workspaceId ) , updateMutatorFlyout$$module$build$src$core$procedures ( a ) } , getCallers$$module$build$src$core$procedures = function ( a , b ) { const c = [ ] ; b = b . getAllBlocks ( ! 1 ) ; for ( let e = 0 ; e < b . length ; e ++ ) { var d = b [ e ] ; d . getProcedureCall && ( d = d . getProcedureCall ( ) ) && Names$$module$build$src$core$names . equals ( d , a ) && c . push ( b [ e ] ) } return c } , 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$xml ( c ) ; g . domToMutation && g . domToMutation ( d ) ; var e = g . mutationToDom ( ) ; e = e && domToText$$module$build$src$core$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 ) ) } } , getDefinition$$module$build$src$core$procedures = function ( a , b ) { b = b . getAllBlocks ( ! 1 ) ; for ( let d = 0 ; d < b . length ; d ++ ) { var c = b [ d ] ; if ( c . getProcedureDef && ( c = c . getProcedureDef ( ) ) && Names$$module$build$src$core$names . equals ( c [ 0 ] , a ) ) return b [ d ] } return null } , isDynamicShape$$module$build$src$core$renderers$common$constants = function ( a ) { return a . isDynamic } , isDebuggerEnabled$$module$build$src$core$renderers$common$debug = function ( ) { return useDebugger$$module$build$src$core$renderers$common$debug } ,
startDebugger$$module$build$src$core$renderers$common$debug = function ( ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.blockRendering.debug.startDebugger()" , "version 8" , "version 10" , "the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)" ) ; useDebugger$$module$build$src$core$renderers$common$debug = ! 0 } , stopDebugger$$module$build$src$core$renderers$common$debug = function ( ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.blockRendering.debug.stopDebugger()" ,
"version 8" , "version 10" , "the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)" ) ; useDebugger$$module$build$src$core$renderers$common$debug = ! 1 } , register$$module$build$src$core$renderers$common$block _rendering = function ( a , b ) { register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . RENDERER , a , b ) } , unregister$$module$build$src$core$renderers$common$block _rendering = function ( a ) { unregister$$module$build$src$core$registry ( Type$$module$build$src$core$registry . RENDERER ,
a ) } , stopDebugger$$module$build$src$core$renderers$common$block _rendering = function ( ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.blockRendering.stopDebugger()" , "September 2021" , "September 2022" , "the debug renderer in @blockly/dev-tools (See https://www.npmjs.com/package/@blockly/dev-tools.)" ) ; stopDebugger$$module$build$src$core$renderers$common$debug ( ) } , init$$module$build$src$core$renderers$common$block _rendering = function ( a , b , c ) { a = new ( getClass$$module$build$src$core$registry ( Type$$module$build$src$core$registry . RENDERER ,
a ) ) ( a ) ; a . init ( b , c ) ; return a } , stringButtonClickHandler$$module$build$src$core$variables _dynamic = function ( a ) { createVariableButtonHandler$$module$build$src$core$variables ( a . getTargetWorkspace ( ) , void 0 , "String" ) } , numberButtonClickHandler$$module$build$src$core$variables _dynamic = function ( a ) { createVariableButtonHandler$$module$build$src$core$variables ( a . getTargetWorkspace ( ) , void 0 , "Number" ) } , colourButtonClickHandler$$module$build$src$core$variables _dynamic = function ( a ) { createVariableButtonHandler$$module$build$src$core$variables ( a . getTargetWorkspace ( ) ,
void 0 , "Colour" ) } , flyoutCategory$$module$build$src$core$variables _dynamic = function ( a ) { let b = [ ] , c = document . createElement ( "button" ) ; c . setAttribute ( "text" , Msg$$module$build$src$core$msg . NEW _STRING _VARIABLE ) ; c . setAttribute ( "callbackKey" , "CREATE_VARIABLE_STRING" ) ; b . push ( c ) ; c = document . createElement ( "button" ) ; c . setAttribute ( "text" , Msg$$module$build$src$core$msg . NEW _NUMBER _VARIABLE ) ; c . setAttribute ( "callbackKey" , "CREATE_VARIABLE_NUMBER" ) ; b . push ( c ) ; c = document . createElement ( "button" ) ; c . setAttribute ( "text" , Msg$$module$build$src$core$msg . NEW _COLOUR _VARIABLE ) ;
c . setAttribute ( "callbackKey" , "CREATE_VARIABLE_COLOUR" ) ; b . push ( c ) ; a . registerButtonCallback ( "CREATE_VARIABLE_STRING" , stringButtonClickHandler$$module$build$src$core$variables _dynamic ) ; a . registerButtonCallback ( "CREATE_VARIABLE_NUMBER" , numberButtonClickHandler$$module$build$src$core$variables _dynamic ) ; a . registerButtonCallback ( "CREATE_VARIABLE_COLOUR" , colourButtonClickHandler$$module$build$src$core$variables _dynamic ) ; a = flyoutCategoryBlocks$$module$build$src$core$variables _dynamic ( a ) ; return b = b . concat ( a ) } ,
flyoutCategoryBlocks$$module$build$src$core$variables _dynamic = function ( a ) { a = a . getAllVariables ( ) ; const b = [ ] ; if ( 0 < a . length ) { if ( Blocks$$module$build$src$core$blocks . variables _set _dynamic ) { var c = a [ a . length - 1 ] ; const d = createElement$$module$build$src$core$utils$xml ( "block" ) ; d . setAttribute ( "type" , "variables_set_dynamic" ) ; d . setAttribute ( "gap" , "24" ) ; d . appendChild ( generateVariableFieldDom$$module$build$src$core$variables ( c ) ) ; b . push ( d ) } if ( Blocks$$module$build$src$core$blocks . variables _get _dynamic ) { a . sort ( VariableModel$$module$build$src$core$variable _model . compareByName ) ;
for ( let d = 0 , e ; e = a [ d ] ; d ++ ) c = createElement$$module$build$src$core$utils$xml ( "block" ) , c . setAttribute ( "type" , "variables_get_dynamic" ) , c . setAttribute ( "gap" , "8" ) , c . appendChild ( generateVariableFieldDom$$module$build$src$core$variables ( e ) ) , b . push ( c ) } } return b } , resizeSvgContents$$module$build$src$core$workspace _svg = function ( a ) { a . resizeContents ( ) } , 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 ( let [ 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 ) ) ;
setGroup$$module$build$src$core$events$utils ( c ) ; setRecordUndo$$module$build$src$core$events$utils ( e ) } } , 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 ) , ! 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 ( - 1 !== BUMP _EVENTS$$module$build$src$core$events$utils . indexOf ( 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 ( ) , 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." ) ,
null !== c && 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 : 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 ) } } , inject$$module$build$src$core$inject = function ( a , b ) { "string" === typeof a && ( a = document . getElementById ( a ) || document . querySelector ( a ) ) ; if ( ! a || ! containsNode$$module$build$src$core$utils$dom ( document ,
a ) ) throw Error ( "Error: container is not in current document." ) ; b = new Options$$module$build$src$core$options ( b || { } ) ; const c = document . createElement ( "div" ) ; c . className = "injectionDiv" ; c . tabIndex = 0 ; setState$$module$build$src$core$utils$aria ( c , State$$module$build$src$core$utils$aria . LABEL , Msg$$module$build$src$core$msg . WORKSPACE _ARIA _LABEL ) ; a . appendChild ( c ) ; a = createDom$$module$build$src$core$inject ( c , b ) ; const d = new BlockDragSurfaceSvg$$module$build$src$core$block _drag _surface ( c ) , e = new WorkspaceDragSurfaceSvg$$module$build$src$core$workspace _drag _surface _svg ( c ) ,
f = createMainWorkspace$$module$build$src$core$inject ( a , b , d , e ) ; init$$module$build$src$core$inject ( f ) ; setMainWorkspace$$module$build$src$core$common ( f ) ; svgResize$$module$build$src$core$common ( f ) ; c . addEventListener ( "focusin" , function ( ) { setMainWorkspace$$module$build$src$core$common ( f ) } ) ; return f } , createDom$$module$build$src$core$inject = function ( a , b ) { a . setAttribute ( "dir" , "LTR" ) ; inject$$module$build$src$core$css ( b . hasCss , b . pathToMedia ) ; a = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . SVG ,
{ xmlns : SVG _NS$$module$build$src$core$utils$dom , "xmlns:html" : HTML _NS$$module$build$src$core$utils$dom , "xmlns:xlink" : XLINK _NS$$module$build$src$core$utils$dom , version : "1.1" , "class" : "blocklySvg" , tabindex : "0" } , a ) ; const c = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . DEFS , { } , a ) , d = String ( Math . random ( ) ) . substring ( 2 ) ; b . gridPattern = Grid$$module$build$src$core$grid . createDom ( d , b . gridOptions , c ) ; return a } , createMainWorkspace$$module$build$src$core$inject = function ( a , b ,
c , d ) { b . parentWorkspace = null ; b = new WorkspaceSvg$$module$build$src$core$workspace _svg ( b , c , d ) ; c = b . options ; b . scale = c . zoomOptions . startScale ; a . appendChild ( b . createDom ( "blocklyMainBackground" ) ) ; d = b . getInjectionDiv ( ) ; var e = b . getRenderer ( ) . getClassName ( ) ; e && addClass$$module$build$src$core$utils$dom ( d , e ) ; ( e = b . getTheme ( ) . getClassName ( ) ) && addClass$$module$build$src$core$utils$dom ( d , e ) ; ! c . hasCategories && c . languageTree && ( d = b . addFlyout ( Svg$$module$build$src$core$utils$svg . SVG ) , insertAfter$$module$build$src$core$utils$dom ( d ,
a ) ) ; c . hasTrashcan && b . addTrashcan ( ) ; c . zoomOptions && c . zoomOptions . controls && b . addZoomControls ( ) ; b . getThemeManager ( ) . subscribe ( a , "workspaceBackgroundColour" , "background-color" ) ; b . translate ( 0 , 0 ) ; b . addChangeListener ( bumpIntoBoundsHandler$$module$build$src$core$bump _objects ( b ) ) ; svgResize$$module$build$src$core$common ( b ) ; createDom$$module$build$src$core$widgetdiv ( ) ; createDom$$module$build$src$core$dropdowndiv ( ) ; createDom$$module$build$src$core$tooltip ( ) ; return b } , init$$module$build$src$core$inject = function ( a ) { const b =
a . options ; var c = a . getParentSvg ( ) ; conditionalBind$$module$build$src$core$browser _events ( c . parentNode , "contextmenu" , null , function ( d ) { isTargetInput$$module$build$src$core$browser _events ( d ) || d . preventDefault ( ) } ) ; c = conditionalBind$$module$build$src$core$browser _events ( window , "resize" , null , function ( ) { a . hideChaff ( ! 0 ) ; svgResize$$module$build$src$core$common ( a ) ; bumpTopObjectsIntoBounds$$module$build$src$core$bump _objects ( a ) } ) ; a . setResizeHandlerWrapper ( c ) ; bindDocumentEvents$$module$build$src$core$inject ( ) ;
if ( b . languageTree ) { c = a . getToolbox ( ) ; const d = a . getFlyout ( ! 0 ) ; c ? c . init ( ) : d && ( d . init ( a ) , d . show ( b . languageTree ) , "function" === typeof d . scrollToStart && d . scrollToStart ( ) ) } b . hasTrashcan && a . trashcan . init ( ) ; b . zoomOptions && b . zoomOptions . controls && a . zoomControls _ . init ( ) ; b . moveOptions && b . moveOptions . scrollbars ? ( a . scrollbar = new ScrollbarPair$$module$build$src$core$scrollbar _pair ( a , ! 0 === b . moveOptions . scrollbars || ! ! b . moveOptions . scrollbars . horizontal , ! 0 === b . moveOptions . scrollbars || ! ! b . moveOptions . scrollbars . vertical ,
"blocklyMainWorkspaceScrollbar" ) , a . scrollbar . resize ( ) ) : a . setMetrics ( { x : . 5 , y : . 5 } ) ; b . hasSounds && loadSounds$$module$build$src$core$inject ( b . pathToMedia , a ) } , onKeyDown$$module$build$src$core$inject = function ( a ) { const b = getMainWorkspace$$module$build$src$core$common ( ) ; if ( b && ! ( isTargetInput$$module$build$src$core$browser _events ( a ) || b . rendered && ! b . isVisible ( ) ) ) ShortcutRegistry$$module$build$src$core$shortcut _registry . registry . onKeyDown ( b , a ) } , bindDocumentEvents$$module$build$src$core$inject = function ( ) { documentEventsBound$$module$build$src$core$inject ||
( conditionalBind$$module$build$src$core$browser _events ( document , "scroll" , null , function ( ) { const a = getAllWorkspaces$$module$build$src$core$common ( ) ; for ( let b = 0 , c ; c = a [ b ] ; b ++ ) c instanceof WorkspaceSvg$$module$build$src$core$workspace _svg && c . updateInverseScreenCTM ( ) } ) , conditionalBind$$module$build$src$core$browser _events ( document , "keydown" , null , onKeyDown$$module$build$src$core$inject ) , bind$$module$build$src$core$browser _events ( document , "touchend" , null , longStop$$module$build$src$core$touch ) , bind$$module$build$src$core$browser _events ( document ,
"touchcancel" , null , longStop$$module$build$src$core$touch ) , IPAD$$module$build$src$core$utils$useragent && conditionalBind$$module$build$src$core$browser _events ( window , "orientationchange" , document , function ( ) { svgResize$$module$build$src$core$common ( getMainWorkspace$$module$build$src$core$common ( ) ) } ) ) ; documentEventsBound$$module$build$src$core$inject = ! 0 } , loadSounds$$module$build$src$core$inject = function ( a , b ) { function c ( ) { for ( ; e . length ; ) unbind$$module$build$src$core$browser _events ( e . pop ( ) ) ; d . preload ( ) } const d =
b . getAudioManager ( ) ; d . load ( [ a + "click.mp3" , a + "click.wav" , a + "click.ogg" ] , "click" ) ; d . load ( [ a + "disconnect.wav" , a + "disconnect.mp3" , a + "disconnect.ogg" ] , "disconnect" ) ; d . load ( [ a + "delete.mp3" , a + "delete.ogg" , a + "delete.wav" ] , "delete" ) ; const e = [ ] ; e . push ( conditionalBind$$module$build$src$core$browser _events ( document , "mousemove" , null , c , ! 0 ) ) ; e . push ( conditionalBind$$module$build$src$core$browser _events ( document , "touchstart" , null , c , ! 0 ) ) } , registerUndo$$module$build$src$core$contextmenu _items = function ( ) { ContextMenuRegistry$$module$build$src$core$contextmenu _registry . registry . register ( { displayText ( ) { return Msg$$module$build$src$core$msg . UNDO } ,
preconditionFn ( a ) { return 0 < a . workspace . getUndoStack ( ) . length ? "enabled" : "disabled" } , callback ( a ) { a . workspace . undo ( ! 1 ) } , scopeType : ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType . WORKSPACE , id : "undoWorkspace" , weight : 1 } ) } , registerRedo$$module$build$src$core$contextmenu _items = function ( ) { ContextMenuRegistry$$module$build$src$core$contextmenu _registry . registry . register ( { displayText ( ) { return Msg$$module$build$src$core$msg . REDO } , preconditionFn ( a ) { return 0 < a . workspace . getRedoStack ( ) . length ?
"enabled" : "disabled" } , callback ( a ) { a . workspace . undo ( ! 0 ) } , scopeType : ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType . WORKSPACE , id : "redoWorkspace" , weight : 2 } ) } , registerCleanup$$module$build$src$core$contextmenu _items = function ( ) { ContextMenuRegistry$$module$build$src$core$contextmenu _registry . registry . register ( { displayText ( ) { return Msg$$module$build$src$core$msg . CLEAN _UP } , preconditionFn ( a ) { return a . workspace . isMovable ( ) ? 1 < a . workspace . getTopBlocks ( ! 1 ) . length ? "enabled" : "disabled" :
"hidden" } , callback ( a ) { a . workspace . cleanUp ( ) } , scopeType : ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType . WORKSPACE , id : "cleanWorkspace" , weight : 3 } ) } , toggleOption _$$module$build$src$core$contextmenu _items = function ( a , b ) { function c ( f ) { e -- ; f . setCollapsed ( a ) ; 0 === e && setGroup$$module$build$src$core$events$utils ( ! 1 ) } let d = 0 , e = 0 ; setGroup$$module$build$src$core$events$utils ( ! 0 ) ; for ( let f = 0 ; f < b . length ; f ++ ) { let g = b [ f ] ; for ( ; g ; ) e ++ , setTimeout ( c . bind ( null , g ) , d ) , g = g . getNextBlock ( ) , d += 10 } } , registerCollapse$$module$build$src$core$contextmenu _items =
function ( ) { ContextMenuRegistry$$module$build$src$core$contextmenu _registry . registry . register ( { displayText ( ) { return Msg$$module$build$src$core$msg . COLLAPSE _ALL } , preconditionFn ( a ) { if ( a . workspace . options . collapse ) { a = a . workspace . getTopBlocks ( ! 1 ) ; for ( let b = 0 ; b < a . length ; b ++ ) { let c = a [ b ] ; for ( ; c ; ) { if ( ! c . isCollapsed ( ) ) return "enabled" ; c = c . getNextBlock ( ) } } return "disabled" } return "hidden" } , callback ( a ) { toggleOption _$$module$build$src$core$contextmenu _items ( ! 0 , a . workspace . getTopBlocks ( ! 0 ) ) } , scopeType : ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType . WORKSPACE ,
id : "collapseWorkspace" , weight : 4 } ) } , registerExpand$$module$build$src$core$contextmenu _items = function ( ) { ContextMenuRegistry$$module$build$src$core$contextmenu _registry . registry . register ( { displayText ( ) { return Msg$$module$build$src$core$msg . EXPAND _ALL } , preconditionFn ( a ) { if ( a . workspace . options . collapse ) { a = a . workspace . getTopBlocks ( ! 1 ) ; for ( let b = 0 ; b < a . length ; b ++ ) { let c = a [ b ] ; for ( ; c ; ) { if ( c . isCollapsed ( ) ) return "enabled" ; c = c . getNextBlock ( ) } } return "disabled" } return "hidden" } , callback ( a ) { toggleOption _$$module$build$src$core$contextmenu _items ( ! 1 ,
a . workspace . getTopBlocks ( ! 0 ) ) } , scopeType : ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType . WORKSPACE , id : "expandWorkspace" , weight : 5 } ) } , addDeletableBlocks _$$module$build$src$core$contextmenu _items = function ( a , b ) { if ( a . isDeletable ( ) ) Array . prototype . push . apply ( b , a . getDescendants ( ! 1 ) ) ; else { a = a . getChildren ( ! 1 ) ; for ( let c = 0 ; c < a . length ; c ++ ) addDeletableBlocks _$$module$build$src$core$contextmenu _items ( a [ c ] , b ) } } , getDeletableBlocks _$$module$build$src$core$contextmenu _items = function ( a ) { const b =
[ ] ; a = a . getTopBlocks ( ! 0 ) ; for ( let c = 0 ; c < a . length ; c ++ ) addDeletableBlocks _$$module$build$src$core$contextmenu _items ( a [ c ] , b ) ; return b } , deleteNext _$$module$build$src$core$contextmenu _items = function ( a , b ) { setGroup$$module$build$src$core$events$utils ( b ) ; const c = a . shift ( ) ; c && ( c . isDeadOrDying ( ) ? deleteNext _$$module$build$src$core$contextmenu _items ( a , b ) : ( c . dispose ( ! 1 , ! 0 ) , setTimeout ( deleteNext _$$module$build$src$core$contextmenu _items , 10 , a , b ) ) ) ; setGroup$$module$build$src$core$events$utils ( ! 1 ) } , registerDeleteAll$$module$build$src$core$contextmenu _items =
function ( ) { ContextMenuRegistry$$module$build$src$core$contextmenu _registry . registry . register ( { displayText ( a ) { if ( ! a . workspace ) return "" ; a = getDeletableBlocks _$$module$build$src$core$contextmenu _items ( a . workspace ) . length ; return 1 === a ? Msg$$module$build$src$core$msg . DELETE _BLOCK : Msg$$module$build$src$core$msg . DELETE _X _BLOCKS . replace ( "%1" , String ( a ) ) } , preconditionFn ( a ) { return a . workspace ? 0 < getDeletableBlocks _$$module$build$src$core$contextmenu _items ( a . workspace ) . length ? "enabled" : "disabled" : "disabled" } , callback ( a ) { if ( a . workspace ) { a . workspace . cancelCurrentGesture ( ) ;
var b = getDeletableBlocks _$$module$build$src$core$contextmenu _items ( a . workspace ) , c = genUid$$module$build$src$core$utils$idgenerator ( ) ; 2 > b . length ? deleteNext _$$module$build$src$core$contextmenu _items ( b , c ) : confirm$$module$build$src$core$dialog ( Msg$$module$build$src$core$msg . DELETE _ALL _BLOCKS . replace ( "%1" , String ( b . length ) ) , function ( d ) { d && deleteNext _$$module$build$src$core$contextmenu _items ( b , c ) } ) } } , scopeType : ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType . WORKSPACE , id : "workspaceDelete" ,
weight : 6 } ) } , registerWorkspaceOptions _$$module$build$src$core$contextmenu _items = function ( ) { registerUndo$$module$build$src$core$contextmenu _items ( ) ; registerRedo$$module$build$src$core$contextmenu _items ( ) ; registerCleanup$$module$build$src$core$contextmenu _items ( ) ; registerCollapse$$module$build$src$core$contextmenu _items ( ) ; registerExpand$$module$build$src$core$contextmenu _items ( ) ; registerDeleteAll$$module$build$src$core$contextmenu _items ( ) } , registerDuplicate$$module$build$src$core$contextmenu _items = function ( ) { ContextMenuRegistry$$module$build$src$core$contextmenu _registry . registry . register ( { displayText ( ) { return Msg$$module$build$src$core$msg . DUPLICATE _BLOCK } ,
preconditionFn ( a ) { a = a . block ; return ! a . isInFlyout && a . isDeletable ( ) && a . isMovable ( ) ? a . isDuplicatable ( ) ? "enabled" : "disabled" : "hidden" } , callback ( a ) { a . block && duplicate$$module$build$src$core$clipboard ( a . block ) } , scopeType : ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType . BLOCK , id : "blockDuplicate" , weight : 1 } ) } , registerComment$$module$build$src$core$contextmenu _items = function ( ) { ContextMenuRegistry$$module$build$src$core$contextmenu _registry . registry . register ( { displayText ( a ) { return a . block . getCommentIcon ( ) ?
Msg$$module$build$src$core$msg . REMOVE _COMMENT : Msg$$module$build$src$core$msg . ADD _COMMENT } , preconditionFn ( a ) { a = a . block ; return ! a . isInFlyout && a . workspace . options . comments && ! a . isCollapsed ( ) && a . isEditable ( ) ? "enabled" : "hidden" } , callback ( a ) { a = a . block ; a . getCommentIcon ( ) ? a . setCommentText ( null ) : a . setCommentText ( "" ) } , scopeType : ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType . BLOCK , id : "blockComment" , weight : 2 } ) } , registerInline$$module$build$src$core$contextmenu _items = function ( ) { ContextMenuRegistry$$module$build$src$core$contextmenu _registry . registry . register ( { displayText ( a ) { return a . block . getInputsInline ( ) ?
Msg$$module$build$src$core$msg . EXTERNAL _INPUTS : Msg$$module$build$src$core$msg . INLINE _INPUTS } , preconditionFn ( a ) { a = a . block ; if ( ! a . isInFlyout && a . isMovable ( ) && ! a . isCollapsed ( ) ) for ( let b = 1 ; b < a . inputList . length ; b ++ ) if ( a . inputList [ b - 1 ] . type !== inputTypes$$module$build$src$core$input _types . STATEMENT && a . inputList [ b ] . type !== inputTypes$$module$build$src$core$input _types . STATEMENT ) return "enabled" ; return "hidden" } , callback ( a ) { a . block . setInputsInline ( ! a . block . getInputsInline ( ) ) } , scopeType : ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType . BLOCK ,
id : "blockInline" , weight : 3 } ) } , registerCollapseExpandBlock$$module$build$src$core$contextmenu _items = function ( ) { ContextMenuRegistry$$module$build$src$core$contextmenu _registry . registry . register ( { displayText ( a ) { return a . block . isCollapsed ( ) ? Msg$$module$build$src$core$msg . EXPAND _BLOCK : Msg$$module$build$src$core$msg . COLLAPSE _BLOCK } , preconditionFn ( a ) { a = a . block ; return ! a . isInFlyout && a . isMovable ( ) && a . workspace . options . collapse ? "enabled" : "hidden" } , callback ( a ) { a . block . setCollapsed ( ! a . block . isCollapsed ( ) ) } , scopeType : ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType . BLOCK ,
id : "blockCollapseExpand" , weight : 4 } ) } , registerDisable$$module$build$src$core$contextmenu _items = function ( ) { ContextMenuRegistry$$module$build$src$core$contextmenu _registry . registry . register ( { displayText ( a ) { return a . block . isEnabled ( ) ? Msg$$module$build$src$core$msg . DISABLE _BLOCK : Msg$$module$build$src$core$msg . ENABLE _BLOCK } , preconditionFn ( a ) { a = a . block ; return ! a . isInFlyout && a . workspace . options . disable && a . isEditable ( ) ? a . getInheritedDisabled ( ) ? "disabled" : "enabled" : "hidden" } , callback ( a ) { a = a . block ; const b = getGroup$$module$build$src$core$events$utils ( ) ;
b || setGroup$$module$build$src$core$events$utils ( ! 0 ) ; a . setEnabled ( ! a . isEnabled ( ) ) ; b || setGroup$$module$build$src$core$events$utils ( ! 1 ) } , scopeType : ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType . BLOCK , id : "blockDisable" , weight : 5 } ) } , registerDelete$$module$build$src$core$contextmenu _items = function ( ) { ContextMenuRegistry$$module$build$src$core$contextmenu _registry . registry . register ( { displayText ( a ) { var b = a . block ; a = b . getDescendants ( ! 1 ) . length ; ( b = b . getNextBlock ( ) ) && ( a -= b . getDescendants ( ! 1 ) . length ) ;
return 1 === a ? Msg$$module$build$src$core$msg . DELETE _BLOCK : Msg$$module$build$src$core$msg . DELETE _X _BLOCKS . replace ( "%1" , String ( a ) ) } , preconditionFn ( a ) { return ! a . block . isInFlyout && a . block . isDeletable ( ) ? "enabled" : "hidden" } , callback ( a ) { a . block && a . block . checkAndDelete ( ) } , scopeType : ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType . BLOCK , id : "blockDelete" , weight : 6 } ) } , registerHelp$$module$build$src$core$contextmenu _items = function ( ) { ContextMenuRegistry$$module$build$src$core$contextmenu _registry . registry . register ( { displayText ( ) { return Msg$$module$build$src$core$msg . HELP } ,
preconditionFn ( a ) { a = a . block ; return ( "function" === typeof a . helpUrl ? a . helpUrl ( ) : a . helpUrl ) ? "enabled" : "hidden" } , callback ( a ) { a . block . showHelp ( ) } , scopeType : ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType . BLOCK , id : "blockHelp" , weight : 7 } ) } , registerBlockOptions _$$module$build$src$core$contextmenu _items = function ( ) { registerDuplicate$$module$build$src$core$contextmenu _items ( ) ; registerComment$$module$build$src$core$contextmenu _items ( ) ; registerInline$$module$build$src$core$contextmenu _items ( ) ;
registerCollapseExpandBlock$$module$build$src$core$contextmenu _items ( ) ; registerDisable$$module$build$src$core$contextmenu _items ( ) ; registerDelete$$module$build$src$core$contextmenu _items ( ) ; registerHelp$$module$build$src$core$contextmenu _items ( ) } , registerDefaultOptions$$module$build$src$core$contextmenu _items = function ( ) { registerWorkspaceOptions _$$module$build$src$core$contextmenu _items ( ) ; registerBlockOptions _$$module$build$src$core$contextmenu _items ( ) } , initIconData$$module$build$src$core$block _dragger =
function ( a ) { const b = [ ] ; a = a . getDescendants ( ! 1 ) ; for ( let c = 0 , d ; d = a [ c ] ; c ++ ) { const e = d . getIcons ( ) ; for ( let f = 0 ; f < e . length ; f ++ ) { const g = { location : e [ f ] . getIconLocation ( ) , icon : e [ f ] } ; b . push ( g ) } } return b } , hideChaff$$module$build$src$core$blockly = function ( a ) { getMainWorkspace$$module$build$src$core$common ( ) . hideChaff ( a ) } , resizeSvgContentsLocal$$module$build$src$core$blockly = function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.resizeSvgContents" , "December 2021" , "December 2022" , "Blockly.WorkspaceSvg.resizeSvgContents" ) ;
resizeSvgContents$$module$build$src$core$workspace _svg ( a ) } , copy$$module$build$src$core$blockly = function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.copy" , "December 2021" , "December 2022" , "Blockly.clipboard.copy" ) ; copy$$module$build$src$core$clipboard ( a ) } , paste$$module$build$src$core$blockly = function ( ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.paste" , "December 2021" , "December 2022" , "Blockly.clipboard.paste" ) ; return ! ! paste$$module$build$src$core$clipboard ( ) } , duplicate$$module$build$src$core$blockly =
function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.duplicate" , "December 2021" , "December 2022" , "Blockly.clipboard.duplicate" ) ; duplicate$$module$build$src$core$clipboard ( a ) } , isNumber$$module$build$src$core$blockly = function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.isNumber" , "December 2021" , "December 2022" , "Blockly.utils.string.isNumber" ) ; return isNumber$$module$build$src$core$utils$string ( a ) } , hueToHex$$module$build$src$core$blockly = function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.hueToHex" ,
"December 2021" , "December 2022" , "Blockly.utils.colour.hueToHex" ) ; return hueToHex$$module$build$src$core$utils$colour ( a ) } , bindEvent _$$module$build$src$core$blockly = function ( a , b , c , d ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.bindEvent_" , "December 2021" , "December 2022" , "Blockly.browserEvents.bind" ) ; return bind$$module$build$src$core$browser _events ( a , b , c , d ) } , unbindEvent _$$module$build$src$core$blockly = function ( a ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.unbindEvent_" , "December 2021" ,
"December 2022" , "Blockly.browserEvents.unbind" ) ; return unbind$$module$build$src$core$browser _events ( a ) } , bindEventWithChecks _$$module$build$src$core$blockly = function ( a , b , c , d , e , f ) { warn$$module$build$src$core$utils$deprecation ( "Blockly.bindEventWithChecks_" , "December 2021" , "December 2022" , "Blockly.browserEvents.conditionalBind" ) ; return conditionalBind$$module$build$src$core$browser _events ( a , b , c , d , e , f ) } , $jscomp = $jscomp || { } ; $jscomp . scope = { } ; $jscomp . ASSUME _ES5 = ! 1 ; $jscomp . ASSUME _NO _NATIVE _MAP = ! 1 ;
$jscomp . ASSUME _NO _NATIVE _SET = ! 1 ; $jscomp . SIMPLE _FROUND _POLYFILL = ! 1 ; $jscomp . ISOLATE _POLYFILLS = ! 1 ; $jscomp . FORCE _POLYFILL _PROMISE = ! 1 ; $jscomp . FORCE _POLYFILL _PROMISE _WHEN _NO _UNHANDLED _REJECTION = ! 1 ; $jscomp . defineProperty = $jscomp . ASSUME _ES5 || "function" == typeof Object . defineProperties ? Object . defineProperty : function ( a , b , c ) { if ( a == Array . prototype || a == Object . prototype ) return a ; a [ b ] = c . value ; return a } ;
$jscomp . getGlobal = function ( a ) { a = [ "object" == typeof globalThis && globalThis , a , "object" == typeof window && window , "object" == typeof self && self , "object" == typeof global && global ] ; for ( var b = 0 ; b < a . length ; ++ b ) { var c = a [ b ] ; if ( c && c . Math == Math ) return c } throw Error ( "Cannot find global object" ) ; } ; $jscomp . global = $jscomp . getGlobal ( this ) ; $jscomp . IS _SYMBOL _NATIVE = "function" === typeof Symbol && "symbol" === typeof Symbol ( "x" ) ; $jscomp . TRUST _ES6 _POLYFILLS = ! $jscomp . ISOLATE _POLYFILLS || $jscomp . IS _SYMBOL _NATIVE ; $jscomp . polyfills = { } ;
$jscomp . propertyToPolyfillSymbol = { } ; $jscomp . POLYFILL _PREFIX = "$jscp$" ; var $jscomp$lookupPolyfilledValue = function ( a , b ) { var c = $jscomp . propertyToPolyfillSymbol [ b ] ; if ( null == c ) return a [ b ] ; c = a [ c ] ; return void 0 !== c ? c : a [ b ] } ; $jscomp . polyfill = function ( a , b , c , d ) { b && ( $jscomp . ISOLATE _POLYFILLS ? $jscomp . polyfillIsolated ( a , b , c , d ) : $jscomp . polyfillUnisolated ( a , b , c , d ) ) } ;
$jscomp . polyfillUnisolated = function ( a , b , c , d ) { c = $jscomp . global ; a = a . split ( "." ) ; for ( d = 0 ; d < a . length - 1 ; d ++ ) { var e = a [ d ] ; if ( ! ( e in c ) ) return ; c = c [ e ] } a = a [ a . length - 1 ] ; d = c [ a ] ; b = b ( d ) ; b != d && null != b && $jscomp . defineProperty ( c , a , { configurable : ! 0 , writable : ! 0 , value : b } ) } ;
$jscomp . polyfillIsolated = function ( a , b , c , d ) { var e = a . split ( "." ) ; a = 1 === e . length ; d = e [ 0 ] ; d = ! a && d in $jscomp . polyfills ? $jscomp . polyfills : $jscomp . global ; for ( var f = 0 ; f < e . length - 1 ; f ++ ) { var g = e [ f ] ; if ( ! ( g in d ) ) return ; d = d [ g ] } e = e [ e . length - 1 ] ; c = $jscomp . IS _SYMBOL _NATIVE && "es6" === c ? d [ e ] : null ; b = b ( c ) ; null != b && ( a ? $jscomp . defineProperty ( $jscomp . polyfills , e , { configurable : ! 0 , writable : ! 0 , value : b } ) : b !== c && ( void 0 === $jscomp . propertyToPolyfillSymbol [ e ] && ( c = 1E9 * Math . random ( ) >>> 0 , $jscomp . propertyToPolyfillSymbol [ e ] = $jscomp . IS _SYMBOL _NATIVE ?
$jscomp . global . Symbol ( e ) : $jscomp . POLYFILL _PREFIX + c + "$" + e ) , $jscomp . defineProperty ( d , $jscomp . propertyToPolyfillSymbol [ e ] , { configurable : ! 0 , writable : ! 0 , value : b } ) ) ) } ; $jscomp . polyfill ( "globalThis" , function ( a ) { return a || $jscomp . global } , "es_2020" , "es3" ) ; $jscomp . arrayIteratorImpl = function ( a ) { var b = 0 ; return function ( ) { return b < a . length ? { done : ! 1 , value : a [ b ++ ] } : { done : ! 0 } } } ; $jscomp . arrayIterator = function ( a ) { return { next : $jscomp . arrayIteratorImpl ( a ) } } ; $jscomp . initSymbol = function ( ) { } ;
$jscomp . iteratorPrototype = function ( a ) { a = { next : a } ; a [ Symbol . iterator ] = function ( ) { return this } ; return a } ; $jscomp . iteratorFromArray = function ( a , b ) { a instanceof String && ( a += "" ) ; var c = 0 , d = ! 1 , e = { next : function ( ) { if ( ! d && c < a . length ) { var f = c ++ ; return { value : b ( f , a [ f ] ) , done : ! 1 } } d = ! 0 ; return { done : ! 0 , value : void 0 } } } ; e [ Symbol . iterator ] = function ( ) { return e } ; return e } ; $jscomp . polyfill ( "Array.prototype.values" , function ( a ) { return a ? a : function ( ) { return $jscomp . iteratorFromArray ( this , function ( b , c ) { return c } ) } } , "es8" , "es3" ) ;
$jscomp . owns = function ( a , b ) { return Object . prototype . hasOwnProperty . call ( a , b ) } ; $jscomp . polyfill ( "Object.values" , function ( a ) { return a ? a : function ( b ) { var c = [ ] , d ; for ( d in b ) $jscomp . owns ( b , d ) && c . push ( b [ d ] ) ; return c } } , "es8" , "es3" ) ; $jscomp . polyfill ( "Array.prototype.flat" , function ( a ) { return a ? a : function ( b ) { b = void 0 === b ? 1 : b ; for ( var c = [ ] , d = 0 ; d < this . length ; d ++ ) { var e = this [ d ] ; Array . isArray ( e ) && 0 < b ? ( e = Array . prototype . flat . call ( e , b - 1 ) , c . push . apply ( c , e ) ) : c . push ( e ) } return c } } , "es9" , "es5" ) ;
$jscomp . polyfill ( "Object.entries" , function ( a ) { return a ? a : function ( b ) { var c = [ ] , d ; for ( d in b ) $jscomp . owns ( b , d ) && c . push ( [ d , b [ d ] ] ) ; return c } } , "es8" , "es3" ) ; var global$$module$build$src$closure$goog$goog = globalThis , declareModuleId$$module$build$src$closure$goog$goog = function ( a ) { window . goog && window . goog . declareModuleId && window . goog . declareModuleId . call ( this , a ) } , module$build$src$closure$goog$goog = { } ; module$build$src$closure$goog$goog . declareModuleId = declareModuleId$$module$build$src$closure$goog$goog ;
module$build$src$closure$goog$goog . global = global$$module$build$src$closure$goog$goog ; / *
2022-01-03 14:02:41 +00:00
Copyright The Closure Library Authors .
SPDX - License - Identifier : Apache - 2.0
* /
2022-11-16 13:57:00 +00:00
var COMPILED = ! 0 , goog = goog || { } ; goog . global = globalThis || root ; goog . define = function ( a , b ) { return b } ; goog . DEBUG = ! 1 ; goog . DISALLOW _TEST _ONLY _CODE = COMPILED && ! goog . DEBUG ; goog . provide = function ( a ) { } ; goog . module = function ( a ) { } ; goog . module . get = function ( a ) { } ; goog . module . declareLegacyNamespace = function ( ) { } ; goog . setTestOnly = function ( a ) { if ( goog . DISALLOW _TEST _ONLY _CODE ) throw a = a || "" , Error ( "Importing test-only code into non-debug environment" + ( a ? ": " + a : "." ) ) ; } ; goog . require = function ( a ) { } ; goog . requireType = function ( a ) { } ; 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 = globalThis . PointerEvent ? { mousedown : [ "pointerdown" ] , mouseenter : [ "pointerenter" ] , mouseleave : [ "pointerleave" ] ,
mousemove : [ "pointermove" ] , mouseout : [ "pointerout" ] , mouseover : [ "pointerover" ] , mouseup : [ "pointerup" , "pointercancel" ] , touchend : [ "pointerup" ] , touchcancel : [ "pointercancel" ] } : { mousedown : [ "touchstart" ] , mousemove : [ "touchmove" ] , mouseup : [ "touchend" , "touchcancel" ] } , longPid _$$module$build$src$core$touch = 0 , module$build$src$core$touch = { } ; module$build$src$core$touch . TOUCH _ENABLED = TOUCH _ENABLED$$module$build$src$core$touch ; 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 . isMouseOrTouchEvent = isMouseOrTouchEvent$$module$build$src$core$touch ; module$build$src$core$touch . isTouchEvent = isTouchEvent$$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 . setClientFromTouch = setClientFromTouch$$module$build$src$core$touch ; module$build$src$core$touch . shouldHandleEvent = shouldHandleEvent$$module$build$src$core$touch ; module$build$src$core$touch . splitEventByTouches = splitEventByTouches$$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 - 1 !== c . indexOf ( 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 &&
globalThis . navigator . maxTouchPoints ; isIPad$$module$build$src$core$utils$useragent = b ( "iPad" ) || b ( "Macintosh" ) && 0 < a ; isIPhone$$module$build$src$core$utils$useragent = b ( "iPhone" ) && ! isIPad$$module$build$src$core$utils$useragent ; isMac$$module$build$src$core$utils$useragent = b ( "Macintosh" ) ; isTablet$$module$build$src$core$utils$useragent = isIPad$$module$build$src$core$utils$useragent || isAndroid$$module$build$src$core$utils$useragent && ! b ( "Mobile" ) || b ( "Silk" ) ; isMobile$$module$build$src$core$utils$useragent = ! isTablet$$module$build$src$core$utils$useragent &&
( isIPhone$$module$build$src$core$utils$useragent || isAndroid$$module$build$src$core$utils$useragent ) } ) ( globalThis . navigator && globalThis . navigator . userAgent || "" ) ;
var raw$$module$build$src$core$utils$useragent = rawUserAgent$$module$build$src$core$utils$useragent , JavaFx$$module$build$src$core$utils$useragent = isJavaFx$$module$build$src$core$utils$useragent , GECKO$$module$build$src$core$utils$useragent = isGecko$$module$build$src$core$utils$useragent , ANDROID$$module$build$src$core$utils$useragent = isAndroid$$module$build$src$core$utils$useragent , IPAD$$module$build$src$core$utils$useragent = isIPad$$module$build$src$core$utils$useragent , IPHONE$$module$build$src$core$utils$useragent =
isIPhone$$module$build$src$core$utils$useragent , MAC$$module$build$src$core$utils$useragent = isMac$$module$build$src$core$utils$useragent , MOBILE$$module$build$src$core$utils$useragent = isMobile$$module$build$src$core$utils$useragent , module$build$src$core$utils$useragent = { } ; module$build$src$core$utils$useragent . ANDROID = ANDROID$$module$build$src$core$utils$useragent ; module$build$src$core$utils$useragent . GECKO = GECKO$$module$build$src$core$utils$useragent ; module$build$src$core$utils$useragent . IPAD = IPAD$$module$build$src$core$utils$useragent ;
module$build$src$core$utils$useragent . IPHONE = IPHONE$$module$build$src$core$utils$useragent ; module$build$src$core$utils$useragent . JavaFx = JavaFx$$module$build$src$core$utils$useragent ; module$build$src$core$utils$useragent . MAC = MAC$$module$build$src$core$utils$useragent ; module$build$src$core$utils$useragent . MOBILE = MOBILE$$module$build$src$core$utils$useragent ; module$build$src$core$utils$useragent . raw = raw$$module$build$src$core$utils$useragent ; var LINE _MODE _MULTIPLIER$$module$build$src$core$browser _events = 40 , PAGE _MODE _MULTIPLIER$$module$build$src$core$browser _events = 125 , module$build$src$core$browser _events = { } ; module$build$src$core$browser _events . bind = bind$$module$build$src$core$browser _events ; module$build$src$core$browser _events . conditionalBind = conditionalBind$$module$build$src$core$browser _events ; module$build$src$core$browser _events . getScrollDeltaPixels = getScrollDeltaPixels$$module$build$src$core$browser _events ;
module$build$src$core$browser _events . isRightButton = isRightButton$$module$build$src$core$browser _events ; module$build$src$core$browser _events . isTargetInput = isTargetInput$$module$build$src$core$browser _events ; module$build$src$core$browser _events . mouseToSvg = mouseToSvg$$module$build$src$core$browser _events ; module$build$src$core$browser _events . unbind = unbind$$module$build$src$core$browser _events ; var Blocks$$module$build$src$core$blocks = Object . create ( null ) , module$build$src$core$blocks = { } ; module$build$src$core$blocks . Blocks = Blocks$$module$build$src$core$blocks ; var WorkspaceDB _$$module$build$src$core$common , mainWorkspace$$module$build$src$core$common , selected$$module$build$src$core$common , parentContainer$$module$build$src$core$common , draggingConnections$$module$build$src$core$common , TEST _ONLY$$module$build$src$core$common ; WorkspaceDB _$$module$build$src$core$common = Object . create ( null ) ; selected$$module$build$src$core$common = null ; 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 = { } ; $ . 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 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" ; a [ a . DOCUMENT _POSITION _CONTAINED _BY = 16 ] = "DOCUMENT_POSITION_CONTAINED_BY" } ) ( 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 = { } ;
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 ; module$build$src$core$utils$dom . addClass = addClass$$module$build$src$core$utils$dom ; module$build$src$core$utils$dom . containsNode = containsNode$$module$build$src$core$utils$dom ;
module$build$src$core$utils$dom . createSvgElement = createSvgElement$$module$build$src$core$utils$dom ; module$build$src$core$utils$dom . getFastTextWidth = getFastTextWidth$$module$build$src$core$utils$dom ; module$build$src$core$utils$dom . getFastTextWidthWithSizeString = getFastTextWidthWithSizeString$$module$build$src$core$utils$dom ; module$build$src$core$utils$dom . getTextWidth = getTextWidth$$module$build$src$core$utils$dom ; module$build$src$core$utils$dom . hasClass = hasClass$$module$build$src$core$utils$dom ;
module$build$src$core$utils$dom . insertAfter = insertAfter$$module$build$src$core$utils$dom ; module$build$src$core$utils$dom . measureFontMetrics = measureFontMetrics$$module$build$src$core$utils$dom ; module$build$src$core$utils$dom . removeClass = removeClass$$module$build$src$core$utils$dom ; module$build$src$core$utils$dom . removeClasses = removeClasses$$module$build$src$core$utils$dom ; module$build$src$core$utils$dom . removeNode = removeNode$$module$build$src$core$utils$dom ;
module$build$src$core$utils$dom . setCssTransform = setCssTransform$$module$build$src$core$utils$dom ; module$build$src$core$utils$dom . startTextWidthCache = startTextWidthCache$$module$build$src$core$utils$dom ; module$build$src$core$utils$dom . stopTextWidthCache = stopTextWidthCache$$module$build$src$core$utils$dom ; 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 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 } contains ( a , b ) { return a >= this . left && a <= this . right && b >= this . top && b <= this . bottom } intersects ( a ) { return ! ( this . left > a . right || this . right < a . left || this . top > a . bottom || this . bottom < a . top ) } } , module$build$src$core$utils$rect = { } ; module$build$src$core$utils$rect . Rect = Rect$$module$build$src$core$utils$rect ; var module$build$src$core$utils$deprecation = { } ; module$build$src$core$utils$deprecation . warn = warn$$module$build$src$core$utils$deprecation ; 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 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 } } , 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 = { } ; 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 . getCascadedStyle = getCascadedStyle$$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 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 . height < e . bottom ? getPositionBelowMetrics$$module$build$src$core$dropdowndiv ( a , b , e , f ) : d - f . height > e . top ? getPositionAboveMetrics$$module$build$src$core$dropdowndiv ( c , d , e , f ) : b + f . height < document . documentElement . clientHeight ?
getPositionBelowMetrics$$module$build$src$core$dropdowndiv ( a , b , e , f ) : d - f . height > document . 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 = { } ; module$build$src$core$dropdowndiv . ANIMATION _TIME = ANIMATION _TIME$$module$build$src$core$dropdowndiv ;
module$build$src$core$dropdowndiv . ARROW _HORIZONTAL _PADDING = ARROW _HORIZONTAL _PADDING$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . ARROW _SIZE = ARROW _SIZE$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . BORDER _SIZE = BORDER _SIZE$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . PADDING _Y = PADDING _Y$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . TEST _ONLY = internal$$module$build$src$core$dropdowndiv ;
module$build$src$core$dropdowndiv . clearContent = clearContent$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . createDom = createDom$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . getContentDiv = getContentDiv$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . getPositionX = getPositionX$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . hide = hide$$module$build$src$core$dropdowndiv ;
module$build$src$core$dropdowndiv . hideIfOwner = hideIfOwner$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . hideWithoutAnimation = hideWithoutAnimation$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . isVisible = isVisible$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . repositionForWindowResize = repositionForWindowResize$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . setBoundsElement = setBoundsElement$$module$build$src$core$dropdowndiv ;
module$build$src$core$dropdowndiv . setColour = setColour$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . show = show$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . showPositionedByBlock = showPositionedByBlock$$module$build$src$core$dropdowndiv ; module$build$src$core$dropdowndiv . showPositionedByField = showPositionedByField$$module$build$src$core$dropdowndiv ; var typeMap$$module$build$src$core$registry = Object . create ( null ) , TEST _ONLY$$module$build$src$core$registry = { typeMap : typeMap$$module$build$src$core$registry } , nameMap$$module$build$src$core$registry = Object . create ( null ) , DEFAULT$$module$build$src$core$registry = "default" , Type$$module$build$src$core$registry = class { constructor ( a ) { this . name = a } toString ( ) { return this . name } } ; Type$$module$build$src$core$registry . CONNECTION _CHECKER = new Type$$module$build$src$core$registry ( "connectionChecker" ) ;
Type$$module$build$src$core$registry . CURSOR = new Type$$module$build$src$core$registry ( "cursor" ) ; Type$$module$build$src$core$registry . EVENT = new Type$$module$build$src$core$registry ( "event" ) ; Type$$module$build$src$core$registry . FIELD = new Type$$module$build$src$core$registry ( "field" ) ; Type$$module$build$src$core$registry . 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" ) ; var module$build$src$core$registry = { } ; module$build$src$core$registry . DEFAULT = DEFAULT$$module$build$src$core$registry ; 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 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 = { } ; 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 = ! 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 , 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" , FINISHED _LOADING$$module$build$src$core$events$utils = "finished_loading" , 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 = { } ; module$build$src$core$events$utils . BLOCK _CHANGE = CHANGE$$module$build$src$core$events$utils ;
module$build$src$core$events$utils . BLOCK _CREATE = CREATE$$module$build$src$core$events$utils ; module$build$src$core$events$utils . BLOCK _DELETE = DELETE$$module$build$src$core$events$utils ; module$build$src$core$events$utils . BLOCK _DRAG = BLOCK _DRAG$$module$build$src$core$events$utils ; module$build$src$core$events$utils . BLOCK _MOVE = MOVE$$module$build$src$core$events$utils ; module$build$src$core$events$utils . BUBBLE _OPEN = BUBBLE _OPEN$$module$build$src$core$events$utils ;
module$build$src$core$events$utils . BUMP _EVENTS = BUMP _EVENTS$$module$build$src$core$events$utils ; module$build$src$core$events$utils . CHANGE = CHANGE$$module$build$src$core$events$utils ; module$build$src$core$events$utils . CLICK = CLICK$$module$build$src$core$events$utils ; module$build$src$core$events$utils . COMMENT _CHANGE = COMMENT _CHANGE$$module$build$src$core$events$utils ; module$build$src$core$events$utils . COMMENT _CREATE = COMMENT _CREATE$$module$build$src$core$events$utils ;
module$build$src$core$events$utils . COMMENT _DELETE = COMMENT _DELETE$$module$build$src$core$events$utils ; module$build$src$core$events$utils . COMMENT _MOVE = COMMENT _MOVE$$module$build$src$core$events$utils ; module$build$src$core$events$utils . CREATE = CREATE$$module$build$src$core$events$utils ; module$build$src$core$events$utils . DELETE = DELETE$$module$build$src$core$events$utils ; module$build$src$core$events$utils . FINISHED _LOADING = FINISHED _LOADING$$module$build$src$core$events$utils ;
module$build$src$core$events$utils . MARKER _MOVE = MARKER _MOVE$$module$build$src$core$events$utils ; module$build$src$core$events$utils . MOVE = MOVE$$module$build$src$core$events$utils ; module$build$src$core$events$utils . SELECTED = SELECTED$$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 . THEME _CHANGE = THEME _CHANGE$$module$build$src$core$events$utils ;
module$build$src$core$events$utils . TOOLBOX _ITEM _SELECT = TOOLBOX _ITEM _SELECT$$module$build$src$core$events$utils ; module$build$src$core$events$utils . TRASHCAN _OPEN = TRASHCAN _OPEN$$module$build$src$core$events$utils ; module$build$src$core$events$utils . UI = UI$$module$build$src$core$events$utils ; module$build$src$core$events$utils . VAR _CREATE = VAR _CREATE$$module$build$src$core$events$utils ; module$build$src$core$events$utils . VAR _DELETE = VAR _DELETE$$module$build$src$core$events$utils ;
module$build$src$core$events$utils . VAR _RENAME = VAR _RENAME$$module$build$src$core$events$utils ; 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 inputTypes$$module$build$src$core$input _types ; ( function ( a ) { a [ a . VALUE = 1 ] = "VALUE" ; a [ a . STATEMENT = 3 ] = "STATEMENT" ; a [ a . DUMMY = 5 ] = "DUMMY" } ) ( inputTypes$$module$build$src$core$input _types || ( inputTypes$$module$build$src$core$input _types = { } ) ) ; $ . module$build$src$core$input _types = { } ; $ . module$build$src$core$input _types . inputTypes = inputTypes$$module$build$src$core$input _types ; var NAME _SPACE$$module$build$src$core$utils$xml , xmlDocument$$module$build$src$core$utils$xml ; NAME _SPACE$$module$build$src$core$utils$xml = "https://developers.google.com/blockly/xml" ; xmlDocument$$module$build$src$core$utils$xml = globalThis . document ; $ . module$build$src$core$utils$xml = { } ; $ . module$build$src$core$utils$xml . NAME _SPACE = NAME _SPACE$$module$build$src$core$utils$xml ; $ . module$build$src$core$utils$xml . createElement = createElement$$module$build$src$core$utils$xml ;
$ . module$build$src$core$utils$xml . createTextNode = createTextNode$$module$build$src$core$utils$xml ; $ . module$build$src$core$utils$xml . domToText = domToText$$module$build$src$core$utils$xml ; $ . module$build$src$core$utils$xml . getDocument = getDocument$$module$build$src$core$utils$xml ; $ . module$build$src$core$utils$xml . setDocument = setDocument$$module$build$src$core$utils$xml ; $ . module$build$src$core$utils$xml . textToDomDocument = textToDomDocument$$module$build$src$core$utils$xml ; 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 = { } ; 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 Msg$$module$build$src$core$msg , setLocale$$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 = { } ; $ . module$build$src$core$msg . Msg = Msg$$module$build$src$core$msg ; $ . module$build$src$core$msg . setLocale = setLocale$$module$build$src$core$msg ; 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 } } fromJson ( a ) { this . isBlank = ! 1 ; this . group = a . group || "" } 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 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 } fromJson ( a ) { super . fromJson ( a ) ; this . varId = a . varId } } , 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 ( ! 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 } fromJson ( a ) { super . fromJson ( a ) ; this . varType = a . varType ; this . varName = a . varName } 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 ( ) ; fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( VAR _CREATE$$module$build$src$core$events$utils ) ) ( this ) ) } 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 , VAR _LETTER _OPTIONS$$module$build$src$core$variables , TEST _ONLY$$module$build$src$core$variables ; 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 = { } ;
$ . module$build$src$core$variables . CATEGORY _NAME = CATEGORY _NAME$$module$build$src$core$variables ; $ . module$build$src$core$variables . TEST _ONLY = TEST _ONLY$$module$build$src$core$variables ; $ . 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 . promptName = promptName$$module$build$src$core$variables ; $ . module$build$src$core$variables . renameVariable = renameVariable$$module$build$src$core$variables ; var WorkspaceComment$$module$build$src$core$workspace _comment = class { constructor ( a , b , c , d , e ) { this . workspace = a ; this . editable _ = this . movable _ = this . deletable _ = ! 0 ; this . disposed _ = ! 1 ; this . isComment = ! 0 ; this . id = e && ! a . getCommentById ( e ) ? e : genUid$$module$build$src$core$utils$idgenerator ( ) ; a . addTopComment ( this ) ; this . xy _ = new Coordinate$$module$build$src$core$utils$coordinate ( 0 , 0 ) ; this . height _ = c ; this . width _ = d ; this . RTL = a . RTL ; this . content _ = b ; WorkspaceComment$$module$build$src$core$workspace _comment . fireCreateEvent ( this ) } dispose ( ) { this . disposed _ ||
( 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 ) ) , this . workspace . removeTopComment ( this ) , this . disposed _ = ! 0 ) } getHeight ( ) { return this . height _ } setHeight ( a ) { this . height _ = a } getWidth ( ) { return this . width _ } setWidth ( a ) { this . width _ = a } getXY ( ) { return new Coordinate$$module$build$src$core$utils$coordinate ( this . xy _ . x , this . xy _ . y ) } moveBy ( a , b ) { const c = new ( get$$module$build$src$core$events$utils ( COMMENT _MOVE$$module$build$src$core$events$utils ) ) ( this ) ;
this . xy _ . translate ( a , b ) ; c . recordNew ( ) ; fire$$module$build$src$core$events$utils ( c ) } isDeletable ( ) { return this . deletable _ && ! ( this . workspace && this . workspace . options . readOnly ) } setDeletable ( a ) { this . deletable _ = a } isMovable ( ) { return this . movable _ && ! ( this . workspace && this . workspace . options . readOnly ) } setMovable ( a ) { this . movable _ = a } isEditable ( ) { return this . editable _ && ! ( this . workspace && this . workspace . options . readOnly ) } setEditable ( a ) { this . editable _ = a } getContent ( ) { return this . content _ } setContent ( a ) { this . content _ !==
a && ( fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( COMMENT _CHANGE$$module$build$src$core$events$utils ) ) ( this , this . content _ , a ) ) , this . content _ = a ) } toXmlWithXY ( a ) { a = this . toXml ( a ) ; a . setAttribute ( "x" , ` ${ Math . round ( this . xy _ . x ) } ` ) ; a . setAttribute ( "y" , ` ${ Math . round ( this . xy _ . y ) } ` ) ; a . setAttribute ( "h" , ` ${ this . height _ } ` ) ; a . setAttribute ( "w" , ` ${ this . width _ } ` ) ; return a } toXml ( a ) { const b = createElement$$module$build$src$core$utils$xml ( "comment" ) ; a || ( b . id = this . id ) ; b . textContent =
this . getContent ( ) ; return b } static fireCreateEvent ( a ) { if ( isEnabled$$module$build$src$core$events$utils ( ) ) { const b = getGroup$$module$build$src$core$events$utils ( ) ; b || setGroup$$module$build$src$core$events$utils ( ! 0 ) ; try { fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( COMMENT _CREATE$$module$build$src$core$events$utils ) ) ( a ) ) } finally { b || setGroup$$module$build$src$core$events$utils ( ! 1 ) } } } static fromXml ( a , b ) { var c = WorkspaceComment$$module$build$src$core$workspace _comment . parseAttributes ( a ) ;
b = new WorkspaceComment$$module$build$src$core$workspace _comment ( b , c . content , c . h , c . w , c . id ) ; c = a . getAttribute ( "x" ) ; a = a . getAttribute ( "y" ) ; c = c ? parseInt ( c , 10 ) : NaN ; a = a ? parseInt ( a , 10 ) : NaN ; isNaN ( c ) || isNaN ( a ) || b . moveBy ( c , a ) ; WorkspaceComment$$module$build$src$core$workspace _comment . fireCreateEvent ( b ) ; return b } static parseAttributes ( a ) { const b = a . getAttribute ( "h" ) , c = a . getAttribute ( "w" ) , d = a . getAttribute ( "x" ) , e = a . getAttribute ( "y" ) , f = a . getAttribute ( "id" ) ; if ( ! f ) throw Error ( "No ID present in XML comment definition." ) ;
let g ; return { id : f , h : b ? parseInt ( b ) : 100 , w : c ? parseInt ( c ) : 100 , x : d ? parseInt ( d ) : NaN , y : e ? parseInt ( e ) : NaN , content : null != ( g = a . textContent ) ? g : "" } } } , module$build$src$core$workspace _comment = { } ; module$build$src$core$workspace _comment . WorkspaceComment = WorkspaceComment$$module$build$src$core$workspace _comment ; var UiBase$$module$build$src$core$events$events _ui _base = class extends Abstract$$module$build$src$core$events$events _abstract { constructor ( a ) { super ( ) ; this . isBlank = ! 0 ; this . recordUndo = ! 1 ; this . isUiEvent = ! 0 ; this . isBlank = "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 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 } fromJson ( a ) { super . fromJson ( a ) ; this . oldElementId = a . oldElementId ; this . newElementId = a . newElementId } } ;
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 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.blocklyWsDragSurface {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n}\n\n/* Added as a separate rule with multiple classes to make it more specific\n than a bootstrap rule that selects svg:root. See issue #1275 for context.\n*/\n.blocklyWsDragSurface.blocklyOverflowVisible {\n overflow: visible;\n}\n\n.blocklyBlockDragSurface {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: visible !important;\n z-index: 50; /* Display below toolbox, but above everything else. */\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: 1000;\n display: none;\n border: 1px solid;\n border-color: #dadce0;\n background-color: #fff;\n border-radius: 2px;\n padding: 4px;\n box-shadow: 0 0 3px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv.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 /* backup for browsers (e.g. IE11) that don\'t support grab */\n cursor: url("<<<PATH>>>/handopen.cur"), auto;\n cursor: grab;\n cursor: -webkit-grab;\n}\n\n /* backup for browsers (e.g. IE11) that don\'t support grabbing */\n.blocklyDragging {\n /* backup for browsers (e.g. IE11) that don\' t support grabbing * / \ n c u r s o r : u r l ( " < < < P A T H > > > / h a n d c l o s e d . c u r " ) , a u t o ; \ n c u r s o r : g r a b b i n g ; \ n c u r s o r : - w e b k i t - g r a b b i n g ; \ n } \ n \ n / * C h a n g e s c u r s o r o n m o u s e
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 Svg$$module$build$src$core$utils$svg = class { constructor ( a ) { this . tagName = a } toString ( ) { return this . tagName } } ; Svg$$module$build$src$core$utils$svg . ANIMATE = new Svg$$module$build$src$core$utils$svg ( "animate" ) ; Svg$$module$build$src$core$utils$svg . CIRCLE = new Svg$$module$build$src$core$utils$svg ( "circle" ) ; Svg$$module$build$src$core$utils$svg . CLIPPATH = new Svg$$module$build$src$core$utils$svg ( "clipPath" ) ; Svg$$module$build$src$core$utils$svg . DEFS = new Svg$$module$build$src$core$utils$svg ( "defs" ) ;
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 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 = { } ; 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 . is3dSupported = is3dSupported$$module$build$src$core$utils$svg _math ;
module$build$src$core$utils$svg _math . screenToWsCoordinates = screenToWsCoordinates$$module$build$src$core$utils$svg _math ; var RESIZE _SIZE$$module$build$src$core$workspace _comment _svg = 8 , BORDER _RADIUS$$module$build$src$core$workspace _comment _svg = 3 , TEXTAREA _OFFSET$$module$build$src$core$workspace _comment _svg = 2 , WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg = class extends WorkspaceComment$$module$build$src$core$workspace _comment { constructor ( a , b , c , d , e ) { super ( a , b , c , d , e ) ; this . onMouseMoveWrapper _ = this . onMouseUpWrapper _ = null ; this . eventsInit _ = ! 1 ; this . deleteIconBorder _ = this . deleteGroup _ = this . resizeGroup _ = this . foreignObject _ =
this . svgHandleTarget _ = this . svgRectTarget _ = this . textarea _ = null ; this . rendered _ = this . autoLayout _ = this . focused _ = ! 1 ; this . svgGroup _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G , { "class" : "blocklyComment" } ) ; this . svgGroup _ . translate _ = "" ; this . workspace = a ; this . svgRect _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "blocklyCommentRect" , x : 0 , y : 0 , rx : BORDER _RADIUS$$module$build$src$core$workspace _comment _svg , ry : BORDER _RADIUS$$module$build$src$core$workspace _comment _svg } ) ;
this . svgGroup _ . appendChild ( this . svgRect _ ) ; this . useDragSurface _ = ! ! a . getBlockDragSurface ( ) ; this . render ( ) } dispose ( ) { this . disposed _ || ( getSelected$$module$build$src$core$common ( ) === this && ( this . unselect ( ) , this . workspace . cancelCurrentGesture ( ) ) , 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 ) ) , removeNode$$module$build$src$core$utils$dom ( this . svgGroup _ ) , this . disposeInternal _ ( ) ,
disable$$module$build$src$core$events$utils ( ) , super . dispose ( ) , enable$$module$build$src$core$events$utils ( ) ) } initSvg ( a ) { if ( ! this . workspace . rendered ) throw TypeError ( "Workspace is headless." ) ; this . workspace . options . readOnly || this . eventsInit _ || ( conditionalBind$$module$build$src$core$browser _events ( this . svgRectTarget _ , "mousedown" , this , this . pathMouseDown _ ) , conditionalBind$$module$build$src$core$browser _events ( this . svgHandleTarget _ , "mousedown" , this , this . pathMouseDown _ ) ) ; this . eventsInit _ = ! 0 ; this . updateMovable ( ) ;
this . getSvgRoot ( ) . parentNode || this . workspace . getBubbleCanvas ( ) . appendChild ( this . getSvgRoot ( ) ) ; ! a && this . textarea _ && this . textarea _ . select ( ) } pathMouseDown _ ( a ) { const b = this . workspace . getGesture ( a ) ; b && b . handleBubbleStart ( a , this ) } showContextMenu ( a ) { throw Error ( "The implementation of showContextMenu should be monkey-patched in by blockly.ts" ) ; } select ( ) { if ( getSelected$$module$build$src$core$common ( ) !== this ) { var a = null ; if ( getSelected$$module$build$src$core$common ( ) ) { a = getSelected$$module$build$src$core$common ( ) . id ;
disable$$module$build$src$core$events$utils ( ) ; try { getSelected$$module$build$src$core$common ( ) . unselect ( ) } finally { enable$$module$build$src$core$events$utils ( ) } } a = new ( get$$module$build$src$core$events$utils ( SELECTED$$module$build$src$core$events$utils ) ) ( a , this . id , this . workspace . id ) ; fire$$module$build$src$core$events$utils ( a ) ; setSelected$$module$build$src$core$common ( this ) ; this . addSelect ( ) } } unselect ( ) { if ( getSelected$$module$build$src$core$common ( ) === this ) { var a = new ( get$$module$build$src$core$events$utils ( SELECTED$$module$build$src$core$events$utils ) ) ( this . id ,
null , this . workspace . id ) ; fire$$module$build$src$core$events$utils ( a ) ; setSelected$$module$build$src$core$common ( null ) ; this . removeSelect ( ) ; this . blurFocus ( ) } } addSelect ( ) { addClass$$module$build$src$core$utils$dom ( this . svgGroup _ , "blocklySelected" ) ; this . setFocus ( ) } removeSelect ( ) { addClass$$module$build$src$core$utils$dom ( this . svgGroup _ , "blocklySelected" ) ; this . blurFocus ( ) } addFocus ( ) { addClass$$module$build$src$core$utils$dom ( this . svgGroup _ , "blocklyFocused" ) } removeFocus ( ) { removeClass$$module$build$src$core$utils$dom ( this . svgGroup _ ,
"blocklyFocused" ) } getRelativeToSurfaceXY ( ) { let a = 0 , b = 0 ; const c = this . useDragSurface _ ? this . workspace . getBlockDragSurface ( ) . getGroup ( ) : null ; let d = this . getSvgRoot ( ) ; if ( d ) { do { var e = getRelativeXY$$module$build$src$core$utils$svg _math ( d ) ; a += e . x ; b += e . y ; this . useDragSurface _ && this . workspace . getBlockDragSurface ( ) . getCurrentBlock ( ) === d && ( e = this . workspace . getBlockDragSurface ( ) . getSurfaceTranslation ( ) , a += e . x , b += e . y ) ; d = d . parentNode } while ( d && d !== this . workspace . getBubbleCanvas ( ) && d !== c ) } return this . xy _ = new Coordinate$$module$build$src$core$utils$coordinate ( a ,
b ) } moveBy ( a , b ) { const c = new ( get$$module$build$src$core$events$utils ( COMMENT _MOVE$$module$build$src$core$events$utils ) ) ( this ) , d = this . getRelativeToSurfaceXY ( ) ; this . translate ( d . x + a , d . y + b ) ; this . xy _ = new Coordinate$$module$build$src$core$utils$coordinate ( d . x + a , d . y + b ) ; c . recordNew ( ) ; fire$$module$build$src$core$events$utils ( c ) ; this . workspace . resizeContents ( ) } translate ( a , b ) { this . xy _ = new Coordinate$$module$build$src$core$utils$coordinate ( a , b ) ; this . getSvgRoot ( ) . setAttribute ( "transform" , "translate(" + a + "," + b + ")" ) } moveToDragSurface ( ) { if ( this . useDragSurface _ ) { var a =
this . getRelativeToSurfaceXY ( ) ; this . clearTransformAttributes _ ( ) ; this . workspace . getBlockDragSurface ( ) . translateSurface ( a . x , a . y ) ; this . workspace . getBlockDragSurface ( ) . setBlocksAndShow ( this . getSvgRoot ( ) ) } } moveDuringDrag ( a , b ) { a ? a . translateSurface ( b . x , b . y ) : ( this . svgGroup _ . translate _ = "translate(" + b . x + "," + b . y + ")" , this . svgGroup _ . setAttribute ( "transform" , this . svgGroup _ . translate _ + this . svgGroup _ . skew _ ) ) } moveTo ( a , b ) { this . translate ( a , b ) } clearTransformAttributes _ ( ) { this . getSvgRoot ( ) . removeAttribute ( "transform" ) } getBoundingRectangle ( ) { var a =
this . getRelativeToSurfaceXY ( ) ; const b = this . getHeightWidth ( ) , c = a . y , d = a . y + b . height ; let e ; this . RTL ? ( e = a . x - b . width , a = a . x ) : ( e = a . x , a = a . x + b . width ) ; return new Rect$$module$build$src$core$utils$rect ( c , d , e , a ) } updateMovable ( ) { this . isMovable ( ) ? addClass$$module$build$src$core$utils$dom ( this . svgGroup _ , "blocklyDraggable" ) : removeClass$$module$build$src$core$utils$dom ( this . svgGroup _ , "blocklyDraggable" ) } setMovable ( a ) { super . setMovable ( a ) ; this . updateMovable ( ) } setEditable ( a ) { super . setEditable ( a ) ; this . textarea _ && ( this . textarea _ . readOnly =
! a ) } setDragging ( a ) { a ? ( a = this . getSvgRoot ( ) , a . translate _ = "" , a . skew _ = "" , addClass$$module$build$src$core$utils$dom ( this . svgGroup _ , "blocklyDragging" ) ) : removeClass$$module$build$src$core$utils$dom ( this . svgGroup _ , "blocklyDragging" ) } getSvgRoot ( ) { return this . svgGroup _ } getContent ( ) { return this . textarea _ ? this . textarea _ . value : this . content _ } setContent ( a ) { super . setContent ( a ) ; this . textarea _ && ( this . textarea _ . value = a ) } setDeleteStyle ( a ) { a ? addClass$$module$build$src$core$utils$dom ( this . svgGroup _ , "blocklyDraggingDelete" ) :
removeClass$$module$build$src$core$utils$dom ( this . svgGroup _ , "blocklyDraggingDelete" ) } setAutoLayout ( a ) { } toXmlWithXY ( a ) { let b = 0 ; this . workspace . RTL && ( b = this . workspace . getWidth ( ) ) ; a = this . toXml ( a ) ; const c = this . getRelativeToSurfaceXY ( ) ; a . setAttribute ( "x" , Math . round ( this . workspace . RTL ? b - c . x : c . x ) ) ; a . setAttribute ( "y" , Math . round ( c . y ) ) ; a . setAttribute ( "h" , this . getHeight ( ) ) ; a . setAttribute ( "w" , this . getWidth ( ) ) ; return a } toCopyData ( ) { return { saveInfo : this . toXmlWithXY ( ) , source : this . workspace , typeCounts : null } } getHeightWidth ( ) { return { width : this . getWidth ( ) ,
height : this . getHeight ( ) } } render ( ) { if ( ! this . rendered _ ) { var a = this . getHeightWidth ( ) ; this . createEditor _ ( ) ; this . svgGroup _ . appendChild ( this . foreignObject _ ) ; this . svgHandleTarget _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "blocklyCommentHandleTarget" , x : 0 , y : 0 } ) ; this . svgGroup _ . appendChild ( this . svgHandleTarget _ ) ; this . svgRectTarget _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "blocklyCommentTarget" ,
x : 0 , y : 0 , rx : BORDER _RADIUS$$module$build$src$core$workspace _comment _svg , ry : BORDER _RADIUS$$module$build$src$core$workspace _comment _svg } ) ; this . svgGroup _ . appendChild ( this . svgRectTarget _ ) ; this . addResizeDom _ ( ) ; this . isDeletable ( ) && this . addDeleteDom _ ( ) ; this . setSize _ ( a . width , a . height ) ; this . textarea _ . value = this . content _ ; this . rendered _ = ! 0 ; this . resizeGroup _ && conditionalBind$$module$build$src$core$browser _events ( this . resizeGroup _ , "mousedown" , this , this . resizeMouseDown _ ) ; this . isDeletable ( ) && ( conditionalBind$$module$build$src$core$browser _events ( this . deleteGroup _ ,
"mousedown" , this , this . deleteMouseDown _ ) , conditionalBind$$module$build$src$core$browser _events ( this . deleteGroup _ , "mouseout" , this , this . deleteMouseOut _ ) , conditionalBind$$module$build$src$core$browser _events ( this . deleteGroup _ , "mouseup" , this , this . deleteMouseUp _ ) ) } } createEditor _ ( ) { this . foreignObject _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FOREIGNOBJECT , { x : 0 , y : WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg . TOP _OFFSET , "class" : "blocklyCommentForeignObject" } ) ;
const a = document . createElementNS ( HTML _NS$$module$build$src$core$utils$dom , "body" ) ; a . setAttribute ( "xmlns" , HTML _NS$$module$build$src$core$utils$dom ) ; a . className = "blocklyMinimalBody" ; const b = document . createElementNS ( HTML _NS$$module$build$src$core$utils$dom , "textarea" ) ; b . className = "blocklyCommentTextarea" ; b . setAttribute ( "dir" , this . RTL ? "RTL" : "LTR" ) ; b . readOnly = ! this . isEditable ( ) ; a . appendChild ( b ) ; this . textarea _ = b ; this . foreignObject _ . appendChild ( a ) ; conditionalBind$$module$build$src$core$browser _events ( b ,
"wheel" , this , function ( c ) { c . stopPropagation ( ) } ) ; conditionalBind$$module$build$src$core$browser _events ( b , "change" , this , function ( c ) { this . setContent ( b . value ) } ) ; return this . foreignObject _ } addResizeDom _ ( ) { this . resizeGroup _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G , { "class" : this . RTL ? "blocklyResizeSW" : "blocklyResizeSE" } , this . svgGroup _ ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . POLYGON , { points : "0,x x,x x,0" . replace ( /x/g ,
RESIZE _SIZE$$module$build$src$core$workspace _comment _svg . toString ( ) ) } , this . resizeGroup _ ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . LINE , { "class" : "blocklyResizeLine" , x1 : RESIZE _SIZE$$module$build$src$core$workspace _comment _svg / 3 , y1 : RESIZE _SIZE$$module$build$src$core$workspace _comment _svg - 1 , x2 : RESIZE _SIZE$$module$build$src$core$workspace _comment _svg - 1 , y2 : RESIZE _SIZE$$module$build$src$core$workspace _comment _svg / 3 } , this . resizeGroup _ ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . LINE ,
{ "class" : "blocklyResizeLine" , x1 : 2 * RESIZE _SIZE$$module$build$src$core$workspace _comment _svg / 3 , y1 : RESIZE _SIZE$$module$build$src$core$workspace _comment _svg - 1 , x2 : RESIZE _SIZE$$module$build$src$core$workspace _comment _svg - 1 , y2 : 2 * RESIZE _SIZE$$module$build$src$core$workspace _comment _svg / 3 } , this . resizeGroup _ ) } addDeleteDom _ ( ) { this . deleteGroup _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G , { "class" : "blocklyCommentDeleteIcon" } , this . svgGroup _ ) ; this . deleteIconBorder _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . CIRCLE ,
{ "class" : "blocklyDeleteIconShape" , r : "7" , cx : "7.5" , cy : "7.5" } , this . deleteGroup _ ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . LINE , { x1 : "5" , y1 : "10" , x2 : "10" , y2 : "5" , stroke : "#fff" , "stroke-width" : "2" } , this . deleteGroup _ ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . LINE , { x1 : "5" , y1 : "5" , x2 : "10" , y2 : "10" , stroke : "#fff" , "stroke-width" : "2" } , this . deleteGroup _ ) } resizeMouseDown _ ( a ) { this . unbindDragEvents _ ( ) ; isRightButton$$module$build$src$core$browser _events ( a ) ||
( this . workspace . startDrag ( a , new Coordinate$$module$build$src$core$utils$coordinate ( this . workspace . RTL ? - this . width _ : this . width _ , this . height _ ) ) , this . onMouseUpWrapper _ = conditionalBind$$module$build$src$core$browser _events ( document , "mouseup" , this , this . resizeMouseUp _ ) , this . onMouseMoveWrapper _ = conditionalBind$$module$build$src$core$browser _events ( document , "mousemove" , this , this . resizeMouseMove _ ) , this . workspace . hideChaff ( ) ) ; a . stopPropagation ( ) } deleteMouseDown _ ( a ) { this . deleteIconBorder _ && addClass$$module$build$src$core$utils$dom ( this . deleteIconBorder _ ,
"blocklyDeleteIconHighlighted" ) ; a . stopPropagation ( ) } deleteMouseOut _ ( a ) { this . deleteIconBorder _ && removeClass$$module$build$src$core$utils$dom ( this . deleteIconBorder _ , "blocklyDeleteIconHighlighted" ) } deleteMouseUp _ ( a ) { this . dispose ( ) ; a . stopPropagation ( ) } unbindDragEvents _ ( ) { this . onMouseUpWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onMouseUpWrapper _ ) , this . onMouseUpWrapper _ = null ) ; this . onMouseMoveWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onMouseMoveWrapper _ ) , this . onMouseMoveWrapper _ =
null ) } resizeMouseUp _ ( a ) { clearTouchIdentifier$$module$build$src$core$touch ( ) ; this . unbindDragEvents _ ( ) } resizeMouseMove _ ( a ) { this . autoLayout _ = ! 1 ; a = this . workspace . moveDrag ( a ) ; this . setSize _ ( this . RTL ? - a . x : a . x , a . y ) } resizeComment _ ( ) { const a = this . getHeightWidth ( ) , b = WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg . TOP _OFFSET , c = 2 * TEXTAREA _OFFSET$$module$build$src$core$workspace _comment _svg ; this . foreignObject _ . setAttribute ( "width" , a . width ) ; this . foreignObject _ . setAttribute ( "height" , ( a . height - b ) . toString ( ) ) ;
this . RTL && this . foreignObject _ . setAttribute ( "x" , ( - a . width ) . toString ( ) ) ; this . textarea _ . style . width = a . width - c + "px" ; this . textarea _ . style . height = a . height - c - b + "px" } setSize _ ( a , b ) { a = Math . max ( a , 45 ) ; b = Math . max ( b , 20 + WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg . TOP _OFFSET ) ; this . width _ = a ; this . height _ = b ; this . svgRect _ . setAttribute ( "width" , a ) ; this . svgRect _ . setAttribute ( "height" , b ) ; this . svgRectTarget _ . setAttribute ( "width" , a ) ; this . svgRectTarget _ . setAttribute ( "height" , b ) ; this . svgHandleTarget _ . setAttribute ( "width" ,
a ) ; this . svgHandleTarget _ . setAttribute ( "height" , WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg . TOP _OFFSET ) ; this . RTL && ( this . svgRect _ . setAttribute ( "transform" , "scale(-1 1)" ) , this . svgRectTarget _ . setAttribute ( "transform" , "scale(-1 1)" ) ) ; this . resizeGroup _ && ( this . RTL ? ( this . resizeGroup _ . setAttribute ( "transform" , "translate(" + ( - a + RESIZE _SIZE$$module$build$src$core$workspace _comment _svg ) + "," + ( b - RESIZE _SIZE$$module$build$src$core$workspace _comment _svg ) + ") scale(-1 1)" ) , this . deleteGroup _ . setAttribute ( "transform" ,
"translate(" + ( - a + RESIZE _SIZE$$module$build$src$core$workspace _comment _svg ) + "," + - RESIZE _SIZE$$module$build$src$core$workspace _comment _svg + ") scale(-1 1)" ) ) : ( this . resizeGroup _ . setAttribute ( "transform" , "translate(" + ( a - RESIZE _SIZE$$module$build$src$core$workspace _comment _svg ) + "," + ( b - RESIZE _SIZE$$module$build$src$core$workspace _comment _svg ) + ")" ) , this . deleteGroup _ . setAttribute ( "transform" , "translate(" + ( a - RESIZE _SIZE$$module$build$src$core$workspace _comment _svg ) + "," + - RESIZE _SIZE$$module$build$src$core$workspace _comment _svg +
")" ) ) ) ; this . resizeComment _ ( ) } disposeInternal _ ( ) { this . svgHandleTarget _ = this . svgRectTarget _ = this . foreignObject _ = this . textarea _ = null ; this . disposed _ = ! 0 } setFocus ( ) { this . focused _ = ! 0 ; setTimeout ( ( ) => { this . disposed _ || ( this . textarea _ . focus ( ) , this . addFocus ( ) , this . svgRectTarget _ && addClass$$module$build$src$core$utils$dom ( this . svgRectTarget _ , "blocklyCommentTargetFocused" ) , this . svgHandleTarget _ && addClass$$module$build$src$core$utils$dom ( this . svgHandleTarget _ , "blocklyCommentHandleTargetFocused" ) ) } , 0 ) } blurFocus ( ) { this . focused _ =
! 1 ; setTimeout ( ( ) => { this . disposed _ || ( this . textarea _ . blur ( ) , this . removeFocus ( ) , this . svgRectTarget _ && removeClass$$module$build$src$core$utils$dom ( this . svgRectTarget _ , "blocklyCommentTargetFocused" ) , this . svgHandleTarget _ && removeClass$$module$build$src$core$utils$dom ( this . svgHandleTarget _ , "blocklyCommentHandleTargetFocused" ) ) } , 0 ) } static fromXmlRendered ( a , b , c ) { disable$$module$build$src$core$events$utils ( ) ; let d ; try { const e = WorkspaceComment$$module$build$src$core$workspace _comment . parseAttributes ( a ) ; d = new WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg ( b ,
e . content , e . h , e . w , e . id ) ; b . rendered && ( d . initSvg ( ! 0 ) , d . render ( ) ) ; if ( ! isNaN ( e . x ) && ! isNaN ( e . y ) ) if ( b . RTL ) { const f = c || b . getWidth ( ) ; d . moveBy ( f - e . x , e . y ) } else d . moveBy ( e . x , e . y ) } finally { enable$$module$build$src$core$events$utils ( ) } WorkspaceComment$$module$build$src$core$workspace _comment . fireCreateEvent ( d ) ; return d } } ; WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg . DEFAULT _SIZE = 100 ; WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg . TOP _OFFSET = 10 ; register$$module$build$src$core$css ( "\n.blocklyCommentForeignObject {\n position: relative;\n z-index: 0;\n}\n\n.blocklyCommentRect {\n fill: #E7DE8E;\n stroke: #bcA903;\n stroke-width: 1px;\n}\n\n.blocklyCommentTarget {\n fill: transparent;\n stroke: #bcA903;\n}\n\n.blocklyCommentTargetFocused {\n fill: none;\n}\n\n.blocklyCommentHandleTarget {\n fill: none;\n}\n\n.blocklyCommentHandleTargetFocused {\n fill: transparent;\n}\n\n.blocklyFocused>.blocklyCommentRect {\n fill: #B9B272;\n stroke: #B9B272;\n}\n\n.blocklySelected>.blocklyCommentTarget {\n stroke: #fc3;\n stroke-width: 3px;\n}\n\n.blocklyCommentDeleteIcon {\n cursor: pointer;\n fill: #000;\n display: none;\n}\n\n.blocklySelected > .blocklyCommentDeleteIcon {\n display: block;\n}\n\n.blocklyDeleteIconShape {\n fill: #000;\n stroke: #000;\n stroke-width: 1px;\n}\n\n.blocklyDeleteIconShape.blocklyDeleteIconHighlighted {\n stroke: #fc3;\n}\n" ) ;
var module$build$src$core$workspace _comment _svg = { } ; module$build$src$core$workspace _comment _svg . WorkspaceCommentSvg = WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg ; $ . 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 . 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 . textToDom = textToDom$$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 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 } fromJson ( a ) { super . fromJson ( a ) ; this . blockId = a . blockId } } , 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 ; return a } fromJson ( a ) { super . fromJson ( a ) ; this . element = a . element ; this . name = a . name ; this . oldValue = a . oldValue ; this . newValue = a . newValue } 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" ) ;
b . mutator && b . mutator . setVisible ( ! 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" : b . setEnabled ( ! a ) ; break ; case "inline" : b . setInputsInline ( ! ! a ) ; break ; case "mutation" : const c = 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$xml ( a || "<mutation/>" ) ) ; fire$$module$build$src$core$events$utils ( new BlockChange$$module$build$src$core$events$events _block _change ( b , "mutation" , null , c , a ) ) ; break ; default : console . warn ( "Unknown change type: " + this . element ) } } static getExtraBlockState _ ( a ) { return a . saveExtraState ? ( a = a . saveExtraState ( ) ) ? 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 MarkerManager$$module$build$src$core$marker _manager = class { constructor ( a ) { this . workspace = a ; this . cursorSvg _ = this . cursor _ = null ; this . markers = new Map ; this . markerSvg _ = null } registerMarker ( a , b ) { this . markers . has ( a ) && this . unregisterMarker ( a ) ; b . setDrawer ( this . workspace . getRenderer ( ) . makeMarkerDrawer ( this . workspace , b ) ) ; this . setMarkerSvg ( b . getDrawer ( ) . createDom ( ) ) ; this . markers . set ( a , b ) } unregisterMarker ( a ) { const b = this . markers . get ( a ) ; if ( b ) b . dispose ( ) , this . markers . delete ( a ) ; else throw Error ( "Marker with ID " +
a + " does not exist. Can only unregister markers that exist." ) ; } getCursor ( ) { return this . cursor _ } getMarker ( a ) { return this . markers . get ( a ) || null } setCursor ( a ) { this . cursor _ && this . cursor _ . getDrawer ( ) && this . cursor _ . getDrawer ( ) . dispose ( ) ; if ( this . cursor _ = a ) a = this . workspace . getRenderer ( ) . makeMarkerDrawer ( this . workspace , this . cursor _ ) , this . cursor _ . setDrawer ( a ) , this . setCursorSvg ( this . cursor _ . getDrawer ( ) . createDom ( ) ) } setCursorSvg ( a ) { a ? ( this . workspace . getBlockCanvas ( ) . appendChild ( a ) , this . cursorSvg _ = a ) : this . cursorSvg _ =
null } setMarkerSvg ( a ) { a ? this . workspace . getBlockCanvas ( ) && ( this . cursorSvg _ ? this . workspace . getBlockCanvas ( ) . insertBefore ( a , this . cursorSvg _ ) : this . workspace . getBlockCanvas ( ) . appendChild ( a ) ) : this . markerSvg _ = null } updateMarkers ( ) { this . workspace . keyboardAccessibilityMode && this . cursorSvg _ && this . workspace . getCursor ( ) . draw ( ) } dispose ( ) { const a = Object . keys ( this . markers ) ; for ( let b = 0 , c ; c = a [ b ] ; b ++ ) this . unregisterMarker ( c ) ; this . markers . clear ( ) ; this . cursor _ && ( this . cursor _ . dispose ( ) , this . cursor _ = null ) } } ;
MarkerManager$$module$build$src$core$marker _manager . LOCAL _MARKER = "local_marker_1" ; var module$build$src$core$marker _manager = { } ; module$build$src$core$marker _manager . MarkerManager = MarkerManager$$module$build$src$core$marker _manager ; $ . module$build$src$core$utils$string = { } ; $ . module$build$src$core$utils$string . commonWordPrefix = commonWordPrefix$$module$build$src$core$utils$string ; $ . module$build$src$core$utils$string . commonWordSuffix = commonWordSuffix$$module$build$src$core$utils$string ; $ . module$build$src$core$utils$string . isNumber = isNumber$$module$build$src$core$utils$string ; $ . module$build$src$core$utils$string . shortestStringLength = shortestStringLength$$module$build$src$core$utils$string ;
$ . module$build$src$core$utils$string . startsWith = startsWith$$module$build$src$core$utils$string ; $ . module$build$src$core$utils$string . wrap = wrap$$module$build$src$core$utils$string ; var customTooltip$$module$build$src$core$tooltip = void 0 , visible$$module$build$src$core$tooltip = ! 1 , blocked$$module$build$src$core$tooltip = ! 1 , LIMIT$$module$build$src$core$tooltip = 50 , mouseOutPid$$module$build$src$core$tooltip = 0 , showPid$$module$build$src$core$tooltip = 0 , lastX$$module$build$src$core$tooltip = 0 , lastY$$module$build$src$core$tooltip = 0 , element$$module$build$src$core$tooltip = null , poisonedElement$$module$build$src$core$tooltip = null , OFFSET _X$$module$build$src$core$tooltip = 0 , OFFSET _Y$$module$build$src$core$tooltip =
10 , RADIUS _OK$$module$build$src$core$tooltip = 10 , HOVER _MS$$module$build$src$core$tooltip = 750 , MARGINS$$module$build$src$core$tooltip = 5 , containerDiv$$module$build$src$core$tooltip = null , module$build$src$core$tooltip = { } ; module$build$src$core$tooltip . HOVER _MS = HOVER _MS$$module$build$src$core$tooltip ; module$build$src$core$tooltip . LIMIT = LIMIT$$module$build$src$core$tooltip ; module$build$src$core$tooltip . MARGINS = MARGINS$$module$build$src$core$tooltip ; module$build$src$core$tooltip . OFFSET _X = OFFSET _X$$module$build$src$core$tooltip ;
module$build$src$core$tooltip . OFFSET _Y = OFFSET _Y$$module$build$src$core$tooltip ; module$build$src$core$tooltip . RADIUS _OK = RADIUS _OK$$module$build$src$core$tooltip ; module$build$src$core$tooltip . bindMouseEvents = bindMouseEvents$$module$build$src$core$tooltip ; module$build$src$core$tooltip . block = block$$module$build$src$core$tooltip ; module$build$src$core$tooltip . createDom = createDom$$module$build$src$core$tooltip ; module$build$src$core$tooltip . dispose = dispose$$module$build$src$core$tooltip ;
module$build$src$core$tooltip . getCustomTooltip = getCustomTooltip$$module$build$src$core$tooltip ; module$build$src$core$tooltip . getDiv = getDiv$$module$build$src$core$tooltip ; module$build$src$core$tooltip . getTooltipOfObject = getTooltipOfObject$$module$build$src$core$tooltip ; module$build$src$core$tooltip . hide = hide$$module$build$src$core$tooltip ; module$build$src$core$tooltip . isVisible = isVisible$$module$build$src$core$tooltip ; module$build$src$core$tooltip . setCustomTooltip = setCustomTooltip$$module$build$src$core$tooltip ;
module$build$src$core$tooltip . unbindMouseEvents = unbindMouseEvents$$module$build$src$core$tooltip ; module$build$src$core$tooltip . unblock = unblock$$module$build$src$core$tooltip ; var hsvSaturation$$module$build$src$core$utils$colour = . 45 , hsvValue$$module$build$src$core$utils$colour = . 65 , names$$module$build$src$core$utils$colour = { aqua : "#00ffff" , black : "#000000" , blue : "#0000ff" , fuchsia : "#ff00ff" , gray : "#808080" , green : "#008000" , lime : "#00ff00" , maroon : "#800000" , navy : "#000080" , olive : "#808000" , purple : "#800080" , red : "#ff0000" , silver : "#c0c0c0" , teal : "#008080" , white : "#ffffff" , yellow : "#ffff00" } , module$build$src$core$utils$colour = { } ; module$build$src$core$utils$colour . blend = blend$$module$build$src$core$utils$colour ;
module$build$src$core$utils$colour . getHsvSaturation = getHsvSaturation$$module$build$src$core$utils$colour ; module$build$src$core$utils$colour . getHsvValue = getHsvValue$$module$build$src$core$utils$colour ; module$build$src$core$utils$colour . hexToRgb = hexToRgb$$module$build$src$core$utils$colour ; module$build$src$core$utils$colour . hsvToHex = hsvToHex$$module$build$src$core$utils$colour ; module$build$src$core$utils$colour . hueToHex = hueToHex$$module$build$src$core$utils$colour ;
module$build$src$core$utils$colour . names = names$$module$build$src$core$utils$colour ; module$build$src$core$utils$colour . parse = parse$$module$build$src$core$utils$colour ; module$build$src$core$utils$colour . rgbToHex = rgbToHex$$module$build$src$core$utils$colour ; module$build$src$core$utils$colour . setHsvSaturation = setHsvSaturation$$module$build$src$core$utils$colour ; module$build$src$core$utils$colour . setHsvValue = setHsvValue$$module$build$src$core$utils$colour ; var module$build$src$core$utils$parsing = { } ; module$build$src$core$utils$parsing . checkMessageReferences = checkMessageReferences$$module$build$src$core$utils$parsing ; module$build$src$core$utils$parsing . parseBlockColour = parseBlockColour$$module$build$src$core$utils$parsing ; module$build$src$core$utils$parsing . replaceMessageReferences = replaceMessageReferences$$module$build$src$core$utils$parsing ; module$build$src$core$utils$parsing . tokenizeInterpolation = tokenizeInterpolation$$module$build$src$core$utils$parsing ; var Sentinel$$module$build$src$core$utils$sentinel = class { } , module$build$src$core$utils$sentinel = { } ; module$build$src$core$utils$sentinel . Sentinel = Sentinel$$module$build$src$core$utils$sentinel ; var owner$$module$build$src$core$widgetdiv = null , dispose$$module$build$src$core$widgetdiv = null , rendererClassName$$module$build$src$core$widgetdiv = "" , themeClassName$$module$build$src$core$widgetdiv = "" , containerDiv$$module$build$src$core$widgetdiv , module$build$src$core$widgetdiv = { } ; module$build$src$core$widgetdiv . createDom = createDom$$module$build$src$core$widgetdiv ; module$build$src$core$widgetdiv . getDiv = getDiv$$module$build$src$core$widgetdiv ; module$build$src$core$widgetdiv . hide = hide$$module$build$src$core$widgetdiv ;
module$build$src$core$widgetdiv . hideIfOwner = hideIfOwner$$module$build$src$core$widgetdiv ; module$build$src$core$widgetdiv . isVisible = isVisible$$module$build$src$core$widgetdiv ; module$build$src$core$widgetdiv . positionWithAnchor = positionWithAnchor$$module$build$src$core$widgetdiv ; module$build$src$core$widgetdiv . show = show$$module$build$src$core$widgetdiv ; module$build$src$core$widgetdiv . testOnly _setDiv = testOnly _setDiv$$module$build$src$core$widgetdiv ; var Field$$module$build$src$core$field = class { constructor ( a , b , c ) { this . name = void 0 ; this . constants _ = this . mouseDownWrapper _ = this . textContent _ = this . textElement _ = this . borderRect _ = this . fieldGroup _ = this . markerSvg _ = this . cursorSvg _ = this . tooltip _ = this . validator _ = null ; this . disposed = ! 1 ; this . maxDisplayLength = 50 ; this . sourceBlock _ = null ; this . enabled _ = this . visible _ = this . isDirty _ = ! 0 ; this . suffixField = this . prefixField = this . clickTarget _ = null ; this . EDITABLE = ! 0 ; this . SERIALIZABLE = ! 1 ; this . CURSOR = "" ; this . value _ = "DEFAULT_VALUE" in
new . target . prototype ? new . target . prototype . DEFAULT _VALUE : null ; this . size _ = new Size$$module$build$src$core$utils$size ( 0 , 0 ) ; a !== Field$$module$build$src$core$field . SKIP _SETUP && ( c && this . configure _ ( c ) , this . setValue ( a ) , b && this . setValidator ( b ) ) } configure _ ( a ) { a . tooltip && this . setTooltip ( replaceMessageReferences$$module$build$src$core$utils$parsing ( a . tooltip ) ) } setSourceBlock ( a ) { if ( this . sourceBlock _ ) throw Error ( "Field already bound to a block" ) ; this . sourceBlock _ = a } getConstants ( ) { ! this . constants _ && this . sourceBlock _ &&
! this . sourceBlock _ . isDeadOrDying ( ) && this . sourceBlock _ . workspace . rendered && ( this . constants _ = this . sourceBlock _ . workspace . getRenderer ( ) . getConstants ( ) ) ; return this . constants _ } getSourceBlock ( ) { return this . sourceBlock _ } init ( ) { this . fieldGroup _ || ( this . fieldGroup _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G , { } ) , this . isVisible ( ) || ( this . fieldGroup _ . style . display = "none" ) , this . sourceBlock _ . getSvgRoot ( ) . appendChild ( this . fieldGroup _ ) , this . initView ( ) , this . updateEditable ( ) ,
this . setTooltip ( this . tooltip _ ) , this . bindEvents _ ( ) , this . initModel ( ) ) } initView ( ) { this . createBorderRect _ ( ) ; this . createTextElement _ ( ) } initModel ( ) { } createBorderRect _ ( ) { this . borderRect _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { rx : this . getConstants ( ) . FIELD _BORDER _RECT _RADIUS , ry : this . getConstants ( ) . FIELD _BORDER _RECT _RADIUS , x : 0 , y : 0 , height : this . size _ . height , width : this . size _ . width , "class" : "blocklyFieldRect" } , this . fieldGroup _ ) } createTextElement _ ( ) { this . textElement _ =
createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . TEXT , { "class" : "blocklyText" } , this . fieldGroup _ ) ; this . getConstants ( ) . FIELD _TEXT _BASELINE _CENTER && this . textElement _ . setAttribute ( "dominant-baseline" , "central" ) ; this . textContent _ = document . createTextNode ( "" ) ; this . textElement _ . appendChild ( this . textContent _ ) } bindEvents _ ( ) { const a = this . getClickTarget _ ( ) ; if ( ! a ) throw Error ( "A click target has not been set." ) ; bindMouseEvents$$module$build$src$core$tooltip ( a ) ; this . mouseDownWrapper _ =
conditionalBind$$module$build$src$core$browser _events ( a , "mousedown" , this , this . onMouseDown _ ) } fromXml ( a ) { this . setValue ( a . textContent ) } toXml ( a ) { a . textContent = this . getValue ( ) ; return a } saveState ( a ) { a = this . saveLegacyState ( Field$$module$build$src$core$field ) ; return null !== a ? a : this . getValue ( ) } loadState ( a ) { this . loadLegacyState ( Field$$module$build$src$core$field , a ) || this . setValue ( a ) } saveLegacyState ( a ) { return a . prototype . saveState === this . saveState && a . prototype . toXml !== this . toXml ? ( a = createElement$$module$build$src$core$utils$xml ( "field" ) ,
a . setAttribute ( "name" , this . name || "" ) , domToText$$module$build$src$core$xml ( this . toXml ( a ) ) . replace ( ' xmlns="https://developers.google.com/blockly/xml"' , "" ) ) : null } loadLegacyState ( a , b ) { return a . prototype . loadState === this . loadState && a . prototype . fromXml !== this . fromXml ? ( this . fromXml ( textToDom$$module$build$src$core$xml ( b ) ) , ! 0 ) : ! 1 } dispose ( ) { hideIfOwner$$module$build$src$core$dropdowndiv ( this ) ; hideIfOwner$$module$build$src$core$widgetdiv ( this ) ; unbindMouseEvents$$module$build$src$core$tooltip ( this . getClickTarget _ ( ) ) ;
this . mouseDownWrapper _ && unbind$$module$build$src$core$browser _events ( this . mouseDownWrapper _ ) ; removeNode$$module$build$src$core$utils$dom ( this . fieldGroup _ ) ; this . disposed = ! 0 } updateEditable ( ) { const a = this . fieldGroup _ , b = this . getSourceBlock ( ) ; this . EDITABLE && a && b && ( this . enabled _ && b . isEditable ( ) ? ( addClass$$module$build$src$core$utils$dom ( a , "blocklyEditableText" ) , removeClass$$module$build$src$core$utils$dom ( a , "blocklyNonEditableText" ) , a . style . cursor = this . CURSOR ) : ( addClass$$module$build$src$core$utils$dom ( a ,
"blocklyNonEditableText" ) , removeClass$$module$build$src$core$utils$dom ( a , "blocklyEditableText" ) , a . style . cursor = "" ) ) } setEnabled ( a ) { this . enabled _ = a ; this . updateEditable ( ) } isEnabled ( ) { return this . enabled _ } isClickable ( ) { return this . enabled _ && ! ! this . sourceBlock _ && this . sourceBlock _ . isEditable ( ) && this . showEditor _ !== Field$$module$build$src$core$field . prototype . showEditor _ } isCurrentlyEditable ( ) { return this . enabled _ && this . EDITABLE && ! ! this . sourceBlock _ && this . sourceBlock _ . isEditable ( ) } isSerializable ( ) { let a = ! 1 ;
this . name && ( this . SERIALIZABLE ? a = ! 0 : this . EDITABLE && ( console . warn ( "Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization." ) , a = ! 0 ) ) ; return a } isVisible ( ) { return this . visible _ } setVisible ( a ) { if ( this . visible _ !== a ) { this . visible _ = a ; var b = this . fieldGroup _ ; b && ( b . style . display = a ? "block" : "none" ) } } setValidator ( a ) { this . validator _ = a } getValidator ( ) { return this . validator _ } getSvgRoot ( ) { return this . fieldGroup _ } getBorderRect ( ) { if ( ! this . borderRect _ ) throw Error ( ` The border rectangle is ${ this . borderRect _ } . ` ) ;
return this . borderRect _ } getTextElement ( ) { if ( ! this . textElement _ ) throw Error ( ` The text element is ${ this . textElement _ } . ` ) ; return this . textElement _ } getTextContent ( ) { if ( ! this . textContent _ ) throw Error ( ` The text content is ${ this . textContent _ } . ` ) ; return this . textContent _ } applyColour ( ) { } render _ ( ) { this . textContent _ && ( this . textContent _ . nodeValue = this . getDisplayText _ ( ) ) ; this . updateSize _ ( ) } showEditor ( a ) { this . isClickable ( ) && this . showEditor _ ( a ) } showEditor _ ( a ) { } updateSize _ ( a ) { const b = this . getConstants ( ) ; a = void 0 !==
a ? a : this . borderRect _ ? this . getConstants ( ) . FIELD _BORDER _RECT _X _PADDING : 0 ; let c = 2 * a , d = b . FIELD _TEXT _HEIGHT , e = 0 ; this . textElement _ && ( e = getFastTextWidth$$module$build$src$core$utils$dom ( this . textElement _ , b . FIELD _TEXT _FONTSIZE , b . FIELD _TEXT _FONTWEIGHT , b . FIELD _TEXT _FONTFAMILY ) , c += e ) ; this . borderRect _ && ( d = Math . max ( d , b . FIELD _BORDER _RECT _HEIGHT ) ) ; this . size _ . height = d ; this . size _ . width = c ; this . positionTextElement _ ( a , e ) ; this . positionBorderRect _ ( ) } positionTextElement _ ( a , b ) { if ( this . textElement _ ) { var c = this . getConstants ( ) ,
d = this . size _ . height / 2 , e ; this . textElement _ . setAttribute ( "x" , ` ${ ( null == ( e = this . getSourceBlock ( ) ) ? 0 : e . RTL ) ? this . size _ . width - b - a : a } ` ) ; this . textElement _ . setAttribute ( "y" , ` ${ c . FIELD _TEXT _BASELINE _CENTER ? d : d - c . FIELD _TEXT _HEIGHT / 2 + c . FIELD _TEXT _BASELINE } ` ) } } positionBorderRect _ ( ) { this . borderRect _ && ( this . borderRect _ . setAttribute ( "width" , ` ${ this . size _ . width } ` ) , this . borderRect _ . setAttribute ( "height" , ` ${ this . size _ . height } ` ) , this . borderRect _ . setAttribute ( "rx" , ` ${ this . getConstants ( ) . FIELD _BORDER _RECT _RADIUS } ` ) , this . borderRect _ . setAttribute ( "ry" ,
` ${ 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 && ( console . warn ( "Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead." ) , this . render _ ( ) ) ; return this . size _ } getScaledBBox ( ) { let a ; var b = this . getSourceBlock ( ) ; if ( ! b ) throw new UnattachedFieldError$$module$build$src$core$field ; if ( this . borderRect _ ) { var c =
this . borderRect _ . getBoundingClientRect ( ) ; a = getPageOffset$$module$build$src$core$utils$style ( this . borderRect _ ) ; b = c . width ; c = c . height } else { 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 ) } return new Rect$$module$build$src$core$utils$rect ( a . y , a . y + c , a . x , a . x + b ) } 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 _ . render ( ) , this . sourceBlock _ . bumpNeighbours ( ) ,
this . updateMarkers _ ( ) ) } setValue ( a ) { if ( null !== a ) { var b = this . doClassValidation _ ( a ) ; a = this . processValidation _ ( a , b ) ; if ( ! ( a instanceof Error ) ) { if ( b = this . getValidator ( ) ) if ( b = b . call ( this , a ) , a = this . processValidation _ ( a , b ) , a instanceof Error ) return ; b = this . sourceBlock _ ; if ( ! b || ! b . disposed ) { var c = this . getValue ( ) ; c === a ? this . doValueUpdate _ ( a ) : ( this . doValueUpdate _ ( a ) , b && 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 ) ) ( b ,
"field" , this . name || null , c , a ) ) , this . isDirty _ && this . forceRerender ( ) ) } } } } processValidation _ ( a , b ) { if ( null === b ) return this . doValueInvalid _ ( a ) , this . isDirty _ && this . forceRerender ( ) , Error ( ) ; void 0 !== b && ( a = b ) ; return a } getValue ( ) { return this . value _ } doClassValidation _ ( a ) { return null === a || void 0 === a ? null : a } doValueUpdate _ ( a ) { this . value _ = a ; this . isDirty _ = ! 0 } doValueInvalid _ ( a ) { } 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 < b . inputList . length ; d ++ ) { const e = c [ d ] , f = e . fieldRow ; for ( let g = 0 ; g < f . length ; g ++ ) if ( f [ g ] === this ) { a = e ; break } } return a } getFlipRtl ( ) { return ! 1 } isTabNavigable ( ) { return ! 1 } onShortcut ( a ) { return ! 1 } setCursorSvg ( a ) { if ( a ) { if ( ! this . fieldGroup _ ) throw Error ( ` The field group is ${ this . fieldGroup _ } . ` ) ; this . fieldGroup _ . appendChild ( a ) ; this . cursorSvg _ = a } else this . cursorSvg _ = null } setMarkerSvg ( a ) { if ( a ) { if ( ! this . fieldGroup _ ) throw Error ( ` The field group is ${ this . fieldGroup _ } . ` ) ;
this . fieldGroup _ . appendChild ( a ) ; this . markerSvg _ = a } else this . markerSvg _ = null } updateMarkers _ ( ) { var a = this . getSourceBlock ( ) ; if ( ! a ) throw new UnattachedFieldError$$module$build$src$core$field ; a = a . workspace ; a . keyboardAccessibilityMode && this . cursorSvg _ && a . getCursor ( ) . draw ( ) ; a . keyboardAccessibilityMode && this . markerSvg _ && a . getMarker ( MarkerManager$$module$build$src$core$marker _manager . LOCAL _MARKER ) . draw ( ) } } ; Field$$module$build$src$core$field . NBSP = "\u00a0" ; Field$$module$build$src$core$field . SKIP _SETUP = new Sentinel$$module$build$src$core$utils$sentinel ;
var UnattachedFieldError$$module$build$src$core$field = class extends Error { constructor ( ) { super ( "The field has not yet been attached to its input. Call appendField to attach it." ) } } , module$build$src$core$field = { } ; module$build$src$core$field . Field = Field$$module$build$src$core$field ; module$build$src$core$field . UnattachedFieldError = UnattachedFieldError$$module$build$src$core$field ; var TEST _ONLY$$module$build$src$core$field _registry = { fromJsonInternal : fromJsonInternal$$module$build$src$core$field _registry } , 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 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 = { } ;
module$build$src$core$utils$aria . Role = Role$$module$build$src$core$utils$aria ; module$build$src$core$utils$aria . State = State$$module$build$src$core$utils$aria ; module$build$src$core$utils$aria . setRole = setRole$$module$build$src$core$utils$aria ; module$build$src$core$utils$aria . setState = setState$$module$build$src$core$utils$aria ; 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 ] =
"NUM_ONE" ; a [ a . NUM _TWO = 98 ] = "NUM_TWO" ; a [ a . NUM _THREE = 99 ] = "NUM_THREE" ; a [ a . NUM _FOUR = 100 ] = "NUM_FOUR" ; a [ a . NUM _FIVE = 101 ] = "NUM_FIVE" ; a [ a . NUM _SIX = 102 ] = "NUM_SIX" ; a [ a . NUM _SEVEN = 103 ] = "NUM_SEVEN" ; a [ a . NUM _EIGHT = 104 ] = "NUM_EIGHT" ; a [ a . NUM _NINE = 105 ] = "NUM_NINE" ; a [ a . NUM _MULTIPLY = 106 ] = "NUM_MULTIPLY" ; a [ a . NUM _PLUS = 107 ] = "NUM_PLUS" ; a [ a . NUM _MINUS = 109 ] = "NUM_MINUS" ; a [ a . NUM _PERIOD = 110 ] = "NUM_PERIOD" ; a [ a . NUM _DIVISION = 111 ] = "NUM_DIVISION" ; a [ a . F1 = 112 ] = "F1" ; a [ a . F2 = 113 ] = "F2" ; a [ a . F3 = 114 ] = "F3" ; a [ a . F4 = 115 ] = "F4" ; a [ a . F5 = 116 ] = "F5" ; a [ a . F6 =
117 ] = "F6" ; a [ a . F7 = 118 ] = "F7" ; a [ a . F8 = 119 ] = "F8" ; a [ a . F9 = 120 ] = "F9" ; a [ a . F10 = 121 ] = "F10" ; a [ a . F11 = 122 ] = "F11" ; a [ a . F12 = 123 ] = "F12" ; a [ a . NUMLOCK = 144 ] = "NUMLOCK" ; a [ a . SCROLL _LOCK = 145 ] = "SCROLL_LOCK" ; a [ a . FIRST _MEDIA _KEY = 166 ] = "FIRST_MEDIA_KEY" ; a [ a . LAST _MEDIA _KEY = 183 ] = "LAST_MEDIA_KEY" ; a [ a . SEMICOLON = 186 ] = "SEMICOLON" ; a [ a . DASH = 189 ] = "DASH" ; a [ a . EQUALS = 187 ] = "EQUALS" ; a [ a . COMMA = 188 ] = "COMMA" ; a [ a . PERIOD = 190 ] = "PERIOD" ; a [ a . SLASH = 191 ] = "SLASH" ; a [ a . APOSTROPHE = 192 ] = "APOSTROPHE" ; a [ a . TILDE = 192 ] = "TILDE" ; a [ a . SINGLE _QUOTE = 222 ] = "SINGLE_QUOTE" ;
a [ a . OPEN _SQUARE _BRACKET = 219 ] = "OPEN_SQUARE_BRACKET" ; a [ a . BACKSLASH = 220 ] = "BACKSLASH" ; a [ a . CLOSE _SQUARE _BRACKET = 221 ] = "CLOSE_SQUARE_BRACKET" ; a [ a . WIN _KEY = 224 ] = "WIN_KEY" ; a [ a . MAC _FF _META = 224 ] = "MAC_FF_META" ; a [ a . MAC _WK _CMD _LEFT = 91 ] = "MAC_WK_CMD_LEFT" ; a [ a . MAC _WK _CMD _RIGHT = 93 ] = "MAC_WK_CMD_RIGHT" ; a [ a . WIN _IME = 229 ] = "WIN_IME" ; a [ a . VK _NONAME = 252 ] = "VK_NONAME" ; a [ a . PHANTOM = 255 ] = "PHANTOM" } ) ( KeyCodes$$module$build$src$core$utils$keycodes || ( KeyCodes$$module$build$src$core$utils$keycodes = { } ) ) ;
var module$build$src$core$utils$keycodes = { } ; module$build$src$core$utils$keycodes . KeyCodes = KeyCodes$$module$build$src$core$utils$keycodes ; var Menu$$module$build$src$core$menu = class { constructor ( ) { this . menuItems _ = [ ] ; this . roleName _ = this . element _ = this . onKeyDownHandler _ = this . mouseLeaveHandler _ = this . mouseEnterHandler _ = this . clickHandler _ = this . mouseOverHandler _ = this . highlightedItem _ = this . openingCoords = null } addChild ( a ) { this . menuItems _ . push ( a ) } render ( a ) { const b = document . createElement ( "div" ) ; b . className = "blocklyMenu goog-menu blocklyNonSelectable" ; b . tabIndex = 0 ; this . roleName _ && setRole$$module$build$src$core$utils$aria ( b , this . roleName _ ) ; this . element _ =
b ; for ( let c = 0 , d ; d = this . menuItems _ [ c ] ; c ++ ) b . appendChild ( d . createDom ( ) ) ; this . mouseOverHandler _ = conditionalBind$$module$build$src$core$browser _events ( b , "mouseover" , this , this . handleMouseOver _ , ! 0 ) ; this . clickHandler _ = conditionalBind$$module$build$src$core$browser _events ( b , "click" , this , this . handleClick _ , ! 0 ) ; this . mouseEnterHandler _ = conditionalBind$$module$build$src$core$browser _events ( b , "mouseenter" , this , this . handleMouseEnter _ , ! 0 ) ; this . mouseLeaveHandler _ = conditionalBind$$module$build$src$core$browser _events ( b ,
"mouseleave" , this , this . handleMouseLeave _ , ! 0 ) ; this . onKeyDownHandler _ = conditionalBind$$module$build$src$core$browser _events ( b , "keydown" , this , this . handleKeyEvent _ ) ; a . appendChild ( b ) ; return b } getElement ( ) { return this . element _ } focus ( ) { const a = this . getElement ( ) ; a && ( a . focus ( { preventScroll : ! 0 } ) , addClass$$module$build$src$core$utils$dom ( a , "blocklyFocused" ) ) } blur _ ( ) { const a = this . getElement ( ) ; a && ( a . blur ( ) , removeClass$$module$build$src$core$utils$dom ( a , "blocklyFocused" ) ) } setRole ( a ) { this . roleName _ = a } dispose ( ) { this . mouseOverHandler _ &&
( unbind$$module$build$src$core$browser _events ( this . mouseOverHandler _ ) , this . mouseOverHandler _ = null ) ; this . clickHandler _ && ( unbind$$module$build$src$core$browser _events ( this . clickHandler _ ) , this . clickHandler _ = null ) ; this . mouseEnterHandler _ && ( unbind$$module$build$src$core$browser _events ( this . mouseEnterHandler _ ) , this . mouseEnterHandler _ = null ) ; this . mouseLeaveHandler _ && ( unbind$$module$build$src$core$browser _events ( this . mouseLeaveHandler _ ) , this . mouseLeaveHandler _ = null ) ; this . onKeyDownHandler _ && ( unbind$$module$build$src$core$browser _events ( this . onKeyDownHandler _ ) ,
this . onKeyDownHandler _ = null ) ; for ( let a = 0 , b ; b = this . menuItems _ [ a ] ; a ++ ) b . dispose ( ) ; this . element _ = null } getMenuItem _ ( a ) { const b = this . getElement ( ) ; for ( ; a && a !== b ; ) { if ( a . classList . contains ( "blocklyMenuItem" ) ) for ( let c = 0 , d ; d = this . menuItems _ [ c ] ; c ++ ) if ( d . getElement ( ) === a ) return d ; a = a . parentElement } return null } setHighlighted ( a ) { var b = this . highlightedItem _ ; b && ( b . setHighlighted ( ! 1 ) , this . highlightedItem _ = null ) ; a && ( a . setHighlighted ( ! 0 ) , this . highlightedItem _ = a , b = this . getElement ( ) , scrollIntoContainerView$$module$build$src$core$utils$style ( a . getElement ( ) ,
b ) , setState$$module$build$src$core$utils$aria ( b , State$$module$build$src$core$utils$aria . ACTIVEDESCENDANT , a . getId ( ) ) ) } highlightNext ( ) { const a = this . highlightedItem _ ? this . menuItems _ . indexOf ( this . highlightedItem _ ) : - 1 ; this . highlightHelper _ ( a , 1 ) } highlightPrevious ( ) { const a = this . highlightedItem _ ? this . menuItems _ . indexOf ( this . highlightedItem _ ) : - 1 ; this . highlightHelper _ ( 0 > a ? this . menuItems _ . length : a , - 1 ) } highlightFirst _ ( ) { this . highlightHelper _ ( - 1 , 1 ) } highlightLast _ ( ) { this . highlightHelper _ ( this . menuItems _ . length ,
- 1 ) } highlightHelper _ ( a , b ) { a += b ; let c ; for ( ; c = this . menuItems _ [ a ] ; ) { if ( c . isEnabled ( ) ) { this . setHighlighted ( c ) ; break } a += b } } handleMouseOver _ ( a ) { ( a = this . getMenuItem _ ( a . target ) ) && ( a . isEnabled ( ) ? this . highlightedItem _ !== a && this . setHighlighted ( a ) : this . setHighlighted ( null ) ) } handleClick _ ( a ) { const b = this . openingCoords ; this . openingCoords = null ; if ( b && "number" === typeof a . clientX ) { const c = new Coordinate$$module$build$src$core$utils$coordinate ( a . clientX , a . clientY ) ; if ( 1 > Coordinate$$module$build$src$core$utils$coordinate . distance ( b ,
c ) ) return } ( a = this . getMenuItem _ ( a . target ) ) && a . performAction ( ) } handleMouseEnter _ ( a ) { this . focus ( ) } handleMouseLeave _ ( a ) { this . getElement ( ) && ( this . blur _ ( ) , this . setHighlighted ( null ) ) } handleKeyEvent _ ( a ) { if ( this . menuItems _ . length && ! ( a . shiftKey || a . ctrlKey || a . metaKey || a . altKey ) ) { var b = this . highlightedItem _ ; switch ( a . keyCode ) { case KeyCodes$$module$build$src$core$utils$keycodes . ENTER : case KeyCodes$$module$build$src$core$utils$keycodes . SPACE : b && b . performAction ( ) ; break ; case KeyCodes$$module$build$src$core$utils$keycodes . UP : this . highlightPrevious ( ) ;
break ; case KeyCodes$$module$build$src$core$utils$keycodes . DOWN : this . highlightNext ( ) ; break ; case KeyCodes$$module$build$src$core$utils$keycodes . PAGE _UP : case KeyCodes$$module$build$src$core$utils$keycodes . HOME : this . highlightFirst _ ( ) ; break ; case KeyCodes$$module$build$src$core$utils$keycodes . PAGE _DOWN : case KeyCodes$$module$build$src$core$utils$keycodes . END : this . highlightLast _ ( ) ; break ; default : return } a . preventDefault ( ) ; a . stopPropagation ( ) } } getSize ( ) { const a = this . getElement ( ) , b = getSize$$module$build$src$core$utils$style ( a ) ;
b . height = a . scrollHeight ; return b } } , module$build$src$core$menu = { } ; module$build$src$core$menu . Menu = Menu$$module$build$src$core$menu ; var MenuItem$$module$build$src$core$menuitem = class { constructor ( a , b ) { this . content = a ; this . opt _value = b ; this . enabled _ = ! 0 ; this . element _ = null ; this . rightToLeft _ = ! 1 ; this . roleName _ = null ; this . highlight _ = this . checked _ = this . checkable _ = ! 1 ; this . actionHandler _ = null } createDom ( ) { const a = document . createElement ( "div" ) ; a . id = getNextUniqueId$$module$build$src$core$utils$idgenerator ( ) ; this . element _ = a ; a . className = "blocklyMenuItem goog-menuitem " + ( this . enabled _ ? "" : "blocklyMenuItemDisabled goog-menuitem-disabled " ) + ( this . checked _ ?
"blocklyMenuItemSelected goog-option-selected " : "" ) + ( 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 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 . 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 = JSON . parse ( JSON . stringify ( a ) ) ) ,
this . menuGenerator _ = a , this . trimOptions _ ( ) , 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 ) ) ; let b ; ( null == ( b = this . getSourceBlock ( ) ) ? 0 : b . RTL ) ? this . getTextElement ( ) . insertBefore ( this . arrow _ ,
this . textContent _ ) : this . getTextElement ( ) . appendChild ( this . arrow _ ) } createSVGArrow _ ( ) { this . svgArrow _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . IMAGE , { height : this . getConstants ( ) . FIELD _DROPDOWN _SVG _ARROW _SIZE + "px" , width : this . getConstants ( ) . FIELD _DROPDOWN _SVG _ARROW _SIZE + "px" } , this . fieldGroup _ ) ; this . svgArrow _ . setAttributeNS ( XLINK _NS$$module$build$src$core$utils$dom , "xlink:href" , this . getConstants ( ) . FIELD _DROPDOWN _SVG _ARROW _DATAURI ) } showEditor _ ( a ) { var b = this . getSourceBlock ( ) ;
if ( ! b ) throw new UnattachedFieldError$$module$build$src$core$field ; this . dropdownCreate _ ( ) ; this . menu _ . openingCoords = a && "number" === typeof a . clientX ? new Coordinate$$module$build$src$core$utils$coordinate ( a . clientX , a . clientY ) : null ; clearContent$$module$build$src$core$dropdowndiv ( ) ; a = this . menu _ . render ( getContentDiv$$module$build$src$core$dropdowndiv ( ) ) ; addClass$$module$build$src$core$utils$dom ( a , "blocklyDropdownMenu" ) ; if ( this . getConstants ( ) . FIELD _DROPDOWN _COLOURED _DIV ) { a = b . isShadow ( ) ? b . getParent ( ) . getColour ( ) :
b . getColour ( ) ; b = b . isShadow ( ) ? b . getParent ( ) . style . colourTertiary : this . sourceBlock _ . style . colourTertiary ; if ( ! b ) throw Error ( "The renderer did not properly initialize the block style" ) ; setColour$$module$build$src$core$dropdowndiv ( a , b ) } showPositionedByField$$module$build$src$core$dropdowndiv ( this , this . dropdownDispose _ . bind ( this ) ) ; this . menu _ . focus ( ) ; this . selectedMenuItem _ && this . menu _ . setHighlighted ( this . selectedMenuItem _ ) ; this . applyColour ( ) } dropdownCreate _ ( ) { const a = this . getSourceBlock ( ) ; if ( ! a ) throw new UnattachedFieldError$$module$build$src$core$field ;
const b = new Menu$$module$build$src$core$menu ; b . setRole ( Role$$module$build$src$core$utils$aria . LISTBOX ) ; this . menu _ = b ; const c = this . getOptions ( ! 1 ) ; this . selectedMenuItem _ = null ; for ( let e = 0 ; e < c . length ; e ++ ) { var d = c [ e ] [ 0 ] ; const f = c [ e ] [ 1 ] ; if ( "object" === typeof d ) { const g = new Image ( d . width , d . height ) ; g . src = d . src ; g . alt = d . alt || "" ; d = g } d = new MenuItem$$module$build$src$core$menuitem ( d , f ) ; d . setRole ( Role$$module$build$src$core$utils$aria . OPTION ) ; d . setRightToLeft ( a . RTL ) ; d . setCheckable ( ! 0 ) ; b . addChild ( d ) ; d . setChecked ( f ===
this . value _ ) ; f === this . value _ && ( this . selectedMenuItem _ = d ) ; d . onAction ( this . handleMenuActionEvent _ , this ) } } dropdownDispose _ ( ) { this . menu _ && this . menu _ . dispose ( ) ; this . selectedMenuItem _ = this . menu _ = null ; this . applyColour ( ) } handleMenuActionEvent _ ( a ) { hideIfOwner$$module$build$src$core$dropdowndiv ( this , ! 0 ) ; this . onItemSelected _ ( this . menu _ , a ) } onItemSelected _ ( a , b ) { this . setValue ( b . getValue ( ) ) } trimOptions _ ( ) { const a = this . menuGenerator _ ; if ( Array . isArray ( a ) ) { var b = ! 1 ; for ( var c = 0 ; c < a . length ; c ++ ) { var d = a [ c ] [ 0 ] ; "string" ===
typeof d ? a [ c ] [ 0 ] = replaceMessageReferences$$module$build$src$core$utils$parsing ( d ) : ( null !== d . alt && ( a [ c ] [ 0 ] . alt = replaceMessageReferences$$module$build$src$core$utils$parsing ( d . alt ) ) , b = ! 0 ) } if ( ! ( b || 2 > a . length ) ) { b = [ ] ; for ( c = 0 ; c < a . length ; c ++ ) b . push ( a [ c ] [ 0 ] ) ; c = shortestStringLength$$module$build$src$core$utils$string ( b ) ; d = commonWordPrefix$$module$build$src$core$utils$string ( b , c ) ; var e = commonWordSuffix$$module$build$src$core$utils$string ( b , c ) ; ! d && ! e || c <= d + e || ( d && ( this . prefixField = b [ 0 ] . substring ( 0 , d - 1 ) ) , e &&
( this . suffixField = b [ 0 ] . substr ( 1 - e ) ) , this . menuGenerator _ = FieldDropdown$$module$build$src$core$field _dropdown . applyTrim _ ( a , d , e ) ) } } } isOptionListDynamic ( ) { return "function" === typeof this . menuGenerator _ } getOptions ( a ) { return this . isOptionListDynamic ( ) ? ( this . generatedOptions _ && a || ( this . generatedOptions _ = this . menuGenerator _ . call ( this ) , validateOptions$$module$build$src$core$field _dropdown ( this . generatedOptions _ ) ) , this . generatedOptions _ ) : this . menuGenerator _ } doClassValidation _ ( a ) { let b = ! 1 ; const c = this . getOptions ( ! 0 ) ;
for ( let d = 0 , e ; e = c [ d ] ; d ++ ) if ( e [ 1 ] === a ) { b = ! 0 ; break } return b ? a : ( this . sourceBlock _ && console . warn ( "Cannot set the dropdown's value to an unavailable option. Block type: " + this . sourceBlock _ . type + ", Field name: " + this . name + ", Value: " + a ) , null ) } doValueUpdate _ ( a ) { super . doValueUpdate _ ( a ) ; a = this . getOptions ( ! 0 ) ; for ( let b = 0 , c ; c = a [ b ] ; b ++ ) c [ 1 ] === this . value _ && ( this . selectedOption _ = c ) } applyColour ( ) { const a = this . sourceBlock _ . style ; if ( ! a . colourSecondary ) throw Error ( "The renderer did not properly initialize the block style" ) ;
if ( ! a . colourTertiary ) throw Error ( "The renderer did not properly initialize the block style" ) ; this . borderRect _ && ( this . borderRect _ . setAttribute ( "stroke" , a . colourTertiary ) , this . menu _ ? this . borderRect _ . setAttribute ( "fill" , a . colourTertiary ) : this . borderRect _ . setAttribute ( "fill" , "transparent" ) ) ; this . sourceBlock _ && this . arrow _ && ( this . sourceBlock _ . isShadow ( ) ? this . arrow _ . style . fill = a . colourSecondary : this . arrow _ . style . fill = a . colourPrimary ) } render _ ( ) { this . getTextContent ( ) . nodeValue = "" ; this . imageElement _ . style . display =
"none" ; const a = this . selectedOption _ && this . selectedOption _ [ 0 ] ; a && "object" === typeof a ? this . renderSelectedImage _ ( a ) : this . renderSelectedText _ ( ) ; this . positionBorderRect _ ( ) } renderSelectedImage _ ( a ) { const b = this . getSourceBlock ( ) ; if ( ! b ) throw new UnattachedFieldError$$module$build$src$core$field ; this . imageElement _ . style . display = "" ; this . imageElement _ . setAttributeNS ( XLINK _NS$$module$build$src$core$utils$dom , "xlink:href" , a . src ) ; this . imageElement _ . setAttribute ( "height" , a . height ) ; this . imageElement _ . setAttribute ( "width" ,
a . width ) ; const c = Number ( a . height ) ; a = Number ( a . width ) ; var d = ! ! this . borderRect _ ; const e = Math . max ( d ? this . getConstants ( ) . FIELD _DROPDOWN _BORDER _RECT _HEIGHT : 0 , c + IMAGE _Y _PADDING$$module$build$src$core$field _dropdown ) ; d = d ? this . getConstants ( ) . FIELD _BORDER _RECT _X _PADDING : 0 ; let f ; f = this . svgArrow _ ? this . positionSVGArrow _ ( a + d , e / 2 - this . getConstants ( ) . FIELD _DROPDOWN _SVG _ARROW _SIZE / 2 ) : getFastTextWidth$$module$build$src$core$utils$dom ( this . arrow _ , this . getConstants ( ) . FIELD _TEXT _FONTSIZE , this . getConstants ( ) . FIELD _TEXT _FONTWEIGHT ,
this . getConstants ( ) . FIELD _TEXT _FONTFAMILY ) ; this . size _ . width = a + f + 2 * d ; this . size _ . height = e ; let g = 0 ; b . RTL ? this . imageElement _ . setAttribute ( "x" , ( d + f ) . toString ( ) ) : ( g = a + f , this . getTextElement ( ) . setAttribute ( "text-anchor" , "end" ) , this . imageElement _ . setAttribute ( "x" , d . toString ( ) ) ) ; this . imageElement _ . setAttribute ( "y" , ( e / 2 - c / 2 ) . toString ( ) ) ; this . positionTextElement _ ( g + d , a + f ) } renderSelectedText _ ( ) { this . getTextContent ( ) . nodeValue = this . getDisplayText _ ( ) ; var a = this . getTextElement ( ) ; addClass$$module$build$src$core$utils$dom ( a ,
"blocklyDropdownText" ) ; a . setAttribute ( "text-anchor" , "start" ) ; var b = ! ! this . borderRect _ ; a = Math . max ( b ? this . getConstants ( ) . FIELD _DROPDOWN _BORDER _RECT _HEIGHT : 0 , this . getConstants ( ) . FIELD _TEXT _HEIGHT ) ; const c = getFastTextWidth$$module$build$src$core$utils$dom ( this . getTextElement ( ) , this . getConstants ( ) . FIELD _TEXT _FONTSIZE , 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 ) } static applyTrim _ ( a , b , c ) { const d = [ ] ; for ( let e = 0 ; e < a . length ; e ++ ) { let f = a [ e ] [ 0 ] ; const g = a [ e ] [ 1 ] ; f = f . substring ( b ,
f . length - c ) ; d [ e ] = [ f , g ] } return d } } ; FieldDropdown$$module$build$src$core$field _dropdown . CHECKMARK _OVERHANG = 25 ; FieldDropdown$$module$build$src$core$field _dropdown . MAX _MENU _HEIGHT _VH = . 45 ; 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 ; FieldDropdown$$module$build$src$core$field _dropdown . ARROW _CHAR = ANDROID$$module$build$src$core$utils$useragent ? "\u25bc" : "\u25be" ;
register$$module$build$src$core$field _registry ( "field_dropdown" , FieldDropdown$$module$build$src$core$field _dropdown ) ; $ . module$build$src$core$field _dropdown = { } ; $ . module$build$src$core$field _dropdown . FieldDropdown = FieldDropdown$$module$build$src$core$field _dropdown ; var BubbleOpen$$module$build$src$core$events$events _bubble _open = class extends UiBase$$module$build$src$core$events$events _ui _base { constructor ( a , b , c ) { super ( a ? a . workspace . id : void 0 ) ; this . type = BUBBLE _OPEN$$module$build$src$core$events$utils ; a && ( this . blockId = a . id , this . isOpen = b , this . bubbleType = c ) } toJson ( ) { const a = super . toJson ( ) ; if ( void 0 === this . isOpen ) throw Error ( "Whether this event is for opening the bubble is undefined. Either pass the value to the constructor, or call fromJson" ) ; if ( ! this . bubbleType ) throw Error ( "The type of bubble is undefined. Either pass the value to the constructor, or call fromJson" ) ;
a . isOpen = this . isOpen ; a . bubbleType = this . bubbleType ; a . blockId = this . blockId || "" ; return a } fromJson ( a ) { super . fromJson ( a ) ; this . isOpen = a . isOpen ; this . bubbleType = a . bubbleType ; this . blockId = a . blockId } } , BubbleType$$module$build$src$core$events$events _bubble _open ; ( function ( a ) { a . MUTATOR = "mutator" ; a . COMMENT = "comment" ; a . WARNING = "warning" } ) ( BubbleType$$module$build$src$core$events$events _bubble _open || ( BubbleType$$module$build$src$core$events$events _bubble _open = { } ) ) ;
register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . EVENT , BUBBLE _OPEN$$module$build$src$core$events$utils , BubbleOpen$$module$build$src$core$events$events _bubble _open ) ; var module$build$src$core$events$events _bubble _open = { } ; module$build$src$core$events$events _bubble _open . BubbleOpen = BubbleOpen$$module$build$src$core$events$events _bubble _open ; module$build$src$core$events$events _bubble _open . BubbleType = BubbleType$$module$build$src$core$events$events _bubble _open ; 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 . startDragHandle = this . handlePosition _ = this . handleLength _ = this . scrollbarLength _ = this . startDragMouse _ = 0 ; this . containerVisible _ = this . isVisible _ = ! 0 ; this . svgGroup _ = this . outerSvg _ = this . svgHandle _ = this . svgBackground _ = null ; this . lengthAttribute _ = "width" ; this . positionAttribute _ = "x" ; this . onMouseMoveWrapper _ = this . onMouseUpWrapper _ = null ; this . pair _ = c || ! 1 ; this . margin _ =
void 0 !== e ? e : Scrollbar$$module$build$src$core$scrollbar . DEFAULT _SCROLLBAR _MARGIN ; this . origin _ = new Coordinate$$module$build$src$core$utils$coordinate ( 0 , 0 ) ; this . createDom _ ( d ) ; this . position = new Coordinate$$module$build$src$core$utils$coordinate ( 0 , 0 ) ; a = Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness ; b ? ( this . svgBackground _ . setAttribute ( "height" , String ( a ) ) , this . outerSvg _ . setAttribute ( "height" , String ( a ) ) , this . svgHandle _ . setAttribute ( "height" , String ( a - 5 ) ) , this . svgHandle _ . setAttribute ( "y" , "2.5" ) ) :
( this . svgBackground _ . setAttribute ( "width" , String ( a ) ) , this . outerSvg _ . setAttribute ( "width" , String ( a ) ) , this . svgHandle _ . setAttribute ( "width" , String ( a - 5 ) ) , this . svgHandle _ . setAttribute ( "x" , "2.5" ) , this . lengthAttribute _ = "height" , this . positionAttribute _ = "y" ) ; this . onMouseDownBarWrapper _ = conditionalBind$$module$build$src$core$browser _events ( this . svgBackground _ , "mousedown" , this , this . onMouseDownBar _ ) ; this . onMouseDownHandleWrapper _ = conditionalBind$$module$build$src$core$browser _events ( this . svgHandle _ , "mousedown" ,
this , this . onMouseDownHandle _ ) } dispose ( ) { this . cleanUp _ ( ) ; this . onMouseDownBarWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onMouseDownBarWrapper _ ) , this . onMouseDownBarWrapper _ = null ) ; this . onMouseDownHandleWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onMouseDownHandleWrapper _ ) , this . onMouseDownHandleWrapper _ = null ) ; removeNode$$module$build$src$core$utils$dom ( this . outerSvg _ ) ; this . svgBackground _ = this . svgGroup _ = this . outerSvg _ = null ; this . svgHandle _ && ( this . workspace . getThemeManager ( ) . unsubscribe ( this . svgHandle _ ) ,
this . svgHandle _ = null ) } constrainHandleLength _ ( a ) { return a = 0 >= a || isNaN ( a ) ? 0 : Math . min ( a , this . scrollbarLength _ ) } setHandleLength _ ( a ) { this . handleLength _ = a ; this . svgHandle _ . setAttribute ( this . lengthAttribute _ , String ( this . handleLength _ ) ) } constrainHandlePosition _ ( a ) { return a = 0 >= a || isNaN ( a ) ? 0 : Math . min ( a , this . scrollbarLength _ - this . handleLength _ ) } setHandlePosition ( a ) { this . handlePosition _ = a ; this . svgHandle _ . setAttribute ( this . positionAttribute _ , String ( this . handlePosition _ ) ) } setScrollbarLength _ ( a ) { this . scrollbarLength _ =
a ; this . outerSvg _ . setAttribute ( this . lengthAttribute _ , String ( this . scrollbarLength _ ) ) ; this . svgBackground _ . setAttribute ( this . lengthAttribute _ , String ( this . scrollbarLength _ ) ) } setPosition ( a , b ) { this . position . x = a ; this . position . y = b ; a = this . position . x + this . origin _ . x ; b = this . position . y + this . origin _ . y ; this . outerSvg _ && setCssTransform$$module$build$src$core$utils$dom ( this . outerSvg _ , "translate(" + a + "px," + b + "px)" ) } resize ( a ) { if ( ! a && ( a = this . workspace . getMetrics ( ) , ! a ) ) return ; this . oldHostMetrics _ && Scrollbar$$module$build$src$core$scrollbar . metricsAreEquivalent _ ( a ,
this . oldHostMetrics _ ) || ( this . horizontal ? this . resizeHorizontal _ ( a ) : this . resizeVertical _ ( a ) , this . oldHostMetrics _ = a , this . updateMetrics _ ( ) ) } requiresViewResize _ ( a ) { return this . oldHostMetrics _ ? this . oldHostMetrics _ . viewWidth !== a . viewWidth || this . oldHostMetrics _ . viewHeight !== a . viewHeight || this . oldHostMetrics _ . absoluteLeft !== a . absoluteLeft || this . oldHostMetrics _ . absoluteTop !== a . absoluteTop : ! 0 } resizeHorizontal _ ( a ) { this . requiresViewResize _ ( a ) ? this . resizeViewHorizontal ( a ) : this . resizeContentHorizontal ( a ) } resizeViewHorizontal ( a ) { var b =
a . viewWidth - 2 * this . margin _ ; this . pair _ && ( b -= Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness ) ; this . setScrollbarLength _ ( Math . max ( 0 , b ) ) ; b = a . absoluteLeft + this . margin _ ; this . pair _ && this . workspace . RTL && ( b += Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness ) ; this . setPosition ( b , a . absoluteTop + a . viewHeight - Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness - this . margin _ ) ; this . resizeContentHorizontal ( a ) } resizeContentHorizontal ( a ) { if ( a . viewWidth >= a . scrollWidth ) this . setHandleLength _ ( this . scrollbarLength _ ) ,
this . setHandlePosition ( 0 ) , this . pair _ || this . setVisible ( ! 1 ) ; else { this . pair _ || this . setVisible ( ! 0 ) ; var b = this . scrollbarLength _ * a . viewWidth / a . scrollWidth ; b = this . constrainHandleLength _ ( b ) ; this . setHandleLength _ ( b ) ; b = a . scrollWidth - a . viewWidth ; var c = this . scrollbarLength _ - this . handleLength _ ; a = ( a . viewLeft - a . scrollLeft ) / b * c ; a = this . constrainHandlePosition _ ( a ) ; this . setHandlePosition ( a ) ; this . ratio = c / b } } resizeVertical _ ( a ) { this . requiresViewResize _ ( a ) ? this . resizeViewVertical ( a ) : this . resizeContentVertical ( a ) } resizeViewVertical ( a ) { let b =
a . viewHeight - 2 * this . margin _ ; this . pair _ && ( b -= Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness ) ; this . setScrollbarLength _ ( Math . max ( 0 , b ) ) ; this . setPosition ( this . workspace . RTL ? a . absoluteLeft + this . margin _ : a . absoluteLeft + a . viewWidth - Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness - this . margin _ , a . absoluteTop + this . margin _ ) ; this . resizeContentVertical ( a ) } resizeContentVertical ( a ) { if ( a . viewHeight >= a . scrollHeight ) this . setHandleLength _ ( this . scrollbarLength _ ) , this . setHandlePosition ( 0 ) , this . pair _ ||
this . setVisible ( ! 1 ) ; else { this . pair _ || this . setVisible ( ! 0 ) ; var b = this . scrollbarLength _ * a . viewHeight / a . scrollHeight ; b = this . constrainHandleLength _ ( b ) ; this . setHandleLength _ ( b ) ; b = a . scrollHeight - a . viewHeight ; var c = this . scrollbarLength _ - this . handleLength _ ; a = ( a . viewTop - a . scrollTop ) / b * c ; a = this . constrainHandlePosition _ ( a ) ; this . setHandlePosition ( a ) ; this . ratio = c / b } } createDom _ ( a ) { let b = "blocklyScrollbar" + ( this . horizontal ? "Horizontal" : "Vertical" ) ; a && ( b += " " + a ) ; this . outerSvg _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . SVG ,
{ "class" : b } ) ; this . svgGroup _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G , { } , this . outerSvg _ ) ; this . svgBackground _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "blocklyScrollbarBackground" } , this . svgGroup _ ) ; a = Math . floor ( ( Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness - 5 ) / 2 ) ; this . svgHandle _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "blocklyScrollbarHandle" ,
rx : a , ry : a } , this . svgGroup _ ) ; this . workspace . getThemeManager ( ) . subscribe ( this . svgHandle _ , "scrollbarColour" , "fill" ) ; this . workspace . getThemeManager ( ) . subscribe ( this . svgHandle _ , "scrollbarOpacity" , "fill-opacity" ) ; insertAfter$$module$build$src$core$utils$dom ( this . outerSvg _ , this . workspace . getParentSvg ( ) ) } isVisible ( ) { return this . isVisible _ } setContainerVisible ( a ) { const b = a !== this . containerVisible _ ; this . containerVisible _ = a ; b && this . updateDisplay _ ( ) } setVisible ( a ) { const b = a !== this . isVisible ( ) ; if ( this . pair _ ) throw Error ( "Unable to toggle visibility of paired scrollbars." ) ;
this . isVisible _ = a ; b && this . updateDisplay _ ( ) } updateDisplay _ ( ) { this . containerVisible _ && this . isVisible ( ) ? this . outerSvg _ . setAttribute ( "display" , "block" ) : this . outerSvg _ . setAttribute ( "display" , "none" ) } onMouseDownBar _ ( a ) { this . workspace . markFocused ( ) ; clearTouchIdentifier$$module$build$src$core$touch ( ) ; this . cleanUp _ ( ) ; if ( isRightButton$$module$build$src$core$browser _events ( a ) ) a . stopPropagation ( ) ; else { var b = mouseToSvg$$module$build$src$core$browser _events ( a , this . workspace . getParentSvg ( ) , this . workspace . getInverseScreenCTM ( ) ) ;
b = this . horizontal ? b . x : b . y ; var c = getInjectionDivXY$$module$build$src$core$utils$svg _math ( this . svgHandle _ ) ; c = this . horizontal ? c . x : c . y ; var d = this . handlePosition _ , e = . 95 * this . handleLength _ ; b <= c ? d -= e : b >= c + this . handleLength _ && ( d += e ) ; this . setHandlePosition ( this . constrainHandlePosition _ ( d ) ) ; this . updateMetrics _ ( ) ; a . stopPropagation ( ) ; a . preventDefault ( ) } } onMouseDownHandle _ ( a ) { this . workspace . markFocused ( ) ; this . cleanUp _ ( ) ; isRightButton$$module$build$src$core$browser _events ( a ) ? a . stopPropagation ( ) : ( this . startDragHandle =
this . handlePosition _ , this . workspace . setupDragSurface ( ) , this . startDragMouse _ = this . horizontal ? a . clientX : a . clientY , this . onMouseUpWrapper _ = conditionalBind$$module$build$src$core$browser _events ( document , "mouseup" , this , this . onMouseUpHandle _ ) , this . onMouseMoveWrapper _ = conditionalBind$$module$build$src$core$browser _events ( document , "mousemove" , this , this . onMouseMoveHandle _ ) , a . stopPropagation ( ) , a . preventDefault ( ) ) } onMouseMoveHandle _ ( a ) { this . setHandlePosition ( this . constrainHandlePosition _ ( this . startDragHandle +
( ( this . horizontal ? a . clientX : a . clientY ) - this . startDragMouse _ ) ) ) ; this . updateMetrics _ ( ) } onMouseUpHandle _ ( ) { this . workspace . resetDragSurface ( ) ; clearTouchIdentifier$$module$build$src$core$touch ( ) ; this . cleanUp _ ( ) } cleanUp _ ( ) { this . workspace . hideChaff ( ! 0 ) ; this . onMouseUpWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onMouseUpWrapper _ ) , this . onMouseUpWrapper _ = null ) ; this . onMouseMoveWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onMouseMoveWrapper _ ) , this . onMouseMoveWrapper _ = null ) } getRatio _ ( ) { let a =
this . handlePosition _ / ( this . scrollbarLength _ - this . handleLength _ ) ; isNaN ( a ) && ( a = 0 ) ; return a } updateMetrics _ ( ) { const a = this . getRatio _ ( ) ; this . horizontal ? this . workspace . setMetrics ( { x : a } ) : this . workspace . setMetrics ( { y : a } ) } set ( a , b ) { this . setHandlePosition ( this . constrainHandlePosition _ ( a * this . ratio ) ) ; ( b || void 0 === b ) && this . updateMetrics _ ( ) } setOrigin ( a , b ) { this . origin _ = new Coordinate$$module$build$src$core$utils$coordinate ( a , b ) } static metricsAreEquivalent _ ( a , b ) { return a . viewWidth === b . viewWidth && a . viewHeight === b . viewHeight &&
a . viewLeft === b . viewLeft && a . viewTop === b . viewTop && a . absoluteTop === b . absoluteTop && a . absoluteLeft === b . absoluteLeft && a . scrollWidth === b . scrollWidth && a . scrollHeight === b . scrollHeight && a . scrollLeft === b . scrollLeft && a . scrollTop === b . scrollTop } } ; Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness = TOUCH _ENABLED$$module$build$src$core$touch ? 25 : 15 ; Scrollbar$$module$build$src$core$scrollbar . DEFAULT _SCROLLBAR _MARGIN = . 5 ; var module$build$src$core$scrollbar = { } ; module$build$src$core$scrollbar . Scrollbar = Scrollbar$$module$build$src$core$scrollbar ; var Bubble$$module$build$src$core$bubble = class { constructor ( a , b , c , d , e , f ) { this . resizeGroup _ = this . bubbleBack _ = this . bubbleArrow _ = this . bubbleGroup _ = null ; this . height _ = this . width _ = this . relativeTop _ = this . relativeLeft _ = 0 ; this . autoLayout _ = ! 0 ; this . onMouseDownResizeWrapper _ = this . onMouseDownBubbleWrapper _ = this . moveCallback _ = this . resizeCallback _ = null ; this . rendered _ = this . disposed = ! 1 ; this . workspace _ = a ; this . content _ = b ; this . shape _ = c ; c = Bubble$$module$build$src$core$bubble . ARROW _ANGLE ; this . workspace _ . RTL && ( c = - c ) ; this . arrow _radians _ =
toRadians$$module$build$src$core$utils$math ( c ) ; a . getBubbleCanvas ( ) . appendChild ( this . createDom _ ( b , ! ( ! e || ! f ) ) ) ; this . setAnchorLocation ( d ) ; e && f || ( a = this . content _ . getBBox ( ) , e = a . width + 2 * Bubble$$module$build$src$core$bubble . BORDER _WIDTH , f = a . height + 2 * Bubble$$module$build$src$core$bubble . BORDER _WIDTH ) ; this . setBubbleSize ( e , f ) ; this . positionBubble _ ( ) ; this . renderArrow _ ( ) ; this . rendered _ = ! 0 } createDom _ ( a , b ) { this . bubbleGroup _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G ,
{ } ) ; var c = { filter : "url(#" + this . workspace _ . getRenderer ( ) . getConstants ( ) . embossFilterId + ")" } ; JavaFx$$module$build$src$core$utils$useragent && ( c = { } ) ; c = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G , c , this . bubbleGroup _ ) ; this . bubbleArrow _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . PATH , { } , c ) ; this . bubbleBack _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "blocklyDraggable" ,
x : 0 , y : 0 , rx : Bubble$$module$build$src$core$bubble . BORDER _WIDTH , ry : Bubble$$module$build$src$core$bubble . BORDER _WIDTH } , c ) ; b ? ( this . resizeGroup _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G , { "class" : this . workspace _ . RTL ? "blocklyResizeSW" : "blocklyResizeSE" } , this . bubbleGroup _ ) , b = 2 * Bubble$$module$build$src$core$bubble . BORDER _WIDTH , createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . POLYGON , { points : "0,x x,x x,0" . replace ( /x/g , b . toString ( ) ) } ,
this . resizeGroup _ ) , createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . LINE , { "class" : "blocklyResizeLine" , x1 : b / 3 , y1 : b - 1 , x2 : b - 1 , y2 : b / 3 } , this . resizeGroup _ ) , createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . LINE , { "class" : "blocklyResizeLine" , x1 : 2 * b / 3 , y1 : b - 1 , x2 : b - 1 , y2 : 2 * b / 3 } , this . resizeGroup _ ) ) : this . resizeGroup _ = null ; this . workspace _ . options . readOnly || ( this . onMouseDownBubbleWrapper _ = conditionalBind$$module$build$src$core$browser _events ( this . bubbleBack _ ,
"mousedown" , this , this . bubbleMouseDown _ ) , this . resizeGroup _ && ( this . onMouseDownResizeWrapper _ = conditionalBind$$module$build$src$core$browser _events ( this . resizeGroup _ , "mousedown" , this , this . resizeMouseDown _ ) ) ) ; this . bubbleGroup _ . appendChild ( a ) ; return this . bubbleGroup _ } getSvgRoot ( ) { return this . bubbleGroup _ } setSvgId ( a ) { let b ; null == ( b = this . bubbleGroup _ ) || b . setAttribute ( "data-block-id" , a ) } bubbleMouseDown _ ( a ) { const b = this . workspace _ . getGesture ( a ) ; b && b . handleBubbleStart ( a , this ) } showContextMenu ( a ) { } isDeletable ( ) { return ! 1 } setDeleteStyle ( a ) { } resizeMouseDown _ ( a ) { this . promote ( ) ;
Bubble$$module$build$src$core$bubble . unbindDragEvents _ ( ) ; isRightButton$$module$build$src$core$browser _events ( a ) || ( this . workspace _ . startDrag ( a , new Coordinate$$module$build$src$core$utils$coordinate ( this . workspace _ . RTL ? - this . width _ : this . width _ , this . height _ ) ) , Bubble$$module$build$src$core$bubble . onMouseUpWrapper _ = conditionalBind$$module$build$src$core$browser _events ( document , "mouseup" , this , Bubble$$module$build$src$core$bubble . bubbleMouseUp _ ) , Bubble$$module$build$src$core$bubble . onMouseMoveWrapper _ = conditionalBind$$module$build$src$core$browser _events ( document ,
"mousemove" , this , this . resizeMouseMove _ ) , this . workspace _ . hideChaff ( ) ) ; a . stopPropagation ( ) } resizeMouseMove _ ( a ) { this . autoLayout _ = ! 1 ; a = this . workspace _ . moveDrag ( a ) ; this . setBubbleSize ( this . workspace _ . RTL ? - a . x : a . x , a . y ) ; this . workspace _ . RTL && this . positionBubble _ ( ) } registerResizeEvent ( a ) { this . resizeCallback _ = a } registerMoveEvent ( a ) { this . moveCallback _ = a } promote ( ) { let a ; const b = null == ( a = this . bubbleGroup _ ) ? void 0 : a . parentNode ; return ( null == b ? void 0 : b . lastChild ) !== this . bubbleGroup _ && this . bubbleGroup _ ? ( null == b || b . appendChild ( this . bubbleGroup _ ) ,
! 0 ) : ! 1 } setAnchorLocation ( a ) { this . anchorXY _ = a ; this . rendered _ && this . positionBubble _ ( ) } layoutBubble _ ( ) { var a = this . workspace _ . getMetricsManager ( ) . getViewMetrics ( ! 0 ) , b = this . getOptimalRelativeLeft _ ( a ) , c = this . getOptimalRelativeTop _ ( a ) , d = this . shape _ . getBBox ( ) ; const e = { x : b , y : - this . height _ - this . workspace _ . getRenderer ( ) . getConstants ( ) . MIN _BLOCK _HEIGHT } , f = { x : - this . width _ - 30 , y : c } ; c = { x : d . width , y : c } ; var g = { x : b , y : d . height } ; b = d . width < d . height ? c : g ; d = d . width < d . height ? g : c ; c = this . getOverlap _ ( e , a ) ; g = this . getOverlap _ ( f ,
a ) ; const h = this . getOverlap _ ( b , a ) ; a = this . getOverlap _ ( d , a ) ; a = Math . max ( c , g , h , a ) ; c === a ? ( this . relativeLeft _ = e . x , this . relativeTop _ = e . y ) : g === a ? ( this . relativeLeft _ = f . x , this . relativeTop _ = f . y ) : h === a ? ( this . relativeLeft _ = b . x , this . relativeTop _ = b . y ) : ( this . relativeLeft _ = d . x , this . relativeTop _ = d . y ) } getOverlap _ ( a , b ) { var c = this . workspace _ . RTL ? this . anchorXY _ . x - a . x - this . width _ : a . x + this . anchorXY _ . x ; a = a . y + this . anchorXY _ . y ; return Math . max ( 0 , Math . min ( 1 , ( Math . min ( c + this . width _ , b . left + b . width ) - Math . max ( c , b . left ) ) * ( Math . min ( a +
this . height _ , b . top + b . height ) - Math . max ( a , b . top ) ) / ( this . width _ * this . height _ ) ) ) } getOptimalRelativeLeft _ ( a ) { let b = - this . width _ / 4 ; if ( this . width _ > a . width ) return b ; if ( this . workspace _ . RTL ) { var c = this . anchorXY _ . x - b , d = a . left + a . width ; a = a . left + Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness / this . workspace _ . scale ; c - this . width _ < a ? b = - ( a - this . anchorXY _ . x + this . width _ ) : c > d && ( b = - ( d - this . anchorXY _ . x ) ) } else { c = b + this . anchorXY _ . x ; d = c + this . width _ ; const e = a . left ; a = a . left + a . width - Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness /
this . workspace _ . scale ; c < e ? b = e - this . anchorXY _ . x : d > a && ( b = a - this . anchorXY _ . x - this . width _ ) } return b } getOptimalRelativeTop _ ( a ) { let b = - this . height _ / 4 ; if ( this . height _ > a . height ) return b ; const c = this . anchorXY _ . y + b , d = c + this . height _ , e = a . top ; a = a . top + a . height - Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness / this . workspace _ . scale ; const f = this . anchorXY _ . y ; c < e ? b = e - f : d > a && ( b = a - f - this . height _ ) ; return b } positionBubble _ ( ) { let a = this . anchorXY _ . x ; a = this . workspace _ . RTL ? a - ( this . relativeLeft _ + this . width _ ) : a +
this . relativeLeft _ ; this . moveTo ( a , this . relativeTop _ + this . anchorXY _ . y ) } moveTo ( a , b ) { let c ; null == ( c = this . bubbleGroup _ ) || c . setAttribute ( "transform" , "translate(" + a + "," + b + ")" ) } setDragging ( a ) { ! a && this . moveCallback _ && this . moveCallback _ ( ) } getBubbleSize ( ) { return new Size$$module$build$src$core$utils$size ( this . width _ , this . height _ ) } setBubbleSize ( a , b ) { const c = 2 * Bubble$$module$build$src$core$bubble . BORDER _WIDTH ; a = Math . max ( a , c + 45 ) ; b = Math . max ( b , c + 20 ) ; this . width _ = a ; this . height _ = b ; let d ; null == ( d = this . bubbleBack _ ) ||
d . setAttribute ( "width" , a . toString ( ) ) ; let e ; null == ( e = this . bubbleBack _ ) || e . setAttribute ( "height" , b . toString ( ) ) ; this . resizeGroup _ && ( this . workspace _ . RTL ? this . resizeGroup _ . setAttribute ( "transform" , "translate(" + 2 * Bubble$$module$build$src$core$bubble . BORDER _WIDTH + "," + ( b - c ) + ") scale(-1 1)" ) : this . resizeGroup _ . setAttribute ( "transform" , "translate(" + ( a - c ) + "," + ( b - c ) + ")" ) ) ; this . autoLayout _ && this . layoutBubble _ ( ) ; this . positionBubble _ ( ) ; this . renderArrow _ ( ) ; this . resizeCallback _ && this . resizeCallback _ ( ) } renderArrow _ ( ) { const a =
[ ] ; var b = this . width _ / 2 , c = this . 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 n = Math . cos ( h ) ; var l = this . getBubbleSize ( ) ; h = ( l . width + l . height ) / Bubble$$module$build$src$core$bubble . ARROW _THICKNESS ; h = Math . min ( h , l . width , l . height ) / 4 ; l = 1 - Bubble$$module$build$src$core$bubble . ANCHOR _RADIUS / f ;
d = b + l * d ; e = c + l * e ; l = b + h * n ; const p = c + h * k ; b -= h * n ; c -= h * k ; k = g + this . arrow _radians _ ; k > 2 * Math . PI && ( k -= 2 * Math . PI ) ; g = Math . sin ( k ) * f / Bubble$$module$build$src$core$bubble . ARROW _BEND ; f = Math . cos ( k ) * f / Bubble$$module$build$src$core$bubble . ARROW _BEND ; a . push ( "M" + l + "," + p ) ; a . push ( "C" + ( l + f ) + "," + ( p + g ) + " " + d + "," + e + " " + d + "," + e ) ; a . push ( "C" + d + "," + e + " " + ( b + f ) + "," + ( c + g ) + " " + b + "," + c ) } a . push ( "z" ) ; let m ; null == ( m = this . bubbleArrow _ ) || m . setAttribute ( "d" , a . join ( " " ) ) } setColour ( a ) { let b ; null == ( b = this . bubbleBack _ ) || b . setAttribute ( "fill" ,
a ) ; let c ; null == ( c = this . bubbleArrow _ ) || c . setAttribute ( "fill" , a ) } dispose ( ) { this . onMouseDownBubbleWrapper _ && unbind$$module$build$src$core$browser _events ( this . onMouseDownBubbleWrapper _ ) ; this . onMouseDownResizeWrapper _ && unbind$$module$build$src$core$browser _events ( this . onMouseDownResizeWrapper _ ) ; Bubble$$module$build$src$core$bubble . unbindDragEvents _ ( ) ; removeNode$$module$build$src$core$utils$dom ( this . bubbleGroup _ ) ; this . disposed = ! 0 } moveDuringDrag ( a , b ) { a ? a . translateSurface ( b . x , b . y ) : this . moveTo ( b . x , b . y ) ; this . relativeLeft _ =
this . workspace _ . RTL ? this . anchorXY _ . x - b . x - this . width _ : b . x - this . anchorXY _ . x ; this . relativeTop _ = b . y - this . anchorXY _ . y ; this . renderArrow _ ( ) } getRelativeToSurfaceXY ( ) { return new Coordinate$$module$build$src$core$utils$coordinate ( this . workspace _ . RTL ? - this . relativeLeft _ + this . anchorXY _ . x - this . width _ : this . anchorXY _ . x + this . relativeLeft _ , this . anchorXY _ . y + this . relativeTop _ ) } setAutoLayout ( a ) { this . autoLayout _ = a } static unbindDragEvents _ ( ) { Bubble$$module$build$src$core$bubble . onMouseUpWrapper _ && ( unbind$$module$build$src$core$browser _events ( Bubble$$module$build$src$core$bubble . onMouseUpWrapper _ ) ,
Bubble$$module$build$src$core$bubble . onMouseUpWrapper _ = null ) ; Bubble$$module$build$src$core$bubble . onMouseMoveWrapper _ && ( unbind$$module$build$src$core$browser _events ( Bubble$$module$build$src$core$bubble . onMouseMoveWrapper _ ) , Bubble$$module$build$src$core$bubble . onMouseMoveWrapper _ = null ) } static bubbleMouseUp _ ( a ) { clearTouchIdentifier$$module$build$src$core$touch ( ) ; Bubble$$module$build$src$core$bubble . unbindDragEvents _ ( ) } static textToDom ( a ) { const b = 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$bubble . BORDER _WIDTH } ) ; a = a . split ( "\n" ) ; for ( let c = 0 ; c < a . length ; 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$bubble . BORDER _WIDTH } , b ) , e = document . createTextNode ( a [ c ] ) ; d . appendChild ( e ) } return b } static createNonEditableBubble ( a , b , c ) { c = new Bubble$$module$build$src$core$bubble ( b . workspace , a , b . pathObject . svgPath ,
c , null , null ) ; c . setSvgId ( b . id ) ; if ( b . RTL ) { b = a . getBBox ( ) . width ; for ( let d = 0 , e ; e = a . childNodes [ d ] ; d ++ ) e . setAttribute ( "text-anchor" , "end" ) , e . setAttribute ( "x" , ( b + Bubble$$module$build$src$core$bubble . BORDER _WIDTH ) . toString ( ) ) } return c } } ; Bubble$$module$build$src$core$bubble . BORDER _WIDTH = 6 ; Bubble$$module$build$src$core$bubble . ARROW _THICKNESS = 5 ; Bubble$$module$build$src$core$bubble . ARROW _ANGLE = 20 ; Bubble$$module$build$src$core$bubble . ARROW _BEND = 4 ; Bubble$$module$build$src$core$bubble . ANCHOR _RADIUS = 8 ;
Bubble$$module$build$src$core$bubble . onMouseUpWrapper _ = null ; Bubble$$module$build$src$core$bubble . onMouseMoveWrapper _ = null ; var module$build$src$core$bubble = { } ; module$build$src$core$bubble . Bubble = Bubble$$module$build$src$core$bubble ; 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 = { } ; module$build$src$core$config . config = $ . config$$module$build$src$core$config ; var Icon$$module$build$src$core$icon = class { constructor ( a ) { this . iconGroup _ = null ; this . collapseHidden = ! 0 ; this . SIZE = 17 ; this . iconXY _ = this . bubble _ = null ; a || warn$$module$build$src$core$utils$deprecation ( "Calling the Icon constructor with a null block" , "version 9" , "version 10" , "a non-null block" ) ; this . block _ = a } createIcon ( ) { this . iconGroup _ || ( this . iconGroup _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G , { "class" : "blocklyIconGroup" } ) , this . getBlock ( ) . isInFlyout && addClass$$module$build$src$core$utils$dom ( this . iconGroup _ ,
"blocklyIconGroupReadonly" ) , this . drawIcon _ ( this . iconGroup _ ) , this . getBlock ( ) . getSvgRoot ( ) . appendChild ( this . iconGroup _ ) , conditionalBind$$module$build$src$core$browser _events ( this . iconGroup _ , "mouseup" , this , this . iconClick _ ) , this . updateEditable ( ) ) } dispose ( ) { removeNode$$module$build$src$core$utils$dom ( this . iconGroup _ ) ; this . setVisible ( ! 1 ) } updateEditable ( ) { } isVisible ( ) { return ! ! this . bubble _ } iconClick _ ( a ) { this . getBlock ( ) . workspace . isDragging ( ) || this . getBlock ( ) . isInFlyout || isRightButton$$module$build$src$core$browser _events ( a ) ||
this . setVisible ( ! this . isVisible ( ) ) } applyColour ( ) { this . bubble _ && this . isVisible ( ) && this . bubble _ . setColour ( this . getBlock ( ) . style . colourPrimary ) } setIconLocation ( a ) { this . iconXY _ = a ; this . bubble _ && this . isVisible ( ) && this . bubble _ . setAnchorLocation ( a ) } computeIconLocation ( ) { var a = this . getBlock ( ) . getRelativeToSurfaceXY ( ) ; const b = getRelativeXY$$module$build$src$core$utils$svg _math ( this . iconGroup _ ) ; a = new Coordinate$$module$build$src$core$utils$coordinate ( a . x + b . x + this . SIZE / 2 , a . y + b . y + this . SIZE / 2 ) ; Coordinate$$module$build$src$core$utils$coordinate . equals ( this . getIconLocation ( ) ,
a ) || this . setIconLocation ( a ) } getIconLocation ( ) { return this . iconXY _ } getCorrectedSize ( ) { return new Size$$module$build$src$core$utils$size ( this . SIZE , this . SIZE - 2 ) } drawIcon _ ( a ) { } setVisible ( a ) { } getBlock ( ) { if ( ! this . block _ ) throw Error ( "Block is not set for this icon." ) ; return this . block _ } } , module$build$src$core$icon = { } ; module$build$src$core$icon . Icon = Icon$$module$build$src$core$icon ; $ . module$build$src$core$utils$object = { } ; $ . module$build$src$core$utils$object . deepMerge = deepMerge$$module$build$src$core$utils$object ; $ . module$build$src$core$utils$object . inherits = inherits$$module$build$src$core$utils$object ; $ . module$build$src$core$utils$object . mixin = mixin$$module$build$src$core$utils$object ; $ . module$build$src$core$utils$object . values = values$$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 ) } getClassName ( ) { return this . name + "-theme" } setBlockStyle ( a , b ) { this . blockStyles [ a ] = b } setCategoryStyle ( a , b ) { this . categoryStyles [ a ] = b } getComponentStyle ( a ) { return ( a =
this . componentStyles [ a ] ) && "string" === typeof a && this . getComponentStyle ( a ) ? this . getComponentStyle ( a ) : a ? String ( a ) : null } setComponentStyle ( a , b ) { this . componentStyles [ a ] = b } setFontStyle ( a ) { this . fontStyle = a } setStartHats ( a ) { this . startHats = a } static defineTheme ( a , b ) { a = a . toLowerCase ( ) ; const c = new Theme$$module$build$src$core$theme ( a ) ; let d = b . base ; if ( d ) { if ( "string" === typeof d ) { let e ; d = null != ( e = getObject$$module$build$src$core$registry ( Type$$module$build$src$core$registry . THEME , d ) ) ? e : void 0 } d instanceof Theme$$module$build$src$core$theme &&
( deepMerge$$module$build$src$core$utils$object ( c , d ) , c . name = a ) } deepMerge$$module$build$src$core$utils$object ( c . blockStyles , b . blockStyles ) ; deepMerge$$module$build$src$core$utils$object ( c . categoryStyles , b . categoryStyles ) ; deepMerge$$module$build$src$core$utils$object ( c . componentStyles , b . componentStyles ) ; deepMerge$$module$build$src$core$utils$object ( c . fontStyle , b . fontStyle ) ; null !== b . startHats && ( c . startHats = b . startHats ) ; return c } } , module$build$src$core$theme = { } ; module$build$src$core$theme . Theme = Theme$$module$build$src$core$theme ; var defaultBlockStyles$$module$build$src$core$theme$classic = { colour _blocks : { colourPrimary : "20" } , list _blocks : { colourPrimary : "260" } , logic _blocks : { colourPrimary : "210" } , loop _blocks : { colourPrimary : "120" } , math _blocks : { colourPrimary : "230" } , procedure _blocks : { colourPrimary : "290" } , text _blocks : { colourPrimary : "160" } , variable _blocks : { colourPrimary : "330" } , variable _dynamic _blocks : { colourPrimary : "310" } , hat _blocks : { colourPrimary : "330" , hat : "cap" } } , categoryStyles$$module$build$src$core$theme$classic = { colour _category : { colour : "20" } ,
list _category : { colour : "260" } , logic _category : { colour : "210" } , loop _category : { colour : "120" } , math _category : { colour : "230" } , procedure _category : { colour : "290" } , text _category : { colour : "160" } , variable _category : { colour : "330" } , variable _dynamic _category : { colour : "310" } } , Classic$$module$build$src$core$theme$classic = new Theme$$module$build$src$core$theme ( "classic" , defaultBlockStyles$$module$build$src$core$theme$classic , categoryStyles$$module$build$src$core$theme$classic ) , module$build$src$core$theme$classic = { } ;
module$build$src$core$theme$classic . Classic = Classic$$module$build$src$core$theme$classic ; var CATEGORY _TOOLBOX _KIND$$module$build$src$core$utils$toolbox = "categoryToolbox" , FLYOUT _TOOLBOX _KIND$$module$build$src$core$utils$toolbox = "flyoutToolbox" , Position$$module$build$src$core$utils$toolbox ; ( function ( a ) { a [ a . TOP = 0 ] = "TOP" ; a [ a . BOTTOM = 1 ] = "BOTTOM" ; a [ a . LEFT = 2 ] = "LEFT" ; a [ a . RIGHT = 3 ] = "RIGHT" } ) ( Position$$module$build$src$core$utils$toolbox || ( Position$$module$build$src$core$utils$toolbox = { } ) ) ;
var TEST _ONLY$$module$build$src$core$utils$toolbox = { hasCategoriesInternal : hasCategoriesInternal$$module$build$src$core$utils$toolbox } , module$build$src$core$utils$toolbox = { } ; module$build$src$core$utils$toolbox . Position = Position$$module$build$src$core$utils$toolbox ; module$build$src$core$utils$toolbox . TEST _ONLY = TEST _ONLY$$module$build$src$core$utils$toolbox ; module$build$src$core$utils$toolbox . convertFlyoutDefToJsonArray = convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox ;
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 Options$$module$build$src$core$options = class { constructor ( a ) { this . gridPattern = null ; this . getMetrics = this . setMetrics = void 0 ; let b = null , c = ! 1 ; var d = ! 1 , e = ! 1 , f = ! 1 , g = ! 1 , h = ! 1 ; const k = ! ! a . readOnly ; if ( ! k ) { var l ; b = convertToolboxDefToJson$$module$build$src$core$utils$toolbox ( null != ( l = a . toolbox ) ? l : null ) ; c = hasCategories$$module$build$src$core$utils$toolbox ( b ) ; d = a . trashcan ; d = void 0 === d ? c : d ; e = a . collapse ; e = void 0 === e ? c : e ; f = a . comments ; f = void 0 === f ? c : f ; g = a . disable ; g = void 0 === g ? c : g ; h = a . sounds ; h = void 0 === h ? ! 0 : h } l =
a . maxTrashcanContents ; d ? void 0 === l && ( l = 32 ) : l = 0 ; const m = ! ! a . rtl ; let n = a . horizontalLayout ; void 0 === n && ( n = ! 1 ) ; var p = "end" !== a . toolboxPosition ; p = n ? p ? Position$$module$build$src$core$utils$toolbox . TOP : Position$$module$build$src$core$utils$toolbox . BOTTOM : p === m ? Position$$module$build$src$core$utils$toolbox . RIGHT : Position$$module$build$src$core$utils$toolbox . LEFT ; let r = a . css ; void 0 === r && ( r = ! 0 ) ; let q = "https://blockly-demo.appspot.com/static/media/" ; a . media ? q = a . media . endsWith ( "/" ) ? a . media : a . media + "/" : "path" in
a && ( warn$$module$build$src$core$utils$deprecation ( "path" , "Nov 2014" , "Jul 2023" , "media" ) , q = a . path + "media/" ) ; const t = a . oneBasedIndex , x = a . renderer || "geras" , y = a . plugins || { } ; this . RTL = m ; this . oneBasedIndex = void 0 === t ? ! 0 : t ; this . collapse = e ; this . comments = f ; this . disable = g ; this . readOnly = k ; this . maxBlocks = a . maxBlocks || Infinity ; let u ; this . maxInstances = null != ( u = a . maxInstances ) ? u : null ; this . pathToMedia = q ; this . hasCategories = c ; this . moveOptions = Options$$module$build$src$core$options . parseMoveOptions _ ( a , c ) ; this . hasScrollbars =
! ! this . moveOptions . scrollbars ; this . hasTrashcan = d ; this . maxTrashcanContents = l ; this . hasSounds = h ; this . hasCss = r ; this . horizontalLayout = n ; this . languageTree = b ; this . gridOptions = Options$$module$build$src$core$options . parseGridOptions _ ( a ) ; this . zoomOptions = Options$$module$build$src$core$options . parseZoomOptions _ ( a ) ; this . toolboxPosition = p ; this . theme = Options$$module$build$src$core$options . parseThemeOptions _ ( a ) ; this . renderer = x ; let v ; this . rendererOverrides = null != ( v = a . rendererOverrides ) ? v : null ; let w ; this . parentWorkspace =
null != ( w = a . parentWorkspace ) ? w : null ; this . plugins = y } static parseMoveOptions _ ( a , b ) { const c = a . move || { } , d = { } ; void 0 === c . scrollbars && void 0 === a . scrollbars ? d . scrollbars = b : "object" === typeof c . scrollbars ? ( d . scrollbars = { horizontal : ! ! c . scrollbars . horizontal , vertical : ! ! c . scrollbars . vertical } , d . scrollbars . horizontal && d . scrollbars . vertical ? d . scrollbars = ! 0 : d . scrollbars . horizontal || d . scrollbars . vertical || ( d . scrollbars = ! 1 ) ) : d . scrollbars = ! ! c . scrollbars || ! ! a . scrollbars ; d . wheel = d . scrollbars && void 0 !== c . wheel ? ! ! c . wheel :
"object" === typeof d . scrollbars ; d . drag = d . scrollbars ? void 0 === c . drag ? ! 0 : ! ! c . drag : ! 1 ; return d } static parseZoomOptions _ ( a ) { a = a . zoom || { } ; const b = { } ; b . controls = void 0 === a . controls ? ! 1 : ! ! a . controls ; b . wheel = void 0 === a . wheel ? ! 1 : ! ! a . wheel ; b . startScale = void 0 === a . startScale ? 1 : Number ( a . startScale ) ; b . maxScale = void 0 === a . maxScale ? 3 : Number ( a . maxScale ) ; b . minScale = void 0 === a . minScale ? . 3 : Number ( a . minScale ) ; b . scaleSpeed = void 0 === a . scaleSpeed ? 1.2 : Number ( a . scaleSpeed ) ; b . pinch = void 0 === a . pinch ? b . wheel || b . controls : ! ! a . pinch ;
return b } static parseGridOptions _ ( a ) { a = a . grid || { } ; const b = { } ; b . spacing = Number ( a . spacing ) || 0 ; b . colour = a . colour || "#888" ; b . length = void 0 === a . length ? 1 : Number ( a . length ) ; b . snap = 0 < b . spacing && ! ! a . snap ; return b } static parseThemeOptions _ ( a ) { a = a . theme || Classic$$module$build$src$core$theme$classic ; return "string" === typeof a ? getObject$$module$build$src$core$registry ( Type$$module$build$src$core$registry . THEME , a ) : a instanceof Theme$$module$build$src$core$theme ? a : Theme$$module$build$src$core$theme . defineTheme ( a . name ||
"builtin" + getNextUniqueId$$module$build$src$core$utils$idgenerator ( ) , a ) } } , module$build$src$core$options = { } ; module$build$src$core$options . Options = Options$$module$build$src$core$options ; var module$build$src$core$mutator ;
$ . Mutator$$module$build$src$core$mutator = class extends Icon$$module$build$src$core$icon { constructor ( a , b ) { b || warn$$module$build$src$core$utils$deprecation ( "Calling the Mutator constructor without passing the block it is attached to" , "version 9" , "version 10" , "the constructor by passing the list of subblocks and the block instance to attach the mutator to" ) ; super ( null != b ? b : null ) ; this . workspace _ = null ; this . workspaceHeight _ = this . workspaceWidth _ = 0 ; this . updateWorkspacePid _ = this . sourceListener _ = this . rootBlock _ =
this . svgDialog _ = null ; this . quarkNames _ = a } setBlock ( a ) { this . block _ = a } getWorkspace ( ) { return this . workspace _ } drawIcon _ ( a ) { createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "blocklyIconShape" , rx : "4" , ry : "4" , height : "16" , width : "16" } , a ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . PATH , { "class" : "blocklyIconSymbol" , d : "m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z" } ,
a ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . CIRCLE , { "class" : "blocklyIconShape" , r : "2.7" , cx : "8" , cy : "8" } , a ) } iconClick _ ( a ) { this . getBlock ( ) . isEditable ( ) && super . iconClick _ ( a ) } createEditor _ ( ) { this . svgDialog _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . SVG , { x : Bubble$$module$build$src$core$bubble . BORDER _WIDTH , y : Bubble$$module$build$src$core$bubble . BORDER _WIDTH } ) ; if ( this . quarkNames _ . length ) { var a = createElement$$module$build$src$core$utils$xml ( "xml" ) ;
for ( let d = 0 , e ; e = this . quarkNames _ [ d ] ; d ++ ) { var b = createElement$$module$build$src$core$utils$xml ( "block" ) ; b . setAttribute ( "type" , e ) ; a . appendChild ( b ) } } else a = null ; var c = this . getBlock ( ) ; b = new Options$$module$build$src$core$options ( { disable : ! 1 , parentWorkspace : c . workspace , media : c . workspace . options . pathToMedia , rtl : c . RTL , horizontalLayout : ! 1 , renderer : c . workspace . options . renderer , rendererOverrides : c . workspace . options . rendererOverrides } ) ; b . toolboxPosition = c . RTL ? Position$$module$build$src$core$utils$toolbox . RIGHT :
Position$$module$build$src$core$utils$toolbox . LEFT ; if ( c = ! ! a ) b . languageTree = convertToolboxDefToJson$$module$build$src$core$utils$toolbox ( a ) ; this . workspace _ = this . newWorkspaceSvg ( b ) ; this . workspace _ . internalIsMutator = ! 0 ; this . workspace _ . addChangeListener ( disableOrphans$$module$build$src$core$events$utils ) ; a = c ? this . workspace _ . addFlyout ( Svg$$module$build$src$core$utils$svg . G ) : null ; b = this . workspace _ . createDom ( "blocklyMutatorBackground" ) ; a && b . insertBefore ( a , this . workspace _ . svgBlockCanvas _ ) ; this . svgDialog _ . appendChild ( b ) ;
return this . svgDialog _ } newWorkspaceSvg ( a ) { throw Error ( "The implementation of newWorkspaceSvg should be monkey-patched in by blockly.ts" ) ; } updateEditable ( ) { super . updateEditable ( ) ; this . getBlock ( ) . isInFlyout || ( this . getBlock ( ) . isEditable ( ) ? this . iconGroup _ && removeClass$$module$build$src$core$utils$dom ( this . iconGroup _ , "blocklyIconGroupReadonly" ) : ( this . setVisible ( ! 1 ) , this . iconGroup _ && addClass$$module$build$src$core$utils$dom ( this . iconGroup _ , "blocklyIconGroupReadonly" ) ) ) } resizeBubble _ ( ) { var a = 2 * Bubble$$module$build$src$core$bubble . BORDER _WIDTH ;
const b = this . workspace _ . getCanvas ( ) . getBBox ( ) ; let c = b . width + b . x , d = b . height + 3 * a ; const e = this . workspace _ . getFlyout ( ) ; if ( e ) { const f = e . getWorkspace ( ) . getMetricsManager ( ) . getScrollMetrics ( ) ; d = Math . max ( d , f . height + 20 ) ; c += e . getWidth ( ) } this . getBlock ( ) . RTL && ( c = - b . x ) ; c += 3 * a ; if ( Math . abs ( this . workspaceWidth _ - c ) > a || Math . abs ( this . workspaceHeight _ - d ) > a ) this . workspaceWidth _ = c , this . workspaceHeight _ = d , this . bubble _ . setBubbleSize ( c + a , d + a ) , this . svgDialog _ . setAttribute ( "width" , ` ${ this . workspaceWidth _ } ` ) , this . svgDialog _ . setAttribute ( "height" ,
` ${ this . workspaceHeight _ } ` ) , this . workspace _ . setCachedParentSvgSize ( this . workspaceWidth _ , this . workspaceHeight _ ) ; this . getBlock ( ) . RTL && ( a = "translate(" + this . workspaceWidth _ + ",0)" , this . workspace _ . getCanvas ( ) . setAttribute ( "transform" , a ) ) ; this . workspace _ . resize ( ) } onBubbleMove _ ( ) { this . workspace _ && this . workspace _ . recordDragTargets ( ) } setVisible ( a ) { if ( a !== this . isVisible ( ) ) { var b = this . getBlock ( ) ; fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( BUBBLE _OPEN$$module$build$src$core$events$utils ) ) ( b ,
a , "mutator" ) ) ; if ( a ) { this . bubble _ = new Bubble$$module$build$src$core$bubble ( b . workspace , this . createEditor _ ( ) , b . pathObject . svgPath , this . iconXY _ , null , null ) ; this . bubble _ . setSvgId ( b . id ) ; this . bubble _ . registerMoveEvent ( this . onBubbleMove _ . bind ( this ) ) ; var c = this . workspace _ . options . languageTree ; a = this . workspace _ . getFlyout ( ) ; c && ( a . init ( this . workspace _ ) , a . show ( c ) ) ; this . rootBlock _ = b . decompose ( this . workspace _ ) ; c = this . rootBlock _ . getDescendants ( ! 1 ) ; for ( let d = 0 , e ; e = c [ d ] ; d ++ ) e . render ( ) ; this . rootBlock _ . setMovable ( ! 1 ) ;
this . rootBlock _ . setDeletable ( ! 1 ) ; a ? ( c = 2 * a . CORNER _RADIUS , a = this . rootBlock _ . RTL ? a . getWidth ( ) + c : c ) : a = c = 16 ; b . RTL && ( a = - a ) ; this . rootBlock _ . moveBy ( a , c ) ; if ( b . saveConnections ) { const d = this . rootBlock _ ; b . saveConnections ( d ) ; this . sourceListener _ = ( ) => { const e = this . getBlock ( ) ; e . saveConnections && e . saveConnections ( d ) } ; b . workspace . addChangeListener ( this . sourceListener _ ) } this . resizeBubble _ ( ) ; this . workspace _ . addChangeListener ( this . workspaceChanged _ . bind ( this ) ) ; this . updateWorkspace _ ( ) ; this . applyColour ( ) } else this . svgDialog _ =
null , this . workspace _ . dispose ( ) , this . rootBlock _ = this . workspace _ = null , null == ( c = this . bubble _ ) || c . dispose ( ) , this . bubble _ = null , this . workspaceHeight _ = this . workspaceWidth _ = 0 , this . sourceListener _ && ( b . workspace . removeChangeListener ( this . sourceListener _ ) , this . sourceListener _ = null ) } } workspaceChanged _ ( a ) { this . shouldIgnoreMutatorEvent _ ( a ) || this . updateWorkspacePid _ || ( this . updateWorkspacePid _ = setTimeout ( ( ) => { this . updateWorkspacePid _ = null ; this . updateWorkspace _ ( ) } , 0 ) ) } shouldIgnoreMutatorEvent _ ( 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 } updateWorkspace _ ( ) { if ( ! this . workspace _ . isDragging ( ) ) { var a = this . workspace _ . getTopBlocks ( ! 1 ) ; for ( let d = 0 , e ; e = a [ d ] ; d ++ ) { var b = e . getRelativeToSurfaceXY ( ) ; 20 > b . y && e . moveBy ( 0 , 20 - b . y ) ; if ( e . RTL ) { var c = - 20 ; const f = this . workspace _ . getFlyout ( ) ; f && ( c -= f . getWidth ( ) ) ; b . x > c && e . moveBy ( c - b . x , 0 ) } else 20 > b . x && e . moveBy ( 20 - b . x , 0 ) } } if ( this . rootBlock _ && this . rootBlock _ . workspace === this . workspace _ ) { ( a =
getGroup$$module$build$src$core$events$utils ( ) ) || setGroup$$module$build$src$core$events$utils ( ! 0 ) ; const d = this . getBlock ( ) ; b = BlockChange$$module$build$src$core$events$events _block _change . getExtraBlockState _ ( d ) ; c = d . rendered ; d . rendered = ! 1 ; d . compose ( this . rootBlock _ ) ; d . rendered = c ; d . initSvg ( ) ; d . rendered && d . render ( ) ; c = BlockChange$$module$build$src$core$events$events _block _change . getExtraBlockState _ ( d ) ; if ( b !== c ) { fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( CHANGE$$module$build$src$core$events$utils ) ) ( d ,
"mutation" , null , b , c ) ) ; const e = getGroup$$module$build$src$core$events$utils ( ) ; setTimeout ( function ( ) { const f = getGroup$$module$build$src$core$events$utils ( ) ; setGroup$$module$build$src$core$events$utils ( e ) ; d . bumpNeighbours ( ) ; setGroup$$module$build$src$core$events$utils ( f ) } , $ . config$$module$build$src$core$config . bumpDelay ) } this . workspace _ . isDragging ( ) || setTimeout ( ( ) => this . resizeBubble _ ( ) , 0 ) ; setGroup$$module$build$src$core$events$utils ( a ) } } dispose ( ) { this . getBlock ( ) . mutator = null ; super . dispose ( ) } updateBlockStyle ( ) { var a =
this . workspace _ ; if ( a && a . getAllBlocks ( ! 1 ) ) { const b = a . getAllBlocks ( ! 1 ) ; for ( let c = 0 , d ; d = b [ c ] ; c ++ ) d . setStyle ( d . getStyleName ( ) ) ; if ( a = a . getFlyout ( ) ) { a = a . getWorkspace ( ) . getAllBlocks ( ! 1 ) ; for ( let c = 0 , d ; d = a [ c ] ; c ++ ) d . setStyle ( d . getStyleName ( ) ) } } } static reconnect ( a , b , c ) { if ( ! a || ! a . getSourceBlock ( ) . workspace ) return ! 1 ; c = b . getInput ( c ) . connection ; const d = a . targetBlock ( ) ; return d && d !== b || ! c || c . targetConnection === a ? ! 1 : ( c . isConnected ( ) && c . disconnect ( ) , c . connect ( a ) , ! 0 ) } static findParentWs ( a ) { let b = null ; if ( a && a . options ) { const c =
a . options . parentWorkspace ; a . isFlyout ? c && c . options && ( b = c . options . parentWorkspace ) : c && ( b = c ) } return b } } ; module$build$src$core$mutator = { } ; module$build$src$core$mutator . Mutator = $ . Mutator$$module$build$src$core$mutator ; 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 ) ; $ . module$build$src$core$extensions = { } ; $ . 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 module$build$src$core$utils$array = { } ; module$build$src$core$utils$array . removeElem = removeElem$$module$build$src$core$utils$array ; var module$build$src$core$utils$svg _paths = { } ; module$build$src$core$utils$svg _paths . arc = arc$$module$build$src$core$utils$svg _paths ; module$build$src$core$utils$svg _paths . curve = curve$$module$build$src$core$utils$svg _paths ; module$build$src$core$utils$svg _paths . line = line$$module$build$src$core$utils$svg _paths ; module$build$src$core$utils$svg _paths . lineOnAxis = lineOnAxis$$module$build$src$core$utils$svg _paths ; module$build$src$core$utils$svg _paths . lineTo = lineTo$$module$build$src$core$utils$svg _paths ;
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 getInjectionDivXY _$$module$build$src$core$utils = getInjectionDivXY$$module$build$src$core$utils , 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 . arrayRemove = arrayRemove$$module$build$src$core$utils ; module$build$src$core$utils . browserEvents = module$build$src$core$browser _events ; module$build$src$core$utils . checkMessageReferences = checkMessageReferences$$module$build$src$core$utils ; 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 . getBlockTypeCounts = getBlockTypeCounts$$module$build$src$core$utils ; module$build$src$core$utils . getDocumentScroll = getDocumentScroll$$module$build$src$core$utils ; module$build$src$core$utils . getInjectionDivXY _ = getInjectionDivXY$$module$build$src$core$utils ;
module$build$src$core$utils . getRelativeXY = getRelativeXY$$module$build$src$core$utils ; module$build$src$core$utils . getViewportBBox = getViewportBBox$$module$build$src$core$utils ; module$build$src$core$utils . idGenerator = module$build$src$core$utils$idgenerator ; module$build$src$core$utils . is3dSupported = is3dSupported$$module$build$src$core$utils ; 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 . parseBlockColour = parseBlockColour$$module$build$src$core$utils ; module$build$src$core$utils . parsing = module$build$src$core$utils$parsing ; module$build$src$core$utils . replaceMessageReferences = replaceMessageReferences$$module$build$src$core$utils ; module$build$src$core$utils . runAfterPageLoad = runAfterPageLoad$$module$build$src$core$utils ; module$build$src$core$utils . screenToWsCoordinates = screenToWsCoordinates$$module$build$src$core$utils ; 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 . tokenizeInterpolation = tokenizeInterpolation$$module$build$src$core$utils ; 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 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 } fromJson ( a ) { super . fromJson ( a ) ; this . isOpen = a . isOpen } } ;
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 Capability$$module$build$src$core$component _manager = class { constructor ( a ) { this . name _ = a } toString ( ) { return this . name _ } } ; Capability$$module$build$src$core$component _manager . POSITIONABLE = new Capability$$module$build$src$core$component _manager ( "positionable" ) ; Capability$$module$build$src$core$component _manager . DRAG _TARGET = new Capability$$module$build$src$core$component _manager ( "drag_target" ) ; Capability$$module$build$src$core$component _manager . DELETE _AREA = new Capability$$module$build$src$core$component _manager ( "delete_area" ) ;
Capability$$module$build$src$core$component _manager . AUTOHIDEABLE = new Capability$$module$build$src$core$component _manager ( "autohideable" ) ;
var ComponentManager$$module$build$src$core$component _manager = class { constructor ( ) { this . componentData = new Map ; this . capabilityToComponentIds = new Map } addComponent ( a , b ) { const c = a . component . id ; if ( ! b && this . componentData . has ( c ) ) { var d ; throw Error ( 'Plugin "' + c + '" with capabilities "' + ( null == ( d = this . componentData . get ( c ) ) ? void 0 : d . capabilities ) + '" already added.' ) ; } this . componentData . set ( c , a ) ; b = [ ] ; for ( d = 0 ; d < a . capabilities . length ; d ++ ) { const e = String ( a . capabilities [ d ] ) . toLowerCase ( ) ; b . push ( e ) ; if ( this . capabilityToComponentIds . has ( e ) ) { let f ;
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 < b . capabilities . length ; c ++ ) { const d = String ( b . capabilities [ c ] ) . toLowerCase ( ) ; removeElem$$module$build$src$core$utils$array ( this . capabilityToComponentIds . get ( d ) , a ) } this . componentData . delete ( a ) } } addCapability ( a , b ) { if ( ! this . getComponent ( a ) ) throw Error ( 'Cannot add capability, "' + b + '". Plugin "' +
a + '" has not been added to the ComponentManager' ) ; if ( this . hasCapability ( a , b ) ) console . warn ( 'Plugin "' + a + 'already has capability "' + b + '"' ) ; else { b = String ( b ) . toLowerCase ( ) ; var c ; null == ( c = this . componentData . get ( a ) ) || c . capabilities . push ( b ) ; var d ; null == ( d = this . capabilityToComponentIds . get ( b ) ) || d . push ( a ) } } removeCapability ( a , b ) { if ( ! this . getComponent ( a ) ) throw Error ( 'Cannot remove capability, "' + b + '". Plugin "' + a + '" has not been added to the ComponentManager' ) ; this . hasCapability ( a , b ) ? ( b = String ( b ) . toLowerCase ( ) ,
removeElem$$module$build$src$core$utils$array ( this . componentData . get ( a ) . capabilities , b ) , removeElem$$module$build$src$core$utils$array ( this . capabilityToComponentIds . get ( b ) , a ) ) : console . warn ( 'Plugin "' + a + "doesn't have capability \"" + b + '" to remove' ) } hasCapability ( a , b ) { b = String ( b ) . toLowerCase ( ) ; return this . componentData . has ( a ) && - 1 !== this . componentData . get ( a ) . capabilities . indexOf ( b ) } getComponent ( a ) { let b ; return null == ( b = this . componentData . get ( a ) ) ? void 0 : b . component } getComponents ( a , b ) { a = String ( a ) . toLowerCase ( ) ;
a = this . capabilityToComponentIds . get ( a ) ; if ( ! a ) return [ ] ; const c = [ ] ; if ( b ) { const d = [ ] ; a . forEach ( e => { 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 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 \n block. It is an invariant of Blockly that shadow blocks only have shadow \n children");this.state=a}},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 ; var VARIABLES$$module$build$src$core$serialization$priorities = 100 , BLOCKS$$module$build$src$core$serialization$priorities = 50 , module$build$src$core$serialization$priorities = { } ; module$build$src$core$serialization$priorities . BLOCKS = BLOCKS$$module$build$src$core$serialization$priorities ; module$build$src$core$serialization$priorities . VARIABLES = VARIABLES$$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 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 . 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 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 } fromJson ( a ) { super . fromJson ( a ) ; this . xml = textToDom$$module$build$src$core$xml ( a . xml ) ; this . ids = a . ids ; this . json = a . json ; void 0 !== a . recordUndo &&
( this . recordUndo = a . recordUndo ) } 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 ( a ) append$$module$build$src$core$serialization$blocks ( this . json , b ) ; else for ( a = 0 ; a < this . ids . length ; a ++ ) { const c = this . ids [ a ] , d = b . getBlockById ( c ) ; d ? d . dispose ( ! 1 ) : c === this . blockId && console . warn ( "Can't uncreate non-existent block: " +
c ) } } } ; 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 BlockDelete$$module$build$src$core$events$events _block _delete = class extends BlockBase$$module$build$src$core$events$events _block _base { constructor ( a ) { super ( a ) ; this . type = DELETE$$module$build$src$core$events$utils ; if ( a ) { if ( a . getParent ( ) ) throw Error ( "Connected blocks cannot be deleted." ) ; a . isShadow ( ) && ( this . recordUndo = ! 1 ) ; this . oldXml = blockToDomWithXY$$module$build$src$core$xml ( a ) ; this . ids = getDescendantIds$$module$build$src$core$events$utils ( a ) ; this . wasShadow = a . isShadow ( ) ; this . oldJson = save$$module$build$src$core$serialization$blocks ( a ,
{ addCoordinates : ! 0 } ) } } toJson ( ) { const a = super . toJson ( ) ; if ( ! this . oldXml ) throw Error ( "The old 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 ( void 0 === this . wasShadow ) throw Error ( "Whether the block was a shadow is undefined. Either pass a block to the constructor, or call fromJson" ) ; if ( ! this . oldJson ) throw Error ( "The old block JSON is undefined. Either pass a block to the constructor, or call fromJson" ) ;
a . oldXml = domToText$$module$build$src$core$xml ( this . oldXml ) ; a . ids = this . ids ; a . wasShadow = this . wasShadow ; a . oldJson = this . oldJson ; this . recordUndo || ( a . recordUndo = this . recordUndo ) ; return a } fromJson ( a ) { super . fromJson ( a ) ; this . oldXml = textToDom$$module$build$src$core$xml ( a . oldXml ) ; this . ids = a . ids ; this . wasShadow = a . wasShadow || "shadow" === this . oldXml . tagName . toLowerCase ( ) ; this . oldJson = a . oldJson ; void 0 !== a . recordUndo && ( this . recordUndo = a . recordUndo ) } run ( a ) { const b = this . getEventWorkspace _ ( ) ; if ( ! this . ids ) throw Error ( "The block IDs are undefined. Either pass a block to the constructor, or call fromJson" ) ;
if ( ! this . oldJson ) throw Error ( "The old block JSON is undefined. Either pass a block to the constructor, or call fromJson" ) ; if ( a ) for ( a = 0 ; a < this . ids . length ; a ++ ) { const c = this . ids [ a ] , d = b . getBlockById ( c ) ; d ? d . dispose ( ! 1 ) : c === this . blockId && console . warn ( "Can't delete non-existent block: " + c ) } else append$$module$build$src$core$serialization$blocks ( this . oldJson , b ) } } ; register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . EVENT , DELETE$$module$build$src$core$events$utils , BlockDelete$$module$build$src$core$events$events _block _delete ) ;
var module$build$src$core$events$events _block _delete = { } ; module$build$src$core$events$events _block _delete . BlockDelete = BlockDelete$$module$build$src$core$events$events _block _delete ; 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 = { } ) ) ; $ . module$build$src$core$connection _type = { } ; $ . module$build$src$core$connection _type . ConnectionType = ConnectionType$$module$build$src$core$connection _type ; var Connection$$module$build$src$core$connection = class { constructor ( a , b ) { this . type = b ; this . targetConnection = null ; this . disposed = ! 1 ; this . shadowDom _ = this . check _ = null ; this . y = this . x = 0 ; this . shadowState _ = null ; this . sourceBlock _ = a } connect _ ( a ) { const b = ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE , c = this . getSourceBlock ( ) ; var d = a . getSourceBlock ( ) ; a . isConnected ( ) && a . disconnect ( ) ; let e ; if ( this . isConnected ( ) ) { const g = this . stashShadowState _ ( ) , h = this . targetBlock ( ) ; h . isShadow ( ) ? h . dispose ( ! 1 ) : ( this . disconnect ( ) ,
e = h ) ; this . applyShadowState _ ( g ) } let f ; isEnabled$$module$build$src$core$events$utils ( ) && ( f = new ( get$$module$build$src$core$events$utils ( MOVE$$module$build$src$core$events$utils ) ) ( d ) ) ; connectReciprocally$$module$build$src$core$connection ( this , a ) ; d . setParent ( c ) ; f && ( f . recordNew ( ) , fire$$module$build$src$core$events$utils ( f ) ) ; if ( e ) if ( a = this . type === b ? e . outputConnection : e . previousConnection , d = Connection$$module$build$src$core$connection . getConnectionForOrphanedConnection ( d , a ) ) a . connect ( d ) ; else a . onFailedConnect ( this ) } dispose ( ) { if ( this . isConnected ( ) ) { this . setShadowStateInternal _ ( ) ;
const a = this . targetBlock ( ) ; a && a . unplug ( ) } this . disposed = ! 0 } getSourceBlock ( ) { return this . sourceBlock _ } isSuperior ( ) { return this . type === ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE || this . type === ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT } isConnected ( ) { return ! ! this . targetConnection } getConnectionChecker ( ) { return this . sourceBlock _ . workspace . connectionChecker } onFailedConnect ( a ) { } connect ( a ) { if ( this . targetConnection === a ) return ! 0 ; if ( this . getConnectionChecker ( ) . canConnect ( this ,
a , ! 1 ) ) { const b = getGroup$$module$build$src$core$events$utils ( ) ; b || setGroup$$module$build$src$core$events$utils ( ! 0 ) ; this . isSuperior ( ) ? this . connect _ ( a ) : a . connect _ ( this ) ; b || setGroup$$module$build$src$core$events$utils ( ! 1 ) } return this . isConnected ( ) } disconnect ( ) { var a = this . targetConnection ; if ( ! a ) throw Error ( "Source connection not connected." ) ; if ( a . targetConnection !== this ) throw Error ( "Target connection not connected to source connection." ) ; let b , c ; this . isSuperior ( ) ? ( b = this . sourceBlock _ , c = a . getSourceBlock ( ) ,
a = this ) : ( b = a . getSourceBlock ( ) , c = this . sourceBlock _ ) ; const d = getGroup$$module$build$src$core$events$utils ( ) ; d || setGroup$$module$build$src$core$events$utils ( ! 0 ) ; this . disconnectInternal _ ( b , c ) ; c . isShadow ( ) || a . respawnShadow _ ( ) ; d || setGroup$$module$build$src$core$events$utils ( ! 1 ) } disconnectInternal _ ( a , b ) { let c ; isEnabled$$module$build$src$core$events$utils ( ) && ( c = new ( get$$module$build$src$core$events$utils ( MOVE$$module$build$src$core$events$utils ) ) ( b ) ) ; if ( a = this . targetConnection ) a . targetConnection = null ; this . targetConnection =
null ; b . setParent ( null ) ; c && ( c . recordNew ( ) , fire$$module$build$src$core$events$utils ( c ) ) } respawnShadow _ ( ) { this . createShadowBlock _ ( ! 0 ) } targetBlock ( ) { if ( this . isConnected ( ) ) { let a , b ; return null != ( b = null == ( a = this . targetConnection ) ? void 0 : a . getSourceBlock ( ) ) ? b : null } return null } onCheckChanged _ ( ) { ! this . isConnected ( ) || this . targetConnection && this . getConnectionChecker ( ) . canConnect ( this , this . targetConnection , ! 1 ) || ( this . isSuperior ( ) ? this . targetBlock ( ) : this . sourceBlock _ ) . unplug ( ) } setCheck ( a ) { a ? ( Array . isArray ( a ) ||
( a = [ a ] ) , this . check _ = a , this . onCheckChanged _ ( ) ) : this . check _ = null ; return this } getCheck ( ) { return this . check _ } setShadowDom ( a ) { this . setShadowStateInternal _ ( { shadowDom : a } ) } getShadowDom ( a ) { return a && this . targetBlock ( ) . isShadow ( ) ? blockToDom$$module$build$src$core$xml ( this . targetBlock ( ) ) : this . shadowDom _ } setShadowState ( a ) { this . setShadowStateInternal _ ( { shadowState : a } ) } getShadowState ( a ) { return a && this . targetBlock ( ) && this . targetBlock ( ) . isShadow ( ) ? save$$module$build$src$core$serialization$blocks ( this . targetBlock ( ) ) :
this . shadowState _ } neighbours ( a ) { return [ ] } getParentInput ( ) { let a = null ; const b = this . sourceBlock _ . inputList ; for ( let c = 0 ; c < b . length ; c ++ ) if ( b [ c ] . connection === this ) { a = b [ c ] ; break } return a } toString ( ) { const a = this . sourceBlock _ ; if ( ! a ) return "Orphan Connection" ; if ( a . outputConnection === this ) var b = "Output Connection of " ; else if ( a . previousConnection === this ) b = "Previous Connection of " ; else if ( a . nextConnection === this ) b = "Next Connection of " ; else { b = null ; for ( let c = 0 , d ; d = a . inputList [ c ] ; c ++ ) if ( d . connection === this ) { b =
d ; break } if ( b ) b = 'Input "' + b . name + '" connection on ' ; else return console . warn ( "Connection not actually connected to sourceBlock_" ) , "Orphan Connection" } return b + a . toDevString ( ) } stashShadowState _ ( ) { const a = this . getShadowDom ( ! 0 ) , b = this . getShadowState ( ! 0 ) ; this . shadowState _ = this . shadowDom _ = null ; return { shadowDom : a , shadowState : b } } applyShadowState _ ( { shadowDom : a , shadowState : b } ) { this . shadowDom _ = a ; this . shadowState _ = b } setShadowStateInternal _ ( { shadowDom : a = null , shadowState : b = null } = { } ) { this . shadowDom _ = a ; this . shadowState _ =
b ; ( a = this . targetBlock ( ) ) ? a . isShadow ( ) ? ( a . dispose ( ! 1 ) , this . respawnShadow _ ( ) , this . targetBlock ( ) && this . targetBlock ( ) . isShadow ( ) && this . serializeShadow _ ( this . targetBlock ( ) ) ) : ( a = this . createShadowBlock _ ( ! 1 ) , this . serializeShadow _ ( a ) , a && a . dispose ( ! 1 ) ) : ( this . respawnShadow _ ( ) , this . targetBlock ( ) && this . targetBlock ( ) . isShadow ( ) && this . serializeShadow _ ( this . targetBlock ( ) ) ) } createShadowBlock _ ( a ) { var b = this . getSourceBlock ( ) ; const c = this . getShadowState ( ) , d = this . getShadowDom ( ) ; if ( b . isDeadOrDying ( ) || ! c && ! d ) return null ;
if ( c ) return b = appendInternal$$module$build$src$core$serialization$blocks ( c , b . workspace , { parentConnection : a ? this : void 0 , isShadow : ! 0 , recordUndo : ! 1 } ) ; if ( d ) { b = domToBlock$$module$build$src$core$xml ( d , b . workspace ) ; if ( a ) if ( this . type === ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE ) { if ( ! b . outputConnection ) throw Error ( "Shadow block is missing an output connection" ) ; if ( ! this . connect ( b . outputConnection ) ) throw Error ( "Could not connect shadow block to connection" ) ; } else if ( this . type === ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT ) { if ( ! b . previousConnection ) throw Error ( "Shadow block is missing previous connection" ) ;
if ( ! this . connect ( b . previousConnection ) ) throw Error ( "Could not connect shadow block to connection" ) ; } else throw Error ( "Cannot connect a shadow block to a previous/output connection" ) ; return b } return null } serializeShadow _ ( a ) { a && ( this . shadowDom _ = blockToDom$$module$build$src$core$xml ( a ) , this . shadowState _ = save$$module$build$src$core$serialization$blocks ( a ) ) } static getConnectionForOrphanedConnection ( a , b ) { if ( b . type === ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE ) return getConnectionForOrphanedOutput$$module$build$src$core$connection ( a ,
b . getSourceBlock ( ) ) ; a = a . lastConnectionInStack ( ! 0 ) ; const c = b . getConnectionChecker ( ) ; return a && c . canConnect ( b , a , ! 1 ) ? a : null } } ; Connection$$module$build$src$core$connection . CAN _CONNECT = 0 ; Connection$$module$build$src$core$connection . REASON _SELF _CONNECTION = 1 ; Connection$$module$build$src$core$connection . REASON _WRONG _TYPE = 2 ; Connection$$module$build$src$core$connection . REASON _TARGET _NULL = 3 ; Connection$$module$build$src$core$connection . REASON _CHECKS _FAILED = 4 ;
Connection$$module$build$src$core$connection . REASON _DIFFERENT _WORKSPACES = 5 ; Connection$$module$build$src$core$connection . REASON _SHADOW _PARENT = 6 ; Connection$$module$build$src$core$connection . REASON _DRAG _CHECKS _FAILED = 7 ; Connection$$module$build$src$core$connection . REASON _PREVIOUS _AND _OUTPUT = 8 ; var module$build$src$core$connection = { } ; module$build$src$core$connection . Connection = Connection$$module$build$src$core$connection ; var COLLAPSED _INPUT _NAME$$module$build$src$core$constants = "_TEMP_COLLAPSED_INPUT" , COLLAPSED _FIELD _NAME$$module$build$src$core$constants = "_TEMP_COLLAPSED_FIELD" , module$build$src$core$constants = { } ; module$build$src$core$constants . COLLAPSED _FIELD _NAME = COLLAPSED _FIELD _NAME$$module$build$src$core$constants ; module$build$src$core$constants . COLLAPSED _INPUT _NAME = COLLAPSED _INPUT _NAME$$module$build$src$core$constants ; $ . FieldLabel$$module$build$src$core$field _label = class extends Field$$module$build$src$core$field { constructor ( a , b , c ) { super ( Field$$module$build$src$core$field . SKIP _SETUP ) ; this . class _ = null ; this . EDITABLE = ! 1 ; a !== Field$$module$build$src$core$field . SKIP _SETUP && ( c ? this . configure _ ( c ) : this . class _ = b || null , this . setValue ( a ) ) } configure _ ( a ) { super . configure _ ( a ) ; a . class && ( this . class _ = a . class ) } initView ( ) { this . createTextElement _ ( ) ; this . class _ && addClass$$module$build$src$core$utils$dom ( this . getTextElement ( ) , this . class _ ) } doClassValidation _ ( a ) { return null ===
a || void 0 === a ? null : String ( a ) } setClass ( a ) { this . textElement _ && ( this . class _ && removeClass$$module$build$src$core$utils$dom ( this . textElement _ , this . class _ ) , a && addClass$$module$build$src$core$utils$dom ( this . textElement _ , a ) ) ; this . class _ = a } static fromJson ( a ) { return new this ( replaceMessageReferences$$module$build$src$core$utils$parsing ( a . text ) , void 0 , a ) } } ; register$$module$build$src$core$field _registry ( "field_label" , $ . FieldLabel$$module$build$src$core$field _label ) ;
$ . FieldLabel$$module$build$src$core$field _label . prototype . DEFAULT _VALUE = "" ; var module$build$src$core$field _label = { } ; module$build$src$core$field _label . FieldLabel = $ . FieldLabel$$module$build$src$core$field _label ; var Input$$module$build$src$core$input = class { constructor ( a , b , c , d ) { this . type = a ; this . name = b ; this . connection = d ; this . fieldRow = [ ] ; this . visible _ = ! 0 ; if ( a !== inputTypes$$module$build$src$core$input _types . DUMMY && ! b ) throw Error ( "Value inputs and statement inputs must have non-empty name." ) ; this . sourceBlock _ = c ; this . align = $ . Align$$module$build$src$core$input . LEFT } getSourceBlock ( ) { return this . sourceBlock _ } appendField ( a , b ) { this . insertFieldAt ( this . fieldRow . length , a , b ) ; return this } insertFieldAt ( a , b , c ) { if ( 0 > a || a > this . fieldRow . length ) throw Error ( "index " +
a + " out of bounds." ) ; if ( ! ( b || "" === b && c ) ) return a ; "string" === typeof b && ( b = fromJson$$module$build$src$core$field _registry ( { type : "field_label" , text : b } ) ) ; b . setSourceBlock ( this . sourceBlock _ ) ; this . sourceBlock _ . rendered && ( b . init ( ) , b . applyColour ( ) ) ; b . name = c ; b . setVisible ( this . isVisible ( ) ) ; b . prefixField && ( a = this . insertFieldAt ( a , b . prefixField ) ) ; this . fieldRow . splice ( a , 0 , b ) ; a ++ ; b . suffixField && ( a = this . insertFieldAt ( a , b . suffixField ) ) ; this . sourceBlock _ . rendered && ( this . sourceBlock _ . render ( ) , this . sourceBlock _ . bumpNeighbours ( ) ) ;
return a } removeField ( a , b ) { for ( let c = 0 , d ; d = this . fieldRow [ c ] ; c ++ ) if ( d . name === a ) return d . dispose ( ) , this . fieldRow . splice ( c , 1 ) , this . sourceBlock _ . rendered && ( this . sourceBlock _ . render ( ) , this . sourceBlock _ . bumpNeighbours ( ) ) , ! 0 ; if ( b ) return ! 1 ; throw Error ( 'Field "' + a + '" not found.' ) ; } isVisible ( ) { return this . visible _ } setVisible ( a ) { let b = [ ] ; if ( this . visible _ === a ) return b ; this . visible _ = a ; for ( let d = 0 , e ; e = this . fieldRow [ d ] ; d ++ ) e . setVisible ( a ) ; if ( this . connection ) { var c = this . connection ; a ? b = c . startTrackingAll ( ) : c . stopTrackingAll ( ) ;
if ( c = c . targetBlock ( ) ) c . getSvgRoot ( ) . style . display = a ? "block" : "none" } return b } markDirty ( ) { for ( let a = 0 , b ; b = this . fieldRow [ a ] ; a ++ ) b . markDirty ( ) } setCheck ( a ) { if ( ! this . connection ) throw Error ( "This input does not have a connection." ) ; this . connection . setCheck ( a ) ; return this } setAlign ( a ) { this . align = a ; this . sourceBlock _ . rendered && this . sourceBlock _ . render ( ) ; return this } setShadowDom ( a ) { if ( ! this . connection ) throw Error ( "This input does not have a connection." ) ; this . connection . setShadowDom ( a ) ; return this } getShadowDom ( ) { if ( ! this . connection ) throw Error ( "This input does not have a connection." ) ;
return this . connection . getShadowDom ( ) } init ( ) { if ( this . sourceBlock _ . workspace . rendered ) for ( let a = 0 ; a < this . fieldRow . length ; a ++ ) this . fieldRow [ a ] . init ( ) } dispose ( ) { for ( let a = 0 , b ; b = this . fieldRow [ a ] ; a ++ ) b . dispose ( ) ; this . connection && this . connection . dispose ( ) } } , module$build$src$core$input ; ( function ( a ) { a = a . Align || ( a . Align = { } ) ; a [ a . LEFT = - 1 ] = "LEFT" ; a [ a . CENTRE = 0 ] = "CENTRE" ; a [ a . RIGHT = 1 ] = "RIGHT" } ) ( Input$$module$build$src$core$input || ( Input$$module$build$src$core$input = { } ) ) ; $ . Align$$module$build$src$core$input = Input$$module$build$src$core$input . Align ;
module$build$src$core$input = { } ; module$build$src$core$input . Align = $ . Align$$module$build$src$core$input ; module$build$src$core$input . Input = Input$$module$build$src$core$input ; var ASTNode$$module$build$src$core$keyboard _nav$ast _node = class { constructor ( a , b , c ) { this . wsCoordinate _ = null ; if ( ! b ) throw Error ( "Cannot create a node without a location." ) ; this . type _ = a ; this . isConnection _ = ASTNode$$module$build$src$core$keyboard _nav$ast _node . isConnectionType _ ( a ) ; this . location _ = b ; this . processParams _ ( c || null ) } processParams _ ( a ) { a && a . wsCoordinate && ( this . wsCoordinate _ = a . wsCoordinate ) } getLocation ( ) { return this . location _ } getType ( ) { return this . type _ } getWsCoordinate ( ) { return this . wsCoordinate _ } isConnection ( ) { return this . isConnection _ } findNextForInput _ ( ) { var a =
this . location _ . getParentInput ( ) ; const b = a . getSourceBlock ( ) ; a = b . inputList . indexOf ( a ) ; for ( a += 1 ; a < b . inputList . length ; a ++ ) { const c = b . inputList [ a ] , d = c . fieldRow ; for ( let e = 0 ; e < d . length ; e ++ ) { const f = d [ e ] ; if ( f . isClickable ( ) || ASTNode$$module$build$src$core$keyboard _nav$ast _node . NAVIGATE _ALL _FIELDS ) return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createFieldNode ( f ) } if ( c . connection ) return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createInputNode ( c ) } return null } findNextForField _ ( ) { var a =
this . location _ , b = a . getParentInput ( ) ; const c = a . getSourceBlock ( ) ; if ( ! c ) throw Error ( "The current AST location is not associated with a block" ) ; var d = c . inputList . indexOf ( b ) ; for ( a = b . fieldRow . indexOf ( a ) + 1 ; d < c . inputList . length ; d ++ ) { b = c . inputList [ d ] ; const e = b . fieldRow ; for ( ; a < e . length ; ) { if ( e [ a ] . isClickable ( ) || ASTNode$$module$build$src$core$keyboard _nav$ast _node . NAVIGATE _ALL _FIELDS ) return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createFieldNode ( e [ a ] ) ; a ++ } a = 0 ; if ( b . connection ) return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createInputNode ( b ) } return null } findPrevForInput _ ( ) { const a =
this . location _ . getParentInput ( ) , b = a . getSourceBlock ( ) ; for ( var c = b . inputList . indexOf ( a ) ; 0 <= c ; c -- ) { var d = b . inputList [ c ] ; if ( d . connection && d !== a ) return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createInputNode ( d ) ; d = d . fieldRow ; for ( let e = d . length - 1 ; 0 <= e ; e -- ) { const f = d [ e ] ; if ( f . isClickable ( ) || ASTNode$$module$build$src$core$keyboard _nav$ast _node . NAVIGATE _ALL _FIELDS ) return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createFieldNode ( f ) } } return null } findPrevForField _ ( ) { var a = this . location _ ;
const b = a . getParentInput ( ) , c = a . getSourceBlock ( ) ; if ( ! c ) throw Error ( "The current AST location is not associated with a block" ) ; var d = c . inputList . indexOf ( b ) ; for ( a = b . fieldRow . indexOf ( a ) - 1 ; 0 <= d ; d -- ) { var e = c . inputList [ d ] ; if ( e . connection && e !== b ) return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createInputNode ( e ) ; for ( e = e . fieldRow ; - 1 < a ; ) { if ( e [ a ] . isClickable ( ) || ASTNode$$module$build$src$core$keyboard _nav$ast _node . NAVIGATE _ALL _FIELDS ) return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createFieldNode ( e [ a ] ) ;
a -- } 0 <= d - 1 && ( a = c . inputList [ d - 1 ] . fieldRow . length - 1 ) } return null } navigateBetweenStacks _ ( a ) { var b = this . getLocation ( ) ; if ( b . getSourceBlock ) { var c = b . getSourceBlock ( ) ; c && ( b = c ) } if ( ! b || b . isDeadOrDying ( ) ) return null ; c = b . getRootBlock ( ) ; b = c . workspace . getTopBlocks ( ! 0 ) ; for ( let d = 0 ; d < b . length ; d ++ ) if ( c . id === b [ d ] . id ) return a = d + ( a ? 1 : - 1 ) , - 1 === a || a === b . length ? null : ASTNode$$module$build$src$core$keyboard _nav$ast _node . createStackNode ( b [ a ] ) ; throw Error ( "Couldn't find " + ( a ? "next" : "previous" ) + " stack?!" ) ; } findTopASTNodeForBlock _ ( 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 ) } getOutAstNodeForBlock _ ( a ) { if ( ! a ) return null ; a = a . getTopStackBlock ( ) ; const b = getParentConnection$$module$build$src$core$keyboard _nav$ast _node ( a ) ; return b && b . targetConnection && b . targetConnection . getParentInput ( ) ? ASTNode$$module$build$src$core$keyboard _nav$ast _node . createInputNode ( b . targetConnection . getParentInput ( ) ) :
ASTNode$$module$build$src$core$keyboard _nav$ast _node . createStackNode ( a ) } findFirstFieldOrInput _ ( a ) { a = a . inputList ; for ( let b = 0 ; b < a . length ; b ++ ) { const c = a [ b ] , d = c . fieldRow ; for ( let e = 0 ; e < d . length ; e ++ ) { const f = d [ e ] ; if ( f . isClickable ( ) || ASTNode$$module$build$src$core$keyboard _nav$ast _node . NAVIGATE _ALL _FIELDS ) return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createFieldNode ( f ) } if ( c . connection ) return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createInputNode ( c ) } return null } getSourceBlock ( ) { return this . getType ( ) ===
ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . BLOCK ? this . getLocation ( ) : this . getType ( ) === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . STACK ? this . getLocation ( ) : this . getType ( ) === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . WORKSPACE ? null : this . getLocation ( ) . getSourceBlock ( ) } next ( ) { switch ( this . type _ ) { case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . STACK : return this . navigateBetweenStacks _ ( ! 0 ) ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . OUTPUT : return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createBlockNode ( this . location _ . getSourceBlock ( ) ) ;
case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . FIELD : return this . findNextForField _ ( ) ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . INPUT : return this . findNextForInput _ ( ) ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . BLOCK : return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createConnectionNode ( this . location _ . nextConnection ) ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . PREVIOUS : return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createBlockNode ( this . location _ . getSourceBlock ( ) ) ;
case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . NEXT : return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createConnectionNode ( this . location _ . targetConnection ) } return null } in ( ) { switch ( this . type _ ) { case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . WORKSPACE : const a = this . location _ . getTopBlocks ( ! 0 ) ; if ( 0 < a . length ) return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createStackNode ( a [ 0 ] ) ; break ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . STACK : return this . findTopASTNodeForBlock _ ( this . location _ ) ;
case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . BLOCK : return this . findFirstFieldOrInput _ ( this . location _ ) ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . INPUT : return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createConnectionNode ( this . location _ . targetConnection ) } return null } prev ( ) { switch ( this . type _ ) { case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . STACK : return this . navigateBetweenStacks _ ( ! 1 ) ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . FIELD : return this . findPrevForField _ ( ) ;
case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . INPUT : return this . findPrevForInput _ ( ) ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . BLOCK : var a = getParentConnection$$module$build$src$core$keyboard _nav$ast _node ( this . location _ ) ; return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createConnectionNode ( a ) ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . PREVIOUS : if ( ( a = this . location _ . targetConnection ) && ! a . getParentInput ( ) ) return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createConnectionNode ( a ) ;
break ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . NEXT : return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createBlockNode ( this . location _ . getSourceBlock ( ) ) } return null } out ( ) { switch ( this . type _ ) { case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . STACK : var a = this . location _ , b = a . getRelativeToSurfaceXY ( ) ; b = new Coordinate$$module$build$src$core$utils$coordinate ( b . x , b . y + ASTNode$$module$build$src$core$keyboard _nav$ast _node . DEFAULT _OFFSET _Y ) ; return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createWorkspaceNode ( a . workspace ,
b ) ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . OUTPUT : return a = this . location _ , ( b = a . targetConnection ) ? ASTNode$$module$build$src$core$keyboard _nav$ast _node . createConnectionNode ( b ) : ASTNode$$module$build$src$core$keyboard _nav$ast _node . createStackNode ( a . getSourceBlock ( ) ) ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . FIELD : a = this . location _ . getSourceBlock ( ) ; if ( ! a ) throw Error ( "The current AST location is not associated with a block" ) ; return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createBlockNode ( a ) ;
case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . INPUT : return ASTNode$$module$build$src$core$keyboard _nav$ast _node . createBlockNode ( this . location _ . getSourceBlock ( ) ) ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . BLOCK : return this . getOutAstNodeForBlock _ ( this . location _ ) ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . PREVIOUS : return this . getOutAstNodeForBlock _ ( this . location _ . getSourceBlock ( ) ) ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . NEXT : return this . getOutAstNodeForBlock _ ( this . location _ . getSourceBlock ( ) ) } return null } static isConnectionType _ ( a ) { switch ( a ) { case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . PREVIOUS : case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . NEXT : case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . INPUT : case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . OUTPUT : return ! 0 } return ! 1 } static createFieldNode ( a ) { return a ?
new ASTNode$$module$build$src$core$keyboard _nav$ast _node ( ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . FIELD , a ) : null } static createConnectionNode ( a ) { if ( ! a ) return null ; const b = a . type ; return b === ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE || b === ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT && a . getParentInput ( ) ? ASTNode$$module$build$src$core$keyboard _nav$ast _node . createInputNode ( a . getParentInput ( ) ) : b === ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT ?
new ASTNode$$module$build$src$core$keyboard _nav$ast _node ( ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . NEXT , a ) : b === ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE ? new ASTNode$$module$build$src$core$keyboard _nav$ast _node ( ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . OUTPUT , a ) : b === ConnectionType$$module$build$src$core$connection _type . PREVIOUS _STATEMENT ? new ASTNode$$module$build$src$core$keyboard _nav$ast _node ( ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . PREVIOUS ,
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 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" } ) ( 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 Block$$module$build$src$core$block = class { constructor ( a , b , c ) { this . data = null ; this . disposed = ! 1 ; this . hue _ = null ; this . colour _ = "#000000" ; this . styleName _ = "" ; this . loadExtraState = this . saveExtraState = this . domToMutation = this . mutationToDom = this . init = void 0 ; this . suppressPrefixSuffix = ! 1 ; this . decompose = this . compose = this . getDeveloperVariables = void 0 ; this . previousConnection = this . nextConnection = this . outputConnection = null ; this . inputList = [ ] ; this . inputsInline = void 0 ; this . disabled = ! 1 ; this . tooltip = "" ; this . contextMenu =
! 0 ; this . parentBlock _ = null ; this . childBlocks _ = [ ] ; this . editable _ = this . movable _ = this . deletable _ = ! 0 ; this . collapsed _ = this . isShadow _ = ! 1 ; this . outputShape _ = null ; this . disposing = ! 1 ; this . comment = null ; this . isInsertionMarker _ = ! 1 ; this . hat = void 0 ; this . onchangeWrapper _ = this . helpUrl = this . rendered = null ; this . statementInputCount = 0 ; this . workspace = a ; this . id = c && ! a . getBlockById ( c ) ? c : genUid$$module$build$src$core$utils$idgenerator ( ) ; a . setBlockById ( this . id , this ) ; this . commentModel = { text : null , pinned : ! 1 , size : new Size$$module$build$src$core$utils$size ( 160 ,
80 ) } ; this . xy _ = new Coordinate$$module$build$src$core$utils$coordinate ( 0 , 0 ) ; this . isInFlyout = a . isFlyout ; this . isInMutator = a . isMutator ; this . RTL = a . RTL ; if ( b ) { this . type = b ; c = Blocks$$module$build$src$core$blocks [ b ] ; if ( ! c || "object" !== typeof c ) throw TypeError ( "Invalid block definition for type: " + b ) ; Object . assign ( this , c ) } a . addTopBlock ( this ) ; a . addTypedBlock ( this ) ; new . target === Block$$module$build$src$core$block && this . doInit _ ( ) } doInit _ ( ) { const a = getGroup$$module$build$src$core$events$utils ( ) ; a || setGroup$$module$build$src$core$events$utils ( ! 0 ) ;
const b = getRecordUndo$$module$build$src$core$events$utils ( ) ; try { "function" === typeof this . init && ( setRecordUndo$$module$build$src$core$events$utils ( ! 1 ) , this . init ( ) , setRecordUndo$$module$build$src$core$events$utils ( b ) ) , 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 ) ) ( this ) ) } finally { a || setGroup$$module$build$src$core$events$utils ( ! 1 ) , setRecordUndo$$module$build$src$core$events$utils ( b ) } this . inputsInlineDefault =
this . inputsInline ; "function" === typeof this . onchange && this . setOnChange ( this . onchange ) } dispose ( a ) { if ( ! this . isDeadOrDying ( ) ) { this . unplug ( a ) ; isEnabled$$module$build$src$core$events$utils ( ) && fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( DELETE$$module$build$src$core$events$utils ) ) ( this ) ) ; this . onchangeWrapper _ && this . workspace . removeChangeListener ( this . onchangeWrapper _ ) ; disable$$module$build$src$core$events$utils ( ) ; try { this . workspace . removeTopBlock ( this ) ; this . workspace . removeTypedBlock ( this ) ;
this . workspace . removeBlockById ( this . id ) ; this . disposing = ! 0 ; for ( let c = this . childBlocks _ . length - 1 ; 0 <= c ; c -- ) this . childBlocks _ [ c ] . dispose ( ! 1 ) ; for ( let c = 0 , d ; d = this . inputList [ c ] ; c ++ ) d . dispose ( ) ; this . inputList . length = 0 ; const b = this . getConnections _ ( ! 0 ) ; for ( let c = 0 , d ; d = b [ c ] ; c ++ ) d . dispose ( ) } finally { enable$$module$build$src$core$events$utils ( ) , this . disposed = ! 0 } } } isDeadOrDying ( ) { return this . disposing || this . disposed } initModel ( ) { for ( let a = 0 , b ; b = this . inputList [ a ] ; a ++ ) for ( let c = 0 , d ; d = b . fieldRow [ c ] ; c ++ ) d . initModel &&
d . initModel ( ) } unplug ( a ) { this . outputConnection && this . unplugFromRow _ ( a ) ; this . previousConnection && this . unplugFromStack _ ( a ) } unplugFromRow _ ( a ) { let b = null ; this . outputConnection . 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 < this . inputList . length ; b ++ ) { const c = this . inputList [ b ] . connection ; if ( c && c . type === ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE && c . targetConnection ) { if ( a ) return null ; a = c } } return a } unplugFromStack _ ( a ) { let b = null ; this . previousConnection . isConnected ( ) && ( b = this . previousConnection . targetConnection , this . previousConnection . disconnect ( ) ) ; const c = this . getNextBlock ( ) ; a && c && ! c . isShadow ( ) && ( a = this . nextConnection . targetConnection , null == a || a . disconnect ( ) , b && this . workspace . connectionChecker . canConnect ( b ,
a , ! 1 ) && b . connect ( a ) ) } getConnections _ ( a ) { a = [ ] ; this . outputConnection && a . push ( this . outputConnection ) ; this . previousConnection && a . push ( this . previousConnection ) ; this . nextConnection && a . push ( this . nextConnection ) ; for ( let b = 0 , c ; c = this . inputList [ b ] ; b ++ ) c . connection && a . push ( c . connection ) ; return a } lastConnectionInStack ( a ) { let b = this . nextConnection ; for ( ; b ; ) { const c = b . targetBlock ( ) ; if ( ! c || a && c . isShadow ( ) ) return b ; b = c . nextConnection } return null } bumpNeighbours ( ) { } getParent ( ) { return this . parentBlock _ } getInputWithBlock ( a ) { for ( let b =
0 , c ; c = this . inputList [ b ] ; b ++ ) if ( c . connection && c . connection . targetBlock ( ) === a ) return c ; return null } getSurroundParent ( ) { let a = this , b ; do if ( b = a , a = a . getParent ( ) , ! a ) return null ; while ( a . getNextBlock ( ) === b ) ; return a } getNextBlock ( ) { return this . nextConnection && this . nextConnection . targetBlock ( ) } getPreviousBlock ( ) { return this . previousConnection && this . previousConnection . targetBlock ( ) } getFirstStatementConnection ( ) { for ( let a = 0 , b ; b = this . inputList [ a ] ; a ++ ) if ( b . connection && b . connection . type === ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT ) return b . connection ;
return null } getRootBlock ( ) { let a , b = this ; do a = b , b = a . parentBlock _ ; while ( b ) ; return a } getTopStackBlock ( ) { let a = this , b ; do b = a . getPreviousBlock ( ) ; while ( b && b . getNextBlock ( ) === a && ( a = b ) ) ; return a } getChildren ( a ) { if ( ! a ) return this . childBlocks _ ; a = [ ] ; for ( let c = 0 , d ; d = this . inputList [ c ] ; c ++ ) if ( d . connection ) { var b = d . connection . targetBlock ( ) ; b && a . push ( b ) } ( b = this . getNextBlock ( ) ) && a . push ( b ) ; return a } setParent ( a ) { if ( a !== this . parentBlock _ ) { var b = this . previousConnection && this . previousConnection . targetBlock ( ) || this . outputConnection &&
this . outputConnection . targetBlock ( ) , c = ! ! b ; if ( c && a && b !== a ) throw Error ( "Block connected to superior one that is not new parent." ) ; if ( ! c && a ) throw Error ( "Block not connected to new parent." ) ; if ( c && ! a ) throw Error ( "Cannot set parent to null while block is still connected to superior block." ) ; this . parentBlock _ ? removeElem$$module$build$src$core$utils$array ( this . parentBlock _ . childBlocks _ , this ) : this . workspace . removeTopBlock ( this ) ; ( this . parentBlock _ = a ) ? a . childBlocks _ . push ( this ) : this . workspace . addTopBlock ( this ) } } getDescendants ( a ) { const b =
[ this ] , c = this . getChildren ( a ) ; for ( let d , e = 0 ; d = c [ e ] ; e ++ ) b . push ( ... d . getDescendants ( a ) ) ; return b } isDeletable ( ) { return this . deletable _ && ! this . isShadow _ && ! this . isDeadOrDying ( ) && ! this . workspace . options . readOnly } setDeletable ( a ) { this . deletable _ = a } isMovable ( ) { return this . movable _ && ! this . isShadow _ && ! this . isDeadOrDying ( ) && ! this . workspace . options . readOnly } setMovable ( a ) { this . movable _ = a } isDuplicatable ( ) { return this . workspace . hasBlockLimits ( ) ? this . workspace . isCapacityAvailable ( getBlockTypeCounts$$module$build$src$core$common ( this ,
! 0 ) ) : ! 0 } isShadow ( ) { return this . isShadow _ } setShadow ( a ) { this . isShadow _ = a } isInsertionMarker ( ) { return this . isInsertionMarker _ } setInsertionMarker ( a ) { this . isInsertionMarker _ = a } isEditable ( ) { return this . editable _ && ! this . isDeadOrDying ( ) && ! this . workspace . options . readOnly } setEditable ( a ) { this . editable _ = a ; for ( let b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( let d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) e . updateEditable ( ) } isDisposed ( ) { return this . disposed } getMatchingConnection ( a , b ) { const c = this . getConnections _ ( ! 0 ) ; a = a . getConnections _ ( ! 0 ) ;
if ( c . length !== a . length ) throw Error ( "Connection lists did not match in length." ) ; for ( let d = 0 ; d < a . length ; d ++ ) if ( a [ d ] === b ) return c [ d ] ; return null } setHelpUrl ( a ) { this . helpUrl = a } setTooltip ( a ) { this . tooltip = a } getTooltip ( ) { return getTooltipOfObject$$module$build$src$core$tooltip ( this ) } getColour ( ) { return this . colour _ } getStyleName ( ) { return this . styleName _ } getHue ( ) { return this . hue _ } setColour ( a ) { a = parseBlockColour$$module$build$src$core$utils$parsing ( a ) ; this . hue _ = a . hue ; this . colour _ = a . hex } setStyle ( a ) { this . styleName _ =
a } setOnChange ( a ) { if ( a && "function" !== typeof a ) throw Error ( "onchange must be a function." ) ; this . onchangeWrapper _ && this . workspace . removeChangeListener ( this . onchangeWrapper _ ) ; this . onchange = a ; this . onchangeWrapper _ = a . bind ( this ) ; this . workspace . addChangeListener ( this . onchangeWrapper _ ) } getField ( a ) { if ( "string" !== typeof a ) throw TypeError ( "Block.prototype.getField expects a string with the field name but received " + ( void 0 === a ? "nothing" : a + " of type " + typeof a ) + " instead" ) ; for ( let b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( let d =
0 , e ; e = c . fieldRow [ d ] ; d ++ ) if ( e . name === a ) return e ; return null } getVars ( ) { const a = [ ] ; for ( let b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( let d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) e . referencesVariables ( ) && a . push ( e . getValue ( ) ) ; return a } getVarModels ( ) { const a = [ ] ; for ( let b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( let d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) if ( e . referencesVariables ( ) ) { const f = this . workspace . getVariableById ( e . getValue ( ) ) ; f && a . push ( f ) } return a } updateVarName ( a ) { for ( let b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( let d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) e . referencesVariables ( ) &&
a . getId ( ) === e . getValue ( ) && e . refreshVariableName ( ) } renameVarById ( a , b ) { for ( let c = 0 , d ; d = this . inputList [ c ] ; c ++ ) for ( let e = 0 , f ; f = d . fieldRow [ e ] ; e ++ ) f . referencesVariables ( ) && a === f . getValue ( ) && f . setValue ( b ) } getFieldValue ( a ) { return ( a = this . getField ( a ) ) ? a . getValue ( ) : null } setFieldValue ( a , b ) { const c = this . getField ( b ) ; if ( ! c ) throw Error ( 'Field "' + b + '" not found.' ) ; c . setValue ( a ) } setPreviousStatement ( a , b ) { if ( a ) void 0 === b && ( b = null ) , this . previousConnection || ( this . previousConnection = this . makeConnection _ ( ConnectionType$$module$build$src$core$connection _type . PREVIOUS _STATEMENT ) ) ,
this . previousConnection . setCheck ( b ) ; else if ( this . previousConnection ) { if ( this . previousConnection . isConnected ( ) ) throw Error ( "Must disconnect previous statement before removing connection." ) ; this . previousConnection . dispose ( ) ; this . previousConnection = null } } setNextStatement ( a , b ) { if ( a ) void 0 === b && ( b = null ) , this . nextConnection || ( this . nextConnection = this . makeConnection _ ( ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT ) ) , this . nextConnection . setCheck ( b ) ; else if ( this . nextConnection ) { if ( this . nextConnection . isConnected ( ) ) throw Error ( "Must disconnect next statement before removing connection." ) ;
this . nextConnection . dispose ( ) ; this . nextConnection = null } } setOutput ( a , b ) { if ( a ) void 0 === b && ( b = null ) , this . outputConnection || ( this . outputConnection = this . makeConnection _ ( ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE ) ) , this . outputConnection . setCheck ( b ) ; else if ( this . outputConnection ) { if ( this . outputConnection . isConnected ( ) ) throw Error ( "Must disconnect output value before removing connection." ) ; this . outputConnection . dispose ( ) ; this . outputConnection = null } } setInputsInline ( a ) { this . inputsInline !==
a && ( fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( CHANGE$$module$build$src$core$events$utils ) ) ( this , "inline" , null , this . inputsInline , a ) ) , this . inputsInline = a ) } getInputsInline ( ) { if ( void 0 !== this . inputsInline ) return this . inputsInline ; for ( var a = 1 ; a < this . inputList . length ; a ++ ) if ( this . inputList [ a - 1 ] . type === inputTypes$$module$build$src$core$input _types . DUMMY && this . inputList [ a ] . type === inputTypes$$module$build$src$core$input _types . DUMMY ) return ! 1 ; for ( a = 1 ; a < this . inputList . length ; a ++ ) if ( this . inputList [ a -
1 ] . type === inputTypes$$module$build$src$core$input _types . VALUE && this . inputList [ a ] . type === inputTypes$$module$build$src$core$input _types . DUMMY ) return ! 0 ; return ! 1 } setOutputShape ( a ) { this . outputShape _ = a } getOutputShape ( ) { return this . outputShape _ } isEnabled ( ) { return ! this . disabled } setEnabled ( a ) { if ( this . isEnabled ( ) !== a ) { const b = this . disabled ; this . disabled = ! a ; fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( CHANGE$$module$build$src$core$events$utils ) ) ( this , "disabled" , null ,
b , ! a ) ) } } getInheritedDisabled ( ) { let a = this . getSurroundParent ( ) ; for ( ; a ; ) { if ( a . disabled ) return ! 0 ; a = a . getSurroundParent ( ) } return ! 1 } isCollapsed ( ) { return this . collapsed _ } setCollapsed ( a ) { this . collapsed _ !== a && ( fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( CHANGE$$module$build$src$core$events$utils ) ) ( this , "collapsed" , null , this . collapsed _ , a ) ) , this . collapsed _ = a ) } toString ( a , b ) { function c ( l ) { let m = l . getCheck ( ) ; ! m && l . targetConnection && ( m = l . targetConnection . getCheck ( ) ) ; return ! ! m &&
( - 1 !== m . indexOf ( "Boolean" ) || - 1 !== m . indexOf ( "Number" ) ) } function d ( ) { let l , m ; g && g . getType ( ) === ( null == ( l = h ) ? void 0 : l . getType ( ) ) && g . getLocation ( ) === ( null == ( m = h ) ? void 0 : m . getLocation ( ) ) && ( g = null ) } var e = [ ] ; b = b || "?" ; const f = ASTNode$$module$build$src$core$keyboard _nav$ast _node . NAVIGATE _ALL _FIELDS ; ASTNode$$module$build$src$core$keyboard _nav$ast _node . NAVIGATE _ALL _FIELDS = ! 0 ; let g = ASTNode$$module$build$src$core$keyboard _nav$ast _node . createBlockNode ( this ) ; const h = g ; for ( ; g ; ) { switch ( g . getType ( ) ) { case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . INPUT : var k =
g . getLocation ( ) ; g . in ( ) ? c ( k ) && e . push ( "(" ) : e . push ( b ) ; break ; case ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . FIELD : k = g . getLocation ( ) , k . name !== COLLAPSED _FIELD _NAME$$module$build$src$core$constants && e . push ( k . getText ( ) ) } k = g ; g = k . in ( ) || k . next ( ) ; if ( ! g ) { g = k . out ( ) ; for ( d ( ) ; g && ! g . next ( ) ; ) g = g . out ( ) , d ( ) , g && g . getType ( ) === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . INPUT && c ( g . getLocation ( ) ) && e . push ( ")" ) ; g && ( g = g . next ( ) ) } } ASTNode$$module$build$src$core$keyboard _nav$ast _node . NAVIGATE _ALL _FIELDS =
f ; for ( b = 2 ; b < e . length ; b ++ ) "(" === e [ b - 2 ] && ")" === e [ b ] && ( e [ b - 2 ] = e [ b - 1 ] , e . splice ( b - 1 , 2 ) ) ; e = e . reduce ( function ( l , m ) { return l + ( "(" === l . substr ( - 1 ) || ")" === m ? "" : " " ) + m } , "" ) ; e = e . trim ( ) || "???" ; a && e . length > a && ( e = e . substring ( 0 , a - 3 ) + "..." ) ; return e } appendValueInput ( a ) { return this . appendInput _ ( inputTypes$$module$build$src$core$input _types . VALUE , a ) } appendStatementInput ( a ) { return this . appendInput _ ( inputTypes$$module$build$src$core$input _types . STATEMENT , a ) } appendDummyInput ( a ) { return this . appendInput _ ( inputTypes$$module$build$src$core$input _types . DUMMY ,
a || "" ) } 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." ) ; 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 ( var c = 0 ; void 0 !== a [ "message" + c ] ; ) this . interpolate _ ( a [ "message" + c ] , a [ "args" + c ] || [ ] , a [ "lastDummyAlign" + c ] , b ) , c ++ ; void 0 !== a . inputsInline && this . setInputsInline ( a . inputsInline ) ;
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 ; b < a . length ; b ++ ) apply$$module$build$src$core$extensions ( a [ b ] ,
this , ! 1 ) } jsonInitColour _ ( a , b ) { if ( "colour" in a ) if ( void 0 === a . colour ) console . warn ( b + "Undefined colour value." ) ; else { a = a . colour ; try { this . setColour ( a ) } catch ( c ) { console . warn ( b + "Illegal colour value: " , a ) } } } jsonInitStyle _ ( a , b ) { a = a . style ; try { this . setStyle ( a ) } catch ( c ) { console . warn ( b + "Style does not exist: " , a ) } } mixin ( a , b ) { if ( void 0 !== b && "boolean" !== typeof b ) throw Error ( "opt_disableCheck must be a boolean if provided" ) ; if ( ! b ) { b = [ ] ; for ( const c in a ) void 0 !== this [ c ] && b . push ( c ) ; if ( b . length ) throw Error ( "Mixin will overwrite block members: " +
JSON . stringify ( b ) ) ; } Object . assign ( this , a ) } interpolate _ ( a , b , c , d ) { a = tokenizeInterpolation$$module$build$src$core$utils$parsing ( a ) ; this . validateTokens _ ( a , b . length ) ; b = this . interpolateArguments _ ( a , b , c ) ; c = [ ] ; for ( let e = 0 , f ; f = b [ e ] ; e ++ ) if ( this . isInputKeyword _ ( f . type ) ) { if ( a = this . inputFromJson _ ( f , d ) ) { for ( let g = 0 , h ; h = c [ g ] ; g ++ ) a . appendField ( h [ 0 ] , h [ 1 ] ) ; c . length = 0 } } else ( a = this . fieldFromJson _ ( f ) ) && c . push ( [ a , f . name ] ) } validateTokens _ ( a , b ) { const c = [ ] ; let d = 0 ; for ( let e = 0 ; e < a . length ; e ++ ) { const f = a [ e ] ; if ( "number" === typeof f ) { if ( 1 >
f || 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 e = 0 ; e < a . length ; e ++ ) { let f = a [ e ] ; "number" === typeof f && ( f = b [ f - 1 ] ) ; if ( "string" === typeof f && ( f = this . stringToFieldJson _ ( f ) , ! f ) ) continue ; d . push ( f ) } ( a = d . length ) && ! this . isInputKeyword _ ( d [ a - 1 ] . type ) &&
( a = { type : "input_dummy" } , c && ( a . align = c ) , d . push ( a ) ) ; return d } fieldFromJson _ ( a ) { const b = fromJson$$module$build$src$core$field _registry ( a ) ; return ! b && a . alt ? "string" === typeof a . alt ? ( a = this . stringToFieldJson _ ( a . alt ) ) ? this . fieldFromJson _ ( a ) : null : this . fieldFromJson _ ( a . alt ) : b } inputFromJson _ ( a , b ) { var c = { LEFT : $ . Align$$module$build$src$core$input . LEFT , RIGHT : $ . Align$$module$build$src$core$input . RIGHT , CENTRE : $ . Align$$module$build$src$core$input . CENTRE , CENTER : $ . Align$$module$build$src$core$input . CENTRE } ; let d = null ;
switch ( a . type ) { case "input_value" : d = this . appendValueInput ( a . name ) ; break ; case "input_statement" : d = this . appendStatementInput ( a . name ) ; break ; case "input_dummy" : d = this . appendDummyInput ( a . name ) } if ( ! d ) return null ; a . check && d . setCheck ( a . check ) ; a . align && ( c = c [ a . align . toUpperCase ( ) ] , void 0 === c ? console . warn ( b + "Illegal align value: " , a . align ) : d . setAlign ( c ) ) ; return d } isInputKeyword _ ( a ) { return "input_value" === a || "input_statement" === a || "input_dummy" === a } stringToFieldJson _ ( a ) { return ( a = a . trim ( ) ) ? { type : "field_label" ,
text : a } : null } appendInput _ ( a , b ) { let c = null ; if ( a === inputTypes$$module$build$src$core$input _types . VALUE || a === inputTypes$$module$build$src$core$input _types . STATEMENT ) c = this . makeConnection _ ( a ) ; a === inputTypes$$module$build$src$core$input _types . STATEMENT && this . statementInputCount ++ ; a = new Input$$module$build$src$core$input ( a , b , this , c ) ; this . inputList . push ( a ) ; return a } moveInputBefore ( a , b ) { if ( a !== b ) { var c = - 1 , d = b ? - 1 : this . inputList . length ; for ( let e = 0 , f ; f = this . inputList [ e ] ; e ++ ) if ( f . name === a ) { if ( c = e , - 1 !== d ) break } else if ( b &&
f . name === b && ( d = e , - 1 !== c ) ) break ; if ( - 1 === c ) throw Error ( 'Named input "' + a + '" not found.' ) ; if ( - 1 === d ) throw Error ( 'Reference input "' + b + '" not found.' ) ; this . moveNumberedInputBefore ( c , d ) } } moveNumberedInputBefore ( a , b ) { if ( a === b ) throw Error ( "Can't move input to itself." ) ; if ( a >= this . inputList . length ) throw RangeError ( "Input index " + a + " out of bounds." ) ; if ( b > this . inputList . length ) throw RangeError ( "Reference input " + b + " out of bounds." ) ; const c = this . inputList [ a ] ; this . inputList . splice ( a , 1 ) ; a < b && b -- ; this . inputList . splice ( b ,
0 , c ) } removeInput ( a , b ) { for ( let c = 0 , d ; d = this . inputList [ c ] ; c ++ ) if ( d . name === a ) return d . type === inputTypes$$module$build$src$core$input _types . STATEMENT && this . statementInputCount -- , d . dispose ( ) , this . inputList . splice ( c , 1 ) , ! 0 ; if ( b ) return ! 1 ; throw Error ( "Input not found: " + a ) ; } getInput ( a ) { for ( let b = 0 , c ; c = this . inputList [ b ] ; b ++ ) if ( c . name === a ) return c ; return null } getInputTargetBlock ( a ) { return ( a = this . getInput ( a ) ) && a . connection && a . connection . targetBlock ( ) } getCommentText ( ) { return this . commentModel . text } setCommentText ( a ) { this . commentModel . 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 , "comment" , null , this . commentModel . text , a ) ) , this . comment = this . commentModel . text = a ) } setWarningText ( a , b ) { } setMutator ( a ) { } getRelativeToSurfaceXY ( ) { return this . xy _ } moveBy ( a , b ) { if ( this . parentBlock _ ) throw Error ( "Block has parent." ) ; const c = new ( get$$module$build$src$core$events$utils ( MOVE$$module$build$src$core$events$utils ) ) ( this ) ; this . xy _ . translate ( a , b ) ; c . recordNew ( ) ;
fire$$module$build$src$core$events$utils ( c ) } 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 disconnectPid$$module$build$src$core$block _animations = null , disconnectGroup$$module$build$src$core$block _animations = null , module$build$src$core$block _animations = { } ; module$build$src$core$block _animations . connectionUiEffect = connectionUiEffect$$module$build$src$core$block _animations ; module$build$src$core$block _animations . disconnectUiEffect = disconnectUiEffect$$module$build$src$core$block _animations ; module$build$src$core$block _animations . disconnectUiStop = disconnectUiStop$$module$build$src$core$block _animations ;
module$build$src$core$block _animations . disposeUiEffect = disposeUiEffect$$module$build$src$core$block _animations ; var Comment$$module$build$src$core$comment = class extends Icon$$module$build$src$core$icon { constructor ( a ) { super ( a ) ; this . cachedText _ = "" ; this . paragraphElement _ = this . textarea _ = this . foreignObject _ = this . onInputWrapper _ = this . onChangeWrapper _ = this . onWheelWrapper _ = this . onMouseUpWrapper _ = null ; this . model _ = a . commentModel ; let b ; this . model _ . text = null != ( b = this . model _ . text ) ? b : "" ; this . createIcon ( ) } drawIcon _ ( a ) { createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . CIRCLE , { "class" : "blocklyIconShape" ,
r : "8" , cx : "8" , cy : "8" } , a ) ; 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" } , a ) ; 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" } , a ) } createEditor _ ( ) { this . foreignObject _ =
createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FOREIGNOBJECT , { x : Bubble$$module$build$src$core$bubble . BORDER _WIDTH , y : Bubble$$module$build$src$core$bubble . BORDER _WIDTH } ) ; const a = document . createElementNS ( HTML _NS$$module$build$src$core$utils$dom , "body" ) ; a . setAttribute ( "xmlns" , HTML _NS$$module$build$src$core$utils$dom ) ; a . className = "blocklyMinimalBody" ; const b = this . textarea _ = document . createElementNS ( HTML _NS$$module$build$src$core$utils$dom , "textarea" ) ; b . className =
"blocklyCommentTextarea" ; b . setAttribute ( "dir" , this . getBlock ( ) . RTL ? "RTL" : "LTR" ) ; let c ; b . value = null != ( c = this . model _ . text ) ? c : "" ; this . resizeTextarea _ ( ) ; a . appendChild ( b ) ; this . foreignObject _ . appendChild ( a ) ; this . onMouseUpWrapper _ = conditionalBind$$module$build$src$core$browser _events ( b , "mouseup" , this , this . startEdit _ , ! 0 , ! 0 ) ; this . onWheelWrapper _ = conditionalBind$$module$build$src$core$browser _events ( b , "wheel" , this , function ( d ) { d . stopPropagation ( ) } ) ; this . onChangeWrapper _ = conditionalBind$$module$build$src$core$browser _events ( b ,
"change" , this , function ( d ) { this . cachedText _ !== this . model _ . text && fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( CHANGE$$module$build$src$core$events$utils ) ) ( this . getBlock ( ) , "comment" , null , this . cachedText _ , this . model _ . text ) ) } ) ; this . onInputWrapper _ = conditionalBind$$module$build$src$core$browser _events ( b , "input" , this , function ( d ) { this . model _ . text = b . value } ) ; setTimeout ( b . focus . bind ( b ) , 0 ) ; return this . foreignObject _ } updateEditable ( ) { super . updateEditable ( ) ; this . isVisible ( ) &&
( this . disposeBubble _ ( ) , this . createBubble _ ( ) ) } onBubbleResize _ ( ) { this . isVisible ( ) && this . bubble _ && ( this . model _ . size = this . bubble _ . getBubbleSize ( ) , this . resizeTextarea _ ( ) ) } resizeTextarea _ ( ) { var a = this . model _ . size ; const b = 2 * Bubble$$module$build$src$core$bubble . BORDER _WIDTH , c = a . width - b ; a = a . height - b ; this . foreignObject _ . setAttribute ( "width" , ` ${ c } ` ) ; this . foreignObject _ . setAttribute ( "height" , ` ${ a } ` ) ; this . textarea _ . style . width = c - 4 + "px" ; this . textarea _ . style . height = a - 4 + "px" } setVisible ( a ) { a !== this . isVisible ( ) && ( fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( BUBBLE _OPEN$$module$build$src$core$events$utils ) ) ( this . getBlock ( ) ,
a , "comment" ) ) , ( this . model _ . pinned = a ) ? this . createBubble _ ( ) : this . disposeBubble _ ( ) ) } createBubble _ ( ) { this . getBlock ( ) . isEditable ( ) ? this . createEditableBubble _ ( ) : this . createNonEditableBubble _ ( ) } createEditableBubble _ ( ) { const a = this . getBlock ( ) ; this . bubble _ = new Bubble$$module$build$src$core$bubble ( a . workspace , this . createEditor _ ( ) , a . pathObject . svgPath , this . iconXY _ , this . model _ . size . width , this . model _ . size . height ) ; this . bubble _ . setSvgId ( a . id ) ; this . bubble _ . registerResizeEvent ( this . onBubbleResize _ . bind ( this ) ) ; this . applyColour ( ) } createNonEditableBubble _ ( ) { let a ;
this . paragraphElement _ = Bubble$$module$build$src$core$bubble . textToDom ( null != ( a = this . model _ . text ) ? a : "" ) ; this . bubble _ = Bubble$$module$build$src$core$bubble . createNonEditableBubble ( this . paragraphElement _ , this . getBlock ( ) , this . iconXY _ ) ; this . applyColour ( ) } disposeBubble _ ( ) { this . onMouseUpWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onMouseUpWrapper _ ) , this . onMouseUpWrapper _ = null ) ; this . onWheelWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onWheelWrapper _ ) , this . onWheelWrapper _ = null ) ;
this . onChangeWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onChangeWrapper _ ) , this . onChangeWrapper _ = null ) ; this . onInputWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onInputWrapper _ ) , this . onInputWrapper _ = null ) ; this . bubble _ && ( this . bubble _ . dispose ( ) , this . bubble _ = null ) ; this . paragraphElement _ = this . foreignObject _ = this . textarea _ = null } startEdit _ ( a ) { let b ; ( null == ( b = this . bubble _ ) ? 0 : b . promote ( ) ) && this . textarea _ . focus ( ) ; this . cachedText _ = this . model _ . text } getBubbleSize ( ) { return this . model _ . size } setBubbleSize ( a ,
b ) { this . bubble _ ? this . bubble _ . setBubbleSize ( a , b ) : ( this . model _ . size . width = a , this . model _ . size . height = b ) } updateText ( ) { if ( this . textarea _ ) { let a ; this . textarea _ . value = null != ( a = this . model _ . text ) ? a : "" } else this . paragraphElement _ && ( this . paragraphElement _ . firstChild . textContent = this . model _ . text ) } dispose ( ) { this . getBlock ( ) . comment = null ; super . dispose ( ) } } ; register$$module$build$src$core$css ( "\n.blocklyCommentTextarea {\n background-color: #fef49c;\n border: 0;\n display: block;\n margin: 0;\n outline: 0;\n padding: 3px;\n resize: none;\n text-overflow: hidden;\n}\n" ) ;
var module$build$src$core$comment = { } ; module$build$src$core$comment . Comment = Comment$$module$build$src$core$comment ; var copyData$$module$build$src$core$clipboard = null , TEST _ONLY$$module$build$src$core$clipboard = { duplicateInternal : duplicateInternal$$module$build$src$core$clipboard , copyInternal : copyInternal$$module$build$src$core$clipboard } , module$build$src$core$clipboard = { } ; module$build$src$core$clipboard . TEST _ONLY = TEST _ONLY$$module$build$src$core$clipboard ; module$build$src$core$clipboard . copy = copy$$module$build$src$core$clipboard ; module$build$src$core$clipboard . duplicate = duplicate$$module$build$src$core$clipboard ;
module$build$src$core$clipboard . paste = paste$$module$build$src$core$clipboard ; var currentBlock$$module$build$src$core$contextmenu , dummyOwner$$module$build$src$core$contextmenu , menu _$$module$build$src$core$contextmenu ; currentBlock$$module$build$src$core$contextmenu = null ; dummyOwner$$module$build$src$core$contextmenu = { } ; menu _$$module$build$src$core$contextmenu = null ; $ . module$build$src$core$contextmenu = { } ; $ . module$build$src$core$contextmenu . callbackFactory = callbackFactory$$module$build$src$core$contextmenu ; $ . module$build$src$core$contextmenu . commentDeleteOption = commentDeleteOption$$module$build$src$core$contextmenu ;
$ . module$build$src$core$contextmenu . commentDuplicateOption = commentDuplicateOption$$module$build$src$core$contextmenu ; $ . module$build$src$core$contextmenu . dispose = dispose$$module$build$src$core$contextmenu ; $ . module$build$src$core$contextmenu . getCurrentBlock = getCurrentBlock$$module$build$src$core$contextmenu ; $ . module$build$src$core$contextmenu . hide = hide$$module$build$src$core$contextmenu ; $ . module$build$src$core$contextmenu . setCurrentBlock = setCurrentBlock$$module$build$src$core$contextmenu ;
$ . module$build$src$core$contextmenu . show = show$$module$build$src$core$contextmenu ; $ . module$build$src$core$contextmenu . workspaceCommentOption = workspaceCommentOption$$module$build$src$core$contextmenu ; var ContextMenuRegistry$$module$build$src$core$contextmenu _registry = class { constructor ( ) { this . registry _ = new Map ; this . reset ( ) } reset ( ) { this . registry _ . clear ( ) } register ( a ) { if ( this . registry _ . has ( a . id ) ) throw Error ( 'Menu item with ID "' + a . id + '" is already registered.' ) ; this . registry _ . set ( a . id , a ) } unregister ( a ) { if ( ! this . registry _ . has ( a ) ) throw Error ( 'Menu item with ID "' + a + '" not found.' ) ; this . registry _ . delete ( a ) } getItem ( a ) { let b ; return null != ( b = this . registry _ . get ( a ) ) ? b : null } getContextMenuOptions ( a , b ) { const c =
[ ] ; for ( const e of this . registry _ . values ( ) ) if ( a === e . scopeType ) { var d = e . preconditionFn ( b ) ; "hidden" !== d && ( d = { text : "function" === typeof e . displayText ? e . displayText ( b ) : e . displayText , enabled : "enabled" === d , callback : e . callback , scope : b , weight : e . weight } , c . push ( d ) ) } c . sort ( function ( e , f ) { return e . weight - f . weight } ) ; return c } } ;
( function ( a ) { var b = a . ScopeType || ( a . ScopeType = { } ) ; b . BLOCK = "block" ; b . WORKSPACE = "workspace" ; a . registry = new a } ) ( ContextMenuRegistry$$module$build$src$core$contextmenu _registry || ( ContextMenuRegistry$$module$build$src$core$contextmenu _registry = { } ) ) ; var ScopeType$$module$build$src$core$contextmenu _registry = ContextMenuRegistry$$module$build$src$core$contextmenu _registry . ScopeType , module$build$src$core$contextmenu _registry = { } ; module$build$src$core$contextmenu _registry . ContextMenuRegistry = ContextMenuRegistry$$module$build$src$core$contextmenu _registry ;
module$build$src$core$contextmenu _registry . ScopeType = ScopeType$$module$build$src$core$contextmenu _registry ; var COLLAPSE _CHARS$$module$build$src$core$internal _constants = 30 , DRAG _STACK$$module$build$src$core$internal _constants = ! 0 , OPPOSITE _TYPE$$module$build$src$core$internal _constants = [ ] ; OPPOSITE _TYPE$$module$build$src$core$internal _constants [ ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE ] = ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE ; OPPOSITE _TYPE$$module$build$src$core$internal _constants [ ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE ] = ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE ;
OPPOSITE _TYPE$$module$build$src$core$internal _constants [ ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT ] = ConnectionType$$module$build$src$core$connection _type . PREVIOUS _STATEMENT ; OPPOSITE _TYPE$$module$build$src$core$internal _constants [ ConnectionType$$module$build$src$core$connection _type . PREVIOUS _STATEMENT ] = ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT ;
var RENAME _VARIABLE _ID$$module$build$src$core$internal _constants = "RENAME_VARIABLE_ID" , DELETE _VARIABLE _ID$$module$build$src$core$internal _constants = "DELETE_VARIABLE_ID" , module$build$src$core$internal _constants = { } ; module$build$src$core$internal _constants . COLLAPSE _CHARS = COLLAPSE _CHARS$$module$build$src$core$internal _constants ; module$build$src$core$internal _constants . DELETE _VARIABLE _ID = DELETE _VARIABLE _ID$$module$build$src$core$internal _constants ; module$build$src$core$internal _constants . DRAG _STACK = DRAG _STACK$$module$build$src$core$internal _constants ;
module$build$src$core$internal _constants . OPPOSITE _TYPE = OPPOSITE _TYPE$$module$build$src$core$internal _constants ; module$build$src$core$internal _constants . RENAME _VARIABLE _ID = RENAME _VARIABLE _ID$$module$build$src$core$internal _constants ; 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 ( ) ;
if ( b ( c ) ) return c ; if ( c ) return this . getNextNode _ ( c , b ) ; a = this . findSiblingOrParent _ ( a . out ( ) ) ; return b ( a ) ? a : a ? this . getNextNode _ ( a , b ) : null } getPreviousNode _ ( a , b ) { if ( ! a ) return null ; let c = a . prev ( ) ; c = c ? this . getRightMostChild _ ( c ) : a . out ( ) ; return b ( c ) ? c : c ? this . getPreviousNode _ ( c , b ) : null } validNode _ ( a ) { let b = ! 1 ; a = a && a . getType ( ) ; if ( a === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . OUTPUT || a === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . INPUT || a === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . FIELD ||
a === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . NEXT || a === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . PREVIOUS || a === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . WORKSPACE ) b = ! 0 ; return b } findSiblingOrParent _ ( a ) { if ( ! a ) return null ; const b = a . next ( ) ; return b ? b : this . findSiblingOrParent _ ( a . out ( ) ) } getRightMostChild _ ( a ) { if ( ! a . in ( ) ) return a ; for ( a = a . in ( ) ; a && a . next ( ) ; ) a = a . next ( ) ; return this . getRightMostChild _ ( a ) } } ;
BasicCursor$$module$build$src$core$keyboard _nav$basic _cursor . registrationName = "basicCursor" ; register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . CURSOR , BasicCursor$$module$build$src$core$keyboard _nav$basic _cursor . registrationName , BasicCursor$$module$build$src$core$keyboard _nav$basic _cursor ) ; var module$build$src$core$keyboard _nav$basic _cursor = { } ; module$build$src$core$keyboard _nav$basic _cursor . BasicCursor = BasicCursor$$module$build$src$core$keyboard _nav$basic _cursor ; var TabNavigateCursor$$module$build$src$core$keyboard _nav$tab _navigate _cursor = class extends BasicCursor$$module$build$src$core$keyboard _nav$basic _cursor { validNode _ ( a ) { let b = ! 1 ; const c = a && a . getType ( ) ; a && ( a = a . getLocation ( ) , c === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . FIELD && a && a . isTabNavigable ( ) && a . isClickable ( ) && ( b = ! 0 ) ) ; return b } } , module$build$src$core$keyboard _nav$tab _navigate _cursor = { } ; module$build$src$core$keyboard _nav$tab _navigate _cursor . TabNavigateCursor = TabNavigateCursor$$module$build$src$core$keyboard _nav$tab _navigate _cursor ; var BUMP _RANDOMNESS$$module$build$src$core$rendered _connection = 10 , RenderedConnection$$module$build$src$core$rendered _connection = class extends Connection$$module$build$src$core$connection { constructor ( a , b ) { super ( a , b ) ; this . targetConnection = this . highlightPath = null ; this . db _ = a . workspace . connectionDBList [ b ] ; this . dbOpposite _ = a . workspace . connectionDBList [ OPPOSITE _TYPE$$module$build$src$core$internal _constants [ b ] ] ; this . offsetInBlock _ = new Coordinate$$module$build$src$core$utils$coordinate ( 0 , 0 ) ; this . trackedState _ =
RenderedConnection$$module$build$src$core$rendered _connection . TrackedState . WILL _TRACK } dispose ( ) { super . dispose ( ) ; this . trackedState _ === RenderedConnection$$module$build$src$core$rendered _connection . TrackedState . TRACKED && this . db _ . removeConnection ( this , this . y ) } getSourceBlock ( ) { return super . getSourceBlock ( ) } targetBlock ( ) { return super . targetBlock ( ) } distanceFrom ( a ) { const b = this . x - a . x ; a = this . y - a . y ; return Math . sqrt ( b * b + a * a ) } bumpAwayFrom ( a ) { if ( ! this . sourceBlock _ . workspace . isDragging ( ) ) { var b = this . sourceBlock _ . getRootBlock ( ) ;
if ( ! b . isInFlyout ) { var c = ! 1 ; if ( ! b . isMovable ( ) ) { b = a . getSourceBlock ( ) . getRootBlock ( ) ; if ( ! b . isMovable ( ) ) return ; a = this ; c = ! 0 } var d = getSelected$$module$build$src$core$common ( ) == b ; d || b . addSelect ( ) ; var e = a . x + $ . config$$module$build$src$core$config . snapRadius + Math . floor ( Math . random ( ) * BUMP _RANDOMNESS$$module$build$src$core$rendered _connection ) - this . x , f = a . y + $ . config$$module$build$src$core$config . snapRadius + Math . floor ( Math . random ( ) * BUMP _RANDOMNESS$$module$build$src$core$rendered _connection ) - this . y ; c && ( f = - f ) ; b . RTL &&
( e = a . x - $ . config$$module$build$src$core$config . snapRadius - Math . floor ( Math . random ( ) * BUMP _RANDOMNESS$$module$build$src$core$rendered _connection ) - this . x ) ; b . moveBy ( e , f ) ; d || b . removeSelect ( ) } } } moveTo ( a , b ) { this . trackedState _ === RenderedConnection$$module$build$src$core$rendered _connection . TrackedState . WILL _TRACK ? ( this . db _ . addConnection ( this , b ) , this . trackedState _ = RenderedConnection$$module$build$src$core$rendered _connection . TrackedState . TRACKED ) : this . trackedState _ === RenderedConnection$$module$build$src$core$rendered _connection . TrackedState . TRACKED &&
( this . db _ . removeConnection ( this , this . y ) , this . db _ . addConnection ( this , b ) ) ; this . x = a ; this . y = b } moveBy ( a , b ) { this . moveTo ( this . x + a , this . y + b ) } moveToOffset ( a ) { this . moveTo ( a . x + this . offsetInBlock _ . x , a . y + this . offsetInBlock _ . y ) } setOffsetInBlock ( a , b ) { this . offsetInBlock _ . x = a ; this . offsetInBlock _ . y = b } getOffsetInBlock ( ) { return this . offsetInBlock _ } tighten ( ) { const a = this . targetConnection . x - this . x , b = this . targetConnection . y - this . y ; if ( 0 !== a || 0 !== b ) { const d = this . targetBlock ( ) ; var c = d . getSvgRoot ( ) ; if ( ! c ) throw Error ( "block is not rendered." ) ;
c = getRelativeXY$$module$build$src$core$utils$svg _math ( c ) ; d . getSvgRoot ( ) . setAttribute ( "transform" , "translate(" + ( c . x - a ) + "," + ( c . y - b ) + ")" ) ; d . moveConnections ( - a , - b ) } } closest ( a , b ) { return this . dbOpposite _ . searchForClosest ( this , a , b ) } highlight ( ) { var a = this . sourceBlock _ . workspace . getRenderer ( ) . getConstants ( ) ; var b = a . shapeFor ( this ) ; this . type === ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE || this . type === ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE ? ( a = a . TAB _OFFSET _FROM _TOP ,
b = moveBy$$module$build$src$core$utils$svg _paths ( 0 , - a ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , a ) + b . pathDown + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , a ) ) : ( a = a . NOTCH _OFFSET _LEFT - a . CORNER _RADIUS , b = moveBy$$module$build$src$core$utils$svg _paths ( - a , 0 ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , a ) + b . pathLeft + lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , a ) ) ; a = this . sourceBlock _ . getRelativeToSurfaceXY ( ) ; this . highlightPath = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . PATH ,
{ "class" : "blocklyHighlightedConnectionPath" , d : b , transform : "translate(" + ( this . x - a . x ) + "," + ( this . y - a . y ) + ")" + ( this . sourceBlock _ . RTL ? " scale(-1 1)" : "" ) } , this . sourceBlock _ . getSvgRoot ( ) ) } unhighlight ( ) { this . highlightPath && ( removeNode$$module$build$src$core$utils$dom ( this . highlightPath ) , this . highlightPath = null ) } setTracking ( a ) { a && this . trackedState _ === RenderedConnection$$module$build$src$core$rendered _connection . TrackedState . TRACKED || ! a && this . trackedState _ === RenderedConnection$$module$build$src$core$rendered _connection . TrackedState . UNTRACKED ||
this . sourceBlock _ . isInFlyout || ( a ? ( this . db _ . addConnection ( this , this . y ) , this . trackedState _ = RenderedConnection$$module$build$src$core$rendered _connection . TrackedState . TRACKED ) : ( this . trackedState _ === RenderedConnection$$module$build$src$core$rendered _connection . TrackedState . TRACKED && this . db _ . removeConnection ( this , this . y ) , this . trackedState _ = RenderedConnection$$module$build$src$core$rendered _connection . TrackedState . UNTRACKED ) ) } stopTrackingAll ( ) { this . setTracking ( ! 1 ) ; if ( this . targetConnection ) { const c = this . targetBlock ( ) . getDescendants ( ! 1 ) ;
for ( let d = 0 ; d < c . length ; d ++ ) { var a = c [ d ] , b = a . getConnections _ ( ! 0 ) ; for ( let e = 0 ; e < b . length ; e ++ ) b [ e ] . setTracking ( ! 1 ) ; a = a . getIcons ( ) ; for ( b = 0 ; b < a . length ; b ++ ) a [ b ] . setVisible ( ! 1 ) } } } startTrackingAll ( ) { this . setTracking ( ! 0 ) ; let a = [ ] ; if ( this . type !== ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE && this . type !== ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT ) return a ; const b = this . targetBlock ( ) ; if ( b ) { let c ; b . isCollapsed ( ) ? ( c = [ ] , b . outputConnection && c . push ( b . outputConnection ) , b . nextConnection &&
c . push ( b . nextConnection ) , b . previousConnection && c . push ( b . previousConnection ) ) : c = b . getConnections _ ( ! 0 ) ; for ( let d = 0 ; d < c . length ; d ++ ) a . push ( ... c [ d ] . startTrackingAll ( ) ) ; a . length || ( a = [ b ] ) } return a } onFailedConnect ( a ) { const b = this . getSourceBlock ( ) ; if ( getRecordUndo$$module$build$src$core$events$utils ( ) ) { const c = getGroup$$module$build$src$core$events$utils ( ) ; setTimeout ( function ( ) { b . isDisposed ( ) || b . getParent ( ) || ( setGroup$$module$build$src$core$events$utils ( c ) , this . bumpAwayFrom ( a ) , setGroup$$module$build$src$core$events$utils ( ! 1 ) ) } . bind ( this ) ,
$ . config$$module$build$src$core$config . bumpDelay ) } } disconnectInternal _ ( a , b ) { super . disconnectInternal _ ( a , b ) ; a . rendered && a . render ( ) ; b . rendered && ( b . updateDisabled ( ) , b . render ( ) , b . getSvgRoot ( ) . style . display = "block" ) } respawnShadow _ ( ) { super . respawnShadow _ ( ) ; var a = this . targetBlock ( ) ; a && ( a . initSvg ( ) , a . render ( ! 1 ) , a = this . getSourceBlock ( ) , a . rendered && a . render ( ) ) } neighbours ( a ) { return this . dbOpposite _ . getNeighbours ( this , a ) } connect _ ( a ) { super . connect _ ( a ) ; var b = this . getSourceBlock ( ) ; a = a . getSourceBlock ( ) ; const c = b . rendered ,
d = a . rendered ; c && b . updateDisabled ( ) ; d && a . updateDisabled ( ) ; c && d && ( this . type === ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT || this . type === ConnectionType$$module$build$src$core$connection _type . PREVIOUS _STATEMENT ? a . render ( ) : b . render ( ) ) ; 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 ( ) , this . sourceBlock _ . bumpNeighbours ( ) ) } } ; ( 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 Warning$$module$build$src$core$warning = class extends Icon$$module$build$src$core$icon { constructor ( a ) { super ( a ) ; this . paragraphElement _ = null ; this . collapseHidden = ! 1 ; this . createIcon ( ) ; this . text _ = Object . create ( null ) } drawIcon _ ( 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" } , a ) ; 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" } , a ) ; 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" } , a ) } setVisible ( a ) { a !== this . isVisible ( ) && ( fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( BUBBLE _OPEN$$module$build$src$core$events$utils ) ) ( this . getBlock ( ) , a , "warning" ) ) , a ? this . createBubble _ ( ) : this . disposeBubble _ ( ) ) } createBubble _ ( ) { this . paragraphElement _ =
Bubble$$module$build$src$core$bubble . textToDom ( this . getText ( ) ) ; this . bubble _ = Bubble$$module$build$src$core$bubble . createNonEditableBubble ( this . paragraphElement _ , this . getBlock ( ) , this . iconXY _ ) ; this . applyColour ( ) } disposeBubble _ ( ) { this . bubble _ && ( this . bubble _ . dispose ( ) , this . bubble _ = null ) ; this . paragraphElement _ = null } setText ( a , b ) { this . text _ [ b ] !== a && ( a ? this . text _ [ b ] = a : delete this . text _ [ b ] , this . isVisible ( ) && ( this . setVisible ( ! 1 ) , this . setVisible ( ! 0 ) ) ) } getText ( ) { const a = [ ] ; for ( const b in this . text _ ) a . push ( this . text _ [ b ] ) ;
return a . join ( "\n" ) } dispose ( ) { this . getBlock ( ) . warning = null ; super . dispose ( ) } } , module$build$src$core$warning = { } ; module$build$src$core$warning . Warning = Warning$$module$build$src$core$warning ; 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 . renderingDebugger = null ; this . width = this . height = 0 ; this . warningTextDb = new Map ; this . warning = this . commentIcon _ = this . mutator = null ; this . eventsInit _ = this . renderIsInProgress _ = this . rendered = ! 1 ; this . workspace = a ; this . decompose = this . decompose ; this . compose = this . compose ; this . saveConnections = this . saveConnections ; this . customContextMenu = this . customContextMenu ; this . svgGroup _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G ,
{ } ) ; this . svgGroup _ . translate _ = "" ; this . style = a . getRenderer ( ) . getConstants ( ) . getBlockStyle ( null ) ; this . pathObject = a . getRenderer ( ) . makePathObject ( this . svgGroup _ , this . style ) ; this . useDragSurface _ = ! ! a . getBlockDragSurface ( ) ; 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 . workspace . rendered ) throw TypeError ( "Workspace is headless." ) ; for ( let b = 0 , c ; c = this . inputList [ b ] ; b ++ ) c . init ( ) ; var a =
this . getIcons ( ) ; for ( let b = 0 ; b < a . length ; b ++ ) a [ b ] . createIcon ( ) ; this . applyColour ( ) ; this . pathObject . updateMovable ( this . isMovable ( ) ) ; a = this . getSvgRoot ( ) ; this . workspace . options . readOnly || this . eventsInit _ || ! a || conditionalBind$$module$build$src$core$browser _events ( a , "mousedown" , this , this . onMouseDown _ ) ; this . eventsInit _ = ! 0 ; a . parentNode || this . workspace . getCanvas ( ) . appendChild ( a ) } getColourSecondary ( ) { return this . style . colourSecondary } getColourTertiary ( ) { return this . style . colourTertiary } select ( ) { if ( this . isShadow ( ) &&
this . getParent ( ) ) this . getParent ( ) . select ( ) ; else if ( getSelected$$module$build$src$core$common ( ) !== this ) { var a = null ; if ( getSelected$$module$build$src$core$common ( ) ) { a = getSelected$$module$build$src$core$common ( ) . id ; disable$$module$build$src$core$events$utils ( ) ; try { getSelected$$module$build$src$core$common ( ) . unselect ( ) } finally { enable$$module$build$src$core$events$utils ( ) } } a = new ( get$$module$build$src$core$events$utils ( SELECTED$$module$build$src$core$events$utils ) ) ( a , this . id , this . workspace . id ) ; fire$$module$build$src$core$events$utils ( a ) ;
setSelected$$module$build$src$core$common ( this ) ; this . addSelect ( ) } } unselect ( ) { if ( getSelected$$module$build$src$core$common ( ) === this ) { var a = new ( get$$module$build$src$core$events$utils ( SELECTED$$module$build$src$core$events$utils ) ) ( this . id , null , this . workspace . id ) ; a . workspaceId = this . workspace . id ; fire$$module$build$src$core$events$utils ( a ) ; setSelected$$module$build$src$core$common ( null ) ; this . removeSelect ( ) } } getIcons ( ) { const a = [ ] ; this . mutator && a . push ( this . mutator ) ; this . commentIcon _ && a . push ( this . commentIcon _ ) ;
this . warning && a . push ( this . warning ) ; return a } 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 ) , a = this . getRelativeToSurfaceXY ( ) , this . moveConnections ( a . x - d . x , a . y - d . y ) ) : b && ( this . workspace . getCanvas ( ) . appendChild ( c ) , this . translate ( d . x , d . y ) ) ; this . applyColour ( ) } } } getRelativeToSurfaceXY ( ) { let a =
0 , b = 0 ; const c = this . useDragSurface _ ? this . workspace . getBlockDragSurface ( ) . getGroup ( ) : null ; let d = this . getSvgRoot ( ) ; if ( d ) { do { var e = getRelativeXY$$module$build$src$core$utils$svg _math ( d ) ; a += e . x ; b += e . y ; this . useDragSurface _ && this . workspace . getBlockDragSurface ( ) . getCurrentBlock ( ) === d && ( e = this . workspace . getBlockDragSurface ( ) . getSurfaceTranslation ( ) , a += e . x , b += e . y ) ; d = d . parentNode } while ( d && d !== this . workspace . getCanvas ( ) && d !== c ) } return new Coordinate$$module$build$src$core$utils$coordinate ( a , b ) } moveBy ( a , b ) { if ( this . parentBlock _ ) throw Error ( "Block has parent." ) ;
const c = isEnabled$$module$build$src$core$events$utils ( ) ; let d = null ; c && ( d = new ( get$$module$build$src$core$events$utils ( MOVE$$module$build$src$core$events$utils ) ) ( this ) ) ; const e = this . getRelativeToSurfaceXY ( ) ; this . translate ( e . x + a , e . y + b ) ; this . moveConnections ( a , b ) ; c && d && ( d . recordNew ( ) , fire$$module$build$src$core$events$utils ( d ) ) ; this . workspace . resizeContents ( ) } translate ( a , b ) { this . getSvgRoot ( ) . setAttribute ( "transform" , "translate(" + a + "," + b + ")" ) } moveToDragSurface ( ) { if ( this . useDragSurface _ ) { var a = this . getRelativeToSurfaceXY ( ) ;
this . clearTransformAttributes _ ( ) ; this . workspace . getBlockDragSurface ( ) . translateSurface ( a . x , a . y ) ; ( a = this . getSvgRoot ( ) ) && this . workspace . getBlockDragSurface ( ) . setBlocksAndShow ( a ) } } moveTo ( a ) { const b = this . getRelativeToSurfaceXY ( ) ; this . moveBy ( a . x - b . x , a . y - b . y ) } moveOffDragSurface ( a ) { this . useDragSurface _ && ( this . translate ( a . x , a . y ) , this . workspace . getBlockDragSurface ( ) . clearAndHide ( this . workspace . getCanvas ( ) ) ) } moveDuringDrag ( a ) { this . useDragSurface _ ? this . workspace . getBlockDragSurface ( ) . translateSurface ( a . x , a . y ) :
( this . svgGroup _ . translate _ = "translate(" + a . x + "," + a . y + ")" , this . svgGroup _ . setAttribute ( "transform" , this . svgGroup _ . translate _ + this . svgGroup _ . skew _ ) ) } clearTransformAttributes _ ( ) { this . getSvgRoot ( ) . removeAttribute ( "transform" ) } snapToGrid ( ) { if ( ! ( this . isDeadOrDying ( ) || this . workspace . isDragging ( ) || this . getParent ( ) || this . isInFlyout ) ) { var a = this . workspace . getGrid ( ) ; if ( a && a . shouldSnap ( ) ) { var b = a . getSpacing ( ) , c = b / 2 , d = this . getRelativeToSurfaceXY ( ) ; a = Math . round ( Math . round ( ( d . x - c ) / b ) * b + c - d . x ) ; b = Math . round ( Math . round ( ( d . y -
c ) / b ) * b + c - d . y ) ; ( a || b ) && this . moveBy ( a , b ) } } } getBoundingRectangle ( ) { const a = this . getRelativeToSurfaceXY ( ) , b = this . getHeightWidth ( ) ; let c , d ; this . RTL ? ( c = a . x - b . width , d = a . x ) : ( c = a . x , d = a . x + b . width ) ; return new Rect$$module$build$src$core$utils$rect ( a . y , a . y + b . 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 ) , a ? this . rendered && this . render ( ) : 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 ) ; if ( a ) { a = this . getIcons ( ) ; for ( let e = 0 , f ; f = a [ e ] ; e ++ ) f . setVisible ( ! 1 ) ; a = this . toString ( COLLAPSE _CHARS$$module$build$src$core$internal _constants ) ; var d = this . getField ( c ) ; d ? d . setValue ( a ) : ( this . getInput ( b ) || this . appendDummyInput ( b ) ) . appendField ( new $ . FieldLabel$$module$build$src$core$field _label ( a ) , c ) } else 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 ) , setCurrentBlock$$module$build$src$core$contextmenu ( this ) ) } moveConnections ( a , b ) { if ( this . rendered ) { var c = this . getConnections _ ( ! 1 ) ; for ( var d = 0 ; d < c . length ; d ++ ) c [ d ] . moveBy ( a , b ) ; c = this . getIcons ( ) ; for ( d = 0 ; d < c . length ; d ++ ) c [ d ] . computeIconLocation ( ) ; for ( c = 0 ; c < this . childBlocks _ . length ; c ++ ) this . childBlocks _ [ c ] . moveConnections ( a , b ) } } setDragging ( a ) { if ( a ) { var b = this . getSvgRoot ( ) ; b . translate _ = "" ; b . skew _ = "" ; draggingConnections$$module$build$src$core$common . push ( ... this . getConnections _ ( ! 0 ) ) ; addClass$$module$build$src$core$utils$dom ( this . svgGroup _ ,
"blocklyDragging" ) } else draggingConnections$$module$build$src$core$common . length = 0 , removeClass$$module$build$src$core$utils$dom ( this . svgGroup _ , "blocklyDragging" ) ; for ( b = 0 ; b < this . childBlocks _ . length ; b ++ ) this . childBlocks _ [ b ] . setDragging ( a ) } setMovable ( a ) { super . setMovable ( a ) ; this . pathObject . updateMovable ( a ) } setEditable ( a ) { super . setEditable ( a ) ; a = this . getIcons ( ) ; for ( let b = 0 ; b < a . length ; b ++ ) a [ b ] . updateEditable ( ) } setShadow ( a ) { super . setShadow ( a ) ; this . applyColour ( ) } setInsertionMarker ( a ) { this . isInsertionMarker _ !==
a && ( this . isInsertionMarker _ = a ) && ( this . setColour ( this . workspace . getRenderer ( ) . getConstants ( ) . INSERTION _MARKER _COLOUR ) , this . pathObject . updateInsertionMarker ( ! 0 ) ) } getSvgRoot ( ) { return this . svgGroup _ } dispose ( a , b ) { if ( ! this . isDeadOrDying ( ) ) { dispose$$module$build$src$core$tooltip ( ) ; unbindMouseEvents$$module$build$src$core$tooltip ( this . pathObject . svgPath ) ; startTextWidthCache$$module$build$src$core$utils$dom ( ) ; var c = this . workspace ; getSelected$$module$build$src$core$common ( ) === this && ( this . unselect ( ) , this . workspace . cancelCurrentGesture ( ) ) ;
getCurrentBlock$$module$build$src$core$contextmenu ( ) === this && hide$$module$build$src$core$contextmenu ( ) ; b && this . rendered && ( this . unplug ( a ) , disposeUiEffect$$module$build$src$core$block _animations ( this ) ) ; this . rendered = ! 1 ; for ( var d of this . warningTextDb . values ( ) ) clearTimeout ( d ) ; this . warningTextDb . clear ( ) ; b = this . getIcons ( ) ; for ( d = 0 ; d < b . length ; d ++ ) b [ d ] . dispose ( ) ; getSelected$$module$build$src$core$common ( ) === this && setSelected$$module$build$src$core$common ( null ) ; super . dispose ( ! ! a ) ; removeNode$$module$build$src$core$utils$dom ( this . svgGroup _ ) ;
c . resizeContents ( ) ; this . svgGroup _ = null ; stopTextWidthCache$$module$build$src$core$utils$dom ( ) } } 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 : { saveInfo : save$$module$build$src$core$serialization$blocks ( this , { addCoordinates : ! 0 , addNextBlocks : ! 1 } ) , source : this . workspace , typeCounts : getBlockTypeCounts$$module$build$src$core$common ( this ,
! 0 ) } } applyColour ( ) { this . pathObject . applyColour ( this ) ; const a = this . getIcons ( ) ; for ( let b = 0 ; b < a . length ; b ++ ) a [ b ] . applyColour ( ) ; for ( let b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( let d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) e . applyColour ( ) } updateDisabled ( ) { const a = this . getChildren ( ! 1 ) ; this . applyColour ( ) ; if ( ! this . isCollapsed ( ) ) for ( let b = 0 , c ; c = a [ b ] ; b ++ ) c . rendered && c . updateDisabled ( ) } getCommentIcon ( ) { return this . commentIcon _ } setCommentText ( a ) { this . commentModel . text !== a && ( super . setCommentText ( a ) , a = null !== a , ! ! this . commentIcon _ ===
a ? this . commentIcon _ . updateText ( ) : ( a ? this . comment = this . commentIcon _ = new Comment$$module$build$src$core$comment ( this ) : ( this . commentIcon _ . dispose ( ) , this . comment = this . commentIcon _ = null ) , this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) ) ) } setWarningText ( a , b ) { const c = b || "" ; if ( c ) this . warningTextDb . has ( c ) && ( clearTimeout ( this . warningTextDb . get ( c ) ) , this . warningTextDb . delete ( c ) ) ; else { for ( var d of this . warningTextDb . values ( ) ) clearTimeout ( d ) ; this . warningTextDb . clear ( ) } if ( this . workspace . isDragging ( ) ) this . warningTextDb . set ( c ,
setTimeout ( ( ) => { this . isDeadOrDying ( ) || ( this . warningTextDb . delete ( c ) , this . setWarningText ( a , c ) ) } , 100 ) ) ; else { this . isInFlyout && ( a = null ) ; b = ! 1 ; if ( "string" === typeof a ) { d = this . getSurroundParent ( ) ; let 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 ) ; this . warning || ( this . warning = new Warning$$module$build$src$core$warning ( this ) , b = ! 0 ) ; this . warning . setText ( a ,
c ) } else this . warning && ! c ? ( this . warning . dispose ( ) , b = ! 0 ) : this . warning && ( b = this . warning . getText ( ) , this . warning . setText ( "" , c ) , ( d = this . warning . getText ( ) ) || this . warning . dispose ( ) , b = b !== d ) ; b && this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } } setMutator ( a ) { this . mutator && this . mutator !== a && this . mutator . dispose ( ) ; a && ( a . setBlock ( this ) , this . mutator = a , a . createIcon ( ) ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } setEnabled ( a ) { this . isEnabled ( ) !== a && ( super . setEnabled ( a ) , this . rendered && ! this . getInheritedDisabled ( ) &&
this . updateDisabled ( ) ) } setHighlighted ( a ) { this . rendered && 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 ( ) { let a = this ; do { const b = a . getSvgRoot ( ) , c = b . parentNode , d = c . childNodes ; d [ d . length - 1 ] !== b && c . appendChild ( b ) ; a = a . getParent ( ) } while ( a ) } setPreviousStatement ( a , b ) { super . setPreviousStatement ( a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } setNextStatement ( a ,
b ) { super . setNextStatement ( a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } setOutput ( a , b ) { super . setOutput ( a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } setInputsInline ( a ) { super . setInputsInline ( a ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } removeInput ( a , b ) { a = super . removeInput ( a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) ; return a } moveNumberedInputBefore ( a , b ) { super . moveNumberedInputBefore ( a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } appendInput _ ( a ,
b ) { a = super . appendInput _ ( a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) ; 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 . inputList . length ; b ++ ) { var c = this . inputList [ b ] . connection ; c && ( c . setTracking ( a ) , ( c = c . targetBlock ( ) ) &&
c . setConnectionTracking ( a ) ) } } getConnections _ ( a ) { const b = [ ] ; if ( a || this . rendered ) if ( this . outputConnection && b . push ( this . outputConnection ) , this . previousConnection && b . push ( this . previousConnection ) , this . nextConnection && b . push ( this . nextConnection ) , a || ! this . collapsed _ ) for ( let c = 0 , d ; d = this . inputList [ c ] ; c ++ ) d . connection && b . push ( d . connection ) ; return b } lastConnectionInStack ( a ) { return super . lastConnectionInStack ( a ) } getMatchingConnection ( a , b ) { return super . getMatchingConnection ( a , b ) } makeConnection _ ( a ) { return new RenderedConnection$$module$build$src$core$rendered _connection ( this ,
a ) } getNextBlock ( ) { return super . getNextBlock ( ) } getPreviousBlock ( ) { return super . getPreviousBlock ( ) } bumpNeighbours ( ) { if ( ! this . isDeadOrDying ( ) && ! this . workspace . isDragging ( ) ) { var a = this . getRootBlock ( ) ; if ( ! a . isInFlyout ) { var b = this . getConnections _ ( ! 1 ) ; for ( let c = 0 , d ; d = b [ c ] ; c ++ ) { const e = d ; e . isConnected ( ) && e . isSuperior ( ) && e . targetBlock ( ) . bumpNeighbours ( ) ; const f = d . neighbours ( $ . config$$module$build$src$core$config . snapRadius ) ; for ( let g = 0 , h ; h = f [ g ] ; g ++ ) { const k = h ; e . isConnected ( ) && k . isConnected ( ) || k . getSourceBlock ( ) . getRootBlock ( ) !==
a && ( e . isSuperior ( ) ? k . bumpAwayFrom ( e ) : e . bumpAwayFrom ( k ) ) } } } } } scheduleSnapAndBump ( ) { const a = getGroup$$module$build$src$core$events$utils ( ) ; setTimeout ( ( ) => { setGroup$$module$build$src$core$events$utils ( a ) ; this . snapToGrid ( ) ; setGroup$$module$build$src$core$events$utils ( ! 1 ) } , $ . config$$module$build$src$core$config . bumpDelay / 2 ) ; setTimeout ( ( ) => { setGroup$$module$build$src$core$events$utils ( a ) ; this . bumpNeighbours ( ) ; setGroup$$module$build$src$core$events$utils ( ! 1 ) } , $ . config$$module$build$src$core$config . bumpDelay ) } positionNearConnection ( a ,
b ) { a . type !== ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT && a . type !== ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE || this . moveBy ( b . x - a . x , b . y - a . y ) } getFirstStatementConnection ( ) { return super . getFirstStatementConnection ( ) } getChildren ( a ) { return super . getChildren ( a ) } render ( a ) { if ( ! this . renderIsInProgress _ ) { this . renderIsInProgress _ = ! 0 ; try { this . rendered = ! 0 ; startTextWidthCache$$module$build$src$core$utils$dom ( ) ; this . isCollapsed ( ) && this . updateCollapsed _ ( ) ; this . workspace . getRenderer ( ) . render ( this ) ;
this . updateConnectionLocations _ ( ) ; if ( ! 1 !== a ) { const b = this . getParent ( ) ; b ? b . render ( ! 0 ) : this . workspace . resizeContents ( ) } stopTextWidthCache$$module$build$src$core$utils$dom ( ) ; this . updateMarkers _ ( ) } finally { this . renderIsInProgress _ = ! 1 } } } updateMarkers _ ( ) { this . workspace . keyboardAccessibilityMode && this . pathObject . cursorSvg && this . workspace . getCursor ( ) . draw ( ) ; this . workspace . keyboardAccessibilityMode && this . pathObject . markerSvg && this . workspace . getMarker ( MarkerManager$$module$build$src$core$marker _manager . LOCAL _MARKER ) . draw ( ) } updateConnectionLocations _ ( ) { const a =
this . getRelativeToSurfaceXY ( ) ; this . previousConnection && this . previousConnection . moveToOffset ( a ) ; this . outputConnection && this . outputConnection . moveToOffset ( a ) ; for ( let b = 0 ; b < this . inputList . length ; b ++ ) { const c = this . inputList [ b ] . connection ; c && ( c . moveToOffset ( a ) , c . isConnected ( ) && c . tighten ( ) ) } this . nextConnection && ( this . nextConnection . moveToOffset ( a ) , this . nextConnection . isConnected ( ) && this . nextConnection . tighten ( ) ) } setCursorSvg ( a ) { this . pathObject . setCursorSvg ( a ) } setMarkerSvg ( a ) { this . pathObject . setMarkerSvg ( a ) } getHeightWidth ( ) { let a =
this . height , b = this . width ; var c = this . getNextBlock ( ) ; if ( c ) { c = c . getHeightWidth ( ) ; const d = this . workspace . getRenderer ( ) . getConstants ( ) . NOTCH _HEIGHT ; a += c . height - d ; b = Math . max ( b , c . width ) } return { height : a , width : b } } fadeForReplacement ( a ) { this . pathObject . updateReplacementFade ( a ) } highlightShapeForInput ( a , b ) { this . pathObject . updateShapeForInputHighlight ( a , b ) } } ; BlockSvg$$module$build$src$core$block _svg . INLINE = - 1 ; BlockSvg$$module$build$src$core$block _svg . COLLAPSED _WARNING _ID = "TEMP_COLLAPSED_WARNING_" ;
var module$build$src$core$block _svg = { } ; module$build$src$core$block _svg . BlockSvg = BlockSvg$$module$build$src$core$block _svg ; var DragTarget$$module$build$src$core$drag _target = class { constructor ( ) { } onDragEnter ( a ) { } onDragOver ( a ) { } onDragExit ( a ) { } onDrop ( a ) { } getClientRect ( ) { return null } shouldPreventMove ( a ) { return ! 1 } } , module$build$src$core$drag _target = { } ; module$build$src$core$drag _target . DragTarget = DragTarget$$module$build$src$core$drag _target ; var DeleteArea$$module$build$src$core$delete _area = class extends DragTarget$$module$build$src$core$drag _target { constructor ( ) { super ( ) ; this . wouldDelete _ = ! 1 } wouldDelete ( a , b ) { a instanceof BlockSvg$$module$build$src$core$block _svg ? ( a = ! a . getParent ( ) && a . isDeletable ( ) , this . updateWouldDelete _ ( a && ! b ) ) : this . updateWouldDelete _ ( a . isDeletable ( ) ) ; return this . wouldDelete _ } updateWouldDelete _ ( a ) { this . wouldDelete _ = a } } , module$build$src$core$delete _area = { } ; module$build$src$core$delete _area . DeleteArea = DeleteArea$$module$build$src$core$delete _area ; 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 = { } ; module$build$src$core$sprites . SPRITE = SPRITE$$module$build$src$core$sprites ; 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 _ , "mousedown" , this , this . blockMouseDownWhenOpenable _ ) ; bind$$module$build$src$core$browser _events ( this . svgGroup _ , "mouseup" , this , this . click ) ; bind$$module$build$src$core$browser _events ( c , "mouseover" , this , this . mouseOver _ ) ; bind$$module$build$src$core$browser _events ( c ,
"mouseout" , this , this . mouseOut _ ) ; this . animateLid _ ( ) ; return this . svgGroup _ } init ( ) { 0 < this . workspace . options . maxTrashcanContents && ( insertAfter$$module$build$src$core$utils$dom ( this . flyout . createDom ( Svg$$module$build$src$core$utils$svg . SVG ) , this . workspace . getParentSvg ( ) ) , this . flyout . init ( this . workspace ) ) ; this . workspace . getComponentManager ( ) . addComponent ( { component : this , weight : 1 , capabilities : [ ComponentManager$$module$build$src$core$component _manager . Capability . AUTOHIDEABLE , ComponentManager$$module$build$src$core$component _manager . Capability . DELETE _AREA ,
ComponentManager$$module$build$src$core$component _manager . Capability . DRAG _TARGET , ComponentManager$$module$build$src$core$component _manager . Capability . POSITIONABLE ] } ) ; this . initialized _ = ! 0 ; this . setLidOpen ( ! 1 ) } dispose ( ) { this . workspace . getComponentManager ( ) . removeComponent ( "trashcan" ) ; this . svgGroup _ && ( removeNode$$module$build$src$core$utils$dom ( this . svgGroup _ ) , this . svgGroup _ = null ) ; this . svgLid _ = null ; this . lidTask _ && clearTimeout ( this . lidTask _ ) } hasContents _ ( ) { return ! ! this . contents _ . length } contentsIsOpen ( ) { return ! ! this . flyout &&
this . flyout . isVisible ( ) } openFlyout ( ) { if ( ! this . contentsIsOpen ( ) ) { var a = this . contents _ . map ( function ( c ) { return JSON . parse ( c ) } ) , b ; null == ( b = this . flyout ) || b . show ( a ) ; this . fireUiEvent _ ( ! 0 ) } } closeFlyout ( ) { if ( this . contentsIsOpen ( ) ) { var a ; null == ( a = this . flyout ) || a . hide ( ) ; 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 . toString ( ) ) ; 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 . 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 ( - 1 === this . contents _ . indexOf ( 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 ;
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 ToolboxItemSelect$$module$build$src$core$events$events _toolbox _item _select = class extends UiBase$$module$build$src$core$events$events _ui _base { constructor ( a , b , c ) { super ( c ) ; this . type = TOOLBOX _ITEM _SELECT$$module$build$src$core$events$utils ; this . oldItem = null != a ? a : void 0 ; this . newItem = null != b ? b : void 0 } toJson ( ) { const a = super . toJson ( ) ; a . oldItem = this . oldItem ; a . newItem = this . newItem ; return a } fromJson ( a ) { super . fromJson ( a ) ; this . oldItem = a . oldItem ; this . newItem = a . newItem } } ;
register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . EVENT , TOOLBOX _ITEM _SELECT$$module$build$src$core$events$utils , ToolboxItemSelect$$module$build$src$core$events$events _toolbox _item _select ) ; var module$build$src$core$events$events _toolbox _item _select = { } ; module$build$src$core$events$events _toolbox _item _select . ToolboxItemSelect = ToolboxItemSelect$$module$build$src$core$events$events _toolbox _item _select ; var ToolboxItem$$module$build$src$core$toolbox$toolbox _item = class { constructor ( a , b , c ) { this . id _ = a . toolboxitemid || getNextUniqueId$$module$build$src$core$utils$idgenerator ( ) ; this . level _ = ( this . parent _ = c || null ) ? this . parent _ . getLevel ( ) + 1 : 0 ; this . toolboxItemDef _ = a ; this . parentToolbox _ = b ; this . workspace _ = this . parentToolbox _ . getWorkspace ( ) } init ( ) { } getDiv ( ) { return null } getClickTarget ( ) { return null } getId ( ) { return this . id _ } getParent ( ) { return null } getLevel ( ) { return this . level _ } isSelectable ( ) { return ! 1 } isCollapsible ( ) { return ! 1 } dispose ( ) { } setVisible _ ( a ) { } } ,
module$build$src$core$toolbox$toolbox _item = { } ; module$build$src$core$toolbox$toolbox _item . ToolboxItem = ToolboxItem$$module$build$src$core$toolbox$toolbox _item ; var ToolboxCategory$$module$build$src$core$toolbox$category = class extends ToolboxItem$$module$build$src$core$toolbox$toolbox _item { constructor ( a , b , c ) { super ( a , b , c ) ; this . colour _ = this . name _ = "" ; this . labelDom _ = this . iconDom _ = this . rowContents _ = this . rowDiv _ = this . htmlDiv _ = null ; this . isDisabled _ = this . isHidden _ = ! 1 ; this . flyoutItems _ = [ ] ; this . cssConfig _ = this . makeDefaultCssConfig _ ( ) } init ( ) { this . parseCategoryDef _ ( this . toolboxItemDef _ ) ; this . parseContents _ ( this . toolboxItemDef _ ) ; this . createDom _ ( ) ; "true" === this . toolboxItemDef _ . hidden &&
this . hide ( ) } makeDefaultCssConfig _ ( ) { return { container : "blocklyToolboxCategory" , row : "blocklyTreeRow" , rowcontentcontainer : "blocklyTreeRowContentContainer" , icon : "blocklyTreeIcon" , label : "blocklyTreeLabel" , contents : "blocklyToolboxContents" , selected : "blocklyTreeSelected" , openicon : "blocklyTreeIconOpen" , closedicon : "blocklyTreeIconClosed" } } parseContents _ ( a ) { if ( "custom" in a ) this . flyoutItems _ = a . custom ; else if ( a = a . contents ) for ( let b = 0 ; b < a . length ; b ++ ) { const c = a [ b ] ; Array . isArray ( this . flyoutItems _ ) && this . flyoutItems _ . push ( c ) } } parseCategoryDef _ ( a ) { this . name _ =
"name" in a ? replaceMessageReferences$$module$build$src$core$utils$parsing ( a . name ) : "" ; this . colour _ = this . getColour _ ( a ) ; Object . assign ( this . cssConfig _ , a . cssconfig || a . cssConfig ) } createDom _ ( ) { this . htmlDiv _ = this . createContainer _ ( ) ; setRole$$module$build$src$core$utils$aria ( this . htmlDiv _ , Role$$module$build$src$core$utils$aria . TREEITEM ) ; setState$$module$build$src$core$utils$aria ( this . htmlDiv _ , State$$module$build$src$core$utils$aria . SELECTED , ! 1 ) ; setState$$module$build$src$core$utils$aria ( this . htmlDiv _ , State$$module$build$src$core$utils$aria . LEVEL ,
this . level _ ) ; this . rowDiv _ = this . createRowContainer _ ( ) ; this . rowDiv _ . style . pointerEvents = "auto" ; this . htmlDiv _ . appendChild ( this . rowDiv _ ) ; this . rowContents _ = this . createRowContentsContainer _ ( ) ; this . rowContents _ . style . pointerEvents = "none" ; this . rowDiv _ . appendChild ( this . rowContents _ ) ; this . iconDom _ = this . createIconDom _ ( ) ; setRole$$module$build$src$core$utils$aria ( this . iconDom _ , Role$$module$build$src$core$utils$aria . PRESENTATION ) ; this . rowContents _ . appendChild ( this . iconDom _ ) ; this . labelDom _ = this . createLabelDom _ ( this . name _ ) ;
this . rowContents _ . appendChild ( this . labelDom _ ) ; const a = this . labelDom _ . getAttribute ( "id" ) ; a && setState$$module$build$src$core$utils$aria ( this . htmlDiv _ , State$$module$build$src$core$utils$aria . LABELLEDBY , a ) ; this . addColourBorder _ ( this . colour _ ) ; return this . htmlDiv _ } createContainer _ ( ) { const a = document . createElement ( "div" ) , b = this . cssConfig _ . container ; b && addClass$$module$build$src$core$utils$dom ( a , b ) ; return a } createRowContainer _ ( ) { const a = document . createElement ( "div" ) ; var b = this . cssConfig _ . row ; b && addClass$$module$build$src$core$utils$dom ( a ,
b ) ; b = ` ${ ToolboxCategory$$module$build$src$core$toolbox$category . nestedPadding * this . getLevel ( ) } px ` ; this . workspace _ . RTL ? a . style . paddingRight = b : a . style . paddingLeft = b ; return a } createRowContentsContainer _ ( ) { const a = document . createElement ( "div" ) , b = this . cssConfig _ . rowcontentcontainer ; b && addClass$$module$build$src$core$utils$dom ( a , b ) ; return a } createIconDom _ ( ) { const a = document . createElement ( "span" ) ; if ( ! this . parentToolbox _ . isHorizontal ( ) ) { const b = this . cssConfig _ . icon ; b && addClass$$module$build$src$core$utils$dom ( a ,
b ) } a . style . display = "inline-block" ; return a } createLabelDom _ ( a ) { const b = document . createElement ( "span" ) ; b . setAttribute ( "id" , this . getId ( ) + ".label" ) ; b . textContent = a ; ( a = this . cssConfig _ . label ) && addClass$$module$build$src$core$utils$dom ( b , a ) ; return b } refreshTheme ( ) { this . colour _ = this . getColour _ ( this . toolboxItemDef _ ) ; this . addColourBorder _ ( this . colour _ ) } addColourBorder _ ( a ) { a && ( a = ToolboxCategory$$module$build$src$core$toolbox$category . borderWidth + "px solid " + ( a || "#ddd" ) , this . workspace _ . RTL ? this . rowDiv _ . style . borderRight =
a : this . rowDiv _ . style . borderLeft = a ) } getColour _ ( a ) { const b = a . categorystyle || a . categoryStyle ; if ( ( a = a . colour ) && b ) console . warn ( 'Toolbox category "' + this . name _ + '" must not have both a style and a colour' ) ; else { if ( b ) return this . getColourfromStyle _ ( b ) ; if ( a ) return this . parseColour _ ( a ) } return "" } getColourfromStyle _ ( a ) { var b = this . workspace _ . getTheme ( ) ; if ( a && b ) { if ( ( b = b . categoryStyles [ a ] ) && b . colour ) return this . parseColour _ ( b . colour ) ; console . warn ( 'Style "' + a + '" must exist and contain a colour value' ) } return "" } getClickTarget ( ) { return this . rowDiv _ } parseColour _ ( a ) { a =
replaceMessageReferences$$module$build$src$core$utils$parsing ( a ) ; if ( null == a || "" === a ) return "" ; var b = Number ( a ) ; if ( isNaN ( b ) ) { if ( b = parse$$module$build$src$core$utils$colour ( a ) ) return b ; console . warn ( 'Toolbox category "' + this . name _ + '" has unrecognized colour attribute: ' + a ) ; return "" } return hueToHex$$module$build$src$core$utils$colour ( b ) } openIcon _ ( a ) { if ( a ) { var b = this . cssConfig _ . closedicon ; b && removeClasses$$module$build$src$core$utils$dom ( a , b ) ; ( b = this . cssConfig _ . openicon ) && addClass$$module$build$src$core$utils$dom ( a ,
b ) } } closeIcon _ ( a ) { if ( a ) { var b = this . cssConfig _ . openicon ; b && removeClasses$$module$build$src$core$utils$dom ( a , b ) ; ( b = this . cssConfig _ . closedicon ) && addClass$$module$build$src$core$utils$dom ( a , b ) } } setVisible _ ( a ) { this . htmlDiv _ . style . display = a ? "block" : "none" ; this . isHidden _ = ! a ; this . parentToolbox _ . getSelectedItem ( ) === this && this . parentToolbox _ . clearSelection ( ) } hide ( ) { this . setVisible _ ( ! 1 ) } show ( ) { this . setVisible _ ( ! 0 ) } isVisible ( ) { return ! this . isHidden _ && this . allAncestorsExpanded _ ( ) } allAncestorsExpanded _ ( ) { let a =
this ; for ( ; a . getParent ( ) ; ) if ( a = a . getParent ( ) , ! a . isExpanded ( ) ) return ! 1 ; return ! 0 } isSelectable ( ) { return this . isVisible ( ) && ! this . isDisabled _ } onClick ( a ) { } setSelected ( a ) { if ( this . rowDiv _ ) { var b = this . cssConfig _ . selected ; if ( a ) { const c = this . parseColour _ ( ToolboxCategory$$module$build$src$core$toolbox$category . defaultBackgroundColour ) ; this . rowDiv _ . style . backgroundColor = this . colour _ || c ; b && addClass$$module$build$src$core$utils$dom ( this . rowDiv _ , b ) } else this . rowDiv _ . style . backgroundColor = "" , b && removeClass$$module$build$src$core$utils$dom ( this . rowDiv _ ,
b ) ; setState$$module$build$src$core$utils$aria ( this . htmlDiv _ , State$$module$build$src$core$utils$aria . SELECTED , a ) } } setDisabled ( a ) { this . isDisabled _ = a ; this . getDiv ( ) . setAttribute ( "disabled" , ` ${ a } ` ) ; a ? this . getDiv ( ) . setAttribute ( "disabled" , "true" ) : this . getDiv ( ) . removeAttribute ( "disabled" ) } getName ( ) { return this . name _ } getParent ( ) { return this . parent _ } getDiv ( ) { return this . htmlDiv _ } getContents ( ) { return this . flyoutItems _ } updateFlyoutContents ( a ) { this . flyoutItems _ = [ ] ; this . toolboxItemDef _ = "string" === typeof a ? { kind : this . toolboxItemDef _ . kind ,
custom : a , id : this . toolboxItemDef _ . id , categorystyle : this . toolboxItemDef _ . categorystyle , colour : this . toolboxItemDef _ . colour , cssconfig : this . toolboxItemDef _ . cssconfig , hidden : this . toolboxItemDef _ . hidden } : { kind : this . toolboxItemDef _ . kind , name : "name" in this . toolboxItemDef _ ? this . toolboxItemDef _ . name : "" , contents : convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox ( a ) , id : this . toolboxItemDef _ . id , categorystyle : this . toolboxItemDef _ . categorystyle , colour : this . toolboxItemDef _ . colour , cssconfig : this . toolboxItemDef _ . cssconfig ,
hidden : this . toolboxItemDef _ . hidden } ; this . parseContents _ ( this . toolboxItemDef _ ) } dispose ( ) { removeNode$$module$build$src$core$utils$dom ( this . htmlDiv _ ) } } ; ToolboxCategory$$module$build$src$core$toolbox$category . registrationName = "category" ; ToolboxCategory$$module$build$src$core$toolbox$category . nestedPadding = 19 ; ToolboxCategory$$module$build$src$core$toolbox$category . borderWidth = 8 ; ToolboxCategory$$module$build$src$core$toolbox$category . defaultBackgroundColour = "#57e" ; register$$module$build$src$core$css ( '\n.blocklyTreeRow:not(.blocklyTreeSelected):hover {\n background-color: rgba(255, 255, 255, .2);\n}\n\n.blocklyToolboxDiv[layout="h"] .blocklyToolboxCategory {\n margin: 1px 5px 1px 0;\n}\n\n.blocklyToolboxDiv[dir="RTL"][layout="h"] .blocklyToolboxCategory {\n margin: 1px 0 1px 5px;\n}\n\n.blocklyTreeRow {\n height: 22px;\n line-height: 22px;\n margin-bottom: 3px;\n padding-right: 8px;\n white-space: nowrap;\n}\n\n.blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {\n margin-left: 8px;\n padding-right: 0;\n}\n\n.blocklyTreeIcon {\n background-image: url(<<<PATH>>>/sprites.png);\n height: 16px;\n vertical-align: middle;\n visibility: hidden;\n width: 16px;\n}\n\n.blocklyTreeIconClosed {\n background-position: -32px -1px;\n}\n\n.blocklyToolboxDiv[dir="RTL"] .blocklyTreeIconClosed {\n background-position: 0 -1px;\n}\n\n.blocklyTreeSelected>.blocklyTreeIconClosed {\n background-position: -32px -17px;\n}\n\n.blocklyToolboxDiv[dir="RTL"] .blocklyTreeSelected>.blocklyTreeIconClosed {\n background-position: 0 -17px;\n}\n\n.blocklyTreeIconOpen {\n background-position: -16px -1px;\n}\n\n.blocklyTreeSelected>.blocklyTreeIconOpen {\n background-position: -16px -17px;\n}\n\n.blocklyTreeLabel {\n cursor: default;\n font: 16px sans-serif;\n padding: 0 3px;\n vertical-align: middle;\n}\n\n.blocklyToolboxDelete .blocklyTreeLabel {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyTreeSelected .blocklyTreeLabel {\n color: #fff;\n}\n' ) ;
register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . TOOLBOX _ITEM , ToolboxCategory$$module$build$src$core$toolbox$category . registrationName , ToolboxCategory$$module$build$src$core$toolbox$category ) ; var module$build$src$core$toolbox$category = { } ; module$build$src$core$toolbox$category . ToolboxCategory = ToolboxCategory$$module$build$src$core$toolbox$category ; var ToolboxSeparator$$module$build$src$core$toolbox$separator = class extends ToolboxItem$$module$build$src$core$toolbox$toolbox _item { constructor ( a , b ) { super ( a , b ) ; this . cssConfig _ = { container : "blocklyTreeSeparator" } ; this . htmlDiv _ = null ; Object . assign ( this . cssConfig _ , a . cssconfig || a . cssConfig ) } init ( ) { this . createDom _ ( ) } createDom _ ( ) { const a = document . createElement ( "div" ) , b = this . cssConfig _ . container ; b && addClass$$module$build$src$core$utils$dom ( a , b ) ; return this . htmlDiv _ = a } getDiv ( ) { return this . htmlDiv _ } dispose ( ) { removeNode$$module$build$src$core$utils$dom ( this . htmlDiv _ ) } } ;
ToolboxSeparator$$module$build$src$core$toolbox$separator . registrationName = "sep" ; register$$module$build$src$core$css ( '\n.blocklyTreeSeparator {\n border-bottom: solid #e5e5e5 1px;\n height: 0;\n margin: 5px 0;\n}\n\n.blocklyToolboxDiv[layout="h"] .blocklyTreeSeparator {\n border-right: solid #e5e5e5 1px;\n border-bottom: none;\n height: auto;\n margin: 0 5px 0 5px;\n padding: 5px 0;\n width: 0;\n}\n' ) ;
register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . TOOLBOX _ITEM , ToolboxSeparator$$module$build$src$core$toolbox$separator . registrationName , ToolboxSeparator$$module$build$src$core$toolbox$separator ) ; var module$build$src$core$toolbox$separator = { } ; module$build$src$core$toolbox$separator . ToolboxSeparator = ToolboxSeparator$$module$build$src$core$toolbox$separator ; var CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible _category = class extends ToolboxCategory$$module$build$src$core$toolbox$category { constructor ( a , b , c ) { super ( a , b , c ) ; this . subcategoriesDiv _ = null ; this . expanded _ = ! 1 ; this . toolboxItems _ = [ ] } makeDefaultCssConfig _ ( ) { const a = super . makeDefaultCssConfig _ ( ) ; a . contents = "blocklyToolboxContents" ; return a } parseContents _ ( a ) { const b = a . contents ; let c = ! 0 ; if ( a . custom ) this . flyoutItems _ = a . custom ; else if ( b ) for ( a = 0 ; a < b . length ; a ++ ) { const d = b [ a ] ; ! hasItem$$module$build$src$core$registry ( Type$$module$build$src$core$registry . TOOLBOX _ITEM ,
d . kind ) || d . kind . toLowerCase ( ) === ToolboxSeparator$$module$build$src$core$toolbox$separator . registrationName && c ? ( this . flyoutItems _ . push ( d ) , c = ! 0 ) : ( this . createToolboxItem _ ( d ) , c = ! 1 ) } } createToolboxItem _ ( a ) { let b = a . kind ; "CATEGORY" === b . toUpperCase ( ) && isCategoryCollapsible$$module$build$src$core$utils$toolbox ( a ) && ( b = CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible _category . registrationName ) ; a = new ( getClass$$module$build$src$core$registry ( Type$$module$build$src$core$registry . TOOLBOX _ITEM ,
b ) ) ( a , this . parentToolbox _ , this ) ; this . toolboxItems _ . push ( a ) } init ( ) { super . init ( ) ; this . setExpanded ( "true" === this . toolboxItemDef _ . expanded || this . toolboxItemDef _ . expanded ) } createDom _ ( ) { super . createDom _ ( ) ; const a = this . getChildToolboxItems ( ) ; this . subcategoriesDiv _ = this . createSubCategoriesDom _ ( a ) ; setRole$$module$build$src$core$utils$aria ( this . subcategoriesDiv _ , Role$$module$build$src$core$utils$aria . GROUP ) ; this . htmlDiv _ . appendChild ( this . subcategoriesDiv _ ) ; return this . htmlDiv _ } createIconDom _ ( ) { const a = document . createElement ( "span" ) ;
if ( ! this . parentToolbox _ . isHorizontal ( ) ) { const b = this . cssConfig _ . icon ; b && addClass$$module$build$src$core$utils$dom ( a , b ) ; a . style . visibility = "visible" } a . style . display = "inline-block" ; return a } createSubCategoriesDom _ ( a ) { const b = document . createElement ( "div" ) ; var c = this . cssConfig _ . contents ; c && addClass$$module$build$src$core$utils$dom ( b , c ) ; for ( c = 0 ; c < a . length ; c ++ ) { const d = a [ c ] ; d . init ( ) ; const e = d . getDiv ( ) ; b . appendChild ( e ) ; if ( d . getClickTarget ) { let f ; null == ( f = d . getClickTarget ( ) ) || f . setAttribute ( "id" , d . getId ( ) ) } } return b } setExpanded ( a ) { this . expanded _ !==
a && ( ( this . expanded _ = a ) ? ( this . subcategoriesDiv _ . style . display = "block" , this . openIcon _ ( this . iconDom _ ) ) : ( this . subcategoriesDiv _ . style . display = "none" , this . closeIcon _ ( this . iconDom _ ) ) , setState$$module$build$src$core$utils$aria ( this . htmlDiv _ , State$$module$build$src$core$utils$aria . EXPANDED , a ) , this . parentToolbox _ . handleToolboxItemResize ( ) ) } setVisible _ ( a ) { this . htmlDiv _ . style . display = a ? "block" : "none" ; const b = this . getChildToolboxItems ( ) ; for ( let c = 0 ; c < b . length ; c ++ ) b [ c ] . setVisible _ ( a ) ; this . isHidden _ = ! a ; this . parentToolbox _ . getSelectedItem ( ) ===
this && this . parentToolbox _ . clearSelection ( ) } isExpanded ( ) { return this . expanded _ } isCollapsible ( ) { return ! 0 } onClick ( a ) { this . toggleExpanded ( ) } toggleExpanded ( ) { this . setExpanded ( ! this . expanded _ ) } getDiv ( ) { return this . htmlDiv _ } getChildToolboxItems ( ) { return this . toolboxItems _ } } ; CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible _category . registrationName = "collapsibleCategory" ;
register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . TOOLBOX _ITEM , CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible _category . registrationName , CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible _category ) ; var module$build$src$core$toolbox$collapsible _category = { } ; module$build$src$core$toolbox$collapsible _category . CollapsibleToolboxCategory = CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible _category ; var Toolbox$$module$build$src$core$toolbox$toolbox = class extends DeleteArea$$module$build$src$core$delete _area { constructor ( a ) { super ( ) ; this . id = "toolbox" ; this . contentsDiv _ = this . HtmlDiv = null ; this . isVisible _ = ! 1 ; this . contents _ = [ ] ; this . height _ = this . width _ = 0 ; this . previouslySelectedItem _ = this . selectedItem _ = this . flyout _ = null ; this . boundEvents _ = [ ] ; this . workspace _ = a ; this . toolboxDef _ = a . options . languageTree || { contents : [ ] } ; this . horizontalLayout _ = a . options . horizontalLayout ; this . RTL = a . options . RTL ; this . contentMap _ =
Object . create ( null ) ; this . toolboxPosition = a . options . toolboxPosition } onShortcut ( a ) { return ! 1 } init ( ) { var a = this . workspace _ ; const b = a . getParentSvg ( ) ; this . flyout _ = this . createFlyout _ ( ) ; this . HtmlDiv = this . createDom _ ( this . workspace _ ) ; insertAfter$$module$build$src$core$utils$dom ( this . flyout _ . createDom ( "svg" ) , b ) ; this . setVisible ( ! 0 ) ; this . flyout _ . init ( a ) ; this . render ( this . toolboxDef _ ) ; a = a . getThemeManager ( ) ; a . subscribe ( this . HtmlDiv , "toolboxBackgroundColour" , "background-color" ) ; a . subscribe ( this . HtmlDiv , "toolboxForegroundColour" ,
"color" ) ; this . workspace _ . getComponentManager ( ) . addComponent ( { component : this , weight : 1 , capabilities : [ ComponentManager$$module$build$src$core$component _manager . Capability . AUTOHIDEABLE , ComponentManager$$module$build$src$core$component _manager . Capability . DELETE _AREA , ComponentManager$$module$build$src$core$component _manager . Capability . DRAG _TARGET ] } ) } createDom _ ( a ) { a = a . getParentSvg ( ) ; const b = this . createContainer _ ( ) ; this . contentsDiv _ = this . createContentsContainer _ ( ) ; this . contentsDiv _ . tabIndex = 0 ; setRole$$module$build$src$core$utils$aria ( this . contentsDiv _ ,
Role$$module$build$src$core$utils$aria . TREE ) ; b . appendChild ( this . contentsDiv _ ) ; a . parentNode . insertBefore ( b , a ) ; this . attachEvents _ ( b , this . contentsDiv _ ) ; return b } createContainer _ ( ) { const a = document . createElement ( "div" ) ; a . setAttribute ( "layout" , this . isHorizontal ( ) ? "h" : "v" ) ; addClass$$module$build$src$core$utils$dom ( a , "blocklyToolboxDiv" ) ; addClass$$module$build$src$core$utils$dom ( a , "blocklyNonSelectable" ) ; a . setAttribute ( "dir" , this . RTL ? "RTL" : "LTR" ) ; return a } createContentsContainer _ ( ) { const a = document . createElement ( "div" ) ;
addClass$$module$build$src$core$utils$dom ( a , "blocklyToolboxContents" ) ; this . isHorizontal ( ) && ( a . style . flexDirection = "row" ) ; return a } attachEvents _ ( a , b ) { a = conditionalBind$$module$build$src$core$browser _events ( a , "click" , this , this . onClick _ , ! 1 , ! 0 ) ; this . boundEvents _ . push ( a ) ; b = conditionalBind$$module$build$src$core$browser _events ( b , "keydown" , this , this . onKeyDown _ , ! 1 , ! 0 ) ; this . boundEvents _ . push ( b ) } onClick _ ( a ) { if ( isRightButton$$module$build$src$core$browser _events ( a ) || a . target === this . HtmlDiv ) getMainWorkspace$$module$build$src$core$common ( ) . hideChaff ( ! 1 ) ;
else { var b = a . target . getAttribute ( "id" ) ; b && ( b = this . getToolboxItemById ( b ) , b . isSelectable ( ) && ( this . setSelectedItem ( b ) , b . onClick ( a ) ) ) ; getMainWorkspace$$module$build$src$core$common ( ) . hideChaff ( ! 0 ) } clearTouchIdentifier$$module$build$src$core$touch ( ) } onKeyDown _ ( a ) { let b = ! 1 ; switch ( a . keyCode ) { case KeyCodes$$module$build$src$core$utils$keycodes . DOWN : b = this . selectNext _ ( ) ; break ; case KeyCodes$$module$build$src$core$utils$keycodes . UP : b = this . selectPrevious _ ( ) ; break ; case KeyCodes$$module$build$src$core$utils$keycodes . LEFT : b =
this . selectParent _ ( ) ; break ; case KeyCodes$$module$build$src$core$utils$keycodes . RIGHT : b = this . selectChild _ ( ) ; break ; case KeyCodes$$module$build$src$core$utils$keycodes . ENTER : case KeyCodes$$module$build$src$core$utils$keycodes . SPACE : this . selectedItem _ && this . selectedItem _ . isCollapsible ( ) && ( this . selectedItem _ . toggleExpanded ( ) , b = ! 0 ) ; break ; default : b = ! 1 } if ( ! b && this . selectedItem _ ) { const c = this . selectedItem _ ; c . onKeyDown && ( b = c . onKeyDown ( a ) ) } b && a . preventDefault ( ) } createFlyout _ ( ) { const a = this . workspace _ , b = new Options$$module$build$src$core$options ( { parentWorkspace : a ,
rtl : a . RTL , oneBasedIndex : a . options . oneBasedIndex , horizontalLayout : a . horizontalLayout , renderer : a . options . renderer , rendererOverrides : a . options . rendererOverrides , move : { scrollbars : ! 0 } } ) ; b . toolboxPosition = a . options . toolboxPosition ; return new ( a . horizontalLayout ? getClassFromOptions$$module$build$src$core$registry ( Type$$module$build$src$core$registry . FLYOUTS _HORIZONTAL _TOOLBOX , a . options , ! 0 ) : getClassFromOptions$$module$build$src$core$registry ( Type$$module$build$src$core$registry . FLYOUTS _VERTICAL _TOOLBOX , a . options ,
! 0 ) ) ( b ) } render ( a ) { this . toolboxDef _ = a ; for ( let b = 0 ; b < this . contents _ . length ; b ++ ) { const c = this . contents _ [ b ] ; c && c . dispose ( ) } this . contents _ = [ ] ; this . contentMap _ = Object . create ( null ) ; this . renderContents _ ( a . contents ) ; this . position ( ) ; this . handleToolboxItemResize ( ) } renderContents _ ( a ) { const b = document . createDocumentFragment ( ) ; for ( let c = 0 ; c < a . length ; c ++ ) this . createToolboxItem _ ( a [ c ] , b ) ; this . contentsDiv _ . appendChild ( b ) } createToolboxItem _ ( a , b ) { var c = a . kind ; "CATEGORY" === c . toUpperCase ( ) && isCategoryCollapsible$$module$build$src$core$utils$toolbox ( a ) &&
( c = CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible _category . registrationName ) ; if ( c = getClass$$module$build$src$core$registry ( Type$$module$build$src$core$registry . TOOLBOX _ITEM , c . toLowerCase ( ) ) ) a = new c ( a , this ) , a . init ( ) , this . addToolboxItem _ ( a ) , ( c = a . getDiv ( ) ) && b . appendChild ( c ) , a . getClickTarget ( ) && a . getClickTarget ( ) . setAttribute ( "id" , a . getId ( ) ) } addToolboxItem _ ( a ) { this . contents _ . push ( a ) ; this . contentMap _ [ a . getId ( ) ] = a ; if ( a . isCollapsible ( ) ) { a = a . getChildToolboxItems ( ) ; for ( let b = 0 ; b < a . length ; b ++ ) this . addToolboxItem _ ( a [ b ] ) } } getToolboxItems ( ) { return this . contents _ } addStyle ( a ) { a &&
this . HtmlDiv && addClass$$module$build$src$core$utils$dom ( this . HtmlDiv , a ) } removeStyle ( a ) { a && this . HtmlDiv && removeClass$$module$build$src$core$utils$dom ( this . HtmlDiv , a ) } getClientRect ( ) { if ( ! this . HtmlDiv || ! this . isVisible _ ) return null ; var a = this . HtmlDiv . getBoundingClientRect ( ) ; const b = a . top , c = b + a . height , d = a . left ; a = d + a . width ; return this . toolboxPosition === Position$$module$build$src$core$utils$toolbox . TOP ? new Rect$$module$build$src$core$utils$rect ( - 1E7 , c , - 1E7 , 1E7 ) : this . toolboxPosition === Position$$module$build$src$core$utils$toolbox . BOTTOM ?
new Rect$$module$build$src$core$utils$rect ( b , 1E7 , - 1E7 , 1E7 ) : this . toolboxPosition === Position$$module$build$src$core$utils$toolbox . LEFT ? new Rect$$module$build$src$core$utils$rect ( - 1E7 , 1E7 , - 1E7 , a ) : new Rect$$module$build$src$core$utils$rect ( - 1E7 , 1E7 , d , 1E7 ) } wouldDelete ( a , b ) { a instanceof BlockSvg$$module$build$src$core$block _svg ? this . updateWouldDelete _ ( ! a . getParent ( ) && a . isDeletable ( ) ) : this . updateWouldDelete _ ( a . isDeletable ( ) ) ; return this . wouldDelete _ } onDragEnter ( a ) { this . updateCursorDeleteStyle _ ( ! 0 ) } onDragExit ( a ) { this . updateCursorDeleteStyle _ ( ! 1 ) } onDrop ( a ) { this . updateCursorDeleteStyle _ ( ! 1 ) } updateWouldDelete _ ( a ) { a !==
this . wouldDelete _ && ( this . updateCursorDeleteStyle _ ( ! 1 ) , this . wouldDelete _ = a , this . updateCursorDeleteStyle _ ( ! 0 ) ) } updateCursorDeleteStyle _ ( a ) { const b = this . wouldDelete _ ? "blocklyToolboxDelete" : "blocklyToolboxGrab" ; a ? this . addStyle ( b ) : this . removeStyle ( b ) } getToolboxItemById ( a ) { return this . contentMap _ [ a ] || null } getWidth ( ) { return this . width _ } getHeight ( ) { return this . height _ } getFlyout ( ) { return this . flyout _ } getWorkspace ( ) { return this . workspace _ } getSelectedItem ( ) { return this . selectedItem _ } getPreviouslySelectedItem ( ) { return this . previouslySelectedItem _ } isHorizontal ( ) { return this . horizontalLayout _ } position ( ) { const a =
this . workspace _ . getMetrics ( ) , b = this . HtmlDiv ; b && ( this . horizontalLayout _ ? ( b . style . left = "0" , b . style . height = "auto" , b . style . width = "100%" , this . height _ = b . offsetHeight , this . width _ = a . viewWidth , this . toolboxPosition === Position$$module$build$src$core$utils$toolbox . TOP ? b . style . top = "0" : b . style . bottom = "0" ) : ( this . toolboxPosition === Position$$module$build$src$core$utils$toolbox . RIGHT ? b . style . right = "0" : b . style . left = "0" , b . style . height = "100%" , this . width _ = b . offsetWidth , this . height _ = a . viewHeight ) , this . flyout _ . position ( ) ) } handleToolboxItemResize ( ) { const a =
this . workspace _ , b = this . HtmlDiv . getBoundingClientRect ( ) ; a . translate ( this . toolboxPosition === Position$$module$build$src$core$utils$toolbox . LEFT ? a . scrollX + b . width : a . scrollX , this . toolboxPosition === Position$$module$build$src$core$utils$toolbox . TOP ? a . scrollY + b . height : a . scrollY ) ; svgResize$$module$build$src$core$common ( a ) } clearSelection ( ) { this . setSelectedItem ( null ) } refreshTheme ( ) { for ( let a = 0 ; a < this . contents _ . length ; a ++ ) { const b = this . contents _ [ a ] ; b . refreshTheme && b . refreshTheme ( ) } } refreshSelection ( ) { this . selectedItem _ &&
this . selectedItem _ . isSelectable ( ) && this . selectedItem _ . getContents ( ) . length && this . flyout _ . show ( this . selectedItem _ . getContents ( ) ) } setVisible ( a ) { this . isVisible _ !== a && ( this . HtmlDiv . style . display = a ? "block" : "none" , this . isVisible _ = a , this . workspace _ . recordDragTargets ( ) ) } autoHide ( a ) { ! a && this . flyout _ && this . flyout _ . autoClose && this . clearSelection ( ) } setSelectedItem ( a ) { const b = this . selectedItem _ ; ! a && ! b || a && ! a . isSelectable ( ) || ( this . shouldDeselectItem _ ( b , a ) && null !== b && this . deselectItem _ ( b ) , this . shouldSelectItem _ ( b ,
a ) && null !== a && this . selectItem _ ( b , a ) , this . updateFlyout _ ( b , a ) , this . fireSelectEvent _ ( b , a ) ) } shouldDeselectItem _ ( a , b ) { return null !== a && ( ! a . isCollapsible ( ) || a !== b ) } shouldSelectItem _ ( a , b ) { return null !== b && b !== a } deselectItem _ ( a ) { this . selectedItem _ = null ; this . previouslySelectedItem _ = a ; a . setSelected ( ! 1 ) ; setState$$module$build$src$core$utils$aria ( this . contentsDiv _ , State$$module$build$src$core$utils$aria . ACTIVEDESCENDANT , "" ) } selectItem _ ( a , b ) { this . selectedItem _ = b ; this . previouslySelectedItem _ = a ; b . setSelected ( ! 0 ) ;
setState$$module$build$src$core$utils$aria ( this . contentsDiv _ , State$$module$build$src$core$utils$aria . ACTIVEDESCENDANT , b . getId ( ) ) } selectItemByPosition ( a ) { - 1 < a && a < this . contents _ . length && ( a = this . contents _ [ a ] , a . isSelectable ( ) && this . setSelectedItem ( a ) ) } updateFlyout _ ( a , b ) { b && ( a !== b || b . isCollapsible ( ) ) && b . getContents ( ) . length ? ( this . flyout _ . show ( b . getContents ( ) ) , this . flyout _ . scrollToStart ( ) ) : this . flyout _ . hide ( ) } fireSelectEvent _ ( a , b ) { const c = a && a . getName ( ) ; let d = b && b . getName ( ) ; a === b && ( d = null ) ; a = new ( get$$module$build$src$core$events$utils ( TOOLBOX _ITEM _SELECT$$module$build$src$core$events$utils ) ) ( c ,
d , this . workspace _ . id ) ; fire$$module$build$src$core$events$utils ( a ) } selectParent _ ( ) { return this . selectedItem _ ? this . selectedItem _ . isCollapsible ( ) && this . selectedItem _ . isExpanded ( ) ? ( this . selectedItem _ . toggleExpanded ( ) , ! 0 ) : this . selectedItem _ . getParent ( ) && this . selectedItem _ . getParent ( ) . isSelectable ( ) ? ( this . setSelectedItem ( this . selectedItem _ . getParent ( ) ) , ! 0 ) : ! 1 : ! 1 } selectChild _ ( ) { if ( ! this . selectedItem _ || ! this . selectedItem _ . isCollapsible ( ) ) return ! 1 ; const a = this . selectedItem _ ; a . isExpanded ( ) ? this . selectNext _ ( ) :
a . toggleExpanded ( ) ; return ! 0 } selectNext _ ( ) { if ( ! this . selectedItem _ ) return ! 1 ; let a = this . contents _ . indexOf ( this . selectedItem _ ) + 1 ; if ( - 1 < a && a < this . contents _ . length ) { let b = this . contents _ [ a ] ; for ( ; b && ! b . isSelectable ( ) ; ) b = this . contents _ [ ++ a ] ; if ( b && b . isSelectable ( ) ) return this . setSelectedItem ( b ) , ! 0 } return ! 1 } selectPrevious _ ( ) { if ( ! this . selectedItem _ ) return ! 1 ; let a = this . contents _ . indexOf ( this . selectedItem _ ) - 1 ; if ( - 1 < a && a < this . contents _ . length ) { let b = this . contents _ [ a ] ; for ( ; b && ! b . isSelectable ( ) ; ) b = this . contents _ [ -- a ] ;
if ( b && b . isSelectable ( ) ) return this . setSelectedItem ( b ) , ! 0 } return ! 1 } dispose ( ) { this . workspace _ . getComponentManager ( ) . removeComponent ( "toolbox" ) ; this . flyout _ . dispose ( ) ; for ( var a = 0 ; a < this . contents _ . length ; a ++ ) this . contents _ [ a ] . dispose ( ) ; for ( a = 0 ; a < this . boundEvents _ . length ; a ++ ) unbind$$module$build$src$core$browser _events ( this . boundEvents _ [ a ] ) ; this . boundEvents _ = [ ] ; this . contents _ = [ ] ; this . workspace _ . getThemeManager ( ) . unsubscribe ( this . HtmlDiv ) ; removeNode$$module$build$src$core$utils$dom ( this . HtmlDiv ) } } ; register$$module$build$src$core$css ( '\n.blocklyToolboxDelete {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxGrab {\n cursor: url("<<<PATH>>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Category tree in Toolbox. */\n.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' ) ;
register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . TOOLBOX , DEFAULT$$module$build$src$core$registry , Toolbox$$module$build$src$core$toolbox$toolbox ) ; var module$build$src$core$toolbox$toolbox = { } ; module$build$src$core$toolbox$toolbox . Toolbox = Toolbox$$module$build$src$core$toolbox$toolbox ; var defaultBlockStyles$$module$build$src$core$theme$zelos = { colour _blocks : { colourPrimary : "#CF63CF" , colourSecondary : "#C94FC9" , colourTertiary : "#BD42BD" } , list _blocks : { colourPrimary : "#9966FF" , colourSecondary : "#855CD6" , colourTertiary : "#774DCB" } , logic _blocks : { colourPrimary : "#4C97FF" , colourSecondary : "#4280D7" , colourTertiary : "#3373CC" } , loop _blocks : { colourPrimary : "#0fBD8C" , colourSecondary : "#0DA57A" , colourTertiary : "#0B8E69" } , math _blocks : { colourPrimary : "#59C059" , colourSecondary : "#46B946" , colourTertiary : "#389438" } ,
procedure _blocks : { colourPrimary : "#FF6680" , colourSecondary : "#FF4D6A" , colourTertiary : "#FF3355" } , text _blocks : { colourPrimary : "#FFBF00" , colourSecondary : "#E6AC00" , colourTertiary : "#CC9900" } , variable _blocks : { colourPrimary : "#FF8C1A" , colourSecondary : "#FF8000" , colourTertiary : "#DB6E00" } , variable _dynamic _blocks : { colourPrimary : "#FF8C1A" , colourSecondary : "#FF8000" , colourTertiary : "#DB6E00" } , hat _blocks : { colourPrimary : "#4C97FF" , colourSecondary : "#4280D7" , colourTertiary : "#3373CC" , hat : "cap" } } , categoryStyles$$module$build$src$core$theme$zelos =
{ colour _category : { colour : "#CF63CF" } , list _category : { colour : "#9966FF" } , logic _category : { colour : "#4C97FF" } , loop _category : { colour : "#0fBD8C" } , math _category : { colour : "#59C059" } , procedure _category : { colour : "#FF6680" } , text _category : { colour : "#FFBF00" } , variable _category : { colour : "#FF8C1A" } , variable _dynamic _category : { colour : "#FF8C1A" } } , Zelos$$module$build$src$core$theme$zelos = new Theme$$module$build$src$core$theme ( "zelos" , defaultBlockStyles$$module$build$src$core$theme$zelos , categoryStyles$$module$build$src$core$theme$zelos ) ,
module$build$src$core$theme$zelos = { } ; module$build$src$core$theme$zelos . Zelos = Zelos$$module$build$src$core$theme$zelos ; var module$build$src$core$theme$themes = { } ; module$build$src$core$theme$themes . Classic = Classic$$module$build$src$core$theme$classic ; module$build$src$core$theme$themes . Zelos = Zelos$$module$build$src$core$theme$zelos ; 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 } fromJson ( a ) { super . fromJson ( a ) ;
this . targetType = a . targetType ; this . blockId = a . blockId } } , 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 BubbleDragger$$module$build$src$core$bubble _dragger = class { constructor ( a , b ) { this . bubble = a ; this . workspace = b ; this . dragTarget _ = null ; this . wouldDeleteBubble _ = ! 1 ; this . startXY _ = this . bubble . getRelativeToSurfaceXY ( ) ; this . dragSurface _ = b . getBlockDragSurface ( ) } startBubbleDrag ( ) { getGroup$$module$build$src$core$events$utils ( ) || setGroup$$module$build$src$core$events$utils ( ! 0 ) ; this . workspace . setResizesEnabled ( ! 1 ) ; this . bubble . setAutoLayout ( ! 1 ) ; this . dragSurface _ && ( this . bubble . moveTo ( 0 , 0 ) , this . dragSurface _ . translateSurface ( this . startXY _ . x ,
this . startXY _ . y ) , this . dragSurface _ . setBlocksAndShow ( this . bubble . getSvgRoot ( ) ) ) ; this . bubble . setDragging && this . bubble . setDragging ( ! 0 ) } dragBubble ( a , b ) { b = this . pixelsToWorkspaceUnits _ ( b ) ; b = Coordinate$$module$build$src$core$utils$coordinate . sum ( this . startXY _ , b ) ; this . bubble . moveDuringDrag ( this . dragSurface _ , b ) ; b = this . dragTarget _ ; this . dragTarget _ = this . workspace . getDragTarget ( a ) ; a = this . wouldDeleteBubble _ ; this . wouldDeleteBubble _ = this . shouldDelete _ ( this . dragTarget _ ) ; a !== this . wouldDeleteBubble _ && this . updateCursorDuringBubbleDrag _ ( ) ;
this . dragTarget _ !== b && ( b && b . onDragExit ( this . bubble ) , this . dragTarget _ && this . dragTarget _ . onDragEnter ( this . bubble ) ) ; this . dragTarget _ && this . dragTarget _ . onDragOver ( this . bubble ) } shouldDelete _ ( a ) { return a && this . workspace . getComponentManager ( ) . hasCapability ( a . id , ComponentManager$$module$build$src$core$component _manager . Capability . DELETE _AREA ) ? a . wouldDelete ( this . bubble , ! 1 ) : ! 1 } updateCursorDuringBubbleDrag _ ( ) { this . bubble . setDeleteStyle ( this . wouldDeleteBubble _ ) } endBubbleDrag ( a , b ) { this . dragBubble ( a , b ) ; this . dragTarget _ &&
this . dragTarget _ . shouldPreventMove ( this . bubble ) ? a = this . startXY _ : ( a = this . pixelsToWorkspaceUnits _ ( b ) , a = Coordinate$$module$build$src$core$utils$coordinate . sum ( this . startXY _ , a ) ) ; this . bubble . moveTo ( a . x , a . y ) ; if ( this . dragTarget _ ) this . dragTarget _ . onDrop ( this . bubble ) ; this . wouldDeleteBubble _ ? ( this . fireMoveEvent _ ( ) , this . bubble . dispose ( ) ) : ( this . dragSurface _ && this . dragSurface _ . clearAndHide ( this . workspace . getBubbleCanvas ( ) ) , this . bubble . setDragging && this . bubble . setDragging ( ! 1 ) , this . fireMoveEvent _ ( ) ) ; this . workspace . setResizesEnabled ( ! 0 ) ;
setGroup$$module$build$src$core$events$utils ( ! 1 ) } fireMoveEvent _ ( ) { if ( this . bubble instanceof WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg ) { const a = new ( get$$module$build$src$core$events$utils ( COMMENT _MOVE$$module$build$src$core$events$utils ) ) ( this . bubble ) ; a . setOldCoordinate ( this . startXY _ ) ; a . recordNew ( ) ; fire$$module$build$src$core$events$utils ( a ) } } pixelsToWorkspaceUnits _ ( a ) { a = new Coordinate$$module$build$src$core$utils$coordinate ( a . x / this . workspace . scale , a . y / this . workspace . scale ) ;
this . workspace . isMutator && a . scale ( 1 / this . workspace . options . parentWorkspace . scale ) ; return a } } , module$build$src$core$bubble _dragger = { } ; module$build$src$core$bubble _dragger . BubbleDragger = BubbleDragger$$module$build$src$core$bubble _dragger ; var WorkspaceDragger$$module$build$src$core$workspace _dragger = class { constructor ( a ) { this . workspace = a ; this . horizontalScrollEnabled _ = this . workspace . isMovableHorizontally ( ) ; this . verticalScrollEnabled _ = this . workspace . isMovableVertically ( ) ; this . startScrollXY _ = new Coordinate$$module$build$src$core$utils$coordinate ( a . scrollX , a . scrollY ) } dispose ( ) { this . workspace = null } startDrag ( ) { getSelected$$module$build$src$core$common ( ) && getSelected$$module$build$src$core$common ( ) . unselect ( ) ; this . workspace . setupDragSurface ( ) } endDrag ( a ) { this . drag ( a ) ;
this . workspace . resetDragSurface ( ) } drag ( a ) { a = Coordinate$$module$build$src$core$utils$coordinate . sum ( this . startScrollXY _ , a ) ; if ( this . horizontalScrollEnabled _ && this . verticalScrollEnabled _ ) this . workspace . scroll ( a . x , a . y ) ; else if ( this . horizontalScrollEnabled _ ) this . workspace . scroll ( a . x , this . workspace . scrollY ) ; else if ( this . verticalScrollEnabled _ ) this . workspace . scroll ( this . workspace . scrollX , a . y ) ; else throw new TypeError ( "Invalid state." ) ; } } , module$build$src$core$workspace _dragger = { } ;
module$build$src$core$workspace _dragger . WorkspaceDragger = WorkspaceDragger$$module$build$src$core$workspace _dragger ; var Gesture$$module$build$src$core$gesture = class { constructor ( a , b ) { this . creatorWorkspace = b ; this . mouseDownXY _ = new Coordinate$$module$build$src$core$utils$coordinate ( 0 , 0 ) ; this . startWorkspace _ = this . targetBlock _ = this . startBlock _ = this . startField _ = this . startBubble _ = null ; this . hasExceededDragRadius _ = ! 1 ; this . flyout _ = this . workspaceDragger _ = this . blockDragger _ = this . bubbleDragger _ = this . onUpWrapper _ = this . onMoveWrapper _ = null ; this . isEnding _ = this . hasStarted _ = this . calledUpdateIsDragging _ = ! 1 ; this . mostRecentEvent _ = a ;
this . currentDragDeltaXY _ = new Coordinate$$module$build$src$core$utils$coordinate ( 0 , 0 ) ; this . healStack _ = ! DRAG _STACK$$module$build$src$core$internal _constants } dispose ( ) { clearTouchIdentifier$$module$build$src$core$touch ( ) ; unblock$$module$build$src$core$tooltip ( ) ; this . creatorWorkspace . clearGesture ( ) ; this . onMoveWrapper _ && unbind$$module$build$src$core$browser _events ( this . onMoveWrapper _ ) ; this . onUpWrapper _ && unbind$$module$build$src$core$browser _events ( this . onUpWrapper _ ) ; this . blockDragger _ && this . blockDragger _ . dispose ( ) ;
this . workspaceDragger _ && this . workspaceDragger _ . dispose ( ) } updateFromEvent _ ( a ) { const b = new Coordinate$$module$build$src$core$utils$coordinate ( a . clientX , a . clientY ) ; this . updateDragDelta _ ( b ) && ( this . updateIsDragging _ ( ) , longStop$$module$build$src$core$touch ( ) ) ; this . mostRecentEvent _ = a } updateDragDelta _ ( a ) { this . currentDragDeltaXY _ = Coordinate$$module$build$src$core$utils$coordinate . difference ( a , this . mouseDownXY _ ) ; return this . hasExceededDragRadius _ ? ! 1 : this . hasExceededDragRadius _ = Coordinate$$module$build$src$core$utils$coordinate . magnitude ( this . currentDragDeltaXY _ ) >
( 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 _ = this . flyout _ . targetWorkspace , this . startWorkspace _ . updateScreenCalculationsIfScrolled ( ) , getGroup$$module$build$src$core$events$utils ( ) || setGroup$$module$build$src$core$events$utils ( ! 0 ) , this . startBlock _ = null , this . targetBlock _ = this . flyout _ . createBlock ( this . targetBlock _ ) , this . targetBlock _ . select ( ) , ! 0 ) : ! 1 } updateIsDraggingBubble _ ( ) { if ( ! this . startBubble _ ) return ! 1 ; this . startDraggingBubble _ ( ) ; return ! 0 } updateIsDraggingBlock _ ( ) { if ( ! this . targetBlock _ ) return ! 1 ; if ( this . flyout _ ) { if ( this . updateIsDraggingFromFlyout _ ( ) ) return this . startDraggingBlock _ ( ) ,
! 0 } else if ( this . targetBlock _ . isMovable ( ) ) return this . startDraggingBlock _ ( ) , ! 0 ; return ! 1 } updateIsDraggingWorkspace _ ( ) { if ( ! this . startWorkspace _ ) throw Error ( "Cannot update dragging the workspace because the start workspace is undefined" ) ; if ( this . flyout _ ? this . flyout _ . isScrollable ( ) : this . startWorkspace _ && this . startWorkspace _ . isDraggable ( ) ) this . workspaceDragger _ = new WorkspaceDragger$$module$build$src$core$workspace _dragger ( this . startWorkspace _ ) , this . workspaceDragger _ . startDrag ( ) } updateIsDragging _ ( ) { if ( this . calledUpdateIsDragging _ ) throw Error ( "updateIsDragging_ should only be called once per gesture." ) ;
this . calledUpdateIsDragging _ = ! 0 ; this . updateIsDraggingBubble _ ( ) || this . updateIsDraggingBlock _ ( ) || this . updateIsDraggingWorkspace _ ( ) } startDraggingBlock _ ( ) { this . blockDragger _ = new ( getClassFromOptions$$module$build$src$core$registry ( Type$$module$build$src$core$registry . BLOCK _DRAGGER , this . creatorWorkspace . options , ! 0 ) ) ( this . targetBlock _ , this . startWorkspace _ ) ; this . blockDragger _ . startDrag ( this . currentDragDeltaXY _ , this . healStack _ ) ; this . blockDragger _ . drag ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) } startDraggingBubble _ ( ) { if ( ! this . startBubble _ ) throw Error ( "Cannot update dragging the bubble because the start bubble is undefined" ) ;
if ( ! this . startWorkspace _ ) throw Error ( "Cannot update dragging the bubble because the start workspace is undefined" ) ; this . bubbleDragger _ = new BubbleDragger$$module$build$src$core$bubble _dragger ( this . startBubble _ , this . startWorkspace _ ) ; this . bubbleDragger _ . startBubbleDrag ( ) ; this . bubbleDragger _ . dragBubble ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) } doStart ( a ) { if ( isTargetInput$$module$build$src$core$browser _events ( a ) ) this . cancel ( ) ; else { if ( ! this . startWorkspace _ ) throw Error ( "Cannot start the gesture because the start workspace is undefined" ) ;
this . hasStarted _ = ! 0 ; disconnectUiStop$$module$build$src$core$block _animations ( ) ; this . startWorkspace _ . updateScreenCalculationsIfScrolled ( ) ; this . startWorkspace _ . isMutator && this . startWorkspace _ . resize ( ) ; this . startWorkspace _ . hideChaff ( ! ! this . flyout _ ) ; this . startWorkspace _ . markFocused ( ) ; this . mostRecentEvent _ = a ; block$$module$build$src$core$tooltip ( ) ; this . targetBlock _ && this . targetBlock _ . select ( ) ; isRightButton$$module$build$src$core$browser _events ( a ) ? this . handleRightClick ( a ) : ( "touchstart" !== a . type . toLowerCase ( ) &&
"pointerdown" !== a . type . toLowerCase ( ) || "mouse" === a . pointerType || longStart$$module$build$src$core$touch ( a , this ) , this . mouseDownXY _ = new Coordinate$$module$build$src$core$utils$coordinate ( a . clientX , a . clientY ) , this . healStack _ = a . altKey || a . ctrlKey || a . metaKey , this . bindMouseEvents ( a ) ) } } bindMouseEvents ( a ) { this . onMoveWrapper _ = conditionalBind$$module$build$src$core$browser _events ( document , "mousemove" , null , this . handleMove . bind ( this ) ) ; this . onUpWrapper _ = conditionalBind$$module$build$src$core$browser _events ( document ,
"mouseup" , null , this . handleUp . bind ( this ) ) ; a . preventDefault ( ) ; a . stopPropagation ( ) } handleMove ( a ) { this . updateFromEvent _ ( a ) ; this . workspaceDragger _ ? this . workspaceDragger _ . drag ( this . currentDragDeltaXY _ ) : this . blockDragger _ ? this . blockDragger _ . drag ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) : this . bubbleDragger _ && this . bubbleDragger _ . dragBubble ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) ; a . preventDefault ( ) ; a . stopPropagation ( ) } handleUp ( a ) { this . updateFromEvent _ ( a ) ; longStop$$module$build$src$core$touch ( ) ;
this . isEnding _ ? console . log ( "Trying to end a gesture recursively." ) : ( this . isEnding _ = ! 0 , this . bubbleDragger _ ? this . bubbleDragger _ . endBubbleDrag ( a , this . currentDragDeltaXY _ ) : this . blockDragger _ ? this . blockDragger _ . endDrag ( a , this . currentDragDeltaXY _ ) : this . workspaceDragger _ ? this . workspaceDragger _ . endDrag ( this . currentDragDeltaXY _ ) : this . isBubbleClick _ ( ) ? this . doBubbleClick _ ( ) : this . isFieldClick _ ( ) ? this . doFieldClick _ ( ) : this . isBlockClick _ ( ) ? this . doBlockClick _ ( ) : this . isWorkspaceClick _ ( ) && this . doWorkspaceClick _ ( a ) ,
a . preventDefault ( ) , a . stopPropagation ( ) , this . dispose ( ) ) } cancel ( ) { this . isEnding _ || ( longStop$$module$build$src$core$touch ( ) , this . bubbleDragger _ ? this . bubbleDragger _ . endBubbleDrag ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) : this . blockDragger _ ? this . blockDragger _ . endDrag ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) : 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 . startWorkspace _ && ! this . flyout _ && ( this . startWorkspace _ . hideChaff ( ) , this . startWorkspace _ . showContextMenu ( a ) ) ; a . preventDefault ( ) ; a . stopPropagation ( ) ; this . dispose ( ) } handleWsStart ( a , b ) { if ( this . hasStarted _ ) throw Error ( "Tried to call gesture.handleWsStart, but the gesture had already been started." ) ; this . setStartWorkspace _ ( b ) ; this . mostRecentEvent _ = a ; 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 . hasStarted _ ) 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 . hasStarted _ ) 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 . hasStarted _ ) throw Error ( "Tried to call gesture.handleBubbleStart, but the gesture had already been started." ) ;
this . setStartBubble ( b ) ; this . mostRecentEvent _ = a } doBubbleClick _ ( ) { this . startBubble _ instanceof WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg && ( this . startBubble _ . setFocus ( ) , this . startBubble _ . select ( ) ) } doFieldClick _ ( ) { if ( ! this . startField _ ) throw Error ( "Cannot do a field click because the start field is undefined" ) ; this . startField _ . showEditor ( this . mostRecentEvent _ ) ; this . bringBlockToFront _ ( ) } doBlockClick _ ( ) { if ( this . flyout _ && this . flyout _ . autoClose ) { if ( ! this . targetBlock _ ) throw Error ( "Cannot do a block click because the target block is undefined" ) ;
this . targetBlock _ . isEnabled ( ) && ( getGroup$$module$build$src$core$events$utils ( ) || setGroup$$module$build$src$core$events$utils ( ! 0 ) , this . flyout _ . createBlock ( this . targetBlock _ ) . scheduleSnapAndBump ( ) ) } else { if ( ! this . startWorkspace _ ) throw Error ( "Cannot do a block click because the start workspace is undefined" ) ; const 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 _ && ! this . flyout _ && this . targetBlock _ . bringToFront ( ) } setStartField ( a ) { if ( this . hasStarted _ ) throw Error ( "Tried to call gesture.setStartField, but the gesture had already been started." ) ; this . startField _ || ( this . startField _ = a ) } setStartBubble ( a ) { this . startBubble _ ||
( this . startBubble _ = a ) } setStartBlock ( a ) { this . startBlock _ || this . startBubble _ || ( this . startBlock _ = a , a . isInFlyout && a !== a . getRootBlock ( ) ? this . setTargetBlock _ ( a . getRootBlock ( ) ) : this . setTargetBlock _ ( a ) ) } setTargetBlock _ ( a ) { a . isShadow ( ) ? this . setTargetBlock _ ( a . getParent ( ) ) : this . targetBlock _ = a } setStartWorkspace _ ( a ) { this . startWorkspace _ || ( this . startWorkspace _ = a ) } setStartFlyout _ ( a ) { this . flyout _ || ( this . flyout _ = a ) } isBubbleClick _ ( ) { return ! ! this . startBubble _ && ! this . hasExceededDragRadius _ } isBlockClick _ ( ) { return ! ! this . startBlock _ &&
! this . hasExceededDragRadius _ && ! this . isFieldClick _ ( ) } isFieldClick _ ( ) { return ( this . startField _ ? this . startField _ . isClickable ( ) : ! 1 ) && ! this . hasExceededDragRadius _ && ( ! this . flyout _ || ! this . flyout _ . autoClose ) } isWorkspaceClick _ ( ) { return ! this . startBlock _ && ! this . startBubble _ && ! this . startField _ && ! this . hasExceededDragRadius _ } isDragging ( ) { return ! ! this . workspaceDragger _ || ! ! this . blockDragger _ || ! ! this . bubbleDragger _ } hasStarted ( ) { return this . hasStarted _ } getInsertionMarkers ( ) { return this . blockDragger _ ? this . blockDragger _ . getInsertionMarkers ( ) :
[ ] } getCurrentDragger ( ) { let a , b ; return null != ( b = null != ( a = this . blockDragger _ ) ? a : this . workspaceDragger _ ) ? b : this . bubbleDragger _ } 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 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 with name "' + a . name + '" already exists.' ) ; this . shortcuts . set ( a . name , a ) ; if ( ( b = a . keyCodes ) && 0 < b . length ) for ( let c = 0 ; c < b . length ; c ++ ) this . addKeyMapping ( b [ c ] , a . name , ! ! a . allowCollision ) } unregister ( a ) { if ( ! this . shortcuts . get ( a ) ) return console . warn ( 'Keyboard shortcut with name "' +
a + '" not found.' ) , ! 1 ; this . removeAllKeyMappings ( a ) ; this . shortcuts . delete ( a ) ; return ! 0 } addKeyMapping ( a , b , c ) { a = String ( a ) ; const d = this . keyMap . get ( a ) ; if ( d && ! c ) throw Error ( 'Shortcut with name "' + b + '" collides with shortcuts ' + d . toString ( ) ) ; d && c ? d . unshift ( b ) : this . keyMap . set ( a , [ b ] ) } removeKeyMapping ( a , b , c ) { const d = this . keyMap . get ( a ) ; if ( ! d ) return c || console . warn ( 'No keyboard shortcut with name "' + b + '" registered with key code "' + a + '"' ) , ! 1 ; const e = d . indexOf ( b ) ; if ( - 1 < e ) return d . splice ( e , 1 ) , 0 === d . length && this . keyMap . delete ( a ) ,
! 0 ; c || console . warn ( 'No keyboard shortcut with name "' + b + '" registered with key code "' + a + '"' ) ; return ! 1 } removeAllKeyMappings ( a ) { for ( const b of this . keyMap . keys ( ) ) this . removeKeyMapping ( b , a , ! 0 ) } setKeyMap ( a ) { this . keyMap . clear ( ) ; for ( const b in a ) this . keyMap . set ( b , a [ b ] ) } getKeyMap ( ) { const a = Object . create ( null ) ; for ( const [ b , c ] of this . keyMap ) a [ b ] = c ; return a } getRegistry ( ) { const a = Object . create ( null ) ; for ( const [ b , c ] of this . shortcuts ) a [ b ] = c ; return deepMerge$$module$build$src$core$utils$object ( Object . create ( null ) ,
a ) } onKeyDown ( a , b ) { var c = this . serializeKeyEvent _ ( b ) ; c = this . getShortcutNamesByKeyCode ( c ) ; if ( ! c ) return ! 1 ; for ( let d = 0 , e ; e = c [ d ] ; d ++ ) { const f = this . shortcuts . get ( e ) ; let g , h ; if ( null == ( g = f ) || ! g . preconditionFn || ( null == ( h = f ) ? 0 : h . preconditionFn ( a ) ) ) { let k , l ; if ( ( null == ( k = f ) ? 0 : k . callback ) && ( null == ( l = f ) ? 0 : l . callback ( a , b , f ) ) ) return ! 0 } } return ! 1 } getShortcutNamesByKeyCode ( a ) { return this . keyMap . get ( a ) || [ ] } getKeyCodesByShortcutName ( a ) { const b = [ ] ; for ( const [ c , d ] of this . keyMap ) - 1 < d . indexOf ( a ) && b . push ( c ) ; return b } serializeKeyEvent _ ( a ) { let b =
"" ; for ( const c in ShortcutRegistry$$module$build$src$core$shortcut _registry . modifierKeys ) a . getModifierState ( c ) && ( "" !== b && ( b += "+" ) , b += c ) ; "" !== b && a . keyCode ? b = b + "+" + a . keyCode : a . keyCode && ( b = a . keyCode . toString ( ) ) ; return b } checkModifiers _ ( a ) { for ( let b = 0 , c ; c = a [ b ] ; b ++ ) if ( ! ( c in ShortcutRegistry$$module$build$src$core$shortcut _registry . modifierKeys ) ) throw Error ( c + " is not a valid modifier key." ) ; } createSerializedKey ( a , b ) { let c = "" ; if ( b ) { this . checkModifiers _ ( b ) ; for ( const d in ShortcutRegistry$$module$build$src$core$shortcut _registry . modifierKeys ) - 1 <
b . indexOf ( ShortcutRegistry$$module$build$src$core$shortcut _registry . modifierKeys [ d ] ) && ( "" !== c && ( c += "+" ) , c += d ) } "" !== c && a ? c = c + "+" + a : a && ( c = a . toString ( ) ) ; return c } } ; ShortcutRegistry$$module$build$src$core$shortcut _registry . registry = new ShortcutRegistry$$module$build$src$core$shortcut _registry ;
( function ( a ) { a = a . modifierKeys || ( a . modifierKeys = { } ) ; a [ a . Shift = 16 ] = "Shift" ; a [ a . Control = 17 ] = "Control" ; a [ a . Alt = 18 ] = "Alt" ; a [ a . Meta = 91 ] = "Meta" } ) ( ShortcutRegistry$$module$build$src$core$shortcut _registry || ( ShortcutRegistry$$module$build$src$core$shortcut _registry = { } ) ) ; var module$build$src$core$shortcut _registry = { } ; module$build$src$core$shortcut _registry . ShortcutRegistry = ShortcutRegistry$$module$build$src$core$shortcut _registry ; var names$$module$build$src$core$shortcut _items ; ( function ( a ) { a . ESCAPE = "escape" ; a . DELETE = "delete" ; a . COPY = "copy" ; a . CUT = "cut" ; a . PASTE = "paste" ; a . UNDO = "undo" ; a . REDO = "redo" } ) ( names$$module$build$src$core$shortcut _items || ( names$$module$build$src$core$shortcut _items = { } ) ) ; registerDefaultShortcuts$$module$build$src$core$shortcut _items ( ) ; var module$build$src$core$shortcut _items = { } ; module$build$src$core$shortcut _items . names = names$$module$build$src$core$shortcut _items ;
module$build$src$core$shortcut _items . registerCopy = registerCopy$$module$build$src$core$shortcut _items ; module$build$src$core$shortcut _items . registerCut = registerCut$$module$build$src$core$shortcut _items ; module$build$src$core$shortcut _items . registerDefaultShortcuts = registerDefaultShortcuts$$module$build$src$core$shortcut _items ; module$build$src$core$shortcut _items . registerDelete = registerDelete$$module$build$src$core$shortcut _items ; module$build$src$core$shortcut _items . registerEscape = registerEscape$$module$build$src$core$shortcut _items ;
module$build$src$core$shortcut _items . registerPaste = registerPaste$$module$build$src$core$shortcut _items ; module$build$src$core$shortcut _items . registerRedo = registerRedo$$module$build$src$core$shortcut _items ; module$build$src$core$shortcut _items . registerUndo = registerUndo$$module$build$src$core$shortcut _items ; 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 } fromJson ( a ) { super . fromJson ( a ) ; this . themeName = a . themeName } } ;
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" ) ;
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 } fromJson ( a ) { super . fromJson ( a ) ; this . viewTop = a . viewTop ; this . viewLeft = a . viewLeft ; this . scale = a . scale ; this . oldScale = a . oldScale } } ;
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 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 && this . connections _ [ d ] . y ===
b ; ) { if ( this . connections _ [ d ] === a ) return d ; d ++ } return - 1 } calculateIndexForYPos _ ( a ) { if ( ! this . connections _ . length ) return 0 ; let b = 0 , c = this . connections _ . length ; for ( ; b < c ; ) { const d = Math . floor ( ( b + c ) / 2 ) ; if ( this . connections _ [ d ] . y < a ) b = d + 1 ; else if ( this . connections _ [ d ] . y > a ) c = d ; else { b = d ; break } } return b } removeConnection ( a , b ) { a = this . findIndexOfConnection _ ( a , b ) ; if ( - 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 < b } const d = this . connections _ , e = a . x , f = a . y ; a = 0 ; let g = d . length - 2 , h = g ; for ( ; a < h ; ) d [ h ] . y < f ? a = h : g = h , h = Math . floor ( ( a + g ) / 2 ) ; const k = [ ] ; g = a = h ; if ( d . length ) { for ( ; 0 <= a && c ( a ) ; ) a -- ; do g ++ ; while ( g < d . length && c ( g ) ) } return k } isInYRange _ ( a , b , c ) { return Math . abs ( this . connections _ [ a ] . y - b ) <= c } searchForClosest ( a , b , c ) { if ( ! this . connections _ . length ) return { connection : null , radius : b } ; const d = a . y , e = a . x ; a . x = e + c . x ; a . y = d + c . y ; var f = this . calculateIndexForYPos _ ( a . y ) ; c = null ; let g = b , h , k = f - 1 ; for ( ; 0 <=
k && this . isInYRange _ ( k , a . y , b ) ; ) h = this . connections _ [ k ] , this . connectionChecker . canConnect ( a , h , ! 0 , g ) && ( c = h , g = h . distanceFrom ( a ) ) , k -- ; for ( ; f < this . connections _ . length && this . isInYRange _ ( f , a . y , b ) ; ) h = this . connections _ [ f ] , this . connectionChecker . canConnect ( a , h , ! 0 , g ) && ( c = h , g = h . distanceFrom ( a ) ) , f ++ ; a . x = e ; a . y = d ; return { connection : c , radius : g } } static init ( a ) { const b = [ ] ; b [ ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE ] = new ConnectionDB$$module$build$src$core$connection _db ( a ) ; b [ ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE ] =
new ConnectionDB$$module$build$src$core$connection _db ( a ) ; b [ ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT ] = new ConnectionDB$$module$build$src$core$connection _db ( a ) ; b [ ConnectionType$$module$build$src$core$connection _type . PREVIOUS _STATEMENT ] = new ConnectionDB$$module$build$src$core$connection _db ( a ) ; return b } } , module$build$src$core$connection _db = { } ; module$build$src$core$connection _db . ConnectionDB = ConnectionDB$$module$build$src$core$connection _db ; var Grid$$module$build$src$core$grid = class { constructor ( a , b ) { this . pattern = a ; 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 } shouldSnap ( ) { return this . snapToGrid } getSpacing ( ) { return this . spacing } getPatternId ( ) { return this . pattern . id } update ( a ) { var b = this . spacing * a || 100 ; this . pattern . setAttribute ( "width" , b . toString ( ) ) ; this . pattern . setAttribute ( "height" , b . toString ( ) ) ;
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 . toString ( ) ) , a . setAttribute ( "x1" , c . toString ( ) ) , a . setAttribute ( "y1" , e . toString ( ) ) , a . setAttribute ( "x2" , d . toString ( ) ) , a . setAttribute ( "y2" , f . toString ( ) ) ) } moveTo ( a , b ) { this . pattern . setAttribute ( "x" , a . toString ( ) ) ; this . pattern . setAttribute ( "y" , b . toString ( ) ) } 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 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 ; b < a . length ; b ++ ) this . getName ( a [ b ] . getId ( ) , $ . NameType$$module$build$src$core$names . VARIABLE ) } populateProcedures ( a ) { throw Error ( "The implementation of populateProcedures should be monkey-patched in by blockly.ts" ) ; } getName ( a , b ) { let c = a ; b === $ . NameType$$module$build$src$core$names . VARIABLE && ( a = this . getNameForUserVariable _ ( a ) ) && ( c = a ) ; a = c . toLowerCase ( ) ; const d = b === $ . NameType$$module$build$src$core$names . VARIABLE ||
b === $ . NameType$$module$build$src$core$names . DEVELOPER _VARIABLE ? this . variablePrefix _ : "" ; this . db . has ( b ) || this . db . set ( b , new Map ) ; const e = this . db . get ( b ) ; if ( e . has ( a ) ) return d + e . get ( a ) ; b = this . getDistinctName ( c , b ) ; e . set ( a , b . substr ( d . length ) ) ; return b } getUserNames ( a ) { let b ; return ( a = null == ( b = this . db . get ( a ) ) ? void 0 : b . keys ( ) ) ? Array . from ( a ) : [ ] } getDistinctName ( a , b ) { a = this . safeName _ ( a ) ; let c = "" ; for ( ; this . dbReverse . has ( a + c ) || this . reservedWords . has ( a + c ) ; ) c = c ? c + 1 : 2 ; a += c ; this . dbReverse . add ( a ) ; return ( b === $ . NameType$$module$build$src$core$names . VARIABLE ||
b === $ . NameType$$module$build$src$core$names . DEVELOPER _VARIABLE ? this . variablePrefix _ : "" ) + a } safeName _ ( a ) { a ? ( a = encodeURI ( a . replace ( / /g , "_" ) ) . replace ( /[^\w]/g , "_" ) , - 1 !== "0123456789" . indexOf ( a [ 0 ] ) && ( a = "my_" + a ) ) : a = Msg$$module$build$src$core$msg . UNNAMED _KEY || "unnamed" ; return a } static equals ( a , b ) { return a . toLowerCase ( ) === b . toLowerCase ( ) } } ;
( function ( a ) { a = a . NameType || ( a . NameType = { } ) ; a . DEVELOPER _VARIABLE = "DEVELOPER_VARIABLE" ; a . VARIABLE = "VARIABLE" ; a . PROCEDURE = "PROCEDURE" } ) ( Names$$module$build$src$core$names || ( Names$$module$build$src$core$names = { } ) ) ; $ . NameType$$module$build$src$core$names = Names$$module$build$src$core$names . NameType ; Names$$module$build$src$core$names . DEVELOPER _VARIABLE _TYPE = $ . NameType$$module$build$src$core$names . DEVELOPER _VARIABLE ; $ . module$build$src$core$names = { } ; $ . module$build$src$core$names . NameType = $ . NameType$$module$build$src$core$names ;
$ . module$build$src$core$names . Names = Names$$module$build$src$core$names ; var CATEGORY _NAME$$module$build$src$core$procedures , DEFAULT _ARG$$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 = { } ; $ . module$build$src$core$procedures . CATEGORY _NAME = CATEGORY _NAME$$module$build$src$core$procedures ; $ . module$build$src$core$procedures . DEFAULT _ARG = DEFAULT _ARG$$module$build$src$core$procedures ; $ . module$build$src$core$procedures . allProcedures = allProcedures$$module$build$src$core$procedures ;
$ . module$build$src$core$procedures . findLegalName = findLegalName$$module$build$src$core$procedures ; $ . module$build$src$core$procedures . flyoutCategory = flyoutCategory$$module$build$src$core$procedures ; $ . module$build$src$core$procedures . getCallers = getCallers$$module$build$src$core$procedures ; $ . module$build$src$core$procedures . getDefinition = getDefinition$$module$build$src$core$procedures ; $ . module$build$src$core$procedures . isNameUsed = isNameUsed$$module$build$src$core$procedures ;
$ . module$build$src$core$procedures . mutateCallers = mutateCallers$$module$build$src$core$procedures ; $ . module$build$src$core$procedures . mutatorOpenListener = mutatorOpenListener$$module$build$src$core$procedures ; $ . module$build$src$core$procedures . rename = rename$$module$build$src$core$procedures ; var TypesContainer$$module$build$src$core$renderers$measurables$types = class { constructor ( ) { this . NONE = 0 ; this . FIELD = 1 ; this . HAT = 2 ; this . ICON = 4 ; this . SPACER = 8 ; this . BETWEEN _ROW _SPACER = 16 ; this . IN _ROW _SPACER = 32 ; this . EXTERNAL _VALUE _INPUT = 64 ; this . INPUT = 128 ; this . INLINE _INPUT = 256 ; this . STATEMENT _INPUT = 512 ; this . CONNECTION = 1024 ; this . PREVIOUS _CONNECTION = 2048 ; this . NEXT _CONNECTION = 4096 ; this . OUTPUT _CONNECTION = 8192 ; this . CORNER = 16384 ; this . LEFT _SQUARE _CORNER = 32768 ; this . LEFT _ROUND _CORNER = 65536 ; this . RIGHT _SQUARE _CORNER = 131072 ;
this . RIGHT _ROUND _CORNER = 262144 ; this . JAGGED _EDGE = 524288 ; this . ROW = 1048576 ; this . TOP _ROW = 2097152 ; this . BOTTOM _ROW = 4194304 ; this . INPUT _ROW = 8388608 ; this . LEFT _CORNER = this . LEFT _SQUARE _CORNER | this . LEFT _ROUND _CORNER ; this . RIGHT _CORNER = this . RIGHT _SQUARE _CORNER | this . RIGHT _ROUND _CORNER ; this . nextTypeValue _ = 16777216 } getType ( a ) { Object . prototype . hasOwnProperty . call ( this , a ) || ( this [ a ] = this . nextTypeValue _ , this . nextTypeValue _ <<= 1 ) ; return this [ a ] } isField ( a ) { return a . type & this . FIELD } isHat ( a ) { return a . type & this . HAT } isIcon ( a ) { return a . type &
this . ICON } isSpacer ( a ) { return a . type & this . SPACER } isInRowSpacer ( a ) { return a . type & this . IN _ROW _SPACER } isInput ( a ) { return a . type & this . INPUT } isExternalInput ( a ) { return a . type & this . EXTERNAL _VALUE _INPUT } isInlineInput ( a ) { return a . type & this . INLINE _INPUT } isStatementInput ( a ) { return a . type & this . STATEMENT _INPUT } isPreviousConnection ( a ) { return a . type & this . PREVIOUS _CONNECTION } isNextConnection ( a ) { return a . type & this . NEXT _CONNECTION } isPreviousOrNextConnection ( a ) { return a . type & ( this . PREVIOUS _CONNECTION | this . NEXT _CONNECTION ) } isLeftRoundedCorner ( a ) { return a . type &
this . LEFT _ROUND _CORNER } isRightRoundedCorner ( a ) { return a . type & this . RIGHT _ROUND _CORNER } isLeftSquareCorner ( a ) { return a . type & this . LEFT _SQUARE _CORNER } isRightSquareCorner ( a ) { return a . type & this . RIGHT _SQUARE _CORNER } isCorner ( a ) { return a . type & this . CORNER } isJaggedEdge ( a ) { return a . type & this . JAGGED _EDGE } isRow ( a ) { return a . type & this . ROW } isBetweenRowSpacer ( a ) { return a . type & this . BETWEEN _ROW _SPACER } isTopRow ( a ) { return a . type & this . TOP _ROW } isBottomRow ( a ) { return a . type & this . BOTTOM _ROW } isTopOrBottomRow ( a ) { return a . type &
( this . TOP _ROW | this . BOTTOM _ROW ) } isInputRow ( a ) { return a . type & this . INPUT _ROW } } , Types$$module$build$src$core$renderers$measurables$types = new TypesContainer$$module$build$src$core$renderers$measurables$types , module$build$src$core$renderers$measurables$types = { } ; module$build$src$core$renderers$measurables$types . Types = Types$$module$build$src$core$renderers$measurables$types ; var Measurable$$module$build$src$core$renderers$measurables$base = class { constructor ( a ) { this . centerline = this . xPos = this . height = this . width = 0 ; this . constants _ = a ; this . type = Types$$module$build$src$core$renderers$measurables$types . NONE ; this . notchOffset = this . constants _ . NOTCH _OFFSET _LEFT } } , module$build$src$core$renderers$measurables$base = { } ; module$build$src$core$renderers$measurables$base . Measurable = Measurable$$module$build$src$core$renderers$measurables$base ; var Row$$module$build$src$core$renderers$measurables$row = class { constructor ( a ) { this . elements = [ ] ; this . xPos = this . yPos = this . widthWithConnectedBlocks = this . minWidth = this . minHeight = this . width = this . height = 0 ; this . hasStatement = this . hasExternalInput = ! 1 ; this . statementEdge = 0 ; this . hasJaggedEdge = this . hasDummyInput = this . hasInlineInput = ! 1 ; this . align = null ; this . constants _ = a ; this . type = Types$$module$build$src$core$renderers$measurables$types . ROW ; this . notchOffset = this . constants _ . NOTCH _OFFSET _LEFT } getLastInput ( ) { for ( let a =
this . elements . length - 1 ; 0 <= a ; a -- ) { const b = this . elements [ a ] ; if ( Types$$module$build$src$core$renderers$measurables$types . isInput ( b ) ) return b } return null } measure ( ) { throw Error ( "Unexpected attempt to measure a base Row." ) ; } startsWithElemSpacer ( ) { return ! 0 } endsWithElemSpacer ( ) { return ! 0 } getFirstSpacer ( ) { for ( let a = 0 ; a < this . elements . length ; a ++ ) { const b = this . elements [ a ] ; if ( Types$$module$build$src$core$renderers$measurables$types . isSpacer ( b ) ) return b } return null } getLastSpacer ( ) { for ( let a = this . elements . length -
1 ; 0 <= a ; a -- ) { const b = this . elements [ a ] ; if ( Types$$module$build$src$core$renderers$measurables$types . isSpacer ( b ) ) return b } return null } } , module$build$src$core$renderers$measurables$row = { } ; module$build$src$core$renderers$measurables$row . Row = Row$$module$build$src$core$renderers$measurables$row ; var BottomRow$$module$build$src$core$renderers$measurables$bottom _row = class extends Row$$module$build$src$core$renderers$measurables$row { constructor ( a ) { super ( a ) ; this . hasNextConnection = ! 1 ; this . connection = null ; this . baseline = this . descenderHeight = 0 ; this . type |= Types$$module$build$src$core$renderers$measurables$types . BOTTOM _ROW } hasLeftSquareCorner ( a ) { return ! ! a . outputConnection || ! ! a . getNextBlock ( ) } hasRightSquareCorner ( a ) { return ! 0 } measure ( ) { let a = 0 , b = 0 , c = 0 ; for ( let d = 0 ; d < this . elements . length ; d ++ ) { const e =
this . elements [ d ] ; b += e . width ; Types$$module$build$src$core$renderers$measurables$types . isSpacer ( e ) || ( Types$$module$build$src$core$renderers$measurables$types . isNextConnection ( e ) ? c = Math . max ( c , e . height ) : a = Math . max ( a , e . height ) ) } this . width = Math . max ( this . minWidth , b ) ; this . height = Math . max ( this . minHeight , a ) + c ; this . descenderHeight = c ; this . widthWithConnectedBlocks = this . width } startsWithElemSpacer ( ) { return ! 1 } endsWithElemSpacer ( ) { return ! 1 } } , module$build$src$core$renderers$measurables$bottom _row = { } ;
module$build$src$core$renderers$measurables$bottom _row . BottomRow = BottomRow$$module$build$src$core$renderers$measurables$bottom _row ; var Connection$$module$build$src$core$renderers$measurables$connection = class extends Measurable$$module$build$src$core$renderers$measurables$base { constructor ( a , b ) { super ( a ) ; this . connectionModel = b ; this . shape = this . constants _ . shapeFor ( b ) ; this . isDynamicShape = "isDynamic" in this . shape && this . shape . isDynamic ; this . type |= Types$$module$build$src$core$renderers$measurables$types . CONNECTION } } , module$build$src$core$renderers$measurables$connection = { } ;
module$build$src$core$renderers$measurables$connection . Connection = Connection$$module$build$src$core$renderers$measurables$connection ; var InputConnection$$module$build$src$core$renderers$measurables$input _connection = class extends Connection$$module$build$src$core$renderers$measurables$connection { constructor ( a , b ) { super ( a , b . connection ) ; this . input = b ; this . connectionOffsetY = this . connectionOffsetX = 0 ; this . type |= Types$$module$build$src$core$renderers$measurables$types . INPUT ; this . align = b . align ; ( this . connectedBlock = b . connection && b . connection . targetBlock ( ) ? b . connection . targetBlock ( ) : null ) ? ( a = this . connectedBlock . getHeightWidth ( ) , this . connectedBlockWidth =
a . width , this . connectedBlockHeight = a . height ) : this . connectedBlockHeight = this . connectedBlockWidth = 0 } } , module$build$src$core$renderers$measurables$input _connection = { } ; module$build$src$core$renderers$measurables$input _connection . InputConnection = InputConnection$$module$build$src$core$renderers$measurables$input _connection ; var ExternalValueInput$$module$build$src$core$renderers$measurables$external _value _input = class extends InputConnection$$module$build$src$core$renderers$measurables$input _connection { constructor ( a , b ) { super ( a , b ) ; this . height = 0 ; this . type |= Types$$module$build$src$core$renderers$measurables$types . EXTERNAL _VALUE _INPUT ; this . height = this . connectedBlock ? this . connectedBlockHeight - this . constants _ . TAB _OFFSET _FROM _TOP - this . constants _ . MEDIUM _PADDING : this . shape . height ; this . width = this . shape . width + this . constants _ . EXTERNAL _VALUE _INPUT _PADDING ;
this . connectionOffsetY = this . constants _ . TAB _OFFSET _FROM _TOP ; this . connectionHeight = this . shape . height ; this . connectionWidth = this . shape . width } } , module$build$src$core$renderers$measurables$external _value _input = { } ; module$build$src$core$renderers$measurables$external _value _input . ExternalValueInput = ExternalValueInput$$module$build$src$core$renderers$measurables$external _value _input ; var Field$$module$build$src$core$renderers$measurables$field = class extends Measurable$$module$build$src$core$renderers$measurables$base { constructor ( a , b , c ) { super ( a ) ; this . field = b ; this . parentInput = c ; this . isEditable = b . EDITABLE ; this . flipRtl = b . getFlipRtl ( ) ; this . type |= Types$$module$build$src$core$renderers$measurables$types . FIELD ; a = this . field . getSize ( ) ; this . height = a . height ; this . width = a . width } } , module$build$src$core$renderers$measurables$field = { } ; module$build$src$core$renderers$measurables$field . Field = Field$$module$build$src$core$renderers$measurables$field ; var Hat$$module$build$src$core$renderers$measurables$hat = class extends Measurable$$module$build$src$core$renderers$measurables$base { constructor ( a ) { super ( a ) ; this . type |= Types$$module$build$src$core$renderers$measurables$types . HAT ; this . height = this . constants _ . START _HAT . height ; this . width = this . constants _ . START _HAT . width ; this . ascenderHeight = this . height } } , module$build$src$core$renderers$measurables$hat = { } ; module$build$src$core$renderers$measurables$hat . Hat = Hat$$module$build$src$core$renderers$measurables$hat ; var Icon$$module$build$src$core$renderers$measurables$icon = class extends Measurable$$module$build$src$core$renderers$measurables$base { constructor ( a , b ) { super ( a ) ; this . icon = b ; this . flipRtl = ! 1 ; this . isVisible = b . isVisible ( ) ; this . type |= Types$$module$build$src$core$renderers$measurables$types . ICON ; a = b . getCorrectedSize ( ) ; this . height = a . height ; this . width = a . width } } , module$build$src$core$renderers$measurables$icon = { } ; module$build$src$core$renderers$measurables$icon . Icon = Icon$$module$build$src$core$renderers$measurables$icon ; var InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer = class extends Measurable$$module$build$src$core$renderers$measurables$base { constructor ( a , b ) { super ( a ) ; this . type = this . type | Types$$module$build$src$core$renderers$measurables$types . SPACER | Types$$module$build$src$core$renderers$measurables$types . IN _ROW _SPACER ; this . width = b ; this . height = this . constants _ . SPACER _DEFAULT _HEIGHT } } , module$build$src$core$renderers$measurables$in _row _spacer = { } ;
module$build$src$core$renderers$measurables$in _row _spacer . InRowSpacer = InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ; var InlineInput$$module$build$src$core$renderers$measurables$inline _input = class extends InputConnection$$module$build$src$core$renderers$measurables$input _connection { constructor ( a , b ) { super ( a , b ) ; this . type |= Types$$module$build$src$core$renderers$measurables$types . INLINE _INPUT ; this . connectedBlock ? ( this . width = this . connectedBlockWidth , this . height = this . connectedBlockHeight ) : ( this . height = this . constants _ . EMPTY _INLINE _INPUT _HEIGHT , this . width = this . constants _ . EMPTY _INLINE _INPUT _PADDING ) ; this . connectionHeight =
this . isDynamicShape ? this . shape . height ( this . height ) : this . shape . height ; this . connectionWidth = this . isDynamicShape ? this . shape . width ( this . height ) : this . shape . width ; this . connectedBlock || ( this . width += this . connectionWidth * ( this . isDynamicShape ? 2 : 1 ) ) ; this . connectionOffsetY = "connectionOffsetY" in this . shape ? this . shape . connectionOffsetY ( this . connectionHeight ) : this . constants _ . TAB _OFFSET _FROM _TOP ; this . connectionOffsetX = "connectionOffsetX" in this . shape ? this . shape . connectionOffsetX ( this . connectionWidth ) : 0 } } , module$build$src$core$renderers$measurables$inline _input =
{ } ; module$build$src$core$renderers$measurables$inline _input . InlineInput = InlineInput$$module$build$src$core$renderers$measurables$inline _input ; var StatementInput$$module$build$src$core$renderers$measurables$statement _input = class extends InputConnection$$module$build$src$core$renderers$measurables$input _connection { constructor ( a , b ) { super ( a , b ) ; this . type |= Types$$module$build$src$core$renderers$measurables$types . STATEMENT _INPUT ; this . height = this . connectedBlock ? this . connectedBlockHeight + this . constants _ . STATEMENT _BOTTOM _SPACER : this . constants _ . EMPTY _STATEMENT _INPUT _HEIGHT ; this . width = this . constants _ . STATEMENT _INPUT _NOTCH _OFFSET + this . shape . width } } ,
module$build$src$core$renderers$measurables$statement _input = { } ; module$build$src$core$renderers$measurables$statement _input . StatementInput = StatementInput$$module$build$src$core$renderers$measurables$statement _input ; var InputRow$$module$build$src$core$renderers$measurables$input _row = class extends Row$$module$build$src$core$renderers$measurables$row { constructor ( a ) { super ( a ) ; this . connectedBlockWidths = 0 ; this . type |= Types$$module$build$src$core$renderers$measurables$types . INPUT _ROW } measure ( ) { this . width = this . minWidth ; this . height = this . minHeight ; let a = 0 ; for ( let b = 0 ; b < this . elements . length ; b ++ ) { const c = this . elements [ b ] ; this . width += c . width ; Types$$module$build$src$core$renderers$measurables$types . isInput ( c ) && c instanceof
InputConnection$$module$build$src$core$renderers$measurables$input _connection && ( Types$$module$build$src$core$renderers$measurables$types . isStatementInput ( c ) && c instanceof StatementInput$$module$build$src$core$renderers$measurables$statement _input ? a += c . connectedBlockWidth : Types$$module$build$src$core$renderers$measurables$types . isExternalInput ( c ) && c instanceof ExternalValueInput$$module$build$src$core$renderers$measurables$external _value _input && 0 !== c . connectedBlockWidth && ( a += c . connectedBlockWidth -
c . connectionWidth ) ) ; Types$$module$build$src$core$renderers$measurables$types . isSpacer ( c ) || ( this . height = Math . max ( this . height , c . height ) ) } this . connectedBlockWidths = a ; this . widthWithConnectedBlocks = this . width + a } endsWithElemSpacer ( ) { return ! this . hasExternalInput && ! this . hasStatement } } , module$build$src$core$renderers$measurables$input _row = { } ; module$build$src$core$renderers$measurables$input _row . InputRow = InputRow$$module$build$src$core$renderers$measurables$input _row ; var JaggedEdge$$module$build$src$core$renderers$measurables$jagged _edge = class extends Measurable$$module$build$src$core$renderers$measurables$base { constructor ( a ) { super ( a ) ; this . type |= Types$$module$build$src$core$renderers$measurables$types . JAGGED _EDGE ; this . height = this . constants _ . JAGGED _TEETH . height ; this . width = this . constants _ . JAGGED _TEETH . width } } , module$build$src$core$renderers$measurables$jagged _edge = { } ; module$build$src$core$renderers$measurables$jagged _edge . JaggedEdge = JaggedEdge$$module$build$src$core$renderers$measurables$jagged _edge ; var NextConnection$$module$build$src$core$renderers$measurables$next _connection = class extends Connection$$module$build$src$core$renderers$measurables$connection { constructor ( a , b ) { super ( a , b ) ; this . type |= Types$$module$build$src$core$renderers$measurables$types . NEXT _CONNECTION ; this . height = this . shape . height ; this . width = this . shape . width } } , module$build$src$core$renderers$measurables$next _connection = { } ; module$build$src$core$renderers$measurables$next _connection . NextConnection = NextConnection$$module$build$src$core$renderers$measurables$next _connection ; var OutputConnection$$module$build$src$core$renderers$measurables$output _connection = class extends Connection$$module$build$src$core$renderers$measurables$connection { constructor ( a , b ) { super ( a , b ) ; this . connectionOffsetX = 0 ; this . type |= Types$$module$build$src$core$renderers$measurables$types . OUTPUT _CONNECTION ; this . height = this . isDynamicShape ? 0 : this . shape . height ; this . startX = this . width = this . isDynamicShape ? 0 : this . shape . width ; this . connectionOffsetY = this . constants _ . TAB _OFFSET _FROM _TOP } } , module$build$src$core$renderers$measurables$output _connection =
{ } ; module$build$src$core$renderers$measurables$output _connection . OutputConnection = OutputConnection$$module$build$src$core$renderers$measurables$output _connection ; var PreviousConnection$$module$build$src$core$renderers$measurables$previous _connection = class extends Connection$$module$build$src$core$renderers$measurables$connection { constructor ( a , b ) { super ( a , b ) ; this . type |= Types$$module$build$src$core$renderers$measurables$types . PREVIOUS _CONNECTION ; this . height = this . shape . height ; this . width = this . shape . width } } , module$build$src$core$renderers$measurables$previous _connection = { } ; module$build$src$core$renderers$measurables$previous _connection . PreviousConnection = PreviousConnection$$module$build$src$core$renderers$measurables$previous _connection ; var RoundCorner$$module$build$src$core$renderers$measurables$round _corner = class extends Measurable$$module$build$src$core$renderers$measurables$base { constructor ( a , b ) { super ( a ) ; this . type = ( b && "left" !== b ? Types$$module$build$src$core$renderers$measurables$types . RIGHT _ROUND _CORNER : Types$$module$build$src$core$renderers$measurables$types . LEFT _ROUND _CORNER ) | Types$$module$build$src$core$renderers$measurables$types . CORNER ; this . width = this . constants _ . CORNER _RADIUS ; this . height = this . constants _ . CORNER _RADIUS / 2 } } ,
module$build$src$core$renderers$measurables$round _corner = { } ; module$build$src$core$renderers$measurables$round _corner . RoundCorner = RoundCorner$$module$build$src$core$renderers$measurables$round _corner ; var SpacerRow$$module$build$src$core$renderers$measurables$spacer _row = class extends Row$$module$build$src$core$renderers$measurables$row { constructor ( a , b , c ) { super ( a ) ; this . height = b ; this . width = c ; this . precedesStatement = this . followsStatement = ! 1 ; this . widthWithConnectedBlocks = 0 ; this . type = this . type | Types$$module$build$src$core$renderers$measurables$types . SPACER | Types$$module$build$src$core$renderers$measurables$types . BETWEEN _ROW _SPACER ; this . elements = [ new InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ( this . constants _ ,
c ) ] } measure ( ) { } } , module$build$src$core$renderers$measurables$spacer _row = { } ; module$build$src$core$renderers$measurables$spacer _row . SpacerRow = SpacerRow$$module$build$src$core$renderers$measurables$spacer _row ; var SquareCorner$$module$build$src$core$renderers$measurables$square _corner = class extends Measurable$$module$build$src$core$renderers$measurables$base { constructor ( a , b ) { super ( a ) ; this . type = ( b && "left" !== b ? Types$$module$build$src$core$renderers$measurables$types . RIGHT _SQUARE _CORNER : Types$$module$build$src$core$renderers$measurables$types . LEFT _SQUARE _CORNER ) | Types$$module$build$src$core$renderers$measurables$types . CORNER ; this . width = this . height = this . constants _ . NO _PADDING } } , module$build$src$core$renderers$measurables$square _corner =
{ } ; module$build$src$core$renderers$measurables$square _corner . SquareCorner = SquareCorner$$module$build$src$core$renderers$measurables$square _corner ; var TopRow$$module$build$src$core$renderers$measurables$top _row = class extends Row$$module$build$src$core$renderers$measurables$row { constructor ( a ) { super ( a ) ; this . ascenderHeight = this . capline = 0 ; this . hasPreviousConnection = ! 1 ; this . connection = null ; this . type |= Types$$module$build$src$core$renderers$measurables$types . TOP _ROW } hasLeftSquareCorner ( a ) { const b = ( a . hat ? "cap" === a . hat : this . constants _ . ADD _START _HATS ) && ! a . outputConnection && ! a . previousConnection , c = a . getPreviousBlock ( ) ; return ! ! a . outputConnection || b || ( c ?
c . getNextBlock ( ) === a : ! 1 ) } hasRightSquareCorner ( a ) { return ! 0 } measure ( ) { let a = 0 , b = 0 , c = 0 ; for ( let d = 0 ; d < this . elements . length ; d ++ ) { const e = this . elements [ d ] ; b += e . width ; Types$$module$build$src$core$renderers$measurables$types . isSpacer ( e ) || ( Types$$module$build$src$core$renderers$measurables$types . isHat ( e ) && e instanceof Hat$$module$build$src$core$renderers$measurables$hat ? c = Math . max ( c , e . ascenderHeight ) : a = Math . max ( a , e . height ) ) } this . width = Math . max ( this . minWidth , b ) ; this . height = Math . max ( this . minHeight , a ) + c ; this . capline =
this . ascenderHeight = c ; this . widthWithConnectedBlocks = this . width } startsWithElemSpacer ( ) { return ! 1 } endsWithElemSpacer ( ) { return ! 1 } } , module$build$src$core$renderers$measurables$top _row = { } ; module$build$src$core$renderers$measurables$top _row . TopRow = TopRow$$module$build$src$core$renderers$measurables$top _row ; var ConstantProvider$$module$build$src$core$renderers$common$constants = class { constructor ( ) { this . NO _PADDING = 0 ; this . SMALL _PADDING = 3 ; this . MEDIUM _PADDING = 5 ; this . MEDIUM _LARGE _PADDING = 8 ; this . LARGE _PADDING = 10 ; this . TAB _HEIGHT = 15 ; this . TAB _OFFSET _FROM _TOP = 5 ; this . TAB _VERTICAL _OVERLAP = 2.5 ; this . TAB _WIDTH = 8 ; this . NOTCH _WIDTH = 15 ; this . NOTCH _HEIGHT = 4 ; this . MIN _BLOCK _WIDTH = 12 ; this . EMPTY _BLOCK _SPACER _HEIGHT = 16 ; this . CORNER _RADIUS = 8 ; this . NOTCH _OFFSET _LEFT = 15 ; this . STATEMENT _BOTTOM _SPACER = 0 ; this . STATEMENT _INPUT _PADDING _LEFT =
20 ; this . BETWEEN _STATEMENT _PADDING _Y = 4 ; this . ADD _START _HATS = ! 1 ; this . START _HAT _HEIGHT = 15 ; this . START _HAT _WIDTH = 100 ; this . SPACER _DEFAULT _HEIGHT = 15 ; this . MIN _BLOCK _HEIGHT = 24 ; this . EMPTY _INLINE _INPUT _PADDING = 14.5 ; this . EXTERNAL _VALUE _INPUT _PADDING = 2 ; this . JAGGED _TEETH _HEIGHT = 12 ; this . JAGGED _TEETH _WIDTH = 6 ; this . FIELD _TEXT _FONTSIZE = 11 ; this . FIELD _TEXT _FONTWEIGHT = "normal" ; this . FIELD _TEXT _FONTFAMILY = "sans-serif" ; this . FIELD _TEXT _BASELINE = this . FIELD _TEXT _HEIGHT = - 1 ; this . FIELD _BORDER _RECT _RADIUS = 4 ; this . FIELD _BORDER _RECT _HEIGHT =
16 ; this . FIELD _BORDER _RECT _X _PADDING = 5 ; this . FIELD _BORDER _RECT _Y _PADDING = 3 ; this . FIELD _BORDER _RECT _COLOUR = "#fff" ; this . FIELD _DROPDOWN _SVG _ARROW = this . FIELD _DROPDOWN _COLOURED _DIV = this . FIELD _DROPDOWN _NO _BORDER _RECT _SHADOW = ! 1 ; this . FIELD _DROPDOWN _SVG _ARROW _SIZE = 12 ; this . FIELD _COLOUR _FULL _BLOCK = this . FIELD _TEXTINPUT _BOX _SHADOW = ! 1 ; this . FIELD _COLOUR _DEFAULT _WIDTH = 26 ; this . defs _ = null ; this . embossFilterId = "" ; this . embossFilter _ = null ; this . disabledPatternId = "" ; this . disabledPattern _ = null ; this . debugFilterId = "" ; this . cssNode _ =
this . debugFilter _ = null ; this . CURSOR _COLOUR = "#cc0a0a" ; this . MARKER _COLOUR = "#4286f4" ; this . CURSOR _WS _WIDTH = 100 ; this . WS _CURSOR _HEIGHT = 5 ; this . CURSOR _STACK _PADDING = 10 ; this . CURSOR _BLOCK _PADDING = 2 ; this . CURSOR _STROKE _WIDTH = 4 ; this . FULL _BLOCK _FIELDS = ! 1 ; this . INSERTION _MARKER _COLOUR = "#000000" ; this . INSERTION _MARKER _OPACITY = . 2 ; this . SHAPES = { PUZZLE : 1 , NOTCH : 2 } ; this . TALL _INPUT _FIELD _OFFSET _Y = this . MEDIUM _PADDING ; this . DUMMY _INPUT _SHADOW _MIN _HEIGHT = this . DUMMY _INPUT _MIN _HEIGHT = this . TAB _HEIGHT ; this . STATEMENT _INPUT _NOTCH _OFFSET =
this . NOTCH _OFFSET _LEFT ; this . TOP _ROW _MIN _HEIGHT = this . MEDIUM _PADDING ; this . TOP _ROW _PRECEDES _STATEMENT _MIN _HEIGHT = this . LARGE _PADDING ; this . BOTTOM _ROW _MIN _HEIGHT = this . MEDIUM _PADDING ; this . BOTTOM _ROW _AFTER _STATEMENT _MIN _HEIGHT = this . LARGE _PADDING ; this . EMPTY _INLINE _INPUT _HEIGHT = this . TAB _HEIGHT + 11 ; this . EMPTY _STATEMENT _INPUT _HEIGHT = this . MIN _BLOCK _HEIGHT ; this . START _POINT = moveBy$$module$build$src$core$utils$svg _paths ( 0 , 0 ) ; this . FIELD _TEXT _BASELINE _CENTER = ! 0 ; this . FIELD _DROPDOWN _BORDER _RECT _HEIGHT = this . FIELD _BORDER _RECT _HEIGHT ;
this . FIELD _DROPDOWN _SVG _ARROW _PADDING = this . FIELD _BORDER _RECT _X _PADDING ; this . FIELD _DROPDOWN _SVG _ARROW _DATAURI = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi43MSIgaGVpZ2h0PSI4Ljc5IiB2aWV3Qm94PSIwIDAgMTIuNzEgOC43OSI+PHRpdGxlPmRyb3Bkb3duLWFycm93PC90aXRsZT48ZyBvcGFjaXR5PSIwLjEiPjxwYXRoIGQ9Ik0xMi43MSwyLjQ0QTIuNDEsMi40MSwwLDAsMSwxMiw0LjE2TDguMDgsOC4wOGEyLjQ1LDIuNDUsMCwwLDEtMy40NSwwTDAuNzIsNC4xNkEyLjQyLDIuNDIsMCwwLDEsMCwyLjQ0LDIuNDgsMi40OCwwLDAsMSwuNzEuNzFDMSwwLjQ3LDEuNDMsMCw2LjM2LDBTMTEuNzUsMC40NiwxMiwuNzFBMi40NCwyLjQ0LDAsMCwxLDEyLjcxLDIuNDRaIiBmaWxsPSIjMjMxZjIwIi8+PC9nPjxwYXRoIGQ9Ik02LjM2LDcuNzlhMS40MywxLjQzLDAsMCwxLTEtLjQyTDEuNDIsMy40NWExLjQ0LDEuNDQsMCwwLDEsMC0yYzAuNTYtLjU2LDkuMzEtMC41Niw5Ljg3LDBhMS40NCwxLjQ0LDAsMCwxLDAsMkw3LjM3LDcuMzdBMS40MywxLjQzLDAsMCwxLDYuMzYsNy43OVoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=" ;
this . FIELD _COLOUR _DEFAULT _HEIGHT = this . FIELD _BORDER _RECT _HEIGHT ; this . FIELD _CHECKBOX _X _OFFSET = this . FIELD _BORDER _RECT _X _PADDING - 3 ; this . randomIdentifier = String ( Math . random ( ) ) . substring ( 2 ) } init ( ) { this . JAGGED _TEETH = this . makeJaggedTeeth ( ) ; this . NOTCH = this . makeNotch ( ) ; this . START _HAT = this . makeStartHat ( ) ; this . PUZZLE _TAB = this . makePuzzleTab ( ) ; this . INSIDE _CORNERS = this . makeInsideCorners ( ) ; this . OUTSIDE _CORNERS = this . makeOutsideCorners ( ) } setTheme ( a ) { this . blockStyles = Object . create ( null ) ; const b = a . blockStyles ; for ( const c in b ) this . blockStyles [ c ] =
this . validatedBlockStyle _ ( b [ c ] ) ; this . setDynamicProperties _ ( a ) } setDynamicProperties _ ( a ) { this . setFontConstants _ ( a ) ; this . setComponentConstants _ ( a ) ; this . ADD _START _HATS = void 0 !== a . startHats ? a . startHats : this . ADD _START _HATS } setFontConstants _ ( a ) { a . fontStyle && a . fontStyle . family && ( this . FIELD _TEXT _FONTFAMILY = a . fontStyle . family ) ; a . fontStyle && a . fontStyle . weight && ( this . FIELD _TEXT _FONTWEIGHT = a . fontStyle . weight ) ; a . fontStyle && a . fontStyle . size && ( this . FIELD _TEXT _FONTSIZE = a . fontStyle . size ) ; a = measureFontMetrics$$module$build$src$core$utils$dom ( "Hg" ,
this . FIELD _TEXT _FONTSIZE + "pt" , this . FIELD _TEXT _FONTWEIGHT , this . FIELD _TEXT _FONTFAMILY ) ; this . FIELD _TEXT _HEIGHT = a . height ; this . FIELD _TEXT _BASELINE = a . baseline } setComponentConstants _ ( a ) { this . CURSOR _COLOUR = a . getComponentStyle ( "cursorColour" ) || this . CURSOR _COLOUR ; this . MARKER _COLOUR = a . getComponentStyle ( "markerColour" ) || this . MARKER _COLOUR ; this . INSERTION _MARKER _COLOUR = a . getComponentStyle ( "insertionMarkerColour" ) || this . INSERTION _MARKER _COLOUR ; this . INSERTION _MARKER _OPACITY = Number ( a . getComponentStyle ( "insertionMarkerOpacity" ) ) ||
this . INSERTION _MARKER _OPACITY } getBlockStyleForColour ( a ) { const b = "auto_" + a ; this . blockStyles [ b ] || ( this . blockStyles [ b ] = this . createBlockStyle _ ( a ) ) ; return { style : this . blockStyles [ b ] , name : b } } getBlockStyle ( a ) { return this . blockStyles [ a || "" ] || ( a && 0 === a . indexOf ( "auto_" ) ? this . getBlockStyleForColour ( a . substring ( 5 ) ) . style : this . createBlockStyle _ ( "#000000" ) ) } createBlockStyle _ ( a ) { return this . validatedBlockStyle _ ( { colourPrimary : a } ) } validatedBlockStyle _ ( a ) { const b = { } ; a && Object . assign ( b , a ) ; a = parseBlockColour$$module$build$src$core$utils$parsing ( b . colourPrimary ||
"#000" ) ; b . colourPrimary = a . hex ; b . colourSecondary = b . colourSecondary ? parseBlockColour$$module$build$src$core$utils$parsing ( b . colourSecondary ) . hex : this . generateSecondaryColour _ ( b . colourPrimary ) ; b . colourTertiary = b . colourTertiary ? parseBlockColour$$module$build$src$core$utils$parsing ( b . colourTertiary ) . hex : this . generateTertiaryColour _ ( b . colourPrimary ) ; b . hat = b . hat || "" ; return b } generateSecondaryColour _ ( a ) { return blend$$module$build$src$core$utils$colour ( "#fff" , a , . 6 ) || a } generateTertiaryColour _ ( a ) { return blend$$module$build$src$core$utils$colour ( "#fff" ,
a , . 3 ) || a } dispose ( ) { this . embossFilter _ && removeNode$$module$build$src$core$utils$dom ( this . embossFilter _ ) ; this . disabledPattern _ && removeNode$$module$build$src$core$utils$dom ( this . disabledPattern _ ) ; this . debugFilter _ && removeNode$$module$build$src$core$utils$dom ( this . debugFilter _ ) ; this . cssNode _ = null } makeJaggedTeeth ( ) { const a = this . JAGGED _TEETH _HEIGHT , b = this . JAGGED _TEETH _WIDTH , c = line$$module$build$src$core$utils$svg _paths ( [ point$$module$build$src$core$utils$svg _paths ( b , a / 4 ) , point$$module$build$src$core$utils$svg _paths ( 2 *
- b , a / 2 ) , point$$module$build$src$core$utils$svg _paths ( b , a / 4 ) ] ) ; return { height : a , width : b , path : c } } makeStartHat ( ) { const a = this . START _HAT _HEIGHT , b = this . START _HAT _WIDTH , c = curve$$module$build$src$core$utils$svg _paths ( "c" , [ point$$module$build$src$core$utils$svg _paths ( 30 , - a ) , point$$module$build$src$core$utils$svg _paths ( 70 , - a ) , point$$module$build$src$core$utils$svg _paths ( b , 0 ) ] ) ; return { height : a , width : b , path : c } } makePuzzleTab ( ) { function a ( f ) { f = f ? - 1 : 1 ; const g = - f ; var h = c / 2 ; const k = h + 2.5 , l = h + . 5 , m = point$$module$build$src$core$utils$svg _paths ( - b ,
f * h ) ; h = point$$module$build$src$core$utils$svg _paths ( b , f * h ) ; return curve$$module$build$src$core$utils$svg _paths ( "c" , [ point$$module$build$src$core$utils$svg _paths ( 0 , f * k ) , point$$module$build$src$core$utils$svg _paths ( - b , g * l ) , m ] ) + curve$$module$build$src$core$utils$svg _paths ( "s" , [ point$$module$build$src$core$utils$svg _paths ( b , 2.5 * g ) , h ] ) } const b = this . TAB _WIDTH , c = this . TAB _HEIGHT , d = a ( ! 0 ) , e = a ( ! 1 ) ; return { type : this . SHAPES . PUZZLE , width : b , height : c , pathDown : e , pathUp : d } } makeNotch ( ) { function a ( g ) { return line$$module$build$src$core$utils$svg _paths ( [ point$$module$build$src$core$utils$svg _paths ( g *
d , c ) , point$$module$build$src$core$utils$svg _paths ( 3 * g , 0 ) , point$$module$build$src$core$utils$svg _paths ( g * d , - c ) ] ) } const b = this . NOTCH _WIDTH , c = this . NOTCH _HEIGHT , d = ( b - 3 ) / 2 , e = a ( 1 ) , f = a ( - 1 ) ; return { type : this . SHAPES . NOTCH , width : b , height : c , pathLeft : e , pathRight : f } } makeInsideCorners ( ) { const a = this . CORNER _RADIUS , b = arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,0" , a , point$$module$build$src$core$utils$svg _paths ( - a , a ) ) , c = arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,0" , a , point$$module$build$src$core$utils$svg _paths ( a ,
a ) ) ; return { width : a , height : a , pathTop : b , pathBottom : c } } makeOutsideCorners ( ) { const a = this . CORNER _RADIUS , b = moveBy$$module$build$src$core$utils$svg _paths ( 0 , a ) + arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,1" , a , point$$module$build$src$core$utils$svg _paths ( a , - a ) ) , c = arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,1" , a , point$$module$build$src$core$utils$svg _paths ( a , a ) ) , d = arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,1" , a , point$$module$build$src$core$utils$svg _paths ( - a , - a ) ) , e = arc$$module$build$src$core$utils$svg _paths ( "a" ,
"0 0,1" , a , point$$module$build$src$core$utils$svg _paths ( - a , a ) ) ; return { topLeft : b , topRight : c , bottomRight : e , bottomLeft : d , rightHeight : a } } shapeFor ( a ) { switch ( a . type ) { case ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE : case ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE : return this . PUZZLE _TAB ; case ConnectionType$$module$build$src$core$connection _type . PREVIOUS _STATEMENT : case ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT : return this . NOTCH ; default : throw Error ( "Unknown connection type" ) ;
} } createDom ( a , b , c ) { this . injectCSS _ ( b , c ) ; this . defs _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . DEFS , { } , a ) ; a = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FILTER , { id : "blocklyEmbossFilter" + this . randomIdentifier } , this . defs _ ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FEGAUSSIANBLUR , { "in" : "SourceAlpha" , stdDeviation : 1 , result : "blur" } , a ) ; b = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FESPECULARLIGHTING ,
{ "in" : "blur" , surfaceScale : 1 , specularConstant : . 5 , specularExponent : 10 , "lighting-color" : "white" , result : "specOut" } , a ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FEPOINTLIGHT , { x : - 5E3 , y : - 1E4 , z : 2E4 } , b ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FECOMPOSITE , { "in" : "specOut" , in2 : "SourceAlpha" , operator : "in" , result : "specOut" } , a ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FECOMPOSITE ,
{ "in" : "SourceGraphic" , in2 : "specOut" , operator : "arithmetic" , k1 : 0 , k2 : 1 , k3 : 1 , k4 : 0 } , a ) ; this . embossFilterId = a . id ; this . embossFilter _ = a ; a = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . PATTERN , { id : "blocklyDisabledPattern" + this . randomIdentifier , patternUnits : "userSpaceOnUse" , width : 10 , height : 10 } , this . defs _ ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { width : 10 , height : 10 , fill : "#aaa" } , a ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . PATH ,
{ d : "M 0 0 L 10 10 M 10 0 L 0 10" , stroke : "#cc0" } , a ) ; this . disabledPatternId = a . id ; this . disabledPattern _ = a ; this . createDebugFilter ( ) } createDebugFilter ( ) { if ( ! this . debugFilter _ ) { const a = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FILTER , { id : "blocklyDebugFilter" + this . randomIdentifier , height : "160%" , width : "180%" , y : "-30%" , x : "-40%" } , this . defs _ ) , b = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FECOMPONENTTRANSFER , { result : "outBlur" } ,
a ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FEFUNCA , { type : "table" , tableValues : "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1" } , b ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FEFLOOD , { "flood-color" : "#ff0000" , "flood-opacity" : . 5 , result : "outColor" } , a ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FECOMPOSITE , { "in" : "outColor" , in2 : "outBlur" , operator : "in" , result : "outGlow" } , a ) ; this . debugFilterId =
a . id ; this . debugFilter _ = a } } injectCSS _ ( a , b ) { b = this . getCSS _ ( b ) ; a = "blockly-renderer-style-" + a ; this . cssNode _ = document . getElementById ( a ) ; const c = b . join ( "\n" ) ; this . cssNode _ ? this . cssNode _ . firstChild . textContent = c : ( b = document . createElement ( "style" ) , b . id = a , a = document . createTextNode ( c ) , b . appendChild ( a ) , document . head . insertBefore ( b , document . head . firstChild ) , this . cssNode _ = b ) } getCSS _ ( a ) { return [ ` ${ a } .blocklyText, ` , ` ${ a } .blocklyFlyoutLabelText { ` , ` font: ${ this . FIELD _TEXT _FONTWEIGHT } ` + ` ${ this . FIELD _TEXT _FONTSIZE } pt ${ this . FIELD _TEXT _FONTFAMILY } ; ` ,
"}" , ` ${ a } .blocklyText { ` , "fill: #fff;" , "}" , ` ${ a } .blocklyNonEditableText>rect, ` , ` ${ a } .blocklyEditableText>rect { ` , ` fill: ${ this . FIELD _BORDER _RECT _COLOUR } ; ` , "fill-opacity: .6;" , "stroke: none;" , "}" , ` ${ a } .blocklyNonEditableText>text, ` , ` ${ a } .blocklyEditableText>text { ` , "fill: #000;" , "}" , ` ${ a } .blocklyFlyoutLabelText { ` , "fill: #000;" , "}" , ` ${ a } .blocklyText.blocklyBubbleText { ` , "fill: #000;" , "}" , ` ${ a } .blocklyEditableText:not(.editing):hover>rect { ` , "stroke: #fff;" , "stroke-width: 2;" , "}" , ` ${ a } .blocklyHtmlInput { ` ,
` font-family: ${ this . FIELD _TEXT _FONTFAMILY } ; ` , ` font-weight: ${ this . FIELD _TEXT _FONTWEIGHT } ; ` , "}" , ` ${ a } .blocklySelected>.blocklyPath { ` , "stroke: #fc3;" , "stroke-width: 3px;" , "}" , ` ${ a } .blocklyHighlightedConnectionPath { ` , "stroke: #fc3;" , "}" , ` ${ a } .blocklyReplaceable .blocklyPath { ` , "fill-opacity: .5;" , "}" , ` ${ a } .blocklyReplaceable .blocklyPathLight, ` , ` ${ a } .blocklyReplaceable .blocklyPathDark { ` , "display: none;" , "}" , ` ${ a } .blocklyInsertionMarker>.blocklyPath { ` , ` fill-opacity: ${ this . INSERTION _MARKER _OPACITY } ; ` ,
"stroke: none;" , "}" ] } } , module$build$src$core$renderers$common$constants = { } ; module$build$src$core$renderers$common$constants . ConstantProvider = ConstantProvider$$module$build$src$core$renderers$common$constants ; module$build$src$core$renderers$common$constants . isDynamicShape = isDynamicShape$$module$build$src$core$renderers$common$constants ; var useDebugger$$module$build$src$core$renderers$common$debug = ! 1 , module$build$src$core$renderers$common$debug = { } ; module$build$src$core$renderers$common$debug . isDebuggerEnabled = isDebuggerEnabled$$module$build$src$core$renderers$common$debug ; module$build$src$core$renderers$common$debug . startDebugger = startDebugger$$module$build$src$core$renderers$common$debug ; module$build$src$core$renderers$common$debug . stopDebugger = stopDebugger$$module$build$src$core$renderers$common$debug ; var Debug$$module$build$src$core$renderers$common$debugger = class { constructor ( a ) { this . constants = a ; this . debugElements _ = [ ] ; this . svgRoot _ = null ; this . randomColour _ = "" } clearElems ( ) { for ( let a = 0 ; a < this . debugElements _ . length ; a ++ ) removeNode$$module$build$src$core$utils$dom ( this . debugElements _ [ a ] ) ; this . debugElements _ = [ ] } drawSpacerRow ( a , b , c ) { if ( Debug$$module$build$src$core$renderers$common$debugger . config . rowSpacers ) { var d = Math . abs ( a . height ) , e = 0 > a . height ; e && ( b -= d ) ; this . debugElements _ . push ( createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT ,
{ "class" : "rowSpacerRect blockRenderDebug" , x : c ? - ( a . xPos + a . width ) : a . xPos , y : b , width : a . width , height : d , stroke : e ? "black" : "blue" , fill : "blue" , "fill-opacity" : "0.5" , "stroke-width" : "1px" } , this . svgRoot _ ) ) } } drawSpacerElem ( a , b , c ) { if ( Debug$$module$build$src$core$renderers$common$debugger . config . elemSpacers ) { b = Math . abs ( a . width ) ; var d = 0 > a . width , e = d ? a . xPos - b : a . xPos ; c && ( e = - ( e + b ) ) ; this . debugElements _ . push ( createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "elemSpacerRect blockRenderDebug" ,
x : e , y : a . centerline - a . height / 2 , width : b , height : a . height , stroke : "pink" , fill : d ? "black" : "pink" , "fill-opacity" : "0.5" , "stroke-width" : "1px" } , this . svgRoot _ ) ) } } drawRenderedElem ( a , b ) { if ( Debug$$module$build$src$core$renderers$common$debugger . config . elems ) { let c = a . xPos ; b && ( c = - ( c + a . width ) ) ; b = a . centerline - a . height / 2 ; this . debugElements _ . push ( createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "rowRenderingRect blockRenderDebug" , x : c , y : b , width : a . width , height : a . height ,
stroke : "black" , fill : "none" , "stroke-width" : "1px" } , this . svgRoot _ ) ) ; Types$$module$build$src$core$renderers$measurables$types . isField ( a ) && a instanceof Field$$module$build$src$core$renderers$measurables$field && a . field instanceof $ . FieldLabel$$module$build$src$core$field _label && this . debugElements _ . push ( createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "rowRenderingRect blockRenderDebug" , x : c , y : b + this . constants . FIELD _TEXT _BASELINE , width : a . width , height : "0.1px" ,
stroke : "red" , fill : "none" , "stroke-width" : "0.5px" } , this . svgRoot _ ) ) } Types$$module$build$src$core$renderers$measurables$types . isInput ( a ) && a instanceof InputConnection$$module$build$src$core$renderers$measurables$input _connection && Debug$$module$build$src$core$renderers$common$debugger . config . connections && this . drawConnection ( a . connectionModel ) } drawConnection ( a ) { if ( Debug$$module$build$src$core$renderers$common$debugger . config . connections ) { var b = "" , c = 0 , d = "" ; a . type === ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE ?
( c = 4 , b = "magenta" , d = "none" ) : a . type === ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE ? ( c = 2 , d = b = "magenta" ) : a . type === ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT ? ( c = 4 , b = "goldenrod" , d = "none" ) : a . type === ConnectionType$$module$build$src$core$connection _type . PREVIOUS _STATEMENT && ( c = 2 , d = b = "goldenrod" ) ; this . debugElements _ . push ( createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . CIRCLE , { "class" : "blockRenderDebug" , cx : a . getOffsetInBlock ( ) . x ,
cy : a . getOffsetInBlock ( ) . y , r : c , fill : d , stroke : b } , this . svgRoot _ ) ) } } drawRenderedRow ( a , b , c ) { Debug$$module$build$src$core$renderers$common$debugger . config . rows && ( this . debugElements _ . push ( createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "elemRenderingRect blockRenderDebug" , x : c ? - ( a . xPos + a . width ) : a . xPos , y : a . yPos , width : a . width , height : a . height , stroke : "red" , fill : "none" , "stroke-width" : "1px" } , this . svgRoot _ ) ) , Types$$module$build$src$core$renderers$measurables$types . isTopOrBottomRow ( a ) ||
Debug$$module$build$src$core$renderers$common$debugger . config . connectedBlockBounds && this . debugElements _ . push ( createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "connectedBlockWidth blockRenderDebug" , x : c ? - ( a . xPos + a . widthWithConnectedBlocks ) : a . xPos , y : a . yPos , width : a . widthWithConnectedBlocks , height : a . height , stroke : this . randomColour _ , fill : "none" , "stroke-width" : "1px" , "stroke-dasharray" : "3,3" } , this . svgRoot _ ) ) ) } drawRowWithElements ( a , b , c ) { for ( let d = 0 ; d < a . elements . length ; d ++ ) { const e =
a . elements [ d ] ; e ? Types$$module$build$src$core$renderers$measurables$types . isSpacer ( e ) ? this . drawSpacerElem ( e , a . height , c ) : this . drawRenderedElem ( e , c ) : console . warn ( "A row has an undefined or null element." , a , e ) } this . drawRenderedRow ( a , b , c ) } drawBoundingBox ( a ) { if ( Debug$$module$build$src$core$renderers$common$debugger . config . blockBounds ) { var b = a . RTL ? - a . width : 0 ; this . debugElements _ . push ( createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "blockBoundingBox blockRenderDebug" ,
x : b , y : 0 , width : a . width , height : a . height , stroke : "black" , fill : "none" , "stroke-width" : "1px" , "stroke-dasharray" : "5,5" } , this . svgRoot _ ) ) ; Debug$$module$build$src$core$renderers$common$debugger . config . connectedBlockBounds && ( b = a . RTL ? - a . widthWithChildren : 0 , this . debugElements _ . push ( createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "blockRenderDebug" , x : b , y : 0 , width : a . widthWithChildren , height : a . height , stroke : "#DF57BC" , fill : "none" , "stroke-width" : "1px" , "stroke-dasharray" : "3,3" } ,
this . svgRoot _ ) ) ) } } drawDebug ( a , b ) { this . clearElems ( ) ; this . svgRoot _ = a . getSvgRoot ( ) ; this . randomColour _ = "#" + Math . floor ( 16777215 * Math . random ( ) ) . toString ( 16 ) ; let c = 0 ; for ( let d = 0 ; d < b . rows . length ; d ++ ) { const e = b . rows [ d ] ; Types$$module$build$src$core$renderers$measurables$types . isBetweenRowSpacer ( e ) ? this . drawSpacerRow ( e , c , b . RTL ) : this . drawRowWithElements ( e , c , b . RTL ) ; c += e . height } a . previousConnection && this . drawConnection ( a . previousConnection ) ; a . nextConnection && this . drawConnection ( a . nextConnection ) ; a . outputConnection &&
this . drawConnection ( a . outputConnection ) ; b . rightSide && this . drawRenderedElem ( b . rightSide , b . RTL ) ; this . drawBoundingBox ( b ) ; this . drawRender ( a . pathObject . svgPath ) } drawRender ( a ) { Debug$$module$build$src$core$renderers$common$debugger . config . render && ( a . setAttribute ( "filter" , "url(#" + this . constants . debugFilterId + ")" ) , setTimeout ( function ( ) { a . setAttribute ( "filter" , "" ) } , 100 ) ) } } ;
Debug$$module$build$src$core$renderers$common$debugger . config = { rowSpacers : ! 0 , elemSpacers : ! 0 , rows : ! 0 , elems : ! 0 , connections : ! 0 , blockBounds : ! 0 , connectedBlockBounds : ! 0 , render : ! 0 } ; var module$build$src$core$renderers$common$debugger = { } ; module$build$src$core$renderers$common$debugger . Debug = Debug$$module$build$src$core$renderers$common$debugger ; var Drawer$$module$build$src$core$renderers$common$drawer = class { constructor ( a , b ) { this . inlinePath _ = this . outlinePath _ = "" ; this . block _ = a ; this . info _ = b ; this . topLeft _ = a . getRelativeToSurfaceXY ( ) ; this . constants _ = b . getRenderer ( ) . getConstants ( ) } draw ( ) { this . hideHiddenIcons _ ( ) ; this . drawOutline _ ( ) ; this . drawInternals _ ( ) ; this . block _ . pathObject . setPath ( this . outlinePath _ + "\n" + this . inlinePath _ ) ; this . info _ . RTL && this . block _ . pathObject . flipRTL ( ) ; if ( isDebuggerEnabled$$module$build$src$core$renderers$common$debug ( ) ) { let a ;
null == ( a = this . block _ . renderingDebugger ) || a . drawDebug ( this . block _ , this . info _ ) } this . recordSizeOnBlock _ ( ) } recordSizeOnBlock _ ( ) { this . block _ . height = this . info _ . height ; this . block _ . width = this . info _ . widthWithChildren } hideHiddenIcons _ ( ) { for ( let a = 0 , b ; b = this . info _ . hiddenIcons [ a ] ; a ++ ) { let c ; null == ( c = b . icon . iconGroup _ ) || c . setAttribute ( "display" , "none" ) } } drawOutline _ ( ) { this . drawTop _ ( ) ; for ( let a = 1 ; a < this . info _ . rows . length - 1 ; a ++ ) { const b = this . info _ . rows [ a ] ; b . hasJaggedEdge ? this . drawJaggedEdge _ ( b ) : b . hasStatement ? this . drawStatementInput _ ( b ) :
b . hasExternalInput ? this . drawValueInput _ ( b ) : this . drawRightSideRow _ ( b ) } this . drawBottom _ ( ) ; this . drawLeft _ ( ) } drawTop _ ( ) { const a = this . info _ . topRow , b = a . elements ; this . positionPreviousConnection _ ( ) ; this . outlinePath _ += moveBy$$module$build$src$core$utils$svg _paths ( a . xPos , this . info _ . startY ) ; for ( let c = 0 , d ; d = b [ c ] ; c ++ ) Types$$module$build$src$core$renderers$measurables$types . isLeftRoundedCorner ( d ) ? this . outlinePath _ += this . constants _ . OUTSIDE _CORNERS . topLeft : Types$$module$build$src$core$renderers$measurables$types . isRightRoundedCorner ( d ) ?
this . outlinePath _ += this . constants _ . OUTSIDE _CORNERS . topRight : Types$$module$build$src$core$renderers$measurables$types . isPreviousConnection ( d ) && d instanceof Connection$$module$build$src$core$renderers$measurables$connection ? this . outlinePath _ += d . shape . pathLeft : Types$$module$build$src$core$renderers$measurables$types . isHat ( d ) ? this . outlinePath _ += this . constants _ . START _HAT . path : Types$$module$build$src$core$renderers$measurables$types . isSpacer ( d ) && ( this . outlinePath _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" ,
d . width ) ) ; this . outlinePath _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , a . height ) } drawJaggedEdge _ ( a ) { this . outlinePath _ += this . constants _ . JAGGED _TEETH . path + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , a . height - this . constants _ . JAGGED _TEETH . height ) } drawValueInput _ ( a ) { const b = a . getLastInput ( ) ; this . positionExternalValueConnection _ ( a ) ; const c = isDynamicShape$$module$build$src$core$renderers$common$constants ( b . shape ) ? b . shape . pathDown ( b . height ) : b . shape . pathDown ; this . outlinePath _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "H" ,
b . xPos + b . width ) + c + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , a . height - b . connectionHeight ) } drawStatementInput _ ( a ) { var b = a . getLastInput ( ) ; if ( b ) { var c = b . xPos + b . notchOffset + b . shape . width ; b = b . shape . pathRight + lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , - ( b . notchOffset - this . constants _ . INSIDE _CORNERS . width ) ) + this . constants _ . INSIDE _CORNERS . pathTop ; var d = a . height - 2 * this . constants _ . INSIDE _CORNERS . height ; this . outlinePath _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "H" , c ) + b + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" ,
d ) + this . constants _ . INSIDE _CORNERS . pathBottom + lineOnAxis$$module$build$src$core$utils$svg _paths ( "H" , a . xPos + a . width ) ; this . positionStatementInputConnection _ ( a ) } } drawRightSideRow _ ( a ) { this . outlinePath _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "V" , a . yPos + a . height ) } drawBottom _ ( ) { const a = this . info _ . bottomRow , b = a . elements ; this . positionNextConnection _ ( ) ; let c = 0 , d = "" ; for ( let e = b . length - 1 , f ; f = b [ e ] ; e -- ) Types$$module$build$src$core$renderers$measurables$types . isNextConnection ( f ) && f instanceof Connection$$module$build$src$core$renderers$measurables$connection ?
d += f . shape . pathRight : Types$$module$build$src$core$renderers$measurables$types . isLeftSquareCorner ( f ) ? d += lineOnAxis$$module$build$src$core$utils$svg _paths ( "H" , a . xPos ) : Types$$module$build$src$core$renderers$measurables$types . isLeftRoundedCorner ( f ) ? d += this . constants _ . OUTSIDE _CORNERS . bottomLeft : Types$$module$build$src$core$renderers$measurables$types . isRightRoundedCorner ( f ) ? ( d += this . constants _ . OUTSIDE _CORNERS . bottomRight , c = this . constants _ . OUTSIDE _CORNERS . rightHeight ) : Types$$module$build$src$core$renderers$measurables$types . isSpacer ( f ) &&
( d += lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , - 1 * f . width ) ) ; this . outlinePath _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "V" , a . baseline - c ) ; this . outlinePath _ += d } drawLeft _ ( ) { var a = this . info _ . outputConnection ; this . positionOutputConnection _ ( ) ; if ( a ) { const b = a . connectionOffsetY + a . height ; a = isDynamicShape$$module$build$src$core$renderers$common$constants ( a . shape ) ? a . shape . pathUp ( a . height ) : a . shape . pathUp ; this . outlinePath _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "V" , b ) + a } this . outlinePath _ +=
"z" } drawInternals _ ( ) { for ( let a = 0 , b ; b = this . info _ . rows [ a ] ; a ++ ) for ( let c = 0 , d ; d = b . elements [ c ] ; c ++ ) Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( d ) ? this . drawInlineInput _ ( d ) : ( Types$$module$build$src$core$renderers$measurables$types . isIcon ( d ) || Types$$module$build$src$core$renderers$measurables$types . isField ( d ) ) && this . layoutField _ ( d ) } layoutField _ ( a ) { const b = Types$$module$build$src$core$renderers$measurables$types . isField ( a ) ? a . field . getSvgRoot ( ) : a . icon . iconGroup _ , c = a . centerline - a . height /
2 ; let d = a . xPos , e = "" ; this . info _ . RTL && ( d = - ( d + a . width ) , a . flipRtl && ( d += a . width , e = "scale(-1 1)" ) ) ; Types$$module$build$src$core$renderers$measurables$types . isIcon ( a ) ? ( b . setAttribute ( "display" , "block" ) , b . setAttribute ( "transform" , "translate(" + d + "," + c + ")" ) , a . icon . computeIconLocation ( ) ) : b . setAttribute ( "transform" , "translate(" + d + "," + c + ")" + e ) ; this . info _ . isInsertionMarker && b . setAttribute ( "display" , "none" ) } drawInlineInput _ ( a ) { const b = a . width , c = a . height , d = a . connectionOffsetY , e = a . connectionHeight + d ; this . inlinePath _ +=
moveTo$$module$build$src$core$utils$svg _paths ( a . xPos + a . connectionWidth , a . centerline - c / 2 ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , d ) + a . shape . pathDown + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , c - e ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , b - a . connectionWidth ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , - c ) + "z" ; this . positionInlineInputConnection _ ( a ) } positionInlineInputConnection _ ( a ) { const b = a . centerline - a . height / 2 ; if ( a . connectionModel ) { let c = a . xPos + a . connectionWidth +
a . connectionOffsetX ; this . info _ . RTL && ( c *= - 1 ) ; a . connectionModel . setOffsetInBlock ( c , b + a . connectionOffsetY ) } } positionStatementInputConnection _ ( a ) { const b = a . getLastInput ( ) ; if ( null == b ? 0 : b . connectionModel ) { let c = a . xPos + a . statementEdge + b . notchOffset ; this . info _ . RTL && ( c *= - 1 ) ; b . connectionModel . setOffsetInBlock ( c , a . yPos ) } } positionExternalValueConnection _ ( a ) { const b = a . getLastInput ( ) ; if ( b && b . connectionModel ) { let c = a . xPos + a . width ; this . info _ . RTL && ( c *= - 1 ) ; b . connectionModel . setOffsetInBlock ( c , a . yPos ) } } positionPreviousConnection _ ( ) { const a =
this . info _ . topRow ; if ( a . connection ) { const b = a . xPos + a . notchOffset ; a . connection . connectionModel . setOffsetInBlock ( this . info _ . RTL ? - b : b , 0 ) } } positionNextConnection _ ( ) { const a = this . info _ . bottomRow ; if ( a . connection ) { const b = a . connection , c = b . xPos ; b . connectionModel . setOffsetInBlock ( this . info _ . RTL ? - c : c , a . baseline ) } } positionOutputConnection _ ( ) { if ( this . info _ . outputConnection ) { const a = this . info _ . startX + this . info _ . outputConnection . connectionOffsetX ; this . block _ . outputConnection . setOffsetInBlock ( this . info _ . RTL ? - a : a ,
this . info _ . outputConnection . connectionOffsetY ) } } } , module$build$src$core$renderers$common$drawer = { } ; module$build$src$core$renderers$common$drawer . Drawer = Drawer$$module$build$src$core$renderers$common$drawer ; var RenderInfo$$module$build$src$core$renderers$common$info = class { constructor ( a , b ) { this . statementEdge = this . width = this . widthWithChildren = this . height = 0 ; this . rows = [ ] ; this . inputRows = [ ] ; this . hiddenIcons = [ ] ; this . startY = this . startX = 0 ; this . renderer _ = a ; this . block _ = b ; this . constants _ = this . renderer _ . getConstants ( ) ; this . outputConnection = b . outputConnection ? new OutputConnection$$module$build$src$core$renderers$measurables$output _connection ( this . constants _ , b . outputConnection ) : null ; this . isInline = b . getInputsInline ( ) &&
! b . isCollapsed ( ) ; this . isCollapsed = b . isCollapsed ( ) ; this . isInsertionMarker = b . isInsertionMarker ( ) ; this . RTL = b . RTL ; this . topRow = new TopRow$$module$build$src$core$renderers$measurables$top _row ( this . constants _ ) ; this . bottomRow = new BottomRow$$module$build$src$core$renderers$measurables$bottom _row ( this . constants _ ) } getRenderer ( ) { return this . renderer _ } measure ( ) { this . createRows _ ( ) ; this . addElemSpacing _ ( ) ; this . addRowSpacing _ ( ) ; this . computeBounds _ ( ) ; this . alignRowElements _ ( ) ; this . finalize _ ( ) } createRows _ ( ) { this . populateTopRow _ ( ) ;
this . rows . push ( this . topRow ) ; let a = new InputRow$$module$build$src$core$renderers$measurables$input _row ( this . constants _ ) ; this . inputRows . push ( a ) ; var b = this . block _ . getIcons ( ) ; for ( let c = 0 , d ; d = b [ c ] ; c ++ ) { const e = new Icon$$module$build$src$core$renderers$measurables$icon ( this . constants _ , d ) ; this . isCollapsed && d . collapseHidden ? this . hiddenIcons . push ( e ) : a . elements . push ( e ) } b = void 0 ; for ( let c = 0 , d ; d = this . block _ . inputList [ c ] ; c ++ ) if ( d . isVisible ( ) ) { this . shouldStartNewRow _ ( d , b ) && ( this . rows . push ( a ) , a = new InputRow$$module$build$src$core$renderers$measurables$input _row ( this . constants _ ) ,
this . inputRows . push ( a ) ) ; for ( let e = 0 , f ; f = d . fieldRow [ e ] ; e ++ ) a . elements . push ( new Field$$module$build$src$core$renderers$measurables$field ( this . constants _ , f , d ) ) ; this . addInput _ ( d , a ) ; b = d } this . isCollapsed && ( a . hasJaggedEdge = ! 0 , a . elements . push ( new JaggedEdge$$module$build$src$core$renderers$measurables$jagged _edge ( this . constants _ ) ) ) ; ( a . elements . length || a . hasDummyInput ) && this . rows . push ( a ) ; this . populateBottomRow _ ( ) ; this . rows . push ( this . bottomRow ) } populateTopRow _ ( ) { var a = ! ! this . block _ . previousConnection ; const b =
( this . block _ . hat ? "cap" === this . block _ . hat : this . constants _ . ADD _START _HATS ) && ! this . outputConnection && ! a ; let c = this . topRow . hasLeftSquareCorner ( this . block _ ) ? SquareCorner$$module$build$src$core$renderers$measurables$square _corner : RoundCorner$$module$build$src$core$renderers$measurables$round _corner ; this . topRow . elements . push ( new c ( this . constants _ ) ) ; b ? ( a = new Hat$$module$build$src$core$renderers$measurables$hat ( this . constants _ ) , this . topRow . elements . push ( a ) , this . topRow . capline = a . ascenderHeight ) : a && ( this . topRow . hasPreviousConnection =
! 0 , this . topRow . connection = new PreviousConnection$$module$build$src$core$renderers$measurables$previous _connection ( this . constants _ , this . block _ . previousConnection ) , this . topRow . elements . push ( this . topRow . connection ) ) ; this . block _ . inputList . length && this . block _ . inputList [ 0 ] . type === inputTypes$$module$build$src$core$input _types . STATEMENT && ! this . block _ . isCollapsed ( ) ? this . topRow . minHeight = this . constants _ . TOP _ROW _PRECEDES _STATEMENT _MIN _HEIGHT : this . topRow . minHeight = this . constants _ . TOP _ROW _MIN _HEIGHT ; c = this . topRow . hasRightSquareCorner ( this . block _ ) ?
SquareCorner$$module$build$src$core$renderers$measurables$square _corner : RoundCorner$$module$build$src$core$renderers$measurables$round _corner ; this . topRow . elements . push ( new c ( this . constants _ , "right" ) ) } populateBottomRow _ ( ) { this . bottomRow . hasNextConnection = ! ! this . block _ . nextConnection ; this . bottomRow . minHeight = this . block _ . inputList . length && this . block _ . inputList [ this . block _ . inputList . length - 1 ] . type === inputTypes$$module$build$src$core$input _types . STATEMENT ? this . constants _ . BOTTOM _ROW _AFTER _STATEMENT _MIN _HEIGHT :
this . constants _ . BOTTOM _ROW _MIN _HEIGHT ; this . bottomRow . hasLeftSquareCorner ( this . block _ ) ? this . bottomRow . elements . push ( new SquareCorner$$module$build$src$core$renderers$measurables$square _corner ( this . constants _ ) ) : this . bottomRow . elements . push ( new RoundCorner$$module$build$src$core$renderers$measurables$round _corner ( this . constants _ ) ) ; this . bottomRow . hasNextConnection && ( this . bottomRow . connection = new NextConnection$$module$build$src$core$renderers$measurables$next _connection ( this . constants _ , this . block _ . nextConnection ) ,
this . bottomRow . elements . push ( this . bottomRow . connection ) ) ; this . bottomRow . hasRightSquareCorner ( this . block _ ) ? this . bottomRow . elements . push ( new SquareCorner$$module$build$src$core$renderers$measurables$square _corner ( this . constants _ , "right" ) ) : this . bottomRow . elements . push ( new RoundCorner$$module$build$src$core$renderers$measurables$round _corner ( this . constants _ , "right" ) ) } addInput _ ( a , b ) { this . isInline && a . type === inputTypes$$module$build$src$core$input _types . VALUE ? ( b . elements . push ( new InlineInput$$module$build$src$core$renderers$measurables$inline _input ( this . constants _ ,
a ) ) , b . hasInlineInput = ! 0 ) : a . type === inputTypes$$module$build$src$core$input _types . STATEMENT ? ( b . elements . push ( new StatementInput$$module$build$src$core$renderers$measurables$statement _input ( this . constants _ , a ) ) , b . hasStatement = ! 0 ) : a . type === inputTypes$$module$build$src$core$input _types . VALUE ? ( b . elements . push ( new ExternalValueInput$$module$build$src$core$renderers$measurables$external _value _input ( this . constants _ , a ) ) , b . hasExternalInput = ! 0 ) : a . type === inputTypes$$module$build$src$core$input _types . DUMMY && ( b . minHeight =
Math . max ( b . minHeight , a . getSourceBlock ( ) && a . getSourceBlock ( ) . isShadow ( ) ? this . constants _ . DUMMY _INPUT _SHADOW _MIN _HEIGHT : this . constants _ . DUMMY _INPUT _MIN _HEIGHT ) , b . hasDummyInput = ! 0 ) ; null === b . align && ( b . align = a . align ) } shouldStartNewRow _ ( a , b ) { return b ? a . type === inputTypes$$module$build$src$core$input _types . STATEMENT || b . type === inputTypes$$module$build$src$core$input _types . STATEMENT ? ! 0 : a . type === inputTypes$$module$build$src$core$input _types . VALUE || a . type === inputTypes$$module$build$src$core$input _types . DUMMY ?
! this . isInline : ! 1 : ! 1 } addElemSpacing _ ( ) { for ( let a = 0 , b ; b = this . rows [ a ] ; a ++ ) { const c = b . elements ; b . elements = [ ] ; b . startsWithElemSpacer ( ) && b . elements . push ( new InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ( this . constants _ , this . getInRowSpacing _ ( null , c [ 0 ] ) ) ) ; if ( c . length ) { for ( let d = 0 ; d < c . length - 1 ; d ++ ) { b . elements . push ( c [ d ] ) ; const e = this . getInRowSpacing _ ( c [ d ] , c [ d + 1 ] ) ; b . elements . push ( new InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ( this . constants _ , e ) ) } b . elements . push ( c [ c . length -
1 ] ) ; b . endsWithElemSpacer ( ) && b . elements . push ( new InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ( this . constants _ , this . getInRowSpacing _ ( c [ c . length - 1 ] , null ) ) ) } } } getInRowSpacing _ ( a , b ) { if ( ! a && b && Types$$module$build$src$core$renderers$measurables$types . isStatementInput ( b ) ) return this . constants _ . STATEMENT _INPUT _PADDING _LEFT ; if ( a && Types$$module$build$src$core$renderers$measurables$types . isInput ( a ) && ! b ) { if ( Types$$module$build$src$core$renderers$measurables$types . isExternalInput ( a ) ) return this . constants _ . NO _PADDING ;
if ( Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( a ) ) return this . constants _ . LARGE _PADDING ; if ( Types$$module$build$src$core$renderers$measurables$types . isStatementInput ( a ) ) return this . constants _ . NO _PADDING } return a && Types$$module$build$src$core$renderers$measurables$types . isLeftSquareCorner ( a ) && b && ( Types$$module$build$src$core$renderers$measurables$types . isPreviousConnection ( b ) || Types$$module$build$src$core$renderers$measurables$types . isNextConnection ( b ) ) ? b . notchOffset : a && Types$$module$build$src$core$renderers$measurables$types . isLeftRoundedCorner ( a ) &&
b && ( Types$$module$build$src$core$renderers$measurables$types . isPreviousConnection ( b ) || Types$$module$build$src$core$renderers$measurables$types . isNextConnection ( b ) ) ? b . notchOffset - this . constants _ . CORNER _RADIUS : this . constants _ . MEDIUM _PADDING } computeBounds _ ( ) { let a = 0 , b = 0 , c = 0 ; for ( let e = 0 , f ; f = this . rows [ e ] ; e ++ ) { f . measure ( ) ; b = Math . max ( b , f . width ) ; if ( f . hasStatement ) { var d = f . getLastInput ( ) ; let g , h ; d = f . width - ( null != ( h = null == ( g = d ) ? void 0 : g . width ) ? h : 0 ) ; a = Math . max ( a , d ) } c = Math . max ( c , f . widthWithConnectedBlocks ) } this . statementEdge =
a ; this . width = b ; for ( let e = 0 , f ; f = this . rows [ e ] ; e ++ ) f . hasStatement && ( f . statementEdge = this . statementEdge ) ; this . widthWithChildren = Math . max ( b , c ) ; this . outputConnection && ( this . startX = this . outputConnection . width , this . width += this . outputConnection . width , this . widthWithChildren += this . outputConnection . width ) } alignRowElements _ ( ) { for ( let b = 0 , c ; c = this . rows [ b ] ; b ++ ) if ( c . hasStatement ) this . alignStatementRow _ ( c ) ; else { var a = c . width ; a = this . getDesiredRowWidth _ ( c ) - a ; 0 < a && this . addAlignmentPadding _ ( c , a ) ; Types$$module$build$src$core$renderers$measurables$types . isTopOrBottomRow ( c ) &&
( c . widthWithConnectedBlocks = c . width ) } } getDesiredRowWidth _ ( a ) { return this . width - this . startX } addAlignmentPadding _ ( a , b ) { const c = a . getFirstSpacer ( ) , d = a . getLastSpacer ( ) ; if ( a . hasExternalInput || a . hasStatement ) a . widthWithConnectedBlocks += b ; if ( a . align === $ . Align$$module$build$src$core$input . LEFT && d ) d . width += b ; else if ( a . align === $ . Align$$module$build$src$core$input . CENTRE && c && d ) c . width += b / 2 , d . width += b / 2 ; else if ( a . align === $ . Align$$module$build$src$core$input . RIGHT && c ) c . width += b ; else if ( d ) d . width += b ; else return ;
a . width += b } alignStatementRow _ ( a ) { const b = a . getLastInput ( ) ; if ( b ) { var c = a . width - b . width , d = this . statementEdge ; c = d - c ; 0 < c && this . addAlignmentPadding _ ( a , c ) ; c = a . width ; d = this . getDesiredRowWidth _ ( a ) ; b . width += d - c ; b . height = Math . max ( b . height , a . height ) ; a . width += d - c ; a . widthWithConnectedBlocks = Math . max ( a . width , this . statementEdge + a . connectedBlockWidths ) } } addRowSpacing _ ( ) { const a = this . rows ; this . rows = [ ] ; for ( let b = 0 ; b < a . length ; b ++ ) this . rows . push ( a [ b ] ) , b !== a . length - 1 && this . rows . push ( this . makeSpacerRow _ ( a [ b ] , a [ b + 1 ] ) ) } makeSpacerRow _ ( a ,
b ) { var c = this . getSpacerRowHeight _ ( a , b ) ; const d = this . getSpacerRowWidth _ ( a , b ) ; c = new SpacerRow$$module$build$src$core$renderers$measurables$spacer _row ( this . constants _ , c , d ) ; a . hasStatement && ( c . followsStatement = ! 0 ) ; b . hasStatement && ( c . precedesStatement = ! 0 ) ; return c } getSpacerRowWidth _ ( a , b ) { return this . width - this . startX } getSpacerRowHeight _ ( a , b ) { return this . constants _ . MEDIUM _PADDING } getElemCenterline _ ( a , b ) { return Types$$module$build$src$core$renderers$measurables$types . isSpacer ( b ) ? a . yPos + b . height / 2 : Types$$module$build$src$core$renderers$measurables$types . isBottomRow ( a ) ?
( a = a . yPos + a . height - a . descenderHeight , Types$$module$build$src$core$renderers$measurables$types . isNextConnection ( b ) ? a + b . height / 2 : a - b . height / 2 ) : Types$$module$build$src$core$renderers$measurables$types . isTopRow ( a ) ? Types$$module$build$src$core$renderers$measurables$types . isHat ( b ) ? a . capline - b . height / 2 : a . capline + b . height / 2 : a . yPos + a . height / 2 } recordElemPositions _ ( a ) { let b = a . xPos ; for ( let c = 0 , d ; d = a . elements [ c ] ; c ++ ) Types$$module$build$src$core$renderers$measurables$types . isSpacer ( d ) && ( d . height = a . height ) , d . xPos =
b , d . centerline = this . getElemCenterline _ ( a , d ) , b += d . width } finalize _ ( ) { let a = 0 , b = 0 ; for ( let c = 0 , d ; d = this . rows [ c ] ; c ++ ) d . yPos = b , d . xPos = this . startX , b += d . height , a = Math . max ( a , d . widthWithConnectedBlocks ) , this . recordElemPositions _ ( d ) ; if ( this . outputConnection && this . block _ . nextConnection ) { const c = this . block _ . nextConnection . targetBlock ( ) ; c && ( a = Math . max ( a , c . getHeightWidth ( ) . width ) ) } this . widthWithChildren = a + this . startX ; this . height = b ; this . startY = this . topRow . capline ; this . bottomRow . baseline = b - this . bottomRow . descenderHeight } } ,
module$build$src$core$renderers$common$info = { } ; module$build$src$core$renderers$common$info . RenderInfo = RenderInfo$$module$build$src$core$renderers$common$info ; 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" ) ;
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 } fromJson ( a ) { super . fromJson ( a ) ; this . isCursor = a . isCursor ; this . blockId = a . blockId ; this . oldNode = a . oldNode ; this . newNode = a . newNode } } ; 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 _ = 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 ) : a . getType ( ) === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . PREVIOUS ? this . showWithPrevious _ ( a ) : a . getType ( ) === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . FIELD ? this . showWithField _ ( a ) : a . getType ( ) === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . WORKSPACE ? this . showWithCoordinates _ ( a ) : a . getType ( ) === ASTNode$$module$build$src$core$keyboard _nav$ast _node . types . STACK && this . showWithStack _ ( a ) } showWithBlockPrevOutput _ ( a ) { a = a . getSourceBlock ( ) ; const b =
a . width ; var c = a . height , d = c * HEIGHT _MULTIPLIER$$module$build$src$core$renderers$common$marker _svg ; const e = this . constants _ . CURSOR _BLOCK _PADDING ; a . previousConnection ? ( c = this . constants _ . shapeFor ( a . previousConnection ) , this . positionPrevious _ ( b , e , d , c ) ) : a . outputConnection ? ( d = this . constants _ . shapeFor ( a . outputConnection ) , this . positionOutput _ ( b , c , d ) ) : this . positionBlock _ ( b , e , d ) ; this . setParent _ ( a ) ; this . showCurrent _ ( ) } showWithBlock _ ( a ) { this . showWithBlockPrevOutput _ ( a ) } showWithPrevious _ ( a ) { this . showWithBlockPrevOutput _ ( a ) } showWithOutput _ ( a ) { this . showWithBlockPrevOutput _ ( a ) } showWithCoordinates _ ( a ) { var b =
a . getWsCoordinate ( ) ; a = b . x ; b = b . y ; this . workspace . RTL && ( a -= this . constants _ . CURSOR _WS _WIDTH ) ; this . positionLine _ ( a , b , this . constants _ . CURSOR _WS _WIDTH ) ; this . setParent _ ( this . workspace ) ; this . showCurrent _ ( ) } showWithField _ ( a ) { a = a . getLocation ( ) ; const b = a . getSize ( ) . width , c = a . getSize ( ) . height ; this . positionRect _ ( 0 , 0 , b , c ) ; this . setParent _ ( a ) ; this . showCurrent _ ( ) } showWithInput _ ( a ) { a = a . getLocation ( ) ; const b = a . getSourceBlock ( ) ; this . positionInput _ ( a ) ; this . setParent _ ( b ) ; this . showCurrent _ ( ) } showWithNext _ ( a ) { var b = a . getLocation ( ) ;
a = b . getSourceBlock ( ) ; let c = 0 ; b = b . getOffsetInBlock ( ) . y ; const d = a . getHeightWidth ( ) . width ; this . workspace . RTL && ( c = - d ) ; this . positionLine _ ( c , b , d ) ; this . setParent _ ( a ) ; this . showCurrent _ ( ) } showWithStack _ ( a ) { a = a . getLocation ( ) ; var b = a . getHeightWidth ( ) ; const c = b . width + this . constants _ . CURSOR _STACK _PADDING ; b = b . height + this . constants _ . CURSOR _STACK _PADDING ; const d = - this . constants _ . CURSOR _STACK _PADDING / 2 , e = - this . constants _ . CURSOR _STACK _PADDING / 2 ; let f = d ; this . workspace . RTL && ( f = - ( c + d ) ) ; this . positionRect _ ( f , e , c , b ) ; this . setParent _ ( a ) ;
this . showCurrent _ ( ) } showCurrent _ ( ) { this . hide ( ) ; this . currentMarkerSvg && ( this . currentMarkerSvg . style . display = "" ) } positionBlock _ ( a , b , c ) { 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" , a + 2 * b ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "V" , c ) ; if ( ! this . markerBlock _ ) throw Error ( "createDom should be called before positioning the marker" ) ; this . markerBlock _ . setAttribute ( "d" , a ) ; this . workspace . RTL &&
this . flipRtl _ ( this . markerBlock _ ) ; this . currentMarkerSvg = this . markerBlock _ } positionInput _ ( a ) { const b = a . getOffsetInBlock ( ) . x , c = a . getOffsetInBlock ( ) . y ; a = moveTo$$module$build$src$core$utils$svg _paths ( 0 , 0 ) + this . constants _ . shapeFor ( a ) . pathDown ; this . markerInput _ . setAttribute ( "d" , a ) ; this . markerInput _ . setAttribute ( "transform" , "translate(" + b + "," + c + ")" + ( this . workspace . RTL ? " scale(-1 1)" : "" ) ) ; this . currentMarkerSvg = this . markerInput _ } positionLine _ ( a , b , c ) { if ( ! this . markerSvgLine _ ) throw Error ( "createDom should be called before positioning the line" ) ;
this . markerSvgLine _ . setAttribute ( "x" , ` ${ a } ` ) ; this . markerSvgLine _ . setAttribute ( "y" , ` ${ b } ` ) ; this . markerSvgLine _ . setAttribute ( "width" , ` ${ c } ` ) ; this . currentMarkerSvg = 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 . 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 , style : "display: none" } , 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 , style : "display: none" } ,
this . markerSvg _ ) ; this . markerInput _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . PATH , { transform : "" , style : "display: none" } , this . markerSvg _ ) ; this . markerBlock _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . PATH , { transform : "" , style : "display: none" , fill : "none" , "stroke-width" : this . constants _ . CURSOR _STROKE _WIDTH } , this . markerSvg _ ) ; 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 ( { } , a , { attributeName : "stroke" } ) , this . markerBlock _ ) } return this . markerSvg _ } applyColour _ ( a ) { if ( ! ( this . markerSvgLine _ && this . markerSvgRect _ && this . markerInput _ && this . markerBlock _ ) ) throw Error ( "createDom should be called before applying color to the markerj" ) ;
this . markerSvgLine _ . setAttribute ( "fill" , this . colour _ ) ; this . markerSvgRect _ . setAttribute ( "stroke" , this . colour _ ) ; this . markerInput _ . setAttribute ( "fill" , this . colour _ ) ; this . markerBlock _ . setAttribute ( "stroke" , this . colour _ ) ; this . isCursor ( ) && ( a = this . colour _ + ";transparent;transparent;" , this . markerSvgLine _ . firstElementChild . setAttribute ( "values" , a ) , this . markerInput _ . firstElementChild . setAttribute ( "values" , a ) , this . markerBlock _ . firstElementChild . setAttribute ( "values" , a ) ) } dispose ( ) { this . svgGroup _ && removeNode$$module$build$src$core$utils$dom ( this . svgGroup _ ) } } ,
module$build$src$core$renderers$common$marker _svg = { } ; module$build$src$core$renderers$common$marker _svg . MarkerSvg = MarkerSvg$$module$build$src$core$renderers$common$marker _svg ; var PathObject$$module$build$src$core$renderers$common$path _object = class { constructor ( a , b , c ) { this . markerSvg = this . cursorSvg = null ; this . constants = c ; this . style = b ; this . svgRoot = a ; this . svgPath = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . PATH , { "class" : "blocklyPath" } , this . svgRoot ) } setPath ( a ) { this . svgPath . setAttribute ( "d" , a ) } flipRTL ( ) { this . svgPath . setAttribute ( "transform" , "scale(-1 1)" ) } setCursorSvg ( a ) { a ? ( this . svgRoot . appendChild ( a ) , this . cursorSvg = a ) : this . cursorSvg =
null } setMarkerSvg ( a ) { a ? ( this . cursorSvg ? this . svgRoot . insertBefore ( a , this . cursorSvg ) : this . svgRoot . appendChild ( a ) , this . markerSvg = a ) : this . markerSvg = null } applyColour ( a ) { if ( ! this . style . colourTertiary ) throw Error ( "The renderer did not properly initialize the block style" ) ; this . svgPath . setAttribute ( "stroke" , this . style . colourTertiary ) ; this . svgPath . setAttribute ( "fill" , this . style . colourPrimary ) ; this . updateShadow _ ( a . isShadow ( ) ) ; this . updateDisabled _ ( ! a . isEnabled ( ) || a . getInheritedDisabled ( ) ) } setStyle ( a ) { this . style =
a } setClass _ ( a , b ) { a && ( b ? addClass$$module$build$src$core$utils$dom ( this . svgRoot , a ) : removeClass$$module$build$src$core$utils$dom ( this . svgRoot , a ) ) } updateHighlighted ( a ) { a ? this . svgPath . setAttribute ( "filter" , "url(#" + this . constants . embossFilterId + ")" ) : this . svgPath . setAttribute ( "filter" , "none" ) } updateShadow _ ( a ) { if ( a ) { if ( ! this . style . colourSecondary ) throw Error ( "The renderer did not properly initialize the block style" ) ; this . svgPath . setAttribute ( "stroke" , "none" ) ; this . svgPath . setAttribute ( "fill" , this . style . colourSecondary ) } } updateDisabled _ ( a ) { this . setClass _ ( "blocklyDisabled" ,
a ) ; a && this . svgPath . setAttribute ( "fill" , "url(#" + this . constants . disabledPatternId + ")" ) } updateSelected ( a ) { this . setClass _ ( "blocklySelected" , a ) } updateDraggingDelete ( a ) { this . setClass _ ( "blocklyDraggingDelete" , a ) } updateInsertionMarker ( a ) { this . setClass _ ( "blocklyInsertionMarker" , a ) } updateMovable ( a ) { this . setClass _ ( "blocklyDraggable" , a ) } updateReplacementFade ( a ) { this . setClass _ ( "blocklyReplaceable" , a ) } updateShapeForInputHighlight ( a , b ) { } } , module$build$src$core$renderers$common$path _object = { } ;
module$build$src$core$renderers$common$path _object . PathObject = PathObject$$module$build$src$core$renderers$common$path _object ; var DUPLICATE _BLOCK _ERROR$$module$build$src$core$insertion _marker _manager = "The insertion marker manager tried to create a marker but the result is missing %1. If you are using a mutator, make sure your domToMutation method is properly defined." , InsertionMarkerManager$$module$build$src$core$insertion _marker _manager = class { constructor ( a ) { this . localConnection _ = this . closestConnection _ = this . lastMarker _ = this . lastOnStack _ = null ; this . wouldDeleteBlock _ = ! 1 ; this . fadedBlock _ = this . highlightedBlock _ = this . markerConnection _ =
null ; setSelected$$module$build$src$core$common ( a ) ; this . topBlock _ = a ; this . workspace _ = a . workspace ; this . firstMarker _ = this . createMarkerBlock _ ( this . topBlock _ ) ; this . availableConnections _ = this . initAvailableConnections _ ( ) } dispose ( ) { this . availableConnections _ . length = 0 ; disable$$module$build$src$core$events$utils ( ) ; try { this . firstMarker _ && this . firstMarker _ . dispose ( ) , this . lastMarker _ && this . lastMarker _ . dispose ( ) } finally { enable$$module$build$src$core$events$utils ( ) } } updateAvailableConnections ( ) { this . availableConnections _ =
this . initAvailableConnections _ ( ) } wouldDeleteBlock ( ) { return this . wouldDeleteBlock _ } wouldConnectBlock ( ) { return ! ! this . closestConnection _ } applyConnections ( ) { if ( this . closestConnection _ ) { if ( ! this . localConnection _ ) throw Error ( "Cannot apply connections because there is no local connection" ) ; disable$$module$build$src$core$events$utils ( ) ; this . hidePreview _ ( ) ; enable$$module$build$src$core$events$utils ( ) ; this . localConnection _ . connect ( this . closestConnection _ ) ; if ( this . topBlock _ . rendered ) { const a = this . localConnection _ . isSuperior ( ) ?
this . closestConnection _ : this . localConnection _ ; connectionUiEffect$$module$build$src$core$block _animations ( a . getSourceBlock ( ) ) ; this . topBlock _ . getRootBlock ( ) . bringToFront ( ) } } } update ( a , b ) { const c = this . getCandidate _ ( a ) ; if ( ( this . wouldDeleteBlock _ = this . shouldDelete _ ( c , b ) ) || this . shouldUpdatePreviews _ ( c , a ) ) disable$$module$build$src$core$events$utils ( ) , this . maybeHidePreview _ ( c ) , this . maybeShowPreview _ ( c ) , enable$$module$build$src$core$events$utils ( ) } createMarkerBlock _ ( a ) { var b = a . type ; disable$$module$build$src$core$events$utils ( ) ;
let c ; try { c = this . workspace _ . newBlock ( b ) ; c . setInsertionMarker ( ! 0 ) ; if ( a . saveExtraState ) { var d = a . saveExtraState ( ) ; d && c . loadExtraState && c . loadExtraState ( d ) } else if ( a . mutationToDom ) { const e = a . mutationToDom ( ) ; e && c . domToMutation && c . domToMutation ( e ) } for ( b = 0 ; b < a . inputList . length ; b ++ ) { const e = a . inputList [ b ] ; if ( e . name === COLLAPSED _INPUT _NAME$$module$build$src$core$constants ) continue ; const f = c . inputList [ b ] ; if ( ! f ) throw Error ( DUPLICATE _BLOCK _ERROR$$module$build$src$core$insertion _marker _manager . replace ( "%1" , "an input" ) ) ;
for ( d = 0 ; d < e . fieldRow . length ; d ++ ) { const g = e . fieldRow [ d ] , h = f . fieldRow [ d ] ; if ( ! h ) throw Error ( DUPLICATE _BLOCK _ERROR$$module$build$src$core$insertion _marker _manager . replace ( "%1" , "a field" ) ) ; h . setValue ( g . getValue ( ) ) } } c . setCollapsed ( a . isCollapsed ( ) ) ; c . setInputsInline ( a . getInputsInline ( ) ) ; c . initSvg ( ) ; c . getSvgRoot ( ) . setAttribute ( "visibility" , "hidden" ) } finally { enable$$module$build$src$core$events$utils ( ) } return c } initAvailableConnections _ ( ) { const a = this . topBlock _ . getConnections _ ( ! 1 ) , b = this . topBlock _ . lastConnectionInStack ( ! 0 ) ;
if ( b && b !== this . topBlock _ . nextConnection ) { a . push ( b ) ; this . lastOnStack _ = b ; if ( this . lastMarker _ ) { disable$$module$build$src$core$events$utils ( ) ; try { this . lastMarker _ . dispose ( ) } finally { enable$$module$build$src$core$events$utils ( ) } } this . lastMarker _ = this . createMarkerBlock _ ( b . getSourceBlock ( ) ) } return a } shouldUpdatePreviews _ ( a , b ) { var c = a . local ; const d = a . closest ; a = a . radius ; if ( c && d ) { if ( this . localConnection _ && this . closestConnection _ ) { if ( this . closestConnection _ === d && this . localConnection _ === c ) return ! 1 ; c = this . localConnection _ . x +
b . x - this . closestConnection _ . x ; b = this . localConnection _ . y + b . y - this . closestConnection _ . y ; b = Math . sqrt ( c * c + b * b ) ; return ! ( d && a > b - $ . config$$module$build$src$core$config . currentConnectionPreference ) } if ( this . localConnection _ || this . closestConnection _ ) console . error ( "Only one of localConnection_ and closestConnection_ was set." ) ; else return ! 0 } else return ! ( ! this . localConnection _ || ! this . closestConnection _ ) ; console . error ( "Returning true from shouldUpdatePreviews, but it's not clear why." ) ; return ! 0 } getCandidate _ ( a ) { let b =
this . getStartRadius _ ( ) , c = null , d = null ; this . markerConnection _ && this . markerConnection _ . isConnected ( ) || this . updateAvailableConnections ( ) ; for ( let e = 0 ; e < this . availableConnections _ . length ; e ++ ) { const f = this . availableConnections _ [ e ] , g = f . closest ( b , a ) ; g . connection && ( c = g . connection , d = f , b = g . radius ) } return { closest : c , local : d , radius : b } } getStartRadius _ ( ) { return this . closestConnection _ && this . localConnection _ ? $ . config$$module$build$src$core$config . connectingSnapRadius : $ . config$$module$build$src$core$config . snapRadius } shouldDelete _ ( a ,
b ) { return b && this . workspace _ . getComponentManager ( ) . hasCapability ( b . id , ComponentManager$$module$build$src$core$component _manager . Capability . DELETE _AREA ) ? b . wouldDelete ( this . topBlock _ , a && ! ! a . closest ) : ! 1 } maybeShowPreview _ ( a ) { if ( ! this . wouldDeleteBlock _ ) { var b = a . closest ; a = a . local ; b && ( b === this . closestConnection _ || b . getSourceBlock ( ) . isInsertionMarker ( ) ? console . log ( "Trying to connect to an insertion marker" ) : ( this . closestConnection _ = b , this . localConnection _ = a , this . showPreview _ ( ) ) ) } } showPreview _ ( ) { if ( ! this . closestConnection _ ) throw Error ( "Cannot show the preview because there is no closest connection" ) ;
if ( ! this . localConnection _ ) throw Error ( "Cannot show the preview because there is no local connection" ) ; const a = this . closestConnection _ , b = this . workspace _ . getRenderer ( ) ; switch ( b . getConnectionPreviewMethod ( a , this . localConnection _ , this . topBlock _ ) ) { case InsertionMarkerManager$$module$build$src$core$insertion _marker _manager . PREVIEW _TYPE . INPUT _OUTLINE : this . showInsertionInputOutline _ ( ) ; break ; case InsertionMarkerManager$$module$build$src$core$insertion _marker _manager . PREVIEW _TYPE . INSERTION _MARKER : this . showInsertionMarker _ ( ) ;
break ; case InsertionMarkerManager$$module$build$src$core$insertion _marker _manager . PREVIEW _TYPE . REPLACEMENT _FADE : this . showReplacementFade _ ( ) } a && b . shouldHighlightConnection ( a ) && a . highlight ( ) } maybeHidePreview _ ( a ) { if ( a . closest ) { const b = this . closestConnection _ !== a . closest ; a = this . localConnection _ !== a . local ; this . closestConnection _ && this . localConnection _ && ( b || a || this . wouldDeleteBlock _ ) && this . hidePreview _ ( ) } else this . hidePreview _ ( ) ; this . localConnection _ = this . closestConnection _ = this . markerConnection _ = null } hidePreview _ ( ) { this . closestConnection _ &&
this . closestConnection _ . targetBlock ( ) && this . workspace _ . getRenderer ( ) . shouldHighlightConnection ( this . closestConnection _ ) && this . closestConnection _ . unhighlight ( ) ; this . fadedBlock _ ? this . hideReplacementFade _ ( ) : this . highlightedBlock _ ? this . hideInsertionInputOutline _ ( ) : this . markerConnection _ && this . hideInsertionMarker _ ( ) } showInsertionMarker _ ( ) { if ( ! this . localConnection _ ) throw Error ( "Cannot show the insertion marker because there is no local connection" ) ; if ( ! this . closestConnection _ ) throw Error ( "Cannot show the insertion marker because there is no closest connection" ) ;
const a = this . localConnection _ , b = this . closestConnection _ , c = this . lastOnStack _ && a === this . lastOnStack _ ; let d = c ? this . lastMarker _ : this . firstMarker _ ; if ( ! d ) throw Error ( "Cannot show the insertion marker because there is no insertion marker block" ) ; let e ; try { e = d . getMatchingConnection ( a . getSourceBlock ( ) , a ) } catch ( f ) { this . firstMarker _ = this . createMarkerBlock _ ( this . topBlock _ ) ; d = c ? this . lastMarker _ : this . firstMarker _ ; if ( ! d ) throw Error ( "Cannot show the insertion marker because there is no insertion marker block" ) ; e =
d . getMatchingConnection ( a . getSourceBlock ( ) , a ) } if ( ! e ) throw Error ( "Cannot show the insertion marker because there is no associated connection" ) ; if ( e === this . markerConnection _ ) throw Error ( "Made it to showInsertionMarker_ even though the marker isn't changing" ) ; d . render ( ) ; d . rendered = ! 0 ; d . getSvgRoot ( ) . setAttribute ( "visibility" , "visible" ) ; e && b && d . positionNearConnection ( e , b ) ; b && e . connect ( b ) ; this . markerConnection _ = e } hideInsertionMarker _ ( ) { if ( this . markerConnection _ ) { var a = this . markerConnection _ , b = a . getSourceBlock ( ) ,
c = b . nextConnection , d = b . previousConnection , e = b . outputConnection ; e = a . type === ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE && ! ( e && e . targetConnection ) ; ! ( a !== c || d && d . targetConnection ) || e ? a . targetBlock ( ) . unplug ( ! 1 ) : a . type === ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT && a !== c ? ( ( c = a . targetConnection ) && c . getSourceBlock ( ) . unplug ( ! 1 ) , d = d ? d . targetConnection : null , b . unplug ( ! 0 ) , d && c && d . connect ( c ) ) : b . unplug ( ! 0 ) ; if ( a . targetConnection ) throw Error ( "markerConnection_ still connected at the end of disconnectInsertionMarker" ) ;
this . markerConnection _ = null ; ( a = b . getSvgRoot ( ) ) && a . setAttribute ( "visibility" , "hidden" ) } else console . log ( "No insertion marker connection to disconnect" ) } showInsertionInputOutline _ ( ) { if ( ! this . closestConnection _ ) throw Error ( "Cannot show the insertion marker outline because there is no closest connection" ) ; const a = this . closestConnection _ ; this . highlightedBlock _ = a . getSourceBlock ( ) ; this . highlightedBlock _ . highlightShapeForInput ( a , ! 0 ) } hideInsertionInputOutline _ ( ) { if ( ! this . highlightedBlock _ ) throw Error ( "Cannot hide the insertion marker outline because there is no highlighted block" ) ;
if ( ! this . closestConnection _ ) throw Error ( "Cannot hide the insertion marker outline because there is no closest connection" ) ; this . highlightedBlock _ . highlightShapeForInput ( this . closestConnection _ , ! 1 ) ; this . highlightedBlock _ = null } showReplacementFade _ ( ) { if ( ! this . closestConnection _ ) throw Error ( "Cannot show the replacement fade because there is no closest connection" ) ; this . fadedBlock _ = this . closestConnection _ . targetBlock ( ) ; if ( ! this . fadedBlock _ ) throw Error ( "Cannot show the replacement fade because the closest connection does not have a target block" ) ;
this . fadedBlock _ . fadeForReplacement ( ! 0 ) } hideReplacementFade _ ( ) { if ( ! this . fadedBlock _ ) throw Error ( "Cannot hide the replacement because there is no faded block" ) ; this . fadedBlock _ . fadeForReplacement ( ! 1 ) ; this . fadedBlock _ = null } getInsertionMarkers ( ) { const a = [ ] ; this . firstMarker _ && a . push ( this . firstMarker _ ) ; this . lastMarker _ && a . push ( this . lastMarker _ ) ; return a } } ;
( function ( a ) { a = a . PREVIEW _TYPE || ( a . PREVIEW _TYPE = { } ) ; a [ a . INSERTION _MARKER = 0 ] = "INSERTION_MARKER" ; a [ a . INPUT _OUTLINE = 1 ] = "INPUT_OUTLINE" ; a [ a . REPLACEMENT _FADE = 2 ] = "REPLACEMENT_FADE" } ) ( InsertionMarkerManager$$module$build$src$core$insertion _marker _manager || ( InsertionMarkerManager$$module$build$src$core$insertion _marker _manager = { } ) ) ;
var PreviewType$$module$build$src$core$insertion _marker _manager = InsertionMarkerManager$$module$build$src$core$insertion _marker _manager . PREVIEW _TYPE , module$build$src$core$insertion _marker _manager = { } ; module$build$src$core$insertion _marker _manager . InsertionMarkerManager = InsertionMarkerManager$$module$build$src$core$insertion _marker _manager ; module$build$src$core$insertion _marker _manager . PreviewType = PreviewType$$module$build$src$core$insertion _marker _manager ; var Renderer$$module$build$src$core$renderers$common$renderer = class { constructor ( a ) { this . overrides = null ; this . name = a } getClassName ( ) { return this . name + "-renderer" } init ( a , b ) { this . constants _ = this . makeConstants _ ( ) ; b && ( this . overrides = b , Object . assign ( this . constants _ , b ) ) ; this . constants _ . setTheme ( a ) ; this . constants _ . init ( ) } createDom ( a , b ) { this . constants _ . createDom ( a , this . name + "-" + b . name , "." + this . getClassName ( ) + "." + b . getClassName ( ) ) } refreshDom ( a , b ) { const c = this . getConstants ( ) ; c . dispose ( ) ; this . constants _ = this . makeConstants _ ( ) ;
this . overrides && Object . assign ( this . constants _ , this . overrides ) ; this . constants _ . randomIdentifier = c . randomIdentifier ; this . constants _ . setTheme ( b ) ; this . constants _ . init ( ) ; this . createDom ( a , b ) } dispose ( ) { this . constants _ && this . constants _ . dispose ( ) } makeConstants _ ( ) { return new ConstantProvider$$module$build$src$core$renderers$common$constants } makeRenderInfo _ ( a ) { return new RenderInfo$$module$build$src$core$renderers$common$info ( this , a ) } makeDrawer _ ( a , b ) { return new Drawer$$module$build$src$core$renderers$common$drawer ( a ,
b ) } makeDebugger _ ( ) { return new Debug$$module$build$src$core$renderers$common$debugger ( this . getConstants ( ) ) } makeMarkerDrawer ( a , b ) { return new MarkerSvg$$module$build$src$core$renderers$common$marker _svg ( a , this . getConstants ( ) , b ) } makePathObject ( a , b ) { return new PathObject$$module$build$src$core$renderers$common$path _object ( a , b , this . constants _ ) } getConstants ( ) { return this . constants _ } shouldHighlightConnection ( a ) { return ! 0 } 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 ) } getConnectionPreviewMethod ( a , b , c ) { return b . type === ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE || b . type === ConnectionType$$module$build$src$core$connection _type . PREVIOUS _STATEMENT ? ! a . isConnected ( ) || this . orphanCanConnectAtEnd ( c , a . targetBlock ( ) , b . type ) ? InsertionMarkerManager$$module$build$src$core$insertion _marker _manager . PREVIEW _TYPE . INSERTION _MARKER : InsertionMarkerManager$$module$build$src$core$insertion _marker _manager . PREVIEW _TYPE . REPLACEMENT _FADE :
InsertionMarkerManager$$module$build$src$core$insertion _marker _manager . PREVIEW _TYPE . INSERTION _MARKER } render ( a ) { isDebuggerEnabled$$module$build$src$core$renderers$common$debug ( ) && ! a . renderingDebugger && ( a . renderingDebugger = this . makeDebugger _ ( ) ) ; const b = this . makeRenderInfo _ ( a ) ; b . measure ( ) ; this . makeDrawer _ ( a , b ) . draw ( ) } } , module$build$src$core$renderers$common$renderer = { } ; module$build$src$core$renderers$common$renderer . Renderer = Renderer$$module$build$src$core$renderers$common$renderer ; var module$build$src$core$renderers$common$block _rendering = { } ; module$build$src$core$renderers$common$block _rendering . BottomRow = BottomRow$$module$build$src$core$renderers$measurables$bottom _row ; module$build$src$core$renderers$common$block _rendering . Connection = Connection$$module$build$src$core$renderers$measurables$connection ; module$build$src$core$renderers$common$block _rendering . ConstantProvider = ConstantProvider$$module$build$src$core$renderers$common$constants ;
module$build$src$core$renderers$common$block _rendering . Debug = Debug$$module$build$src$core$renderers$common$debugger ; module$build$src$core$renderers$common$block _rendering . Drawer = Drawer$$module$build$src$core$renderers$common$drawer ; module$build$src$core$renderers$common$block _rendering . ExternalValueInput = ExternalValueInput$$module$build$src$core$renderers$measurables$external _value _input ; module$build$src$core$renderers$common$block _rendering . Field = Field$$module$build$src$core$renderers$measurables$field ;
module$build$src$core$renderers$common$block _rendering . Hat = Hat$$module$build$src$core$renderers$measurables$hat ; module$build$src$core$renderers$common$block _rendering . Icon = Icon$$module$build$src$core$renderers$measurables$icon ; module$build$src$core$renderers$common$block _rendering . InRowSpacer = InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ; module$build$src$core$renderers$common$block _rendering . InlineInput = InlineInput$$module$build$src$core$renderers$measurables$inline _input ;
module$build$src$core$renderers$common$block _rendering . InputConnection = InputConnection$$module$build$src$core$renderers$measurables$input _connection ; module$build$src$core$renderers$common$block _rendering . InputRow = InputRow$$module$build$src$core$renderers$measurables$input _row ; module$build$src$core$renderers$common$block _rendering . JaggedEdge = JaggedEdge$$module$build$src$core$renderers$measurables$jagged _edge ; module$build$src$core$renderers$common$block _rendering . MarkerSvg = MarkerSvg$$module$build$src$core$renderers$common$marker _svg ;
module$build$src$core$renderers$common$block _rendering . Measurable = Measurable$$module$build$src$core$renderers$measurables$base ; module$build$src$core$renderers$common$block _rendering . NextConnection = NextConnection$$module$build$src$core$renderers$measurables$next _connection ; module$build$src$core$renderers$common$block _rendering . OutputConnection = OutputConnection$$module$build$src$core$renderers$measurables$output _connection ; module$build$src$core$renderers$common$block _rendering . PathObject = PathObject$$module$build$src$core$renderers$common$path _object ;
module$build$src$core$renderers$common$block _rendering . PreviousConnection = PreviousConnection$$module$build$src$core$renderers$measurables$previous _connection ; module$build$src$core$renderers$common$block _rendering . RenderInfo = RenderInfo$$module$build$src$core$renderers$common$info ; module$build$src$core$renderers$common$block _rendering . Renderer = Renderer$$module$build$src$core$renderers$common$renderer ; module$build$src$core$renderers$common$block _rendering . RoundCorner = RoundCorner$$module$build$src$core$renderers$measurables$round _corner ;
module$build$src$core$renderers$common$block _rendering . Row = Row$$module$build$src$core$renderers$measurables$row ; module$build$src$core$renderers$common$block _rendering . SpacerRow = SpacerRow$$module$build$src$core$renderers$measurables$spacer _row ; module$build$src$core$renderers$common$block _rendering . SquareCorner = SquareCorner$$module$build$src$core$renderers$measurables$square _corner ; module$build$src$core$renderers$common$block _rendering . StatementInput = StatementInput$$module$build$src$core$renderers$measurables$statement _input ;
module$build$src$core$renderers$common$block _rendering . TopRow = TopRow$$module$build$src$core$renderers$measurables$top _row ; module$build$src$core$renderers$common$block _rendering . Types = Types$$module$build$src$core$renderers$measurables$types ; module$build$src$core$renderers$common$block _rendering . init = init$$module$build$src$core$renderers$common$block _rendering ; module$build$src$core$renderers$common$block _rendering . register = register$$module$build$src$core$renderers$common$block _rendering ;
module$build$src$core$renderers$common$block _rendering . stopDebugger = stopDebugger$$module$build$src$core$renderers$common$block _rendering ; module$build$src$core$renderers$common$block _rendering . unregister = unregister$$module$build$src$core$renderers$common$block _rendering ; var ThemeManager$$module$build$src$core$theme _manager = class { constructor ( a , b ) { this . workspace = a ; this . theme = b ; this . subscribedWorkspaces _ = [ ] ; this . componentDB = new Map } getTheme ( ) { return this . theme } setTheme ( a ) { var b = this . theme ; this . theme = a ; if ( a = this . workspace . getInjectionDiv ( ) ) b && ( b = b . getClassName ( ) ) && removeClass$$module$build$src$core$utils$dom ( a , b ) , ( b = this . theme . getClassName ( ) ) && addClass$$module$build$src$core$utils$dom ( a , b ) ; for ( let c = 0 , d ; d = this . subscribedWorkspaces _ [ c ] ; c ++ ) d . refreshTheme ( ) ; for ( const [ c ,
d ] of this . componentDB ) for ( const e of d ) { a = e . element ; b = e . propertyName ; const f = this . theme && this . theme . getComponentStyle ( c ) ; a . style [ b ] = f || "" } for ( const c of this . subscribedWorkspaces _ ) c . hideChaff ( ) } subscribeWorkspace ( a ) { this . subscribedWorkspaces _ . push ( a ) } unsubscribeWorkspace ( a ) { if ( ! removeElem$$module$build$src$core$utils$array ( this . subscribedWorkspaces _ , a ) ) throw Error ( "Cannot unsubscribe a workspace that hasn't been subscribed." ) ; } subscribe ( a , b , c ) { this . componentDB . has ( b ) || this . componentDB . set ( b , [ ] ) ; this . componentDB . get ( b ) . push ( { element : a ,
propertyName : c } ) ; b = this . theme && this . theme . getComponentStyle ( b ) ; a . style [ c ] = b || "" } unsubscribe ( a ) { if ( a ) for ( const [ b , c ] of this . componentDB ) { for ( let d = c . length - 1 ; 0 <= d ; d -- ) c [ d ] . element === a && c . splice ( d , 1 ) ; c . length || this . componentDB . delete ( b ) } } dispose ( ) { this . subscribedWorkspaces _ = this . theme = this . owner _ = null ; this . componentDB . clear ( ) } } , module$build$src$core$theme _manager = { } ; module$build$src$core$theme _manager . ThemeManager = ThemeManager$$module$build$src$core$theme _manager ; var ZOOM _IN _MULTIPLIER$$module$build$src$core$touch _gesture = 5 , ZOOM _OUT _MULTIPLIER$$module$build$src$core$touch _gesture = 6 , TouchGesture$$module$build$src$core$touch _gesture = class extends Gesture$$module$build$src$core$gesture { constructor ( ) { super ( ... arguments ) ; this . isMultiTouch _ = ! 1 ; this . cachedPoints = new Map ; this . startDistance _ = this . previousScale _ = 0 ; this . onUpWrapper _ = this . onMoveWrapper _ = this . isPinchZoomEnabled _ = this . onStartWrapper _ = null } doStart ( a ) { if ( ! this . startWorkspace _ ) throw Error ( "Cannot start the touch event becauase the start workspace is undefined" ) ;
this . isPinchZoomEnabled _ = this . startWorkspace _ . options . zoomOptions && this . startWorkspace _ . options . zoomOptions . pinch ; super . doStart ( a ) ; ! this . isEnding _ && isTouchEvent$$module$build$src$core$touch ( a ) && this . handleTouchStart ( a ) } bindMouseEvents ( a ) { this . onStartWrapper _ = conditionalBind$$module$build$src$core$browser _events ( document , "mousedown" , null , this . handleStart . bind ( this ) , ! 0 ) ; this . onMoveWrapper _ = conditionalBind$$module$build$src$core$browser _events ( document , "mousemove" , null , this . handleMove . bind ( this ) , ! 0 ) ;
this . onUpWrapper _ = conditionalBind$$module$build$src$core$browser _events ( document , "mouseup" , null , this . handleUp . bind ( this ) , ! 0 ) ; a . preventDefault ( ) ; a . stopPropagation ( ) } handleStart ( a ) { ! this . isDragging ( ) && isTouchEvent$$module$build$src$core$touch ( a ) && ( this . handleTouchStart ( a ) , this . isMultiTouch ( ) && longStop$$module$build$src$core$touch ( ) ) } handleMove ( a ) { this . isDragging ( ) ? shouldHandleEvent$$module$build$src$core$touch ( a ) && super . handleMove ( a ) : this . isMultiTouch ( ) ? ( isTouchEvent$$module$build$src$core$touch ( a ) &&
this . handleTouchMove ( a ) , longStop$$module$build$src$core$touch ( ) ) : super . handleMove ( a ) } handleUp ( a ) { isTouchEvent$$module$build$src$core$touch ( a ) && ! this . isDragging ( ) && this . handleTouchEnd ( a ) ; ! this . isMultiTouch ( ) || this . isDragging ( ) ? shouldHandleEvent$$module$build$src$core$touch ( a ) && super . handleUp ( a ) : ( a . preventDefault ( ) , a . stopPropagation ( ) , this . dispose ( ) ) } isMultiTouch ( ) { return this . isMultiTouch _ } dispose ( ) { super . dispose ( ) ; this . onStartWrapper _ && unbind$$module$build$src$core$browser _events ( this . onStartWrapper _ ) } 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 ) : super . 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 ( 0 < this . previousScale _ && Infinity > this . previousScale _ ) { b = c - this . previousScale _ ; b = 0 < b ? b * ZOOM _IN _MULTIPLIER$$module$build$src$core$touch _gesture : b * ZOOM _OUT _MULTIPLIER$$module$build$src$core$touch _gesture ; if ( ! this . startWorkspace _ ) throw Error ( "Cannot handle a pinch because the start workspace is undefined" ) ;
const d = this . startWorkspace _ , e = mouseToSvg$$module$build$src$core$browser _events ( a , d . getParentSvg ( ) , d . getInverseScreenCTM ( ) ) ; d . zoom ( e . x , e . y , b ) } this . previousScale _ = c ; a . preventDefault ( ) } handleTouchEnd ( a ) { a = getTouchIdentifierFromEvent$$module$build$src$core$touch ( a ) ; this . cachedPoints . has ( a ) && this . cachedPoints . delete ( a ) ; 2 > this . cachedPoints . size && ( this . cachedPoints . clear ( ) , this . previousScale _ = 0 ) } getTouchPoint ( a ) { return this . startWorkspace _ ? new Coordinate$$module$build$src$core$utils$coordinate ( a . changedTouches ?
a . changedTouches [ 0 ] . pageX : a . pageX , a . changedTouches ? a . changedTouches [ 0 ] . pageY : a . pageY ) : null } } , module$build$src$core$touch _gesture = { } ; module$build$src$core$touch _gesture . TouchGesture = TouchGesture$$module$build$src$core$touch _gesture ; var CATEGORY _NAME$$module$build$src$core$variables _dynamic = "VARIABLE_DYNAMIC" , onCreateVariableButtonClick _String$$module$build$src$core$variables _dynamic = stringButtonClickHandler$$module$build$src$core$variables _dynamic , onCreateVariableButtonClick _Number$$module$build$src$core$variables _dynamic = numberButtonClickHandler$$module$build$src$core$variables _dynamic , onCreateVariableButtonClick _Colour$$module$build$src$core$variables _dynamic = colourButtonClickHandler$$module$build$src$core$variables _dynamic ,
module$build$src$core$variables _dynamic = { } ; module$build$src$core$variables _dynamic . CATEGORY _NAME = CATEGORY _NAME$$module$build$src$core$variables _dynamic ; module$build$src$core$variables _dynamic . flyoutCategory = flyoutCategory$$module$build$src$core$variables _dynamic ; module$build$src$core$variables _dynamic . flyoutCategoryBlocks = flyoutCategoryBlocks$$module$build$src$core$variables _dynamic ; module$build$src$core$variables _dynamic . onCreateVariableButtonClick _Colour = colourButtonClickHandler$$module$build$src$core$variables _dynamic ;
module$build$src$core$variables _dynamic . onCreateVariableButtonClick _Number = numberButtonClickHandler$$module$build$src$core$variables _dynamic ; module$build$src$core$variables _dynamic . onCreateVariableButtonClick _String = stringButtonClickHandler$$module$build$src$core$variables _dynamic ; var ConnectionChecker$$module$build$src$core$connection _checker = class { canConnect ( a , b , c , d ) { return this . canConnectWithReason ( a , b , c , d ) === Connection$$module$build$src$core$connection . CAN _CONNECT } canConnectWithReason ( a , b , c , d ) { const e = this . doSafetyChecks ( a , b ) ; return e !== Connection$$module$build$src$core$connection . CAN _CONNECT ? e : this . doTypeChecks ( a , b ) ? c && ! this . doDragChecks ( a , b , d || 0 ) ? Connection$$module$build$src$core$connection . REASON _DRAG _CHECKS _FAILED : Connection$$module$build$src$core$connection . CAN _CONNECT :
Connection$$module$build$src$core$connection . REASON _CHECKS _FAILED } getErrorMessage ( a , b , c ) { switch ( a ) { case Connection$$module$build$src$core$connection . REASON _SELF _CONNECTION : return "Attempted to connect a block to itself." ; case Connection$$module$build$src$core$connection . REASON _DIFFERENT _WORKSPACES : return "Blocks not on same workspace." ; case Connection$$module$build$src$core$connection . REASON _WRONG _TYPE : return "Attempt to connect incompatible types." ; case Connection$$module$build$src$core$connection . REASON _TARGET _NULL : return "Target connection is null." ;
case Connection$$module$build$src$core$connection . REASON _CHECKS _FAILED : return "Connection checks failed. " + ( b + " expected " + b . getCheck ( ) + ", found " + c . getCheck ( ) ) ; case Connection$$module$build$src$core$connection . REASON _SHADOW _PARENT : return "Connecting non-shadow to shadow block." ; case Connection$$module$build$src$core$connection . REASON _DRAG _CHECKS _FAILED : return "Drag checks failed." ; case Connection$$module$build$src$core$connection . REASON _PREVIOUS _AND _OUTPUT : return "Block would have an output and a previous connection." ;
default : return "Unknown connection failure: this should never happen!" } } doSafetyChecks ( a , b ) { if ( ! a || ! b ) return Connection$$module$build$src$core$connection . REASON _TARGET _NULL ; let c , d , e ; a . isSuperior ( ) ? ( c = a . getSourceBlock ( ) , d = b . getSourceBlock ( ) , e = b ) : ( d = a . getSourceBlock ( ) , c = b . getSourceBlock ( ) , e = a , a = b ) ; return c === d ? Connection$$module$build$src$core$connection . REASON _SELF _CONNECTION : e . type !== OPPOSITE _TYPE$$module$build$src$core$internal _constants [ a . type ] ? Connection$$module$build$src$core$connection . REASON _WRONG _TYPE :
c . workspace !== d . workspace ? Connection$$module$build$src$core$connection . REASON _DIFFERENT _WORKSPACES : c . isShadow ( ) && ! d . isShadow ( ) ? Connection$$module$build$src$core$connection . REASON _SHADOW _PARENT : e . type === ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE && d . previousConnection && d . previousConnection . isConnected ( ) || e . type === ConnectionType$$module$build$src$core$connection _type . PREVIOUS _STATEMENT && d . outputConnection && d . outputConnection . isConnected ( ) ? Connection$$module$build$src$core$connection . REASON _PREVIOUS _AND _OUTPUT :
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 ; c < a . length ; c ++ ) if ( - 1 !== b . indexOf ( a [ c ] ) ) return ! 0 ; return ! 1 } doDragChecks ( a , b , c ) { if ( a . distanceFrom ( b ) > c || 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 ) return ! 1 ; break ; default : return ! 1 } return - 1 !== draggingConnections$$module$build$src$core$common . indexOf ( b ) ?
! 1 : ! 0 } canConnectToPrevious _ ( a , b ) { if ( a . targetConnection || - 1 !== draggingConnections$$module$build$src$core$common . indexOf ( 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 ( ! 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 } fromJson ( a ) { super . fromJson ( a ) ; this . varType = a . varType ; this . varName = a . varName } 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" ) ;
a . oldName = this . oldName ; a . newName = this . newName ; return a } fromJson ( a ) { super . fromJson ( a ) ; this . oldName = a . oldName ; this . newName = a . newName } 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 ( ) { this . variableMap . clear ( ) } renameVariable ( a , b ) { const c = this . getVariable ( b , a . type ) , d = this . workspace . getAllBlocks ( ! 1 ) ; setGroup$$module$build$src$core$events$utils ( ! 0 ) ; try { c && c . getId ( ) !== a . getId ( ) ? this . renameVariableWithConflict _ ( a , b , c , d ) : this . renameVariableAndUses _ ( a , b , d ) } finally { setGroup$$module$build$src$core$events$utils ( ! 1 ) } } renameVariableById ( a , b ) { const c = this . getVariableById ( a ) ;
if ( ! c ) throw Error ( "Tried to rename a variable that didn't exist. ID: " + a ) ; this . renameVariable ( c , b ) } renameVariableAndUses _ ( a , b , c ) { fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( VAR _RENAME$$module$build$src$core$events$utils ) ) ( a , b ) ) ; a . name = b ; for ( b = 0 ; b < c . length ; b ++ ) c [ b ] . updateVarName ( a ) } renameVariableWithConflict _ ( a , b , c , d ) { const e = a . type ; b !== c . name && this . renameVariableAndUses _ ( c , b , d ) ; for ( b = 0 ; b < d . length ; b ++ ) d [ b ] . renameVarById ( a . getId ( ) , c . getId ( ) ) ; fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( VAR _DELETE$$module$build$src$core$events$utils ) ) ( a ) ) ;
removeElem$$module$build$src$core$utils$array ( this . variableMap . get ( e ) , a ) } createVariable ( a , b , c ) { var d = this . getVariable ( a , b ) ; if ( d ) { if ( c && d . getId ( ) !== c ) throw Error ( 'Variable "' + a + '" is already in use and its id is "' + d . getId ( ) + '" which conflicts with the passed in id, "' + c + '".' ) ; return d } if ( c && this . getVariableById ( c ) ) throw Error ( 'Variable id, "' + c + '", is already in use.' ) ; d = c || genUid$$module$build$src$core$utils$idgenerator ( ) ; b = b || "" ; d = new VariableModel$$module$build$src$core$variable _model ( this . workspace ,
a , b , d ) ; a = this . variableMap . get ( b ) || [ ] ; a . push ( d ) ; this . variableMap . delete ( b ) ; this . variableMap . set ( b , a ) ; return d } deleteVariable ( a ) { const b = a . getId ( ) , c = this . variableMap . get ( a . type ) ; if ( c ) for ( let d = 0 ; d < c . length ; d ++ ) if ( c [ d ] . getId ( ) === b ) { c . splice ( d , 1 ) ; fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( VAR _DELETE$$module$build$src$core$events$utils ) ) ( a ) ) ; break } } deleteVariableById ( a ) { const b = this . getVariableById ( a ) ; if ( b ) { var c = b . name ; const d = this . getVariableUsesById ( a ) ; for ( let e =
0 , f ; f = d [ e ] ; e ++ ) if ( "procedures_defnoreturn" === f . type || "procedures_defreturn" === f . type ) { a = String ( f . getFieldValue ( "NAME" ) ) ; c = Msg$$module$build$src$core$msg . CANNOT _DELETE _VARIABLE _PROCEDURE . replace ( "%1" , c ) . replace ( "%2" , a ) ; alert$$module$build$src$core$dialog ( c ) ; return } 1 < d . length ? ( c = Msg$$module$build$src$core$msg . DELETE _VARIABLE _CONFIRMATION . replace ( "%1" , String ( d . length ) ) . replace ( "%2" , c ) , confirm$$module$build$src$core$dialog ( c , e => { 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 ; d < b . length ; d ++ ) b [ d ] . dispose ( ! 0 ) ; this . deleteVariable ( a ) } finally { c || setGroup$$module$build$src$core$events$utils ( ! 1 ) } } getVariable ( a , b ) { if ( b = this . variableMap . get ( b || "" ) ) for ( let c = 0 , d ; d = b [ c ] ; c ++ ) if ( Names$$module$build$src$core$names . equals ( d . name , a ) ) return d ; return null } getVariableById ( a ) { for ( const [ ,
b ] of this . variableMap ) for ( const c of b ) if ( c . getId ( ) === a ) return c ; return null } getVariablesOfType ( a ) { return ( a = this . variableMap . get ( a || "" ) ) ? a . slice ( ) : [ ] } getVariableTypes ( a ) { const b = new Set ( this . variableMap . keys ( ) ) ; if ( a && a . getPotentialVariableMap ( ) ) for ( const c of a . getPotentialVariableMap ( ) . variableMap . keys ( ) ) b . add ( c ) ; b . has ( "" ) || b . add ( "" ) ; return Array . from ( b . values ( ) ) } getAllVariables ( ) { let a = [ ] ; for ( const b of this . variableMap . values ( ) ) a = a . concat ( b ) ; return a } getAllVariableNames ( ) { return Array . from ( this . variableMap . values ( ) ) . flat ( ) . map ( a =>
a . name ) } getVariableUsesById ( a ) { const b = [ ] , c = this . workspace . getAllBlocks ( ! 1 ) ; for ( let d = 0 ; d < c . length ; d ++ ) { const e = c [ d ] . getVarModels ( ) ; if ( e ) for ( let f = 0 ; f < e . length ; f ++ ) e [ f ] . getId ( ) === a && b . push ( c [ d ] ) } return b } } , module$build$src$core$variable _map = { } ; module$build$src$core$variable _map . VariableMap = VariableMap$$module$build$src$core$variable _map ; var Workspace$$module$build$src$core$workspace = class { constructor ( a ) { this . isClearing = this . internalIsMutator = this . internalIsFlyout = this . rendered = ! 1 ; this . MAX _UNDO = 1024 ; this . connectionDBList = [ ] ; this . topBlocks _ = [ ] ; this . topComments _ = [ ] ; this . commentDB = new Map ; this . listeners _ = [ ] ; this . undoStack _ = [ ] ; this . redoStack _ = [ ] ; this . blockDB = new Map ; this . typedBlocksDB = new Map ; this . potentialVariableMap _ = null ; this . id = genUid$$module$build$src$core$utils$idgenerator ( ) ; registerWorkspace$$module$build$src$core$common ( this ) ;
this . options = a || new Options$$module$build$src$core$options ( { } ) ; this . RTL = ! ! this . options . RTL ; this . horizontalLayout = ! ! this . options . horizontalLayout ; this . toolboxPosition = this . options . toolboxPosition ; this . connectionChecker = new ( getClassFromOptions$$module$build$src$core$registry ( Type$$module$build$src$core$registry . CONNECTION _CHECKER , this . options , ! 0 ) ) ( this ) ; this . variableMap _ = new VariableMap$$module$build$src$core$variable _map ( this ) } get isFlyout ( ) { return this . internalIsFlyout } get isMutator ( ) { return this . internalIsMutator } dispose ( ) { this . listeners _ . length =
0 ; this . clear ( ) ; unregisterWorkpace$$module$build$src$core$common ( this ) } sortObjects _ ( a , b ) { a = a . getRelativeToSurfaceXY ( ) ; b = b . getRelativeToSurfaceXY ( ) ; return a . y + Workspace$$module$build$src$core$workspace . prototype . sortObjects _ . offset * a . x - ( b . y + Workspace$$module$build$src$core$workspace . prototype . sortObjects _ . offset * b . x ) } addTopBlock ( a ) { this . topBlocks _ . push ( a ) } removeTopBlock ( a ) { if ( ! removeElem$$module$build$src$core$utils$array ( this . topBlocks _ , a ) ) throw Error ( "Block not present in workspace's list of top-most blocks." ) ;
} getTopBlocks ( a ) { const b = [ ] . concat ( this . topBlocks _ ) ; a && 1 < b . length && ( this . sortObjects _ . offset = Math . sin ( toRadians$$module$build$src$core$utils$math ( Workspace$$module$build$src$core$workspace . SCAN _ANGLE ) ) , this . RTL && ( this . sortObjects _ . offset *= - 1 ) , b . sort ( this . sortObjects _ ) ) ; return b } addTypedBlock ( a ) { this . typedBlocksDB . has ( a . type ) || this . typedBlocksDB . set ( a . type , [ ] ) ; this . typedBlocksDB . get ( a . type ) . push ( a ) } removeTypedBlock ( a ) { removeElem$$module$build$src$core$utils$array ( this . typedBlocksDB . get ( a . type ) , a ) ;
this . typedBlocksDB . get ( a . type ) . length || this . typedBlocksDB . delete ( a . type ) } getBlocksByType ( a , b ) { if ( ! this . typedBlocksDB . has ( a ) ) return [ ] ; a = this . typedBlocksDB . get ( a ) . slice ( 0 ) ; b && a && 1 < a . length && ( this . sortObjects _ . offset = Math . sin ( toRadians$$module$build$src$core$utils$math ( Workspace$$module$build$src$core$workspace . SCAN _ANGLE ) ) , this . RTL && ( this . sortObjects _ . offset *= - 1 ) , a . sort ( this . sortObjects _ ) ) ; return a . filter ( function ( c ) { return ! 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 ) { const b = [ ] . concat ( this . topComments _ ) ; a && 1 < b . length && ( this . sortObjects _ . offset = Math . sin ( toRadians$$module$build$src$core$utils$math ( Workspace$$module$build$src$core$workspace . SCAN _ANGLE ) ) ,
this . RTL && ( this . sortObjects _ . offset *= - 1 ) , b . sort ( this . sortObjects _ ) ) ; return b } getAllBlocks ( a ) { if ( a ) { var b = this . getTopBlocks ( ! 0 ) ; a = [ ] ; for ( let c = 0 ; c < b . length ; c ++ ) a . push ( ... b [ c ] . getDescendants ( ! 0 ) ) } else for ( a = this . getTopBlocks ( ! 1 ) , b = 0 ; b < a . length ; b ++ ) a . push ( ... a [ b ] . getChildren ( ! 1 ) ) ; return a . filter ( function ( c ) { return ! 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 ( ) ; a || setGroup$$module$build$src$core$events$utils ( ! 1 ) ; 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" ) ; } 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 ; ) e . push ( b . pop ( ) ) ; for ( b = 0 ; b < e . length ; b ++ ) c . push ( e [ b ] ) ; e = filter$$module$build$src$core$events$utils ( e , a ) ; setRecordUndo$$module$build$src$core$events$utils ( ! 1 ) ; try { for ( c = 0 ; c < e . length ; c ++ ) e [ c ] . run ( a ) } finally { setRecordUndo$$module$build$src$core$events$utils ( ! 0 ) } } } clearUndo ( ) { this . undoStack _ . length = 0 ; this . redoStack _ . length = 0 ; clearPendingUndo$$module$build$src$core$events$utils ( ) } addChangeListener ( a ) { this . listeners _ . push ( a ) ;
return a } removeChangeListener ( a ) { removeElem$$module$build$src$core$utils$array ( this . listeners _ , a ) } fireChangeListener ( a ) { if ( a . recordUndo ) for ( this . undoStack _ . push ( a ) , this . redoStack _ . length = 0 ; this . undoStack _ . length > this . MAX _UNDO && 0 <= this . MAX _UNDO ; ) this . undoStack _ . shift ( ) ; for ( let b = 0 ; b < this . listeners _ . length ; b ++ ) ( 0 , this . listeners _ [ b ] ) ( a ) } getBlockById ( a ) { return this . blockDB . get ( a ) || null } setBlockById ( a , b ) { this . blockDB . set ( a , b ) } removeBlockById ( a ) { this . blockDB . delete ( a ) } getCommentById ( a ) { let b ; return null !=
( b = this . commentDB . get ( a ) ) ? b : null } allInputsFilled ( a ) { const b = this . getTopBlocks ( ! 1 ) ; for ( let c = 0 ; c < b . length ; c ++ ) if ( ! b [ c ] . allInputsFilled ( a ) ) return ! 1 ; return ! 0 } getPotentialVariableMap ( ) { return this . potentialVariableMap _ } createPotentialVariableMap ( ) { this . potentialVariableMap _ = new VariableMap$$module$build$src$core$variable _map ( this ) } getVariableMap ( ) { return this . variableMap _ } setVariableMap ( a ) { this . variableMap _ = a } static getById ( a ) { return getWorkspaceById$$module$build$src$core$common ( a ) } static getAll ( ) { return getAllWorkspaces$$module$build$src$core$common ( ) } } ;
Workspace$$module$build$src$core$workspace . SCAN _ANGLE = 3 ; var module$build$src$core$workspace = { } ; module$build$src$core$workspace . Workspace = Workspace$$module$build$src$core$workspace ; var SOUND _LIMIT$$module$build$src$core$workspace _audio = 100 , WorkspaceAudio$$module$build$src$core$workspace _audio = class { constructor ( a ) { this . parentWorkspace = a ; this . sounds = new Map ; this . lastSound _ = null } dispose ( ) { this . sounds . clear ( ) } load ( a , b ) { if ( a . length ) { try { var c = new globalThis . Audio } catch ( e ) { return } for ( let e = 0 ; e < a . length ; e ++ ) { const f = a [ e ] , g = f . match ( /\.(\w+)$/ ) ; if ( g && c . canPlayType ( "audio/" + g [ 1 ] ) ) { var d = new globalThis . Audio ( f ) ; break } } d && this . sounds . set ( b , d ) } } preload ( ) { for ( const a of this . sounds . values ( ) ) { a . volume =
. 01 ; const b = a . play ( ) ; void 0 !== b ? b . then ( a . pause ) . catch ( function ( ) { } ) : a . pause ( ) ; if ( IPAD$$module$build$src$core$utils$useragent || IPHONE$$module$build$src$core$utils$useragent ) break } } play ( a , b ) { var c = this . sounds . get ( a ) ; c ? ( a = new Date , null !== this . lastSound _ && a . getTime ( ) - this . lastSound _ . getTime ( ) < SOUND _LIMIT$$module$build$src$core$workspace _audio || ( this . lastSound _ = a , c = IPAD$$module$build$src$core$utils$useragent || ANDROID$$module$build$src$core$utils$useragent ? c : c . cloneNode ( ) , c . volume = void 0 === b ? 1 : b , c . play ( ) ) ) :
this . parentWorkspace && this . parentWorkspace . getAudioManager ( ) . play ( a , b ) } } , module$build$src$core$workspace _audio = { } ; module$build$src$core$workspace _audio . WorkspaceAudio = WorkspaceAudio$$module$build$src$core$workspace _audio ; var ZoomControls$$module$build$src$core$zoom _controls = class { constructor ( a ) { this . workspace = a ; this . id = "zoomControls" ; this . zoomResetGroup = this . zoomOutGroup = this . zoomInGroup = this . onZoomOutWrapper _ = this . onZoomInWrapper _ = this . onZoomResetWrapper _ = 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 ) ;
this . onZoomResetWrapper _ && unbind$$module$build$src$core$browser _events ( this . onZoomResetWrapper _ ) ; this . onZoomInWrapper _ && unbind$$module$build$src$core$browser _events ( this . onZoomInWrapper _ ) ; this . onZoomOutWrapper _ && unbind$$module$build$src$core$browser _events ( this . onZoomOutWrapper _ ) } 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" } , 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 . onZoomOutWrapper _ = conditionalBind$$module$build$src$core$browser _events ( this . zoomOutGroup , "mousedown" , 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" } ,
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 . onZoomInWrapper _ = conditionalBind$$module$build$src$core$browser _events ( this . zoomInGroup , "mousedown" , 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" } , 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 . onZoomResetWrapper _ = conditionalBind$$module$build$src$core$browser _events ( this . zoomResetGroup , "mousedown" , 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 ZOOM _TO _FIT _MARGIN$$module$build$src$core$workspace _svg = 20 , WorkspaceSvg$$module$build$src$core$workspace _svg = class extends Workspace$$module$build$src$core$workspace { constructor ( a , b , c ) { super ( a ) ; this . resizeHandlerWrapper _ = null ; this . resizesEnabled _ = this . isVisible _ = this . rendered = ! 0 ; this . startScrollY = this . startScrollX = this . scrollY = this . scrollX = 0 ; this . dragDeltaXY _ = null ; this . oldScale _ = this . scale = 1 ; this . oldLeft _ = this . oldTop _ = 0 ; this . workspaceDragSurface _ = this . blockDragSurface _ = this . currentGesture _ = this . toolbox _ =
this . flyout _ = this . scrollbar = this . trashcan = null ; this . isDragSurfaceActive _ = ! 1 ; this . inverseScreenCTM _ = this . targetWorkspace = this . configureContextMenu = this . lastRecordedPageScroll _ = this . injectionDiv _ = null ; this . inverseScreenCTMDirty _ = ! 0 ; this . highlightedBlocks _ = [ ] ; this . toolboxCategoryCallbacks = new Map ; this . flyoutButtonCallbacks = new Map ; this . cachedParentSvg _ = null ; this . keyboardAccessibilityMode = ! 1 ; this . topBoundedElements _ = [ ] ; this . dragTargetAreas _ = [ ] ; this . zoomControls _ = null ; this . metricsManager _ = new ( getClassFromOptions$$module$build$src$core$registry ( Type$$module$build$src$core$registry . METRICS _MANAGER ,
a , ! 0 ) ) ( this ) ; this . getMetrics = a . getMetrics || this . metricsManager _ . getMetrics . bind ( this . metricsManager _ ) ; this . setMetrics = a . setMetrics || WorkspaceSvg$$module$build$src$core$workspace _svg . setTopLevelWorkspaceMetrics _ ; this . componentManager _ = new ComponentManager$$module$build$src$core$component _manager ; this . connectionDBList = ConnectionDB$$module$build$src$core$connection _db . init ( this . connectionChecker ) ; b && ( this . blockDragSurface _ = b ) ; c && ( this . workspaceDragSurface _ = c ) ; this . useWorkspaceDragSurface _ = ! ! this . workspaceDragSurface _ ;
this . audioManager _ = new WorkspaceAudio$$module$build$src$core$workspace _audio ( a . parentWorkspace ) ; this . grid _ = this . options . gridPattern ? new Grid$$module$build$src$core$grid ( this . options . gridPattern , a . gridOptions ) : null ; this . markerManager _ = new MarkerManager$$module$build$src$core$marker _manager ( this ) ; $ . module$build$src$core$variables && flyoutCategory$$module$build$src$core$variables && this . registerToolboxCategoryCallback ( CATEGORY _NAME$$module$build$src$core$variables , flyoutCategory$$module$build$src$core$variables ) ;
module$build$src$core$variables _dynamic && flyoutCategory$$module$build$src$core$variables _dynamic && this . registerToolboxCategoryCallback ( CATEGORY _NAME$$module$build$src$core$variables _dynamic , flyoutCategory$$module$build$src$core$variables _dynamic ) ; $ . module$build$src$core$procedures && flyoutCategory$$module$build$src$core$procedures && ( this . registerToolboxCategoryCallback ( CATEGORY _NAME$$module$build$src$core$procedures , flyoutCategory$$module$build$src$core$procedures ) , this . addChangeListener ( mutatorOpenListener$$module$build$src$core$procedures ) ) ;
this . themeManager _ = this . options . parentWorkspace ? this . options . parentWorkspace . getThemeManager ( ) : new ThemeManager$$module$build$src$core$theme _manager ( this , this . options . theme || Classic$$module$build$src$core$theme$classic ) ; this . themeManager _ . subscribeWorkspace ( this ) ; let d ; this . renderer _ = init$$module$build$src$core$renderers$common$block _rendering ( this . options . renderer || "geras" , this . getTheme ( ) , null != ( d = this . options . rendererOverrides ) ? d : void 0 ) ; this . cachedParentSvgSize _ = new Size$$module$build$src$core$utils$size ( 0 ,
0 ) } getMarkerManager ( ) { return this . markerManager _ } getMetricsManager ( ) { return this . metricsManager _ } setMetricsManager ( a ) { this . metricsManager _ = a ; this . getMetrics = this . metricsManager _ . getMetrics . bind ( this . metricsManager _ ) } getComponentManager ( ) { return this . componentManager _ } setCursorSvg ( a ) { this . markerManager _ . setCursorSvg ( a ) } setMarkerSvg ( a ) { this . markerManager _ . setMarkerSvg ( a ) } getMarker ( a ) { return this . markerManager _ ? this . markerManager _ . getMarker ( a ) : null } getCursor ( ) { return this . markerManager _ ? this . markerManager _ . getCursor ( ) :
null } getRenderer ( ) { return this . renderer _ } getThemeManager ( ) { return this . themeManager _ } getTheme ( ) { return this . themeManager _ . getTheme ( ) } setTheme ( a ) { a || ( a = Classic$$module$build$src$core$theme$classic ) ; this . themeManager _ . setTheme ( a ) } refreshTheme ( ) { this . svgGroup _ && this . renderer _ . refreshDom ( this . svgGroup _ , this . getTheme ( ) ) ; this . updateBlockStyles _ ( this . getAllBlocks ( ! 1 ) . filter ( function ( b ) { return ! ! b . getStyleName ( ) } ) ) ; this . refreshToolboxSelection ( ) ; this . toolbox _ && this . toolbox _ . refreshTheme ( ) ; this . isVisible ( ) &&
this . setVisible ( ! 0 ) ; const a = new ( get$$module$build$src$core$events$utils ( THEME _CHANGE$$module$build$src$core$events$utils ) ) ( 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 ( ) ; if ( d ) { const e = c ; e . setStyle ( d ) ; e . mutator && e . mutator . updateBlockStyle ( ) } } } 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 ( containsNode$$module$build$src$core$utils$dom ( this . getCanvas ( ) , a ) || containsNode$$module$build$src$core$utils$dom ( this . getBubbleCanvas ( ) , 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 ( ) ) ; 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 ( - 1 !== ( " " + ( a . getAttribute ( "class" ) || "" ) + " " ) . indexOf ( " injectionDiv " ) ) { this . injectionDiv _ = a ; break } a = a . parentNode } } return this . injectionDiv _ } getBlockCanvas ( ) { return this . svgBlockCanvas _ } setResizeHandlerWrapper ( a ) { this . resizeHandlerWrapper _ =
a } createDom ( a ) { this . svgGroup _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G , { "class" : "blocklyWorkspace" } ) ; a && ( this . svgBackground _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { height : "100%" , width : "100%" , "class" : a } , this . svgGroup _ ) , "blocklyMainBackground" === a && this . grid _ ? this . svgBackground _ . style . fill = "url(#" + this . grid _ . getPatternId ( ) + ")" : this . themeManager _ . subscribe ( this . svgBackground _ , "workspaceBackgroundColour" ,
"fill" ) ) ; this . svgBlockCanvas _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G , { "class" : "blocklyBlockCanvas" } , this . svgGroup _ ) ; this . svgBubbleCanvas _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G , { "class" : "blocklyBubbleCanvas" } , this . svgGroup _ ) ; this . isFlyout || ( conditionalBind$$module$build$src$core$browser _events ( this . svgGroup _ , "mousedown" , this , this . onMouseDown _ , ! 1 , ! 0 ) , document . body . addEventListener ( "wheel" , function ( ) { } ) ,
conditionalBind$$module$build$src$core$browser _events ( this . svgGroup _ , "wheel" , this , this . onMouseWheel _ ) ) ; this . options . hasCategories && ( this . toolbox _ = new ( getClassFromOptions$$module$build$src$core$registry ( Type$$module$build$src$core$registry . TOOLBOX , this . options , ! 0 ) ) ( this ) ) ; this . grid _ && this . grid _ . update ( this . scale ) ; this . recordDragTargets ( ) ; ( a = getClassFromOptions$$module$build$src$core$registry ( Type$$module$build$src$core$registry . CURSOR , this . options ) ) && this . markerManager _ . setCursor ( new a ) ; this . renderer _ . createDom ( this . svgGroup _ ,
this . getTheme ( ) ) ; return this . svgGroup _ } dispose ( ) { this . rendered = ! 1 ; this . currentGesture _ && this . currentGesture _ . cancel ( ) ; this . svgGroup _ && removeNode$$module$build$src$core$utils$dom ( this . svgGroup _ ) ; this . toolbox _ && ( this . toolbox _ . dispose ( ) , this . toolbox _ = null ) ; this . flyout _ && ( this . flyout _ . dispose ( ) , this . flyout _ = null ) ; this . trashcan && ( this . trashcan . dispose ( ) , this . trashcan = null ) ; this . scrollbar && ( this . scrollbar . dispose ( ) , this . scrollbar = null ) ; this . zoomControls _ && this . zoomControls _ . dispose ( ) ; this . audioManager _ &&
this . audioManager _ . dispose ( ) ; this . grid _ && ( this . grid _ = null ) ; this . renderer _ . dispose ( ) ; this . markerManager _ && this . markerManager _ . dispose ( ) ; super . dispose ( ) ; this . themeManager _ && ( this . themeManager _ . unsubscribeWorkspace ( this ) , this . themeManager _ . unsubscribe ( this . svgBackground _ ) , this . options . parentWorkspace || this . themeManager _ . dispose ( ) ) ; this . connectionDBList . length = 0 ; this . toolboxCategoryCallbacks . clear ( ) ; this . flyoutButtonCallbacks . clear ( ) ; if ( ! this . options . parentWorkspace ) { const a = this . getParentSvg ( ) ; a && a . parentNode &&
removeNode$$module$build$src$core$utils$dom ( a . parentNode ) } this . resizeHandlerWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . resizeHandlerWrapper _ ) , this . resizeHandlerWrapper _ = null ) } addTrashcan ( ) { this . trashcan = WorkspaceSvg$$module$build$src$core$workspace _svg . newTrashcan ( this ) ; const a = this . trashcan . createDom ( ) ; this . svgGroup _ . insertBefore ( a , this . svgBlockCanvas _ ) } static newTrashcan ( a ) { throw Error ( "The implementation of newTrashcan should be monkey-patched in by blockly.ts" ) ; } addZoomControls ( ) { this . zoomControls _ =
new ZoomControls$$module$build$src$core$zoom _controls ( this ) ; const a = this . zoomControls _ . createDom ( ) ; this . svgGroup _ . appendChild ( a ) } addFlyout ( a ) { const b = new Options$$module$build$src$core$options ( { parentWorkspace : this , rtl : this . RTL , oneBasedIndex : this . options . oneBasedIndex , horizontalLayout : this . horizontalLayout , renderer : this . options . renderer , rendererOverrides : this . options . rendererOverrides , move : { scrollbars : ! 0 } } ) ; b . toolboxPosition = this . options . toolboxPosition ; this . flyout _ = this . horizontalLayout ? new ( getClassFromOptions$$module$build$src$core$registry ( Type$$module$build$src$core$registry . FLYOUTS _HORIZONTAL _TOOLBOX ,
this . options , ! 0 ) ) ( b ) : new ( getClassFromOptions$$module$build$src$core$registry ( Type$$module$build$src$core$registry . FLYOUTS _VERTICAL _TOOLBOX , this . options , ! 0 ) ) ( b ) ; this . flyout _ . autoClose = ! 1 ; this . flyout _ . getWorkspace ( ) . setVisible ( ! 0 ) ; return this . flyout _ . createDom ( a ) } getFlyout ( a ) { return this . flyout _ || a ? this . flyout _ : this . toolbox _ ? this . toolbox _ . getFlyout ( ) : null } getToolbox ( ) { return this . toolbox _ } updateScreenCalculations _ ( ) { this . updateInverseScreenCTM ( ) ; this . recordDragTargets ( ) } resizeContents ( ) { this . resizesEnabled _ &&
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 _ ( ) ) } getCanvas ( ) { return this . svgBlockCanvas _ } setCachedParentSvgSize ( a , b ) { const c = this . getParentSvg ( ) ; null != a && ( this . cachedParentSvgSize _ . width = a , c . setAttribute ( "data-cached-width" , a . toString ( ) ) ) ; null != b && ( this . cachedParentSvgSize _ . height = b , c . setAttribute ( "data-cached-height" , b . toString ( ) ) ) } getBubbleCanvas ( ) { return this . svgBubbleCanvas _ } 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 ) { if ( this . useWorkspaceDragSurface _ && this . isDragSurfaceActive _ ) { var c ; null == ( c = this . workspaceDragSurface _ ) || c . translateSurface ( a , b ) } else c = "translate(" + a + "," + b + ") scale(" + this . scale + ")" , this . svgBlockCanvas _ . setAttribute ( "transform" , c ) , this . svgBubbleCanvas _ . setAttribute ( "transform" , c ) ; this . blockDragSurface _ && this . blockDragSurface _ . translateAndScaleGroup ( a , b , this . scale ) ; this . grid _ && this . grid _ . moveTo ( a , b ) ; this . maybeFireViewportChangeEvent ( ) } resetDragSurface ( ) { if ( this . useWorkspaceDragSurface _ ) { this . isDragSurfaceActive _ =
! 1 ; var a = this . workspaceDragSurface _ . getSurfaceTranslation ( ) ; this . workspaceDragSurface _ . clearAndHide ( this . svgGroup _ ) ; a = "translate(" + a . x + "," + a . y + ") scale(" + this . scale + ")" ; this . svgBlockCanvas _ . setAttribute ( "transform" , a ) ; this . svgBubbleCanvas _ . setAttribute ( "transform" , a ) } } setupDragSurface ( ) { if ( this . useWorkspaceDragSurface _ && ! this . isDragSurfaceActive _ ) { this . isDragSurfaceActive _ = ! 0 ; var a = this . svgBlockCanvas _ . previousSibling , b , c = parseInt ( null != ( b = this . getParentSvg ( ) . getAttribute ( "width" ) ) ? b : "0" ) , d ; b = parseInt ( null !=
( d = this . getParentSvg ( ) . getAttribute ( "height" ) ) ? d : "0" ) ; d = getRelativeXY$$module$build$src$core$utils$svg _math ( this . getCanvas ( ) ) ; this . workspaceDragSurface _ . setContentsAndShow ( this . getCanvas ( ) , this . getBubbleCanvas ( ) , a , c , b , this . scale ) ; this . workspaceDragSurface _ . translateSurface ( d . x , d . y ) } } getBlockDragSurface ( ) { return this . blockDragSurface _ } getWidth ( ) { const a = this . getMetrics ( ) ; return a ? a . viewWidth / this . scale : 0 } setVisible ( a ) { this . isVisible _ = a ; if ( this . svgGroup _ ) if ( 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 ) { a = this . getAllBlocks ( ! 1 ) ; for ( let b = a . length - 1 ; 0 <= b ; b -- ) a [ b ] . markDirty ( ) ; this . render ( ) ; this . toolbox _ && this . toolbox _ . position ( ) } else this . hideChaff ( ! 0 ) } render ( ) { var a = this . getAllBlocks ( ! 1 ) ; for ( var b = a . length - 1 ; 0 <= b ; b -- ) a [ b ] . render ( ! 1 ) ; if ( this . currentGesture _ ) for ( a = this . currentGesture _ . getInsertionMarkers ( ) , b = 0 ; b < a . length ; b ++ ) a [ b ] . render ( ! 1 ) ; 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 ) ? - 1 === this . highlightedBlocks _ . indexOf ( a ) && this . highlightedBlocks _ . push ( a ) : removeElem$$module$build$src$core$utils$array ( this . highlightedBlocks _ , a ) , a . setHighlighted ( b ) } paste ( a ) { if ( ! this . rendered || ! a . type && ! a . tagName ) return null ; this . currentGesture _ && this . currentGesture _ . cancel ( ) ; const b = getGroup$$module$build$src$core$events$utils ( ) ;
b || setGroup$$module$build$src$core$events$utils ( ! 0 ) ; a = a . type ? this . pasteBlock _ ( null , a ) : "comment" === a . tagName . toLowerCase ( ) ? this . pasteWorkspaceComment _ ( a ) : this . pasteBlock _ ( a , null ) ; setGroup$$module$build$src$core$events$utils ( b ) ; return a } pasteBlock _ ( a , b ) { disable$$module$build$src$core$events$utils ( ) ; let c ; try { let d = 0 , e = 0 ; if ( a ) { c = domToBlock$$module$build$src$core$xml ( a , this ) ; let f ; d = parseInt ( null != ( f = a . getAttribute ( "x" ) ) ? f : "0" ) ; this . RTL && ( d = - d ) ; let g ; e = parseInt ( null != ( g = a . getAttribute ( "y" ) ) ? g : "0" ) } else b &&
( c = append$$module$build$src$core$serialization$blocks ( b , this ) , d = b . x || 10 , this . RTL && ( d = this . getWidth ( ) - d ) , e = b . y || 10 ) ; if ( ! isNaN ( d ) && ! isNaN ( e ) ) { let f ; do { f = ! 1 ; const g = this . getAllBlocks ( ! 1 ) ; for ( let h = 0 , k ; k = g [ h ] ; h ++ ) { const l = k . getRelativeToSurfaceXY ( ) ; if ( 1 >= Math . abs ( d - l . x ) && 1 >= Math . abs ( e - l . y ) ) { f = ! 0 ; break } } if ( ! f ) { const h = c . getConnections _ ( ! 1 ) ; for ( let k = 0 , l ; l = h [ k ] ; k ++ ) if ( l . closest ( $ . config$$module$build$src$core$config . snapRadius , new Coordinate$$module$build$src$core$utils$coordinate ( d , e ) ) . connection ) { f = ! 0 ;
break } } f && ( d = this . RTL ? d - $ . config$$module$build$src$core$config . snapRadius : d + $ . config$$module$build$src$core$config . snapRadius , e += 2 * $ . config$$module$build$src$core$config . snapRadius ) } while ( f ) ; c . moveTo ( new Coordinate$$module$build$src$core$utils$coordinate ( d , e ) ) } } 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 ) ) ;
c . select ( ) ; return c } pasteWorkspaceComment _ ( a ) { disable$$module$build$src$core$events$utils ( ) ; let b ; try { b = WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg . fromXmlRendered ( a , this ) ; let c , d = parseInt ( null != ( c = a . getAttribute ( "x" ) ) ? c : "0" ) , e , f = parseInt ( null != ( e = a . getAttribute ( "y" ) ) ? e : "0" ) ; isNaN ( d ) || isNaN ( f ) || ( this . RTL && ( d = - d ) , b . moveBy ( d + 50 , f + 50 ) ) } finally { enable$$module$build$src$core$events$utils ( ) } isEnabled$$module$build$src$core$events$utils ( ) && WorkspaceComment$$module$build$src$core$workspace _comment . fireCreateEvent ( b ) ;
b . select ( ) ; return 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" ) ; } 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 ; d < a . length ; d ++ ) { var c = a [ d ] ; c . isInsertionMarker && c . isInsertionMarker ( ) || ( c = c . getBoundingRectangle ( ) , c . top < b . top && ( b . top =
c . top ) , c . bottom > b . bottom && ( b . bottom = c . bottom ) , c . left < b . left && ( b . left = c . left ) , c . right > b . right && ( b . right = c . right ) ) } return b } cleanUp ( ) { this . setResizesEnabled ( ! 1 ) ; 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 ) ; 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 ) } } 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 . setBrowserFocus ( ) ) } setBrowserFocus ( ) { document . activeElement && document . activeElement instanceof HTMLElement && document . activeElement . blur ( ) ; try { this . getParentSvg ( ) . focus ( { preventScroll : ! 0 } ) } catch ( a ) { try { this . getParentSvg ( ) . parentElement . setActive ( ) } catch ( b ) { this . getParentSvg ( ) . parentElement . 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 : d < this . options . zoomOptions . minScale && ( c = this . options . zoomOptions . minScale / this . scale ) ; var e = this . getCanvas ( ) . getCTM ( ) , f = this . getParentSvg ( ) . createSVGPoint ( ) ; f . x = a ; f . y = b ; f = f . matrixTransform ( e . inverse ( ) ) ; a = f . x ; b = f . y ; e = e . translate ( a * ( 1 - c ) , b * ( 1 - c ) ) . scale ( c ) ; this . scrollX = e . e ; this . scrollY = e . f ; this . setScale ( d ) } } zoomCenter ( a ) { var b = this . getMetrics ( ) ; let c ; this . flyout _ ? ( c = b . svgWidth ? b . svgWidth / 2 : 0 , b = b . svgHeight ? b . svgHeight / 2 : 0 ) : ( c = b . viewWidth / 2 + b . absoluteLeft ,
b = b . viewHeight / 2 + b . absoluteTop ) ; this . zoom ( c , b , a ) } zoomToFit ( ) { if ( this . isMovable ( ) ) { var a = this . getMetrics ( ) , b = a . viewWidth ; a = a . viewHeight ; var c = this . getBlocksBoundingBox ( ) , d = 2 * ZOOM _TO _FIT _MARGIN$$module$build$src$core$workspace _svg , e = c . right - c . left + d ; c = c . bottom - c . top + d ; if ( e ) { this . flyout _ && ( this . horizontalLayout ? ( a += this . flyout _ . getHeight ( ) , c += this . flyout _ . getHeight ( ) / this . scale ) : ( b += this . flyout _ . getWidth ( ) , e += this . flyout _ . getWidth ( ) / this . scale ) ) ; b /= e ; a /= c ; disable$$module$build$src$core$events$utils ( ) ;
try { this . setScale ( Math . min ( b , a ) ) , this . scrollCenter ( ) } finally { enable$$module$build$src$core$events$utils ( ) } this . maybeFireViewportChangeEvent ( ) } } else console . warn ( "Tried to move a non-movable workspace. This could result in blocks becoming inaccessible." ) } beginCanvasTransition ( ) { addClass$$module$build$src$core$utils$dom ( this . svgBlockCanvas _ , "blocklyCanvasTransitioning" ) ; addClass$$module$build$src$core$utils$dom ( this . svgBubbleCanvas _ , "blocklyCanvasTransitioning" ) } endCanvasTransition ( ) { removeClass$$module$build$src$core$utils$dom ( this . svgBlockCanvas _ ,
"blocklyCanvasTransitioning" ) ; removeClass$$module$build$src$core$utils$dom ( this . svgBubbleCanvas _ , "blocklyCanvasTransitioning" ) } scrollCenter ( ) { if ( this . isMovable ( ) ) { var a = this . getMetrics ( ) , b = ( a . scrollWidth - a . viewWidth ) / 2 , c = ( a . scrollHeight - a . viewHeight ) / 2 ; b = - b - a . scrollLeft ; c = - c - a . scrollTop ; this . scroll ( b , c ) } else console . warn ( "Tried to move a non-movable workspace. This could result in blocks becoming inaccessible." ) } centerOnBlock ( a ) { if ( this . isMovable ( ) ) { if ( a = a ? this . getBlockById ( a ) : null ) { var b = a . getRelativeToSurfaceXY ( ) ,
c = a . getHeightWidth ( ) , d = this . scale ; a = ( b . x + ( this . RTL ? - 1 : 1 ) * c . width / 2 ) * d ; b = ( b . y + c . height / 2 ) * d ; c = this . getMetrics ( ) ; this . scroll ( - ( a - c . viewWidth / 2 ) , - ( b - c . viewHeight / 2 ) ) } } else console . warn ( "Tried to move a non-movable workspace. This could result in blocks becoming inaccessible." ) } setScale ( a ) { this . options . zoomOptions . maxScale && a > this . options . zoomOptions . maxScale ? a = this . options . zoomOptions . maxScale : this . options . zoomOptions . minScale && a < this . options . zoomOptions . minScale && ( a = this . options . zoomOptions . minScale ) ;
this . scale = a ; this . hideChaff ( ! 1 ) ; ( a = this . getFlyout ( ! 1 ) ) && a . isVisible ( ) && ( a . reflow ( ) , this . recordDragTargets ( ) ) ; this . grid _ && this . grid _ . update ( this . scale ) ; a = this . getMetrics ( ) ; this . scrollX -= a . absoluteLeft ; this . scrollY -= a . absoluteTop ; a . viewLeft += a . absoluteLeft ; a . viewTop += a . absoluteTop ; this . scroll ( this . scrollX , this . scrollY ) ; this . scrollbar && ( this . flyout _ ? this . scrollbar . resizeView ( a ) : this . scrollbar . resizeContent ( a ) ) } getScale ( ) { return this . options . parentWorkspace ? this . options . parentWorkspace . getScale ( ) : this . scale } scroll ( a ,
b ) { this . hideChaff ( ! 0 ) ; const c = this . getMetrics ( ) ; a = Math . min ( a , - c . scrollLeft ) ; b = Math . min ( b , - c . scrollTop ) ; const d = c . scrollTop + Math . max ( 0 , c . scrollHeight - c . viewHeight ) ; a = Math . max ( a , - ( c . scrollLeft + Math . max ( 0 , c . scrollWidth - c . viewWidth ) ) ) ; b = Math . max ( b , - d ) ; this . scrollX = a ; this . scrollY = b ; this . scrollbar && this . scrollbar . set ( - ( a + c . scrollLeft ) , - ( b + c . scrollTop ) , ! 1 ) ; a += c . absoluteLeft ; b += c . absoluteTop ; this . translate ( a , b ) } getBlockById ( a ) { return super . getBlockById ( a ) } getAllBlocks ( a ) { return super . getAllBlocks ( a ) } getTopBlocks ( a ) { return super . getTopBlocks ( a ) } addTopBlock ( a ) { this . addTopBoundedElement ( a ) ;
super . addTopBlock ( a ) } removeTopBlock ( a ) { this . removeTopBoundedElement ( a ) ; super . removeTopBlock ( a ) } addTopComment ( a ) { this . addTopBoundedElement ( a ) ; super . addTopComment ( a ) } removeTopComment ( a ) { this . removeTopBoundedElement ( a ) ; super . removeTopComment ( a ) } addTopBoundedElement ( a ) { this . topBoundedElements _ . push ( a ) } removeTopBoundedElement ( a ) { removeElem$$module$build$src$core$utils$array ( this . topBoundedElements _ , a ) } getTopBoundedElements ( ) { return [ ] . concat ( this . topBoundedElements _ ) } setResizesEnabled ( a ) { const b = ! this . resizesEnabled _ &&
a ; this . resizesEnabled _ = a ; b && this . resizeContents ( ) } clear ( ) { this . setResizesEnabled ( ! 1 ) ; super . clear ( ) ; this . topBoundedElements _ = [ ] ; this . setResizesEnabled ( ! 0 ) } registerButtonCallback ( a , b ) { if ( "function" !== typeof b ) throw TypeError ( "Button callbacks must be functions." ) ; this . flyoutButtonCallbacks . set ( a , b ) } getButtonCallback ( a ) { let b ; return null != ( b = this . flyoutButtonCallbacks . get ( a ) ) ? b : null } removeButtonCallback ( a ) { this . flyoutButtonCallbacks . delete ( a ) } registerToolboxCategoryCallback ( a , b ) { if ( "function" !== typeof b ) throw TypeError ( "Toolbox category callbacks must be functions." ) ;
this . toolboxCategoryCallbacks . set ( a , b ) } getToolboxCategoryCallback ( a ) { return this . toolboxCategoryCallbacks . get ( a ) || null } removeToolboxCategoryCallback ( a ) { this . toolboxCategoryCallbacks . delete ( a ) } getGesture ( a ) { const b = "mousedown" === a . type || "touchstart" === a . type || "pointerdown" === a . type , c = this . currentGesture _ ; return c ? b && c . hasStarted ( ) ? ( console . warn ( "Tried to start the same gesture twice." ) , c . cancel ( ) , null ) : c : b ? this . currentGesture _ = new TouchGesture$$module$build$src$core$touch _gesture ( a , this ) : null } clearGesture ( ) { this . currentGesture _ =
null } cancelCurrentGesture ( ) { this . currentGesture _ && this . currentGesture _ . cancel ( ) } getAudioManager ( ) { return this . audioManager _ } getGrid ( ) { return this . grid _ } hideChaff ( a ) { hide$$module$build$src$core$tooltip ( ) ; hide$$module$build$src$core$widgetdiv ( ) ; hideWithoutAnimation$$module$build$src$core$dropdowndiv ( ) ; const b = ! ! a ; this . getComponentManager ( ) . getComponents ( ComponentManager$$module$build$src$core$component _manager . Capability . AUTOHIDEABLE , ! 0 ) . forEach ( c => c . autoHide ( b ) ) } 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 module$build$src$core$serialization$workspaces = { } ; module$build$src$core$serialization$workspaces . load = load$$module$build$src$core$serialization$workspaces ; module$build$src$core$serialization$workspaces . save = save$$module$build$src$core$serialization$workspaces ; var VariableSerializer$$module$build$src$core$serialization$variables = class { constructor ( ) { this . priority = VARIABLES$$module$build$src$core$serialization$priorities } save ( a ) { const b = [ ] ; for ( const c of a . getAllVariables ( ) ) a = { name : c . name , id : c . getId ( ) } , c . type && ( a . type = c . type ) , b . push ( a ) ; return b . length ? b : null } load ( a , b ) { for ( const c of a ) b . createVariable ( c . name , c . type , c . id ) } clear ( a ) { a . getVariableMap ( ) . clear ( ) } } ; register$$module$build$src$core$serialization$registry ( "variables" , new VariableSerializer$$module$build$src$core$serialization$variables ) ;
var module$build$src$core$serialization$variables = { } ; var ConstantProvider$$module$build$src$core$renderers$zelos$constants = class extends ConstantProvider$$module$build$src$core$renderers$common$constants { constructor ( ) { super ( ) ; this . GRID _UNIT = 4 ; this . CURSOR _COLOUR = "#ffa200" ; this . CURSOR _RADIUS = 5 ; this . JAGGED _TEETH _WIDTH = this . JAGGED _TEETH _HEIGHT = 0 ; this . START _HAT _HEIGHT = 22 ; this . START _HAT _WIDTH = 96 ; this . SHAPES = { HEXAGONAL : 1 , ROUND : 2 , SQUARE : 3 , PUZZLE : 4 , NOTCH : 5 } ; this . SHAPE _IN _SHAPE _PADDING = { 1 : { 0 : 5 * this . GRID _UNIT , 1 : 2 * this . GRID _UNIT , 2 : 5 * this . GRID _UNIT , 3 : 5 * this . GRID _UNIT } ,
2 : { 0 : 3 * this . GRID _UNIT , 1 : 3 * this . GRID _UNIT , 2 : 1 * this . GRID _UNIT , 3 : 2 * this . GRID _UNIT } , 3 : { 0 : 2 * this . GRID _UNIT , 1 : 2 * this . GRID _UNIT , 2 : 2 * this . GRID _UNIT , 3 : 2 * this . GRID _UNIT } } ; this . FULL _BLOCK _FIELDS = ! 0 ; this . FIELD _TEXT _FONTWEIGHT = "bold" ; this . FIELD _TEXT _FONTFAMILY = '"Helvetica Neue", "Segoe UI", Helvetica, sans-serif' ; this . FIELD _COLOUR _FULL _BLOCK = this . FIELD _TEXTINPUT _BOX _SHADOW = this . FIELD _DROPDOWN _SVG _ARROW = this . FIELD _DROPDOWN _COLOURED _DIV = this . FIELD _DROPDOWN _NO _BORDER _RECT _SHADOW = ! 0 ; this . SELECTED _GLOW _COLOUR = "#fff200" ;
this . SELECTED _GLOW _SIZE = . 5 ; this . REPLACEMENT _GLOW _COLOUR = "#fff200" ; this . REPLACEMENT _GLOW _SIZE = 2 ; this . selectedGlowFilterId = "" ; this . selectedGlowFilter _ = null ; this . replacementGlowFilterId = "" ; this . SQUARED = this . ROUNDED = this . HEXAGONAL = this . replacementGlowFilter _ = null ; this . SMALL _PADDING = this . GRID _UNIT ; this . MEDIUM _PADDING = 2 * this . GRID _UNIT ; this . MEDIUM _LARGE _PADDING = 3 * this . GRID _UNIT ; this . LARGE _PADDING = 4 * this . GRID _UNIT ; this . CORNER _RADIUS = 1 * this . GRID _UNIT ; this . NOTCH _WIDTH = 9 * this . GRID _UNIT ; this . NOTCH _HEIGHT = 2 * this . GRID _UNIT ;
this . STATEMENT _INPUT _NOTCH _OFFSET = this . NOTCH _OFFSET _LEFT = 3 * this . GRID _UNIT ; this . MIN _BLOCK _WIDTH = 2 * this . GRID _UNIT ; this . MIN _BLOCK _HEIGHT = 12 * this . GRID _UNIT ; this . EMPTY _STATEMENT _INPUT _HEIGHT = 6 * this . GRID _UNIT ; this . TOP _ROW _MIN _HEIGHT = this . CORNER _RADIUS ; this . TOP _ROW _PRECEDES _STATEMENT _MIN _HEIGHT = this . LARGE _PADDING ; this . BOTTOM _ROW _MIN _HEIGHT = this . CORNER _RADIUS ; this . BOTTOM _ROW _AFTER _STATEMENT _MIN _HEIGHT = 6 * this . GRID _UNIT ; this . STATEMENT _BOTTOM _SPACER = - this . NOTCH _HEIGHT ; this . STATEMENT _INPUT _SPACER _MIN _WIDTH = 40 *
this . GRID _UNIT ; this . STATEMENT _INPUT _PADDING _LEFT = 4 * this . GRID _UNIT ; this . EMPTY _INLINE _INPUT _PADDING = 4 * this . GRID _UNIT ; this . EMPTY _INLINE _INPUT _HEIGHT = 8 * this . GRID _UNIT ; this . DUMMY _INPUT _MIN _HEIGHT = 8 * this . GRID _UNIT ; this . DUMMY _INPUT _SHADOW _MIN _HEIGHT = 6 * this . GRID _UNIT ; this . CURSOR _WS _WIDTH = 20 * this . GRID _UNIT ; this . FIELD _TEXT _FONTSIZE = 3 * this . GRID _UNIT ; this . FIELD _BORDER _RECT _RADIUS = this . CORNER _RADIUS ; this . FIELD _BORDER _RECT _X _PADDING = 2 * this . GRID _UNIT ; this . FIELD _BORDER _RECT _Y _PADDING = 1.625 * this . GRID _UNIT ; this . FIELD _BORDER _RECT _HEIGHT =
8 * this . GRID _UNIT ; this . FIELD _DROPDOWN _BORDER _RECT _HEIGHT = 8 * this . GRID _UNIT ; this . FIELD _DROPDOWN _SVG _ARROW _PADDING = this . FIELD _BORDER _RECT _X _PADDING ; this . FIELD _COLOUR _DEFAULT _WIDTH = 2 * this . GRID _UNIT ; this . FIELD _COLOUR _DEFAULT _HEIGHT = 4 * this . GRID _UNIT ; this . FIELD _CHECKBOX _X _OFFSET = 1 * this . GRID _UNIT ; this . MAX _DYNAMIC _CONNECTION _SHAPE _WIDTH = 12 * this . GRID _UNIT } setFontConstants _ ( a ) { super . setFontConstants _ ( a ) ; this . FIELD _DROPDOWN _BORDER _RECT _HEIGHT = this . FIELD _BORDER _RECT _HEIGHT = this . FIELD _TEXT _HEIGHT + 2 * this . FIELD _BORDER _RECT _Y _PADDING } init ( ) { super . init ( ) ;
this . HEXAGONAL = this . makeHexagonal ( ) ; this . ROUNDED = this . makeRounded ( ) ; this . SQUARED = this . makeSquared ( ) ; this . STATEMENT _INPUT _NOTCH _OFFSET = this . NOTCH _OFFSET _LEFT + this . INSIDE _CORNERS . rightWidth } setDynamicProperties _ ( a ) { super . setDynamicProperties _ ( a ) ; this . SELECTED _GLOW _COLOUR = a . getComponentStyle ( "selectedGlowColour" ) || this . SELECTED _GLOW _COLOUR ; const b = Number ( a . getComponentStyle ( "selectedGlowSize" ) ) ; this . SELECTED _GLOW _SIZE = b && ! isNaN ( b ) ? b : this . SELECTED _GLOW _SIZE ; this . REPLACEMENT _GLOW _COLOUR = a . getComponentStyle ( "replacementGlowColour" ) ||
this . REPLACEMENT _GLOW _COLOUR ; this . REPLACEMENT _GLOW _SIZE = ( a = Number ( a . getComponentStyle ( "replacementGlowSize" ) ) ) && ! isNaN ( a ) ? a : this . REPLACEMENT _GLOW _SIZE } dispose ( ) { super . dispose ( ) ; this . selectedGlowFilter _ && removeNode$$module$build$src$core$utils$dom ( this . selectedGlowFilter _ ) ; this . replacementGlowFilter _ && removeNode$$module$build$src$core$utils$dom ( this . replacementGlowFilter _ ) } makeStartHat ( ) { const a = this . START _HAT _HEIGHT , b = this . START _HAT _WIDTH , c = curve$$module$build$src$core$utils$svg _paths ( "c" , [ point$$module$build$src$core$utils$svg _paths ( 25 ,
- a ) , point$$module$build$src$core$utils$svg _paths ( 71 , - a ) , point$$module$build$src$core$utils$svg _paths ( b , 0 ) ] ) ; return { height : a , width : b , path : c } } makeHexagonal ( ) { function a ( c , d , e ) { var f = c / 2 ; f = f > b ? b : f ; e = e ? - 1 : 1 ; c = ( d ? - 1 : 1 ) * c / 2 ; return lineTo$$module$build$src$core$utils$svg _paths ( - e * f , c ) + lineTo$$module$build$src$core$utils$svg _paths ( e * f , c ) } const b = this . MAX _DYNAMIC _CONNECTION _SHAPE _WIDTH ; return { type : this . SHAPES . HEXAGONAL , isDynamic : ! 0 , width ( c ) { c /= 2 ; return c > b ? b : c } , height ( c ) { return c } , connectionOffsetY ( c ) { return c /
2 } , connectionOffsetX ( c ) { return - c } , pathDown ( c ) { return a ( c , ! 1 , ! 1 ) } , pathUp ( c ) { return a ( c , ! 0 , ! 1 ) } , pathRightDown ( c ) { return a ( c , ! 1 , ! 0 ) } , pathRightUp ( c ) { return a ( c , ! 1 , ! 0 ) } } } makeRounded ( ) { function a ( d , e , f ) { const g = d > c ? d - c : 0 ; d = ( d > c ? c : d ) / 2 ; return arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,1" , d , point$$module$build$src$core$utils$svg _paths ( ( e ? - 1 : 1 ) * d , ( e ? - 1 : 1 ) * d ) ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , ( f ? 1 : - 1 ) * g ) + arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,1" , d , point$$module$build$src$core$utils$svg _paths ( ( e ?
1 : - 1 ) * d , ( e ? - 1 : 1 ) * d ) ) } const b = this . MAX _DYNAMIC _CONNECTION _SHAPE _WIDTH , c = 2 * b ; return { type : this . SHAPES . ROUND , isDynamic : ! 0 , width ( d ) { d /= 2 ; return d > b ? b : d } , height ( d ) { return d } , connectionOffsetY ( d ) { return d / 2 } , connectionOffsetX ( d ) { return - d } , pathDown ( d ) { return a ( d , ! 1 , ! 1 ) } , pathUp ( d ) { return a ( d , ! 0 , ! 1 ) } , pathRightDown ( d ) { return a ( d , ! 1 , ! 0 ) } , pathRightUp ( d ) { return a ( d , ! 1 , ! 0 ) } } } makeSquared ( ) { function a ( c , d , e ) { c -= 2 * b ; return arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,1" , b , point$$module$build$src$core$utils$svg _paths ( ( d ?
- 1 : 1 ) * b , ( d ? - 1 : 1 ) * b ) ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , ( e ? 1 : - 1 ) * c ) + arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,1" , b , point$$module$build$src$core$utils$svg _paths ( ( d ? 1 : - 1 ) * b , ( d ? - 1 : 1 ) * b ) ) } const b = this . CORNER _RADIUS ; return { type : this . SHAPES . SQUARE , isDynamic : ! 0 , width ( c ) { return b } , height ( c ) { return c } , connectionOffsetY ( c ) { return c / 2 } , connectionOffsetX ( c ) { return - c } , pathDown ( c ) { return a ( c , ! 1 , ! 1 ) } , pathUp ( c ) { return a ( c , ! 0 , ! 1 ) } , pathRightDown ( c ) { return a ( c , ! 1 , ! 0 ) } , pathRightUp ( c ) { return a ( c ,
! 1 , ! 0 ) } } } shapeFor ( a ) { let b = a . getCheck ( ) ; ! b && a . targetConnection && ( b = a . targetConnection . getCheck ( ) ) ; switch ( a . type ) { case ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE : case ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE : a = a . getSourceBlock ( ) . getOutputShape ( ) ; if ( null !== a ) switch ( a ) { case this . SHAPES . HEXAGONAL : return this . HEXAGONAL ; case this . SHAPES . ROUND : return this . ROUNDED ; case this . SHAPES . SQUARE : return this . SQUARED } if ( b && - 1 !== b . indexOf ( "Boolean" ) ) return this . HEXAGONAL ;
if ( b && - 1 !== b . indexOf ( "Number" ) ) return this . ROUNDED ; b && b . indexOf ( "String" ) ; return this . ROUNDED ; case ConnectionType$$module$build$src$core$connection _type . PREVIOUS _STATEMENT : case ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT : return this . NOTCH ; default : throw Error ( "Unknown type" ) ; } } makeNotch ( ) { function a ( l ) { return curve$$module$build$src$core$utils$svg _paths ( "c" , [ point$$module$build$src$core$utils$svg _paths ( l * e / 2 , 0 ) , point$$module$build$src$core$utils$svg _paths ( l * e * 3 / 4 , g / 2 ) , point$$module$build$src$core$utils$svg _paths ( l *
e , g ) ] ) + line$$module$build$src$core$utils$svg _paths ( [ point$$module$build$src$core$utils$svg _paths ( l * e , f ) ] ) + curve$$module$build$src$core$utils$svg _paths ( "c" , [ point$$module$build$src$core$utils$svg _paths ( l * e / 4 , g / 2 ) , point$$module$build$src$core$utils$svg _paths ( l * e / 2 , g ) , point$$module$build$src$core$utils$svg _paths ( l * e , g ) ] ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , l * d ) + curve$$module$build$src$core$utils$svg _paths ( "c" , [ point$$module$build$src$core$utils$svg _paths ( l * e / 2 , 0 ) , point$$module$build$src$core$utils$svg _paths ( l *
e * 3 / 4 , - ( g / 2 ) ) , point$$module$build$src$core$utils$svg _paths ( l * e , - g ) ] ) + line$$module$build$src$core$utils$svg _paths ( [ point$$module$build$src$core$utils$svg _paths ( l * e , - f ) ] ) + curve$$module$build$src$core$utils$svg _paths ( "c" , [ point$$module$build$src$core$utils$svg _paths ( l * e / 4 , - ( g / 2 ) ) , point$$module$build$src$core$utils$svg _paths ( l * e / 2 , - g ) , point$$module$build$src$core$utils$svg _paths ( l * e , - g ) ] ) } const b = this . NOTCH _WIDTH , c = this . NOTCH _HEIGHT , d = b / 3 , e = d / 3 , f = c / 2 , g = f / 2 , h = a ( 1 ) , k = a ( - 1 ) ; return { type : this . SHAPES . NOTCH ,
width : b , height : c , pathLeft : h , pathRight : k } } makeInsideCorners ( ) { const a = this . CORNER _RADIUS , b = arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,0" , a , point$$module$build$src$core$utils$svg _paths ( - a , a ) ) , c = arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,1" , a , point$$module$build$src$core$utils$svg _paths ( - a , a ) ) , d = arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,0" , a , point$$module$build$src$core$utils$svg _paths ( a , a ) ) , e = arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,1" , a , point$$module$build$src$core$utils$svg _paths ( a ,
a ) ) ; return { width : a , height : a , pathTop : b , pathBottom : d , rightWidth : a , rightHeight : a , pathTopRight : c , pathBottomRight : e } } generateSecondaryColour _ ( a ) { return blend$$module$build$src$core$utils$colour ( "#000" , a , . 15 ) || a } generateTertiaryColour _ ( a ) { return blend$$module$build$src$core$utils$colour ( "#000" , a , . 25 ) || a } createDom ( a , b , c ) { super . createDom ( a , b , c ) ; a = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . DEFS , { } , a ) ; b = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FILTER ,
{ id : "blocklySelectedGlowFilter" + this . randomIdentifier , height : "160%" , width : "180%" , y : "-30%" , x : "-40%" } , a ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FEGAUSSIANBLUR , { "in" : "SourceGraphic" , stdDeviation : this . SELECTED _GLOW _SIZE } , b ) ; c = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FECOMPONENTTRANSFER , { result : "outBlur" } , b ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FEFUNCA , { type : "table" ,
tableValues : "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1" } , c ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FEFLOOD , { "flood-color" : this . SELECTED _GLOW _COLOUR , "flood-opacity" : 1 , result : "outColor" } , b ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FECOMPOSITE , { "in" : "outColor" , in2 : "outBlur" , operator : "in" , result : "outGlow" } , b ) ; this . selectedGlowFilterId = b . id ; this . selectedGlowFilter _ = b ; a = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FILTER ,
{ id : "blocklyReplacementGlowFilter" + this . randomIdentifier , height : "160%" , width : "180%" , y : "-30%" , x : "-40%" } , a ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FEGAUSSIANBLUR , { "in" : "SourceGraphic" , stdDeviation : this . REPLACEMENT _GLOW _SIZE } , a ) ; b = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FECOMPONENTTRANSFER , { result : "outBlur" } , a ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FEFUNCA , { type : "table" ,
tableValues : "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1" } , b ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FEFLOOD , { "flood-color" : this . REPLACEMENT _GLOW _COLOUR , "flood-opacity" : 1 , result : "outColor" } , a ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FECOMPOSITE , { "in" : "outColor" , in2 : "outBlur" , operator : "in" , result : "outGlow" } , a ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . FECOMPOSITE , { "in" : "SourceGraphic" ,
in2 : "outGlow" , operator : "over" } , a ) ; this . replacementGlowFilterId = a . id ; this . replacementGlowFilter _ = a } getCSS _ ( a ) { return [ ` ${ a } .blocklyText, ` , ` ${ a } .blocklyFlyoutLabelText { ` , ` font: ${ this . FIELD _TEXT _FONTWEIGHT } ${ this . FIELD _TEXT _FONTSIZE } ` + ` pt ${ this . FIELD _TEXT _FONTFAMILY } ; ` , "}" , ` ${ a } .blocklyText { ` , "fill: #fff;" , "}" , ` ${ a } .blocklyNonEditableText>rect:not(.blocklyDropdownRect), ` , ` ${ a } .blocklyEditableText>rect:not(.blocklyDropdownRect) { ` , ` fill: ${ this . FIELD _BORDER _RECT _COLOUR } ; ` , "}" , ` ${ a } .blocklyNonEditableText>text, ` ,
` ${ a } .blocklyEditableText>text, ` , ` ${ a } .blocklyNonEditableText>g>text, ` , ` ${ a } .blocklyEditableText>g>text { ` , "fill: #575E75;" , "}" , ` ${ a } .blocklyFlyoutLabelText { ` , "fill: #575E75;" , "}" , ` ${ a } .blocklyText.blocklyBubbleText { ` , "fill: #575E75;" , "}" , ` ${ a } .blocklyDraggable:not(.blocklyDisabled) ` , " .blocklyEditableText:not(.editing):hover>rect," , ` ${ a } .blocklyDraggable:not(.blocklyDisabled) ` , " .blocklyEditableText:not(.editing):hover>.blocklyPath {" , "stroke: #fff;" , "stroke-width: 2;" , "}" , ` ${ a } .blocklyHtmlInput { ` ,
` font-family: ${ this . FIELD _TEXT _FONTFAMILY } ; ` , ` font-weight: ${ this . FIELD _TEXT _FONTWEIGHT } ; ` , "color: #575E75;" , "}" , ` ${ a } .blocklyDropdownText { ` , "fill: #fff !important;" , "}" , ` ${ a } .blocklyWidgetDiv .goog-menuitem, ` , ` ${ a } .blocklyDropDownDiv .goog-menuitem { ` , ` font-family: ${ this . FIELD _TEXT _FONTFAMILY } ; ` , "}" , ` ${ a } .blocklyDropDownDiv .goog-menuitem-content { ` , "color: #fff;" , "}" , ` ${ a } .blocklyHighlightedConnectionPath { ` , ` stroke: ${ this . SELECTED _GLOW _COLOUR } ; ` , "}" , ` ${ a } .blocklyDisabled > .blocklyOutlinePath { ` ,
` fill: url(#blocklyDisabledPattern ${ this . randomIdentifier } ) ` , "}" , ` ${ a } .blocklyInsertionMarker>.blocklyPath { ` , ` fill-opacity: ${ this . INSERTION _MARKER _OPACITY } ; ` , "stroke: none;" , "}" ] } } , module$build$src$core$renderers$zelos$constants = { } ; module$build$src$core$renderers$zelos$constants . ConstantProvider = ConstantProvider$$module$build$src$core$renderers$zelos$constants ; var Drawer$$module$build$src$core$renderers$zelos$drawer = class extends Drawer$$module$build$src$core$renderers$common$drawer { constructor ( a , b ) { super ( a , b ) } draw ( ) { const a = this . block _ . pathObject ; a . beginDrawing ( ) ; this . hideHiddenIcons _ ( ) ; this . drawOutline _ ( ) ; this . drawInternals _ ( ) ; a . setPath ( this . outlinePath _ + "\n" + this . inlinePath _ ) ; this . info _ . RTL && a . flipRTL ( ) ; if ( isDebuggerEnabled$$module$build$src$core$renderers$common$debug ( ) ) { let b , c ; null == ( b = this . block _ ) || null == ( c = b . renderingDebugger ) || c . drawDebug ( this . block _ ,
this . info _ ) } this . recordSizeOnBlock _ ( ) ; this . info _ . outputConnection && ( a . outputShapeType = this . info _ . outputConnection . shape . type ) ; a . endDrawing ( ) } drawOutline _ ( ) { this . info _ . outputConnection && this . info _ . outputConnection . isDynamicShape && ! this . info _ . hasStatementInput && ! this . info _ . bottomRow . hasNextConnection ? ( this . drawFlatTop _ ( ) , this . drawRightDynamicConnection _ ( ) , this . drawFlatBottom _ ( ) , this . drawLeftDynamicConnection _ ( ) ) : super . drawOutline _ ( ) } drawLeft _ ( ) { this . info _ . outputConnection && this . info _ . outputConnection . isDynamicShape ?
this . drawLeftDynamicConnection _ ( ) : super . drawLeft _ ( ) } drawRightSideRow _ ( a ) { if ( ! ( 0 >= a . height ) ) if ( Types$$module$build$src$core$renderers$measurables$types . isSpacer ( a ) && ( a . precedesStatement || a . followsStatement ) ) { var b = this . constants _ . INSIDE _CORNERS . rightHeight ; b = a . height - ( a . precedesStatement ? b : 0 ) ; this . outlinePath _ += ( a . followsStatement ? this . constants _ . INSIDE _CORNERS . pathBottomRight : "" ) + ( 0 < b ? lineOnAxis$$module$build$src$core$utils$svg _paths ( "V" , a . yPos + b ) : "" ) + ( a . precedesStatement ? this . constants _ . INSIDE _CORNERS . pathTopRight :
"" ) } else this . outlinePath _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "V" , a . yPos + a . height ) } drawRightDynamicConnection _ ( ) { if ( ! this . info _ . outputConnection ) throw Error ( "Cannot draw the output connection of a block that doesn't have one" ) ; this . outlinePath _ += this . info _ . outputConnection . shape . pathRightDown ( this . info _ . outputConnection . height ) } drawLeftDynamicConnection _ ( ) { if ( ! this . info _ . outputConnection ) throw Error ( "Cannot draw the output connection of a block that doesn't have one" ) ; this . positionOutputConnection _ ( ) ;
this . outlinePath _ += this . info _ . outputConnection . shape . pathUp ( this . info _ . outputConnection . height ) ; this . outlinePath _ += "z" } drawFlatTop _ ( ) { const a = this . info _ . topRow ; this . positionPreviousConnection _ ( ) ; this . outlinePath _ += moveBy$$module$build$src$core$utils$svg _paths ( a . xPos , this . info _ . startY ) ; this . outlinePath _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , a . width ) } drawFlatBottom _ ( ) { const a = this . info _ . bottomRow ; this . positionNextConnection _ ( ) ; this . outlinePath _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "V" ,
a . baseline ) ; this . outlinePath _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , - a . width ) } drawInlineInput _ ( a ) { this . positionInlineInputConnection _ ( a ) ; const b = a . input . name ; if ( ! a . connectedBlock && ! this . info _ . isInsertionMarker ) { var c = a . width - 2 * a . connectionWidth ; a = moveTo$$module$build$src$core$utils$svg _paths ( a . xPos + a . connectionWidth , a . centerline - a . height / 2 ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , c ) + a . shape . pathRightDown ( a . height ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" ,
- c ) + a . shape . pathUp ( a . height ) + "z" ; this . block _ . pathObject . setOutlinePath ( b , a ) } } drawStatementInput _ ( a ) { var b = a . getLastInput ( ) ; const c = b . xPos + b . notchOffset + b . shape . width , d = b . shape . pathRight + lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , - ( b . notchOffset - this . constants _ . INSIDE _CORNERS . width ) ) + this . constants _ . INSIDE _CORNERS . pathTop , e = a . height - 2 * this . constants _ . INSIDE _CORNERS . height ; b = this . constants _ . INSIDE _CORNERS . pathBottom + lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , b . notchOffset - this . constants _ . INSIDE _CORNERS . width ) +
( b . connectedBottomNextConnection ? "" : b . shape . pathLeft ) ; this . outlinePath _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "H" , c ) + d + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , e ) + b + lineOnAxis$$module$build$src$core$utils$svg _paths ( "H" , a . xPos + a . width ) ; this . positionStatementInputConnection _ ( a ) } } , module$build$src$core$renderers$zelos$drawer = { } ; module$build$src$core$renderers$zelos$drawer . Drawer = Drawer$$module$build$src$core$renderers$zelos$drawer ; $ . FieldImage$$module$build$src$core$field _image = class extends Field$$module$build$src$core$field { constructor ( a , b , c , d , e , f , g ) { super ( Field$$module$build$src$core$field . SKIP _SETUP ) ; this . imageElement _ = this . clickHandler _ = null ; this . flipRtl _ = this . isDirty _ = this . EDITABLE = ! 1 ; this . altText _ = "" ; c = Number ( replaceMessageReferences$$module$build$src$core$utils$parsing ( c ) ) ; b = Number ( replaceMessageReferences$$module$build$src$core$utils$parsing ( b ) ) ; if ( isNaN ( c ) || isNaN ( b ) ) throw Error ( "Height and width values of an image field must cast to numbers." ) ;
if ( 0 >= c || 0 >= b ) throw Error ( "Height and width values of an image field must be greater than 0." ) ; this . size _ = new Size$$module$build$src$core$utils$size ( b , c + $ . FieldImage$$module$build$src$core$field _image . Y _PADDING ) ; this . imageHeight _ = c ; "function" === typeof e && ( this . clickHandler _ = e ) ; a !== Field$$module$build$src$core$field . SKIP _SETUP && ( g ? this . configure _ ( g ) : ( this . flipRtl _ = ! ! f , this . altText _ = replaceMessageReferences$$module$build$src$core$utils$parsing ( d ) || "" ) , this . setValue ( replaceMessageReferences$$module$build$src$core$utils$parsing ( a ) ) ) } configure _ ( a ) { super . configure _ ( a ) ;
a . flipRtl && ( this . flipRtl _ = a . flipRtl ) ; a . alt && ( this . altText _ = replaceMessageReferences$$module$build$src$core$utils$parsing ( a . alt ) ) } initView ( ) { this . imageElement _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . IMAGE , { height : this . imageHeight _ + "px" , width : this . size _ . width + "px" , alt : this . altText _ } , this . fieldGroup _ ) ; this . imageElement _ . setAttributeNS ( XLINK _NS$$module$build$src$core$utils$dom , "xlink:href" , this . value _ ) ; this . clickHandler _ && ( this . imageElement _ . style . cursor =
"pointer" ) } updateSize _ ( ) { } doClassValidation _ ( a ) { return "string" !== typeof a ? null : a } doValueUpdate _ ( a ) { this . value _ = a ; this . imageElement _ && this . imageElement _ . setAttributeNS ( XLINK _NS$$module$build$src$core$utils$dom , "xlink:href" , String ( this . value _ ) ) } getFlipRtl ( ) { return this . flipRtl _ } setAlt ( a ) { a !== this . altText _ && ( this . altText _ = a || "" , this . imageElement _ && this . imageElement _ . setAttribute ( "alt" , this . altText _ ) ) } showEditor _ ( ) { this . clickHandler _ && this . clickHandler _ ( this ) } setOnClickHandler ( a ) { this . clickHandler _ = a } getText _ ( ) { return this . altText _ } static fromJson ( a ) { if ( ! a . src ||
! a . width || ! a . height ) throw Error ( "src, width, and height values for an image field arerequired. The width and height must be non-zero." ) ; return new this ( a . src , a . width , a . height , void 0 , void 0 , void 0 , a ) } } ; $ . FieldImage$$module$build$src$core$field _image . Y _PADDING = 1 ; register$$module$build$src$core$field _registry ( "field_image" , $ . FieldImage$$module$build$src$core$field _image ) ; $ . FieldImage$$module$build$src$core$field _image . prototype . DEFAULT _VALUE = "" ; var module$build$src$core$field _image = { } ;
module$build$src$core$field _image . FieldImage = $ . FieldImage$$module$build$src$core$field _image ; $ . FieldTextInput$$module$build$src$core$field _textinput = class extends Field$$module$build$src$core$field { constructor ( a , b , c ) { super ( Field$$module$build$src$core$field . SKIP _SETUP ) ; this . spellcheck _ = ! 0 ; this . htmlInput _ = null ; this . isTextValid _ = this . isBeingEdited _ = ! 1 ; this . onKeyInputWrapper _ = this . onKeyDownWrapper _ = null ; this . fullBlockClickTarget _ = ! 1 ; this . workspace _ = null ; this . SERIALIZABLE = ! 0 ; this . CURSOR = "text" ; a !== Field$$module$build$src$core$field . SKIP _SETUP && ( c && this . configure _ ( c ) , this . setValue ( a ) , b && this . setValidator ( b ) ) } configure _ ( a ) { super . configure _ ( a ) ;
void 0 !== a . spellcheck && ( this . spellcheck _ = a . spellcheck ) } initView ( ) { const a = this . getSourceBlock ( ) ; if ( ! a ) throw new UnattachedFieldError$$module$build$src$core$field ; if ( this . getConstants ( ) . FULL _BLOCK _FIELDS ) { let b = 0 , c = 0 ; for ( let d = 0 , e ; e = a . inputList [ d ] ; d ++ ) { for ( let f = 0 ; e . fieldRow [ f ] ; f ++ ) b ++ ; e . connection && c ++ } this . fullBlockClickTarget _ = 1 >= b && a . outputConnection && ! c } else this . fullBlockClickTarget _ = ! 1 ; this . fullBlockClickTarget _ ? this . clickTarget _ = this . sourceBlock _ . getSvgRoot ( ) : this . createBorderRect _ ( ) ; this . createTextElement _ ( ) } doClassValidation _ ( a ) { return null ===
a || void 0 === a ? null : String ( a ) } doValueInvalid _ ( a ) { this . isBeingEdited _ && ( this . isTextValid _ = ! 1 , a = this . value _ , this . value _ = this . htmlInput _ . getAttribute ( "data-untyped-default-value" ) , this . sourceBlock _ && 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 ) ) ( this . sourceBlock _ , "field" , this . name || null , a , this . value _ ) ) ) } doValueUpdate _ ( a ) { this . isTextValid _ = ! 0 ; this . value _ = a ; this . isBeingEdited _ ||
( this . isDirty _ = ! 0 ) } applyColour ( ) { if ( this . sourceBlock _ && this . getConstants ( ) . FULL _BLOCK _FIELDS ) { var a = this . sourceBlock _ ; if ( this . borderRect _ ) { if ( ! a . style . colourTertiary ) throw Error ( "The renderer did not properly initialize the block style" ) ; this . borderRect _ . setAttribute ( "stroke" , a . style . colourTertiary ) } else a . pathObject . svgPath . setAttribute ( "fill" , this . getConstants ( ) . FIELD _BORDER _RECT _COLOUR ) } } render _ ( ) { super . render _ ( ) ; if ( this . isBeingEdited _ ) { this . resizeEditor _ ( ) ; const a = this . htmlInput _ ; this . isTextValid _ ?
( removeClass$$module$build$src$core$utils$dom ( a , "blocklyInvalidInput" ) , setState$$module$build$src$core$utils$aria ( a , State$$module$build$src$core$utils$aria . INVALID , ! 1 ) ) : ( addClass$$module$build$src$core$utils$dom ( a , "blocklyInvalidInput" ) , setState$$module$build$src$core$utils$aria ( a , State$$module$build$src$core$utils$aria . INVALID , ! 0 ) ) } } setSpellcheck ( a ) { a !== this . spellcheck _ && ( this . spellcheck _ = a , this . htmlInput _ && this . htmlInput _ . setAttribute ( "spellcheck" , this . spellcheck _ ) ) } showEditor _ ( a , b ) { this . workspace _ =
this . sourceBlock _ . workspace ; a = b || ! 1 ; ! a && ( MOBILE$$module$build$src$core$utils$useragent || ANDROID$$module$build$src$core$utils$useragent || IPAD$$module$build$src$core$utils$useragent ) ? this . showPromptEditor _ ( ) : this . showInlineEditor _ ( a ) } showPromptEditor _ ( ) { prompt$$module$build$src$core$dialog ( Msg$$module$build$src$core$msg . CHANGE _VALUE _TITLE , this . getText ( ) , a => { null !== a && this . setValue ( this . getValueFromEditorText _ ( a ) ) } ) } showInlineEditor _ ( a ) { const b = this . getSourceBlock ( ) ; if ( ! b ) throw new UnattachedFieldError$$module$build$src$core$field ;
show$$module$build$src$core$widgetdiv ( this , b . RTL , this . widgetDispose _ . bind ( this ) ) ; this . htmlInput _ = this . widgetCreate _ ( ) ; this . isBeingEdited _ = ! 0 ; a || ( this . htmlInput _ . focus ( { preventScroll : ! 0 } ) , this . htmlInput _ . select ( ) ) } widgetCreate _ ( ) { var a = this . getSourceBlock ( ) ; if ( ! a ) throw new UnattachedFieldError$$module$build$src$core$field ; setGroup$$module$build$src$core$events$utils ( ! 0 ) ; const b = getDiv$$module$build$src$core$widgetdiv ( ) ; var c = this . getClickTarget _ ( ) ; if ( ! c ) throw Error ( "A click target has not been set." ) ;
addClass$$module$build$src$core$utils$dom ( c , "editing" ) ; c = document . createElement ( "input" ) ; c . className = "blocklyHtmlInput" ; c . setAttribute ( "spellcheck" , this . spellcheck _ ) ; const d = this . workspace _ . getScale ( ) ; var e = this . getConstants ( ) . FIELD _TEXT _FONTSIZE * d + "pt" ; b . style . fontSize = e ; c . style . fontSize = e ; e = $ . FieldTextInput$$module$build$src$core$field _textinput . BORDERRADIUS * d + "px" ; this . fullBlockClickTarget _ && ( e = this . getScaledBBox ( ) , e = ( e . bottom - e . top ) / 2 + "px" , a = a . getParent ( ) ? a . getParent ( ) . style . colourTertiary : this . sourceBlock _ . style . colourTertiary ,
c . style . border = 1 * d + "px solid " + a , b . style . borderRadius = e , b . style . transition = "box-shadow 0.25s ease 0s" , this . getConstants ( ) . FIELD _TEXTINPUT _BOX _SHADOW && ( b . style . boxShadow = "rgba(255, 255, 255, 0.3) 0 0 0 " + 4 * d + "px" ) ) ; c . style . borderRadius = e ; b . appendChild ( c ) ; c . value = c . defaultValue = this . getEditorText _ ( this . value _ ) ; c . setAttribute ( "data-untyped-default-value" , this . value _ ) ; c . setAttribute ( "data-old-value" , "" ) ; this . resizeEditor _ ( ) ; this . bindInputEvents _ ( c ) ; return c } widgetDispose _ ( ) { this . isBeingEdited _ = ! 1 ; this . isTextValid _ =
! 0 ; this . forceRerender ( ) ; this . onFinishEditing _ ( this . value _ ) ; setGroup$$module$build$src$core$events$utils ( ! 1 ) ; this . unbindInputEvents _ ( ) ; var a = getDiv$$module$build$src$core$widgetdiv ( ) . style ; a . width = "auto" ; a . height = "auto" ; a . fontSize = "" ; a . transition = "" ; a . boxShadow = "" ; this . htmlInput _ = null ; a = this . getClickTarget _ ( ) ; if ( ! a ) throw Error ( "A click target has not been set." ) ; removeClass$$module$build$src$core$utils$dom ( a , "editing" ) } onFinishEditing _ ( a ) { } bindInputEvents _ ( a ) { this . onKeyDownWrapper _ = conditionalBind$$module$build$src$core$browser _events ( a ,
"keydown" , this , this . onHtmlInputKeyDown _ ) ; this . onKeyInputWrapper _ = conditionalBind$$module$build$src$core$browser _events ( a , "input" , this , this . onHtmlInputChange _ ) } unbindInputEvents _ ( ) { this . onKeyDownWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onKeyDownWrapper _ ) , this . onKeyDownWrapper _ = null ) ; this . onKeyInputWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onKeyInputWrapper _ ) , this . onKeyInputWrapper _ = null ) } onHtmlInputKeyDown _ ( a ) { a . keyCode === KeyCodes$$module$build$src$core$utils$keycodes . ENTER ?
( hide$$module$build$src$core$widgetdiv ( ) , hideWithoutAnimation$$module$build$src$core$dropdowndiv ( ) ) : a . keyCode === KeyCodes$$module$build$src$core$utils$keycodes . ESC ? ( this . setValue ( this . htmlInput _ . getAttribute ( "data-untyped-default-value" ) ) , hide$$module$build$src$core$widgetdiv ( ) , hideWithoutAnimation$$module$build$src$core$dropdowndiv ( ) ) : a . keyCode === KeyCodes$$module$build$src$core$utils$keycodes . TAB && ( hide$$module$build$src$core$widgetdiv ( ) , hideWithoutAnimation$$module$build$src$core$dropdowndiv ( ) , this . sourceBlock _ . tab ( this ,
! a . shiftKey ) , a . preventDefault ( ) ) } onHtmlInputChange _ ( a ) { a = this . htmlInput _ . value ; a !== this . htmlInput _ . getAttribute ( "data-old-value" ) && ( this . htmlInput _ . setAttribute ( "data-old-value" , a ) , a = this . getValueFromEditorText _ ( a ) , this . setValue ( a ) , this . forceRerender ( ) , this . resizeEditor _ ( ) ) } setEditorValue _ ( a ) { this . isDirty _ = ! 0 ; this . isBeingEdited _ && ( this . htmlInput _ . value = this . getEditorText _ ( a ) ) ; this . setValue ( a ) } resizeEditor _ ( ) { var a = this . getSourceBlock ( ) ; if ( ! a ) throw new UnattachedFieldError$$module$build$src$core$field ;
const b = getDiv$$module$build$src$core$widgetdiv ( ) , c = this . getScaledBBox ( ) ; b . style . width = c . right - c . left + "px" ; b . style . height = c . bottom - c . top + "px" ; a = new Coordinate$$module$build$src$core$utils$coordinate ( a . RTL ? c . right - b . offsetWidth : c . left , c . top ) ; b . style . left = a . x + "px" ; b . style . top = a . y + "px" } isTabNavigable ( ) { return ! 0 } getText _ ( ) { return this . isBeingEdited _ && this . htmlInput _ ? this . htmlInput _ . value : null } getEditorText _ ( a ) { return String ( a ) } getValueFromEditorText _ ( a ) { return a } static fromJson ( a ) { return new this ( replaceMessageReferences$$module$build$src$core$utils$parsing ( a . text ) ,
void 0 , a ) } } ; $ . FieldTextInput$$module$build$src$core$field _textinput . BORDERRADIUS = 4 ; register$$module$build$src$core$field _registry ( "field_input" , $ . FieldTextInput$$module$build$src$core$field _textinput ) ; $ . FieldTextInput$$module$build$src$core$field _textinput . prototype . DEFAULT _VALUE = "" ; var module$build$src$core$field _textinput = { } ; module$build$src$core$field _textinput . FieldTextInput = $ . FieldTextInput$$module$build$src$core$field _textinput ; var BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom _row = class extends BottomRow$$module$build$src$core$renderers$measurables$bottom _row { constructor ( a ) { super ( a ) } endsWithElemSpacer ( ) { return ! 1 } hasLeftSquareCorner ( a ) { return ! ! a . outputConnection } hasRightSquareCorner ( a ) { return ! ! a . outputConnection && ! a . statementInputCount && ! a . nextConnection } } , module$build$src$core$renderers$zelos$measurables$bottom _row = { } ; module$build$src$core$renderers$zelos$measurables$bottom _row . BottomRow = BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom _row ; var StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs = class extends StatementInput$$module$build$src$core$renderers$measurables$statement _input { constructor ( a , b ) { super ( a , b ) ; this . connectedBottomNextConnection = ! 1 ; if ( this . connectedBlock ) { for ( a = this . connectedBlock ; b = a . getNextBlock ( ) ; ) a = b ; a . nextConnection || ( this . height = this . connectedBlockHeight , this . connectedBottomNextConnection = ! 0 ) } } } , module$build$src$core$renderers$zelos$measurables$inputs = { } ;
module$build$src$core$renderers$zelos$measurables$inputs . StatementInput = StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs ; var RightConnectionShape$$module$build$src$core$renderers$zelos$measurables$row _elements = class extends Measurable$$module$build$src$core$renderers$measurables$base { constructor ( a ) { super ( a ) ; this . width = this . height = 0 ; this . type |= Types$$module$build$src$core$renderers$measurables$types . getType ( "RIGHT_CONNECTION" ) } } , module$build$src$core$renderers$zelos$measurables$row _elements = { } ; module$build$src$core$renderers$zelos$measurables$row _elements . RightConnectionShape = RightConnectionShape$$module$build$src$core$renderers$zelos$measurables$row _elements ; var TopRow$$module$build$src$core$renderers$zelos$measurables$top _row = class extends TopRow$$module$build$src$core$renderers$measurables$top _row { constructor ( a ) { super ( a ) } endsWithElemSpacer ( ) { return ! 1 } hasLeftSquareCorner ( a ) { const b = ( a . hat ? "cap" === a . hat : this . constants _ . ADD _START _HATS ) && ! a . outputConnection && ! a . previousConnection ; return ! ! a . outputConnection || b } hasRightSquareCorner ( a ) { return ! ! a . outputConnection && ! a . statementInputCount && ! a . nextConnection } } , module$build$src$core$renderers$zelos$measurables$top _row =
{ } ; module$build$src$core$renderers$zelos$measurables$top _row . TopRow = TopRow$$module$build$src$core$renderers$zelos$measurables$top _row ; var RenderInfo$$module$build$src$core$renderers$zelos$info = class extends RenderInfo$$module$build$src$core$renderers$common$info { constructor ( a , b ) { super ( a , b ) ; this . isInline = ! 0 ; this . renderer _ = a ; this . constants _ = this . renderer _ . getConstants ( ) ; this . topRow = new TopRow$$module$build$src$core$renderers$zelos$measurables$top _row ( this . constants _ ) ; this . bottomRow = new BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom _row ( this . constants _ ) ; this . isMultiRow = ! b . getInputsInline ( ) || b . isCollapsed ( ) ; this . hasStatementInput =
0 < b . statementInputCount ; this . rightSide = this . outputConnection ? new RightConnectionShape$$module$build$src$core$renderers$zelos$measurables$row _elements ( this . constants _ ) : null ; this . rightAlignedDummyInputs _ = new WeakMap } getRenderer ( ) { return this . renderer _ } measure ( ) { this . createRows _ ( ) ; this . addElemSpacing _ ( ) ; this . addRowSpacing _ ( ) ; this . adjustXPosition _ ( ) ; this . computeBounds _ ( ) ; this . alignRowElements _ ( ) ; this . finalize _ ( ) } shouldStartNewRow _ ( a , b ) { return b ? a . type === inputTypes$$module$build$src$core$input _types . STATEMENT ||
b . type === inputTypes$$module$build$src$core$input _types . STATEMENT ? ! 0 : a . type === inputTypes$$module$build$src$core$input _types . VALUE || a . type === inputTypes$$module$build$src$core$input _types . DUMMY ? ! this . isInline || this . isMultiRow : ! 1 : ! 1 } getDesiredRowWidth _ ( a ) { return a . hasStatement ? this . width - this . startX - ( this . constants _ . INSIDE _CORNERS . rightWidth || 0 ) : super . getDesiredRowWidth _ ( a ) } getInRowSpacing _ ( a , b ) { return a && b || ! this . outputConnection || ! this . outputConnection . isDynamicShape || this . hasStatementInput || this . bottomRow . hasNextConnection ?
! a && b && Types$$module$build$src$core$renderers$measurables$types . isStatementInput ( b ) ? this . constants _ . STATEMENT _INPUT _PADDING _LEFT : a && Types$$module$build$src$core$renderers$measurables$types . isLeftRoundedCorner ( a ) && b && ( Types$$module$build$src$core$renderers$measurables$types . isPreviousConnection ( b ) || Types$$module$build$src$core$renderers$measurables$types . isNextConnection ( b ) ) ? b . notchOffset - this . constants _ . CORNER _RADIUS : a && Types$$module$build$src$core$renderers$measurables$types . isLeftSquareCorner ( a ) &&
b && Types$$module$build$src$core$renderers$measurables$types . isHat ( b ) ? this . constants _ . NO _PADDING : this . constants _ . MEDIUM _PADDING : this . constants _ . NO _PADDING } getSpacerRowHeight _ ( a , b ) { if ( Types$$module$build$src$core$renderers$measurables$types . isTopRow ( a ) && Types$$module$build$src$core$renderers$measurables$types . isBottomRow ( b ) ) return this . constants _ . EMPTY _BLOCK _SPACER _HEIGHT ; const c = Types$$module$build$src$core$renderers$measurables$types . isInputRow ( a ) && a . hasStatement , d = Types$$module$build$src$core$renderers$measurables$types . isInputRow ( b ) &&
b . hasStatement ; return d || c ? ( a = Math . max ( this . constants _ . NOTCH _HEIGHT , this . constants _ . INSIDE _CORNERS . rightHeight || 0 ) , d && c ? Math . max ( a , this . constants _ . DUMMY _INPUT _MIN _HEIGHT ) : a ) : Types$$module$build$src$core$renderers$measurables$types . isTopRow ( a ) ? a . hasPreviousConnection || this . outputConnection && ! this . hasStatementInput ? this . constants _ . NO _PADDING : Math . abs ( this . constants _ . NOTCH _HEIGHT - this . constants _ . CORNER _RADIUS ) : Types$$module$build$src$core$renderers$measurables$types . isBottomRow ( b ) ? this . outputConnection ?
! b . hasNextConnection && this . hasStatementInput ? Math . abs ( this . constants _ . NOTCH _HEIGHT - this . constants _ . CORNER _RADIUS ) : this . constants _ . NO _PADDING : Math . max ( this . topRow . minHeight , Math . max ( this . constants _ . NOTCH _HEIGHT , this . constants _ . CORNER _RADIUS ) ) - this . constants _ . CORNER _RADIUS : this . constants _ . MEDIUM _PADDING } getSpacerRowWidth _ ( a , b ) { const c = this . width - this . startX ; return Types$$module$build$src$core$renderers$measurables$types . isInputRow ( a ) && a . hasStatement || Types$$module$build$src$core$renderers$measurables$types . isInputRow ( b ) &&
b . hasStatement ? Math . max ( c , this . constants _ . STATEMENT _INPUT _SPACER _MIN _WIDTH ) : c } getElemCenterline _ ( a , b ) { if ( a . hasStatement && ! Types$$module$build$src$core$renderers$measurables$types . isSpacer ( b ) && ! Types$$module$build$src$core$renderers$measurables$types . isStatementInput ( b ) ) return a . yPos + this . constants _ . EMPTY _STATEMENT _INPUT _HEIGHT / 2 ; if ( Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( b ) && b instanceof InputConnection$$module$build$src$core$renderers$measurables$input _connection ) { const c =
b . connectedBlock ; if ( c && c . outputConnection && c . nextConnection ) return a . yPos + c . height / 2 } return super . getElemCenterline _ ( a , b ) } addInput _ ( a , b ) { if ( a . type === inputTypes$$module$build$src$core$input _types . DUMMY && b . hasDummyInput && b . align === $ . Align$$module$build$src$core$input . LEFT && a . align === $ . Align$$module$build$src$core$input . RIGHT ) this . rightAlignedDummyInputs _ . set ( b , a ) ; else if ( a . type === inputTypes$$module$build$src$core$input _types . STATEMENT ) { b . elements . push ( new StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs ( this . constants _ ,
a ) ) ; b . hasStatement = ! 0 ; null === b . align && ( b . align = a . align ) ; return } super . addInput _ ( a , b ) } addAlignmentPadding _ ( a , b ) { if ( this . rightAlignedDummyInputs _ . get ( a ) ) { let c ; for ( let d = 0 ; d < a . elements . length ; d ++ ) { const e = a . elements [ d ] ; Types$$module$build$src$core$renderers$measurables$types . isSpacer ( e ) && ( c = e ) ; if ( Types$$module$build$src$core$renderers$measurables$types . isField ( e ) && e instanceof Field$$module$build$src$core$renderers$measurables$field && e . parentInput === this . rightAlignedDummyInputs _ . get ( a ) ) break } if ( c ) { c . width +=
b ; a . width += b ; return } } super . addAlignmentPadding _ ( a , b ) } adjustXPosition _ ( ) { const a = this . constants _ . NOTCH _OFFSET _LEFT + this . constants _ . NOTCH _WIDTH ; let b = a ; for ( let e = 2 ; e < this . rows . length - 1 ; e += 2 ) { var c = this . rows [ e - 1 ] ; const f = this . rows [ e ] ; var d = this . rows [ e + 1 ] ; c = 2 === e ? ! ! this . topRow . hasPreviousConnection : ! ! c . followsStatement ; d = e + 2 >= this . rows . length - 1 ? ! ! this . bottomRow . hasNextConnection : ! ! d . precedesStatement ; if ( Types$$module$build$src$core$renderers$measurables$types . isInputRow ( f ) && f . hasStatement ) { f . measure ( ) ;
let g , h ; b = f . width - ( null != ( h = null == ( g = f . getLastInput ( ) ) ? void 0 : g . width ) ? h : 0 ) + a } else if ( c && ( 2 === e || d ) && Types$$module$build$src$core$renderers$measurables$types . isInputRow ( f ) && ! f . hasStatement ) { d = f . xPos ; c = null ; for ( let g = 0 ; g < f . elements . length ; g ++ ) { const h = f . elements [ g ] ; Types$$module$build$src$core$renderers$measurables$types . isSpacer ( h ) && ( c = h ) ; c && ( Types$$module$build$src$core$renderers$measurables$types . isField ( h ) || Types$$module$build$src$core$renderers$measurables$types . isInput ( h ) ) && d < b && ! ( Types$$module$build$src$core$renderers$measurables$types . isField ( h ) &&
h instanceof Field$$module$build$src$core$renderers$measurables$field && ( h . field instanceof $ . FieldLabel$$module$build$src$core$field _label || h . field instanceof $ . FieldImage$$module$build$src$core$field _image ) ) && ( c . width += b - d ) ; d += h . width } } } } finalizeOutputConnection _ ( ) { if ( this . outputConnection && this . outputConnection . isDynamicShape ) { var a = this . outputConnection . shape ; if ( "isDynamic" in a && a . isDynamic ) { var b = 0 ; for ( var c = 0 ; c < this . rows . length ; c ++ ) { const d = this . rows [ c ] ; d . yPos = b ; b += d . height } this . height = b ; c = this . bottomRow . hasNextConnection ?
this . height - this . bottomRow . descenderHeight : this . height ; b = a . height ( c ) ; c = a . width ( c ) ; this . outputConnection . height = b ; this . outputConnection . width = c ; this . outputConnection . startX = c ; this . outputConnection . connectionOffsetY = a . connectionOffsetY ( b ) ; this . outputConnection . connectionOffsetX = a . connectionOffsetX ( c ) ; a = 0 ; this . hasStatementInput || this . bottomRow . hasNextConnection || ( a = c , this . rightSide . height = b , this . rightSide . width = a , this . rightSide . centerline = b / 2 , this . rightSide . xPos = this . width + a ) ; this . startX = c ; this . width +=
c + a ; this . widthWithChildren += c + a } } } finalizeHorizontalAlignment _ ( ) { if ( this . outputConnection && ! this . hasStatementInput && ! this . bottomRow . hasNextConnection ) { var a = 0 ; for ( var b = 0 ; b < this . rows . length ; b ++ ) { var c = this . rows [ b ] ; if ( ! Types$$module$build$src$core$renderers$measurables$types . isInputRow ( c ) ) continue ; a = c . elements [ c . elements . length - 2 ] ; let d = this . getNegativeSpacing _ ( c . elements [ 1 ] ) , e = this . getNegativeSpacing _ ( a ) ; a = d + e ; const f = this . constants _ . MIN _BLOCK _WIDTH + 2 * this . outputConnection . width ; this . width - a < f && ( a =
this . width - f , d = a / 2 , e = a / 2 ) ; c . elements . unshift ( new InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ( this . constants _ , - d ) ) ; c . elements . push ( new InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ( this . constants _ , - e ) ) } if ( a ) for ( this . width -= a , this . widthWithChildren -= a , this . rightSide . xPos -= a , b = 0 ; b < this . rows . length ; b ++ ) c = this . rows [ b ] , Types$$module$build$src$core$renderers$measurables$types . isTopOrBottomRow ( c ) && ( c . elements [ 1 ] . width -= a ) , c . width -= a , c . widthWithConnectedBlocks -=
a } } getNegativeSpacing _ ( a ) { if ( ! a || ! this . outputConnection ) return 0 ; const b = this . outputConnection . width ; var c = this . outputConnection . shape . type ; const d = this . constants _ ; if ( this . isMultiRow && 1 < this . inputRows . length ) switch ( c ) { case d . SHAPES . ROUND : return c = this . constants _ . MAX _DYNAMIC _CONNECTION _SHAPE _WIDTH , c = this . height / 2 > c ? c : this . height / 2 , b - c * ( 1 - Math . sin ( Math . acos ( ( c - this . constants _ . SMALL _PADDING ) / c ) ) ) ; default : return 0 } if ( Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( a ) && a instanceof
InputConnection$$module$build$src$core$renderers$measurables$input _connection ) { const e = a . connectedBlock ; a = e ? e . pathObject . outputShapeType : a . shape . type ; return null == a || e && e . outputConnection && ( e . statementInputCount || e . nextConnection ) || c === d . SHAPES . HEXAGONAL && c !== a ? 0 : b - this . constants _ . SHAPE _IN _SHAPE _PADDING [ c ] [ a ] } return Types$$module$build$src$core$renderers$measurables$types . isField ( a ) && a instanceof Field$$module$build$src$core$renderers$measurables$field ? c === d . SHAPES . ROUND && a . field instanceof $ . FieldTextInput$$module$build$src$core$field _textinput ?
b - 2.75 * d . GRID _UNIT : b - this . constants _ . SHAPE _IN _SHAPE _PADDING [ c ] [ 0 ] : Types$$module$build$src$core$renderers$measurables$types . isIcon ( a ) ? this . constants _ . SMALL _PADDING : 0 } finalizeVerticalAlignment _ ( ) { if ( ! this . outputConnection ) for ( let d = 2 ; d < this . rows . length - 1 ; d += 2 ) { const e = this . rows [ d - 1 ] , f = this . rows [ d ] , g = this . rows [ d + 1 ] ; var a = 2 === d , b = d + 2 >= this . rows . length - 1 ? ! ! this . bottomRow . hasNextConnection : ! ! g . precedesStatement ; if ( a ? this . topRow . hasPreviousConnection : e . followsStatement ) { var c = f . elements [ 1 ] ; c = 3 === f . elements . length &&
c instanceof Field$$module$build$src$core$renderers$measurables$field && ( c . field instanceof $ . FieldLabel$$module$build$src$core$field _label || c . field instanceof $ . FieldImage$$module$build$src$core$field _image ) ; if ( ! a && c ) e . height -= this . constants _ . SMALL _PADDING , g . height -= this . constants _ . SMALL _PADDING , f . height -= this . constants _ . MEDIUM _PADDING ; else if ( ! a && ! b ) e . height += this . constants _ . SMALL _PADDING ; else if ( b ) { a = ! 1 ; for ( b = 0 ; b < f . elements . length ; b ++ ) if ( c = f . elements [ b ] , c instanceof InputConnection$$module$build$src$core$renderers$measurables$input _connection &&
Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( c ) && c . connectedBlock && ! c . connectedBlock . isShadow ( ) && 40 <= c . connectedBlock . getHeightWidth ( ) . height ) { a = ! 0 ; break } a && ( e . height -= this . constants _ . SMALL _PADDING , g . height -= this . constants _ . SMALL _PADDING ) } } } } finalize _ ( ) { this . finalizeOutputConnection _ ( ) ; this . finalizeHorizontalAlignment _ ( ) ; this . finalizeVerticalAlignment _ ( ) ; super . finalize _ ( ) ; this . rightSide && ( this . widthWithChildren += this . rightSide . width ) } } , module$build$src$core$renderers$zelos$info =
{ } ; module$build$src$core$renderers$zelos$info . RenderInfo = RenderInfo$$module$build$src$core$renderers$zelos$info ; var MarkerSvg$$module$build$src$core$renderers$zelos$marker _svg = class extends MarkerSvg$$module$build$src$core$renderers$common$marker _svg { constructor ( a , b , c ) { super ( a , b , c ) ; this . markerCircle _ = null } showWithInputOutput _ ( a ) { const b = a . getSourceBlock ( ) ; a = a . getLocation ( ) . getOffsetInBlock ( ) ; this . positionCircle _ ( a . x , a . y ) ; this . setParent _ ( b ) ; this . showCurrent _ ( ) } showWithOutput _ ( a ) { this . showWithInputOutput _ ( a ) } showWithInput _ ( a ) { this . showWithInputOutput _ ( a ) } showWithBlock _ ( a ) { a = a . getLocation ( ) ; const b = a . getHeightWidth ( ) ;
this . positionRect _ ( 0 , 0 , b . width , b . height ) ; this . setParent _ ( a ) ; this . showCurrent _ ( ) } positionCircle _ ( a , b ) { let c ; null == ( c = this . markerCircle _ ) || c . setAttribute ( "cx" , a . toString ( ) ) ; let d ; null == ( d = this . markerCircle _ ) || d . setAttribute ( "cy" , b . toString ( ) ) ; this . currentMarkerSvg = this . markerCircle _ } hide ( ) { super . hide ( ) ; this . markerCircle _ && ( this . markerCircle _ . style . display = "none" ) } createDomInternal _ ( ) { super . createDomInternal _ ( ) ; this . markerCircle _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . CIRCLE ,
{ r : this . constants _ . CURSOR _RADIUS , style : "display: none" , "stroke-width" : this . constants _ . CURSOR _STROKE _WIDTH } , this . markerSvg _ ) ; if ( this . isCursor ( ) ) { const a = this . getBlinkProperties _ ( ) ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . ANIMATE , a , this . markerCircle _ ) } return this . markerSvg _ } applyColour _ ( a ) { super . applyColour _ ( a ) ; let b ; null == ( b = this . markerCircle _ ) || b . setAttribute ( "fill" , this . colour _ ) ; let c ; null == ( c = this . markerCircle _ ) || c . setAttribute ( "stroke" , this . colour _ ) ;
if ( this . isCursor ( ) ) { a = this . colour _ + ";transparent;transparent;" ; let d ; null == ( d = this . markerCircle _ ) || d . firstElementChild . setAttribute ( "values" , a ) } } } , module$build$src$core$renderers$zelos$marker _svg = { } ; module$build$src$core$renderers$zelos$marker _svg . MarkerSvg = MarkerSvg$$module$build$src$core$renderers$zelos$marker _svg ; var PathObject$$module$build$src$core$renderers$zelos$path _object = class extends PathObject$$module$build$src$core$renderers$common$path _object { constructor ( a , b , c ) { super ( a , b , c ) ; this . svgPathSelected _ = null ; this . outlines = new Map ; this . remainingOutlines = new Set ; this . outputShapeType = null ; this . constants = c } setPath ( a ) { super . setPath ( a ) ; this . svgPathSelected _ && this . svgPathSelected _ . setAttribute ( "d" , a ) } applyColour ( a ) { super . applyColour ( a ) ; const b = a . getParent ( ) ; if ( a . isShadow ( ) && b ) { if ( ! b . style . colourTertiary ) throw Error ( "The renderer did not properly initialize the block style" ) ;
this . svgPath . setAttribute ( "stroke" , b . style . colourTertiary ) } for ( const c of this . outlines . values ( ) ) { if ( ! this . style . colourTertiary ) throw Error ( "The renderer did not properly initialize the block style" ) ; c . setAttribute ( "fill" , this . style . colourTertiary ) } } flipRTL ( ) { super . flipRTL ( ) ; for ( const a of this . outlines . values ( ) ) a . setAttribute ( "transform" , "scale(-1 1)" ) } updateSelected ( a ) { this . setClass _ ( "blocklySelected" , a ) ; a ? this . svgPathSelected _ || ( this . svgPathSelected _ = this . svgPath . cloneNode ( ! 0 ) , this . svgPathSelected _ . setAttribute ( "fill" ,
"none" ) , this . svgPathSelected _ . setAttribute ( "filter" , "url(#" + this . constants . selectedGlowFilterId + ")" ) , this . svgRoot . appendChild ( this . svgPathSelected _ ) ) : this . svgPathSelected _ && ( this . svgRoot . removeChild ( this . svgPathSelected _ ) , this . svgPathSelected _ = null ) } updateReplacementFade ( a ) { this . setClass _ ( "blocklyReplaceable" , a ) ; a ? this . svgPath . setAttribute ( "filter" , "url(#" + this . constants . replacementGlowFilterId + ")" ) : this . svgPath . removeAttribute ( "filter" ) } updateShapeForInputHighlight ( a , b ) { a = a . getParentInput ( ) . name ;
( a = this . getOutlinePath _ ( a ) ) && ( b ? a . setAttribute ( "filter" , "url(#" + this . constants . replacementGlowFilterId + ")" ) : a . removeAttribute ( "filter" ) ) } beginDrawing ( ) { this . remainingOutlines . clear ( ) ; for ( const a of this . outlines . keys ( ) ) this . remainingOutlines . add ( a ) } endDrawing ( ) { if ( this . remainingOutlines . size ) for ( const a of this . remainingOutlines ) this . removeOutlinePath _ ( a ) ; this . remainingOutlines . clear ( ) } setOutlinePath ( a , b ) { a = this . getOutlinePath _ ( a ) ; a . setAttribute ( "d" , b ) ; if ( ! this . style . colourTertiary ) throw Error ( "The renderer did not properly initialize the block style" ) ;
a . setAttribute ( "fill" , this . style . colourTertiary ) } getOutlinePath _ ( a ) { this . outlines . has ( a ) || this . outlines . set ( a , createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . PATH , { "class" : "blocklyOutlinePath" , d : "" } , this . svgRoot ) ) ; this . remainingOutlines . delete ( a ) ; return this . outlines . get ( a ) } removeOutlinePath _ ( a ) { let b , c ; null == ( b = this . outlines . get ( a ) ) || null == ( c = b . parentNode ) || c . removeChild ( this . outlines . get ( a ) ) ; this . outlines . delete ( a ) } } , module$build$src$core$renderers$zelos$path _object =
{ } ; module$build$src$core$renderers$zelos$path _object . PathObject = PathObject$$module$build$src$core$renderers$zelos$path _object ; var Renderer$$module$build$src$core$renderers$zelos$renderer = class extends Renderer$$module$build$src$core$renderers$common$renderer { constructor ( a ) { super ( a ) } makeConstants _ ( ) { return new ConstantProvider$$module$build$src$core$renderers$zelos$constants } makeRenderInfo _ ( a ) { return new RenderInfo$$module$build$src$core$renderers$zelos$info ( this , a ) } makeDrawer _ ( a , b ) { return new Drawer$$module$build$src$core$renderers$zelos$drawer ( a , b ) } makeMarkerDrawer ( a , b ) { return new MarkerSvg$$module$build$src$core$renderers$zelos$marker _svg ( a ,
this . getConstants ( ) , b ) } makePathObject ( a , b ) { return new PathObject$$module$build$src$core$renderers$zelos$path _object ( a , b , this . getConstants ( ) ) } getConstants ( ) { return this . constants _ } shouldHighlightConnection ( a ) { return a . type !== ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE && a . type !== ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE } getConnectionPreviewMethod ( a , b , c ) { return b . type === ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE ? a . isConnected ( ) ? InsertionMarkerManager$$module$build$src$core$insertion _marker _manager . PREVIEW _TYPE . REPLACEMENT _FADE :
InsertionMarkerManager$$module$build$src$core$insertion _marker _manager . PREVIEW _TYPE . INPUT _OUTLINE : super . getConnectionPreviewMethod ( a , b , c ) } } ; register$$module$build$src$core$renderers$common$block _rendering ( "zelos" , Renderer$$module$build$src$core$renderers$zelos$renderer ) ; var module$build$src$core$renderers$zelos$renderer = { } ; module$build$src$core$renderers$zelos$renderer . Renderer = Renderer$$module$build$src$core$renderers$zelos$renderer ; var module$build$src$core$renderers$zelos$zelos = { } ; module$build$src$core$renderers$zelos$zelos . BottomRow = BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom _row ; module$build$src$core$renderers$zelos$zelos . ConstantProvider = ConstantProvider$$module$build$src$core$renderers$zelos$constants ; module$build$src$core$renderers$zelos$zelos . Drawer = Drawer$$module$build$src$core$renderers$zelos$drawer ; module$build$src$core$renderers$zelos$zelos . MarkerSvg = MarkerSvg$$module$build$src$core$renderers$zelos$marker _svg ;
module$build$src$core$renderers$zelos$zelos . PathObject = PathObject$$module$build$src$core$renderers$zelos$path _object ; module$build$src$core$renderers$zelos$zelos . RenderInfo = RenderInfo$$module$build$src$core$renderers$zelos$info ; module$build$src$core$renderers$zelos$zelos . Renderer = Renderer$$module$build$src$core$renderers$zelos$renderer ; module$build$src$core$renderers$zelos$zelos . RightConnectionShape = RightConnectionShape$$module$build$src$core$renderers$zelos$measurables$row _elements ;
module$build$src$core$renderers$zelos$zelos . StatementInput = StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs ; module$build$src$core$renderers$zelos$zelos . TopRow = TopRow$$module$build$src$core$renderers$zelos$measurables$top _row ; var RenderInfo$$module$build$src$core$renderers$thrasos$info = class extends RenderInfo$$module$build$src$core$renderers$common$info { constructor ( a , b ) { super ( a , b ) } getRenderer ( ) { return this . renderer _ } addElemSpacing _ ( ) { let a = ! 1 ; for ( var b = 0 ; b < this . rows . length ; b ++ ) if ( this . rows [ b ] . hasExternalInput ) { a = ! 0 ; break } for ( b = 0 ; b < this . rows . length ; b ++ ) { const d = this . rows [ b ] ; var c = d . elements ; d . elements = [ ] ; d . startsWithElemSpacer ( ) && d . elements . push ( new InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ( this . constants _ ,
this . getInRowSpacing _ ( null , c [ 0 ] ) ) ) ; if ( c . length ) { for ( let e = 0 ; e < c . length - 1 ; e ++ ) { d . elements . push ( c [ e ] ) ; const f = this . getInRowSpacing _ ( c [ e ] , c [ e + 1 ] ) ; d . elements . push ( new InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ( this . constants _ , f ) ) } d . elements . push ( c [ c . length - 1 ] ) ; d . endsWithElemSpacer ( ) && ( c = this . getInRowSpacing _ ( c [ c . length - 1 ] , null ) , a && d . hasDummyInput && ( c += this . constants _ . TAB _WIDTH ) , d . elements . push ( new InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ( this . constants _ ,
c ) ) ) } } } getInRowSpacing _ ( a , b ) { if ( ! a ) return b && Types$$module$build$src$core$renderers$measurables$types . isField ( b ) && b . isEditable ? this . constants _ . MEDIUM _PADDING : b && Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( b ) ? this . constants _ . MEDIUM _LARGE _PADDING : b && Types$$module$build$src$core$renderers$measurables$types . isStatementInput ( b ) ? this . constants _ . STATEMENT _INPUT _PADDING _LEFT : this . constants _ . LARGE _PADDING ; if ( ! Types$$module$build$src$core$renderers$measurables$types . isInput ( a ) && ! b ) return Types$$module$build$src$core$renderers$measurables$types . isField ( a ) &&
a . isEditable ? this . constants _ . MEDIUM _PADDING : Types$$module$build$src$core$renderers$measurables$types . isIcon ( a ) ? 2 * this . constants _ . LARGE _PADDING + 1 : Types$$module$build$src$core$renderers$measurables$types . isHat ( a ) ? this . constants _ . NO _PADDING : Types$$module$build$src$core$renderers$measurables$types . isPreviousOrNextConnection ( a ) ? this . constants _ . LARGE _PADDING : Types$$module$build$src$core$renderers$measurables$types . isLeftRoundedCorner ( a ) ? this . constants _ . MIN _BLOCK _WIDTH : Types$$module$build$src$core$renderers$measurables$types . isJaggedEdge ( a ) ?
this . constants _ . NO _PADDING : this . constants _ . LARGE _PADDING ; if ( Types$$module$build$src$core$renderers$measurables$types . isInput ( a ) && ! b ) { if ( Types$$module$build$src$core$renderers$measurables$types . isExternalInput ( a ) ) return this . constants _ . NO _PADDING ; if ( Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( a ) ) return this . constants _ . LARGE _PADDING ; if ( Types$$module$build$src$core$renderers$measurables$types . isStatementInput ( a ) ) return this . constants _ . NO _PADDING } if ( ! Types$$module$build$src$core$renderers$measurables$types . isInput ( a ) &&
b && Types$$module$build$src$core$renderers$measurables$types . isInput ( b ) ) { if ( Types$$module$build$src$core$renderers$measurables$types . isField ( a ) && a . isEditable ) { if ( Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( b ) || Types$$module$build$src$core$renderers$measurables$types . isExternalInput ( b ) ) return this . constants _ . SMALL _PADDING } else { if ( Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( b ) || Types$$module$build$src$core$renderers$measurables$types . isExternalInput ( b ) ) return this . constants _ . MEDIUM _LARGE _PADDING ;
if ( Types$$module$build$src$core$renderers$measurables$types . isStatementInput ( b ) ) return this . constants _ . LARGE _PADDING } return this . constants _ . LARGE _PADDING - 1 } if ( Types$$module$build$src$core$renderers$measurables$types . isIcon ( a ) && b && ! Types$$module$build$src$core$renderers$measurables$types . isInput ( b ) ) return this . constants _ . LARGE _PADDING ; if ( Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( a ) && b && Types$$module$build$src$core$renderers$measurables$types . isField ( b ) ) return b . isEditable ?
this . constants _ . MEDIUM _PADDING : this . constants _ . LARGE _PADDING ; if ( Types$$module$build$src$core$renderers$measurables$types . isLeftSquareCorner ( a ) && b ) { if ( Types$$module$build$src$core$renderers$measurables$types . isHat ( b ) ) return this . constants _ . NO _PADDING ; if ( Types$$module$build$src$core$renderers$measurables$types . isPreviousConnection ( b ) || Types$$module$build$src$core$renderers$measurables$types . isNextConnection ( b ) ) return b . notchOffset } return Types$$module$build$src$core$renderers$measurables$types . isLeftRoundedCorner ( a ) &&
b ? b . notchOffset - this . constants _ . CORNER _RADIUS : Types$$module$build$src$core$renderers$measurables$types . isField ( a ) && b && Types$$module$build$src$core$renderers$measurables$types . isField ( b ) && a . isEditable === b . isEditable || b && Types$$module$build$src$core$renderers$measurables$types . isJaggedEdge ( b ) ? this . constants _ . LARGE _PADDING : this . constants _ . MEDIUM _PADDING } getSpacerRowHeight _ ( a , b ) { return Types$$module$build$src$core$renderers$measurables$types . isTopRow ( a ) && Types$$module$build$src$core$renderers$measurables$types . isBottomRow ( b ) ?
this . constants _ . EMPTY _BLOCK _SPACER _HEIGHT : Types$$module$build$src$core$renderers$measurables$types . isTopRow ( a ) || Types$$module$build$src$core$renderers$measurables$types . isBottomRow ( b ) ? this . constants _ . NO _PADDING : a . hasExternalInput && b . hasExternalInput ? this . constants _ . LARGE _PADDING : ! a . hasStatement && b . hasStatement ? this . constants _ . BETWEEN _STATEMENT _PADDING _Y : a . hasStatement && b . hasStatement || a . hasDummyInput || b . hasDummyInput ? this . constants _ . LARGE _PADDING : this . constants _ . MEDIUM _PADDING } getElemCenterline _ ( a ,
b ) { if ( Types$$module$build$src$core$renderers$measurables$types . isSpacer ( b ) ) return a . yPos + b . height / 2 ; if ( Types$$module$build$src$core$renderers$measurables$types . isBottomRow ( a ) ) return a = a . yPos + a . height - a . descenderHeight , Types$$module$build$src$core$renderers$measurables$types . isNextConnection ( b ) ? a + b . height / 2 : a - b . height / 2 ; if ( Types$$module$build$src$core$renderers$measurables$types . isTopRow ( a ) ) return Types$$module$build$src$core$renderers$measurables$types . isHat ( b ) ? a . capline - b . height / 2 : a . capline + b . height /
2 ; let c = a . yPos ; return c = Types$$module$build$src$core$renderers$measurables$types . isField ( b ) && a . hasStatement ? c + ( this . constants _ . TALL _INPUT _FIELD _OFFSET _Y + b . height / 2 ) : c + a . height / 2 } finalize _ ( ) { let a = 0 , b = 0 ; for ( var c = 0 ; c < this . rows . length ; c ++ ) { const e = this . rows [ c ] ; e . yPos = b ; e . xPos = this . startX ; b += e . height ; a = Math . max ( a , e . widthWithConnectedBlocks ) ; var d = b - this . topRow . ascenderHeight ; e === this . bottomRow && d < this . constants _ . MIN _BLOCK _HEIGHT && ( d = this . constants _ . MIN _BLOCK _HEIGHT - d , this . bottomRow . height += d , b += d ) ; this . recordElemPositions _ ( e ) } this . outputConnection &&
this . block _ . nextConnection && this . block _ . nextConnection . isConnected ( ) && ( c = this . block _ . nextConnection . targetBlock ( ) ) && ( a = Math . max ( a , c . getHeightWidth ( ) . width ) ) ; this . bottomRow . baseline = b - this . bottomRow . descenderHeight ; this . widthWithChildren = a + this . startX ; this . height = b ; this . startY = this . topRow . capline } } , module$build$src$core$renderers$thrasos$info = { } ; module$build$src$core$renderers$thrasos$info . RenderInfo = RenderInfo$$module$build$src$core$renderers$thrasos$info ; var Renderer$$module$build$src$core$renderers$thrasos$renderer = class extends Renderer$$module$build$src$core$renderers$common$renderer { constructor ( a ) { super ( a ) } makeRenderInfo _ ( a ) { return new RenderInfo$$module$build$src$core$renderers$thrasos$info ( this , a ) } } ; register$$module$build$src$core$renderers$common$block _rendering ( "thrasos" , Renderer$$module$build$src$core$renderers$thrasos$renderer ) ; var module$build$src$core$renderers$thrasos$renderer = { } ;
module$build$src$core$renderers$thrasos$renderer . Renderer = Renderer$$module$build$src$core$renderers$thrasos$renderer ; var module$build$src$core$renderers$thrasos$thrasos = { } ; module$build$src$core$renderers$thrasos$thrasos . RenderInfo = RenderInfo$$module$build$src$core$renderers$thrasos$info ; module$build$src$core$renderers$thrasos$thrasos . Renderer = Renderer$$module$build$src$core$renderers$thrasos$renderer ; var ConstantProvider$$module$build$src$core$renderers$minimalist$constants = class extends ConstantProvider$$module$build$src$core$renderers$common$constants { constructor ( ) { super ( ) } } , module$build$src$core$renderers$minimalist$constants = { } ; module$build$src$core$renderers$minimalist$constants . ConstantProvider = ConstantProvider$$module$build$src$core$renderers$minimalist$constants ; var Drawer$$module$build$src$core$renderers$minimalist$drawer = class extends Drawer$$module$build$src$core$renderers$common$drawer { constructor ( a , b ) { super ( a , b ) } } , module$build$src$core$renderers$minimalist$drawer = { } ; module$build$src$core$renderers$minimalist$drawer . Drawer = Drawer$$module$build$src$core$renderers$minimalist$drawer ; var RenderInfo$$module$build$src$core$renderers$minimalist$info = class extends RenderInfo$$module$build$src$core$renderers$common$info { constructor ( a , b ) { super ( a , b ) } getRenderer ( ) { return this . renderer _ } } , module$build$src$core$renderers$minimalist$info = { } ; module$build$src$core$renderers$minimalist$info . RenderInfo = RenderInfo$$module$build$src$core$renderers$minimalist$info ; var Renderer$$module$build$src$core$renderers$minimalist$renderer = class extends Renderer$$module$build$src$core$renderers$common$renderer { constructor ( a ) { super ( a ) } makeConstants _ ( ) { return new ConstantProvider$$module$build$src$core$renderers$minimalist$constants } makeRenderInfo _ ( a ) { return new RenderInfo$$module$build$src$core$renderers$minimalist$info ( this , a ) } makeDrawer _ ( a , b ) { return new Drawer$$module$build$src$core$renderers$minimalist$drawer ( a , b ) } } ;
register$$module$build$src$core$renderers$common$block _rendering ( "minimalist" , Renderer$$module$build$src$core$renderers$minimalist$renderer ) ; var module$build$src$core$renderers$minimalist$renderer = { } ; module$build$src$core$renderers$minimalist$renderer . Renderer = Renderer$$module$build$src$core$renderers$minimalist$renderer ; var module$build$src$core$renderers$minimalist$minimalist = { } ; module$build$src$core$renderers$minimalist$minimalist . ConstantProvider = ConstantProvider$$module$build$src$core$renderers$minimalist$constants ; module$build$src$core$renderers$minimalist$minimalist . Drawer = Drawer$$module$build$src$core$renderers$minimalist$drawer ; module$build$src$core$renderers$minimalist$minimalist . RenderInfo = RenderInfo$$module$build$src$core$renderers$minimalist$info ;
module$build$src$core$renderers$minimalist$minimalist . Renderer = Renderer$$module$build$src$core$renderers$minimalist$renderer ; var ConstantProvider$$module$build$src$core$renderers$geras$constants = class extends ConstantProvider$$module$build$src$core$renderers$common$constants { constructor ( ) { super ( ) ; this . FIELD _TEXT _BASELINE _CENTER = ! 1 ; this . DARK _PATH _OFFSET = 1 ; this . MAX _BOTTOM _WIDTH = 30 ; this . STATEMENT _BOTTOM _SPACER = - this . NOTCH _HEIGHT / 2 } getCSS _ ( a ) { return super . getCSS _ ( a ) . concat ( [ ` ${ a } .blocklyInsertionMarker>.blocklyPathLight, ` , ` ${ a } .blocklyInsertionMarker>.blocklyPathDark { ` , ` fill-opacity: ${ this . INSERTION _MARKER _OPACITY } ; ` , "stroke: none;" ,
"}" ] ) } } , module$build$src$core$renderers$geras$constants = { } ; module$build$src$core$renderers$geras$constants . ConstantProvider = ConstantProvider$$module$build$src$core$renderers$geras$constants ; var Highlighter$$module$build$src$core$renderers$geras$highlighter = class { constructor ( a ) { this . inlineSteps _ = this . steps _ = "" ; this . info _ = a ; this . RTL _ = this . info _ . RTL ; a = a . getRenderer ( ) ; this . constants _ = a . getConstants ( ) ; this . highlightConstants _ = a . getHighlightConstants ( ) ; this . highlightOffset _ = this . highlightConstants _ . OFFSET ; this . outsideCornerPaths _ = this . highlightConstants _ . OUTSIDE _CORNER ; this . insideCornerPaths _ = this . highlightConstants _ . INSIDE _CORNER ; this . puzzleTabPaths _ = this . highlightConstants _ . PUZZLE _TAB ; this . notchPaths _ =
this . highlightConstants _ . NOTCH ; this . startPaths _ = this . highlightConstants _ . START _HAT ; this . jaggedTeethPaths _ = this . highlightConstants _ . JAGGED _TEETH } getPath ( ) { return this . steps _ + "\n" + this . inlineSteps _ } drawTopCorner ( a ) { this . steps _ += moveBy$$module$build$src$core$utils$svg _paths ( a . xPos , this . info _ . startY ) ; for ( let b = 0 , c ; c = a . elements [ b ] ; b ++ ) Types$$module$build$src$core$renderers$measurables$types . isLeftSquareCorner ( c ) ? this . steps _ += this . highlightConstants _ . START _POINT : Types$$module$build$src$core$renderers$measurables$types . isLeftRoundedCorner ( c ) ?
this . steps _ += this . outsideCornerPaths _ . topLeft ( this . RTL _ ) : Types$$module$build$src$core$renderers$measurables$types . isPreviousConnection ( c ) ? this . steps _ += this . notchPaths _ . pathLeft : Types$$module$build$src$core$renderers$measurables$types . isHat ( c ) ? this . steps _ += this . startPaths _ . path ( this . RTL _ ) : Types$$module$build$src$core$renderers$measurables$types . isSpacer ( c ) && 0 !== c . width && ( this . steps _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "H" , c . xPos + c . width - this . highlightOffset _ ) ) ; this . steps _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "H" ,
a . xPos + a . width - this . highlightOffset _ ) } drawJaggedEdge _ ( a ) { this . info _ . RTL && ( this . steps _ += this . jaggedTeethPaths _ . pathLeft + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , a . height - this . jaggedTeethPaths _ . height - this . highlightOffset _ ) ) } drawValueInput ( a ) { const b = a . getLastInput ( ) ; if ( this . RTL _ ) { const c = a . height - b . connectionHeight ; this . steps _ += moveTo$$module$build$src$core$utils$svg _paths ( b . xPos + b . width - this . highlightOffset _ , a . yPos ) + this . puzzleTabPaths _ . pathDown ( this . RTL _ ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" ,
c ) } else this . steps _ += moveTo$$module$build$src$core$utils$svg _paths ( b . xPos + b . width , a . yPos ) + this . puzzleTabPaths _ . pathDown ( this . RTL _ ) } drawStatementInput ( a ) { const b = a . getLastInput ( ) ; if ( b ) if ( this . RTL _ ) { const c = a . height - 2 * this . insideCornerPaths _ . height ; this . steps _ += moveTo$$module$build$src$core$utils$svg _paths ( b . xPos , a . yPos ) + this . insideCornerPaths _ . pathTop ( this . RTL _ ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , c ) + this . insideCornerPaths _ . pathBottom ( this . RTL _ ) + lineTo$$module$build$src$core$utils$svg _paths ( a . width -
b . xPos - this . insideCornerPaths _ . width , 0 ) } else this . steps _ += moveTo$$module$build$src$core$utils$svg _paths ( b . xPos , a . yPos + a . height ) + this . insideCornerPaths _ . pathBottom ( this . RTL _ ) + lineTo$$module$build$src$core$utils$svg _paths ( a . width - b . xPos - this . insideCornerPaths _ . width , 0 ) } drawRightSideRow ( a ) { const b = a . xPos + a . width - this . highlightOffset _ ; a instanceof SpacerRow$$module$build$src$core$renderers$measurables$spacer _row && a . followsStatement && ( this . steps _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "H" ,
b ) ) ; this . RTL _ && ( this . steps _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "H" , b ) , a . height > this . highlightOffset _ && ( this . steps _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "V" , a . yPos + a . height - this . highlightOffset _ ) ) ) } drawBottomRow ( a ) { if ( this . RTL _ ) this . steps _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "V" , a . baseline - this . highlightOffset _ ) ; else { const b = this . info _ . bottomRow . elements [ 0 ] ; Types$$module$build$src$core$renderers$measurables$types . isLeftSquareCorner ( b ) ? this . steps _ += moveTo$$module$build$src$core$utils$svg _paths ( a . xPos +
this . highlightOffset _ , a . baseline - this . highlightOffset _ ) : Types$$module$build$src$core$renderers$measurables$types . isLeftRoundedCorner ( b ) && ( this . steps _ += moveTo$$module$build$src$core$utils$svg _paths ( a . xPos , a . baseline ) , this . steps _ += this . outsideCornerPaths _ . bottomLeft ( ) ) } } drawLeft ( ) { var a = this . info _ . outputConnection ; a && ( a = a . connectionOffsetY + a . height , this . RTL _ ? this . steps _ += moveTo$$module$build$src$core$utils$svg _paths ( this . info _ . startX , a ) : ( this . steps _ += moveTo$$module$build$src$core$utils$svg _paths ( this . info _ . startX +
this . highlightOffset _ , this . info _ . bottomRow . baseline - this . highlightOffset _ ) , this . steps _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "V" , a ) ) , this . steps _ += this . puzzleTabPaths _ . pathUp ( this . RTL _ ) ) ; this . RTL _ || ( a = this . info _ . topRow , Types$$module$build$src$core$renderers$measurables$types . isLeftRoundedCorner ( a . elements [ 0 ] ) ? this . steps _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "V" , this . outsideCornerPaths _ . height ) : this . steps _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "V" , a . capline + this . highlightOffset _ ) ) } drawInlineInput ( a ) { const b =
this . highlightOffset _ , c = a . xPos + a . connectionWidth ; var d = a . centerline - a . height / 2 ; const e = a . width - a . connectionWidth , f = d + b ; this . RTL _ ? ( d = a . connectionOffsetY - b , a = a . height - ( a . connectionOffsetY + a . connectionHeight ) + b , this . inlineSteps _ += moveTo$$module$build$src$core$utils$svg _paths ( c - b , f ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , d ) + this . puzzleTabPaths _ . pathDown ( this . RTL _ ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , a ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , e ) ) : this . inlineSteps _ +=
moveTo$$module$build$src$core$utils$svg _paths ( a . xPos + a . width + b , f ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , a . height ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , - e ) + moveTo$$module$build$src$core$utils$svg _paths ( c , d + a . connectionOffsetY ) + this . puzzleTabPaths _ . pathDown ( this . RTL _ ) } } , module$build$src$core$renderers$geras$highlighter = { } ; module$build$src$core$renderers$geras$highlighter . Highlighter = Highlighter$$module$build$src$core$renderers$geras$highlighter ; var Drawer$$module$build$src$core$renderers$geras$drawer = class extends Drawer$$module$build$src$core$renderers$common$drawer { constructor ( a , b ) { super ( a , b ) ; this . highlighter _ = new Highlighter$$module$build$src$core$renderers$geras$highlighter ( b ) } draw ( ) { this . hideHiddenIcons _ ( ) ; this . drawOutline _ ( ) ; this . drawInternals _ ( ) ; const a = this . block _ . pathObject ; a . setPath ( this . outlinePath _ + "\n" + this . inlinePath _ ) ; a . setHighlightPath ( this . highlighter _ . getPath ( ) ) ; this . info _ . RTL && a . flipRTL ( ) ; if ( isDebuggerEnabled$$module$build$src$core$renderers$common$debug ( ) ) { let b ,
c ; null == ( b = this . block _ ) || null == ( c = b . renderingDebugger ) || c . drawDebug ( this . block _ , this . info _ ) } this . recordSizeOnBlock _ ( ) } drawTop _ ( ) { this . highlighter _ . drawTopCorner ( this . info _ . topRow ) ; this . highlighter _ . drawRightSideRow ( this . info _ . topRow ) ; super . drawTop _ ( ) } drawJaggedEdge _ ( a ) { this . highlighter _ . drawJaggedEdge _ ( a ) ; super . drawJaggedEdge _ ( a ) } drawValueInput _ ( a ) { this . highlighter _ . drawValueInput ( a ) ; super . drawValueInput _ ( a ) } drawStatementInput _ ( a ) { this . highlighter _ . drawStatementInput ( a ) ; super . drawStatementInput _ ( a ) } drawRightSideRow _ ( a ) { this . highlighter _ . drawRightSideRow ( a ) ;
this . outlinePath _ += lineOnAxis$$module$build$src$core$utils$svg _paths ( "H" , a . xPos + a . width ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "V" , a . yPos + a . height ) } drawBottom _ ( ) { this . highlighter _ . drawBottomRow ( this . info _ . bottomRow ) ; super . drawBottom _ ( ) } drawLeft _ ( ) { this . highlighter _ . drawLeft ( ) ; super . drawLeft _ ( ) } drawInlineInput _ ( a ) { this . highlighter _ . drawInlineInput ( a ) ; super . drawInlineInput _ ( a ) } positionInlineInputConnection _ ( a ) { const b = a . centerline - a . height / 2 ; if ( a . connectionModel ) { let c = a . xPos + a . connectionWidth +
this . constants _ . DARK _PATH _OFFSET ; this . info _ . RTL && ( c *= - 1 ) ; a . connectionModel . setOffsetInBlock ( c , b + a . connectionOffsetY + this . constants _ . DARK _PATH _OFFSET ) } } positionStatementInputConnection _ ( a ) { const b = a . getLastInput ( ) ; if ( null == b ? 0 : b . connectionModel ) { let c = a . xPos + a . statementEdge + b . notchOffset ; c = this . info _ . RTL ? - 1 * c : c + this . constants _ . DARK _PATH _OFFSET ; b . connectionModel . setOffsetInBlock ( c , a . yPos + this . constants _ . DARK _PATH _OFFSET ) } } positionExternalValueConnection _ ( a ) { const b = a . getLastInput ( ) ; if ( b && b . connectionModel ) { let c =
a . xPos + a . width + this . constants _ . DARK _PATH _OFFSET ; this . info _ . RTL && ( c *= - 1 ) ; b . connectionModel . setOffsetInBlock ( c , a . yPos ) } } positionNextConnection _ ( ) { const a = this . info _ . bottomRow ; if ( a . connection ) { const b = a . connection , c = b . xPos ; b . connectionModel . setOffsetInBlock ( ( this . info _ . RTL ? - c : c ) + this . constants _ . DARK _PATH _OFFSET / 2 , a . baseline + this . constants _ . DARK _PATH _OFFSET ) } } } , module$build$src$core$renderers$geras$drawer = { } ; module$build$src$core$renderers$geras$drawer . Drawer = Drawer$$module$build$src$core$renderers$geras$drawer ; var HighlightConstantProvider$$module$build$src$core$renderers$geras$highlight _constants = class { constructor ( a ) { this . OFFSET = . 5 ; this . constantProvider = a ; this . START _POINT = moveBy$$module$build$src$core$utils$svg _paths ( this . OFFSET , this . OFFSET ) } init ( ) { this . INSIDE _CORNER = this . makeInsideCorner ( ) ; this . OUTSIDE _CORNER = this . makeOutsideCorner ( ) ; this . PUZZLE _TAB = this . makePuzzleTab ( ) ; this . NOTCH = this . makeNotch ( ) ; this . JAGGED _TEETH = this . makeJaggedTeeth ( ) ; this . START _HAT = this . makeStartHat ( ) } makeInsideCorner ( ) { const a = this . constantProvider . CORNER _RADIUS ,
b = this . OFFSET , c = ( 1 - Math . SQRT1 _2 ) * ( a + b ) - b , d = moveBy$$module$build$src$core$utils$svg _paths ( c , c ) + arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,0" , a , point$$module$build$src$core$utils$svg _paths ( - c - b , a - c ) ) , e = arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,0" , a + b , point$$module$build$src$core$utils$svg _paths ( a + b , a + b ) ) , f = moveBy$$module$build$src$core$utils$svg _paths ( c , - c ) + arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,0" , a + b , point$$module$build$src$core$utils$svg _paths ( a - c , c + b ) ) ; return { width : a +
b , height : a , pathTop ( g ) { return g ? d : "" } , pathBottom ( g ) { return g ? e : f } } } makeOutsideCorner ( ) { const a = this . constantProvider . CORNER _RADIUS , b = this . OFFSET , c = ( 1 - Math . SQRT1 _2 ) * ( a - b ) + b , d = moveBy$$module$build$src$core$utils$svg _paths ( c , c ) + arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,1" , a - b , point$$module$build$src$core$utils$svg _paths ( a - c , - c + b ) ) , e = moveBy$$module$build$src$core$utils$svg _paths ( b , a ) + arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,1" , a - b , point$$module$build$src$core$utils$svg _paths ( a , - a +
b ) ) , f = - c , g = moveBy$$module$build$src$core$utils$svg _paths ( c , f ) + arc$$module$build$src$core$utils$svg _paths ( "a" , "0 0,1" , a - b , point$$module$build$src$core$utils$svg _paths ( - c + b , - f - a ) ) ; return { height : a , topLeft ( h ) { return h ? d : e } , bottomLeft ( ) { return g } } } makePuzzleTab ( ) { const a = this . constantProvider . TAB _WIDTH , b = this . constantProvider . TAB _HEIGHT , c = moveBy$$module$build$src$core$utils$svg _paths ( - 2 , - b + 3.4 ) + lineTo$$module$build$src$core$utils$svg _paths ( - . 45 * a , - 2.1 ) , d = lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" ,
2.5 ) + moveBy$$module$build$src$core$utils$svg _paths ( . 97 * - a , 2.5 ) + curve$$module$build$src$core$utils$svg _paths ( "q" , [ point$$module$build$src$core$utils$svg _paths ( . 05 * - a , 10 ) , point$$module$build$src$core$utils$svg _paths ( . 3 * a , 9.5 ) ] ) + moveBy$$module$build$src$core$utils$svg _paths ( . 67 * a , - 1.9 ) + lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , 2.5 ) , e = lineOnAxis$$module$build$src$core$utils$svg _paths ( "v" , - 1.5 ) + moveBy$$module$build$src$core$utils$svg _paths ( - . 92 * a , - . 5 ) + curve$$module$build$src$core$utils$svg _paths ( "q" ,
[ point$$module$build$src$core$utils$svg _paths ( - . 19 * a , - 5.5 ) , point$$module$build$src$core$utils$svg _paths ( 0 , - 11 ) ] ) + moveBy$$module$build$src$core$utils$svg _paths ( . 92 * a , 1 ) , f = moveBy$$module$build$src$core$utils$svg _paths ( - 5 , b - . 7 ) + lineTo$$module$build$src$core$utils$svg _paths ( . 46 * a , - 2.1 ) ; return { width : a , height : b , pathUp ( g ) { return g ? c : e } , pathDown ( g ) { return g ? d : f } } } makeNotch ( ) { return { pathLeft : lineOnAxis$$module$build$src$core$utils$svg _paths ( "h" , this . OFFSET ) + this . constantProvider . NOTCH . pathLeft } } makeJaggedTeeth ( ) { return { pathLeft : lineTo$$module$build$src$core$utils$svg _paths ( 5.1 ,
2.6 ) + moveBy$$module$build$src$core$utils$svg _paths ( - 10.2 , 6.8 ) + lineTo$$module$build$src$core$utils$svg _paths ( 5.1 , 2.6 ) , height : 12 , width : 10.2 } } makeStartHat ( ) { const a = this . constantProvider . START _HAT . height , b = moveBy$$module$build$src$core$utils$svg _paths ( 25 , - 8.7 ) + curve$$module$build$src$core$utils$svg _paths ( "c" , [ point$$module$build$src$core$utils$svg _paths ( 29.7 , - 6.2 ) , point$$module$build$src$core$utils$svg _paths ( 57.2 , - . 5 ) , point$$module$build$src$core$utils$svg _paths ( 75 , 8.7 ) ] ) , c = curve$$module$build$src$core$utils$svg _paths ( "c" ,
[ point$$module$build$src$core$utils$svg _paths ( 17.8 , - 9.2 ) , point$$module$build$src$core$utils$svg _paths ( 45.3 , - 14.9 ) , point$$module$build$src$core$utils$svg _paths ( 75 , - 8.7 ) ] ) + moveTo$$module$build$src$core$utils$svg _paths ( 100.5 , a + . 5 ) ; return { path ( d ) { return d ? b : c } } } } , module$build$src$core$renderers$geras$highlight _constants = { } ; module$build$src$core$renderers$geras$highlight _constants . HighlightConstantProvider = HighlightConstantProvider$$module$build$src$core$renderers$geras$highlight _constants ; var InlineInput$$module$build$src$core$renderers$geras$measurables$inline _input = class extends InlineInput$$module$build$src$core$renderers$measurables$inline _input { constructor ( a , b ) { super ( a , b ) ; this . constants _ = a ; this . connectedBlock && ( this . width += this . constants _ . DARK _PATH _OFFSET , this . height += this . constants _ . DARK _PATH _OFFSET ) } } , module$build$src$core$renderers$geras$measurables$inline _input = { } ; module$build$src$core$renderers$geras$measurables$inline _input . InlineInput = InlineInput$$module$build$src$core$renderers$geras$measurables$inline _input ; var StatementInput$$module$build$src$core$renderers$geras$measurables$statement _input = class extends StatementInput$$module$build$src$core$renderers$measurables$statement _input { constructor ( a , b ) { super ( a , b ) ; this . constants _ = a ; this . connectedBlock && ( this . height += this . constants _ . DARK _PATH _OFFSET ) } } , module$build$src$core$renderers$geras$measurables$statement _input = { } ; module$build$src$core$renderers$geras$measurables$statement _input . StatementInput = StatementInput$$module$build$src$core$renderers$geras$measurables$statement _input ; var RenderInfo$$module$build$src$core$renderers$geras$info = class extends RenderInfo$$module$build$src$core$renderers$common$info { constructor ( a , b ) { super ( a , b ) ; this . renderer _ = a } getRenderer ( ) { return this . renderer _ } populateBottomRow _ ( ) { super . populateBottomRow _ ( ) ; this . block _ . inputList . length && this . block _ . inputList [ this . block _ . inputList . length - 1 ] . type === inputTypes$$module$build$src$core$input _types . STATEMENT || ( this . bottomRow . minHeight = this . constants _ . MEDIUM _PADDING - this . constants _ . DARK _PATH _OFFSET ) } addInput _ ( a ,
b ) { this . isInline && a . type === inputTypes$$module$build$src$core$input _types . VALUE ? ( b . elements . push ( new InlineInput$$module$build$src$core$renderers$geras$measurables$inline _input ( this . constants _ , a ) ) , b . hasInlineInput = ! 0 ) : a . type === inputTypes$$module$build$src$core$input _types . STATEMENT ? ( b . elements . push ( new StatementInput$$module$build$src$core$renderers$geras$measurables$statement _input ( this . constants _ , a ) ) , b . hasStatement = ! 0 ) : a . type === inputTypes$$module$build$src$core$input _types . VALUE ? ( b . elements . push ( new ExternalValueInput$$module$build$src$core$renderers$measurables$external _value _input ( this . constants _ ,
a ) ) , b . hasExternalInput = ! 0 ) : a . type === inputTypes$$module$build$src$core$input _types . DUMMY && ( b . minHeight = Math . max ( b . minHeight , this . constants _ . DUMMY _INPUT _MIN _HEIGHT ) , b . hasDummyInput = ! 0 ) ; this . isInline || null !== b . align || ( b . align = a . align ) } addElemSpacing _ ( ) { let a = ! 1 ; for ( let c = 0 , d ; d = this . rows [ c ] ; c ++ ) d . hasExternalInput && ( a = ! 0 ) ; for ( let c = 0 , d ; d = this . rows [ c ] ; c ++ ) { var b = d . elements ; d . elements = [ ] ; d . startsWithElemSpacer ( ) && d . elements . push ( new InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ( this . constants _ ,
this . getInRowSpacing _ ( null , b [ 0 ] ) ) ) ; if ( b . length ) { for ( let e = 0 ; e < b . length - 1 ; e ++ ) { d . elements . push ( b [ e ] ) ; const f = this . getInRowSpacing _ ( b [ e ] , b [ e + 1 ] ) ; d . elements . push ( new InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ( this . constants _ , f ) ) } d . elements . push ( b [ b . length - 1 ] ) ; d . endsWithElemSpacer ( ) && ( b = this . getInRowSpacing _ ( b [ b . length - 1 ] , null ) , a && d . hasDummyInput && ( b += this . constants _ . TAB _WIDTH ) , d . elements . push ( new InRowSpacer$$module$build$src$core$renderers$measurables$in _row _spacer ( this . constants _ ,
b ) ) ) } } } getInRowSpacing _ ( a , b ) { if ( ! a ) return b && Types$$module$build$src$core$renderers$measurables$types . isField ( b ) && b . isEditable ? this . constants _ . MEDIUM _PADDING : b && Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( b ) ? this . constants _ . MEDIUM _LARGE _PADDING : b && Types$$module$build$src$core$renderers$measurables$types . isStatementInput ( b ) ? this . constants _ . STATEMENT _INPUT _PADDING _LEFT : this . constants _ . LARGE _PADDING ; if ( ! Types$$module$build$src$core$renderers$measurables$types . isInput ( a ) && ( ! b ||
Types$$module$build$src$core$renderers$measurables$types . isStatementInput ( b ) ) ) return Types$$module$build$src$core$renderers$measurables$types . isField ( a ) && a . isEditable ? this . constants _ . MEDIUM _PADDING : Types$$module$build$src$core$renderers$measurables$types . isIcon ( a ) ? 2 * this . constants _ . LARGE _PADDING + 1 : Types$$module$build$src$core$renderers$measurables$types . isHat ( a ) ? this . constants _ . NO _PADDING : Types$$module$build$src$core$renderers$measurables$types . isPreviousOrNextConnection ( a ) ? this . constants _ . LARGE _PADDING :
Types$$module$build$src$core$renderers$measurables$types . isLeftRoundedCorner ( a ) ? this . constants _ . MIN _BLOCK _WIDTH : Types$$module$build$src$core$renderers$measurables$types . isJaggedEdge ( a ) ? this . constants _ . NO _PADDING : this . constants _ . LARGE _PADDING ; if ( Types$$module$build$src$core$renderers$measurables$types . isInput ( a ) && ! b ) { if ( Types$$module$build$src$core$renderers$measurables$types . isExternalInput ( a ) ) return this . constants _ . NO _PADDING ; if ( Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( a ) ) return this . constants _ . LARGE _PADDING ;
if ( Types$$module$build$src$core$renderers$measurables$types . isStatementInput ( a ) ) return this . constants _ . NO _PADDING } if ( ! Types$$module$build$src$core$renderers$measurables$types . isInput ( a ) && b && Types$$module$build$src$core$renderers$measurables$types . isInput ( b ) ) { if ( Types$$module$build$src$core$renderers$measurables$types . isField ( a ) && a . isEditable ) { if ( Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( b ) || Types$$module$build$src$core$renderers$measurables$types . isExternalInput ( b ) ) return this . constants _ . SMALL _PADDING } else { if ( Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( b ) ||
Types$$module$build$src$core$renderers$measurables$types . isExternalInput ( b ) ) return this . constants _ . MEDIUM _LARGE _PADDING ; if ( Types$$module$build$src$core$renderers$measurables$types . isStatementInput ( b ) ) return this . constants _ . LARGE _PADDING } return this . constants _ . LARGE _PADDING - 1 } if ( Types$$module$build$src$core$renderers$measurables$types . isIcon ( a ) && b && ! Types$$module$build$src$core$renderers$measurables$types . isInput ( b ) ) return this . constants _ . LARGE _PADDING ; if ( Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( a ) &&
b && Types$$module$build$src$core$renderers$measurables$types . isField ( b ) ) return b . isEditable ? this . constants _ . MEDIUM _PADDING : this . constants _ . LARGE _PADDING ; if ( Types$$module$build$src$core$renderers$measurables$types . isLeftSquareCorner ( a ) && b ) { if ( Types$$module$build$src$core$renderers$measurables$types . isHat ( b ) ) return this . constants _ . NO _PADDING ; if ( Types$$module$build$src$core$renderers$measurables$types . isPreviousConnection ( b ) ) return b . notchOffset ; if ( Types$$module$build$src$core$renderers$measurables$types . isNextConnection ( b ) ) return b . notchOffset +
( this . RTL ? 1 : - 1 ) * this . constants _ . DARK _PATH _OFFSET / 2 } if ( Types$$module$build$src$core$renderers$measurables$types . isLeftRoundedCorner ( a ) && b ) { if ( Types$$module$build$src$core$renderers$measurables$types . isPreviousConnection ( b ) ) return b . notchOffset - this . constants _ . CORNER _RADIUS ; if ( Types$$module$build$src$core$renderers$measurables$types . isNextConnection ( b ) ) return b . notchOffset - this . constants _ . CORNER _RADIUS + ( this . RTL ? 1 : - 1 ) * this . constants _ . DARK _PATH _OFFSET / 2 } return Types$$module$build$src$core$renderers$measurables$types . isField ( a ) &&
b && Types$$module$build$src$core$renderers$measurables$types . isField ( b ) && a . isEditable === b . isEditable || b && Types$$module$build$src$core$renderers$measurables$types . isJaggedEdge ( b ) ? this . constants _ . LARGE _PADDING : this . constants _ . MEDIUM _PADDING } getSpacerRowHeight _ ( a , b ) { return Types$$module$build$src$core$renderers$measurables$types . isTopRow ( a ) && Types$$module$build$src$core$renderers$measurables$types . isBottomRow ( b ) ? this . constants _ . EMPTY _BLOCK _SPACER _HEIGHT : Types$$module$build$src$core$renderers$measurables$types . isTopRow ( a ) ||
Types$$module$build$src$core$renderers$measurables$types . isBottomRow ( b ) ? this . constants _ . NO _PADDING : a . hasExternalInput && b . hasExternalInput ? this . constants _ . LARGE _PADDING : ! a . hasStatement && b . hasStatement ? this . constants _ . BETWEEN _STATEMENT _PADDING _Y : a . hasStatement && b . hasStatement || ! a . hasStatement && b . hasDummyInput || a . hasDummyInput ? this . constants _ . LARGE _PADDING : this . constants _ . MEDIUM _PADDING } getElemCenterline _ ( a , b ) { if ( Types$$module$build$src$core$renderers$measurables$types . isSpacer ( b ) ) return a . yPos + b . height /
2 ; if ( Types$$module$build$src$core$renderers$measurables$types . isBottomRow ( a ) ) return a = a . yPos + a . height - a . descenderHeight , Types$$module$build$src$core$renderers$measurables$types . isNextConnection ( b ) ? a + b . height / 2 : a - b . height / 2 ; if ( Types$$module$build$src$core$renderers$measurables$types . isTopRow ( a ) ) return Types$$module$build$src$core$renderers$measurables$types . isHat ( b ) ? a . capline - b . height / 2 : a . capline + b . height / 2 ; let c = a . yPos ; Types$$module$build$src$core$renderers$measurables$types . isField ( b ) || Types$$module$build$src$core$renderers$measurables$types . isIcon ( b ) ?
( c += b . height / 2 , ( a . hasInlineInput || a . hasStatement ) && b . height + this . constants _ . TALL _INPUT _FIELD _OFFSET _Y <= a . height && ( c += this . constants _ . TALL _INPUT _FIELD _OFFSET _Y ) ) : c = Types$$module$build$src$core$renderers$measurables$types . isInlineInput ( b ) ? c + b . height / 2 : c + a . height / 2 ; return c } alignRowElements _ ( ) { if ( this . isInline ) { var a = 0 , b = new WeakMap , c = null ; for ( let d = this . rows . length - 1 , e ; e = this . rows [ d ] ; d -- ) b . set ( e , a ) , Types$$module$build$src$core$renderers$measurables$types . isInputRow ( e ) && ( e . hasStatement && this . alignStatementRow _ ( e ) ,
c && c . hasStatement && e . width < c . width ? b . set ( e , c . width ) : a = e . width , c = e ) ; a = 0 ; for ( let d = 0 , e ; e = this . rows [ d ] ; d ++ ) e . hasStatement ? a = this . getDesiredRowWidth _ ( e ) : Types$$module$build$src$core$renderers$measurables$types . isSpacer ( e ) ? e . width = Math . max ( a , b . get ( e ) ) : ( c = e . width , a = Math . max ( a , b . get ( e ) ) - c , 0 < a && this . addAlignmentPadding _ ( e , a ) , a = e . width ) } else super . alignRowElements _ ( ) } getDesiredRowWidth _ ( a ) { return this . isInline && a . hasStatement ? this . statementEdge + this . constants _ . MAX _BOTTOM _WIDTH + this . startX : super . getDesiredRowWidth _ ( a ) } finalize _ ( ) { let a =
0 , b = 0 ; for ( let d = 0 , e ; e = this . rows [ d ] ; d ++ ) { e . yPos = b ; e . xPos = this . startX ; b += e . height ; a = Math . max ( a , e . widthWithConnectedBlocks ) ; var c = b - this . topRow . ascenderHeight ; e === this . bottomRow && c < this . constants _ . MIN _BLOCK _HEIGHT && ( c = this . constants _ . MIN _BLOCK _HEIGHT - c , this . bottomRow . height += c , b += c ) ; this . recordElemPositions _ ( e ) } this . outputConnection && this . block _ . nextConnection && this . block _ . nextConnection . isConnected ( ) && ( c = this . block _ . nextConnection . targetBlock ( ) ) && ( a = Math . max ( a , c . getHeightWidth ( ) . width - this . constants _ . DARK _PATH _OFFSET ) ) ;
this . bottomRow . baseline = b - this . bottomRow . descenderHeight ; this . widthWithChildren = a + this . startX + this . constants _ . DARK _PATH _OFFSET ; this . width += this . constants _ . DARK _PATH _OFFSET ; this . height = b + this . constants _ . DARK _PATH _OFFSET ; this . startY = this . topRow . capline } } , module$build$src$core$renderers$geras$info = { } ; module$build$src$core$renderers$geras$info . RenderInfo = RenderInfo$$module$build$src$core$renderers$geras$info ; var PathObject$$module$build$src$core$renderers$geras$path _object = class extends PathObject$$module$build$src$core$renderers$common$path _object { constructor ( a , b , c ) { super ( a , b , c ) ; this . constants = c ; this . colourDark = "#000000" ; this . svgPathDark = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . PATH , { "class" : "blocklyPathDark" , transform : "translate(1,1)" } ) ; this . svgRoot . insertBefore ( this . svgPathDark , this . svgPath ) ; this . svgPathLight = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . PATH ,
{ "class" : "blocklyPathLight" } , this . svgRoot ) } setPath ( a ) { this . svgPath . setAttribute ( "d" , a ) ; this . svgPathDark . setAttribute ( "d" , a ) } setHighlightPath ( a ) { this . svgPathLight . setAttribute ( "d" , a ) } flipRTL ( ) { this . svgPath . setAttribute ( "transform" , "scale(-1 1)" ) ; this . svgPathLight . setAttribute ( "transform" , "scale(-1 1)" ) ; this . svgPathDark . setAttribute ( "transform" , "translate(1,1) scale(-1 1)" ) } applyColour ( a ) { this . svgPathLight . style . display = "" ; this . svgPathDark . style . display = "" ; if ( ! this . style . colourTertiary ) throw Error ( "The renderer did not properly initialize the tertiary colour of the block style" ) ;
this . svgPathLight . setAttribute ( "stroke" , this . style . colourTertiary ) ; this . svgPathDark . setAttribute ( "fill" , this . colourDark ) ; super . applyColour ( a ) ; this . svgPath . setAttribute ( "stroke" , "none" ) } setStyle ( a ) { this . style = a ; this . colourDark = blend$$module$build$src$core$utils$colour ( "#000" , this . style . colourPrimary , . 2 ) || this . colourDark } updateHighlighted ( a ) { a ? ( this . svgPath . setAttribute ( "filter" , "url(#" + this . constants . embossFilterId + ")" ) , this . svgPathLight . style . display = "none" ) : ( this . svgPath . setAttribute ( "filter" , "none" ) ,
this . svgPathLight . style . display = "inline" ) } updateShadow _ ( a ) { if ( a ) { this . svgPathLight . style . display = "none" ; if ( ! this . style . colourSecondary ) throw Error ( "The renderer did not properly initialize the secondary colour of the block style block style" ) ; this . svgPathDark . setAttribute ( "fill" , this . style . colourSecondary ) ; this . svgPath . setAttribute ( "stroke" , "none" ) ; this . svgPath . setAttribute ( "fill" , this . style . colourSecondary ) } } updateDisabled _ ( a ) { super . updateDisabled _ ( a ) ; a && this . svgPath . setAttribute ( "stroke" , "none" ) } } ,
module$build$src$core$renderers$geras$path _object = { } ; module$build$src$core$renderers$geras$path _object . PathObject = PathObject$$module$build$src$core$renderers$geras$path _object ; var Renderer$$module$build$src$core$renderers$geras$renderer = class extends Renderer$$module$build$src$core$renderers$common$renderer { constructor ( a ) { super ( a ) ; this . highlightConstants _ = null } init ( a , b ) { super . init ( a , b ) ; this . highlightConstants _ = this . makeHighlightConstants _ ( ) ; this . highlightConstants _ . init ( ) } refreshDom ( a , b ) { super . refreshDom ( a , b ) ; this . getHighlightConstants ( ) . init ( ) } makeConstants _ ( ) { return new ConstantProvider$$module$build$src$core$renderers$geras$constants } makeRenderInfo _ ( a ) { return new RenderInfo$$module$build$src$core$renderers$geras$info ( this ,
a ) } makeDrawer _ ( a , b ) { return new Drawer$$module$build$src$core$renderers$geras$drawer ( a , b ) } makePathObject ( a , b ) { return new PathObject$$module$build$src$core$renderers$geras$path _object ( a , b , this . getConstants ( ) ) } makeHighlightConstants _ ( ) { return new HighlightConstantProvider$$module$build$src$core$renderers$geras$highlight _constants ( this . getConstants ( ) ) } getHighlightConstants ( ) { if ( ! this . highlightConstants _ ) throw Error ( "Cannot access the highlight constants because init has not been called" ) ; return this . highlightConstants _ } } ;
register$$module$build$src$core$renderers$common$block _rendering ( "geras" , Renderer$$module$build$src$core$renderers$geras$renderer ) ; var module$build$src$core$renderers$geras$renderer = { } ; module$build$src$core$renderers$geras$renderer . Renderer = Renderer$$module$build$src$core$renderers$geras$renderer ; var module$build$src$core$renderers$geras$geras = { } ; module$build$src$core$renderers$geras$geras . ConstantProvider = ConstantProvider$$module$build$src$core$renderers$geras$constants ; module$build$src$core$renderers$geras$geras . Drawer = Drawer$$module$build$src$core$renderers$geras$drawer ; module$build$src$core$renderers$geras$geras . HighlightConstantProvider = HighlightConstantProvider$$module$build$src$core$renderers$geras$highlight _constants ; module$build$src$core$renderers$geras$geras . Highlighter = Highlighter$$module$build$src$core$renderers$geras$highlighter ;
module$build$src$core$renderers$geras$geras . InlineInput = InlineInput$$module$build$src$core$renderers$geras$measurables$inline _input ; module$build$src$core$renderers$geras$geras . PathObject = PathObject$$module$build$src$core$renderers$geras$path _object ; module$build$src$core$renderers$geras$geras . RenderInfo = RenderInfo$$module$build$src$core$renderers$geras$info ; module$build$src$core$renderers$geras$geras . Renderer = Renderer$$module$build$src$core$renderers$geras$renderer ;
module$build$src$core$renderers$geras$geras . StatementInput = StatementInput$$module$build$src$core$renderers$geras$measurables$statement _input ; var WorkspaceDragSurfaceSvg$$module$build$src$core$workspace _drag _surface _svg = class { constructor ( a ) { this . container = a ; this . previousSibling = null ; this . createDom ( ) } createDom ( ) { this . SVG || ( this . SVG = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . SVG , { xmlns : SVG _NS$$module$build$src$core$utils$dom , "xmlns:html" : HTML _NS$$module$build$src$core$utils$dom , "xmlns:xlink" : XLINK _NS$$module$build$src$core$utils$dom , version : "1.1" , "class" : "blocklyWsDragSurface blocklyOverflowVisible" } ) ,
this . container . appendChild ( this . SVG ) ) } translateSurface ( a , b ) { a = Math . round ( a ) ; b = Math . round ( b ) ; this . SVG . style . display = "block" ; setCssTransform$$module$build$src$core$utils$dom ( this . SVG , "translate3d(" + a + "px, " + b + "px, 0)" ) } getSurfaceTranslation ( ) { return getRelativeXY$$module$build$src$core$utils$svg _math ( this . SVG ) } clearAndHide ( a ) { if ( ! a ) throw Error ( "Couldn't clear and hide the drag surface: missing new surface." ) ; const b = this . SVG . childNodes [ 0 ] , c = this . SVG . childNodes [ 1 ] ; if ( ! b || ! c || ! b . classList . contains ( "blocklyBlockCanvas" ) &&
c . classList . contains ( "blocklyBubbleCanvas" ) ) throw Error ( "Couldn't clear and hide the drag surface. A node was missing." ) ; null !== this . previousSibling ? insertAfter$$module$build$src$core$utils$dom ( b , this . previousSibling ) : a . insertBefore ( b , a . firstChild ) ; insertAfter$$module$build$src$core$utils$dom ( c , b ) ; this . SVG . style . display = "none" ; if ( this . SVG . childNodes . length ) throw Error ( "Drag surface was not cleared." ) ; setCssTransform$$module$build$src$core$utils$dom ( this . SVG , "" ) ; this . previousSibling = null } setContentsAndShow ( a ,
b , c , d , e , f ) { if ( this . SVG . childNodes . length ) throw Error ( "Already dragging a block." ) ; this . previousSibling = c ; a . setAttribute ( "transform" , "translate(0, 0) scale(" + f + ")" ) ; b . setAttribute ( "transform" , "translate(0, 0) scale(" + f + ")" ) ; this . SVG . setAttribute ( "width" , String ( d ) ) ; this . SVG . setAttribute ( "height" , String ( e ) ) ; this . SVG . appendChild ( a ) ; this . SVG . appendChild ( b ) ; this . SVG . style . display = "block" } } , module$build$src$core$workspace _drag _surface _svg = { } ;
module$build$src$core$workspace _drag _surface _svg . WorkspaceDragSurfaceSvg = WorkspaceDragSurfaceSvg$$module$build$src$core$workspace _drag _surface _svg ; var BlockDragSurfaceSvg$$module$build$src$core$block _drag _surface = class { constructor ( a ) { this . container = a ; this . scale _ = 1 ; this . surfaceXY _ = new Coordinate$$module$build$src$core$utils$coordinate ( 0 , 0 ) ; this . childSurfaceXY _ = new Coordinate$$module$build$src$core$utils$coordinate ( 0 , 0 ) ; this . svg _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . SVG , { xmlns : SVG _NS$$module$build$src$core$utils$dom , "xmlns:html" : HTML _NS$$module$build$src$core$utils$dom , "xmlns:xlink" : XLINK _NS$$module$build$src$core$utils$dom ,
version : "1.1" , "class" : "blocklyBlockDragSurface" } , this . container ) ; this . dragGroup _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G , { } , this . svg _ ) } createDom ( ) { warn$$module$build$src$core$utils$deprecation ( "BlockDragSurfaceSvg createDom" , "June 2022" , "June 2023" ) } setBlocksAndShow ( a ) { if ( this . dragGroup _ . childNodes . length ) throw Error ( "Already dragging a block." ) ; this . dragGroup _ . appendChild ( a ) ; this . svg _ . style . display = "block" ; this . surfaceXY _ = new Coordinate$$module$build$src$core$utils$coordinate ( 0 ,
0 ) } translateAndScaleGroup ( a , b , c ) { this . scale _ = c ; a = Math . round ( a ) ; b = Math . round ( b ) ; this . childSurfaceXY _ . x = a ; this . childSurfaceXY _ . y = b ; this . dragGroup _ . setAttribute ( "transform" , "translate(" + a + "," + b + ") scale(" + c + ")" ) } translateSurfaceInternal _ ( ) { let a = this . surfaceXY _ . x , b = this . surfaceXY _ . y ; a = Math . round ( a ) ; b = Math . round ( b ) ; this . svg _ . style . display = "block" ; setCssTransform$$module$build$src$core$utils$dom ( this . svg _ , "translate3d(" + a + "px, " + b + "px, 0)" ) } translateBy ( a , b ) { this . surfaceXY _ = new Coordinate$$module$build$src$core$utils$coordinate ( this . surfaceXY _ . x +
a , this . surfaceXY _ . y + b ) ; this . translateSurfaceInternal _ ( ) } translateSurface ( a , b ) { this . surfaceXY _ = new Coordinate$$module$build$src$core$utils$coordinate ( a * this . scale _ , b * this . scale _ ) ; this . translateSurfaceInternal _ ( ) } getSurfaceTranslation ( ) { const a = getRelativeXY$$module$build$src$core$utils$svg _math ( this . svg _ ) ; return new Coordinate$$module$build$src$core$utils$coordinate ( a . x / this . scale _ , a . y / this . scale _ ) } getGroup ( ) { return this . dragGroup _ } getSvgRoot ( ) { return this . svg _ } getCurrentBlock ( ) { return this . dragGroup _ . firstChild } getWsTranslation ( ) { return this . childSurfaceXY _ . clone ( ) } clearAndHide ( a ) { const b =
this . getCurrentBlock ( ) ; b && ( a ? a . appendChild ( b ) : this . dragGroup _ . removeChild ( b ) ) ; this . svg _ . style . display = "none" ; if ( this . dragGroup _ . childNodes . length ) throw Error ( "Drag group was not cleared." ) ; this . surfaceXY _ = new Coordinate$$module$build$src$core$utils$coordinate ( 0 , 0 ) } } , module$build$src$core$block _drag _surface = { } ; module$build$src$core$block _drag _surface . BlockDragSurfaceSvg = BlockDragSurfaceSvg$$module$build$src$core$block _drag _surface ; 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 ScrollbarPair$$module$build$src$core$scrollbar _pair = class { constructor ( a , b , c , d , e ) { this . workspace = a ; this . oldHostMetrics _ = this . corner _ = this . vScroll = this . hScroll = null ; b = void 0 === b ? ! 0 : b ; c = void 0 === c ? ! 0 : c ; const f = b && c ; b && ( this . hScroll = new Scrollbar$$module$build$src$core$scrollbar ( a , ! 0 , f , d , e ) ) ; c && ( this . vScroll = new Scrollbar$$module$build$src$core$scrollbar ( a , ! 1 , f , d , e ) ) ; f && ( this . corner _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { height : Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness ,
width : Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness , "class" : "blocklyScrollbarBackground" } ) , insertAfter$$module$build$src$core$utils$dom ( this . corner _ , a . getBubbleCanvas ( ) ) ) } dispose ( ) { removeNode$$module$build$src$core$utils$dom ( this . corner _ ) ; this . oldHostMetrics _ = this . corner _ = null ; this . hScroll && ( this . hScroll . dispose ( ) , this . hScroll = null ) ; this . vScroll && ( this . vScroll . dispose ( ) , this . vScroll = null ) } resize ( ) { const a = this . workspace . getMetrics ( ) ; if ( a ) { var b = ! 1 , c = ! 1 ; this . oldHostMetrics _ && this . oldHostMetrics _ . viewWidth ===
a . viewWidth && this . oldHostMetrics _ . viewHeight === a . viewHeight && this . oldHostMetrics _ . absoluteTop === a . absoluteTop && this . oldHostMetrics _ . absoluteLeft === a . absoluteLeft ? ( this . oldHostMetrics _ && this . oldHostMetrics _ . scrollWidth === a . scrollWidth && this . oldHostMetrics _ . viewLeft === a . viewLeft && this . oldHostMetrics _ . scrollLeft === a . scrollLeft || ( b = ! 0 ) , this . oldHostMetrics _ && this . oldHostMetrics _ . scrollHeight === a . scrollHeight && this . oldHostMetrics _ . viewTop === a . viewTop && this . oldHostMetrics _ . scrollTop === a . scrollTop || ( c = ! 0 ) ) :
c = b = ! 0 ; if ( b || c ) { try { disable$$module$build$src$core$events$utils ( ) , this . hScroll && b && this . hScroll . resize ( a ) , this . vScroll && c && this . vScroll . resize ( a ) } finally { enable$$module$build$src$core$events$utils ( ) } this . workspace . maybeFireViewportChangeEvent ( ) } if ( this . hScroll && this . vScroll ) { if ( ! this . oldHostMetrics _ || this . oldHostMetrics _ . viewWidth !== a . viewWidth || this . oldHostMetrics _ . absoluteLeft !== a . absoluteLeft ) { let d ; null == ( d = this . corner _ ) || d . setAttribute ( "x" , String ( this . vScroll . position . x ) ) } if ( ! this . oldHostMetrics _ ||
this . oldHostMetrics _ . viewHeight !== a . viewHeight || this . oldHostMetrics _ . absoluteTop !== a . absoluteTop ) { let d ; null == ( d = this . corner _ ) || d . setAttribute ( "y" , String ( this . hScroll . position . y ) ) } } this . oldHostMetrics _ = a } } canScrollHorizontally ( ) { return ! ! this . hScroll } canScrollVertically ( ) { return ! ! this . vScroll } setOrigin ( a , b ) { this . hScroll && this . hScroll . setOrigin ( a , b ) ; this . vScroll && this . vScroll . setOrigin ( a , b ) } set ( a , b , c ) { this . hScroll && this . hScroll . set ( a , ! 1 ) ; this . vScroll && this . vScroll . set ( b , ! 1 ) ; if ( c || void 0 === c ) a = { } , this . hScroll &&
( a . x = this . hScroll . getRatio _ ( ) ) , this . vScroll && ( a . y = this . vScroll . getRatio _ ( ) ) , this . workspace . setMetrics ( a ) } setX ( a ) { this . hScroll && this . hScroll . set ( a , ! 0 ) } setY ( a ) { this . vScroll && this . vScroll . set ( a , ! 0 ) } setContainerVisible ( a ) { this . hScroll && this . hScroll . setContainerVisible ( a ) ; this . vScroll && this . vScroll . setContainerVisible ( a ) } isVisible ( ) { let a = ! 1 ; this . hScroll && ( a = this . hScroll . isVisible ( ) ) ; this . vScroll && ( a = a || this . vScroll . isVisible ( ) ) ; return a } resizeContent ( a ) { this . hScroll && this . hScroll . resizeContentHorizontal ( a ) ;
this . vScroll && this . vScroll . resizeContentVertical ( a ) } resizeView ( a ) { this . hScroll && this . hScroll . resizeViewHorizontal ( a ) ; this . vScroll && this . vScroll . resizeViewVertical ( a ) } } , module$build$src$core$scrollbar _pair = { } ; module$build$src$core$scrollbar _pair . ScrollbarPair = ScrollbarPair$$module$build$src$core$scrollbar _pair ; var documentEventsBound$$module$build$src$core$inject = ! 1 , module$build$src$core$inject = { } ; module$build$src$core$inject . inject = inject$$module$build$src$core$inject ; $ . Generator$$module$build$src$core$generator = class { constructor ( a ) { this . FUNCTION _NAME _PLACEHOLDER _ = "{leCUI8hutHZI4480Dc}" ; this . STATEMENT _SUFFIX = this . STATEMENT _PREFIX = this . INFINITE _LOOP _TRAP = null ; this . INDENT = " " ; this . COMMENT _WRAP = 60 ; this . ORDER _OVERRIDES = [ ] ; this . isInitialized = null ; this . RESERVED _WORDS _ = "" ; this . definitions _ = Object . create ( null ) ; this . functionNames _ = Object . create ( null ) ; this . nameDB _ = void 0 ; this . name _ = a ; this . FUNCTION _NAME _PLACEHOLDER _REGEXP _ = new RegExp ( this . FUNCTION _NAME _PLACEHOLDER _ , "g" ) } workspaceToCode ( a ) { a ||
( console . warn ( "No workspace specified in workspaceToCode call. Guessing." ) , a = getMainWorkspace$$module$build$src$core$common ( ) ) ; var b = [ ] ; this . init ( a ) ; a = a . getTopBlocks ( ! 0 ) ; for ( let c = 0 , d ; d = a [ c ] ; c ++ ) { let e = this . blockToCode ( d ) ; Array . isArray ( e ) && ( e = e [ 0 ] ) ; e && ( d . outputConnection && ( e = this . scrubNakedValue ( e ) , this . STATEMENT _PREFIX && ! d . suppressPrefixSuffix && ( e = this . injectId ( this . STATEMENT _PREFIX , d ) + e ) , this . STATEMENT _SUFFIX && ! d . suppressPrefixSuffix && ( e += this . injectId ( this . STATEMENT _SUFFIX , d ) ) ) , b . push ( e ) ) } b = b . join ( "\n" ) ;
b = this . finish ( b ) ; b = b . replace ( /^\s+\n/ , "" ) ; b = b . replace ( /\n\s+$/ , "\n" ) ; return b = b . replace ( /[ \t]+\n/g , "\n" ) } prefixLines ( a , b ) { return b + a . replace ( /(?!\n$)\n/g , "\n" + b ) } allNestedComments ( a ) { const b = [ ] ; a = a . getDescendants ( ! 0 ) ; for ( let c = 0 ; c < a . length ; c ++ ) { const d = a [ c ] . getCommentText ( ) ; d && b . push ( d ) } b . length && b . push ( "" ) ; return b . join ( "\n" ) } blockToCode ( a , b ) { ! 1 === this . isInitialized && console . warn ( "Generator init was not called before blockToCode was called." ) ; if ( ! a ) return "" ; if ( ! a . isEnabled ( ) ) return b ? "" : this . blockToCode ( a . getNextBlock ( ) ) ;
if ( a . isInsertionMarker ( ) ) return b ? "" : this . blockToCode ( a . getChildren ( ! 1 ) [ 0 ] ) ; var c = this [ a . type ] ; if ( "function" !== typeof c ) throw Error ( 'Language "' + this . name _ + '" does not know how to generate code for block type "' + a . type + '".' ) ; c = c . call ( a , a ) ; if ( Array . isArray ( c ) ) { if ( ! a . outputConnection ) throw TypeError ( "Expecting string from statement block: " + a . type ) ; return [ this . scrub _ ( a , c [ 0 ] , b ) , c [ 1 ] ] } if ( "string" === typeof c ) return this . STATEMENT _PREFIX && ! a . suppressPrefixSuffix && ( c = this . injectId ( this . STATEMENT _PREFIX ,
a ) + c ) , this . STATEMENT _SUFFIX && ! a . suppressPrefixSuffix && ( c += this . injectId ( this . STATEMENT _SUFFIX , a ) ) , this . scrub _ ( a , c , b ) ; if ( null === c ) return "" ; throw SyntaxError ( "Invalid code generated: " + c ) ; } valueToCode ( a , b , c ) { if ( isNaN ( c ) ) throw TypeError ( "Expecting valid order from block: " + a . type ) ; var d = a . getInputTargetBlock ( b ) ; if ( ! d ) return "" ; b = this . blockToCode ( d ) ; if ( "" === b ) return "" ; if ( ! Array . isArray ( b ) ) throw TypeError ( "Expecting tuple from value block: " + d . type ) ; a = b [ 0 ] ; b = b [ 1 ] ; if ( isNaN ( b ) ) throw TypeError ( "Expecting valid order from value block: " +
d . type ) ; if ( ! a ) return "" ; d = ! 1 ; var e = Math . floor ( c ) ; const f = Math . floor ( b ) ; if ( e <= f && ( e !== f || 0 !== e && 99 !== e ) ) for ( d = ! 0 , e = 0 ; e < this . ORDER _OVERRIDES . length ; e ++ ) if ( this . ORDER _OVERRIDES [ e ] [ 0 ] === c && this . ORDER _OVERRIDES [ e ] [ 1 ] === b ) { d = ! 1 ; break } d && ( a = "(" + a + ")" ) ; return a } statementToCode ( a , b ) { a = a . getInputTargetBlock ( b ) ; b = this . blockToCode ( a ) ; if ( "string" !== typeof b ) throw TypeError ( "Expecting code from statement block: " + ( a && a . type ) ) ; b && ( b = this . prefixLines ( b , this . INDENT ) ) ; return b } addLoopTrap ( a , b ) { this . INFINITE _LOOP _TRAP &&
( a = this . prefixLines ( this . injectId ( this . INFINITE _LOOP _TRAP , b ) , this . INDENT ) + a ) ; this . STATEMENT _SUFFIX && ! b . suppressPrefixSuffix && ( a = this . prefixLines ( this . injectId ( this . STATEMENT _SUFFIX , b ) , this . INDENT ) + a ) ; this . STATEMENT _PREFIX && ! b . suppressPrefixSuffix && ( a += this . prefixLines ( this . injectId ( this . STATEMENT _PREFIX , b ) , this . INDENT ) ) ; return a } injectId ( a , b ) { b = b . id . replace ( /\$/g , "$$$$" ) ; return a . replace ( /%1/g , "'" + b + "'" ) } addReservedWords ( a ) { this . RESERVED _WORDS _ += a + "," } provideFunction _ ( a , b ) { if ( ! this . definitions _ [ a ] ) { const c =
this . nameDB _ . getDistinctName ( a , $ . NameType$$module$build$src$core$names . PROCEDURE ) ; this . functionNames _ [ a ] = c ; Array . isArray ( b ) && ( b = b . join ( "\n" ) ) ; b = b . trim ( ) . replace ( this . FUNCTION _NAME _PLACEHOLDER _REGEXP _ , c ) ; let d ; for ( ; d !== b ; ) d = b , b = b . replace ( /^(( {2})*) {2}/gm , "$1\x00" ) ; b = b . replace ( /\0/g , this . INDENT ) ; this . definitions _ [ a ] = b } return this . functionNames _ [ a ] } init ( a ) { this . definitions _ = Object . create ( null ) ; this . functionNames _ = Object . create ( null ) } scrub _ ( a , b , c ) { return b } finish ( a ) { this . definitions _ = Object . create ( null ) ;
this . functionNames _ = Object . create ( null ) ; return a } scrubNakedValue ( a ) { return a } } ; Object . defineProperties ( $ . Generator$$module$build$src$core$generator . prototype , { variableDB _ : { get ( ) { warn$$module$build$src$core$utils$deprecation ( "variableDB_" , "version 9" , "version 10" , "nameDB_" ) ; return this . nameDB _ } , set ( a ) { warn$$module$build$src$core$utils$deprecation ( "variableDB_" , "version 9" , "version 10" , "nameDB_" ) ; this . nameDB _ = a } } } ) ; var module$build$src$core$generator = { } ; module$build$src$core$generator . Generator = $ . Generator$$module$build$src$core$generator ; var FlyoutButton$$module$build$src$core$flyout _button = class { constructor ( a , b , c , d ) { this . workspace = a ; this . targetWorkspace = b ; this . isLabel _ = d ; this . onMouseUpWrapper _ = null ; this . height = this . width = 0 ; 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 . isLabel _ ? "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 . isLabel _ || ( b = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : "blocklyFlyoutButtonShadow" , rx : 4 , ry : 4 , x : 1 , y : 1 } , this . svgGroup _ ) ) ; a = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "class" : this . isLabel _ ? "blocklyFlyoutLabelBackground" :
"blocklyFlyoutButtonBackground" , rx : 4 , ry : 4 } , this . svgGroup _ ) ; const c = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . TEXT , { "class" : this . isLabel _ ? "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 . isLabel _ && ( 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 , e , f , g ) ; this . height = d . height ; if ( ! this . isLabel _ ) { this . width += 2 * FlyoutButton$$module$build$src$core$flyout _button . TEXT _MARGIN _X ; this . height +=
2 * FlyoutButton$$module$build$src$core$flyout _button . TEXT _MARGIN _Y ; let h ; null == ( h = b ) || h . setAttribute ( "width" , this . width . toString ( ) ) ; let k ; null == ( k = b ) || k . setAttribute ( "height" , this . height . toString ( ) ) } a . setAttribute ( "width" , this . width . toString ( ) ) ; a . setAttribute ( "height" , this . height . toString ( ) ) ; c . setAttribute ( "x" , ( this . width / 2 ) . toString ( ) ) ; c . setAttribute ( "y" , ( this . height / 2 - d . height / 2 + d . baseline ) . toString ( ) ) ; this . updateTransform _ ( ) ; this . onMouseUpWrapper _ = conditionalBind$$module$build$src$core$browser _events ( this . svgGroup _ ,
"mouseup" , this , this . onMouseUp _ ) ; return this . svgGroup _ } show ( ) { this . updateTransform _ ( ) ; this . svgGroup _ . setAttribute ( "display" , "block" ) } updateTransform _ ( ) { this . svgGroup _ . setAttribute ( "transform" , "translate(" + this . position _ . x + "," + this . position _ . y + ")" ) } moveTo ( a , b ) { this . position _ . x = a ; this . position _ . y = b ; this . updateTransform _ ( ) } isLabel ( ) { return this . isLabel _ } getPosition ( ) { return this . position _ } getButtonText ( ) { return this . text _ } getTargetWorkspace ( ) { return this . targetWorkspace } dispose ( ) { this . onMouseUpWrapper _ &&
unbind$$module$build$src$core$browser _events ( this . onMouseUpWrapper _ ) ; this . svgGroup _ && removeNode$$module$build$src$core$utils$dom ( this . svgGroup _ ) ; this . svgText _ && this . workspace . getThemeManager ( ) . unsubscribe ( this . svgText _ ) } onMouseUp _ ( a ) { ( a = this . targetWorkspace . getGesture ( a ) ) && a . cancel ( ) ; this . isLabel _ && this . callbackKey _ ? console . warn ( "Labels should not have callbacks. Label text: " + this . text _ ) : this . isLabel _ || this . callbackKey _ && this . targetWorkspace . getButtonCallback ( this . callbackKey _ ) ? this . isLabel _ || ( a =
this . targetWorkspace . getButtonCallback ( this . callbackKey _ ) ) && a ( this ) : console . warn ( "Buttons should have callbacks. Button text: " + this . text _ ) } } ; FlyoutButton$$module$build$src$core$flyout _button . TEXT _MARGIN _X = 5 ; FlyoutButton$$module$build$src$core$flyout _button . TEXT _MARGIN _Y = 2 ; register$$module$build$src$core$css ( "\n.blocklyFlyoutButton {\n fill: #888;\n cursor: default;\n}\n\n.blocklyFlyoutButtonShadow {\n fill: #666;\n}\n\n.blocklyFlyoutButton:hover {\n fill: #aaa;\n}\n\n.blocklyFlyoutLabel {\n cursor: default;\n}\n\n.blocklyFlyoutLabelBackground {\n opacity: 0;\n}\n" ) ;
var module$build$src$core$flyout _button = { } ; module$build$src$core$flyout _button . FlyoutButton = FlyoutButton$$module$build$src$core$flyout _button ; var MetricsManager$$module$build$src$core$metrics _manager = class { constructor ( a ) { this . workspace _ = a } getDimensionsPx _ ( a ) { let b = 0 , c = 0 ; a && ( b = a . getWidth ( ) , c = a . getHeight ( ) ) ; return new Size$$module$build$src$core$utils$size ( b , c ) } getFlyoutMetrics ( a ) { a = this . getDimensionsPx _ ( this . workspace _ . getFlyout ( a ) ) ; return { width : a . width , height : a . height , position : this . workspace _ . toolboxPosition } } getToolboxMetrics ( ) { const a = this . getDimensionsPx _ ( this . workspace _ . getToolbox ( ) ) ; return { width : a . width , height : a . height , position : this . workspace _ . toolboxPosition } } getSvgMetrics ( ) { return this . workspace _ . getCachedParentSvgSize ( ) } getAbsoluteMetrics ( ) { let a =
0 ; const b = this . getToolboxMetrics ( ) , c = this . getFlyoutMetrics ( ! 0 ) , d = ! ! this . workspace _ . getToolbox ( ) , e = ! ! this . workspace _ . getFlyout ( ! 0 ) ; var f = d ? b . position : c . position , g = f === Position$$module$build$src$core$utils$toolbox . LEFT ; f = f === Position$$module$build$src$core$utils$toolbox . TOP ; d && g ? a = b . width : e && g && ( a = c . width ) ; g = 0 ; d && f ? g = b . height : e && f && ( g = c . height ) ; return { top : g , left : a } } getViewMetrics ( a ) { a = a ? this . workspace _ . scale : 1 ; const b = this . getSvgMetrics ( ) , c = this . getToolboxMetrics ( ) , d = this . getFlyoutMetrics ( ! 0 ) , e = this . workspace _ . getToolbox ( ) ?
c . position : d . position ; if ( this . workspace _ . getToolbox ( ) ) if ( e === Position$$module$build$src$core$utils$toolbox . TOP || e === Position$$module$build$src$core$utils$toolbox . BOTTOM ) b . height -= c . height ; else { if ( e === Position$$module$build$src$core$utils$toolbox . LEFT || e === Position$$module$build$src$core$utils$toolbox . RIGHT ) b . width -= c . width } else if ( this . workspace _ . getFlyout ( ! 0 ) ) if ( e === Position$$module$build$src$core$utils$toolbox . TOP || e === Position$$module$build$src$core$utils$toolbox . BOTTOM ) b . height -= d . height ; else if ( e ===
Position$$module$build$src$core$utils$toolbox . LEFT || e === Position$$module$build$src$core$utils$toolbox . RIGHT ) b . width -= d . width ; return { height : b . height / a , width : b . width / a , top : - this . workspace _ . scrollY / a , left : - this . workspace _ . scrollX / a } } getContentMetrics ( a ) { a = a ? 1 : this . workspace _ . scale ; const b = this . workspace _ . getBlocksBoundingBox ( ) ; return { height : ( b . bottom - b . top ) * a , width : ( b . right - b . left ) * a , top : b . top * a , left : b . left * a } } hasFixedEdges ( ) { return ! this . workspace _ . isMovableHorizontally ( ) || ! this . workspace _ . isMovableVertically ( ) } getComputedFixedEdges _ ( a ) { if ( ! this . hasFixedEdges ( ) ) return { } ;
const b = this . workspace _ . isMovableHorizontally ( ) , c = this . workspace _ . isMovableVertically ( ) ; a = a || this . getViewMetrics ( ! 1 ) ; const d = { } ; c || ( d . top = a . top , d . bottom = a . top + a . height ) ; b || ( d . left = a . left , d . right = a . left + a . width ) ; return d } getPaddedContent _ ( a , b ) { const c = b . top + b . height , d = b . left + b . width , e = a . width ; a = a . height ; const f = e / 2 , g = a / 2 ; return { top : Math . min ( b . top - g , c - a ) , bottom : Math . max ( c + g , b . top + a ) , left : Math . min ( b . left - f , d - e ) , right : Math . max ( d + f , b . left + e ) } } getScrollMetrics ( a , b , c ) { a = a ? this . workspace _ . scale : 1 ; b = b || this . getViewMetrics ( ! 1 ) ;
var d = c || this . getContentMetrics ( ) ; c = this . getComputedFixedEdges _ ( b ) ; b = this . getPaddedContent _ ( b , d ) ; d = void 0 !== c . top ? c . top : b . top ; const e = void 0 !== c . left ? c . left : b . left ; return { top : d / a , left : e / a , width : ( ( void 0 !== c . right ? c . right : b . right ) - e ) / a , height : ( ( void 0 !== c . bottom ? c . bottom : b . bottom ) - d ) / a } } getUiMetrics ( ) { return { viewMetrics : this . getViewMetrics ( ) , absoluteMetrics : this . getAbsoluteMetrics ( ) , toolboxMetrics : this . getToolboxMetrics ( ) } } getMetrics ( ) { const a = this . getToolboxMetrics ( ) , b = this . getFlyoutMetrics ( ! 0 ) , c =
this . getSvgMetrics ( ) , d = this . getAbsoluteMetrics ( ) , e = this . getViewMetrics ( ) , f = this . getContentMetrics ( ) , g = this . getScrollMetrics ( ! 1 , e , f ) ; return { contentHeight : f . height , contentWidth : f . width , contentTop : f . top , contentLeft : f . left , scrollHeight : g . height , scrollWidth : g . width , scrollTop : g . top , scrollLeft : g . left , viewHeight : e . height , viewWidth : e . width , viewTop : e . top , viewLeft : e . left , absoluteTop : d . top , absoluteLeft : d . left , svgHeight : c . height , svgWidth : c . width , toolboxWidth : a . width , toolboxHeight : a . height , toolboxPosition : a . position ,
flyoutWidth : b . width , flyoutHeight : b . height } } } ; register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . METRICS _MANAGER , DEFAULT$$module$build$src$core$registry , MetricsManager$$module$build$src$core$metrics _manager ) ; var module$build$src$core$metrics _manager = { } ; module$build$src$core$metrics _manager . MetricsManager = MetricsManager$$module$build$src$core$metrics _manager ; var FlyoutMetricsManager$$module$build$src$core$flyout _metrics _manager = class extends MetricsManager$$module$build$src$core$metrics _manager { constructor ( a , b ) { super ( a ) ; this . flyout _ = b } getBoundingBox _ ( ) { let a ; try { a = this . workspace _ . getCanvas ( ) . getBBox ( ) } catch ( b ) { a = { height : 0 , y : 0 , width : 0 , x : 0 } } return a } getContentMetrics ( a ) { const b = this . getBoundingBox _ ( ) ; a = a ? 1 : this . workspace _ . scale ; return { height : b . height * a , width : b . width * a , top : b . y * a , left : b . x * a } } getScrollMetrics ( a , b , c ) { b = c || this . getContentMetrics ( ) ; c = this . flyout _ . MARGIN *
this . workspace _ . scale ; a = a ? this . workspace _ . scale : 1 ; return { height : ( b . height + 2 * c ) / a , width : ( b . width + b . left + c ) / a , top : 0 , left : 0 } } } , module$build$src$core$flyout _metrics _manager = { } ; module$build$src$core$flyout _metrics _manager . FlyoutMetricsManager = FlyoutMetricsManager$$module$build$src$core$flyout _metrics _manager ; var FlyoutItemType$$module$build$src$core$flyout _base ; ( function ( a ) { a . BLOCK = "block" ; a . BUTTON = "button" } ) ( FlyoutItemType$$module$build$src$core$flyout _base || ( FlyoutItemType$$module$build$src$core$flyout _base = { } ) ) ;
var Flyout$$module$build$src$core$flyout _base = class extends DeleteArea$$module$build$src$core$delete _area { constructor ( a ) { super ( ) ; this . horizontalLayout = ! 1 ; this . eventWrappers _ = [ ] ; this . filterWrapper _ = this . reflowWrapper _ = null ; this . mats _ = [ ] ; this . buttons _ = [ ] ; this . listeners _ = [ ] ; this . permanentlyDisabled _ = [ ] ; this . recycledBlocks _ = [ ] ; this . autoClose = ! 0 ; this . isVisible _ = ! 1 ; this . containerVisible _ = ! 0 ; this . CORNER _RADIUS = 8 ; this . SCROLLBAR _MARGIN = 2.5 ; this . height _ = this . width _ = 0 ; this . dragAngleRange _ = 70 ; this . svgGroup _ =
this . svgBackground _ = null ; a . setMetrics = this . setMetrics _ . bind ( this ) ; this . workspace _ = new WorkspaceSvg$$module$build$src$core$workspace _svg ( a ) ; this . workspace _ . setMetricsManager ( new FlyoutMetricsManager$$module$build$src$core$flyout _metrics _manager ( this . workspace _ , this ) ) ; this . workspace _ . internalIsFlyout = ! 0 ; this . workspace _ . setVisible ( this . isVisible _ ) ; this . id = genUid$$module$build$src$core$utils$idgenerator ( ) ; this . RTL = ! ! a . RTL ; this . toolboxPosition _ = a . toolboxPosition ; this . tabWidth _ = this . workspace _ . getRenderer ( ) . getConstants ( ) . TAB _WIDTH ;
this . rectMap _ = new WeakMap ; this . MARGIN = this . CORNER _RADIUS ; this . GAP _X = 3 * this . MARGIN ; this . GAP _Y = 3 * this . MARGIN } createDom ( a ) { this . svgGroup _ = createSvgElement$$module$build$src$core$utils$dom ( a , { "class" : "blocklyFlyout" , style : "display: none" } ) ; this . svgBackground _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . PATH , { "class" : "blocklyFlyoutBackground" } , this . svgGroup _ ) ; this . svgGroup _ . appendChild ( this . workspace _ . createDom ( ) ) ; this . workspace _ . getThemeManager ( ) . subscribe ( this . svgBackground _ ,
"flyoutBackgroundColour" , "fill" ) ; this . workspace _ . getThemeManager ( ) . subscribe ( this . svgBackground _ , "flyoutOpacity" , "fill-opacity" ) ; return this . svgGroup _ } init ( a ) { this . targetWorkspace = a ; this . workspace _ . targetWorkspace = a ; this . workspace _ . scrollbar = new ScrollbarPair$$module$build$src$core$scrollbar _pair ( this . workspace _ , this . horizontalLayout , ! this . horizontalLayout , "blocklyFlyoutScrollbar" , this . SCROLLBAR _MARGIN ) ; this . hide ( ) ; Array . prototype . push . apply ( this . eventWrappers _ , conditionalBind$$module$build$src$core$browser _events ( this . svgGroup _ ,
"wheel" , this , this . wheel _ ) ) ; this . autoClose || ( this . filterWrapper _ = this . filterForCapacity _ . bind ( this ) , this . targetWorkspace . addChangeListener ( this . filterWrapper _ ) ) ; Array . prototype . push . apply ( this . eventWrappers _ , conditionalBind$$module$build$src$core$browser _events ( this . svgBackground _ , "mousedown" , this , this . onMouseDown _ ) ) ; this . workspace _ . getGesture = this . targetWorkspace . getGesture . bind ( this . targetWorkspace ) ; this . workspace _ . setVariableMap ( this . targetWorkspace . getVariableMap ( ) ) ; this . workspace _ . createPotentialVariableMap ( ) ;
a . getComponentManager ( ) . addComponent ( { component : this , weight : 1 , capabilities : [ ComponentManager$$module$build$src$core$component _manager . Capability . DELETE _AREA , ComponentManager$$module$build$src$core$component _manager . Capability . DRAG _TARGET ] } ) } dispose ( ) { this . hide ( ) ; this . workspace _ . getComponentManager ( ) . removeComponent ( this . id ) ; unbind$$module$build$src$core$browser _events ( this . eventWrappers _ ) ; this . filterWrapper _ && ( this . targetWorkspace . removeChangeListener ( this . filterWrapper _ ) , this . filterWrapper _ = null ) ;
this . workspace _ && ( this . workspace _ . getThemeManager ( ) . unsubscribe ( this . svgBackground _ ) , this . workspace _ . dispose ( ) ) ; this . svgGroup _ && ( removeNode$$module$build$src$core$utils$dom ( this . svgGroup _ ) , this . svgGroup _ = null ) ; this . svgBackground _ = null } getWidth ( ) { return this . width _ } getHeight ( ) { return this . height _ } getFlyoutScale ( ) { return this . targetWorkspace . scale } getWorkspace ( ) { return this . workspace _ } isVisible ( ) { return this . isVisible _ } setVisible ( a ) { const b = a !== this . isVisible ( ) ; this . isVisible _ = a ; b && ( this . autoClose ||
this . workspace _ . recordDragTargets ( ) , this . updateDisplay _ ( ) ) } setContainerVisible ( a ) { const b = a !== this . containerVisible _ ; this . containerVisible _ = a ; b && this . updateDisplay _ ( ) } updateDisplay _ ( ) { let a ; a = this . containerVisible _ ? this . isVisible ( ) : ! 1 ; this . svgGroup _ && ( this . svgGroup _ . style . display = a ? "block" : "none" ) ; let b ; null == ( b = this . workspace _ . scrollbar ) || b . setContainerVisible ( a ) } positionAt _ ( a , b , c , d ) { let e ; null == ( e = this . svgGroup _ ) || e . setAttribute ( "width" , a . toString ( ) ) ; let f ; null == ( f = this . svgGroup _ ) || f . setAttribute ( "height" ,
b . toString ( ) ) ; this . workspace _ . setCachedParentSvgSize ( a , b ) ; let g ; if ( "svg" === ( null == ( g = this . svgGroup _ ) ? void 0 : g . tagName ) ) setCssTransform$$module$build$src$core$utils$dom ( this . svgGroup _ , "translate(" + c + "px," + d + "px)" ) ; else { let h ; null == ( h = this . svgGroup _ ) || h . setAttribute ( "transform" , "translate(" + c + "," + d + ")" ) } if ( a = this . workspace _ . scrollbar ) a . setOrigin ( c , d ) , a . resize ( ) , a . hScroll && a . hScroll . setPosition ( a . hScroll . position . x , a . hScroll . position . y ) , a . vScroll && a . vScroll . setPosition ( a . vScroll . position . x , a . vScroll . position . y ) } hide ( ) { if ( this . isVisible ( ) ) { this . setVisible ( ! 1 ) ;
for ( let a = 0 , b ; b = this . listeners _ [ a ] ; a ++ ) unbind$$module$build$src$core$browser _events ( b ) ; this . listeners _ . length = 0 ; this . reflowWrapper _ && ( this . workspace _ . removeChangeListener ( this . reflowWrapper _ ) , this . reflowWrapper _ = null ) } } show ( a ) { this . workspace _ . setResizesEnabled ( ! 1 ) ; this . hide ( ) ; this . clearOldBlocks _ ( ) ; "string" === typeof a && ( a = this . getDynamicCategoryContents _ ( a ) ) ; this . setVisible ( ! 0 ) ; a = convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox ( a ) ; a = this . createFlyoutInfo _ ( a ) ; this . layout _ ( a . contents ,
a . gaps ) ; this . listeners _ . push ( conditionalBind$$module$build$src$core$browser _events ( this . svgBackground _ , "mouseover" , this , function ( ) { const b = this . workspace _ . getTopBlocks ( ! 1 ) ; for ( let c = 0 , d ; d = b [ c ] ; c ++ ) d . removeSelect ( ) } ) ) ; this . horizontalLayout ? this . height _ = 0 : this . width _ = 0 ; this . workspace _ . setResizesEnabled ( ! 0 ) ; this . reflow ( ) ; this . filterForCapacity _ ( ) ; this . position ( ) ; this . reflowWrapper _ = this . reflow . bind ( this ) ; this . workspace _ . addChangeListener ( this . reflowWrapper _ ) ; this . emptyRecycledBlocks _ ( ) } createFlyoutInfo _ ( a ) { const b =
[ ] , c = [ ] ; this . permanentlyDisabled _ . length = 0 ; const d = this . horizontalLayout ? this . GAP _X : this . GAP _Y ; for ( let f = 0 , g ; g = a [ f ] ; f ++ ) { if ( "custom" in g ) { var e = this . getDynamicCategoryContents _ ( g . custom ) ; e = convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox ( e ) ; a . splice . apply ( a , [ f , 1 , ... e ] ) ; g = a [ f ] } switch ( g . kind . toUpperCase ( ) ) { case "BLOCK" : e = g ; const h = this . createFlyoutBlock _ ( e ) ; b . push ( { type : FlyoutItemType$$module$build$src$core$flyout _base . BLOCK , block : h } ) ; this . addBlockGap _ ( e , c , d ) ; break ; case "SEP" : this . addSeparatorGap _ ( g ,
c , d ) ; break ; case "LABEL" : e = this . createButton _ ( g , ! 0 ) ; b . push ( { type : FlyoutItemType$$module$build$src$core$flyout _base . BUTTON , button : e } ) ; c . push ( d ) ; break ; case "BUTTON" : e = this . createButton _ ( g , ! 1 ) , b . push ( { type : FlyoutItemType$$module$build$src$core$flyout _base . BUTTON , button : e } ) , c . push ( d ) } } return { contents : b , gaps : c } } getDynamicCategoryContents _ ( a ) { a = this . workspace _ . targetWorkspace . getToolboxCategoryCallback ( a ) ; if ( "function" !== typeof a ) throw TypeError ( "Couldn't find a callback function when opening a toolbox category." ) ;
return a ( this . workspace _ . targetWorkspace ) } createButton _ ( a , b ) { return new FlyoutButton$$module$build$src$core$flyout _button ( this . workspace _ , this . targetWorkspace , a , b ) } createFlyoutBlock _ ( a ) { let b ; a . blockxml ? ( a = "string" === typeof a . blockxml ? textToDom$$module$build$src$core$xml ( a . blockxml ) : a . blockxml , ( b = this . getRecycledBlock _ ( a . getAttribute ( "type" ) ) ) || ( b = domToBlock$$module$build$src$core$xml ( a , this . workspace _ ) ) ) : ( b = this . getRecycledBlock _ ( a . type ) , b || ( void 0 === a . enabled && ( a . enabled = "true" !== a . disabled && ! 0 !==
a . disabled ) , b = append$$module$build$src$core$serialization$blocks ( a , this . workspace _ ) ) ) ; b . isEnabled ( ) || this . permanentlyDisabled _ . push ( b ) ; return b } getRecycledBlock _ ( a ) { let b = - 1 ; for ( let c = 0 ; c < this . recycledBlocks _ . length ; c ++ ) if ( this . recycledBlocks _ [ c ] . type === a ) { b = c ; break } return - 1 === b ? void 0 : this . recycledBlocks _ . splice ( b , 1 ) [ 0 ] } addBlockGap _ ( a , b , c ) { let d ; a . gap ? d = parseInt ( a . gap . toString ( ) ) : a . blockxml && ( a = "string" === typeof a . blockxml ? textToDom$$module$build$src$core$xml ( a . blockxml ) : a . blockxml , d = parseInt ( a . getAttribute ( "gap" ) ) ) ;
b . push ( ! d || isNaN ( d ) ? c : d ) } addSeparatorGap _ ( a , b , c ) { a = parseInt ( a . gap . toString ( ) ) ; ! isNaN ( a ) && 0 < b . length ? b [ b . length - 1 ] = a : b . push ( c ) } clearOldBlocks _ ( ) { var a = this . workspace _ . getTopBlocks ( ! 1 ) ; for ( let c = 0 , d ; d = a [ c ] ; c ++ ) this . blockIsRecyclable _ ( d ) ? this . recycleBlock _ ( d ) : d . dispose ( ! 1 , ! 1 ) ; for ( a = 0 ; a < this . mats _ . length ; a ++ ) { const c = this . mats _ [ a ] ; c && ( unbindMouseEvents$$module$build$src$core$tooltip ( c ) , removeNode$$module$build$src$core$utils$dom ( c ) ) } this . mats _ . length = 0 ; for ( let c = 0 , d ; d = this . buttons _ [ c ] ; c ++ ) d . dispose ( ) ;
this . buttons _ . length = 0 ; let b ; null == ( b = this . workspace _ . getPotentialVariableMap ( ) ) || b . clear ( ) } emptyRecycledBlocks _ ( ) { for ( let a = 0 ; a < this . recycledBlocks _ . length ; a ++ ) this . recycledBlocks _ [ a ] . dispose ( ) ; this . recycledBlocks _ = [ ] } blockIsRecyclable _ ( a ) { return ! 1 } recycleBlock _ ( a ) { const b = a . getRelativeToSurfaceXY ( ) ; a . moveBy ( - b . x , - b . y ) ; this . recycledBlocks _ . push ( a ) } addBlockListeners _ ( a , b , c ) { this . listeners _ . push ( conditionalBind$$module$build$src$core$browser _events ( a , "mousedown" , null , this . blockMouseDown _ ( b ) ) ) ; this . listeners _ . push ( conditionalBind$$module$build$src$core$browser _events ( c ,
"mousedown" , null , this . blockMouseDown _ ( b ) ) ) ; this . listeners _ . push ( bind$$module$build$src$core$browser _events ( a , "mouseenter" , b , b . addSelect ) ) ; this . listeners _ . push ( bind$$module$build$src$core$browser _events ( a , "mouseleave" , b , b . removeSelect ) ) ; this . listeners _ . push ( bind$$module$build$src$core$browser _events ( c , "mouseenter" , b , b . addSelect ) ) ; this . listeners _ . push ( bind$$module$build$src$core$browser _events ( c , "mouseleave" , b , 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 < a . length ; c ++ ) { const d = a [ c ] ; fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( VAR _CREATE$$module$build$src$core$events$utils ) ) ( d ) ) } fire$$module$build$src$core$events$utils ( new ( get$$module$build$src$core$events$utils ( CREATE$$module$build$src$core$events$utils ) ) ( b ) ) } this . autoClose ? this . hide ( ) : this . filterForCapacity _ ( ) ; return b } initFlyoutButton _ ( a , b , c ) { const d =
a . createDom ( ) ; a . moveTo ( b , c ) ; a . show ( ) ; this . listeners _ . push ( conditionalBind$$module$build$src$core$browser _events ( d , "mousedown" , this , this . onMouseDown _ ) ) ; this . buttons _ . push ( a ) } createRect _ ( a , b , c , d , e ) { b = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . RECT , { "fill-opacity" : 0 , x : b , y : c , height : d . height , width : d . width } ) ; b . tooltip = a ; bindMouseEvents$$module$build$src$core$tooltip ( b ) ; this . workspace _ . getCanvas ( ) . insertBefore ( b , a . getSvgRoot ( ) ) ; this . rectMap _ . set ( a , b ) ; return this . mats _ [ e ] =
b } moveRectToBlock _ ( a , b ) { const c = b . getHeightWidth ( ) ; a . setAttribute ( "width" , c . width . toString ( ) ) ; a . setAttribute ( "height" , c . height . toString ( ) ) ; b = b . getRelativeToSurfaceXY ( ) ; a . setAttribute ( "y" , b . y . toString ( ) ) ; a . setAttribute ( "x" , ( this . RTL ? b . x - c . width : b . x ) . toString ( ) ) } filterForCapacity _ ( ) { const a = this . workspace _ . getTopBlocks ( ! 1 ) ; for ( let b = 0 , c ; c = a [ b ] ; b ++ ) if ( - 1 === this . permanentlyDisabled _ . indexOf ( c ) ) { const d = this . targetWorkspace . isCapacityAvailable ( getBlockTypeCounts$$module$build$src$core$common ( c ) ) ; for ( ; c ; ) c . setEnabled ( d ) ,
c = c . getNextBlock ( ) } } reflow ( ) { this . reflowWrapper _ && this . workspace _ . removeChangeListener ( this . reflowWrapper _ ) ; this . reflowInternal _ ( ) ; this . reflowWrapper _ && this . workspace _ . addChangeListener ( this . reflowWrapper _ ) } isScrollable ( ) { return this . workspace _ . scrollbar ? this . workspace _ . scrollbar . isVisible ( ) : ! 1 } placeNewBlock _ ( a ) { var b = this . targetWorkspace ; if ( ! a . getSvgRoot ( ) ) throw Error ( "oldBlock is not rendered." ) ; const c = save$$module$build$src$core$serialization$blocks ( a ) ; b . setResizesEnabled ( ! 1 ) ; b = append$$module$build$src$core$serialization$blocks ( c ,
b ) ; this . positionNewBlock _ ( a , b ) ; return b } positionNewBlock _ ( a , b ) { const c = this . targetWorkspace ; var d = c . getOriginOffsetInPixels ( ) , e = this . workspace _ . getOriginOffsetInPixels ( ) ; a = a . getRelativeToSurfaceXY ( ) ; a . scale ( this . workspace _ . scale ) ; e = Coordinate$$module$build$src$core$utils$coordinate . sum ( e , a ) ; d = Coordinate$$module$build$src$core$utils$coordinate . difference ( e , d ) ; d . scale ( 1 / c . scale ) ; b . moveTo ( new Coordinate$$module$build$src$core$utils$coordinate ( d . x , d . y ) ) } } ;
Flyout$$module$build$src$core$flyout _base . FlyoutItemType = FlyoutItemType$$module$build$src$core$flyout _base ; var module$build$src$core$flyout _base = { } ; module$build$src$core$flyout _base . Flyout = Flyout$$module$build$src$core$flyout _base ; var VerticalFlyout$$module$build$src$core$flyout _vertical = class extends Flyout$$module$build$src$core$flyout _base { constructor ( a ) { super ( a ) } setMetrics _ ( a ) { if ( this . isVisible ( ) ) { var b = this . workspace _ . getMetricsManager ( ) , c = b . getScrollMetrics ( ) , d = b . getViewMetrics ( ) ; b = b . getAbsoluteMetrics ( ) ; "number" === typeof a . y && ( this . workspace _ . scrollY = - ( c . top + ( c . height - d . height ) * a . y ) ) ; this . workspace _ . translate ( this . workspace _ . scrollX + b . left , this . workspace _ . scrollY + b . top ) } } getX ( ) { if ( ! this . isVisible ( ) ) return 0 ; var a = this . targetWorkspace . getMetricsManager ( ) ;
const b = a . getAbsoluteMetrics ( ) , c = a . getViewMetrics ( ) ; a = a . getToolboxMetrics ( ) ; return this . targetWorkspace . toolboxPosition === this . toolboxPosition _ ? this . targetWorkspace . getToolbox ( ) ? this . toolboxPosition _ === Position$$module$build$src$core$utils$toolbox . LEFT ? a . width : c . width - this . width _ : this . toolboxPosition _ === Position$$module$build$src$core$utils$toolbox . LEFT ? 0 : c . width : this . toolboxPosition _ === Position$$module$build$src$core$utils$toolbox . LEFT ? 0 : c . width + b . left - this . width _ } getY ( ) { return 0 } position ( ) { if ( this . isVisible ( ) &&
this . targetWorkspace . isVisible ( ) ) { var a = this . targetWorkspace . getMetricsManager ( ) . getViewMetrics ( ) ; this . height _ = a . height ; this . setBackgroundPath _ ( this . width _ - this . CORNER _RADIUS , a . height - 2 * this . CORNER _RADIUS ) ; a = this . getX ( ) ; var b = this . getY ( ) ; this . positionAt _ ( this . width _ , this . height _ , a , b ) } } setBackgroundPath _ ( a , b ) { const c = this . toolboxPosition _ === Position$$module$build$src$core$utils$toolbox . RIGHT ; var d = a + this . CORNER _RADIUS ; d = [ "M " + ( c ? d : 0 ) + ",0" ] ; d . push ( "h" , c ? - a : a ) ; d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS ,
0 , 0 , c ? 0 : 1 , c ? - this . CORNER _RADIUS : this . CORNER _RADIUS , this . CORNER _RADIUS ) ; d . push ( "v" , Math . max ( 0 , b ) ) ; d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , c ? 0 : 1 , c ? this . CORNER _RADIUS : - this . CORNER _RADIUS , this . CORNER _RADIUS ) ; d . push ( "h" , c ? a : - a ) ; d . push ( "z" ) ; this . svgBackground _ . setAttribute ( "d" , d . join ( " " ) ) } scrollToStart ( ) { let a ; null == ( a = this . workspace _ . scrollbar ) || a . setY ( 0 ) } wheel _ ( a ) { var b = getScrollDeltaPixels$$module$build$src$core$browser _events ( a ) ; if ( b . y ) { const c = this . workspace _ . getMetricsManager ( ) , d = c . getScrollMetrics ( ) ;
b = c . getViewMetrics ( ) . top - d . top + b . y ; let e ; null == ( e = this . workspace _ . scrollbar ) || e . setY ( b ) ; hide$$module$build$src$core$widgetdiv ( ) ; hideWithoutAnimation$$module$build$src$core$dropdowndiv ( ) } a . preventDefault ( ) ; a . stopPropagation ( ) } layout _ ( a , b ) { this . workspace _ . scale = this . targetWorkspace . scale ; var c = this . MARGIN ; const d = this . RTL ? c : c + this . tabWidth _ ; for ( let h = 0 , k ; k = a [ h ] ; h ++ ) if ( "block" === k . type ) { var e = k . block , f = e . getDescendants ( ! 1 ) ; for ( let m = 0 , n ; n = f [ m ] ; m ++ ) n . isInFlyout = ! 0 ; e . render ( ) ; f = e . getSvgRoot ( ) ; const l =
e . getHeightWidth ( ) ; var g = e . outputConnection ? d - this . tabWidth _ : d ; e . moveBy ( g , c ) ; g = this . createRect _ ( e , this . RTL ? g - l . width : g , c , l , h ) ; this . addBlockListeners _ ( f , e , g ) ; c += l . height + b [ h ] } else "button" === k . type && ( e = k . button , this . initFlyoutButton _ ( e , d , c ) , c += e . height + b [ h ] ) } isDragTowardWorkspace ( a ) { a = Math . atan2 ( a . y , a . x ) / Math . PI * 180 ; const b = this . dragAngleRange _ ; return a < b && a > - b || a < - 180 + b || a > 180 - b ? ! 0 : ! 1 } getClientRect ( ) { if ( ! this . svgGroup _ || this . autoClose || ! this . isVisible ( ) ) return null ; const a = this . svgGroup _ . getBoundingClientRect ( ) ,
b = a . left ; return this . toolboxPosition _ === Position$$module$build$src$core$utils$toolbox . LEFT ? new Rect$$module$build$src$core$utils$rect ( - 1E9 , 1E9 , - 1E9 , b + a . width ) : new Rect$$module$build$src$core$utils$rect ( - 1E9 , 1E9 , b , 1E9 ) } reflowInternal _ ( ) { this . workspace _ . scale = this . getFlyoutScale ( ) ; let a = 0 ; var b = this . workspace _ . getTopBlocks ( ! 1 ) ; for ( let d = 0 , e ; e = b [ d ] ; d ++ ) { var c = e . getHeightWidth ( ) . width ; e . outputConnection && ( c -= this . tabWidth _ ) ; a = Math . max ( a , c ) } for ( let d = 0 , e ; e = this . buttons _ [ d ] ; d ++ ) a = Math . max ( a , e . width ) ; a +=
1.5 * this . MARGIN + this . tabWidth _ ; a *= this . workspace _ . scale ; a += Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness ; if ( this . width _ !== a ) { for ( let d = 0 , e ; e = b [ d ] ; d ++ ) { if ( this . RTL ) { c = e . getRelativeToSurfaceXY ( ) . x ; let f = a / this . workspace _ . scale - this . MARGIN ; e . outputConnection || ( f -= this . tabWidth _ ) ; e . moveBy ( f - c , 0 ) } this . rectMap _ . has ( e ) && this . moveRectToBlock _ ( this . rectMap _ . get ( e ) , e ) } if ( this . RTL ) for ( let d = 0 , e ; e = this . buttons _ [ d ] ; d ++ ) b = e . getPosition ( ) . y , e . moveTo ( a / this . workspace _ . scale - e . width - this . MARGIN - this . tabWidth _ ,
b ) ; this . targetWorkspace . toolboxPosition !== this . toolboxPosition _ || this . toolboxPosition _ !== Position$$module$build$src$core$utils$toolbox . LEFT || this . targetWorkspace . getToolbox ( ) || this . targetWorkspace . translate ( this . targetWorkspace . scrollX + a , this . targetWorkspace . scrollY ) ; this . width _ = a ; this . position ( ) ; this . targetWorkspace . recordDragTargets ( ) } } } ; VerticalFlyout$$module$build$src$core$flyout _vertical . registryName = "verticalFlyout" ;
register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . FLYOUTS _VERTICAL _TOOLBOX , DEFAULT$$module$build$src$core$registry , VerticalFlyout$$module$build$src$core$flyout _vertical ) ; var module$build$src$core$flyout _vertical = { } ; module$build$src$core$flyout _vertical . VerticalFlyout = VerticalFlyout$$module$build$src$core$flyout _vertical ; var HorizontalFlyout$$module$build$src$core$flyout _horizontal = class extends Flyout$$module$build$src$core$flyout _base { constructor ( a ) { super ( a ) ; this . horizontalLayout = ! 0 } setMetrics _ ( a ) { if ( this . isVisible ( ) ) { var b = this . workspace _ . getMetricsManager ( ) , c = b . getScrollMetrics ( ) , d = b . getViewMetrics ( ) ; b = b . getAbsoluteMetrics ( ) ; "number" === typeof a . x && ( this . workspace _ . scrollX = - ( c . left + ( c . width - d . width ) * a . x ) ) ; this . workspace _ . translate ( this . workspace _ . scrollX + b . left , this . workspace _ . scrollY + b . top ) } } getX ( ) { return 0 } getY ( ) { if ( ! this . isVisible ( ) ) return 0 ;
var a = this . targetWorkspace . getMetricsManager ( ) ; const b = a . getAbsoluteMetrics ( ) , c = a . getViewMetrics ( ) ; a = a . getToolboxMetrics ( ) ; const d = this . toolboxPosition _ === Position$$module$build$src$core$utils$toolbox . TOP ; return this . targetWorkspace . toolboxPosition === this . toolboxPosition _ ? this . targetWorkspace . getToolbox ( ) ? d ? a . height : c . height - this . height _ : d ? 0 : c . height : d ? 0 : c . height + b . top - this . height _ } position ( ) { if ( this . isVisible ( ) && this . targetWorkspace . isVisible ( ) ) { var a = this . targetWorkspace . getMetricsManager ( ) . getViewMetrics ( ) ;
this . width _ = a . width ; this . setBackgroundPath _ ( a . width - 2 * this . CORNER _RADIUS , this . height _ - this . CORNER _RADIUS ) ; a = this . getX ( ) ; var b = this . getY ( ) ; this . positionAt _ ( this . width _ , this . height _ , a , b ) } } setBackgroundPath _ ( a , b ) { const c = this . toolboxPosition _ === Position$$module$build$src$core$utils$toolbox . TOP , d = [ "M 0," + ( c ? 0 : this . CORNER _RADIUS ) ] ; c ? ( d . push ( "h" , a + 2 * this . CORNER _RADIUS ) , d . push ( "v" , b ) , d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , 1 , - this . CORNER _RADIUS , this . CORNER _RADIUS ) , d . push ( "h" , - a ) , d . push ( "a" ,
this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , 1 , - this . CORNER _RADIUS , - this . CORNER _RADIUS ) ) : ( d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , 1 , this . CORNER _RADIUS , - this . CORNER _RADIUS ) , d . push ( "h" , a ) , d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , 1 , this . CORNER _RADIUS , this . CORNER _RADIUS ) , d . push ( "v" , b ) , d . push ( "h" , - a - 2 * this . CORNER _RADIUS ) ) ; d . push ( "z" ) ; this . svgBackground _ . setAttribute ( "d" , d . join ( " " ) ) } scrollToStart ( ) { let a ; null == ( a = this . workspace _ . scrollbar ) || a . setX ( this . RTL ? Infinity : 0 ) } wheel _ ( a ) { var b =
getScrollDeltaPixels$$module$build$src$core$browser _events ( a ) ; if ( b = b . x || b . y ) { const c = this . workspace _ . getMetricsManager ( ) , d = c . getScrollMetrics ( ) ; b = c . getViewMetrics ( ) . left - d . left + b ; let e ; null == ( e = this . workspace _ . scrollbar ) || e . setX ( b ) ; hide$$module$build$src$core$widgetdiv ( ) ; hideWithoutAnimation$$module$build$src$core$dropdowndiv ( ) } a . preventDefault ( ) ; a . stopPropagation ( ) } layout _ ( a , b ) { this . workspace _ . scale = this . targetWorkspace . scale ; const c = this . MARGIN ; let d = c + this . tabWidth _ ; this . RTL && ( a = a . reverse ( ) ) ; for ( let h =
0 , k ; k = a [ h ] ; h ++ ) if ( "block" === k . type ) { var e = k . block , f = e . getDescendants ( ! 1 ) ; for ( let m = 0 , n ; n = f [ m ] ; m ++ ) n . isInFlyout = ! 0 ; e . render ( ) ; f = e . getSvgRoot ( ) ; const l = e . getHeightWidth ( ) ; var g = e . outputConnection ? this . tabWidth _ : 0 ; g = this . RTL ? d + l . width : d - g ; e . moveBy ( g , c ) ; g = this . createRect _ ( e , g , c , l , h ) ; d += l . width + b [ h ] ; this . addBlockListeners _ ( f , e , g ) } else "button" === k . type && ( e = k . button , this . initFlyoutButton _ ( e , d , c ) , d += e . width + b [ h ] ) } isDragTowardWorkspace ( a ) { a = Math . atan2 ( a . y , a . x ) / Math . PI * 180 ; const b = this . dragAngleRange _ ; return a <
90 + b && a > 90 - b || a > - 90 - b && a < - 90 + b ? ! 0 : ! 1 } getClientRect ( ) { if ( ! this . svgGroup _ || this . autoClose || ! this . isVisible ( ) ) return null ; const a = this . svgGroup _ . getBoundingClientRect ( ) , b = a . top ; return this . toolboxPosition _ === Position$$module$build$src$core$utils$toolbox . TOP ? new Rect$$module$build$src$core$utils$rect ( - 1E9 , b + a . height , - 1E9 , 1E9 ) : new Rect$$module$build$src$core$utils$rect ( b , 1E9 , - 1E9 , 1E9 ) } reflowInternal _ ( ) { this . workspace _ . scale = this . getFlyoutScale ( ) ; let a = 0 ; const b = this . workspace _ . getTopBlocks ( ! 1 ) ; for ( let d =
0 , e ; e = b [ d ] ; d ++ ) a = Math . max ( a , e . getHeightWidth ( ) . height ) ; const c = this . buttons _ ; for ( let d = 0 , e ; e = c [ d ] ; d ++ ) a = Math . max ( a , e . height ) ; a += 1.5 * this . MARGIN ; a *= this . workspace _ . scale ; a += Scrollbar$$module$build$src$core$scrollbar . scrollbarThickness ; if ( this . height _ !== a ) { for ( let d = 0 , e ; e = b [ d ] ; d ++ ) this . rectMap _ . has ( e ) && this . moveRectToBlock _ ( this . rectMap _ . get ( e ) , e ) ; this . targetWorkspace . toolboxPosition !== this . toolboxPosition _ || this . toolboxPosition _ !== Position$$module$build$src$core$utils$toolbox . TOP || this . targetWorkspace . getToolbox ( ) ||
this . targetWorkspace . translate ( this . targetWorkspace . scrollX , this . targetWorkspace . scrollY + a ) ; this . height _ = a ; this . position ( ) ; this . targetWorkspace . recordDragTargets ( ) } } } ; register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . FLYOUTS _HORIZONTAL _TOOLBOX , DEFAULT$$module$build$src$core$registry , HorizontalFlyout$$module$build$src$core$flyout _horizontal ) ; var module$build$src$core$flyout _horizontal = { } ; module$build$src$core$flyout _horizontal . HorizontalFlyout = HorizontalFlyout$$module$build$src$core$flyout _horizontal ; var FieldVariable$$module$build$src$core$field _variable = class extends FieldDropdown$$module$build$src$core$field _dropdown { constructor ( a , b , c , d , e ) { super ( Field$$module$build$src$core$field . SKIP _SETUP ) ; this . defaultType _ = "" ; this . variableTypes = [ ] ; this . variable _ = null ; this . SERIALIZABLE = ! 0 ; this . menuGenerator _ = FieldVariable$$module$build$src$core$field _variable . dropdownCreate ; this . defaultVariableName = "string" === typeof a ? a : "" ; this . size _ = new Size$$module$build$src$core$utils$size ( 0 , 0 ) ; a !== Field$$module$build$src$core$field . SKIP _SETUP &&
( e ? this . configure _ ( e ) : this . setTypes _ ( c , d ) , b && this . setValidator ( b ) ) } configure _ ( a ) { super . configure _ ( a ) ; this . setTypes _ ( a . variableTypes , a . defaultType ) } initModel ( ) { var a = this . getSourceBlock ( ) ; if ( ! a ) throw new UnattachedFieldError$$module$build$src$core$field ; this . variable _ || ( a = getOrCreateVariablePackage$$module$build$src$core$variables ( a . workspace , null , this . defaultVariableName , this . defaultType _ ) , this . doValueUpdate _ ( a . getId ( ) ) ) } shouldAddBorderRect _ ( ) { const a = this . getSourceBlock ( ) ; if ( ! a ) throw new UnattachedFieldError$$module$build$src$core$field ;
return super . shouldAddBorderRect _ ( ) && ( ! this . getConstants ( ) . FIELD _DROPDOWN _NO _BORDER _RECT _SHADOW || "variables_get" !== a . type ) } fromXml ( a ) { var b = this . getSourceBlock ( ) ; if ( ! b ) throw new UnattachedFieldError$$module$build$src$core$field ; const c = a . getAttribute ( "id" ) , d = a . textContent , e = a . getAttribute ( "variabletype" ) || a . getAttribute ( "variableType" ) || "" ; b = getOrCreateVariablePackage$$module$build$src$core$variables ( b . workspace , c , d , e ) ; if ( null !== e && e !== b . type ) throw Error ( "Serialized variable type with id '" + b . getId ( ) +
"' had type " + b . type + ", and does not match variable field that references it: " + domToText$$module$build$src$core$xml ( a ) + "." ) ; this . setValue ( b . getId ( ) ) } toXml ( a ) { this . initModel ( ) ; a . id = this . variable _ . getId ( ) ; a . textContent = this . variable _ . name ; this . variable _ . type && a . setAttribute ( "variabletype" , this . variable _ . type ) ; return a } saveState ( a ) { var b = this . saveLegacyState ( FieldVariable$$module$build$src$core$field _variable ) ; if ( null !== b ) return b ; this . initModel ( ) ; b = { id : this . variable _ . getId ( ) } ; a && ( b . name = this . variable _ . name ,
b . type = this . variable _ . type ) ; return b } loadState ( a ) { const b = this . getSourceBlock ( ) ; if ( ! b ) throw new UnattachedFieldError$$module$build$src$core$field ; this . loadLegacyState ( FieldVariable$$module$build$src$core$field _variable , a ) || ( a = getOrCreateVariablePackage$$module$build$src$core$variables ( b . workspace , a . id || null , a . name , a . type || "" ) , this . setValue ( a . getId ( ) ) ) } setSourceBlock ( a ) { if ( a . isShadow ( ) ) throw Error ( "Variable fields are not allowed to exist on shadow blocks." ) ; super . setSourceBlock ( a ) } getValue ( ) { return this . variable _ ?
this . variable _ . getId ( ) : null } getText ( ) { return this . variable _ ? this . variable _ . name : "" } getVariable ( ) { return this . variable _ } getValidator ( ) { return this . variable _ ? this . validator _ : null } doClassValidation _ ( a ) { if ( null === a ) return null ; var b = this . getSourceBlock ( ) ; if ( ! b ) throw new UnattachedFieldError$$module$build$src$core$field ; b = getVariable$$module$build$src$core$variables ( b . workspace , a ) ; if ( ! b ) return console . warn ( "Variable id doesn't point to a real variable! ID was " + a ) , null ; b = b . type ; return this . typeIsAllowed _ ( b ) ?
a : ( console . warn ( "Variable type doesn't match this field! Type was " + b ) , null ) } doValueUpdate _ ( a ) { const b = this . getSourceBlock ( ) ; if ( ! b ) throw new UnattachedFieldError$$module$build$src$core$field ; this . variable _ = getVariable$$module$build$src$core$variables ( b . workspace , a ) ; super . doValueUpdate _ ( a ) } typeIsAllowed _ ( a ) { const b = this . getVariableTypes _ ( ) ; if ( ! b ) return ! 0 ; for ( let c = 0 ; c < b . length ; c ++ ) if ( a === b [ c ] ) return ! 0 ; return ! 1 } getVariableTypes _ ( ) { var a = this . variableTypes ; if ( null === a && this . sourceBlock _ && ! this . sourceBlock _ . isDeadOrDying ( ) ) return this . sourceBlock _ . workspace . getVariableTypes ( ) ;
a = a || [ "" ] ; if ( 0 === a . length ) throw a = this . getText ( ) , Error ( "'variableTypes' of field variable " + a + " was an empty list" ) ; return a } setTypes _ ( a , b ) { b = b || "" ; if ( null === a || void 0 === a ) a = null ; else if ( Array . isArray ( a ) ) { let c = ! 1 ; for ( let d = 0 ; d < a . length ; d ++ ) a [ d ] === b && ( c = ! 0 ) ; if ( ! c ) throw Error ( "Invalid default type '" + b + "' in the definition of a FieldVariable" ) ; } else throw Error ( "'variableTypes' was not an array in the definition of a FieldVariable" ) ; this . defaultType _ = b ; this . variableTypes = a } refreshVariableName ( ) { this . forceRerender ( ) } onItemSelected _ ( a ,
b ) { a = b . getValue ( ) ; if ( this . sourceBlock _ && ! this . sourceBlock _ . isDeadOrDying ( ) ) { if ( a === RENAME _VARIABLE _ID$$module$build$src$core$internal _constants ) { renameVariable$$module$build$src$core$variables ( this . sourceBlock _ . workspace , this . variable _ ) ; return } if ( a === DELETE _VARIABLE _ID$$module$build$src$core$internal _constants ) { this . sourceBlock _ . workspace . deleteVariableById ( this . variable _ . getId ( ) ) ; return } } this . setValue ( a ) } referencesVariables ( ) { return ! 0 } static fromJson ( a ) { return new this ( replaceMessageReferences$$module$build$src$core$utils$parsing ( a . variable ) ,
void 0 , void 0 , void 0 , a ) } static dropdownCreate ( ) { if ( ! this . variable _ ) throw Error ( "Tried to call dropdownCreate on a variable field with no variable selected." ) ; const a = this . getText ( ) ; let b = [ ] ; if ( this . sourceBlock _ && ! this . sourceBlock _ . isDeadOrDying ( ) ) { var c = this . getVariableTypes _ ( ) ; for ( var d = 0 ; d < c . length ; d ++ ) { const e = this . sourceBlock _ . workspace . getVariablesOfType ( c [ d ] ) ; b = b . concat ( e ) } } b . sort ( VariableModel$$module$build$src$core$variable _model . compareByName ) ; c = [ ] ; for ( d = 0 ; d < b . length ; d ++ ) c [ d ] = [ b [ d ] . name ,
b [ d ] . getId ( ) ] ; c . push ( [ Msg$$module$build$src$core$msg . RENAME _VARIABLE , RENAME _VARIABLE _ID$$module$build$src$core$internal _constants ] ) ; Msg$$module$build$src$core$msg . DELETE _VARIABLE && c . push ( [ Msg$$module$build$src$core$msg . DELETE _VARIABLE . replace ( "%1" , a ) , DELETE _VARIABLE _ID$$module$build$src$core$internal _constants ] ) ; return c } } ; register$$module$build$src$core$field _registry ( "field_variable" , FieldVariable$$module$build$src$core$field _variable ) ; var module$build$src$core$field _variable = { } ;
module$build$src$core$field _variable . FieldVariable = FieldVariable$$module$build$src$core$field _variable ; var FieldNumber$$module$build$src$core$field _number = class extends $ . FieldTextInput$$module$build$src$core$field _textinput { constructor ( a , b , c , d , e , f ) { super ( Field$$module$build$src$core$field . SKIP _SETUP ) ; this . min _ = - Infinity ; this . max _ = Infinity ; this . precision _ = 0 ; this . decimalPlaces _ = null ; this . SERIALIZABLE = ! 0 ; a !== Field$$module$build$src$core$field . SKIP _SETUP && ( f ? this . configure _ ( f ) : this . setConstraints ( b , c , d ) , this . setValue ( a ) , e && this . setValidator ( e ) ) } configure _ ( a ) { super . configure _ ( a ) ; this . setMinInternal _ ( a . min ) ;
this . setMaxInternal _ ( a . max ) ; this . setPrecisionInternal _ ( a . precision ) } setConstraints ( a , b , c ) { this . setMinInternal _ ( a ) ; this . setMaxInternal _ ( b ) ; this . setPrecisionInternal _ ( c ) ; this . setValue ( this . getValue ( ) ) } setMin ( a ) { this . setMinInternal _ ( a ) ; this . setValue ( this . getValue ( ) ) } setMinInternal _ ( a ) { null == a ? this . min _ = - Infinity : ( a = Number ( a ) , isNaN ( a ) || ( this . min _ = a ) ) } getMin ( ) { return this . min _ } setMax ( a ) { this . setMaxInternal _ ( a ) ; this . setValue ( this . getValue ( ) ) } setMaxInternal _ ( a ) { null == a ? this . max _ = Infinity : ( a = Number ( a ) , isNaN ( a ) ||
( this . max _ = a ) ) } getMax ( ) { return this . max _ } setPrecision ( a ) { this . setPrecisionInternal _ ( a ) ; this . setValue ( this . getValue ( ) ) } setPrecisionInternal _ ( a ) { this . precision _ = Number ( a ) || 0 ; let b = String ( this . precision _ ) ; - 1 !== b . indexOf ( "e" ) && ( b = this . precision _ . toLocaleString ( "en-US" , { maximumFractionDigits : 20 } ) ) ; const c = b . indexOf ( "." ) ; this . decimalPlaces _ = - 1 === c ? a ? 0 : null : b . length - c - 1 } getPrecision ( ) { return this . precision _ } doClassValidation _ ( a ) { if ( null === a ) return null ; a = String ( a ) ; a = a . replace ( /O/ig , "0" ) ; a = a . replace ( /,/g ,
"" ) ; a = a . replace ( /infinity/i , "Infinity" ) ; a = Number ( a || 0 ) ; if ( isNaN ( a ) ) return null ; a = Math . min ( Math . max ( a , this . min _ ) , this . max _ ) ; this . precision _ && isFinite ( a ) && ( a = Math . round ( a / this . precision _ ) * this . precision _ ) ; null !== this . decimalPlaces _ && ( a = Number ( a . toFixed ( this . decimalPlaces _ ) ) ) ; return a } widgetCreate _ ( ) { const a = super . widgetCreate _ ( ) ; - Infinity < this . min _ && setState$$module$build$src$core$utils$aria ( a , State$$module$build$src$core$utils$aria . VALUEMIN , this . min _ ) ; Infinity > this . max _ && setState$$module$build$src$core$utils$aria ( a ,
State$$module$build$src$core$utils$aria . VALUEMAX , this . max _ ) ; return a } static fromJson ( a ) { return new this ( a . value , void 0 , void 0 , void 0 , void 0 , a ) } } ; register$$module$build$src$core$field _registry ( "field_number" , FieldNumber$$module$build$src$core$field _number ) ; FieldNumber$$module$build$src$core$field _number . prototype . DEFAULT _VALUE = 0 ; var module$build$src$core$field _number = { } ; module$build$src$core$field _number . FieldNumber = FieldNumber$$module$build$src$core$field _number ; var FieldMultilineInput$$module$build$src$core$field _multilineinput = class extends $ . FieldTextInput$$module$build$src$core$field _textinput { constructor ( a , b , c ) { super ( Field$$module$build$src$core$field . SKIP _SETUP ) ; this . textGroup _ = null ; this . maxLines _ = Infinity ; this . isOverflowedY _ = ! 1 ; a !== Field$$module$build$src$core$field . SKIP _SETUP && ( c && this . configure _ ( c ) , this . setValue ( a ) , b && this . setValidator ( b ) ) } configure _ ( a ) { super . configure _ ( a ) ; a . maxLines && this . setMaxLines ( a . maxLines ) } toXml ( a ) { a . textContent = this . getValue ( ) . replace ( /\n/g ,
" " ) ; return a } fromXml ( a ) { this . setValue ( a . textContent . replace ( / /g , "\n" ) ) } saveState ( ) { const a = this . saveLegacyState ( FieldMultilineInput$$module$build$src$core$field _multilineinput ) ; return null !== a ? a : this . getValue ( ) } loadState ( a ) { this . loadLegacyState ( Field$$module$build$src$core$field , a ) || this . setValue ( a ) } initView ( ) { this . createBorderRect _ ( ) ; this . textGroup _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . G , { "class" : "blocklyEditableText" } , this . fieldGroup _ ) } getDisplayText _ ( ) { const a =
this . getSourceBlock ( ) ; if ( ! a ) throw new UnattachedFieldError$$module$build$src$core$field ; let b = this . getText ( ) ; if ( ! b ) return Field$$module$build$src$core$field . NBSP ; const c = b . split ( "\n" ) ; b = "" ; const d = this . isOverflowedY _ ? this . maxLines _ : c . length ; for ( let e = 0 ; e < d ; e ++ ) { let f = c [ e ] ; f . length > this . maxDisplayLength ? f = f . substring ( 0 , this . maxDisplayLength - 4 ) + "..." : this . isOverflowedY _ && e === d - 1 && ( f = f . substring ( 0 , f . length - 3 ) + "..." ) ; f = f . replace ( /\s/g , Field$$module$build$src$core$field . NBSP ) ; b += f ; e !== d - 1 && ( b += "\n" ) } a . RTL &&
( b += "\u200f" ) ; return b } doValueUpdate _ ( a ) { super . doValueUpdate _ ( a ) ; this . isOverflowedY _ = this . value _ . split ( "\n" ) . length > this . maxLines _ } render _ ( ) { var a = this . getSourceBlock ( ) ; if ( ! a ) throw new UnattachedFieldError$$module$build$src$core$field ; for ( var b ; b = this . textGroup _ . firstChild ; ) this . textGroup _ . removeChild ( b ) ; b = this . getDisplayText _ ( ) . split ( "\n" ) ; let c = 0 ; for ( let d = 0 ; d < b . length ; d ++ ) { const e = this . getConstants ( ) . FIELD _TEXT _HEIGHT + this . getConstants ( ) . FIELD _BORDER _RECT _Y _PADDING ; createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . TEXT ,
{ "class" : "blocklyText blocklyMultilineText" , x : this . getConstants ( ) . FIELD _BORDER _RECT _X _PADDING , y : c + this . getConstants ( ) . FIELD _BORDER _RECT _Y _PADDING , dy : this . getConstants ( ) . FIELD _TEXT _BASELINE } , this . textGroup _ ) . appendChild ( document . createTextNode ( b [ d ] ) ) ; c += e } this . isBeingEdited _ && ( b = this . htmlInput _ , this . isOverflowedY _ ? addClass$$module$build$src$core$utils$dom ( b , "blocklyHtmlTextAreaInputOverflowedY" ) : removeClass$$module$build$src$core$utils$dom ( b , "blocklyHtmlTextAreaInputOverflowedY" ) ) ; this . updateSize _ ( ) ;
this . isBeingEdited _ && ( a . RTL ? setTimeout ( this . resizeEditor _ . bind ( this ) , 0 ) : this . resizeEditor _ ( ) , a = this . htmlInput _ , this . isTextValid _ ? ( removeClass$$module$build$src$core$utils$dom ( a , "blocklyInvalidInput" ) , setState$$module$build$src$core$utils$aria ( a , State$$module$build$src$core$utils$aria . INVALID , ! 1 ) ) : ( addClass$$module$build$src$core$utils$dom ( a , "blocklyInvalidInput" ) , setState$$module$build$src$core$utils$aria ( a , State$$module$build$src$core$utils$aria . INVALID , ! 0 ) ) ) } updateSize _ ( ) { var a = this . textGroup _ . childNodes ;
const b = this . getConstants ( ) . FIELD _TEXT _FONTSIZE , c = this . getConstants ( ) . FIELD _TEXT _FONTWEIGHT , d = this . getConstants ( ) . FIELD _TEXT _FONTFAMILY ; let e = 0 , f = 0 ; for ( var g = 0 ; g < a . length ; g ++ ) { var h = getFastTextWidth$$module$build$src$core$utils$dom ( a [ g ] , b , c , d ) ; h > e && ( e = h ) ; f += this . getConstants ( ) . FIELD _TEXT _HEIGHT + ( 0 < g ? this . getConstants ( ) . FIELD _BORDER _RECT _Y _PADDING : 0 ) } if ( this . isBeingEdited _ ) { a = this . value _ . split ( "\n" ) ; g = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . TEXT , { "class" : "blocklyText blocklyMultilineText" } ) ;
for ( h = 0 ; h < a . length ; h ++ ) { a [ h ] . length > this . maxDisplayLength && ( a [ h ] = a [ h ] . substring ( 0 , this . maxDisplayLength ) ) ; g . textContent = a [ h ] ; const k = getFastTextWidth$$module$build$src$core$utils$dom ( g , b , c , d ) ; k > e && ( e = k ) } e += this . htmlInput _ . offsetWidth - this . htmlInput _ . clientWidth } this . borderRect _ && ( f += 2 * this . getConstants ( ) . FIELD _BORDER _RECT _Y _PADDING , e += 2 * this . getConstants ( ) . FIELD _BORDER _RECT _X _PADDING , this . borderRect _ . setAttribute ( "width" , e ) , this . borderRect _ . setAttribute ( "height" , f ) ) ; this . size _ . width = e ; this . size _ . height =
f ; this . positionBorderRect _ ( ) } showEditor _ ( a , b ) { super . showEditor _ ( a , b ) ; this . forceRerender ( ) } widgetCreate _ ( ) { const a = getDiv$$module$build$src$core$widgetdiv ( ) , b = this . workspace _ . getScale ( ) , c = document . createElement ( "textarea" ) ; c . className = "blocklyHtmlInput blocklyHtmlTextAreaInput" ; c . setAttribute ( "spellcheck" , this . spellcheck _ ) ; var d = this . getConstants ( ) . FIELD _TEXT _FONTSIZE * b + "pt" ; a . style . fontSize = d ; c . style . fontSize = d ; c . style . borderRadius = $ . FieldTextInput$$module$build$src$core$field _textinput . BORDERRADIUS *
b + "px" ; d = this . getConstants ( ) . FIELD _BORDER _RECT _X _PADDING * b ; const e = this . getConstants ( ) . FIELD _BORDER _RECT _Y _PADDING * b / 2 ; c . style . padding = e + "px " + d + "px " + e + "px " + d + "px" ; d = this . getConstants ( ) . FIELD _TEXT _HEIGHT + this . getConstants ( ) . FIELD _BORDER _RECT _Y _PADDING ; c . style . lineHeight = d * b + "px" ; a . appendChild ( c ) ; c . value = c . defaultValue = this . getEditorText _ ( this . value _ ) ; c . setAttribute ( "data-untyped-default-value" , this . value _ ) ; c . setAttribute ( "data-old-value" , "" ) ; GECKO$$module$build$src$core$utils$useragent ? setTimeout ( this . resizeEditor _ . bind ( this ) ,
0 ) : this . resizeEditor _ ( ) ; this . bindInputEvents _ ( c ) ; return c } setMaxLines ( a ) { "number" === typeof a && 0 < a && a !== this . maxLines _ && ( this . maxLines _ = a , this . forceRerender ( ) ) } getMaxLines ( ) { return this . maxLines _ } onHtmlInputKeyDown _ ( a ) { if ( a . keyCode !== KeyCodes$$module$build$src$core$utils$keycodes . ENTER ) super . onHtmlInputKeyDown _ ( a ) } static fromJson ( a ) { return new this ( replaceMessageReferences$$module$build$src$core$utils$parsing ( a . text ) , void 0 , a ) } } ; register$$module$build$src$core$css ( "\n.blocklyHtmlTextAreaInput {\n font-family: monospace;\n resize: none;\n overflow: hidden;\n height: 100%;\n text-align: left;\n}\n\n.blocklyHtmlTextAreaInputOverflowedY {\n overflow-y: scroll;\n}\n" ) ;
register$$module$build$src$core$field _registry ( "field_multilinetext" , FieldMultilineInput$$module$build$src$core$field _multilineinput ) ; var module$build$src$core$field _multilineinput = { } ; module$build$src$core$field _multilineinput . FieldMultilineInput = FieldMultilineInput$$module$build$src$core$field _multilineinput ; var FieldLabelSerializable$$module$build$src$core$field _label _serializable = class extends $ . FieldLabel$$module$build$src$core$field _label { constructor ( a , b , c ) { super ( String ( null != a ? a : "" ) , b , c ) ; this . EDITABLE = ! 1 ; this . SERIALIZABLE = ! 0 } static fromJson ( a ) { return new this ( replaceMessageReferences$$module$build$src$core$utils$parsing ( a . text ) , void 0 , a ) } } ; register$$module$build$src$core$field _registry ( "field_label_serializable" , FieldLabelSerializable$$module$build$src$core$field _label _serializable ) ;
var module$build$src$core$field _label _serializable = { } ; module$build$src$core$field _label _serializable . FieldLabelSerializable = FieldLabelSerializable$$module$build$src$core$field _label _serializable ; var FieldColour$$module$build$src$core$field _colour = class extends Field$$module$build$src$core$field { constructor ( a , b , c ) { super ( Field$$module$build$src$core$field . SKIP _SETUP ) ; this . onKeyDownWrapper _ = this . onMouseLeaveWrapper _ = this . onMouseEnterWrapper _ = this . onMouseMoveWrapper _ = this . onClickWrapper _ = this . highlightedIndex _ = this . picker _ = null ; this . SERIALIZABLE = ! 0 ; this . CURSOR = "default" ; this . isDirty _ = ! 1 ; this . titles _ = this . colours _ = null ; this . columns _ = 0 ; a !== Field$$module$build$src$core$field . SKIP _SETUP && ( c && this . configure _ ( c ) ,
this . setValue ( a ) , b && this . setValidator ( b ) ) } configure _ ( a ) { super . configure _ ( a ) ; a . colourOptions && ( this . colours _ = a . colourOptions ) ; a . colourTitles && ( this . titles _ = a . colourTitles ) ; a . columns && ( this . columns _ = a . columns ) } initView ( ) { this . size _ = new Size$$module$build$src$core$utils$size ( this . getConstants ( ) . FIELD _COLOUR _DEFAULT _WIDTH , this . getConstants ( ) . FIELD _COLOUR _DEFAULT _HEIGHT ) ; this . getConstants ( ) . FIELD _COLOUR _FULL _BLOCK ? this . sourceBlock _ instanceof BlockSvg$$module$build$src$core$block _svg && ( this . clickTarget _ =
this . sourceBlock _ . getSvgRoot ( ) ) : ( this . createBorderRect _ ( ) , this . getBorderRect ( ) . style . fillOpacity = "1" ) } applyColour ( ) { this . getConstants ( ) . FIELD _COLOUR _FULL _BLOCK ? this . sourceBlock _ instanceof BlockSvg$$module$build$src$core$block _svg && ( this . sourceBlock _ . pathObject . svgPath . setAttribute ( "fill" , this . getValue ( ) ) , this . sourceBlock _ . pathObject . svgPath . setAttribute ( "stroke" , "#fff" ) ) : this . borderRect _ && ( this . borderRect _ . style . fill = this . getValue ( ) ) } doClassValidation _ ( a ) { return "string" !== typeof a ? null : parse$$module$build$src$core$utils$colour ( a ) } doValueUpdate _ ( a ) { this . value _ =
a ; this . borderRect _ ? this . borderRect _ . style . fill = a : this . sourceBlock _ && this . sourceBlock _ . rendered && this . sourceBlock _ instanceof BlockSvg$$module$build$src$core$block _svg && ( this . sourceBlock _ . pathObject . svgPath . setAttribute ( "fill" , a ) , this . sourceBlock _ . pathObject . svgPath . setAttribute ( "stroke" , "#fff" ) ) } getText ( ) { let a = this . value _ ; /^#(.)\1(.)\2(.)\3$/ . test ( a ) && ( a = "#" + a [ 1 ] + a [ 3 ] + a [ 5 ] ) ; return a } setColours ( a , b ) { this . colours _ = a ; b && ( this . titles _ = b ) ; return this } setColumns ( a ) { this . columns _ = a ; return this } showEditor _ ( ) { this . dropdownCreate _ ( ) ;
getContentDiv$$module$build$src$core$dropdowndiv ( ) . appendChild ( this . picker _ ) ; showPositionedByField$$module$build$src$core$dropdowndiv ( this , this . dropdownDispose _ . bind ( this ) ) ; this . picker _ . focus ( { preventScroll : ! 0 } ) } onClick _ ( a ) { a = ( a = a . target ) && a . getAttribute ( "data-colour" ) ; null !== a && ( this . setValue ( a ) , hideIfOwner$$module$build$src$core$dropdowndiv ( this ) ) } onKeyDown _ ( a ) { var b = ! 1 ; if ( a . keyCode === KeyCodes$$module$build$src$core$utils$keycodes . UP ) this . moveHighlightBy _ ( 0 , - 1 ) , b = ! 0 ; else if ( a . keyCode === KeyCodes$$module$build$src$core$utils$keycodes . DOWN ) this . moveHighlightBy _ ( 0 ,
1 ) , b = ! 0 ; else if ( a . keyCode === KeyCodes$$module$build$src$core$utils$keycodes . LEFT ) this . moveHighlightBy _ ( - 1 , 0 ) , b = ! 0 ; else if ( a . keyCode === KeyCodes$$module$build$src$core$utils$keycodes . RIGHT ) this . moveHighlightBy _ ( 1 , 0 ) , b = ! 0 ; else if ( a . keyCode === KeyCodes$$module$build$src$core$utils$keycodes . ENTER ) { if ( b = this . getHighlighted _ ( ) ) b = b && b . getAttribute ( "data-colour" ) , null !== b && this . setValue ( b ) ; hideWithoutAnimation$$module$build$src$core$dropdowndiv ( ) ; b = ! 0 } b && a . stopPropagation ( ) } moveHighlightBy _ ( a , b ) { if ( this . highlightedIndex _ ) { var c =
this . colours _ || FieldColour$$module$build$src$core$field _colour . COLOURS , d = this . columns _ || FieldColour$$module$build$src$core$field _colour . COLUMNS , e = this . highlightedIndex _ % d , f = Math . floor ( this . highlightedIndex _ / d ) ; e += a ; f += b ; 0 > a ? 0 > e && 0 < f ? ( e = d - 1 , f -- ) : 0 > e && ( e = 0 ) : 0 < a ? e > d - 1 && f < Math . floor ( c . length / d ) - 1 ? ( e = 0 , f ++ ) : e > d - 1 && e -- : 0 > b ? 0 > f && ( f = 0 ) : 0 < b && f > Math . floor ( c . length / d ) - 1 && ( f = Math . floor ( c . length / d ) - 1 ) ; this . setHighlightedCell _ ( this . picker _ . childNodes [ f ] . childNodes [ e ] , f * d + e ) } } onMouseMove _ ( a ) { const b = ( a = a . target ) &&
Number ( a . getAttribute ( "data-index" ) ) ; null !== b && b !== this . highlightedIndex _ && this . setHighlightedCell _ ( a , b ) } onMouseEnter _ ( ) { this . picker _ . focus ( { preventScroll : ! 0 } ) } onMouseLeave _ ( ) { this . picker _ . blur ( ) ; const a = this . getHighlighted _ ( ) ; a && removeClass$$module$build$src$core$utils$dom ( a , "blocklyColourHighlighted" ) } getHighlighted _ ( ) { if ( ! this . highlightedIndex _ ) return null ; const a = this . columns _ || FieldColour$$module$build$src$core$field _colour . COLUMNS , b = this . picker _ . childNodes [ Math . floor ( this . highlightedIndex _ /
a ) ] ; return b ? b . childNodes [ this . highlightedIndex _ % a ] : null } setHighlightedCell _ ( a , b ) { const c = this . getHighlighted _ ( ) ; c && removeClass$$module$build$src$core$utils$dom ( c , "blocklyColourHighlighted" ) ; addClass$$module$build$src$core$utils$dom ( a , "blocklyColourHighlighted" ) ; this . highlightedIndex _ = b ; setState$$module$build$src$core$utils$aria ( this . picker _ , State$$module$build$src$core$utils$aria . ACTIVEDESCENDANT , a . getAttribute ( "id" ) ) } dropdownCreate _ ( ) { const a = this . columns _ || FieldColour$$module$build$src$core$field _colour . COLUMNS ,
b = this . colours _ || FieldColour$$module$build$src$core$field _colour . COLOURS , c = this . titles _ || FieldColour$$module$build$src$core$field _colour . TITLES , d = this . getValue ( ) , e = document . createElement ( "table" ) ; e . className = "blocklyColourTable" ; e . tabIndex = 0 ; e . dir = "ltr" ; setRole$$module$build$src$core$utils$aria ( e , Role$$module$build$src$core$utils$aria . GRID ) ; setState$$module$build$src$core$utils$aria ( e , State$$module$build$src$core$utils$aria . EXPANDED , ! 0 ) ; setState$$module$build$src$core$utils$aria ( e , State$$module$build$src$core$utils$aria . ROWCOUNT ,
Math . floor ( b . length / a ) ) ; setState$$module$build$src$core$utils$aria ( e , State$$module$build$src$core$utils$aria . COLCOUNT , a ) ; let f ; for ( let g = 0 ; g < b . length ; g ++ ) { 0 === g % a && ( f = document . createElement ( "tr" ) , setRole$$module$build$src$core$utils$aria ( f , Role$$module$build$src$core$utils$aria . ROW ) , e . appendChild ( f ) ) ; const h = document . createElement ( "td" ) ; f . appendChild ( h ) ; h . setAttribute ( "data-colour" , b [ g ] ) ; h . title = c [ g ] || b [ g ] ; h . id = getNextUniqueId$$module$build$src$core$utils$idgenerator ( ) ; h . setAttribute ( "data-index" ,
g ) ; setRole$$module$build$src$core$utils$aria ( h , Role$$module$build$src$core$utils$aria . GRIDCELL ) ; setState$$module$build$src$core$utils$aria ( h , State$$module$build$src$core$utils$aria . LABEL , b [ g ] ) ; setState$$module$build$src$core$utils$aria ( h , State$$module$build$src$core$utils$aria . SELECTED , b [ g ] === d ) ; h . style . backgroundColor = b [ g ] ; b [ g ] === d && ( h . className = "blocklyColourSelected" , this . highlightedIndex _ = g ) } this . onClickWrapper _ = conditionalBind$$module$build$src$core$browser _events ( e , "click" , this , this . onClick _ ,
! 0 ) ; this . onMouseMoveWrapper _ = conditionalBind$$module$build$src$core$browser _events ( e , "mousemove" , this , this . onMouseMove _ , ! 0 ) ; this . onMouseEnterWrapper _ = conditionalBind$$module$build$src$core$browser _events ( e , "mouseenter" , this , this . onMouseEnter _ , ! 0 ) ; this . onMouseLeaveWrapper _ = conditionalBind$$module$build$src$core$browser _events ( e , "mouseleave" , this , this . onMouseLeave _ , ! 0 ) ; this . onKeyDownWrapper _ = conditionalBind$$module$build$src$core$browser _events ( e , "keydown" , this , this . onKeyDown _ ) ; this . picker _ = e } dropdownDispose _ ( ) { this . onClickWrapper _ &&
( unbind$$module$build$src$core$browser _events ( this . onClickWrapper _ ) , this . onClickWrapper _ = null ) ; this . onMouseMoveWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onMouseMoveWrapper _ ) , this . onMouseMoveWrapper _ = null ) ; this . onMouseEnterWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onMouseEnterWrapper _ ) , this . onMouseEnterWrapper _ = null ) ; this . onMouseLeaveWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . onMouseLeaveWrapper _ ) , this . onMouseLeaveWrapper _ = null ) ; this . onKeyDownWrapper _ &&
( unbind$$module$build$src$core$browser _events ( this . onKeyDownWrapper _ ) , this . onKeyDownWrapper _ = null ) ; this . highlightedIndex _ = this . picker _ = null } static fromJson ( a ) { return new this ( a . colour , void 0 , a ) } } ; FieldColour$$module$build$src$core$field _colour . COLOURS = "#ffffff #cccccc #c0c0c0 #999999 #666666 #333333 #000000 #ffcccc #ff6666 #ff0000 #cc0000 #990000 #660000 #330000 #ffcc99 #ff9966 #ff9900 #ff6600 #cc6600 #993300 #663300 #ffff99 #ffff66 #ffcc66 #ffcc33 #cc9933 #996633 #663333 #ffffcc #ffff33 #ffff00 #ffcc00 #999900 #666600 #333300 #99ff99 #66ff99 #33ff33 #33cc00 #009900 #006600 #003300 #99ffff #33ffff #66cccc #00cccc #339999 #336666 #003333 #ccffff #66ffff #33ccff #3366ff #3333ff #000099 #000066 #ccccff #9999ff #6666cc #6633ff #6600cc #333399 #330099 #ffccff #ff99ff #cc66cc #cc33cc #993399 #663366 #330033" . split ( " " ) ;
FieldColour$$module$build$src$core$field _colour . TITLES = [ ] ; FieldColour$$module$build$src$core$field _colour . COLUMNS = 7 ; FieldColour$$module$build$src$core$field _colour . prototype . DEFAULT _VALUE = FieldColour$$module$build$src$core$field _colour . COLOURS [ 0 ] ; register$$module$build$src$core$css ( "\n.blocklyColourTable {\n border-collapse: collapse;\n display: block;\n outline: none;\n padding: 1px;\n}\n\n.blocklyColourTable>tr>td {\n border: .5px solid #888;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-block;\n height: 20px;\n padding: 0;\n width: 20px;\n}\n\n.blocklyColourTable>tr>td.blocklyColourHighlighted {\n border-color: #eee;\n box-shadow: 2px 2px 7px 2px rgba(0,0,0,.3);\n position: relative;\n}\n\n.blocklyColourSelected, .blocklyColourSelected:hover {\n border-color: #eee !important;\n outline: 1px solid #333;\n position: relative;\n}\n" ) ;
register$$module$build$src$core$field _registry ( "field_colour" , FieldColour$$module$build$src$core$field _colour ) ; var module$build$src$core$field _colour = { } ; module$build$src$core$field _colour . FieldColour = FieldColour$$module$build$src$core$field _colour ; $ . FieldCheckbox$$module$build$src$core$field _checkbox = class extends Field$$module$build$src$core$field { constructor ( a , b , c ) { super ( Field$$module$build$src$core$field . SKIP _SETUP ) ; this . SERIALIZABLE = ! 0 ; this . CURSOR = "default" ; this . checkChar _ = $ . FieldCheckbox$$module$build$src$core$field _checkbox . CHECK _CHAR ; a !== Field$$module$build$src$core$field . SKIP _SETUP && ( c && this . configure _ ( c ) , this . setValue ( a ) , b && this . setValidator ( b ) ) } configure _ ( a ) { super . configure _ ( a ) ; a . checkCharacter && ( this . checkChar _ = a . checkCharacter ) } saveState ( ) { const a =
this . saveLegacyState ( $ . FieldCheckbox$$module$build$src$core$field _checkbox ) ; return null !== a ? a : this . getValueBoolean ( ) } initView ( ) { super . initView ( ) ; const a = this . getTextElement ( ) ; addClass$$module$build$src$core$utils$dom ( a , "blocklyCheckbox" ) ; a . style . display = this . value _ ? "block" : "none" } render _ ( ) { this . textContent _ && ( this . textContent _ . nodeValue = this . getDisplayText _ ( ) ) ; this . updateSize _ ( this . getConstants ( ) . FIELD _CHECKBOX _X _OFFSET ) } getDisplayText _ ( ) { return this . checkChar _ } setCheckCharacter ( a ) { this . checkChar _ =
a || $ . FieldCheckbox$$module$build$src$core$field _checkbox . CHECK _CHAR ; this . forceRerender ( ) } showEditor _ ( ) { this . setValue ( ! this . value _ ) } doClassValidation _ ( a ) { return ! 0 === a || "TRUE" === a ? "TRUE" : ! 1 === a || "FALSE" === a ? "FALSE" : null } doValueUpdate _ ( a ) { this . value _ = this . convertValueToBool _ ( a ) ; this . textElement _ && ( this . textElement _ . style . display = this . value _ ? "block" : "none" ) } getValue ( ) { return this . value _ ? "TRUE" : "FALSE" } getValueBoolean ( ) { return this . value _ } getText ( ) { return String ( this . convertValueToBool _ ( this . value _ ) ) } convertValueToBool _ ( a ) { return "string" ===
typeof a ? "TRUE" === a : ! ! a } static fromJson ( a ) { return new this ( a . checked , void 0 , a ) } } ; $ . FieldCheckbox$$module$build$src$core$field _checkbox . CHECK _CHAR = "\u2713" ; register$$module$build$src$core$field _registry ( "field_checkbox" , $ . FieldCheckbox$$module$build$src$core$field _checkbox ) ; $ . FieldCheckbox$$module$build$src$core$field _checkbox . prototype . DEFAULT _VALUE = ! 1 ; var module$build$src$core$field _checkbox = { } ; module$build$src$core$field _checkbox . FieldCheckbox = $ . FieldCheckbox$$module$build$src$core$field _checkbox ; var FieldAngle$$module$build$src$core$field _angle = class extends $ . FieldTextInput$$module$build$src$core$field _textinput { constructor ( a , b , c ) { super ( Field$$module$build$src$core$field . SKIP _SETUP ) ; this . moveSurfaceWrapper _ = this . clickSurfaceWrapper _ = this . clickWrapper _ = this . symbol _ = this . line _ = this . gauge _ = this . editor _ = null ; this . SERIALIZABLE = ! 0 ; this . clockwise _ = FieldAngle$$module$build$src$core$field _angle . CLOCKWISE ; this . offset _ = FieldAngle$$module$build$src$core$field _angle . OFFSET ; this . wrap _ = FieldAngle$$module$build$src$core$field _angle . WRAP ;
this . round _ = FieldAngle$$module$build$src$core$field _angle . ROUND ; a !== Field$$module$build$src$core$field . SKIP _SETUP && ( c && this . configure _ ( c ) , this . setValue ( a ) , b && this . setValidator ( b ) ) } configure _ ( a ) { super . configure _ ( a ) ; switch ( a . mode ) { case Mode$$module$build$src$core$field _angle . COMPASS : this . clockwise _ = ! 0 ; this . offset _ = 90 ; break ; case Mode$$module$build$src$core$field _angle . PROTRACTOR : this . clockwise _ = ! 1 , this . offset _ = 0 } a . clockwise && ( this . clockwise _ = a . clockwise ) ; a . offset && ( this . offset _ = a . offset ) ; a . wrap && ( this . wrap _ =
a . wrap ) ; a . round && ( this . round _ = a . round ) } initView ( ) { super . initView ( ) ; this . symbol _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . TSPAN , { } ) ; this . symbol _ . appendChild ( document . createTextNode ( "\u00b0" ) ) ; this . getTextElement ( ) . appendChild ( this . symbol _ ) } render _ ( ) { super . render _ ( ) ; this . updateGraph _ ( ) } showEditor _ ( a ) { super . showEditor _ ( a , MOBILE$$module$build$src$core$utils$useragent || ANDROID$$module$build$src$core$utils$useragent || IPAD$$module$build$src$core$utils$useragent ) ;
this . dropdownCreate _ ( ) ; getContentDiv$$module$build$src$core$dropdowndiv ( ) . appendChild ( this . editor _ ) ; if ( this . sourceBlock _ instanceof BlockSvg$$module$build$src$core$block _svg ) { if ( ! this . sourceBlock _ . style . colourTertiary ) throw Error ( "The renderer did not properly initialize the block style" ) ; setColour$$module$build$src$core$dropdowndiv ( this . sourceBlock _ . style . colourPrimary , this . sourceBlock _ . style . colourTertiary ) } showPositionedByField$$module$build$src$core$dropdowndiv ( this , this . dropdownDispose _ . bind ( this ) ) ;
this . updateGraph _ ( ) } dropdownCreate _ ( ) { const a = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . SVG , { xmlns : SVG _NS$$module$build$src$core$utils$dom , "xmlns:html" : HTML _NS$$module$build$src$core$utils$dom , "xmlns:xlink" : XLINK _NS$$module$build$src$core$utils$dom , version : "1.1" , height : 2 * FieldAngle$$module$build$src$core$field _angle . HALF + "px" , width : 2 * FieldAngle$$module$build$src$core$field _angle . HALF + "px" , style : "touch-action: none" } ) , b = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . CIRCLE ,
{ cx : FieldAngle$$module$build$src$core$field _angle . HALF , cy : FieldAngle$$module$build$src$core$field _angle . HALF , r : FieldAngle$$module$build$src$core$field _angle . RADIUS , "class" : "blocklyAngleCircle" } , a ) ; this . gauge _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . PATH , { "class" : "blocklyAngleGauge" } , a ) ; this . line _ = createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . LINE , { x1 : FieldAngle$$module$build$src$core$field _angle . HALF , y1 : FieldAngle$$module$build$src$core$field _angle . HALF ,
"class" : "blocklyAngleLine" } , a ) ; for ( let c = 0 ; 360 > c ; c += 15 ) createSvgElement$$module$build$src$core$utils$dom ( Svg$$module$build$src$core$utils$svg . LINE , { x1 : FieldAngle$$module$build$src$core$field _angle . HALF + FieldAngle$$module$build$src$core$field _angle . RADIUS , y1 : FieldAngle$$module$build$src$core$field _angle . HALF , x2 : FieldAngle$$module$build$src$core$field _angle . HALF + FieldAngle$$module$build$src$core$field _angle . RADIUS - ( 0 === c % 45 ? 10 : 5 ) , y2 : FieldAngle$$module$build$src$core$field _angle . HALF , "class" : "blocklyAngleMarks" ,
transform : "rotate(" + c + "," + FieldAngle$$module$build$src$core$field _angle . HALF + "," + FieldAngle$$module$build$src$core$field _angle . HALF + ")" } , a ) ; this . clickWrapper _ = conditionalBind$$module$build$src$core$browser _events ( a , "click" , this , this . hide _ ) ; this . clickSurfaceWrapper _ = conditionalBind$$module$build$src$core$browser _events ( b , "click" , this , this . onMouseMove _ , ! 0 , ! 0 ) ; this . moveSurfaceWrapper _ = conditionalBind$$module$build$src$core$browser _events ( b , "mousemove" , this , this . onMouseMove _ , ! 0 , ! 0 ) ; this . editor _ = a } dropdownDispose _ ( ) { this . clickWrapper _ &&
( unbind$$module$build$src$core$browser _events ( this . clickWrapper _ ) , this . clickWrapper _ = null ) ; this . clickSurfaceWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . clickSurfaceWrapper _ ) , this . clickSurfaceWrapper _ = null ) ; this . moveSurfaceWrapper _ && ( unbind$$module$build$src$core$browser _events ( this . moveSurfaceWrapper _ ) , this . moveSurfaceWrapper _ = null ) ; this . line _ = this . gauge _ = null } hide _ ( ) { hideIfOwner$$module$build$src$core$dropdowndiv ( this ) ; hide$$module$build$src$core$widgetdiv ( ) } onMouseMove _ ( a ) { var b =
this . gauge _ . ownerSVGElement . getBoundingClientRect ( ) ; const c = a . clientX - b . left - FieldAngle$$module$build$src$core$field _angle . HALF ; a = a . clientY - b . top - FieldAngle$$module$build$src$core$field _angle . HALF ; b = Math . atan ( - a / c ) ; isNaN ( b ) || ( b = toDegrees$$module$build$src$core$utils$math ( b ) , 0 > c ? b += 180 : 0 < a && ( b += 360 ) , b = this . clockwise _ ? this . offset _ + 360 - b : 360 - ( this . offset _ - b ) , this . displayMouseOrKeyboardValue _ ( b ) ) } displayMouseOrKeyboardValue _ ( a ) { this . round _ && ( a = Math . round ( a / this . round _ ) * this . round _ ) ; a = this . wrapValue _ ( a ) ;
a !== this . value _ && this . setEditorValue _ ( a ) } updateGraph _ ( ) { if ( this . gauge _ ) { var a = Number ( this . getText ( ) ) + this . offset _ , b = toRadians$$module$build$src$core$utils$math ( a % 360 ) ; a = [ "M " , FieldAngle$$module$build$src$core$field _angle . HALF , "," , FieldAngle$$module$build$src$core$field _angle . HALF ] ; var c = FieldAngle$$module$build$src$core$field _angle . HALF , d = FieldAngle$$module$build$src$core$field _angle . HALF ; if ( ! isNaN ( b ) ) { const e = Number ( this . clockwise _ ) , f = toRadians$$module$build$src$core$utils$math ( this . offset _ ) , g = Math . cos ( f ) *
FieldAngle$$module$build$src$core$field _angle . RADIUS , h = Math . sin ( f ) * - FieldAngle$$module$build$src$core$field _angle . RADIUS ; e && ( b = 2 * f - b ) ; c += Math . cos ( b ) * FieldAngle$$module$build$src$core$field _angle . RADIUS ; d -= Math . sin ( b ) * FieldAngle$$module$build$src$core$field _angle . RADIUS ; b = Math . abs ( Math . floor ( ( b - f ) / Math . PI ) % 2 ) ; e && ( b = 1 - b ) ; a . push ( " l " , g , "," , h , " A " , FieldAngle$$module$build$src$core$field _angle . RADIUS , "," , FieldAngle$$module$build$src$core$field _angle . RADIUS , " 0 " , b , " " , e , " " , c , "," , d , " z" ) } this . gauge _ . setAttribute ( "d" ,
a . join ( "" ) ) ; this . line _ . setAttribute ( "x2" , c ) ; this . line _ . setAttribute ( "y2" , d ) } } onHtmlInputKeyDown _ ( a ) { super . onHtmlInputKeyDown _ ( a ) ; var b = this . getSourceBlock ( ) ; if ( ! b ) throw new UnattachedFieldError$$module$build$src$core$field ; let c ; a . keyCode === KeyCodes$$module$build$src$core$utils$keycodes . LEFT ? c = b . RTL ? 1 : - 1 : a . keyCode === KeyCodes$$module$build$src$core$utils$keycodes . RIGHT ? c = b . RTL ? - 1 : 1 : a . keyCode === KeyCodes$$module$build$src$core$utils$keycodes . DOWN ? c = - 1 : a . keyCode === KeyCodes$$module$build$src$core$utils$keycodes . UP &&
( c = 1 ) ; c && ( b = this . getValue ( ) , this . displayMouseOrKeyboardValue _ ( b + c * this . round _ ) , a . preventDefault ( ) , a . stopPropagation ( ) ) } doClassValidation _ ( a ) { a = Number ( a ) ; return isNaN ( a ) || ! isFinite ( a ) ? null : this . wrapValue _ ( a ) } wrapValue _ ( a ) { a %= 360 ; 0 > a && ( a += 360 ) ; a > this . wrap _ && ( a -= 360 ) ; return a } static fromJson ( a ) { return new this ( a . angle , void 0 , a ) } } ; FieldAngle$$module$build$src$core$field _angle . ROUND = 15 ; FieldAngle$$module$build$src$core$field _angle . HALF = 50 ; FieldAngle$$module$build$src$core$field _angle . CLOCKWISE = ! 1 ;
FieldAngle$$module$build$src$core$field _angle . OFFSET = 0 ; FieldAngle$$module$build$src$core$field _angle . WRAP = 360 ; FieldAngle$$module$build$src$core$field _angle . RADIUS = FieldAngle$$module$build$src$core$field _angle . HALF - 1 ; register$$module$build$src$core$css ( "\n.blocklyAngleCircle {\n stroke: #444;\n stroke-width: 1;\n fill: #ddd;\n fill-opacity: .8;\n}\n\n.blocklyAngleMarks {\n stroke: #444;\n stroke-width: 1;\n}\n\n.blocklyAngleGauge {\n fill: #f88;\n fill-opacity: .8;\n pointer-events: none;\n}\n\n.blocklyAngleLine {\n stroke: #f00;\n stroke-width: 2;\n stroke-linecap: round;\n pointer-events: none;\n}\n" ) ;
register$$module$build$src$core$field _registry ( "field_angle" , FieldAngle$$module$build$src$core$field _angle ) ; FieldAngle$$module$build$src$core$field _angle . prototype . DEFAULT _VALUE = 0 ; var Mode$$module$build$src$core$field _angle ; ( function ( a ) { a . COMPASS = "compass" ; a . PROTRACTOR = "protractor" } ) ( Mode$$module$build$src$core$field _angle || ( Mode$$module$build$src$core$field _angle = { } ) ) ; var module$build$src$core$field _angle = { } ; module$build$src$core$field _angle . FieldAngle = FieldAngle$$module$build$src$core$field _angle ;
module$build$src$core$field _angle . Mode = Mode$$module$build$src$core$field _angle ; var BlockMove$$module$build$src$core$events$events _block _move = class extends BlockBase$$module$build$src$core$events$events _block _base { constructor ( a ) { super ( a ) ; this . type = MOVE$$module$build$src$core$events$utils ; a && ( a . isShadow ( ) && ( this . recordUndo = ! 1 ) , a = this . currentLocation _ ( ) , this . oldParentId = a . parentId , this . oldInputName = a . inputName , this . oldCoordinate = a . coordinate ) } toJson ( ) { const a = super . toJson ( ) ; a . newParentId = this . newParentId ; a . newInputName = this . newInputName ; this . newCoordinate && ( a . newCoordinate = ` ${ Math . round ( this . newCoordinate . x ) } , ` +
` ${ Math . round ( this . newCoordinate . y ) } ` ) ; this . recordUndo || ( a . recordUndo = this . recordUndo ) ; return a } fromJson ( a ) { super . fromJson ( a ) ; this . newParentId = a . newParentId ; this . newInputName = a . newInputName ; if ( a . newCoordinate ) { const b = a . newCoordinate . split ( "," ) ; this . newCoordinate = new Coordinate$$module$build$src$core$utils$coordinate ( Number ( b [ 0 ] ) , Number ( b [ 1 ] ) ) } void 0 !== a . recordUndo && ( this . recordUndo = a . recordUndo ) } recordNew ( ) { const a = this . currentLocation _ ( ) ; this . newParentId = a . parentId ; this . newInputName = a . inputName ;
this . newCoordinate = a . coordinate } currentLocation _ ( ) { var a = this . getEventWorkspace _ ( ) ; if ( ! this . blockId ) throw Error ( "The block ID is undefined. Either pass a block to the constructor, or call fromJson" ) ; var b = a . getBlockById ( this . blockId ) ; if ( ! b ) throw Error ( "The block associated with the block move event could not be found" ) ; a = { } ; const c = b . getParent ( ) ; if ( c ) { if ( a . parentId = c . id , b = c . getInputWithBlock ( b ) ) a . inputName = b . name } else a . coordinate = b . getRelativeToSurfaceXY ( ) ; return a } isNull ( ) { return this . oldParentId ===
this . newParentId && this . oldInputName === this . newInputName && Coordinate$$module$build$src$core$utils$coordinate . equals ( this . oldCoordinate , this . newCoordinate ) } 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" ) ; var c = b . getBlockById ( this . blockId ) ; if ( c ) { var d = a ? this . newParentId : this . oldParentId , e = a ? this . newInputName : this . oldInputName ; a = a ? this . newCoordinate : this . oldCoordinate ; if ( d ) { var f = b . getBlockById ( d ) ;
if ( ! f ) { console . warn ( "Can't connect to non-existent block: " + d ) ; return } } c . getParent ( ) && c . unplug ( ) ; if ( a ) e = c . getRelativeToSurfaceXY ( ) , c . moveBy ( a . x - e . x , a . y - e . y ) ; else { b = c . outputConnection ; if ( ! b || c . previousConnection && c . previousConnection . isConnected ( ) ) b = c . previousConnection ; let g ; c = b . type ; if ( e ) { if ( c = f . getInput ( e ) ) g = c . connection } else c === ConnectionType$$module$build$src$core$connection _type . PREVIOUS _STATEMENT && ( g = f . nextConnection ) ; g ? b . connect ( g ) : console . warn ( "Can't connect to non-existent input: " + e ) } } else console . warn ( "Can't move non-existent block: " +
this . blockId ) } } ; register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . EVENT , MOVE$$module$build$src$core$events$utils , BlockMove$$module$build$src$core$events$events _block _move ) ; var module$build$src$core$events$events _block _move = { } ; module$build$src$core$events$events _block _move . BlockMove = BlockMove$$module$build$src$core$events$events _block _move ; var CommentBase$$module$build$src$core$events$events _comment _base = class extends Abstract$$module$build$src$core$events$events _abstract { constructor ( a ) { super ( ) ; this . isBlank = ! a ; a && ( this . commentId = a . id , this . workspaceId = a . workspace . id , this . group = getGroup$$module$build$src$core$events$utils ( ) , this . recordUndo = getRecordUndo$$module$build$src$core$events$utils ( ) ) } toJson ( ) { const a = super . toJson ( ) ; if ( ! this . commentId ) throw Error ( "The comment ID is undefined. Either pass a comment to the constructor, or call fromJson" ) ;
a . commentId = this . commentId ; return a } fromJson ( a ) { super . fromJson ( a ) ; this . commentId = a . commentId } static CommentCreateDeleteHelper ( a , b ) { var c = a . getEventWorkspace _ ( ) ; if ( b ) { b = createElement$$module$build$src$core$utils$xml ( "xml" ) ; if ( ! a . xml ) throw Error ( "Ecountered a comment event without proper xml" ) ; b . appendChild ( a . xml ) ; domToWorkspace$$module$build$src$core$xml ( b , c ) } else { if ( ! a . commentId ) throw Error ( "The comment ID is undefined. Either pass a comment to the constructor, or call fromJson" ) ; ( c = c . getCommentById ( a . commentId ) ) ?
c . dispose ( ) : console . warn ( "Can't uncreate non-existent comment: " + a . commentId ) } } } , module$build$src$core$events$events _comment _base = { } ; module$build$src$core$events$events _comment _base . CommentBase = CommentBase$$module$build$src$core$events$events _comment _base ; var CommentChange$$module$build$src$core$events$events _comment _change = class extends CommentBase$$module$build$src$core$events$events _comment _base { constructor ( a , b , c ) { super ( a ) ; this . type = COMMENT _CHANGE$$module$build$src$core$events$utils ; a && ( this . oldContents _ = "undefined" === typeof b ? "" : b , this . newContents _ = "undefined" === typeof c ? "" : c ) } toJson ( ) { const a = super . toJson ( ) ; if ( ! this . oldContents _ ) throw Error ( "The old contents is undefined. Either pass a value to the constructor, or call fromJson" ) ; if ( ! this . newContents _ ) throw Error ( "The new contents is undefined. Either pass a value to the constructor, or call fromJson" ) ;
a . oldContents = this . oldContents _ ; a . newContents = this . newContents _ ; return a } fromJson ( a ) { super . fromJson ( a ) ; this . oldContents _ = a . oldContents ; this . newContents _ = a . newContents } isNull ( ) { return this . oldContents _ === this . newContents _ } run ( a ) { var b = this . getEventWorkspace _ ( ) ; if ( ! this . commentId ) throw Error ( "The comment ID is undefined. Either pass a comment to the constructor, or call fromJson" ) ; if ( b = b . getCommentById ( this . commentId ) ) { var c = a ? this . newContents _ : this . oldContents _ ; if ( ! c ) { if ( a ) throw Error ( "The new contents is undefined. Either pass a value to the constructor, or call fromJson" ) ;
throw Error ( "The old contents is undefined. Either pass a value to the constructor, or call fromJson" ) ; } b . setContent ( c ) } else console . warn ( "Can't change non-existent comment: " + this . commentId ) } } ; register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . EVENT , COMMENT _CHANGE$$module$build$src$core$events$utils , CommentChange$$module$build$src$core$events$events _comment _change ) ; var module$build$src$core$events$events _comment _change = { } ;
module$build$src$core$events$events _comment _change . CommentChange = CommentChange$$module$build$src$core$events$events _comment _change ; var CommentCreate$$module$build$src$core$events$events _comment _create = class extends CommentBase$$module$build$src$core$events$events _comment _base { constructor ( a ) { super ( a ) ; this . type = COMMENT _CREATE$$module$build$src$core$events$utils ; a && ( this . xml = a . toXmlWithXY ( ) ) } toJson ( ) { const a = super . toJson ( ) ; if ( ! this . xml ) throw Error ( "The comment XML is undefined. Either pass a comment to the constructor, or call fromJson" ) ; a . xml = domToText$$module$build$src$core$xml ( this . xml ) ; return a } fromJson ( a ) { super . fromJson ( a ) ;
this . xml = textToDom$$module$build$src$core$xml ( a . xml ) } run ( a ) { CommentBase$$module$build$src$core$events$events _comment _base . CommentCreateDeleteHelper ( this , a ) } } ; register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . EVENT , COMMENT _CREATE$$module$build$src$core$events$utils , CommentCreate$$module$build$src$core$events$events _comment _create ) ; var module$build$src$core$events$events _comment _create = { } ; module$build$src$core$events$events _comment _create . CommentCreate = CommentCreate$$module$build$src$core$events$events _comment _create ; var CommentDelete$$module$build$src$core$events$events _comment _delete = class extends CommentBase$$module$build$src$core$events$events _comment _base { constructor ( a ) { super ( a ) ; this . type = COMMENT _DELETE$$module$build$src$core$events$utils ; a && ( this . xml = a . toXmlWithXY ( ) ) } run ( a ) { CommentBase$$module$build$src$core$events$events _comment _base . CommentCreateDeleteHelper ( this , ! a ) } } ;
register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . EVENT , COMMENT _DELETE$$module$build$src$core$events$utils , CommentDelete$$module$build$src$core$events$events _comment _delete ) ; var module$build$src$core$events$events _comment _delete = { } ; module$build$src$core$events$events _comment _delete . CommentDelete = CommentDelete$$module$build$src$core$events$events _comment _delete ; var CommentMove$$module$build$src$core$events$events _comment _move = class extends CommentBase$$module$build$src$core$events$events _comment _base { constructor ( a ) { super ( a ) ; this . type = COMMENT _MOVE$$module$build$src$core$events$utils ; a && ( this . comment _ = a , this . oldCoordinate _ = a . getXY ( ) ) } recordNew ( ) { if ( this . newCoordinate _ ) throw Error ( "Tried to record the new position of a comment on the same event twice." ) ; if ( ! this . comment _ ) throw Error ( "The comment is undefined. Pass a comment to the constructor if you want to use the record functionality" ) ;
this . newCoordinate _ = this . comment _ . getXY ( ) } setOldCoordinate ( a ) { this . oldCoordinate _ = a } toJson ( ) { const a = super . toJson ( ) ; if ( ! this . oldCoordinate _ ) throw Error ( "The old comment position is undefined. Either pass a comment to the constructor, or call fromJson" ) ; if ( ! this . newCoordinate _ ) throw Error ( "The new comment position is undefined. Either call recordNew, or call fromJson" ) ; a . oldCoordinate = ` ${ Math . round ( this . oldCoordinate _ . x ) } , ` + ` ${ Math . round ( this . oldCoordinate _ . y ) } ` ; a . newCoordinate = Math . round ( this . newCoordinate _ . x ) +
"," + Math . round ( this . newCoordinate _ . y ) ; return a } fromJson ( a ) { super . fromJson ( a ) ; let b = a . oldCoordinate . split ( "," ) ; this . oldCoordinate _ = new Coordinate$$module$build$src$core$utils$coordinate ( Number ( b [ 0 ] ) , Number ( b [ 1 ] ) ) ; b = a . newCoordinate . split ( "," ) ; this . newCoordinate _ = new Coordinate$$module$build$src$core$utils$coordinate ( Number ( b [ 0 ] ) , Number ( b [ 1 ] ) ) } isNull ( ) { return Coordinate$$module$build$src$core$utils$coordinate . equals ( this . oldCoordinate _ , this . newCoordinate _ ) } run ( a ) { var b = this . getEventWorkspace _ ( ) ; if ( ! this . commentId ) throw Error ( "The comment ID is undefined. Either pass a comment to the constructor, or call fromJson" ) ;
if ( b = b . getCommentById ( this . commentId ) ) { a = a ? this . newCoordinate _ : this . oldCoordinate _ ; if ( ! a ) throw Error ( "Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson" ) ; var c = b . getXY ( ) ; b . moveBy ( a . x - c . x , a . y - c . y ) } else console . warn ( "Can't move non-existent comment: " + this . commentId ) } } ; register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . EVENT , COMMENT _MOVE$$module$build$src$core$events$utils , CommentMove$$module$build$src$core$events$events _comment _move ) ;
var module$build$src$core$events$events _comment _move = { } ; module$build$src$core$events$events _comment _move . CommentMove = CommentMove$$module$build$src$core$events$events _comment _move ; var BlockDrag$$module$build$src$core$events$events _block _drag = class extends UiBase$$module$build$src$core$events$events _ui _base { constructor ( a , b , c ) { super ( a ? a . workspace . id : void 0 ) ; this . type = BLOCK _DRAG$$module$build$src$core$events$utils ; a && ( this . blockId = a . id , this . isStart = b , this . blocks = c ) } toJson ( ) { const a = super . toJson ( ) ; if ( void 0 === this . isStart ) throw Error ( "Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson" ) ; if ( void 0 === this . blockId ) throw Error ( "The block ID is undefined. Either pass a block to the constructor, or call fromJson" ) ;
a . isStart = this . isStart ; a . blockId = this . blockId ; a . blocks = this . blocks ; return a } fromJson ( a ) { super . fromJson ( a ) ; this . isStart = a . isStart ; this . blockId = a . blockId ; this . blocks = a . blocks } } ; register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . EVENT , BLOCK _DRAG$$module$build$src$core$events$utils , BlockDrag$$module$build$src$core$events$events _block _drag ) ; var module$build$src$core$events$events _block _drag = { } ; module$build$src$core$events$events _block _drag . BlockDrag = BlockDrag$$module$build$src$core$events$events _block _drag ; var Ui$$module$build$src$core$events$events _ui = class extends UiBase$$module$build$src$core$events$events _ui _base { constructor ( a , b , c , d ) { super ( a ? a . workspace . id : void 0 ) ; this . type = UI$$module$build$src$core$events$utils ; this . blockId = a ? a . id : null ; this . element = "undefined" === typeof b ? "" : b ; this . oldValue = "undefined" === typeof c ? "" : c ; this . newValue = "undefined" === typeof d ? "" : d } toJson ( ) { const a = super . toJson ( ) ; a . element = this . element ; void 0 !== this . newValue && ( a . newValue = this . newValue ) ; this . blockId && ( a . blockId = this . blockId ) ;
return a } fromJson ( a ) { super . fromJson ( a ) ; this . element = a . element ; this . newValue = a . newValue ; this . blockId = a . blockId } } ; register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . EVENT , UI$$module$build$src$core$events$utils , Ui$$module$build$src$core$events$events _ui ) ; var module$build$src$core$events$events _ui = { } ; module$build$src$core$events$events _ui . Ui = Ui$$module$build$src$core$events$events _ui ; var FinishedLoading$$module$build$src$core$events$workspace _events = class extends Abstract$$module$build$src$core$events$events _abstract { constructor ( a ) { super ( ) ; this . isBlank = ! 0 ; this . recordUndo = ! 1 ; this . type = FINISHED _LOADING$$module$build$src$core$events$utils ; this . isBlank = ! ! a ; a && ( this . workspaceId = a . id ) } toJson ( ) { const a = super . toJson ( ) ; if ( ! this . workspaceId ) throw Error ( "The workspace ID is undefined. Either pass a workspace to the constructor, or call fromJson" ) ; a . workspaceId = this . workspaceId ; return a } fromJson ( a ) { super . fromJson ( a ) ;
this . workspaceId = a . workspaceId } } ; register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . EVENT , FINISHED _LOADING$$module$build$src$core$events$utils , FinishedLoading$$module$build$src$core$events$workspace _events ) ; var module$build$src$core$events$workspace _events = { } ; module$build$src$core$events$workspace _events . FinishedLoading = FinishedLoading$$module$build$src$core$events$workspace _events ; var Abstract$$module$build$src$core$events$events , BLOCK _CHANGE$$module$build$src$core$events$events , BLOCK _CREATE$$module$build$src$core$events$events , BLOCK _DELETE$$module$build$src$core$events$events , BLOCK _DRAG$$module$build$src$core$events$events , BLOCK _MOVE$$module$build$src$core$events$events , BUBBLE _OPEN$$module$build$src$core$events$events , BUMP _EVENTS$$module$build$src$core$events$events , CHANGE$$module$build$src$core$events$events , CLICK$$module$build$src$core$events$events , COMMENT _CHANGE$$module$build$src$core$events$events ,
COMMENT _CREATE$$module$build$src$core$events$events , COMMENT _DELETE$$module$build$src$core$events$events , COMMENT _MOVE$$module$build$src$core$events$events , CREATE$$module$build$src$core$events$events , DELETE$$module$build$src$core$events$events , FINISHED _LOADING$$module$build$src$core$events$events , MARKER _MOVE$$module$build$src$core$events$events , MOVE$$module$build$src$core$events$events , SELECTED$$module$build$src$core$events$events , THEME _CHANGE$$module$build$src$core$events$events , TOOLBOX _ITEM _SELECT$$module$build$src$core$events$events ,
TRASHCAN _OPEN$$module$build$src$core$events$events , UI$$module$build$src$core$events$events , VAR _CREATE$$module$build$src$core$events$events , VAR _DELETE$$module$build$src$core$events$events , VAR _RENAME$$module$build$src$core$events$events , VIEWPORT _CHANGE$$module$build$src$core$events$events , clearPendingUndo$$module$build$src$core$events$events , disable$$module$build$src$core$events$events , enable$$module$build$src$core$events$events , filter$$module$build$src$core$events$events , fire$$module$build$src$core$events$events ,
fromJson$$module$build$src$core$events$events , getDescendantIds$$module$build$src$core$events$events , get$$module$build$src$core$events$events , getGroup$$module$build$src$core$events$events , getRecordUndo$$module$build$src$core$events$events , isEnabled$$module$build$src$core$events$events , setGroup$$module$build$src$core$events$events , setRecordUndo$$module$build$src$core$events$events , disableOrphans$$module$build$src$core$events$events ; Abstract$$module$build$src$core$events$events = Abstract$$module$build$src$core$events$events _abstract ;
BLOCK _CHANGE$$module$build$src$core$events$events = CHANGE$$module$build$src$core$events$utils ; BLOCK _CREATE$$module$build$src$core$events$events = CREATE$$module$build$src$core$events$utils ; BLOCK _DELETE$$module$build$src$core$events$events = DELETE$$module$build$src$core$events$utils ; BLOCK _DRAG$$module$build$src$core$events$events = BLOCK _DRAG$$module$build$src$core$events$utils ; BLOCK _MOVE$$module$build$src$core$events$events = MOVE$$module$build$src$core$events$utils ;
BUBBLE _OPEN$$module$build$src$core$events$events = BUBBLE _OPEN$$module$build$src$core$events$utils ; BUMP _EVENTS$$module$build$src$core$events$events = BUMP _EVENTS$$module$build$src$core$events$utils ; CHANGE$$module$build$src$core$events$events = CHANGE$$module$build$src$core$events$utils ; CLICK$$module$build$src$core$events$events = CLICK$$module$build$src$core$events$utils ; COMMENT _CHANGE$$module$build$src$core$events$events = COMMENT _CHANGE$$module$build$src$core$events$utils ;
COMMENT _CREATE$$module$build$src$core$events$events = COMMENT _CREATE$$module$build$src$core$events$utils ; COMMENT _DELETE$$module$build$src$core$events$events = COMMENT _DELETE$$module$build$src$core$events$utils ; COMMENT _MOVE$$module$build$src$core$events$events = COMMENT _MOVE$$module$build$src$core$events$utils ; CREATE$$module$build$src$core$events$events = CREATE$$module$build$src$core$events$utils ; DELETE$$module$build$src$core$events$events = DELETE$$module$build$src$core$events$utils ;
FINISHED _LOADING$$module$build$src$core$events$events = FINISHED _LOADING$$module$build$src$core$events$utils ; MARKER _MOVE$$module$build$src$core$events$events = MARKER _MOVE$$module$build$src$core$events$utils ; MOVE$$module$build$src$core$events$events = MOVE$$module$build$src$core$events$utils ; SELECTED$$module$build$src$core$events$events = SELECTED$$module$build$src$core$events$utils ; THEME _CHANGE$$module$build$src$core$events$events = THEME _CHANGE$$module$build$src$core$events$utils ;
TOOLBOX _ITEM _SELECT$$module$build$src$core$events$events = TOOLBOX _ITEM _SELECT$$module$build$src$core$events$utils ; TRASHCAN _OPEN$$module$build$src$core$events$events = TRASHCAN _OPEN$$module$build$src$core$events$utils ; UI$$module$build$src$core$events$events = UI$$module$build$src$core$events$utils ; VAR _CREATE$$module$build$src$core$events$events = VAR _CREATE$$module$build$src$core$events$utils ; VAR _DELETE$$module$build$src$core$events$events = VAR _DELETE$$module$build$src$core$events$utils ;
VAR _RENAME$$module$build$src$core$events$events = VAR _RENAME$$module$build$src$core$events$utils ; VIEWPORT _CHANGE$$module$build$src$core$events$events = VIEWPORT _CHANGE$$module$build$src$core$events$utils ; clearPendingUndo$$module$build$src$core$events$events = clearPendingUndo$$module$build$src$core$events$utils ; disable$$module$build$src$core$events$events = disable$$module$build$src$core$events$utils ; enable$$module$build$src$core$events$events = enable$$module$build$src$core$events$utils ;
filter$$module$build$src$core$events$events = filter$$module$build$src$core$events$utils ; fire$$module$build$src$core$events$events = fire$$module$build$src$core$events$utils ; fromJson$$module$build$src$core$events$events = fromJson$$module$build$src$core$events$utils ; getDescendantIds$$module$build$src$core$events$events = getDescendantIds$$module$build$src$core$events$utils ; get$$module$build$src$core$events$events = get$$module$build$src$core$events$utils ; getGroup$$module$build$src$core$events$events = getGroup$$module$build$src$core$events$utils ;
getRecordUndo$$module$build$src$core$events$events = getRecordUndo$$module$build$src$core$events$utils ; isEnabled$$module$build$src$core$events$events = isEnabled$$module$build$src$core$events$utils ; setGroup$$module$build$src$core$events$events = setGroup$$module$build$src$core$events$utils ; setRecordUndo$$module$build$src$core$events$events = setRecordUndo$$module$build$src$core$events$utils ; disableOrphans$$module$build$src$core$events$events = disableOrphans$$module$build$src$core$events$utils ;
$ . module$build$src$core$events$events = { } ; $ . module$build$src$core$events$events . Abstract = Abstract$$module$build$src$core$events$events _abstract ; $ . module$build$src$core$events$events . BLOCK _CHANGE = CHANGE$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . BLOCK _CREATE = CREATE$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . BLOCK _DELETE = DELETE$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . BLOCK _DRAG = BLOCK _DRAG$$module$build$src$core$events$utils ;
$ . module$build$src$core$events$events . BLOCK _MOVE = MOVE$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . BUBBLE _OPEN = BUBBLE _OPEN$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . BUMP _EVENTS = BUMP _EVENTS$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . BlockBase = BlockBase$$module$build$src$core$events$events _block _base ; $ . module$build$src$core$events$events . BlockChange = BlockChange$$module$build$src$core$events$events _block _change ;
$ . module$build$src$core$events$events . BlockCreate = BlockCreate$$module$build$src$core$events$events _block _create ; $ . module$build$src$core$events$events . BlockDelete = BlockDelete$$module$build$src$core$events$events _block _delete ; $ . module$build$src$core$events$events . BlockDrag = BlockDrag$$module$build$src$core$events$events _block _drag ; $ . module$build$src$core$events$events . BlockMove = BlockMove$$module$build$src$core$events$events _block _move ; $ . module$build$src$core$events$events . BubbleOpen = BubbleOpen$$module$build$src$core$events$events _bubble _open ;
$ . module$build$src$core$events$events . BubbleType = BubbleType$$module$build$src$core$events$events _bubble _open ; $ . module$build$src$core$events$events . CHANGE = CHANGE$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . CLICK = CLICK$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . COMMENT _CHANGE = COMMENT _CHANGE$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . COMMENT _CREATE = COMMENT _CREATE$$module$build$src$core$events$utils ;
$ . module$build$src$core$events$events . COMMENT _DELETE = COMMENT _DELETE$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . COMMENT _MOVE = COMMENT _MOVE$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . CREATE = CREATE$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . Click = Click$$module$build$src$core$events$events _click ; $ . module$build$src$core$events$events . ClickTarget = ClickTarget$$module$build$src$core$events$events _click ;
$ . module$build$src$core$events$events . CommentBase = CommentBase$$module$build$src$core$events$events _comment _base ; $ . module$build$src$core$events$events . CommentChange = CommentChange$$module$build$src$core$events$events _comment _change ; $ . module$build$src$core$events$events . CommentCreate = CommentCreate$$module$build$src$core$events$events _comment _create ; $ . module$build$src$core$events$events . CommentDelete = CommentDelete$$module$build$src$core$events$events _comment _delete ;
$ . module$build$src$core$events$events . CommentMove = CommentMove$$module$build$src$core$events$events _comment _move ; $ . module$build$src$core$events$events . DELETE = DELETE$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . FINISHED _LOADING = FINISHED _LOADING$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . FinishedLoading = FinishedLoading$$module$build$src$core$events$workspace _events ; $ . module$build$src$core$events$events . MARKER _MOVE = MARKER _MOVE$$module$build$src$core$events$utils ;
$ . module$build$src$core$events$events . MOVE = MOVE$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . MarkerMove = MarkerMove$$module$build$src$core$events$events _marker _move ; $ . module$build$src$core$events$events . SELECTED = SELECTED$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . Selected = Selected$$module$build$src$core$events$events _selected ; $ . module$build$src$core$events$events . THEME _CHANGE = THEME _CHANGE$$module$build$src$core$events$utils ;
$ . module$build$src$core$events$events . TOOLBOX _ITEM _SELECT = TOOLBOX _ITEM _SELECT$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . TRASHCAN _OPEN = TRASHCAN _OPEN$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . ThemeChange = ThemeChange$$module$build$src$core$events$events _theme _change ; $ . module$build$src$core$events$events . ToolboxItemSelect = ToolboxItemSelect$$module$build$src$core$events$events _toolbox _item _select ;
$ . module$build$src$core$events$events . TrashcanOpen = TrashcanOpen$$module$build$src$core$events$events _trashcan _open ; $ . module$build$src$core$events$events . UI = UI$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . Ui = Ui$$module$build$src$core$events$events _ui ; $ . module$build$src$core$events$events . UiBase = UiBase$$module$build$src$core$events$events _ui _base ; $ . module$build$src$core$events$events . VAR _CREATE = VAR _CREATE$$module$build$src$core$events$utils ;
$ . module$build$src$core$events$events . VAR _DELETE = VAR _DELETE$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . VAR _RENAME = VAR _RENAME$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . VIEWPORT _CHANGE = VIEWPORT _CHANGE$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . VarBase = VarBase$$module$build$src$core$events$events _var _base ; $ . module$build$src$core$events$events . VarCreate = VarCreate$$module$build$src$core$events$events _var _create ;
$ . module$build$src$core$events$events . VarDelete = VarDelete$$module$build$src$core$events$events _var _delete ; $ . module$build$src$core$events$events . VarRename = VarRename$$module$build$src$core$events$events _var _rename ; $ . module$build$src$core$events$events . ViewportChange = ViewportChange$$module$build$src$core$events$events _viewport ; $ . module$build$src$core$events$events . clearPendingUndo = clearPendingUndo$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . disable = disable$$module$build$src$core$events$utils ;
$ . module$build$src$core$events$events . disableOrphans = disableOrphans$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . enable = enable$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . filter = filter$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . fire = fire$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . fromJson = fromJson$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . get = get$$module$build$src$core$events$utils ;
$ . module$build$src$core$events$events . getDescendantIds = getDescendantIds$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . getGroup = getGroup$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . getRecordUndo = getRecordUndo$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . isEnabled = isEnabled$$module$build$src$core$events$utils ; $ . module$build$src$core$events$events . setGroup = setGroup$$module$build$src$core$events$utils ;
$ . module$build$src$core$events$events . setRecordUndo = setRecordUndo$$module$build$src$core$events$utils ; registerDefaultOptions$$module$build$src$core$contextmenu _items ( ) ; var module$build$src$core$contextmenu _items = { } ; module$build$src$core$contextmenu _items . registerCleanup = registerCleanup$$module$build$src$core$contextmenu _items ; module$build$src$core$contextmenu _items . registerCollapse = registerCollapse$$module$build$src$core$contextmenu _items ; module$build$src$core$contextmenu _items . registerCollapseExpandBlock = registerCollapseExpandBlock$$module$build$src$core$contextmenu _items ;
module$build$src$core$contextmenu _items . registerComment = registerComment$$module$build$src$core$contextmenu _items ; module$build$src$core$contextmenu _items . registerDefaultOptions = registerDefaultOptions$$module$build$src$core$contextmenu _items ; module$build$src$core$contextmenu _items . registerDelete = registerDelete$$module$build$src$core$contextmenu _items ; module$build$src$core$contextmenu _items . registerDeleteAll = registerDeleteAll$$module$build$src$core$contextmenu _items ;
module$build$src$core$contextmenu _items . registerDisable = registerDisable$$module$build$src$core$contextmenu _items ; module$build$src$core$contextmenu _items . registerDuplicate = registerDuplicate$$module$build$src$core$contextmenu _items ; module$build$src$core$contextmenu _items . registerExpand = registerExpand$$module$build$src$core$contextmenu _items ; module$build$src$core$contextmenu _items . registerHelp = registerHelp$$module$build$src$core$contextmenu _items ;
module$build$src$core$contextmenu _items . registerInline = registerInline$$module$build$src$core$contextmenu _items ; module$build$src$core$contextmenu _items . registerRedo = registerRedo$$module$build$src$core$contextmenu _items ; module$build$src$core$contextmenu _items . registerUndo = registerUndo$$module$build$src$core$contextmenu _items ; var BlockDragger$$module$build$src$core$block _dragger = class { constructor ( a , b ) { this . dragTarget _ = null ; this . wouldDeleteBlock _ = ! 1 ; this . draggingBlock _ = a ; this . draggedConnectionManager _ = new InsertionMarkerManager$$module$build$src$core$insertion _marker _manager ( this . draggingBlock _ ) ; this . workspace _ = b ; this . startXY _ = this . draggingBlock _ . getRelativeToSurfaceXY ( ) ; this . dragIconData _ = initIconData$$module$build$src$core$block _dragger ( a ) } dispose ( ) { this . dragIconData _ . length = 0 ; this . draggedConnectionManager _ && this . draggedConnectionManager _ . dispose ( ) } startDrag ( a ,
b ) { getGroup$$module$build$src$core$events$utils ( ) || setGroup$$module$build$src$core$events$utils ( ! 0 ) ; this . fireDragStartEvent _ ( ) ; this . workspace _ . isMutator && this . draggingBlock _ . bringToFront ( ) ; startTextWidthCache$$module$build$src$core$utils$dom ( ) ; this . workspace _ . setResizesEnabled ( ! 1 ) ; disconnectUiStop$$module$build$src$core$block _animations ( ) ; this . shouldDisconnect _ ( b ) && this . disconnectBlock _ ( b , a ) ; this . draggingBlock _ . setDragging ( ! 0 ) ; this . draggingBlock _ . moveToDragSurface ( ) } shouldDisconnect _ ( a ) { return ! ! ( this . draggingBlock _ . getParent ( ) ||
a && this . draggingBlock _ . nextConnection && this . draggingBlock _ . nextConnection . targetBlock ( ) ) } disconnectBlock _ ( a , b ) { this . draggingBlock _ . unplug ( a ) ; a = this . pixelsToWorkspaceUnits _ ( b ) ; a = Coordinate$$module$build$src$core$utils$coordinate . sum ( this . startXY _ , a ) ; this . draggingBlock _ . translate ( a . x , a . y ) ; disconnectUiEffect$$module$build$src$core$block _animations ( this . draggingBlock _ ) ; this . draggedConnectionManager _ . updateAvailableConnections ( ) } fireDragStartEvent _ ( ) { const a = new ( get$$module$build$src$core$events$utils ( BLOCK _DRAG$$module$build$src$core$events$utils ) ) ( this . draggingBlock _ ,
! 0 , this . draggingBlock _ . getDescendants ( ! 1 ) ) ; fire$$module$build$src$core$events$utils ( a ) } drag ( a , b ) { b = this . pixelsToWorkspaceUnits _ ( b ) ; var c = Coordinate$$module$build$src$core$utils$coordinate . sum ( this . startXY _ , b ) ; this . draggingBlock _ . moveDuringDrag ( c ) ; this . dragIcons _ ( b ) ; c = this . dragTarget _ ; this . dragTarget _ = this . workspace _ . getDragTarget ( a ) ; this . draggedConnectionManager _ . update ( b , this . dragTarget _ ) ; a = this . wouldDeleteBlock _ ; this . wouldDeleteBlock _ = this . draggedConnectionManager _ . wouldDeleteBlock ( ) ; a !== this . wouldDeleteBlock _ &&
this . updateCursorDuringBlockDrag _ ( ) ; this . dragTarget _ !== c && ( c && c . onDragExit ( this . draggingBlock _ ) , this . dragTarget _ && this . dragTarget _ . onDragEnter ( this . draggingBlock _ ) ) ; this . dragTarget _ && this . dragTarget _ . onDragOver ( this . draggingBlock _ ) } endDrag ( a , b ) { this . drag ( a , b ) ; this . dragIconData _ = [ ] ; this . fireDragEndEvent _ ( ) ; stopTextWidthCache$$module$build$src$core$utils$dom ( ) ; disconnectUiStop$$module$build$src$core$block _animations ( ) ; a = null ; this . dragTarget _ && this . dragTarget _ . shouldPreventMove ( this . draggingBlock _ ) ?
b = this . startXY _ : ( b = this . getNewLocationAfterDrag _ ( b ) , a = b . delta , b = b . newLocation ) ; this . draggingBlock _ . moveOffDragSurface ( b ) ; if ( this . dragTarget _ ) this . dragTarget _ . onDrop ( this . draggingBlock _ ) ; this . maybeDeleteBlock _ ( ) || ( this . draggingBlock _ . setDragging ( ! 1 ) , a ? this . updateBlockAfterMove _ ( a ) : bumpObjectIntoBounds$$module$build$src$core$bump _objects ( this . draggingBlock _ . workspace , this . workspace _ . getMetricsManager ( ) . getScrollMetrics ( ! 0 ) , this . draggingBlock _ ) ) ; this . workspace _ . setResizesEnabled ( ! 0 ) ; setGroup$$module$build$src$core$events$utils ( ! 1 ) } getNewLocationAfterDrag _ ( a ) { a =
this . pixelsToWorkspaceUnits _ ( a ) ; const b = Coordinate$$module$build$src$core$utils$coordinate . sum ( this . startXY _ , a ) ; return { delta : a , newLocation : b } } maybeDeleteBlock _ ( ) { return this . wouldDeleteBlock _ ? ( this . fireMoveEvent _ ( ) , this . draggingBlock _ . dispose ( ! 1 , ! 0 ) , draggingConnections$$module$build$src$core$common . length = 0 , ! 0 ) : ! 1 } updateBlockAfterMove _ ( a ) { this . draggingBlock _ . moveConnections ( a . x , a . y ) ; this . fireMoveEvent _ ( ) ; this . draggedConnectionManager _ . wouldConnectBlock ( ) ? this . draggedConnectionManager _ . applyConnections ( ) :
this . draggingBlock _ . render ( ) ; this . draggingBlock _ . scheduleSnapAndBump ( ) } fireDragEndEvent _ ( ) { const a = new ( get$$module$build$src$core$events$utils ( BLOCK _DRAG$$module$build$src$core$events$utils ) ) ( this . draggingBlock _ , ! 1 , this . draggingBlock _ . getDescendants ( ! 1 ) ) ; fire$$module$build$src$core$events$utils ( a ) } updateToolboxStyle _ ( a ) { const b = this . workspace _ . getToolbox ( ) ; if ( b ) { const c = this . draggingBlock _ . isDeletable ( ) ? "blocklyToolboxDelete" : "blocklyToolboxGrab" ; a && "function" === typeof b . removeStyle ? b . removeStyle ( c ) :
a || "function" !== typeof b . addStyle || b . addStyle ( c ) } } fireMoveEvent _ ( ) { const a = new ( get$$module$build$src$core$events$utils ( MOVE$$module$build$src$core$events$utils ) ) ( this . draggingBlock _ ) ; a . oldCoordinate = this . startXY _ ; a . recordNew ( ) ; fire$$module$build$src$core$events$utils ( a ) } updateCursorDuringBlockDrag _ ( ) { this . draggingBlock _ . setDeleteStyle ( this . wouldDeleteBlock _ ) } pixelsToWorkspaceUnits _ ( a ) { a = new Coordinate$$module$build$src$core$utils$coordinate ( a . x / this . workspace _ . scale , a . y / this . workspace _ . scale ) ; this . workspace _ . isMutator &&
a . scale ( 1 / this . workspace _ . options . parentWorkspace . scale ) ; return a } dragIcons _ ( a ) { for ( let b = 0 ; b < this . dragIconData _ . length ; b ++ ) { const c = this . dragIconData _ [ b ] ; c . icon . setIconLocation ( Coordinate$$module$build$src$core$utils$coordinate . sum ( c . location , a ) ) } } getInsertionMarkers ( ) { return this . draggedConnectionManager _ && this . draggedConnectionManager _ . getInsertionMarkers ? this . draggedConnectionManager _ . getInsertionMarkers ( ) : [ ] } } ;
register$$module$build$src$core$registry ( Type$$module$build$src$core$registry . BLOCK _DRAGGER , DEFAULT$$module$build$src$core$registry , BlockDragger$$module$build$src$core$block _dragger ) ; var module$build$src$core$block _dragger = { } ; module$build$src$core$block _dragger . BlockDragger = BlockDragger$$module$build$src$core$block _dragger ; var VERSION$$module$build$src$core$blockly = "9.0.1" , ALIGN _LEFT$$module$build$src$core$blockly = $ . Align$$module$build$src$core$input . LEFT , ALIGN _CENTRE$$module$build$src$core$blockly = $ . Align$$module$build$src$core$input . CENTRE , ALIGN _RIGHT$$module$build$src$core$blockly = $ . Align$$module$build$src$core$input . RIGHT , INPUT _VALUE$$module$build$src$core$blockly = ConnectionType$$module$build$src$core$connection _type . INPUT _VALUE , OUTPUT _VALUE$$module$build$src$core$blockly = ConnectionType$$module$build$src$core$connection _type . OUTPUT _VALUE ,
NEXT _STATEMENT$$module$build$src$core$blockly = ConnectionType$$module$build$src$core$connection _type . NEXT _STATEMENT , PREVIOUS _STATEMENT$$module$build$src$core$blockly = ConnectionType$$module$build$src$core$connection _type . PREVIOUS _STATEMENT , DUMMY _INPUT$$module$build$src$core$blockly = inputTypes$$module$build$src$core$input _types . DUMMY , TOOLBOX _AT _TOP$$module$build$src$core$blockly = Position$$module$build$src$core$utils$toolbox . TOP , TOOLBOX _AT _BOTTOM$$module$build$src$core$blockly = Position$$module$build$src$core$utils$toolbox . BOTTOM ,
TOOLBOX _AT _LEFT$$module$build$src$core$blockly = Position$$module$build$src$core$utils$toolbox . LEFT , TOOLBOX _AT _RIGHT$$module$build$src$core$blockly = Position$$module$build$src$core$utils$toolbox . RIGHT , svgResize$$module$build$src$core$blockly = svgResize$$module$build$src$core$common , getMainWorkspace$$module$build$src$core$blockly = getMainWorkspace$$module$build$src$core$common , getSelected$$module$build$src$core$blockly = getSelected$$module$build$src$core$common , defineBlocksWithJsonArray$$module$build$src$core$blockly =
defineBlocksWithJsonArray$$module$build$src$core$common , setParentContainer$$module$build$src$core$blockly = setParentContainer$$module$build$src$core$common , resizeSvgContents$$module$build$src$core$blockly = resizeSvgContentsLocal$$module$build$src$core$blockly , COLLAPSE _CHARS$$module$build$src$core$blockly = COLLAPSE _CHARS$$module$build$src$core$internal _constants , DRAG _STACK$$module$build$src$core$blockly = DRAG _STACK$$module$build$src$core$internal _constants , OPPOSITE _TYPE$$module$build$src$core$blockly =
OPPOSITE _TYPE$$module$build$src$core$internal _constants , RENAME _VARIABLE _ID$$module$build$src$core$blockly = RENAME _VARIABLE _ID$$module$build$src$core$internal _constants , DELETE _VARIABLE _ID$$module$build$src$core$blockly = DELETE _VARIABLE _ID$$module$build$src$core$internal _constants , COLLAPSED _INPUT _NAME$$module$build$src$core$blockly = COLLAPSED _INPUT _NAME$$module$build$src$core$constants , COLLAPSED _FIELD _NAME$$module$build$src$core$blockly = COLLAPSED _FIELD _NAME$$module$build$src$core$constants , VARIABLE _CATEGORY _NAME$$module$build$src$core$blockly =
CATEGORY _NAME$$module$build$src$core$variables , VARIABLE _DYNAMIC _CATEGORY _NAME$$module$build$src$core$blockly = CATEGORY _NAME$$module$build$src$core$variables _dynamic , PROCEDURE _CATEGORY _NAME$$module$build$src$core$blockly = CATEGORY _NAME$$module$build$src$core$procedures ; Workspace$$module$build$src$core$workspace . prototype . newBlock = function ( a , b ) { return new Block$$module$build$src$core$block ( this , a , b ) } ;
WorkspaceSvg$$module$build$src$core$workspace _svg . prototype . newBlock = function ( a , b ) { return new BlockSvg$$module$build$src$core$block _svg ( this , a , b ) } ; WorkspaceSvg$$module$build$src$core$workspace _svg . newTrashcan = function ( a ) { return new Trashcan$$module$build$src$core$trashcan ( a ) } ;
WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg . prototype . showContextMenu = function ( a ) { if ( ! this . workspace . options . readOnly ) { var b = [ ] ; this . isDeletable ( ) && this . isMovable ( ) && ( b . push ( commentDuplicateOption$$module$build$src$core$contextmenu ( this ) ) , b . push ( commentDeleteOption$$module$build$src$core$contextmenu ( this ) ) ) ; show$$module$build$src$core$contextmenu ( a , b , this . RTL ) } } ; $ . Mutator$$module$build$src$core$mutator . prototype . newWorkspaceSvg = function ( a ) { return new WorkspaceSvg$$module$build$src$core$workspace _svg ( a ) } ;
Names$$module$build$src$core$names . prototype . populateProcedures = function ( a ) { a = allProcedures$$module$build$src$core$procedures ( a ) ; a = a [ 0 ] . concat ( a [ 1 ] ) ; for ( let b = 0 ; b < a . length ; b ++ ) this . getName ( a [ b ] [ 0 ] , Names$$module$build$src$core$names . NameType . PROCEDURE ) } ; var DropDownDiv$$module$build$src$core$blockly = module$build$src$core$dropdowndiv , connectionTypes$$module$build$src$core$blockly = ConnectionType$$module$build$src$core$connection _type , serialization$$module$build$src$core$blockly ;
( function ( a ) { a . blocks = module$build$src$core$serialization$blocks ; a . exceptions = module$build$src$core$serialization$exceptions ; a . priorities = module$build$src$core$serialization$priorities ; a . registry = module$build$src$core$serialization$registry ; a . variables = module$build$src$core$serialization$variables ; a . workspaces = module$build$src$core$serialization$workspaces } ) ( serialization$$module$build$src$core$blockly || ( serialization$$module$build$src$core$blockly = { } ) ) ; var module$build$src$core$blockly = { } ;
module$build$src$core$blockly . ALIGN _CENTRE = ALIGN _CENTRE$$module$build$src$core$blockly ; module$build$src$core$blockly . ALIGN _LEFT = ALIGN _LEFT$$module$build$src$core$blockly ; module$build$src$core$blockly . ALIGN _RIGHT = ALIGN _RIGHT$$module$build$src$core$blockly ; module$build$src$core$blockly . ASTNode = ASTNode$$module$build$src$core$keyboard _nav$ast _node ; module$build$src$core$blockly . BasicCursor = BasicCursor$$module$build$src$core$keyboard _nav$basic _cursor ; module$build$src$core$blockly . Block = Block$$module$build$src$core$block ;
module$build$src$core$blockly . BlockDragSurfaceSvg = BlockDragSurfaceSvg$$module$build$src$core$block _drag _surface ; module$build$src$core$blockly . BlockDragger = BlockDragger$$module$build$src$core$block _dragger ; module$build$src$core$blockly . BlockSvg = BlockSvg$$module$build$src$core$block _svg ; module$build$src$core$blockly . Blocks = Blocks$$module$build$src$core$blocks ; module$build$src$core$blockly . Bubble = Bubble$$module$build$src$core$bubble ; module$build$src$core$blockly . BubbleDragger = BubbleDragger$$module$build$src$core$bubble _dragger ;
module$build$src$core$blockly . COLLAPSED _FIELD _NAME = COLLAPSED _FIELD _NAME$$module$build$src$core$constants ; module$build$src$core$blockly . COLLAPSED _INPUT _NAME = COLLAPSED _INPUT _NAME$$module$build$src$core$constants ; module$build$src$core$blockly . COLLAPSE _CHARS = COLLAPSE _CHARS$$module$build$src$core$internal _constants ; module$build$src$core$blockly . CollapsibleToolboxCategory = CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible _category ; module$build$src$core$blockly . Comment = Comment$$module$build$src$core$comment ;
module$build$src$core$blockly . ComponentManager = ComponentManager$$module$build$src$core$component _manager ; module$build$src$core$blockly . Connection = Connection$$module$build$src$core$connection ; module$build$src$core$blockly . ConnectionChecker = ConnectionChecker$$module$build$src$core$connection _checker ; module$build$src$core$blockly . ConnectionDB = ConnectionDB$$module$build$src$core$connection _db ; module$build$src$core$blockly . ConnectionType = ConnectionType$$module$build$src$core$connection _type ;
module$build$src$core$blockly . ContextMenu = $ . module$build$src$core$contextmenu ; module$build$src$core$blockly . ContextMenuItems = module$build$src$core$contextmenu _items ; module$build$src$core$blockly . ContextMenuRegistry = ContextMenuRegistry$$module$build$src$core$contextmenu _registry ; module$build$src$core$blockly . Css = module$build$src$core$css ; module$build$src$core$blockly . Cursor = Cursor$$module$build$src$core$keyboard _nav$cursor ; module$build$src$core$blockly . DELETE _VARIABLE _ID = DELETE _VARIABLE _ID$$module$build$src$core$internal _constants ;
module$build$src$core$blockly . DRAG _STACK = DRAG _STACK$$module$build$src$core$internal _constants ; module$build$src$core$blockly . DUMMY _INPUT = DUMMY _INPUT$$module$build$src$core$blockly ; module$build$src$core$blockly . DeleteArea = DeleteArea$$module$build$src$core$delete _area ; module$build$src$core$blockly . DragTarget = DragTarget$$module$build$src$core$drag _target ; module$build$src$core$blockly . DropDownDiv = module$build$src$core$dropdowndiv ; module$build$src$core$blockly . Events = $ . module$build$src$core$events$events ;
module$build$src$core$blockly . Extensions = $ . module$build$src$core$extensions ; module$build$src$core$blockly . Field = Field$$module$build$src$core$field ; module$build$src$core$blockly . FieldAngle = FieldAngle$$module$build$src$core$field _angle ; module$build$src$core$blockly . FieldCheckbox = $ . FieldCheckbox$$module$build$src$core$field _checkbox ; module$build$src$core$blockly . FieldColour = FieldColour$$module$build$src$core$field _colour ; module$build$src$core$blockly . FieldDropdown = FieldDropdown$$module$build$src$core$field _dropdown ;
module$build$src$core$blockly . FieldImage = $ . FieldImage$$module$build$src$core$field _image ; module$build$src$core$blockly . FieldLabel = $ . FieldLabel$$module$build$src$core$field _label ; module$build$src$core$blockly . FieldLabelSerializable = FieldLabelSerializable$$module$build$src$core$field _label _serializable ; module$build$src$core$blockly . FieldMultilineInput = FieldMultilineInput$$module$build$src$core$field _multilineinput ; module$build$src$core$blockly . FieldNumber = FieldNumber$$module$build$src$core$field _number ;
module$build$src$core$blockly . FieldTextInput = $ . FieldTextInput$$module$build$src$core$field _textinput ; module$build$src$core$blockly . FieldVariable = FieldVariable$$module$build$src$core$field _variable ; module$build$src$core$blockly . Flyout = Flyout$$module$build$src$core$flyout _base ; module$build$src$core$blockly . FlyoutButton = FlyoutButton$$module$build$src$core$flyout _button ; module$build$src$core$blockly . FlyoutMetricsManager = FlyoutMetricsManager$$module$build$src$core$flyout _metrics _manager ;
module$build$src$core$blockly . Generator = $ . Generator$$module$build$src$core$generator ; module$build$src$core$blockly . Gesture = Gesture$$module$build$src$core$gesture ; module$build$src$core$blockly . Grid = Grid$$module$build$src$core$grid ; module$build$src$core$blockly . HorizontalFlyout = HorizontalFlyout$$module$build$src$core$flyout _horizontal ; module$build$src$core$blockly . INPUT _VALUE = INPUT _VALUE$$module$build$src$core$blockly ; module$build$src$core$blockly . Icon = Icon$$module$build$src$core$icon ;
module$build$src$core$blockly . Input = Input$$module$build$src$core$input ; module$build$src$core$blockly . InsertionMarkerManager = InsertionMarkerManager$$module$build$src$core$insertion _marker _manager ; module$build$src$core$blockly . Marker = Marker$$module$build$src$core$keyboard _nav$marker ; module$build$src$core$blockly . MarkerManager = MarkerManager$$module$build$src$core$marker _manager ; module$build$src$core$blockly . Menu = Menu$$module$build$src$core$menu ; module$build$src$core$blockly . MenuItem = MenuItem$$module$build$src$core$menuitem ;
module$build$src$core$blockly . MetricsManager = MetricsManager$$module$build$src$core$metrics _manager ; module$build$src$core$blockly . Msg = Msg$$module$build$src$core$msg ; module$build$src$core$blockly . Mutator = $ . Mutator$$module$build$src$core$mutator ; module$build$src$core$blockly . NEXT _STATEMENT = NEXT _STATEMENT$$module$build$src$core$blockly ; module$build$src$core$blockly . Names = Names$$module$build$src$core$names ; module$build$src$core$blockly . OPPOSITE _TYPE = OPPOSITE _TYPE$$module$build$src$core$internal _constants ;
module$build$src$core$blockly . OUTPUT _VALUE = OUTPUT _VALUE$$module$build$src$core$blockly ; module$build$src$core$blockly . Options = Options$$module$build$src$core$options ; module$build$src$core$blockly . PREVIOUS _STATEMENT = PREVIOUS _STATEMENT$$module$build$src$core$blockly ; module$build$src$core$blockly . PROCEDURE _CATEGORY _NAME = CATEGORY _NAME$$module$build$src$core$procedures ; module$build$src$core$blockly . Procedures = $ . module$build$src$core$procedures ; module$build$src$core$blockly . RENAME _VARIABLE _ID = RENAME _VARIABLE _ID$$module$build$src$core$internal _constants ;
module$build$src$core$blockly . RenderedConnection = RenderedConnection$$module$build$src$core$rendered _connection ; module$build$src$core$blockly . Scrollbar = Scrollbar$$module$build$src$core$scrollbar ; module$build$src$core$blockly . ScrollbarPair = ScrollbarPair$$module$build$src$core$scrollbar _pair ; module$build$src$core$blockly . ShortcutItems = module$build$src$core$shortcut _items ; module$build$src$core$blockly . ShortcutRegistry = ShortcutRegistry$$module$build$src$core$shortcut _registry ;
module$build$src$core$blockly . TOOLBOX _AT _BOTTOM = TOOLBOX _AT _BOTTOM$$module$build$src$core$blockly ; module$build$src$core$blockly . TOOLBOX _AT _LEFT = TOOLBOX _AT _LEFT$$module$build$src$core$blockly ; module$build$src$core$blockly . TOOLBOX _AT _RIGHT = TOOLBOX _AT _RIGHT$$module$build$src$core$blockly ; module$build$src$core$blockly . TOOLBOX _AT _TOP = TOOLBOX _AT _TOP$$module$build$src$core$blockly ; module$build$src$core$blockly . TabNavigateCursor = TabNavigateCursor$$module$build$src$core$keyboard _nav$tab _navigate _cursor ;
module$build$src$core$blockly . Theme = Theme$$module$build$src$core$theme ; module$build$src$core$blockly . ThemeManager = ThemeManager$$module$build$src$core$theme _manager ; module$build$src$core$blockly . Themes = module$build$src$core$theme$themes ; module$build$src$core$blockly . Toolbox = Toolbox$$module$build$src$core$toolbox$toolbox ; module$build$src$core$blockly . ToolboxCategory = ToolboxCategory$$module$build$src$core$toolbox$category ; module$build$src$core$blockly . ToolboxItem = ToolboxItem$$module$build$src$core$toolbox$toolbox _item ;
module$build$src$core$blockly . ToolboxSeparator = ToolboxSeparator$$module$build$src$core$toolbox$separator ; module$build$src$core$blockly . Tooltip = module$build$src$core$tooltip ; module$build$src$core$blockly . Touch = module$build$src$core$touch ; module$build$src$core$blockly . TouchGesture = TouchGesture$$module$build$src$core$touch _gesture ; module$build$src$core$blockly . Trashcan = Trashcan$$module$build$src$core$trashcan ; module$build$src$core$blockly . VARIABLE _CATEGORY _NAME = CATEGORY _NAME$$module$build$src$core$variables ;
module$build$src$core$blockly . VARIABLE _DYNAMIC _CATEGORY _NAME = CATEGORY _NAME$$module$build$src$core$variables _dynamic ; module$build$src$core$blockly . VERSION = VERSION$$module$build$src$core$blockly ; module$build$src$core$blockly . VariableMap = VariableMap$$module$build$src$core$variable _map ; module$build$src$core$blockly . VariableModel = VariableModel$$module$build$src$core$variable _model ; module$build$src$core$blockly . Variables = $ . module$build$src$core$variables ; module$build$src$core$blockly . VariablesDynamic = module$build$src$core$variables _dynamic ;
module$build$src$core$blockly . VerticalFlyout = VerticalFlyout$$module$build$src$core$flyout _vertical ; module$build$src$core$blockly . Warning = Warning$$module$build$src$core$warning ; module$build$src$core$blockly . WidgetDiv = module$build$src$core$widgetdiv ; module$build$src$core$blockly . Workspace = Workspace$$module$build$src$core$workspace ; module$build$src$core$blockly . WorkspaceAudio = WorkspaceAudio$$module$build$src$core$workspace _audio ; module$build$src$core$blockly . WorkspaceComment = WorkspaceComment$$module$build$src$core$workspace _comment ;
module$build$src$core$blockly . WorkspaceCommentSvg = WorkspaceCommentSvg$$module$build$src$core$workspace _comment _svg ; module$build$src$core$blockly . WorkspaceDragSurfaceSvg = WorkspaceDragSurfaceSvg$$module$build$src$core$workspace _drag _surface _svg ; module$build$src$core$blockly . WorkspaceDragger = WorkspaceDragger$$module$build$src$core$workspace _dragger ; module$build$src$core$blockly . WorkspaceSvg = WorkspaceSvg$$module$build$src$core$workspace _svg ; module$build$src$core$blockly . Xml = $ . module$build$src$core$xml ;
module$build$src$core$blockly . ZoomControls = ZoomControls$$module$build$src$core$zoom _controls ; module$build$src$core$blockly . bindEventWithChecks _ = bindEventWithChecks _$$module$build$src$core$blockly ; module$build$src$core$blockly . bindEvent _ = bindEvent _$$module$build$src$core$blockly ; module$build$src$core$blockly . blockAnimations = module$build$src$core$block _animations ; module$build$src$core$blockly . blockRendering = module$build$src$core$renderers$common$block _rendering ;
module$build$src$core$blockly . browserEvents = module$build$src$core$browser _events ; module$build$src$core$blockly . bumpObjects = module$build$src$core$bump _objects ; module$build$src$core$blockly . clipboard = module$build$src$core$clipboard ; module$build$src$core$blockly . common = $ . module$build$src$core$common ; module$build$src$core$blockly . config = $ . config$$module$build$src$core$config ; module$build$src$core$blockly . connectionTypes = connectionTypes$$module$build$src$core$blockly ;
module$build$src$core$blockly . constants = module$build$src$core$constants ; module$build$src$core$blockly . copy = copy$$module$build$src$core$blockly ; module$build$src$core$blockly . defineBlocksWithJsonArray = defineBlocksWithJsonArray$$module$build$src$core$common ; module$build$src$core$blockly . dialog = module$build$src$core$dialog ; module$build$src$core$blockly . duplicate = duplicate$$module$build$src$core$blockly ; module$build$src$core$blockly . fieldRegistry = module$build$src$core$field _registry ;
module$build$src$core$blockly . geras = module$build$src$core$renderers$geras$geras ; module$build$src$core$blockly . getMainWorkspace = getMainWorkspace$$module$build$src$core$common ; module$build$src$core$blockly . getSelected = getSelected$$module$build$src$core$common ; module$build$src$core$blockly . hideChaff = hideChaff$$module$build$src$core$blockly ; module$build$src$core$blockly . hueToHex = hueToHex$$module$build$src$core$blockly ; module$build$src$core$blockly . inject = inject$$module$build$src$core$inject ;
module$build$src$core$blockly . inputTypes = inputTypes$$module$build$src$core$input _types ; module$build$src$core$blockly . isNumber = isNumber$$module$build$src$core$blockly ; module$build$src$core$blockly . minimalist = module$build$src$core$renderers$minimalist$minimalist ; module$build$src$core$blockly . paste = paste$$module$build$src$core$blockly ; module$build$src$core$blockly . registry = module$build$src$core$registry ; module$build$src$core$blockly . resizeSvgContents = resizeSvgContentsLocal$$module$build$src$core$blockly ;
module$build$src$core$blockly . serialization = serialization$$module$build$src$core$blockly ; module$build$src$core$blockly . setLocale = setLocale$$module$build$src$core$msg ; module$build$src$core$blockly . setParentContainer = setParentContainer$$module$build$src$core$common ; module$build$src$core$blockly . svgResize = svgResize$$module$build$src$core$common ; module$build$src$core$blockly . thrasos = module$build$src$core$renderers$thrasos$thrasos ; module$build$src$core$blockly . uiPosition = module$build$src$core$positionable _helpers ;
module$build$src$core$blockly . unbindEvent _ = unbindEvent _$$module$build$src$core$blockly ; 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$exports$Blockly$main = { } , module$contents$Blockly$main _Blockly = module$build$src$core$blockly , module$contents$Blockly$main _ContextMenu = $ . module$build$src$core$contextmenu , module$contents$Blockly$main _Events = $ . module$build$src$core$events$events , module$contents$Blockly$main _Msg = $ . module$build$src$core$msg , module$contents$Blockly$main _Tooltip = module$build$src$core$tooltip , module$contents$Blockly$main _WidgetDiv = module$build$src$core$widgetdiv , module$contents$Blockly$main _colour = module$build$src$core$utils$colour ,
module$contents$Blockly$main _common = $ . module$build$src$core$common , module$contents$Blockly$main _deprecation = module$build$src$core$utils$deprecation , module$contents$Blockly$main _dialog = module$build$src$core$dialog , module$contents$Blockly$main _eventUtils = module$build$src$core$events$utils ;
Object . defineProperties ( module$build$src$core$blockly , { alert : { set : function ( a ) { module$build$src$core$utils$deprecation . warn ( "Blockly.alert" , "December 2021" , "December 2022" ) ; module$build$src$core$dialog . setAlert ( a ) } , get : function ( ) { module$build$src$core$utils$deprecation . warn ( "Blockly.alert" , "December 2021" , "December 2022" , "Blockly.dialog.alert()" ) ; return module$build$src$core$dialog . alert } } , confirm : { set : function ( a ) { module$build$src$core$utils$deprecation . warn ( "Blockly.confirm" , "December 2021" , "December 2022" ) ;
module$build$src$core$dialog . setConfirm ( a ) } , get : function ( ) { module$build$src$core$utils$deprecation . warn ( "Blockly.confirm" , "December 2021" , "December 2022" , "Blockly.dialog.confirm()" ) ; return module$build$src$core$dialog . confirm } } , mainWorkspace : { set : function ( a ) { module$build$src$core$utils$deprecation . warn ( "Blockly.mainWorkspace" , "version 9" , "version 10" , "Blockly.getMainWorkspace" ) ; $ . module$build$src$core$common . setMainWorkspace ( a ) } , get : function ( ) { module$build$src$core$utils$deprecation . warn ( "Blockly.mainWorkspace" ,
"version 9" , "version 10" , "Blockly.getMainWorkspace" ) ; return $ . module$build$src$core$common . getMainWorkspace ( ) } } , prompt : { set : function ( a ) { module$build$src$core$utils$deprecation . warn ( "Blockly.prompt" , "December 2021" , "December 2022" ) ; module$build$src$core$dialog . setPrompt ( a ) } , get : function ( ) { module$build$src$core$utils$deprecation . warn ( "Blockly.prompt" , "December 2021" , "December 2022" , "Blockly.dialog.prompt()" ) ; return module$build$src$core$dialog . prompt } } , selected : { get : function ( ) { module$build$src$core$utils$deprecation . warn ( "Blockly.selected" ,
"version 9" , "version 10" , "Blockly.getSelected" ) ; return $ . module$build$src$core$common . getSelected ( ) } , set : function ( a ) { module$build$src$core$utils$deprecation . warn ( "Blockly.selected" , "version 9" , "version 10" , "Blockly.getSelected" ) ; $ . module$build$src$core$common . setSelected ( a ) } } , HSV _SATURATION : { get : function ( ) { return module$build$src$core$utils$colour . getHsvSaturation ( ) } , set : function ( a ) { module$build$src$core$utils$colour . setHsvSaturation ( a ) } } , HSV _VALUE : { get : function ( ) { return module$build$src$core$utils$colour . getHsvValue ( ) } ,
set : function ( a ) { module$build$src$core$utils$colour . setHsvValue ( a ) } } } ) ;
Object . defineProperties ( $ . module$build$src$core$contextmenu , { currentBlock : { get : function ( ) { module$build$src$core$utils$deprecation . warn ( "Blockly.ContextMenu.currentBlock" , "September 2021" , "September 2022" , "Blockly.Tooltip.getCurrentBlock()" ) ; return $ . module$build$src$core$contextmenu . getCurrentBlock ( ) } , set : function ( a ) { module$build$src$core$utils$deprecation . warn ( "Blockly.ContextMenu.currentBlock" , "September 2021" , "September 2022" , "Blockly.Tooltip.setCurrentBlock(block)" ) ; $ . module$build$src$core$contextmenu . setCurrentBlock ( a ) } } } ) ;
Object . defineProperties ( $ . module$build$src$core$events$events , { recordUndo : { get : function ( ) { module$build$src$core$utils$deprecation . warn ( "Blockly.Events.recordUndo" , "September 2021" , "September 2022" , "Blockly.Events.getRecordUndo()" ) ; return module$build$src$core$events$utils . getRecordUndo ( ) } , set : function ( a ) { module$build$src$core$utils$deprecation . warn ( "Blockly.Events.recordUndo" , "September 2021" , "September 2022" , "Blockly.Events.setRecordUndo()" ) ; module$build$src$core$events$utils . setRecordUndo ( a ) } } } ) ;
Object . defineProperties ( module$build$src$core$tooltip , { visible : { get : function ( ) { module$build$src$core$utils$deprecation . warn ( "Blockly.Tooltip.visible" , "September 2021" , "September 2022" , "Blockly.Tooltip.isVisible()" ) ; return module$build$src$core$tooltip . isVisible ( ) } } , DIV : { get : function ( ) { module$build$src$core$utils$deprecation . warn ( "Blockly.Tooltip.DIV" , "September 2021" , "September 2022" , "Blockly.Tooltip.getDiv()" ) ; return module$build$src$core$tooltip . getDiv ( ) } } } ) ;
Object . defineProperties ( module$build$src$core$widgetdiv , { DIV : { get : function ( ) { module$build$src$core$utils$deprecation . warn ( "Blockly.WidgetDiv.DIV" , "September 2021" , "September 2022" , "Blockly.WidgetDiv.getDiv()" ) ; return module$build$src$core$widgetdiv . getDiv ( ) } } } ) ; "Blockly" in globalThis || ( globalThis . Blockly = { Msg : $ . module$build$src$core$msg } ) ;
module$build$src$core$blockly . _ _namespace _ _ = $ ;
return module$build$src$core$blockly ;
2021-01-16 14:07:51 +00:00
} ) ) ;
//# sourceMappingURL=blockly_compressed.js.map