@elyra/canvas 12.20.0 → 12.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{common-canvas-0c35f64f.js → common-canvas-bcfe04ef.js} +2 -2
- package/dist/common-canvas-bcfe04ef.js.map +1 -0
- package/dist/{common-canvas-b60fe77c.js → common-canvas-c4f77878.js} +2 -2
- package/dist/common-canvas-c4f77878.js.map +1 -0
- package/dist/common-canvas.es.js +1 -1
- package/dist/common-canvas.js +1 -1
- package/dist/common-properties-267a9a6c.js +2 -0
- package/dist/common-properties-267a9a6c.js.map +1 -0
- package/dist/common-properties-6520f90b.js +2 -0
- package/dist/common-properties-6520f90b.js.map +1 -0
- package/dist/{extends-634d1af7.js → extends-12382a72.js} +2 -2
- package/dist/extends-12382a72.js.map +1 -0
- package/dist/extends-195c6b49.js +7 -0
- package/dist/extends-195c6b49.js.map +1 -0
- package/dist/flexible-table-056c538e.js +2 -0
- package/dist/{flexible-table-72146c49.js.map → flexible-table-056c538e.js.map} +1 -1
- package/dist/flexible-table-7fb8a62e.js +2 -0
- package/dist/{flexible-table-fa8e4aa4.js.map → flexible-table-7fb8a62e.js.map} +1 -1
- package/dist/{icon-079f1f09.js → icon-162ec1ee.js} +2 -2
- package/dist/{icon-079f1f09.js.map → icon-162ec1ee.js.map} +1 -1
- package/dist/{icon-4ba4a133.js → icon-1ef0f3b9.js} +2 -2
- package/dist/{icon-4ba4a133.js.map → icon-1ef0f3b9.js.map} +1 -1
- package/dist/{index-e0fcee5d.js → index-61be3509.js} +2 -2
- package/dist/index-61be3509.js.map +1 -0
- package/dist/index-8076376e.js +2 -0
- package/dist/index-8076376e.js.map +1 -0
- package/dist/lib/canvas.es.js +1 -1
- package/dist/lib/canvas.js +1 -1
- package/dist/lib/context-menu.es.js +1 -1
- package/dist/lib/context-menu.js +1 -1
- package/dist/lib/properties/field-picker.es.js +1 -1
- package/dist/lib/properties/field-picker.js +1 -1
- package/dist/lib/properties/flexible-table.es.js +1 -1
- package/dist/lib/properties/flexible-table.js +1 -1
- package/dist/lib/properties.es.js +1 -1
- package/dist/lib/properties.js +1 -1
- package/dist/styles/common-canvas.min.css +1 -1
- package/dist/styles/common-canvas.min.css.map +1 -1
- package/dist/{toolbar-011cf35e.js → toolbar-59ce5251.js} +2 -2
- package/dist/{toolbar-011cf35e.js.map → toolbar-59ce5251.js.map} +1 -1
- package/dist/{toolbar-91cb4665.js → toolbar-bb5bee87.js} +2 -2
- package/dist/{toolbar-91cb4665.js.map → toolbar-bb5bee87.js.map} +1 -1
- package/locales/common-properties/locales/en.json +4 -0
- package/locales/common-properties/locales/eo.json +4 -0
- package/package.json +3 -3
- package/src/common-canvas/svg-canvas-renderer.js +5 -0
- package/src/common-properties/actions.js +5 -0
- package/src/common-properties/components/components.scss +1 -1
- package/src/common-properties/components/editor-form/editor-form.jsx +23 -3
- package/src/common-properties/constants/constants.js +2 -0
- package/src/common-properties/constants/form-constants.js +5 -2
- package/src/common-properties/controls/checkboxset/checkboxset.scss +7 -4
- package/src/common-properties/controls/expression/expression-builder/expression-select-field-function.jsx +14 -2
- package/src/common-properties/controls/expression/expression-toggle/expression-toggle.jsx +74 -0
- package/src/common-properties/controls/expression/expression-toggle/expression-toggle.scss +12 -0
- package/src/common-properties/controls/expression/expression.jsx +13 -0
- package/src/common-properties/controls/expression/expression.scss +1 -0
- package/src/common-properties/controls/expression/expressionInfo-parser.js +11 -1
- package/src/common-properties/controls/passwordfield/passwordfield.jsx +16 -14
- package/src/common-properties/controls/selectcolumns/selectcolumns.jsx +3 -3
- package/src/common-properties/form/ControlInfo.js +3 -0
- package/src/common-properties/form/EditorForm.js +12 -1
- package/src/common-properties/form/ParameterInfo.js +5 -0
- package/src/common-properties/form/UIItem.js +10 -0
- package/src/common-properties/panels/panels.scss +1 -0
- package/src/common-properties/panels/tearsheet/index.js +18 -0
- package/src/common-properties/panels/tearsheet/tearsheet.jsx +54 -0
- package/src/common-properties/panels/tearsheet/tearsheet.scss +31 -0
- package/src/common-properties/properties-controller.js +9 -0
- package/src/common-properties/properties-store.js +17 -2
- package/src/common-properties/reducers/tearsheet-states.js +29 -0
- package/stats.html +1 -1
- package/dist/common-canvas-0c35f64f.js.map +0 -1
- package/dist/common-canvas-b60fe77c.js.map +0 -1
- package/dist/common-properties-5d20f9bf.js +0 -2
- package/dist/common-properties-5d20f9bf.js.map +0 -1
- package/dist/common-properties-80b89ad2.js +0 -2
- package/dist/common-properties-80b89ad2.js.map +0 -1
- package/dist/extends-42886b42.js +0 -7
- package/dist/extends-42886b42.js.map +0 -1
- package/dist/extends-634d1af7.js.map +0 -1
- package/dist/flexible-table-72146c49.js +0 -2
- package/dist/flexible-table-fa8e4aa4.js +0 -2
- package/dist/index-ddc2e031.js +0 -2
- package/dist/index-ddc2e031.js.map +0 -1
- package/dist/index-e0fcee5d.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("./createClass-6db89a23.js"),t=require("./getPrototypeOf-bf88242f.js"),n=require("react"),i=require("react-redux"),o=require("react-intl"),a=require("./isArrayLikeObject-f3b27f64.js"),r=require("./icon-4ba4a133.js"),s=require("react-inlinesvg"),l=require("./canvas-constants-34cdb7df.js"),c=require("./toolbar-011cf35e.js"),u=require("./datarecord-metadata-v3-schema-6b6384ff.js"),d=require("carbon-components-react"),h=require("./canvas-logger-a0f1beaa.js"),p=require("./lib/tooltip.js"),g=require("react-resize-detector"),f=require("./canvas-controller-ccb05f9f.js"),v=require("./lib/context-menu.js"),y=require("@carbon/icons-react"),m=require("./en-7a0f1db1.js"),C=require("./_baseForOwn-7d4e8506.js");function k(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=k(n),T=k(s),P=k(g),L="Find palette nodes",_="No results found.",N="Try adjusting your search to find what you're looking for.",x="Results restricted to 10 nodes. Try refining your search.",w="Show more",S="Show less",E="Flyout Palette",I="Dialog Palette";function D(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var O=function(n){t._inherits(o,n);var i=D(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={hover:!1},a.iconClicked=a.iconClicked.bind(t._assertThisInitialized(a)),a.mouseEnter=a.mouseEnter.bind(t._assertThisInitialized(a)),a.mouseLeave=a.mouseLeave.bind(t._assertThisInitialized(a)),a.mouseDown=a.mouseDown.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"iconClicked",value:function(){this.props.iconClickedMethod()}},{key:"mouseEnter",value:function(){this.setState({hover:!0})}},{key:"mouseLeave",value:function(){this.setState({hover:!1})}},{key:"mouseDown",value:function(e){e.stopPropagation()}},{key:"render",value:function(){var e=this.props.selectedIconName;return this.props.isSelected||(e=this.state.hover?this.props.hoverIconName:this.props.deselectedIconName),b.default.createElement("div",{draggable:"false",className:"palette-three-way-icon-div"},b.default.createElement("img",{src:e,draggable:"false",onClick:this.iconClicked,onMouseEnter:this.mouseEnter,onMouseLeave:this.mouseLeave,onMouseDown:this.mouseDown}))}}]),o}(b.default.Component),A=O;function M(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var z=function(n){t._inherits(o,n);var i=M(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={},a.mouseDown=a.mouseDown.bind(t._assertThisInitialized(a)),a.doubleClick=a.doubleClick.bind(t._assertThisInitialized(a)),a.close=a.close.bind(t._assertThisInitialized(a)),a.gridViewSelected=a.gridViewSelected.bind(t._assertThisInitialized(a)),a.listViewSelected=a.listViewSelected.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"mouseDown",value:function(e){this.props.mouseDownMethod(e)}},{key:"doubleClick",value:function(e){this.props.windowMaximizeMethod(e)}},{key:"close",value:function(e){this.props.canvasController.closePalette(e)}},{key:"gridViewSelected",value:function(){this.props.showGridMethod(!0)}},{key:"listViewSelected",value:function(){this.props.showGridMethod(!1)}},{key:"render",value:function(){return b.default.createElement("div",{className:"palette-dialog-topbar",onMouseDown:this.mouseDown,onDoubleClick:this.doubleClick},b.default.createElement("span",{className:"left-navbar"},b.default.createElement(A,{iconClickedMethod:this.gridViewSelected,isSelected:this.props.showGrid,selectedIconName:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20enable-background%3D%22new%200%200%2016%2016%22%3E%3Cg%20fill%3D%22%233D70B2%22%3E%3Cpath%20d%3D%22m9.8%200h6.2v6.2h-6.2z%22%2F%3E%3Cpath%20d%3D%22M8.6%2C0H7.4H0v7.4v1.2V16h7.4h1.2H16V8.6V7.4H8.6V0z%20M7.4%2C14.8H1.2V8.6h6.2V14.8z%20M14.8%2C8.6v6.2H8.6V8.6%20%20H14.8z%20M1.2%2C7.4V1.2h6.2v6.2H1.2z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",hoverIconName:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20enable-background%3D%22new%200%200%2016%2016%22%3E%3Cg%20fill%3D%22%235596e6%22%3E%3Cpath%20d%3D%22m9.8%200h6.2v6.2h-6.2z%22%2F%3E%3Cpath%20d%3D%22M8.6%2C0H7.4H0v7.4v1.2V16h7.4h1.2H16V8.6V7.4H8.6V0z%20M7.4%2C14.8H1.2V8.6h6.2V14.8z%20M14.8%2C8.6v6.2H8.6V8.6%20%20H14.8z%20M1.2%2C7.4V1.2h6.2v6.2H1.2z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",deselectedIconName:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20enable-background%3D%22new%200%200%2016%2016%22%3E%3Cg%20fill%3D%22%23C7C7C7%22%3E%3Cpath%20d%3D%22m9.8%200h6.2v6.2h-6.2z%22%2F%3E%3Cpath%20d%3D%22M8.6%2C0H7.4H0v7.4v1.2V16h7.4h1.2H16V8.6V7.4H8.6V0z%20M7.4%2C14.8H1.2V8.6h6.2V14.8z%20M14.8%2C8.6v6.2H8.6V8.6%20%20H14.8z%20M1.2%2C7.4V1.2h6.2v6.2H1.2z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"}),b.default.createElement(A,{iconClickedMethod:this.listViewSelected,isSelected:!this.props.showGrid,selectedIconName:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20enable-background%3D%22new%200%200%2016%2016%22%3E%3Cg%20fill%3D%22%233D70B2%22%3E%3Cpath%20d%3D%22m0%2014.5h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%2014.5h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%209.7h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%209.7h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%204.8h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%204.8h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%200h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%200h12.7v1.5h-12.7z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",hoverIconName:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20enable-background%3D%22new%200%200%2016%2016%22%3E%3Cg%20fill%3D%22%235596e6%22%3E%3Cpath%20d%3D%22m0%2014.5h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%2014.5h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%209.7h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%209.7h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%204.8h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%204.8h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%200h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%200h12.7v1.5h-12.7z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",deselectedIconName:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20enable-background%3D%22new%200%200%2016%2016%22%3E%3Cg%20fill%3D%22%23C7C7C7%22%3E%3Cpath%20d%3D%22m0%2014.5h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%2014.5h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%209.7h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%209.7h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%204.8h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%204.8h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%200h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%200h12.7v1.5h-12.7z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"})),b.default.createElement("span",{className:"right-navbar"},b.default.createElement("a",{className:"secondary-action",onClick:this.close},b.default.createElement("img",{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20style%3D%22fill%3A%233D70B2%22%20d%3D%22M20.293%2010.293L16%2014.586l-4.293-4.293-1.414%201.414L14.586%2016l-4.293%204.293%201.414%201.414L16%2017.414l4.293%204.293%201.414-1.414L17.414%2016l4.293-4.293z%22%2F%3E%3Cpath%20style%3D%22fill%3A%233D70B2%22%20d%3D%22M16%202C8.269%202%202%208.269%202%2016s6.269%2014%2014%2014%2014-6.269%2014-14S23.731%202%2016%202zm0%2026C9.383%2028%204%2022.617%204%2016S9.383%204%2016%204s12%205.383%2012%2012-5.383%2012-12%2012z%22%2F%3E%3C%2Fsvg%3E",draggable:"false",className:"close-icon"}))))}}]),o}(b.default.Component);function R(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var H=function(n){t._inherits(o,n);var i=R(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={},a.categorySelected=a.categorySelected.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"categorySelected",value:function(e){this.props.categorySelectedMethod(e)}},{key:"render",value:function(){var e="palette-dialog-category";return this.props.selectedCategory===this.props.category.label&&(e="palette-dialog-category-selected"),b.default.createElement("div",{"data-id":this.props.category.id,className:e,onClick:this.categorySelected},this.props.category.label)}}]),o}(b.default.Component);function U(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var j=function(n){t._inherits(o,n);var i=U(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).state={},n}return e._createClass(o,[{key:"render",value:function(){for(var e=[],t=0;t<this.props.categories.length;t++)e.push(b.default.createElement(H,{key:this.props.categories[t].label,category:this.props.categories[t],selectedCategory:this.props.selectedCategory,categorySelectedMethod:this.props.categorySelectedMethod}));return b.default.createElement("div",{className:"palette-dialog-categories palette-scroll"},e)}}]),o}(b.default.Component),B="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2060%22%3E%20%3Cpath%20d%3D%22M32%2C42a1.61%2C1.61%2C0%2C0%2C1-.8-.2L9.28%2C30.15l1.6-2.94L32%2C38.47%2C53.12%2C27.21l1.6%2C2.94L32.8%2C41.84A1.71%2C1.71%2C0%2C0%2C1%2C32%2C42Z%22%2F%3E%20%3Cpath%20d%3D%22M32%2C52.05a1.72%2C1.72%2C0%2C0%2C1-.8-.2L9.28%2C40.17l1.6-2.94L32%2C48.48%2C53.12%2C37.23l1.6%2C2.94L32.8%2C51.85A1.72%2C1.72%2C0%2C0%2C1%2C32%2C52.05Z%22%2F%3E%20%3Cpath%20d%3D%22M32%2C32a1.72%2C1.72%2C0%2C0%2C1-.8-.2L9.28%2C20.14a1.66%2C1.66%2C0%2C0%2C1%2C0-2.94L31.2%2C5.52a1.68%2C1.68%2C0%2C0%2C1%2C1.6%2C0L54.72%2C17.2a1.66%2C1.66%2C0%2C0%2C1%2C.69%2C2.26%2C1.74%2C1.74%2C0%2C0%2C1-.69.68L32.8%2C31.82A1.72%2C1.72%2C0%2C0%2C1%2C32%2C32ZM13.64%2C18.67%2C32%2C28.46l18.36-9.79L32%2C8.88Z%22%2F%3E%20%3Crect%20x%3D%225.02%22%20y%3D%221.98%22%20width%3D%2253.96%22%20height%3D%2253.41%22%20fill%3D%22none%22%2F%3E%3C%2Fsvg%3E",F="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2060%22%3E%20%3Cdefs%3E%20%20%3CclipPath%20id%3D%22a%22%3E%20%20%20%3Cpolygon%20points%3D%2217.28%204.63%2026.88%2014.07%2024.74%2015.87%2018.94%2010.35%2018.94%2026.29%2015.78%2026.29%2015.78%2010.35%209.97%2016.12%207.91%2014.04%2017.28%204.63%22%2F%3E%20%20%3C%2FclipPath%3E%20%20%3CclipPath%20id%3D%22b%22%3E%20%20%20%3Cpath%20d%3D%22M32.39%2C6.36l.2.1%2C20.35%2C11a2.7%2C2.7%2C0%2C0%2C1%2C1.11%2C1.11%2C2.74%2C2.74%2C0%2C0%2C1-.89%2C3.59l-.22.13L33%2C33a2.66%2C2.66%2C0%2C0%2C1-2.51%2C0l-6-3.13a1.83%2C1.83%2C0%2C1%2C1%2C1.69-3.25l5.57%2C2.89%2C18-9.69L30.85%2C9.68A1.83%2C1.83%2C0%2C0%2C1%2C30%2C7.39l.09-.19A1.83%2C1.83%2C0%2C0%2C1%2C32.39%2C6.36Z%22%20%20%20clip-path%3D%22url%28%23a%29%22%2F%3E%20%20%3C%2FclipPath%3E%20%3C%2Fdefs%3E%20%3Cpolygon%20points%3D%2217.28%204.63%2026.88%2014.07%2024.74%2015.87%2018.94%2010.35%2018.94%2026.29%2015.78%2026.29%2015.78%2010.35%209.97%2016.12%207.91%2014.04%2017.28%204.63%22%2F%3E%20%3Cpath%20d%3D%22M32.39%2C6.36l.2.1%2C20.35%2C11a2.7%2C2.7%2C0%2C0%2C1%2C1.11%2C1.11%2C2.74%2C2.74%2C0%2C0%2C1-.89%2C3.59l-.22.13L33%2C33a2.66%2C2.66%2C0%2C0%2C1-2.51%2C0l-6-3.13a1.83%2C1.83%2C0%2C1%2C1%2C1.69-3.25l5.57%2C2.89%2C18-9.69L30.85%2C9.68A1.83%2C1.83%2C0%2C0%2C1%2C30%2C7.39l.09-.19A1.83%2C1.83%2C0%2C0%2C1%2C32.39%2C6.36Z%22%2F%3E%20%3Cpath%20d%3D%22M53%2C28.53l1.62%2C3L32.52%2C43.43a1.59%2C1.59%2C0%2C0%2C1-.8.21%2C1.66%2C1.66%2C0%2C0%2C1-.81-.21L8.8%2C31.53l1.61-3L31.72%2C40Z%22%2F%3E%20%3Cpath%20d%3D%22M53%2C38.74l1.62%2C3L32.52%2C53.64a1.69%2C1.69%2C0%2C0%2C1-.8.2%2C1.76%2C1.76%2C0%2C0%2C1-.81-.2L8.8%2C41.73l1.61-3L31.72%2C50.21Z%22%2F%3E%3C%2Fsvg%3E";function G(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Y=function(n){t._inherits(o,n);var i=G(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={},a.ghostData=null,a.onDragStart=a.onDragStart.bind(t._assertThisInitialized(a)),a.onDragEnd=a.onDragEnd.bind(t._assertThisInitialized(a)),a.onDoubleClick=a.onDoubleClick.bind(t._assertThisInitialized(a)),a.onMouseOver=a.onMouseOver.bind(t._assertThisInitialized(a)),a.onMouseLeave=a.onMouseLeave.bind(t._assertThisInitialized(a)),a.onMouseDown=a.onMouseDown.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"onMouseDown",value:function(){this.props.canvasController.closeTip(),this.ghostData=this.props.canvasController.getGhostNode(this.props.nodeTemplate)}},{key:"onDragStart",value:function(e){this.props.canvasController.nodeTemplateDragStart(this.props.nodeTemplate),e.dataTransfer.setData(l.DND_DATA_TEXT,""),this.ghostData&&e.dataTransfer.setDragImage(this.ghostData.element,this.ghostData.centerX,this.ghostData.centerY)}},{key:"onDragEnd",value:function(){this.props.canvasController.nodeTemplateDragEnd()}},{key:"onDoubleClick",value:function(){this.props.canvasController.createAutoNode&&this.props.canvasController.createAutoNode(this.props.nodeTemplate)}},{key:"onMouseOver",value:function(e){if(0===e.buttons){var t=this.props.category.empty_text?{app_data:{ui_data:{label:this.props.category.empty_text}}}:this.props.nodeTemplate;this.props.canvasController.openTip({id:"paletteTip_"+this.props.nodeTemplate.op,type:l.TIP_TYPE_PALETTE_ITEM,targetObj:e.currentTarget,nodeTemplate:t,category:this.props.category})}}},{key:"onMouseLeave",value:function(){this.props.canvasController.closeTip()}},{key:"render",value:function(){var e="";a.has_1(this.props.nodeTemplate,"app_data.ui_data.label")&&(e=this.props.nodeTemplate.app_data.ui_data.label);var t=b.default.createElement("div",{className:"node-icon"});if(a.has_1(this.props.nodeTemplate,"app_data.ui_data.image")){var n=this.props.nodeTemplate.app_data.ui_data.image;n===l.USE_DEFAULT_ICON?n=B:n===l.USE_DEFAULT_EXT_ICON&&(n=F),t=n.endsWith(".svg")?b.default.createElement(T.default,{src:n,className:"node-icon",alt:e}):b.default.createElement("img",{src:n,className:"node-icon",alt:e})}var i=this.props.isEditingEnabled?"true":"false",o="palette-dialog-grid-node-text";return this.props.category&&0===this.props.category.node_types.length&&this.props.category.empty_text&&(e=this.props.category.empty_text,i="false",o="palette-dialog-grid-node-text-warning",t=b.default.createElement(r.Icon,{type:l.CANVAS_CARBON_ICONS.WARNING_UNFILLED,className:"palette-dialog-grid-node-icon-warning",draggable:"false"})),b.default.createElement("div",{id:this.props.nodeTemplate.id,"data-id":this.props.nodeTemplate.op,draggable:i,onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave,onMouseDown:this.props.isEditingEnabled?this.onMouseDown:null,onDragStart:this.props.isEditingEnabled?this.onDragStart:null,onDragEnd:this.props.isEditingEnabled?this.onDragEnd:null,onDoubleClick:this.props.isEditingEnabled?this.onDoubleClick:null,className:"palette-dialog-grid-node-outer"},b.default.createElement("div",{className:"palette-dialog-grid-node-inner"},b.default.createElement("div",{className:"palette-dialog-grid-node-icon"},t),b.default.createElement("div",{className:o},e)))}}]),o}(b.default.Component),X=Y;function W(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var V=function(n){t._inherits(o,n);var i=W(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).state={},n}return e._createClass(o,[{key:"render",value:function(){var e=[];if(this.props.category&&this.props.category.node_types&&0===this.props.category.node_types.length&&this.props.category.empty_text)e.push(b.default.createElement(X,{key:"pal_grid_node_empty",category:this.props.category,nodeTemplate:{},canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled}));else for(var t=0;t<this.props.nodeTypes.length;t++)e.push(b.default.createElement(X,{key:"pal_grid_node_"+t,category:this.props.category,nodeTemplate:this.props.nodeTypes[t],canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled}));return b.default.createElement("div",{width:"100%",className:"palette-scroll"},e)}}]),o}(b.default.Component);function K(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Z=function(n){t._inherits(o,n);var i=K(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={showFullDescription:!1},a.ghostData=null,a.showFullDescription=a.showFullDescription.bind(t._assertThisInitialized(a)),a.showShortDescription=a.showShortDescription.bind(t._assertThisInitialized(a)),a.onDragStart=a.onDragStart.bind(t._assertThisInitialized(a)),a.onDragEnd=a.onDragEnd.bind(t._assertThisInitialized(a)),a.onDoubleClick=a.onDoubleClick.bind(t._assertThisInitialized(a)),a.onMouseOver=a.onMouseOver.bind(t._assertThisInitialized(a)),a.onMouseLeave=a.onMouseLeave.bind(t._assertThisInitialized(a)),a.onMouseDown=a.onMouseDown.bind(t._assertThisInitialized(a)),a.onKeyPress=a.onKeyPress.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"onMouseDown",value:function(){this.props.canvasController.closeTip(),this.ghostData=this.props.canvasController.getGhostNode(this.props.nodeTypeInfo.nodeType)}},{key:"onDragStart",value:function(e){this.props.canvasController.nodeTemplateDragStart(this.props.nodeTypeInfo.nodeType),e.dataTransfer.setData(l.DND_DATA_TEXT,""),this.ghostData&&e.dataTransfer.setDragImage(this.ghostData.element,this.ghostData.centerX,this.ghostData.centerY)}},{key:"onKeyPress",value:function(e){" "!==e.key&&"Space"!==e.code&&32!==e.keyCode||this.onDoubleClick()}},{key:"onDragEnd",value:function(){this.props.canvasController.nodeTemplateDragEnd()}},{key:"onDoubleClick",value:function(){this.props.canvasController.createAutoNode&&this.props.canvasController.createAutoNode(this.props.nodeTypeInfo.nodeType)}},{key:"onMouseOver",value:function(e){if(!this.props.isDisplaySearchResult&&0===e.buttons){var t=this.props.nodeTypeInfo.category.empty_text?{app_data:{ui_data:{label:this.props.nodeTypeInfo.category.empty_text}}}:this.props.nodeTypeInfo.nodeType;this.props.canvasController.openTip({id:"paletteTip_"+this.props.nodeTypeInfo.nodeType.op,type:l.TIP_TYPE_PALETTE_ITEM,targetObj:e.currentTarget,nodeTemplate:t,category:this.props.nodeTypeInfo.category})}}},{key:"onMouseLeave",value:function(){this.props.canvasController.closeTip()}},{key:"getHighlightedCategoryLabel",value:function(){return this.getHighlightedText(this.props.nodeTypeInfo.category.label,this.props.nodeTypeInfo.occurrenceInfo.catLabelOccurrences)}},{key:"getHighlightedLabel",value:function(){return this.getHighlightedText(this.props.nodeTypeInfo.nodeType.app_data.ui_data.label,this.props.nodeTypeInfo.occurrenceInfo.nodeLabelOccurrences)}},{key:"getHighlightedDesc",value:function(){var e=this.props.nodeTypeInfo.nodeType.app_data.ui_data.description,t=this.props.nodeTypeInfo.occurrenceInfo.nodeDescOccurrences,n=!1;if(e.length>150&&(n=!0,!this.state.showFullDescription)){var i=this.getAbbreviatedDescription(e,t,150);e=i.abbrDesc,t=i.occurrences}var o=this.getHighlightedText(e,t);if(n)if(this.state.showFullDescription){var a=this.props.intl.formatMessage({id:"palette.flyout.search.less",defaultMessage:S});o.push(b.default.createElement("div",{key:"l_btn",className:"palette-list-item-desc-button",onClick:this.showShortDescription},a))}else{var r=this.props.intl.formatMessage({id:"palette.flyout.search.more",defaultMessage:w});o.push(b.default.createElement("div",{key:"m_btn",className:"palette-list-item-desc-button",onClick:this.showFullDescription},r))}return o}},{key:"getAbbreviatedDescription",value:function(e,t,n){if(0===t.length)return{abbrDesc:e.substring(0,n)+" ...",occurrences:t};var i=t[0].start,o=e.length-i,a="",r=0;return i<n?(r=0,a=e.substring(r,n)+" ..."):o>n?(r=i,a="... "+e.substring(r,i+n)+" ...",r-=4):(r=e.length-n,a="... "+e.substring(r,e.length),r-=4),{abbrDesc:a,occurrences:t.map((function(e){return{start:e.start-r,end:e.end-r}}))}}},{key:"getHighlightedText",value:function(e,t){if(!t||0===t.length)return[b.default.createElement("span",{key:"o"},e)];var n=[],i=0,o="";return t.forEach((function(a,r){o=e.substring(i,a.start),n.push(b.default.createElement("span",{key:"s"+r},o)),o=e.substring(a.start,a.end),n.push(b.default.createElement("mark",{key:"m"+r},o)),i=a.end,r===t.length-1&&a.end<e.length&&(o=e.substring(a.end),n.push(b.default.createElement("span",{key:"f"+r},o)))})),n}},{key:"showFullDescription",value:function(){this.setState({showFullDescription:!0})}},{key:"showShortDescription",value:function(){this.setState({showFullDescription:!1})}},{key:"imageDrag",value:function(){return!1}},{key:"render",value:function(){var e=null,t=this.props.isEditingEnabled?"true":"false",n=null;if(a.has_1(this.props.nodeTypeInfo.nodeType,"app_data.ui_data.image")){var i=this.props.nodeTypeInfo.nodeType.app_data.ui_data.palette_image?this.props.nodeTypeInfo.nodeType.app_data.ui_data.palette_image:this.props.nodeTypeInfo.nodeType.app_data.ui_data.image;i===l.USE_DEFAULT_ICON?i=B:i===l.USE_DEFAULT_EXT_ICON&&(i=F),n=i.endsWith(".svg")?b.default.createElement(T.default,{src:i,className:"palette-list-item-icon",draggable:"false"}):b.default.createElement("img",{src:i,className:"palette-list-item-icon",draggable:"false"})}!a.has_1(this.props.nodeTypeInfo.nodeType,"app_data.ui_data.label")||!this.props.isPaletteOpen&&n||(e=this.props.isDisplaySearchResult?this.getHighlightedLabel():b.default.createElement("span",null,this.props.nodeTypeInfo.nodeType.app_data.ui_data.label));var o=this.props.isShowRanking&&this.props.isDisplaySearchResult&&a.has_1(this.props.nodeTypeInfo,"occurrenceInfo.ranking")?b.default.createElement("span",null,this.props.nodeTypeInfo.occurrenceInfo.ranking):null;0===this.props.nodeTypeInfo.category.node_types.length&&this.props.nodeTypeInfo.category.empty_text&&(this.props.isPaletteOpen&&(e=this.props.nodeTypeInfo.category.empty_text),t="false",n=b.default.createElement(r.Icon,{type:l.CANVAS_CARBON_ICONS.WARNING_UNFILLED,className:"palette-list-item-icon-warning",draggable:"false"}));var s=this.props.isDisplaySearchResult?"palette-list-item search-result":"palette-list-item",c=this.props.isDisplaySearchResult?b.default.createElement("div",{className:"palette-list-item-category-label"},this.getHighlightedCategoryLabel()):null,u=this.props.isDisplaySearchResult&&a.has_1(this.props.nodeTypeInfo.nodeType,"app_data.ui_data.description")&&this.props.nodeTypeInfo.nodeType.app_data.ui_data.description?b.default.createElement("div",{className:"palette-list-item-description"},this.getHighlightedDesc()):null,d=e?b.default.createElement("div",{className:"palette-list-item-text-div",tabIndex:"-1"},e):null;return b.default.createElement("div",{id:this.props.nodeTypeInfo.nodeType.id,"data-id":this.props.nodeTypeInfo.nodeType.op,tabIndex:0,draggable:t,className:s,onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave,onKeyPress:this.props.isEditingEnabled?this.onKeyPress:null,onMouseDown:this.props.isEditingEnabled?this.onMouseDown:null,onDragStart:this.props.isEditingEnabled?this.onDragStart:null,onDragEnd:this.props.isEditingEnabled?this.onDragEnd:null,onDoubleClick:this.props.isEditingEnabled?this.onDoubleClick:null},c,b.default.createElement("div",{className:"palette-list-item-icon-and-text",tabIndex:"-1"},n,d,o),u)}}]),o}(b.default.Component),q=o.injectIntl(Z);function $(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var J=function(n){t._inherits(o,n);var i=$(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).state={},n}return e._createClass(o,[{key:"render",value:function(){var e=[];if(this.props.category&&this.props.category.node_types&&0===this.props.category.node_types.length&&this.props.category.empty_text)e.push(b.default.createElement("div",{key:"item_empty"},b.default.createElement(q,{nodeTypeInfo:{nodeType:{},category:this.props.category},isDisplaySearchResult:!1,canvasController:this.props.canvasController,isPaletteOpen:this.props.isPaletteOpen,isEditingEnabled:this.props.isEditingEnabled})));else for(var t=0;t<this.props.nodeTypeInfos.length;t++){var n="item_"+t;e.push(b.default.createElement(q,{key:n,nodeTypeInfo:this.props.nodeTypeInfos[t],isDisplaySearchResult:!1,canvasController:this.props.canvasController,isPaletteOpen:this.props.isPaletteOpen,isEditingEnabled:this.props.isEditingEnabled}))}return b.default.createElement("div",{width:"100%",draggable:"false",className:"palette-content-list palette-scroll"},e)}}]),o}(b.default.Component);function Q(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var ee=function(n){t._inherits(o,n);var i=Q(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={selectedCategory:""},a.categorySelected=a.categorySelected.bind(t._assertThisInitialized(a)),a.getUniqueCategories=a.getUniqueCategories.bind(t._assertThisInitialized(a)),a.getSelectedCategory=a.getSelectedCategory.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"getUniqueCategories",value:function(e){var t=[];if(e)for(var n=0;n<e.length;n++)-1===t.indexOf(e[n].label)&&t.push(e[n]);return t}},{key:"getSelectedCategory",value:function(e){var t={};if(e)for(var n=0;n<e.length;n++)e[n].label===this.state.selectedCategory&&(t=e[n]);return t}},{key:"categorySelected",value:function(e){this.setState({selectedCategory:e.target.firstChild.data})}},{key:"render",value:function(){var e=this.getUniqueCategories(this.props.paletteJSON.categories),t=this.getSelectedCategory(this.props.paletteJSON.categories),n=t&&t.node_types?t.node_types:[],i=n.map((function(e){return{nodeType:e,category:t}})),o=this.props.showGrid?b.default.createElement(V,{category:t,nodeTypes:n,canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled}):b.default.createElement(J,{category:t,nodeTypeInfos:i,canvasController:this.props.canvasController,isPaletteOpen:!0,isEditingEnabled:this.props.isEditingEnabled});return b.default.createElement("div",{className:"palette-dialog-content",ref:"palettecontent"},b.default.createElement(j,{categories:e,selectedCategory:this.state.selectedCategory,categorySelectedMethod:this.categorySelected}),o)}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.paletteJSON&&e.paletteJSON.categories&&e.paletteJSON.categories.length>0&&""===t.selectedCategory?{selectedCategory:e.paletteJSON.categories[0].label}:{}}}]),o}(b.default.Component);function te(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var ne=function(n){t._inherits(o,n);var i=te(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={xPos:100,yPos:100,showGrid:!0},a.showGrid=a.showGrid.bind(t._assertThisInitialized(a)),a.mouseDownOnTopBar=a.mouseDownOnTopBar.bind(t._assertThisInitialized(a)),a.mouseDownOnPalette=a.mouseDownOnPalette.bind(t._assertThisInitialized(a)),a.mouseMove=a.mouseMove.bind(t._assertThisInitialized(a)),a.mouseUp=a.mouseUp.bind(t._assertThisInitialized(a)),a.windowResize=a.windowResize.bind(t._assertThisInitialized(a)),a.windowMaximize=a.windowMaximize.bind(t._assertThisInitialized(a)),a.getPaletteDiv=a.getPaletteDiv.bind(t._assertThisInitialized(a)),a.resizePalette=a.resizePalette.bind(t._assertThisInitialized(a)),a.movePalette=a.movePalette.bind(t._assertThisInitialized(a)),a.setResizingCursors=a.setResizingCursors.bind(t._assertThisInitialized(a)),a.setSizingHoverEdge=a.setSizingHoverEdge.bind(t._assertThisInitialized(a)),a.snapToWidth=a.snapToWidth.bind(t._assertThisInitialized(a)),a.snapToHeight=a.snapToHeight.bind(t._assertThisInitialized(a)),a.removePx=a.removePx.bind(t._assertThisInitialized(a)),a.dragging=!1,a.dragOffsetY=0,a.dragOffsetX=0,a.verticalSizingAction="",a.verticalSizingHover="",a.horizontalSizingAction="",a.hoizontalSizingHover="",a.savedWidth=0,a.savedLeft=0,a.savedHeight=0,a.savedTop=0,a.hoverZoneSize=3,a.totalHoverZoneSize=2*a.hoverZoneSize,a.adjustedWidth=137,a.adjustedHeight=51,a.adjustedScrollBarWidth=15,a.isMaximized=!1,a.paletteNodes=[],a.hackPaletteOffset=46,a.hackPaletteTopOffset=a.hackPaletteOffset+4,window.addEventListener("mousemove",a.mouseMove,!1),window.addEventListener("mouseup",a.mouseUp,!1),window.addEventListener("resize",a.windowResize,!1),a}return e._createClass(o,[{key:"componentDidUpdate",value:function(){this.windowResize()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mousemove",this.mouseMove),window.removeEventListener("mouseup",this.mouseUp),window.removeEventListener("resize",this.windowResize)}},{key:"getAdjustedMousePositionBottom",value:function(e,t){var n=e.clientY;return n>t.offsetTop+t.offsetHeight-this.hoverZoneSize&&(n=t.offsetTop+t.offsetHeight-this.hoverZoneSize),n}},{key:"getAdjustedMousePositionLeft",value:function(e,t){var n=e.clientX;return n<t.offsetLeft+this.hoverZoneSize&&(n=t.offsetLeft+this.hoverZoneSize),n}},{key:"getAdjustedMousePositionRight",value:function(e,t){var n=e.clientX;return n>t.offsetLeft+t.offsetWidth-this.hoverZoneSize&&(n=t.offsetLeft+t.offsetWidth-this.hoverZoneSize),n}},{key:"getAdjustedMousePositionTop",value:function(e,t){var n=e.clientY;return n<t.offsetTop+this.hoverZoneSize&&(n=t.offsetTop+this.hoverZoneSize),n}},{key:"getPaletteDiv",value:function(){return this.refs.palette}},{key:"getStyleProperty",value:function(e,t){var n=e.charAt(0),i=e.substring(1),o="#"===n?document.getElementById(i):document.getElementsByClassName(i)[0];return window.getComputedStyle(o,null).getPropertyValue(t)}},{key:"setResizingCursors",value:function(e){var t=this.getPaletteDiv();this.setSizingHoverEdge(e,t),"top"===this.verticalSizingHover?"left"===this.horizontalSizingHover?t.style.cursor="nwse-resize":"right"===this.horizontalSizingHover?t.style.cursor="nesw-resize":t.style.cursor="ns-resize":"bottom"===this.verticalSizingHover?"left"===this.horizontalSizingHover?t.style.cursor="nesw-resize":"right"===this.horizontalSizingHover?t.style.cursor="nwse-resize":t.style.cursor="ns-resize":"left"===this.horizontalSizingHover||"right"===this.horizontalSizingHover?t.style.cursor="ew-resize":t.style.cursor="default"}},{key:"setContentDivHeight",value:function(e,t){var n=t-this.removePx(this.getStyleProperty(".palette-dialog-topbar","height"))-this.totalHoverZoneSize+"px",i=e.childNodes[1];i.style.height=n,i.childNodes[0].style.height=n,i.childNodes[1].style.height=n,i.childNodes[2].style.height=n}},{key:"setSizingHoverEdge",value:function(e,t){e.clientX>t.offsetLeft&&e.clientX<t.offsetLeft+this.totalHoverZoneSize?this.horizontalSizingHover="left":e.clientX<t.offsetLeft+t.offsetWidth&&e.clientX>t.offsetLeft+t.offsetWidth-this.totalHoverZoneSize?this.horizontalSizingHover="right":(this.horizontalSizingHover="",this.horizontalSizingAction=""),e.clientY>t.offsetTop+this.hackPaletteTopOffset&&e.clientY<t.offsetTop+this.hackPaletteTopOffset+this.totalHoverZoneSize?this.verticalSizingHover="top":e.clientY<t.offsetTop+t.offsetHeight+this.hackPaletteOffset&&e.clientY>t.offsetTop+t.offsetHeight+this.hackPaletteOffset-this.totalHoverZoneSize?this.verticalSizingHover="bottom":(this.verticalSizingHover="",this.verticalSizingAction="")}},{key:"mouseDownOnTopBar",value:function(e){this.dragging=!0;var t=this.getPaletteDiv();this.dragOffsetX=e.clientX-t.offsetLeft,this.dragOffsetY=e.clientY-t.offsetTop}},{key:"mouseDownOnPalette",value:function(e){var t=this.getPaletteDiv();""===this.verticalSizingHover&&""===this.horizontalSizingHover||(this.verticalSizingAction=this.verticalSizingHover,this.horizontalSizingAction=this.horizontalSizingHover,this.savedWidth=t.offsetWidth,this.savedLeft=t.offsetLeft,this.savedHeight=t.offsetHeight,this.savedTop=t.offsetTop)}},{key:"mouseMove",value:function(e){""!==this.verticalSizingAction||""!==this.horizontalSizingAction?this.resizePalette(e):!0===this.dragging?this.movePalette(e):this.setResizingCursors(e)}},{key:"mouseUp",value:function(){var e=this.getPaletteDiv();if(this.state.showGrid&&""!==this.horizontalSizingAction){var t=this.removePx(e.style.width);""!==t&&(t=this.snapToWidth(t)),e.style.width=t+"px";var n=e.childNodes[1].childNodes[1];n.clientHeight<n.scrollHeight&&(e.style.width=t+this.adjustedScrollBarWidth+"px")}if(""!==this.verticalSizingAction){var i=this.removePx(e.style.height);if(""!==i){var o=this.snapToHeight(i);e.style.height=o+"px",this.setContentDivHeight(e,o)}}this.dragging=!1,this.verticalSizingAction="",this.horizontalSizingAction="",this.verticalSizingHover="",this.horizontalSizingHover=""}},{key:"movePalette",value:function(e){var t=this.getPaletteDiv(),n=document.getElementById(this.props.parentDivId),i=e.clientX-this.dragOffsetX,o=e.clientY-this.dragOffsetY;i<n.offsetLeft+this.hoverZoneSize&&(i=n.offsetLeft+this.hoverZoneSize),o<n.offsetTop+this.hoverZoneSize&&(o=n.offsetTop+this.hoverZoneSize),i+t.offsetWidth>n.offsetLeft+n.offsetWidth&&(i=n.offsetLeft+n.offsetWidth-t.offsetWidth-this.hoverZoneSize),o+t.offsetHeight>n.offsetTop+n.offsetHeight&&(o=n.offsetTop+n.offsetHeight-t.offsetHeight-this.hoverZoneSize),t.style.left=i+"px",t.style.top=o+"px"}},{key:"removePx",value:function(e){return parseInt(e.substring(0,e.indexOf("px")),10)}},{key:"resizePalette",value:function(e){var t=this.getPaletteDiv(),n=document.getElementById(this.props.parentDivId);this.isMaximized=!1;var i=this.removePx(this.getStyleProperty(".palette-dialog-grid-node-outer","width"))+this.removePx(this.getStyleProperty(".palette-dialog-categories","min-width"))+2*this.hoverZoneSize,o=this.removePx(this.getStyleProperty(".palette-dialog-grid-node-outer","height"))+this.removePx(this.getStyleProperty(".palette-dialog-topbar","height"))+2*this.hoverZoneSize;if("left"===this.horizontalSizingAction){var a=this.getAdjustedMousePositionLeft(e,n),r=this.savedWidth-(a-this.savedLeft);r<=i?t.style.width=i+"px":(t.style.width=r+"px",t.style.left=a+"px")}if("right"===this.horizontalSizingAction){var s=this.getAdjustedMousePositionRight(e,n)-this.savedLeft;s<=i&&(s=i),t.style.width=s+"px"}if("top"===this.verticalSizingAction){var l=this.getAdjustedMousePositionTop(e,n),c=this.savedHeight-(l-this.savedTop);c<=o?(t.style.height=o+"px",this.setContentDivHeight(t,this.minHeight)):(t.style.height=c+"px",t.style.top=l-this.dragOffsetY+"px",this.setContentDivHeight(t,c))}if("bottom"===this.verticalSizingAction){var u=this.getAdjustedMousePositionBottom(e,n)-this.savedTop-this.hackPaletteOffset;u<=o&&(u=o),t.style.height=u+"px",this.setContentDivHeight(t,u)}}},{key:"snapToWidth",value:function(e){var t=this.removePx(this.getStyleProperty(".palette-dialog-grid-node-outer","width"));return Math.round((e-this.adjustedWidth)/t)*t+this.adjustedWidth}},{key:"snapToHeight",value:function(e){var t=this.state.showGrid?this.removePx(this.getStyleProperty(".palette-dialog-grid-node-outer","height")):this.removePx(this.getStyleProperty(".palette-list-item","height"));return Math.round((e-this.adjustedHeight)/t)*t+this.adjustedHeight}},{key:"windowResize",value:function(){var e=this.getPaletteDiv(),t=document.getElementById(this.props.parentDivId);if(t)if(this.isMaximized){var n=t.offsetLeft+this.hoverZoneSize;e.style.left=n+"px";var i=t.offsetWidth-this.totalHoverZoneSize;e.style.width=i+"px";var o=t.offsetTop+this.hoverZoneSize;e.style.top=o+"px";var a=t.offsetHeight-this.totalHoverZoneSize;e.style.height=a+"px",this.setContentDivHeight(e,a)}else{if(e.offsetLeft+e.offsetWidth+this.hoverZoneSize>t.offsetLeft+t.offsetWidth){var r=t.offsetLeft+t.offsetWidth-e.offsetWidth-this.hoverZoneSize;e.style.left=r+"px"}var s=t.offsetWidth-this.totalHoverZoneSize;if(s<e.offsetWidth&&(e.style.width=s+"px",e.style.left=t.offsetLeft+t.offsetWidth-e.offsetWidth-this.hoverZoneSize+"px"),e.offsetTop+e.offsetHeight+this.hoverZoneSize>t.offsetTop+t.offsetHeight){var l=t.offsetTop+t.offsetHeight-e.offsetHeight-this.hoverZoneSize;e.style.top=l+"px"}var c=t.offsetHeight-this.totalHoverZoneSize;c<e.offsetHeight&&(e.style.height=c+"px",e.style.top=t.offsetTop+t.offsetHeight-e.offsetHeight-this.hoverZoneSize+"px",this.setContentDivHeight(e,c))}}},{key:"windowMaximize",value:function(){var e=this.getPaletteDiv(),t=document.getElementById(this.props.parentDivId);if(t)if(this.isMaximized)e.style.width=this.savedWidth+"px",e.style.left=this.savedLeft+"px",e.style.height=this.savedHeight+"px",e.style.top=this.savedTop+"px",this.setContentDivHeight(e,this.savedHeight),this.isMaximized=!1,this.windowResize();else{this.savedWidth=e.offsetWidth,this.savedLeft=e.offsetLeft,this.savedHeight=e.offsetHeight,this.savedTop=e.offsetTop;var n=t.offsetWidth-this.totalHoverZoneSize+1;e.style.width=n+"px",e.style.left=t.offsetLeft+this.hoverZoneSize+"px";var i=t.offsetHeight-this.totalHoverZoneSize+1;e.style.height=i+"px",e.style.top=t.offsetTop+this.hoverZoneSize+"px",this.setContentDivHeight(e,i),this.isMaximized=!0}}},{key:"showGrid",value:function(e){this.setState({showGrid:e})}},{key:"render",value:function(){var e=this.props.showPalette?"block":"none";return b.default.createElement("nav",{"aria-label":this.props.intl.formatMessage({id:"palette.dialog.label",defaultMessage:I}),role:"navigation"},b.default.createElement("div",{className:"palette-dialog-div",ref:"palette",onMouseDown:this.mouseDownOnPalette,style:{display:e}},b.default.createElement(z,{mouseDownMethod:this.mouseDownOnTopBar,showGridMethod:this.showGrid,windowMaximizeMethod:this.windowMaximize,showGrid:this.state.showGrid,canvasController:this.props.canvasController}),b.default.createElement(ee,{paletteJSON:this.props.paletteJSON,showGrid:this.state.showGrid,canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled})))}}]),o}(b.default.Component),ie=o.injectIntl(ne),oe=a._root,ae=function(){return oe.Date.now()},re=a.isObject_1,se=ae,le=c.toNumber_1,ce=Math.max,ue=Math.min;var de=function(e,t,n){var i,o,a,r,s,l,c=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,a=o;return i=o=void 0,c=t,r=e.apply(a,n)}function g(e){return c=e,s=setTimeout(v,t),u?p(e):r}function f(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=a}function v(){var e=se();if(f(e))return y(e);s=setTimeout(v,function(e){var n=t-(e-l);return d?ue(n,a-(e-c)):n}(e))}function y(e){return s=void 0,h&&i?p(e):(i=o=void 0,r)}function m(){var e=se(),n=f(e);if(i=arguments,o=this,l=e,n){if(void 0===s)return g(l);if(d)return clearTimeout(s),s=setTimeout(v,t),p(l)}return void 0===s&&(s=setTimeout(v,t)),r}return t=le(t)||0,re(n)&&(u=!!n.leading,a=(d="maxWait"in n)?ce(le(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),m.cancel=function(){void 0!==s&&clearTimeout(s),c=0,i=l=o=s=void 0},m.flush=function(){return void 0===s?r:y(se())},m};function he(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==n.return||n.return()}finally{if(s)throw a}}}}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function ge(e,t){var n=[];if(e.node_types){var i,o=he(e.node_types);try{for(o.s();!(i=o.n()).done;){var a=i.value,r=fe(a,e,t);r&&n.push({nodeType:a,category:e,occurrenceInfo:r})}}catch(e){o.e(e)}finally{o.f()}}return n}function fe(e,t,n){if(n.length>0){var i=function(e,t){var n=ve(a.has_1(e,"label")&&e.label?e.label.toLowerCase():"",t),i=n.occurrences,o=n.hitCounts;return{catLabelOccurrences:i,catLabelHitCounts:o}}(t,n),o=i.catLabelOccurrences,r=i.catLabelHitCounts,s=function(e,t){var n=ve(a.has_1(e,"app_data.ui_data.label")&&e.app_data.ui_data.label?e.app_data.ui_data.label.toLowerCase():"",t),i=n.occurrences,o=n.hitCounts;return{nodeLabelOccurrences:i,nodeLabelHitCounts:o}}(e,n),l=s.nodeLabelOccurrences,c=s.nodeLabelHitCounts,u=function(e,t){var n=ve(a.has_1(e,"app_data.ui_data.description")&&e.app_data.ui_data.description?e.app_data.ui_data.description.toLowerCase():"",t),i=n.occurrences,o=n.hitCounts;return{nodeDescOccurrences:i,nodeDescHitCounts:o}}(e,n),d=u.nodeDescOccurrences,h=u.nodeDescHitCounts;if(o.length>0||l.length>0||d.length>0){var p=function(e,t,n,i){for(var o=0,a=0,r=0;r<i;r++)o+=e[r]+10*t[r]+n[r],e[r]+t[r]+n[r]>0&&a++;return o+50*a}(r,c,h,n.length);return{catLabelOccurrences:o,nodeLabelOccurrences:l,nodeDescOccurrences:d,ranking:p}}}return null}function ve(e,t){var n=[],i=[];return t.forEach((function(t){if(t){var o=function(e,t){var n=[],i=0,o=0,a=0;for(;o>-1&&a<20;)(o=e.indexOf(t,i))>-1&&(n.push({start:o,end:o+t.length}),i=o+t.length,a++);return n}(e,t);n=function(e,t){if(0===e.length)return t;if(0===t.length)return e;var n=[];t.forEach((function(t){var i=!1;e.forEach((function(e){t.start<=e.start&&t.end>=e.end?(e.start=t.start,e.end=t.end,i=!0):t.start>=e.start&&t.start<e.end?(t.end>=e.end&&(e.end=t.end),i=!0):t.end>e.start&&t.end<=e.end&&(t.start<e.start&&(e.start=t.start),i=!0)})),i||n.push(t)}));var i=e.concat(n);return i=i.sort((function(e,t){return e.start<t.start?-1:1}))}(n,o),i.push(o.length>0?1:0)}})),{occurrences:n,hitCounts:i}}function ye(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var me=function(n){t._inherits(o,n);var i=ye(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={isOpen:!1},a.onMouseOver=a.onMouseOver.bind(t._assertThisInitialized(a)),a.onMouseLeave=a.onMouseLeave.bind(t._assertThisInitialized(a)),a.categorySelected=a.categorySelected.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"onMouseOver",value:function(e){this.props.canvasController.openTip({id:"paletteTip_"+this.props.category.id,type:l.TIP_TYPE_PALETTE_CATEGORY,targetObj:e.currentTarget,category:this.props.category})}},{key:"onMouseLeave",value:function(){this.props.canvasController.closeTip()}},{key:"getDisplayLabel",value:function(){return!0===this.props.isPaletteOpen?this.props.category.label:!this.props.category.image&&this.props.category.label&&this.props.category.label.length>0?this.props.category.label.substr(0,3):null}},{key:"getInlineLoadingRenderCategory",value:function(){var e="";this.props.isPaletteOpen&&(e=this.props.category.loading_text);var t=b.default.createElement("div",{className:"palette-flyout-category"},b.default.createElement("div",{className:"palette-flyout-category-item-loading"},b.default.createElement(d.InlineLoading,{description:e,iconDescription:e,onSuccess:function(){return null},status:"active",successDelay:1500})));return b.default.createElement(d.AccordionItem,{className:"palette-loading-category",title:t})}},{key:"getRenderCategory",value:function(){var e=this,t=this.getTitleObj(),n=this.getContent();return b.default.createElement(d.AccordionItem,{title:t,onHeadingClick:function(t){var n=t.isOpen;return e.setState({isOpen:n})}},n)}},{key:"getTitleObj",value:function(){var e=this.getItemImage(),t=this.getItemText();return b.default.createElement("div",{className:"palette-flyout-category","data-id":a.get_1(this.props.category,"id",""),onClick:this.categorySelected,value:this.props.category.label,onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave},b.default.createElement("div",{className:"palette-flyout-category-item"},e,t))}},{key:"getItemText",value:function(){var e=null,t=this.getDisplayLabel();if(!0===this.props.isPaletteOpen){var n=this.props.category.image?"palette-flyout-category-text":"palette-flyout-category-text-no-image";e=b.default.createElement("span",{className:n},t)}else!this.props.category.image&&this.props.category.label&&this.props.category.label.length>0&&(e=b.default.createElement("span",{className:"palette-flyout-category-text-abbr"},t));return e}},{key:"getItemImage",value:function(){var e=null;return this.props.category.image&&""!==this.props.category.image&&(e=this.props.category.image.endsWith(".svg")?b.default.createElement("div",null,b.default.createElement(T.default,{src:this.props.category.image,className:"palette-flyout-category-item-icon",draggable:"false"})):b.default.createElement("div",null,b.default.createElement("img",{src:this.props.category.image,className:"palette-flyout-category-item-icon",draggable:"false"}))),e}},{key:"getContent",value:function(){var e=this;if(this.state.isOpen){var t=this.props.category.node_types.map((function(t){return{nodeType:t,category:e.props.category}}));return b.default.createElement(J,{key:this.props.category.id+"-nodes",category:this.props.category,nodeTypeInfos:t,canvasController:this.props.canvasController,isPaletteOpen:this.props.isPaletteOpen,isEditingEnabled:this.props.isEditingEnabled})}return null}},{key:"categorySelected",value:function(){this.props.categorySelectedMethod(this.props.category.id)}},{key:"render",value:function(){return this.props.category.loading_text?this.getInlineLoadingRenderCategory():this.getRenderCategory()}}]),o}(b.default.Component);function Ce(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var ke=function(n){t._inherits(o,n);var i=Ce(o);function o(){var n;return e._classCallCheck(this,o),(n=i.call(this)).state={searchString:""},n.searchOnClick=n.searchOnClick.bind(t._assertThisInitialized(n)),n.handleSearchStringChange=n.handleSearchStringChange.bind(t._assertThisInitialized(n)),n}return e._createClass(o,[{key:"handleSearchStringChange",value:function(e){var t=this,n=e.target.value||"";this.setState({searchString:n},(function(){return t.props.handleSearchStringChange(n)}))}},{key:"searchOnClick",value:function(){this.props.isPaletteOpen||this.props.canvasController.openPalette()}},{key:"render",value:function(){var e=this.props.intl.formatMessage({id:"palette.flyout.search.placeholder",defaultMessage:L});return b.default.createElement("div",{className:"palette-flyout-search-container",id:"palette-flyout-search"},b.default.createElement(d.Search,{key:"palette-flyout-search",className:"palette-flyout-search",placeholder:e,onChange:this.handleSearchStringChange,size:"sm",value:this.state.searchString,labelText:e,onClick:this.searchOnClick}))}}]),o}(b.default.Component),be=o.injectIntl(ke);function Te(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Pe=function(n){t._inherits(o,n);var i=Te(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).state={},n}return e._createClass(o,[{key:"getNoResultsDiv",value:function(){var e=this.props.intl.formatMessage({id:"palette.flyout.search.noresults",defaultMessage:_}),t=this.props.intl.formatMessage({id:"palette.flyout.search.adjustsearch",defaultMessage:N});return b.default.createElement("div",null,b.default.createElement("div",{className:"palette-no-results-title"},e),b.default.createElement("br",null),b.default.createElement("div",{className:"palette-no-results-desc"},t))}},{key:"getContentListDiv",value:function(){for(var e=[],t=0;t<this.props.nodeTypeInfos.length;t++){var n="item_"+t;e.push(b.default.createElement("div",{key:n},b.default.createElement(q,{nodeTypeInfo:this.props.nodeTypeInfos[t],isDisplaySearchResult:!0,isShowRanking:this.props.isShowRanking,canvasController:this.props.canvasController,isPaletteOpen:this.props.isPaletteOpen,isEditingEnabled:this.props.isEditingEnabled})))}if(this.props.isNodeTypeInfosArrayTruncated){var i=this.props.intl.formatMessage({id:"palette.flyout.search.resultsrestricted",defaultMessage:x});e.push(b.default.createElement("div",{key:"restrict-item",className:"palette-flyout-restrict-item"},i))}return b.default.createElement("div",{width:"100%",draggable:"false",className:"palette-scroll"},e)}},{key:"render",value:function(){return 0===this.props.nodeTypeInfos.length?this.getNoResultsDiv():this.getContentListDiv()}}]),o}(b.default.Component),Le=o.injectIntl(Pe);function _e(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ne(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==n.return||n.return()}finally{if(s)throw a}}}}function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function xe(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var we=new h.Logger("PaletteFlyoutContent"),Se=function(n){t._inherits(o,n);var i=xe(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={selectedCategoryIds:[],searchString:""},a.categories=[],a.categorySelected=a.categorySelected.bind(t._assertThisInitialized(a)),a.getUniqueCategories=a.getUniqueCategories.bind(t._assertThisInitialized(a)),a.setSearchString=a.setSearchString.bind(t._assertThisInitialized(a)),a.handleSearchStringChange=a.handleSearchStringChange.bind(t._assertThisInitialized(a)),a.setSearchStringThrottled=de(a.setSearchString,200),a}return e._createClass(o,[{key:"getUniqueCategories",value:function(e){var t=[];if(e){var n,i=_e(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;-1===t.indexOf(o.label)&&t.push(o)}}catch(e){i.e(e)}finally{i.f()}}return t}},{key:"getContentDivs",value:function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];t.push(b.default.createElement("div",{key:i.label+"-container"},b.default.createElement(me,{key:i.id,category:i,categorySelectedMethod:this.categorySelected,canvasController:this.props.canvasController,isPaletteOpen:this.props.isPaletteOpen,isEditingEnabled:this.props.isEditingEnabled})))}return b.default.createElement(d.Accordion,null,t)}},{key:"getFilteredContentDivs",value:function(e){we.logStartTimer("getFilteredNodeTypeInfos");var t=function(e,t){for(var n=[],i=t.toLowerCase().split(" ").filter((function(e){return""!==e})),o=0;o<e.length;o++)n.push.apply(n,u._toConsumableArray(ge(e[o],i)));return n.sort((function(e,t){return e.occurrenceInfo.ranking<=t.occurrenceInfo.ranking?1:-1}))}(this.categories,this.state.searchString);we.logEndTimer("getFilteredNodeTypeInfos");var n=!1;return t.length>10&&(t=t.slice(0,10),n=!0),[b.default.createElement(Le,{key:"filtered-nodes",nodeTypeInfos:t,canvasController:this.props.canvasController,isPaletteOpen:this.props.isPaletteOpen,isEditingEnabled:this.props.isEditingEnabled,isNodeTypeInfosArrayTruncated:n})]}},{key:"setSearchString",value:function(){this.setState({searchString:this.ss})}},{key:"handleSearchStringChange",value:function(e){this.ss=e,this.setSearchStringThrottled()}},{key:"categorySelected",value:function(e){var t=this.isCategorySelected(e)?this.state.selectedCategoryIds.filter((function(t){return t!==e})):this.state.selectedCategoryIds.concat(e);this.setState({selectedCategoryIds:t})}},{key:"isCategorySelected",value:function(e){return this.state.selectedCategoryIds.some((function(t){return t===e}))}},{key:"render",value:function(){this.categories=this.getUniqueCategories(this.props.paletteJSON.categories);var e=this.props.isPaletteOpen&&this.state.searchString?this.getFilteredContentDivs(this.categories):this.getContentDivs(this.categories),t=b.default.createElement("div",{className:"palette-flyout-categories"},e),n=b.default.createElement(be,{handleSearchStringChange:this.handleSearchStringChange,isPaletteOpen:this.props.isPaletteOpen,canvasController:this.props.canvasController});return b.default.createElement("div",{className:"palette-flyout-content"},n,t)}}]),o}(b.default.Component);function Ee(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Ie=function(n){t._inherits(o,n);var i=Ee(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).paletteNodes=[],n}return e._createClass(o,[{key:"render",value:function(){var e="palette-flyout-div";return this.props.showPalette?e+=" palette-flyout-div-open":(e+=" palette-flyout-div-closed",this.props.enableNarrowPalette&&(e+=" palette-flyout-div-narrow")),b.default.createElement("nav",{"aria-label":this.props.intl.formatMessage({id:"palette.flyout.label",defaultMessage:E}),role:"navigation"},b.default.createElement("div",{className:e},b.default.createElement(Se,{paletteJSON:this.props.paletteJSON,canvasController:this.props.canvasController,isPaletteOpen:this.props.showPalette,isEditingEnabled:this.props.isEditingEnabled})))}}]),o}(b.default.Component),De=o.injectIntl(Ie);function Oe(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Ae=function(n){t._inherits(o,n);var i=Oe(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).logger=new h.Logger("Palette"),n}return e._createClass(o,[{key:"render",value:function(){this.logger.log("render");var e=null;return this.props.enablePaletteLayout===l.PALETTE_LAYOUT_FLYOUT?e=b.default.createElement(De,{enableNarrowPalette:this.props.enableNarrowPalette,paletteJSON:this.props.paletteJSON,showPalette:this.props.showPalette,canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled}):this.props.enablePaletteLayout===l.PALETTE_LAYOUT_MODAL&&(e=b.default.createElement(ie,{paletteJSON:this.props.paletteJSON,showPalette:this.props.showPalette,parentDivId:this.props.containingDivId,canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled})),e}}]),o}(b.default.Component),Me=i.connect((function(e,t){return{enablePaletteLayout:e.canvasconfig.enablePaletteLayout,enableNarrowPalette:e.canvasconfig.enableNarrowPalette,isEditingEnabled:e.canvasconfig.enableEditingActions,paletteJSON:e.palette.content,showPalette:void 0!==e.palette.isOpen&&e.palette.isOpen}}))(Ae);function ze(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Re=function(n){t._inherits(o,n);var i=ze(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={},a.handleClick=a.handleClick.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.handleClick,!0)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.handleClick,!0)}},{key:"handleClick",value:function(e){this.props.canvasController.closeTip()}},{key:"render",value:function(){var e=null,t=null;switch(this.props.type){case l.TIP_TYPE_PALETTE_ITEM:case l.TIP_TYPE_PALETTE_CATEGORY:t="right";break;case l.TIP_TYPE_NODE:case l.TIP_TYPE_PORT:case l.TIP_TYPE_DEC:case l.TIP_TYPE_LINK:case l.TIP_TYPE_STATE_TAG:default:t="bottom"}if(this.props.customContent)e=this.props.customContent;else switch(this.props.type){case l.TIP_TYPE_PALETTE_ITEM:e=b.default.createElement("div",{className:"tip-palette-item"},b.default.createElement("div",{className:"tip-palette-category"},this.props.category.label),b.default.createElement("div",{className:"tip-palette-label"},this.props.nodeTemplate.app_data.ui_data.label),this.props.nodeTemplate.app_data.ui_data.description?b.default.createElement("div",{className:"tip-palette-desc"},this.props.nodeTemplate.app_data.ui_data.description):"");break;case l.TIP_TYPE_PALETTE_CATEGORY:e=b.default.createElement("div",{className:"tip-palette-item"},b.default.createElement("div",{className:"tip-palette-label"},this.props.category.label),this.props.category.description?b.default.createElement("div",{className:"tip-palette-desc"},this.props.category.description):"");break;case l.TIP_TYPE_NODE:var n=null;this.props.canvasController.getObjectModel().hasErrorMessage(this.props.node)?n=b.default.createElement(r.Icon,{type:l.ERROR,className:"tip-node-status error"}):this.props.canvasController.getObjectModel().hasWarningMessage(this.props.node)&&(n=b.default.createElement(r.Icon,{type:l.WARNING,className:"tip-node-status warning"}));var i=this.props.canvasController.getObjectModel().getPaletteNode(this.props.node.op),o=this.props.node.label,s=i&&i.app_data&&i.app_data.ui_data?i.app_data.ui_data.label:o;if(o!==s&&(o+=" (".concat(s,")")),!(n||o||s||this.props.node.description))return null;e=b.default.createElement("div",{className:"tip-node"},n,b.default.createElement("div",{className:"tip-node-label"},o),this.props.node.description?b.default.createElement("div",{className:"tip-node-desc"},this.props.node.description):"");break;case l.TIP_TYPE_PORT:e=a.isEmpty_1(this.props.port.label)?null:b.default.createElement("div",{className:"tip-port"},this.props.port.label);break;case l.TIP_TYPE_DEC:e=a.isEmpty_1(this.props.decoration.tooltip)?null:b.default.createElement("div",{className:"tip-decoration"},this.props.decoration.tooltip);break;case l.TIP_TYPE_LINK:break;case l.TIP_TYPE_STATE_TAG:e=a.isEmpty_1(this.props.stateTagText)?null:b.default.createElement("div",{className:"tip-state-tag"},this.props.stateTagText);break;default:e=null}return null!==e?b.default.createElement(p,{tip:e,direction:t,id:this.props.id,targetObj:this.props.targetObj,mousePos:this.props.mousePos,className:[l.TIP_TYPE_NODE,l.TIP_TYPE_PORT,l.TIP_TYPE_DEC,l.TIP_TYPE_LINK].includes(this.props.type)?"definition-tooltip":null}):null}}]),o}(b.default.Component),He=i.connect((function(e,t){return{id:e.tooltip.id,type:e.tooltip.type,targetObj:e.tooltip.targetObj,mousePos:e.tooltip.mousePos,customContent:e.tooltip.customContent,node:e.tooltip.node,port:e.tooltip.port,decoration:e.tooltip.decoration,nodeTemplate:e.tooltip.nodeTemplate,category:e.tooltip.category,stateTagText:e.tooltip.stateTagText}}))(Re);function Ue(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var je=function(n){t._inherits(o,n);var i=Ue(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).logger=new h.Logger("CC-ContextMenu"),n}return e._createClass(o,[{key:"render",value:function(){this.logger.log("render");var e=null;return a.isEmpty_1(this.props.contextMenuDef)||(e=b.default.createElement(v,{containingDivId:this.props.containingDivId,contextMenuDef:this.props.contextMenuDef,contextMenuActionHandler:this.props.canvasController.contextMenuActionHandler,contextMenuPos:this.props.canvasController.getContextMenuPos(),closeContextMenu:this.props.canvasController.closeContextMenu,stopPropagation:!0})),e}}]),o}(b.default.Component),Be=i.connect((function(e,t){return{contextMenuDef:e.contextmenu.menuDef}}))(je),Fe={"toolbar.palette":"Palette","toolbar.zoomIn":"Zoom in","toolbar.zoomOut":"Zoom out","toolbar.zoomToFit":"Zoom to fit","toolbar.overflowMenu":"Overflow menu","toolbar.label":"Canvas toolbar"};function Ge(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Ye=function(n){t._inherits(o,n);var i=Ge(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).getLabel=a.getLabel.bind(t._assertThisInitialized(a)),a.logger=new h.Logger("CC-Toolbar"),a}return e._createClass(o,[{key:"getLabel",value:function(e,t){var n=f.defaultMessages1[e]?f.defaultMessages1[e]:Fe[e];return this.props.intl.formatMessage({id:e,defaultMessage:n},t)}},{key:"getJsxLabel",value:function(e,t,n){var i=f.CanvasUtils.isMacintosh()?"⌘":"Ctrl",o=t?i+" + "+t:null,a=n?i+" + "+n:null;return b.default.createElement("div",null,this.getLabel(e),b.default.createElement("br",null),o,b.default.createElement("br",null),a)}},{key:"getTextToolbar",value:function(){var e=this,t=this.getJsxLabel("texttoolbar.headerAction",">","<"),n=this.getJsxLabel("texttoolbar.boldAction","b"),i=this.getJsxLabel("texttoolbar.italicsAction","i"),o=this.getJsxLabel("texttoolbar.strikethroughAction","shift + x"),a=this.getJsxLabel("texttoolbar.codeAction","e"),r=this.getJsxLabel("texttoolbar.linkAction","k"),s=this.getJsxLabel("texttoolbar.quoteAction","shift + >"),l=this.getJsxLabel("texttoolbar.numberedListAction","shift + 7"),c=this.getJsxLabel("texttoolbar.bulletedListAction","shift + 8");return{leftBar:[{action:"header",tooltip:t,jsx:b.default.createElement("div",null,b.default.createElement(d.OverflowMenu,{id:"headerMenu",iconDescription:"",renderIcon:y.TextScale32},b.default.createElement(d.OverflowMenuItem,{itemText:this.getLabel("texttoolbar.titleAction"),onClick:function(t){return e.props.actionHandler("title",t)}}),b.default.createElement(d.OverflowMenuItem,{itemText:this.getLabel("texttoolbar.headerAction"),onClick:function(t){return e.props.actionHandler("header",t)}}),b.default.createElement(d.OverflowMenuItem,{itemText:this.getLabel("texttoolbar.subheaderAction"),onClick:function(t){return e.props.actionHandler("subheader",t)}}),b.default.createElement(d.OverflowMenuItem,{itemText:this.getLabel("texttoolbar.bodyAction"),onClick:function(t){return e.props.actionHandler("body",t)}})),b.default.createElement("svg",{className:"text-toolbar-tick-svg"},b.default.createElement("path",{d:"M 39 39 L 39 33 33 39 Z",className:"text-toolbar-tick-mark"})))},{divider:!0},{action:"bold",label:n,enable:!0,iconEnabled:b.default.createElement(y.TextBold32,null)},{action:"italics",label:i,enable:!0,iconEnabled:b.default.createElement(y.TextItalic32,null)},{action:"strikethrough",label:o,enable:!0,iconEnabled:b.default.createElement(y.TextStrikethrough32,null)},{divider:!0},{action:"code",label:a,enable:!0,iconEnabled:b.default.createElement(y.Code32,null)},{divider:!0},{action:"link",label:r,enable:!0,iconEnabled:b.default.createElement(y.Link32,null)},{divider:!0},{action:"quote",label:s,enable:!0,iconEnabled:b.default.createElement(y.TextIndentMore32,null)},{divider:!0},{action:"numberedList",label:l,enable:!0,iconEnabled:b.default.createElement(y.ListNumbered32,null)},{action:"bulletedList",label:c,enable:!0,iconEnabled:b.default.createElement(y.ListBulleted32,null)}]}}},{key:"render",value:function(){this.logger.log("render");var e=null;return this.props.isOpen&&(e=b.default.createElement("div",{className:"text-toolbar",style:{left:this.props.pos_x,top:this.props.pos_y},onBlur:this.props.blurHandler},b.default.createElement(c.Toolbar,{config:this.getTextToolbar(),instanceId:this.props.canvasController.getInstanceId(),toolbarActionHandler:this.props.actionHandler,tooltipDirection:"top"}))),e}}]),o}(b.default.Component),Xe=i.connect((function(e,t){return{isOpen:e.texttoolbar.isOpen,pos_x:e.texttoolbar.pos_x,pos_y:e.texttoolbar.pos_y,actionHandler:e.texttoolbar.actionHandler,blurHandler:e.texttoolbar.blurHandler}}))(o.injectIntl(Ye));function We(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Ve=function(n){t._inherits(o,n);var i=We(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).logger=new h.Logger("CC-StateTag"),a.onMouseOver=a.onMouseOver.bind(t._assertThisInitialized(a)),a.onMouseLeave=a.onMouseLeave.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"onMouseOver",value:function(e){var t;this.props.stateTagType===l.STATE_TAG_LOCKED?t=this.getLabel("canvas.stateTagTipLocked"):this.props.stateTagType===l.STATE_TAG_READ_ONLY&&(t=this.getLabel("canvas.stateTagTipReadOnly")),this.props.canvasController.openTip({id:"stateTagTip",type:l.TIP_TYPE_STATE_TAG,stateTagType:this.props.stateTagType,stateTagText:t,targetObj:e.currentTarget})}},{key:"onMouseLeave",value:function(){this.props.canvasController.closeTip()}},{key:"getLabel",value:function(e){return this.props.intl.formatMessage({id:e,defaultMessage:f.defaultMessages1[e]})}},{key:"getStateTag",value:function(e,t){return b.default.createElement("div",{className:"state-tag",onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave},t,b.default.createElement("span",null,e))}},{key:"render",value:function(){this.logger.log("render");var e=null;if(this.props.stateTagType===l.STATE_TAG_LOCKED){var t=this.getLabel("canvas.stateTagLocked");e=this.getStateTag(t,b.default.createElement(y.Locked16,null))}else if(this.props.stateTagType===l.STATE_TAG_READ_ONLY){var n=this.getLabel("canvas.stateTagReadOnly");e=this.getStateTag(n,b.default.createElement(y.EditOff16,null))}return e}}]),o}(b.default.Component),Ke=o.injectIntl(Ve),Ze="http://www.w3.org/1999/xhtml",qe={svg:"http://www.w3.org/2000/svg",xhtml:Ze,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $e(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),qe.hasOwnProperty(t)?{space:qe[t],local:e}:e}function Je(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ze&&t.documentElement.namespaceURI===Ze?t.createElement(e):t.createElementNS(n,e)}}function Qe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function et(e){var t=$e(e);return(t.local?Qe:Je)(t)}function tt(){}function nt(e){return null==e?tt:function(){return this.querySelector(e)}}function it(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}function ot(){return[]}function at(e){return null==e?ot:function(){return this.querySelectorAll(e)}}function rt(e){return function(){return this.matches(e)}}function st(e){return function(t){return t.matches(e)}}var lt=Array.prototype.find;function ct(){return this.firstElementChild}var ut=Array.prototype.filter;function dt(){return Array.from(this.children)}function ht(e){return new Array(e.length)}function pt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function gt(e){return function(){return e}}function ft(e,t,n,i,o,a){for(var r,s=0,l=t.length,c=a.length;s<c;++s)(r=t[s])?(r.__data__=a[s],i[s]=r):n[s]=new pt(e,a[s]);for(;s<l;++s)(r=t[s])&&(o[s]=r)}function vt(e,t,n,i,o,a,r){var s,l,c,u=new Map,d=t.length,h=a.length,p=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(p[s]=c=r.call(l,l.__data__,s,t)+"",u.has(c)?o[s]=l:u.set(c,l));for(s=0;s<h;++s)c=r.call(e,a[s],s,a)+"",(l=u.get(c))?(i[s]=l,l.__data__=a[s],u.delete(c)):n[s]=new pt(e,a[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(o[s]=l)}function yt(e){return e.__data__}function mt(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function Ct(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function kt(e){return function(){this.removeAttribute(e)}}function bt(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tt(e,t){return function(){this.setAttribute(e,t)}}function Pt(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Lt(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function _t(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Nt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function xt(e){return function(){this.style.removeProperty(e)}}function wt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function St(e,t,n){return function(){var i=t.apply(this,arguments);null==i?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function Et(e,t){return e.style.getPropertyValue(t)||Nt(e).getComputedStyle(e,null).getPropertyValue(t)}function It(e){return function(){delete this[e]}}function Dt(e,t){return function(){this[e]=t}}function Ot(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function At(e){return e.trim().split(/^|\s+/)}function Mt(e){return e.classList||new zt(e)}function zt(e){this._node=e,this._names=At(e.getAttribute("class")||"")}function Rt(e,t){for(var n=Mt(e),i=-1,o=t.length;++i<o;)n.add(t[i])}function Ht(e,t){for(var n=Mt(e),i=-1,o=t.length;++i<o;)n.remove(t[i])}function Ut(e){return function(){Rt(this,e)}}function jt(e){return function(){Ht(this,e)}}function Bt(e,t){return function(){(t.apply(this,arguments)?Rt:Ht)(this,e)}}function Ft(){this.textContent=""}function Gt(e){return function(){this.textContent=e}}function Yt(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Xt(){this.innerHTML=""}function Wt(e){return function(){this.innerHTML=e}}function Vt(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Kt(){this.nextSibling&&this.parentNode.appendChild(this)}function Zt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qt(){return null}function $t(){var e=this.parentNode;e&&e.removeChild(this)}function Jt(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Qt(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function en(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}function tn(e){return function(){var t=this.__on;if(t){for(var n,i=0,o=-1,a=t.length;i<a;++i)n=t[i],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function nn(e,t,n){return function(){var i,o=this.__on,a=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var r=0,s=o.length;r<s;++r)if((i=o[r]).type===e.type&&i.name===e.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),void(i.value=t);this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},o?o.push(i):this.__on=[i]}}function on(e,t,n){var i=Nt(e),o=i.CustomEvent;"function"==typeof o?o=new o(t,n):(o=i.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function an(e,t){return function(){return on(this,e,t)}}function rn(e,t){return function(){return on(this,e,t.apply(this,arguments))}}pt.prototype={constructor:pt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},zt.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var sn=[null];function ln(e,t){this._groups=e,this._parents=t}function cn(){return new ln([[document.documentElement]],sn)}function un(e){return"string"==typeof e?new ln([[document.querySelector(e)]],[document.documentElement]):new ln([[e]],sn)}ln.prototype=cn.prototype={constructor:ln,select:function(e){"function"!=typeof e&&(e=nt(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var a,r,s=t[o],l=s.length,c=i[o]=new Array(l),u=0;u<l;++u)(a=s[u])&&(r=e.call(a,a.__data__,u,s))&&("__data__"in a&&(r.__data__=a.__data__),c[u]=r);return new ln(i,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return it(e.apply(this,arguments))}}(e):at(e);for(var t=this._groups,n=t.length,i=[],o=[],a=0;a<n;++a)for(var r,s=t[a],l=s.length,c=0;c<l;++c)(r=s[c])&&(i.push(e.call(r,r.__data__,c,s)),o.push(r));return new ln(i,o)},selectChild:function(e){return this.select(null==e?ct:function(e){return function(){return lt.call(this.children,e)}}("function"==typeof e?e:st(e)))},selectChildren:function(e){return this.selectAll(null==e?dt:function(e){return function(){return ut.call(this.children,e)}}("function"==typeof e?e:st(e)))},filter:function(e){"function"!=typeof e&&(e=rt(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var a,r=t[o],s=r.length,l=i[o]=[],c=0;c<s;++c)(a=r[c])&&e.call(a,a.__data__,c,r)&&l.push(a);return new ln(i,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,yt);var n=t?vt:ft,i=this._parents,o=this._groups;"function"!=typeof e&&(e=gt(e));for(var a=o.length,r=new Array(a),s=new Array(a),l=new Array(a),c=0;c<a;++c){var u=i[c],d=o[c],h=d.length,p=mt(e.call(u,u&&u.__data__,c,i)),g=p.length,f=s[c]=new Array(g),v=r[c]=new Array(g),y=l[c]=new Array(h);n(u,d,f,v,y,p,t);for(var m,C,k=0,b=0;k<g;++k)if(m=f[k]){for(k>=b&&(b=k+1);!(C=v[b])&&++b<g;);m._next=C||null}}return(r=new ln(r,i))._enter=s,r._exit=l,r},enter:function(){return new ln(this._enter||this._groups.map(ht),this._parents)},exit:function(){return new ln(this._exit||this._groups.map(ht),this._parents)},join:function(e,t,n){var i=this.enter(),o=this,a=this.exit();return"function"==typeof e?(i=e(i))&&(i=i.selection()):i=i.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?a.remove():n(a),i&&o?i.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,o=n.length,a=i.length,r=Math.min(o,a),s=new Array(o),l=0;l<r;++l)for(var c,u=n[l],d=i[l],h=u.length,p=s[l]=new Array(h),g=0;g<h;++g)(c=u[g]||d[g])&&(p[g]=c);for(;l<o;++l)s[l]=n[l];return new ln(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i,o=e[t],a=o.length-1,r=o[a];--a>=0;)(i=o[a])&&(r&&4^i.compareDocumentPosition(r)&&r.parentNode.insertBefore(i,r),r=i);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=Ct);for(var n=this._groups,i=n.length,o=new Array(i),a=0;a<i;++a){for(var r,s=n[a],l=s.length,c=o[a]=new Array(l),u=0;u<l;++u)(r=s[u])&&(c[u]=r);c.sort(t)}return new ln(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],o=0,a=i.length;o<a;++o){var r=i[o];if(r)return r}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var o,a=t[n],r=0,s=a.length;r<s;++r)(o=a[r])&&e.call(o,o.__data__,r,a);return this},attr:function(e,t){var n=$e(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==t?n.local?bt:kt:"function"==typeof t?n.local?_t:Lt:n.local?Pt:Tt)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?xt:"function"==typeof t?St:wt)(e,t,null==n?"":n)):Et(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?It:"function"==typeof t?Ot:Dt)(e,t)):this.node()[e]},classed:function(e,t){var n=At(e+"");if(arguments.length<2){for(var i=Mt(this.node()),o=-1,a=n.length;++o<a;)if(!i.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?Bt:t?Ut:jt)(n,t))},text:function(e){return arguments.length?this.each(null==e?Ft:("function"==typeof e?Yt:Gt)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Xt:("function"==typeof e?Vt:Wt)(e)):this.node().innerHTML},raise:function(){return this.each(Kt)},lower:function(){return this.each(Zt)},append:function(e){var t="function"==typeof e?e:et(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var n="function"==typeof e?e:et(e),i=null==t?qt:"function"==typeof t?t:nt(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each($t)},clone:function(e){return this.select(e?Qt:Jt)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var i,o,a=en(e+""),r=a.length;if(!(arguments.length<2)){for(s=t?nn:tn,i=0;i<r;++i)this.each(s(a[i],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(i=0,l=s[c];i<r;++i)if((o=a[i]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?rn:an)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i,o=e[t],a=0,r=o.length;a<r;++a)(i=o[a])&&(yield i)}};var dn=0;function hn(){return new pn}function pn(){this._="@"+(++dn).toString(36)}function gn(e){let t;for(;t=e.sourceEvent;)e=t;return e}function fn(e,t){if(e=gn(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,[(i=i.matrixTransform(t.getScreenCTM().inverse())).x,i.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}pn.prototype=hn.prototype={constructor:pn,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};var vn=Object.freeze({__proto__:null,create:function(e){return un(et(e).call(document.documentElement))},creator:et,local:hn,matcher:rt,namespace:$e,namespaces:qe,pointer:fn,pointers:function(e,t){return e.target&&(e=gn(e),void 0===t&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,(e=>fn(e,t)))},select:un,selectAll:function(e){return"string"==typeof e?new ln([document.querySelectorAll(e)],[document.documentElement]):new ln([it(e)],sn)},selection:cn,selector:nt,selectorAll:at,style:Et,window:Nt}),yn=C._baseForOwn,mn=f._castFunction;var Cn=function(e,t){return e&&yn(e,mn(t))};var kn=function(e){return function(t){return null==e?void 0:e[t]}},bn=kn({"&":"&","<":"<",">":">",'"':""","'":"'"}),Tn=a.toString_1,Pn=/[&<>"']/g,Ln=RegExp(Pn.source);var _n=function(e){return(e=Tn(e))&&Ln.test(e)?e.replace(Pn,bn):e},Nn={value:()=>{}};function xn(){for(var e,t=0,n=arguments.length,i={};t<n;++t){if(!(e=arguments[t]+"")||e in i||/[\s.]/.test(e))throw new Error("illegal type: "+e);i[e]=[]}return new wn(i)}function wn(e){this._=e}function Sn(e,t){return e.trim().split(/^|\s+/).map((function(e){var n="",i=e.indexOf(".");if(i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}function En(e,t){for(var n,i=0,o=e.length;i<o;++i)if((n=e[i]).name===t)return n.value}function In(e,t,n){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=Nn,e=e.slice(0,i).concat(e.slice(i+1));break}return null!=n&&e.push({name:t,value:n}),e}wn.prototype=xn.prototype={constructor:wn,on:function(e,t){var n,i=this._,o=Sn(e+"",i),a=-1,r=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a<r;)if(n=(e=o[a]).type)i[n]=In(i[n],e.name,t);else if(null==t)for(n in i)i[n]=In(i[n],e.name,null);return this}for(;++a<r;)if((n=(e=o[a]).type)&&(n=En(i[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new wn(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,i,o=new Array(n),a=0;a<n;++a)o[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(i=this._[e]).length;a<n;++a)i[a].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,a=i.length;o<a;++o)i[o].value.apply(t,n)}};const Dn={passive:!1},On={capture:!0,passive:!1};function An(e){e.stopImmediatePropagation()}function Mn(e){e.preventDefault(),e.stopImmediatePropagation()}function zn(e){var t=e.document.documentElement,n=un(e).on("dragstart.drag",Mn,On);"onselectstart"in t?n.on("selectstart.drag",Mn,On):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Rn(e,t){var n=e.document.documentElement,i=un(e).on("dragstart.drag",null);t&&(i.on("click.drag",Mn,On),setTimeout((function(){i.on("click.drag",null)}),0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Hn=e=>()=>e;function Un(e,{sourceEvent:t,subject:n,target:i,identifier:o,active:a,x:r,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:r,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function jn(e){return!e.ctrlKey&&!e.button}function Bn(){return this.parentNode}function Fn(e,t){return null==t?{x:e.x,y:e.y}:t}function Gn(){return navigator.maxTouchPoints||"ontouchstart"in this}Un.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var Yn=Object.freeze({__proto__:null,drag:function(){var e,t,n,i,o=jn,a=Bn,r=Fn,s=Gn,l={},c=xn("start","drag","end"),u=0,d=0;function h(e){e.on("mousedown.drag",p).filter(s).on("touchstart.drag",v).on("touchmove.drag",y,Dn).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(r,s){if(!i&&o.call(this,r,s)){var l=C(this,a.call(this,r,s),r,s,"mouse");l&&(un(r.view).on("mousemove.drag",g,On).on("mouseup.drag",f,On),zn(r.view),An(r),n=!1,e=r.clientX,t=r.clientY,l("start",r))}}function g(i){if(Mn(i),!n){var o=i.clientX-e,a=i.clientY-t;n=o*o+a*a>d}l.mouse("drag",i)}function f(e){un(e.view).on("mousemove.drag mouseup.drag",null),Rn(e.view,n),Mn(e),l.mouse("end",e)}function v(e,t){if(o.call(this,e,t)){var n,i,r=e.changedTouches,s=a.call(this,e,t),l=r.length;for(n=0;n<l;++n)(i=C(this,s,e,t,r[n].identifier,r[n]))&&(An(e),i("start",e,r[n]))}}function y(e){var t,n,i=e.changedTouches,o=i.length;for(t=0;t<o;++t)(n=l[i[t].identifier])&&(Mn(e),n("drag",e,i[t]))}function m(e){var t,n,o=e.changedTouches,a=o.length;for(i&&clearTimeout(i),i=setTimeout((function(){i=null}),500),t=0;t<a;++t)(n=l[o[t].identifier])&&(An(e),n("end",e,o[t]))}function C(e,t,n,i,o,a){var s,d,p,g=c.copy(),f=fn(a||n,t);if(null!=(p=r.call(e,new Un("beforestart",{sourceEvent:n,target:h,identifier:o,active:u,x:f[0],y:f[1],dx:0,dy:0,dispatch:g}),i)))return s=p.x-f[0]||0,d=p.y-f[1]||0,function n(a,r,c){var v,y=f;switch(a){case"start":l[o]=n,v=u++;break;case"end":delete l[o],--u;case"drag":f=fn(c||r,t),v=u}g.call(a,e,new Un(a,{sourceEvent:r,subject:p,target:h,identifier:o,active:v,x:f[0]+s,y:f[1]+d,dx:f[0]-y[0],dy:f[1]-y[1],dispatch:g}),i)}}return h.filter=function(e){return arguments.length?(o="function"==typeof e?e:Hn(!!e),h):o},h.container=function(e){return arguments.length?(a="function"==typeof e?e:Hn(e),h):a},h.subject=function(e){return arguments.length?(r="function"==typeof e?e:Hn(e),h):r},h.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Hn(!!e),h):s},h.on=function(){var e=c.on.apply(c,arguments);return e===c?h:e},h.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,h):Math.sqrt(d)},h},dragDisable:zn,dragEnable:Rn});function Xn(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}function Wn(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Vn=function e(t){function n(e){return Math.pow(e,t)}return t=+t,n.exponent=e,n}(3),Kn=function e(t){function n(e){return 1-Math.pow(1-e,t)}return t=+t,n.exponent=e,n}(3),Zn=function e(t){function n(e){return((e*=2)<=1?Math.pow(e,t):2-Math.pow(2-e,t))/2}return t=+t,n.exponent=e,n}(3),qn=Math.PI,$n=qn/2;function Jn(e){return(1-Math.cos(qn*e))/2}function Qn(e){return 1.0009775171065494*(Math.pow(2,-10*e)-.0009765625)}function ei(e){return((e*=2)<=1?Qn(1-e):2-Qn(e-1))/2}function ti(e){return((e*=2)<=1?1-Math.sqrt(1-e*e):Math.sqrt(1-(e-=2)*e)+1)/2}var ni=4/11,ii=7.5625;function oi(e){return(e=+e)<ni?ii*e*e:e<.7272727272727273?ii*(e-=.5454545454545454)*e+.75:e<.9090909090909091?ii*(e-=.8181818181818182)*e+.9375:ii*(e-=.9545454545454546)*e+.984375}var ai=function e(t){function n(e){return(e=+e)*e*(t*(e-1)+e)}return t=+t,n.overshoot=e,n}(1.70158),ri=function e(t){function n(e){return--e*e*((e+1)*t+e)+1}return t=+t,n.overshoot=e,n}(1.70158),si=function e(t){function n(e){return((e*=2)<1?e*e*((t+1)*e-t):(e-=2)*e*((t+1)*e+t)+2)/2}return t=+t,n.overshoot=e,n}(1.70158),li=2*Math.PI,ci=function e(t,n){var i=Math.asin(1/(t=Math.max(1,t)))*(n/=li);function o(e){return t*Qn(- --e)*Math.sin((i-e)/n)}return o.amplitude=function(t){return e(t,n*li)},o.period=function(n){return e(t,n)},o}(1,.3),ui=function e(t,n){var i=Math.asin(1/(t=Math.max(1,t)))*(n/=li);function o(e){return 1-t*Qn(e=+e)*Math.sin((e+i)/n)}return o.amplitude=function(t){return e(t,n*li)},o.period=function(n){return e(t,n)},o}(1,.3),di=function e(t,n){var i=Math.asin(1/(t=Math.max(1,t)))*(n/=li);function o(e){return((e=2*e-1)<0?t*Qn(-e)*Math.sin((i-e)/n):2-t*Qn(e)*Math.sin((i+e)/n))/2}return o.amplitude=function(t){return e(t,n*li)},o.period=function(n){return e(t,n)},o}(1,.3),hi=Object.freeze({__proto__:null,easeLinear:e=>+e,easeQuad:Xn,easeQuadIn:function(e){return e*e},easeQuadOut:function(e){return e*(2-e)},easeQuadInOut:Xn,easeCubic:Wn,easeCubicIn:function(e){return e*e*e},easeCubicOut:function(e){return--e*e*e+1},easeCubicInOut:Wn,easePoly:Zn,easePolyIn:Vn,easePolyOut:Kn,easePolyInOut:Zn,easeSin:Jn,easeSinIn:function(e){return 1==+e?1:1-Math.cos(e*$n)},easeSinOut:function(e){return Math.sin(e*$n)},easeSinInOut:Jn,easeExp:ei,easeExpIn:function(e){return Qn(1-+e)},easeExpOut:function(e){return 1-Qn(e)},easeExpInOut:ei,easeCircle:ti,easeCircleIn:function(e){return 1-Math.sqrt(1-e*e)},easeCircleOut:function(e){return Math.sqrt(1- --e*e)},easeCircleInOut:ti,easeBounce:oi,easeBounceIn:function(e){return 1-oi(1-e)},easeBounceOut:oi,easeBounceInOut:function(e){return((e*=2)<=1?1-oi(1-e):oi(e-1)+1)/2},easeBack:si,easeBackIn:ai,easeBackOut:ri,easeBackInOut:si,easeElastic:ui,easeElasticIn:ci,easeElasticOut:ui,easeElasticInOut:di});function pi(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.blob()}function gi(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.arrayBuffer()}var fi={},vi={};function yi(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function mi(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var i in e)i in t||n.push(t[i]=i)})),n}function Ci(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function ki(e){var t,n=e.getUTCHours(),i=e.getUTCMinutes(),o=e.getUTCSeconds(),a=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":((t=e.getUTCFullYear())<0?"-"+Ci(-t,6):t>9999?"+"+Ci(t,6):Ci(t,4))+"-"+Ci(e.getUTCMonth()+1,2)+"-"+Ci(e.getUTCDate(),2)+(a?"T"+Ci(n,2)+":"+Ci(i,2)+":"+Ci(o,2)+"."+Ci(a,3)+"Z":o?"T"+Ci(n,2)+":"+Ci(i,2)+":"+Ci(o,2)+"Z":i||n?"T"+Ci(n,2)+":"+Ci(i,2)+"Z":"")}function bi(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,o=[],a=e.length,r=0,s=0,l=a<=0,c=!1;function u(){if(l)return vi;if(c)return c=!1,fi;var t,i,o=r;if(34===e.charCodeAt(o)){for(;r++<a&&34!==e.charCodeAt(r)||34===e.charCodeAt(++r););return(t=r)>=a?l=!0:10===(i=e.charCodeAt(r++))?c=!0:13===i&&(c=!0,10===e.charCodeAt(r)&&++r),e.slice(o+1,t-1).replace(/""/g,'"')}for(;r<a;){if(10===(i=e.charCodeAt(t=r++)))c=!0;else if(13===i)c=!0,10===e.charCodeAt(r)&&++r;else if(i!==n)continue;return e.slice(o,t)}return l=!0,e.slice(o,a)}for(10===e.charCodeAt(a-1)&&--a,13===e.charCodeAt(a-1)&&--a;(i=u())!==vi;){for(var d=[];i!==fi&&i!==vi;)d.push(i),i=u();t&&null==(d=t(d,s++))||o.push(d)}return o}function o(t,n){return t.map((function(t){return n.map((function(e){return r(t[e])})).join(e)}))}function a(t){return t.map(r).join(e)}function r(e){return null==e?"":e instanceof Date?ki(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,o,a=i(e,(function(e,i){if(n)return n(e,i-1);o=e,n=t?function(e,t){var n=yi(e);return function(i,o){return t(n(i),o,e)}}(e,t):yi(e)}));return a.columns=o||[],a},parseRows:i,format:function(t,n){return null==n&&(n=mi(t)),[n.map(r).join(e)].concat(o(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=mi(e)),o(e,t).join("\n")},formatRows:function(e){return e.map(a).join("\n")},formatRow:a,formatValue:r}}var Ti=bi(",").parse,Pi=bi("\t").parse;function Li(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.text()}function _i(e,t){return fetch(e,t).then(Li)}function Ni(e){return function(t,n,i){return 2===arguments.length&&"function"==typeof n&&(i=n,n=void 0),_i(t,n).then((function(t){return e(t,i)}))}}var xi=Ni(Ti),wi=Ni(Pi);function Si(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);if(204!==e.status&&205!==e.status)return e.json()}function Ei(e){return(t,n)=>_i(t,n).then((t=>(new DOMParser).parseFromString(t,e)))}var Ii=Ei("application/xml"),Di=Ei("text/html"),Oi=Ei("image/svg+xml"),Ai=Object.freeze({__proto__:null,blob:function(e,t){return fetch(e,t).then(pi)},buffer:function(e,t){return fetch(e,t).then(gi)},dsv:function(e,t,n,i){3===arguments.length&&"function"==typeof n&&(i=n,n=void 0);var o=bi(e);return _i(t,n).then((function(e){return o.parse(e,i)}))},csv:xi,tsv:wi,image:function(e,t){return new Promise((function(n,i){var o=new Image;for(var a in t)o[a]=t[a];o.onerror=i,o.onload=function(){n(o)},o.src=e}))},json:function(e,t){return fetch(e,t).then(Si)},text:_i,xml:Ii,html:Di,svg:Oi});function Mi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zi(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Ri(){}var Hi=1/.7,Ui="\\s*([+-]?\\d+)\\s*",ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Bi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Fi=/^#([0-9a-f]{3,8})$/,Gi=new RegExp(`^rgb\\(${Ui},${Ui},${Ui}\\)$`),Yi=new RegExp(`^rgb\\(${Bi},${Bi},${Bi}\\)$`),Xi=new RegExp(`^rgba\\(${Ui},${Ui},${Ui},${ji}\\)$`),Wi=new RegExp(`^rgba\\(${Bi},${Bi},${Bi},${ji}\\)$`),Vi=new RegExp(`^hsl\\(${ji},${Bi},${Bi}\\)$`),Ki=new RegExp(`^hsla\\(${ji},${Bi},${Bi},${ji}\\)$`),Zi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function qi(){return this.rgb().formatHex()}function $i(){return this.rgb().formatRgb()}function Ji(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Fi.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Qi(t):3===n?new io(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?eo(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?eo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Gi.exec(e))?new io(t[1],t[2],t[3],1):(t=Yi.exec(e))?new io(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Xi.exec(e))?eo(t[1],t[2],t[3],t[4]):(t=Wi.exec(e))?eo(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Vi.exec(e))?co(t[1],t[2]/100,t[3]/100,1):(t=Ki.exec(e))?co(t[1],t[2]/100,t[3]/100,t[4]):Zi.hasOwnProperty(e)?Qi(Zi[e]):"transparent"===e?new io(NaN,NaN,NaN,0):null}function Qi(e){return new io(e>>16&255,e>>8&255,255&e,1)}function eo(e,t,n,i){return i<=0&&(e=t=n=NaN),new io(e,t,n,i)}function to(e){return e instanceof Ri||(e=Ji(e)),e?new io((e=e.rgb()).r,e.g,e.b,e.opacity):new io}function no(e,t,n,i){return 1===arguments.length?to(e):new io(e,t,n,null==i?1:i)}function io(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function oo(){return`#${lo(this.r)}${lo(this.g)}${lo(this.b)}`}function ao(){const e=ro(this.opacity);return`${1===e?"rgb(":"rgba("}${so(this.r)}, ${so(this.g)}, ${so(this.b)}${1===e?")":`, ${e})`}`}function ro(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function so(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function lo(e){return((e=so(e))<16?"0":"")+e.toString(16)}function co(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ho(e,t,n,i)}function uo(e){if(e instanceof ho)return new ho(e.h,e.s,e.l,e.opacity);if(e instanceof Ri||(e=Ji(e)),!e)return new ho;if(e instanceof ho)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,o=Math.min(t,n,i),a=Math.max(t,n,i),r=NaN,s=a-o,l=(a+o)/2;return s?(r=t===a?(n-i)/s+6*(n<i):n===a?(i-t)/s+2:(t-n)/s+4,s/=l<.5?a+o:2-a-o,r*=60):s=l>0&&l<1?0:r,new ho(r,s,l,e.opacity)}function ho(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function po(e){return(e=(e||0)%360)<0?e+360:e}function go(e){return Math.max(0,Math.min(1,e||0))}function fo(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Mi(Ri,Ji,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qi,formatHex:qi,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return uo(this).formatHsl()},formatRgb:$i,toString:$i}),Mi(io,no,zi(Ri,{brighter(e){return e=null==e?Hi:Math.pow(Hi,e),new io(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new io(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new io(so(this.r),so(this.g),so(this.b),ro(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oo,formatHex:oo,formatHex8:function(){return`#${lo(this.r)}${lo(this.g)}${lo(this.b)}${lo(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ao,toString:ao})),Mi(ho,(function(e,t,n,i){return 1===arguments.length?uo(e):new ho(e,t,n,null==i?1:i)}),zi(Ri,{brighter(e){return e=null==e?Hi:Math.pow(Hi,e),new ho(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ho(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,o=2*n-i;return new io(fo(e>=240?e-240:e+120,o,i),fo(e,o,i),fo(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new ho(po(this.h),go(this.s),go(this.l),ro(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ro(this.opacity);return`${1===e?"hsl(":"hsla("}${po(this.h)}, ${100*go(this.s)}%, ${100*go(this.l)}%${1===e?")":`, ${e})`}`}}));var vo=e=>()=>e;function yo(e){return 1==(e=+e)?mo:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):vo(isNaN(t)?n:t)}}function mo(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):vo(isNaN(e)?t:e)}var Co=function e(t){var n=yo(t);function i(e,t){var i=n((e=no(e)).r,(t=no(t)).r),o=n(e.g,t.g),a=n(e.b,t.b),r=mo(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=o(t),e.b=a(t),e.opacity=r(t),e+""}}return i.gamma=e,i}(1);function ko(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var bo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,To=new RegExp(bo.source,"g");function Po(e,t){var n,i,o,a=bo.lastIndex=To.lastIndex=0,r=-1,s=[],l=[];for(e+="",t+="";(n=bo.exec(e))&&(i=To.exec(t));)(o=i.index)>a&&(o=t.slice(a,o),s[r]?s[r]+=o:s[++r]=o),(n=n[0])===(i=i[0])?s[r]?s[r]+=i:s[++r]=i:(s[++r]=null,l.push({i:r,x:ko(n,i)})),a=To.lastIndex;return a<t.length&&(o=t.slice(a),s[r]?s[r]+=o:s[++r]=o),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)s[(n=l[i]).i]=n.x(e);return s.join("")})}var Lo,_o=180/Math.PI,No={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xo(e,t,n,i,o,a){var r,s,l;return(r=Math.sqrt(e*e+t*t))&&(e/=r,t/=r),(l=e*n+t*i)&&(n-=e*l,i-=t*l),(s=Math.sqrt(n*n+i*i))&&(n/=s,i/=s,l/=s),e*i<t*n&&(e=-e,t=-t,l=-l,r=-r),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*_o,skewX:Math.atan(l)*_o,scaleX:r,scaleY:s}}function wo(e,t,n,i){function o(e){return e.length?e.pop()+" ":""}return function(a,r){var s=[],l=[];return a=e(a),r=e(r),function(e,i,o,a,r,s){if(e!==o||i!==a){var l=r.push("translate(",null,t,null,n);s.push({i:l-4,x:ko(e,o)},{i:l-2,x:ko(i,a)})}else(o||a)&&r.push("translate("+o+t+a+n)}(a.translateX,a.translateY,r.translateX,r.translateY,s,l),function(e,t,n,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(o(n)+"rotate(",null,i)-2,x:ko(e,t)})):t&&n.push(o(n)+"rotate("+t+i)}(a.rotate,r.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(o(n)+"skewX(",null,i)-2,x:ko(e,t)}):t&&n.push(o(n)+"skewX("+t+i)}(a.skewX,r.skewX,s,l),function(e,t,n,i,a,r){if(e!==n||t!==i){var s=a.push(o(a)+"scale(",null,",",null,")");r.push({i:s-4,x:ko(e,n)},{i:s-2,x:ko(t,i)})}else 1===n&&1===i||a.push(o(a)+"scale("+n+","+i+")")}(a.scaleX,a.scaleY,r.scaleX,r.scaleY,s,l),a=r=null,function(e){for(var t,n=-1,i=l.length;++n<i;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var So=wo((function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?No:xo(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),Eo=wo((function(e){return null==e?No:(Lo||(Lo=document.createElementNS("http://www.w3.org/2000/svg","g")),Lo.setAttribute("transform",e),(e=Lo.transform.baseVal.consolidate())?xo((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):No)}),", ",")",")");function Io(e){return((e=Math.exp(e))+1/e)/2}var Do,Oo,Ao=function e(t,n,i){function o(e,o){var a,r,s=e[0],l=e[1],c=e[2],u=o[0],d=o[1],h=o[2],p=u-s,g=d-l,f=p*p+g*g;if(f<1e-12)r=Math.log(h/c)/t,a=function(e){return[s+e*p,l+e*g,c*Math.exp(t*e*r)]};else{var v=Math.sqrt(f),y=(h*h-c*c+i*f)/(2*c*n*v),m=(h*h-c*c-i*f)/(2*h*n*v),C=Math.log(Math.sqrt(y*y+1)-y),k=Math.log(Math.sqrt(m*m+1)-m);r=(k-C)/t,a=function(e){var i,o=e*r,a=Io(C),u=c/(n*v)*(a*(i=t*o+C,((i=Math.exp(2*i))-1)/(i+1))-function(e){return((e=Math.exp(e))-1/e)/2}(C));return[s+u*p,l+u*g,c*a/Io(t*o+C)]}}return a.duration=1e3*r*t/Math.SQRT2,a}return o.rho=function(t){var n=Math.max(.001,+t),i=n*n;return e(n,i,i*i)},o}(Math.SQRT2,2,4),Mo=0,zo=0,Ro=0,Ho=0,Uo=0,jo=0,Bo="object"==typeof performance&&performance.now?performance:Date,Fo="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Go(){return Uo||(Fo(Yo),Uo=Bo.now()+jo)}function Yo(){Uo=0}function Xo(){this._call=this._time=this._next=null}function Wo(e,t,n){var i=new Xo;return i.restart(e,t,n),i}function Vo(){Uo=(Ho=Bo.now())+jo,Mo=zo=0;try{!function(){Go(),++Mo;for(var e,t=Do;t;)(e=Uo-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Mo}()}finally{Mo=0,function(){var e,t,n=Do,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Do=t);Oo=e,Zo(i)}(),Uo=0}}function Ko(){var e=Bo.now(),t=e-Ho;t>1e3&&(jo-=t,Ho=e)}function Zo(e){Mo||(zo&&(zo=clearTimeout(zo)),e-Uo>24?(e<1/0&&(zo=setTimeout(Vo,e-Bo.now()-jo)),Ro&&(Ro=clearInterval(Ro))):(Ro||(Ho=Bo.now(),Ro=setInterval(Ko,1e3)),Mo=1,Fo(Vo)))}function qo(e,t,n){var i=new Xo;return t=null==t?0:+t,i.restart((n=>{i.stop(),e(n+t)}),t,n),i}Xo.prototype=Wo.prototype={constructor:Xo,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Go():+n)+(null==t?0:+t),this._next||Oo===this||(Oo?Oo._next=this:Do=this,Oo=this),this._call=e,this._time=n,Zo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zo())}};var $o=xn("start","end","cancel","interrupt"),Jo=[];function Qo(e,t,n,i,o,a){var r=e.__transition;if(r){if(n in r)return}else e.__transition={};!function(e,t,n){var i,o=e.__transition;function a(e){n.state=1,n.timer.restart(r,n.delay,n.time),n.delay<=e&&r(e-n.delay)}function r(a){var c,u,d,h;if(1!==n.state)return l();for(c in o)if((h=o[c]).name===n.name){if(3===h.state)return qo(r);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[c]):+c<t&&(h.state=6,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete o[c])}if(qo((function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))})),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=h);i.length=u+1}}function s(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,r=i.length;++a<r;)i[a].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var i in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=Wo(a,0,n.time)}(e,n,{name:t,index:i,group:o,on:$o,tween:Jo,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function ea(e,t){var n=na(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function ta(e,t){var n=na(e,t);if(n.state>3)throw new Error("too late; already running");return n}function na(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ia(e,t){var n,i,o,a=e.__transition,r=!0;if(a){for(o in t=null==t?null:t+"",a)(n=a[o]).name===t?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[o]):r=!1;r&&delete e.__transition}}function oa(e,t){var n,i;return function(){var o=ta(this,e),a=o.tween;if(a!==n)for(var r=0,s=(i=n=a).length;r<s;++r)if(i[r].name===t){(i=i.slice()).splice(r,1);break}o.tween=i}}function aa(e,t,n){var i,o;if("function"!=typeof n)throw new Error;return function(){var a=ta(this,e),r=a.tween;if(r!==i){o=(i=r).slice();for(var s={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=s;break}l===c&&o.push(s)}a.tween=o}}function ra(e,t,n){var i=e._id;return e.each((function(){var e=ta(this,i);(e.value||(e.value={}))[t]=n.apply(this,arguments)})),function(e){return na(e,i).value[t]}}function sa(e,t){var n;return("number"==typeof t?ko:t instanceof Ji?Co:(n=Ji(t))?(t=n,Co):Po)(e,t)}function la(e){return function(){this.removeAttribute(e)}}function ca(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ua(e,t,n){var i,o,a=n+"";return function(){var r=this.getAttribute(e);return r===a?null:r===i?o:o=t(i=r,n)}}function da(e,t,n){var i,o,a=n+"";return function(){var r=this.getAttributeNS(e.space,e.local);return r===a?null:r===i?o:o=t(i=r,n)}}function ha(e,t,n){var i,o,a;return function(){var r,s,l=n(this);if(null!=l)return(r=this.getAttribute(e))===(s=l+"")?null:r===i&&s===o?a:(o=s,a=t(i=r,l));this.removeAttribute(e)}}function pa(e,t,n){var i,o,a;return function(){var r,s,l=n(this);if(null!=l)return(r=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:r===i&&s===o?a:(o=s,a=t(i=r,l));this.removeAttributeNS(e.space,e.local)}}function ga(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function fa(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function va(e,t){var n,i;function o(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&fa(e,o)),n}return o._value=t,o}function ya(e,t){var n,i;function o(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&ga(e,o)),n}return o._value=t,o}function ma(e,t){return function(){ea(this,e).delay=+t.apply(this,arguments)}}function Ca(e,t){return t=+t,function(){ea(this,e).delay=t}}function ka(e,t){return function(){ta(this,e).duration=+t.apply(this,arguments)}}function ba(e,t){return t=+t,function(){ta(this,e).duration=t}}function Ta(e,t){if("function"!=typeof t)throw new Error;return function(){ta(this,e).ease=t}}function Pa(e,t,n){var i,o,a=function(e){return(e+"").trim().split(/^|\s+/).every((function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?ea:ta;return function(){var r=a(this,e),s=r.on;s!==i&&(o=(i=s).copy()).on(t,n),r.on=o}}var La=cn.prototype.constructor;function _a(e){return function(){this.style.removeProperty(e)}}function Na(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function xa(e,t,n){var i,o;function a(){var a=t.apply(this,arguments);return a!==o&&(i=(o=a)&&Na(e,a,n)),i}return a._value=t,a}function wa(e){return function(t){this.textContent=e.call(this,t)}}function Sa(e){var t,n;function i(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&wa(i)),t}return i._value=e,i}var Ea=0;function Ia(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function Da(){return++Ea}var Oa=cn.prototype;Ia.prototype={constructor:Ia,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=nt(e));for(var i=this._groups,o=i.length,a=new Array(o),r=0;r<o;++r)for(var s,l,c=i[r],u=c.length,d=a[r]=new Array(u),h=0;h<u;++h)(s=c[h])&&(l=e.call(s,s.__data__,h,c))&&("__data__"in s&&(l.__data__=s.__data__),d[h]=l,Qo(d[h],t,n,h,d,na(s,n)));return new Ia(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=at(e));for(var i=this._groups,o=i.length,a=[],r=[],s=0;s<o;++s)for(var l,c=i[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var h,p=e.call(l,l.__data__,d,c),g=na(l,n),f=0,v=p.length;f<v;++f)(h=p[f])&&Qo(h,t,n,f,p,g);a.push(p),r.push(l)}return new Ia(a,r,t,n)},selectChild:Oa.selectChild,selectChildren:Oa.selectChildren,filter:function(e){"function"!=typeof e&&(e=rt(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var a,r=t[o],s=r.length,l=i[o]=[],c=0;c<s;++c)(a=r[c])&&e.call(a,a.__data__,c,r)&&l.push(a);return new Ia(i,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,o=n.length,a=Math.min(i,o),r=new Array(i),s=0;s<a;++s)for(var l,c=t[s],u=n[s],d=c.length,h=r[s]=new Array(d),p=0;p<d;++p)(l=c[p]||u[p])&&(h[p]=l);for(;s<i;++s)r[s]=t[s];return new Ia(r,this._parents,this._name,this._id)},selection:function(){return new La(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=Da(),i=this._groups,o=i.length,a=0;a<o;++a)for(var r,s=i[a],l=s.length,c=0;c<l;++c)if(r=s[c]){var u=na(r,t);Qo(r,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ia(i,this._parents,e,n)},call:Oa.call,nodes:Oa.nodes,node:Oa.node,size:Oa.size,empty:Oa.empty,each:Oa.each,on:function(e,t){var n=this._id;return arguments.length<2?na(this.node(),n).on.on(e):this.each(Pa(n,e,t))},attr:function(e,t){var n=$e(e),i="transform"===n?Eo:sa;return this.attrTween(e,"function"==typeof t?(n.local?pa:ha)(n,i,ra(this,"attr."+e,t)):null==t?(n.local?ca:la)(n):(n.local?da:ua)(n,i,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var i=$e(e);return this.tween(n,(i.local?va:ya)(i,t))},style:function(e,t,n){var i="transform"==(e+="")?So:sa;return null==t?this.styleTween(e,function(e,t){var n,i,o;return function(){var a=Et(this,e),r=(this.style.removeProperty(e),Et(this,e));return a===r?null:a===n&&r===i?o:o=t(n=a,i=r)}}(e,i)).on("end.style."+e,_a(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var i,o,a;return function(){var r=Et(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=Et(this,e)),r===l?null:r===i&&l===o?a:(o=l,a=t(i=r,s))}}(e,i,ra(this,"style."+e,t))).each(function(e,t){var n,i,o,a,r="style."+t,s="end."+r;return function(){var l=ta(this,e),c=l.on,u=null==l.value[r]?a||(a=_a(t)):void 0;c===n&&o===u||(i=(n=c).copy()).on(s,o=u),l.on=i}}(this._id,e)):this.styleTween(e,function(e,t,n){var i,o,a=n+"";return function(){var r=Et(this,e);return r===a?null:r===i?o:o=t(i=r,n)}}(e,i,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==t)return this.tween(i,null);if("function"!=typeof t)throw new Error;return this.tween(i,xa(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(ra(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,Sa(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i,o=na(this.node(),n).tween,a=0,r=o.length;a<r;++a)if((i=o[a]).name===e)return i.value;return null}return this.each((null==t?oa:aa)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?ma:Ca)(t,e)):na(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?ka:ba)(t,e)):na(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(Ta(t,e)):na(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;ta(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,i=n._id,o=n.size();return new Promise((function(a,r){var s={value:r},l={value:function(){0==--o&&a()}};n.each((function(){var n=ta(this,i),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t})),0===o&&a()}))},[Symbol.iterator]:Oa[Symbol.iterator]};var Aa={time:null,delay:0,duration:250,ease:Wn};function Ma(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}cn.prototype.interrupt=function(e){return this.each((function(){ia(this,e)}))},cn.prototype.transition=function(e){var t,n;e instanceof Ia?(t=e._id,e=e._name):(t=Da(),(n=Aa).time=Go(),e=null==e?null:e+"");for(var i=this._groups,o=i.length,a=0;a<o;++a)for(var r,s=i[a],l=s.length,c=0;c<l;++c)(r=s[c])&&Qo(r,e,t,c,s,n||Ma(r,t));return new Ia(i,this._parents,e,t)};var za=function(e){return function(){return e}};function Ra(e,t){var n=t.sourceEvent,i=t.target,o=t.transform,a=t.dispatch;Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:a}})}function Ha(e,t,n){this.k=e,this.x=t,this.y=n}Ha.prototype={constructor:Ha,scale:function(e){return 1===e?this:new Ha(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Ha(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ua=new Ha(1,0,0);function ja(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ua;return e.__zoom}function Ba(e){e.stopImmediatePropagation()}function Fa(e){e.preventDefault(),e.stopImmediatePropagation()}function Ga(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function Ya(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function Xa(){return this.__zoom||Ua}function Wa(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Va(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ka(e,t,n){var i=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],r=e.invertY(t[1][1])-n[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),r>a?(a+r)/2:Math.min(0,a)||Math.max(0,r))}ja.prototype=Ha.prototype;var Za=Object.freeze({__proto__:null,zoom:function(){var e,t,n,i=Ga,o=Ya,a=Ka,r=Wa,s=Va,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=Ao,h=xn("start","zoom","end"),p=500,g=0,f=10,v=!1,y=!1;function m(e){e.property("__zoom",Xa).on("wheel.zoom",_).on("mousedown.zoom",S).on("dblclick.zoom",E).on("gesturestart",N).on("gesturechange",x).on("gestureend",w).filter(s).on("touchstart.zoom",I).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new Ha(t,e.x,e.y)}function k(e,t,n){var i=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return i===e.x&&o===e.y?e:new Ha(e.k,i,o)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function T(e,t,n,i){e.on("start.zoom",(function(){P(this,arguments).event(i).start()})).on("interrupt.zoom end.zoom",(function(){P(this,arguments).event(i).end()})).tween("zoom",(function(){var e=this,a=arguments,r=P(e,a).event(i),s=o.apply(e,a),l=null==n?b(s):"function"==typeof n?n.apply(e,a):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,h="function"==typeof t?t.apply(e,a):t,p=d(u.invert(l).concat(c/u.k),h.invert(l).concat(c/h.k));return function(e){if(1===e)e=h;else{var t=p(e),n=c/t[2];e=new Ha(n,l[0]-t[0]*n,l[1]-t[1]*n)}r.zoom(null,e)}}))}function P(e,t,n){return!n&&e.__zooming||new L(e,t)}function L(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function _(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if(y&&Fa(e),i.apply(this,arguments)){var s=P(this,n).event(e),u=this.__zoom,d=Math.max(l[0],Math.min(l[1],u.k*Math.pow(2,r.apply(this,arguments)))),h=fn(e);if(s.wheel)s.mouse[0][0]===h[0]&&s.mouse[0][1]===h[1]||(s.mouse[1]=u.invert(s.mouse[0]=h)),clearTimeout(s.wheel);else{if(u.k===d)return;!v||e.ctrlKey||e.safariPinchZoom||(s.wheelTransX=-u.x,s.wheelTransY=-u.y),s.mouse=[h,u.invert(h)],ia(this),s.start()}if(Fa(e),s.wheel=setTimeout(f,150),!v||e.ctrlKey||e.safariPinchZoom)s.zoom("mouse",a(k(C(u,d),s.mouse[0],s.mouse[1]),s.extent,c));else{s.wheelTransX+=e.deltaX,s.wheelTransY+=e.deltaY;var p=[u.x,u.y],g=[u.x+s.wheelTransX,u.y+s.wheelTransY];s.zoom("mouse",a(k(u,p,g),s.extent,c))}}function f(){s.wheel=null,s.end()}}function N(e){Fa(e),this.scale=e.scale}function x(e){Fa(e),this.__zoom&&(e.deltaY=100*(this.scale-e.scale),this.scale=e.scale),e.safariPinchZoom=!0,_.apply(this,[e].concat(Array.prototype.slice.call(arguments)))}function w(e){Fa(e)}function S(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r<t;r++)o[r-1]=arguments[r];if(!n&&i.apply(this,arguments)){var s=P(this,o,!0).event(e),l=un(e.view).on("mousemove.zoom",f,!0).on("mouseup.zoom",v,!0),u=fn(e,d),d=e.currentTarget,h=e.clientX,p=e.clientY;zn(e.view),Ba(e),s.mouse=[u,this.__zoom.invert(u)],ia(this),s.start()}function f(e){if(Fa(e),!s.moved){var t=e.clientX-h,n=e.clientY-p;s.moved=t*t+n*n>g}s.event(e).zoom("mouse",a(k(s.that.__zoom,s.mouse[0]=fn(e,d),s.mouse[1]),s.extent,c))}function v(e){l.on("mousemove.zoom mouseup.zoom",null),Rn(e.view,s.moved),Fa(e),s.event(e).end()}}function E(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(i.apply(this,arguments)){var s=this.__zoom,l=fn(e.changedTouches?e.changedTouches[0]:e,this),d=s.invert(l),h=s.k*(e.shiftKey?.5:2),p=a(k(C(s,h),l,d),o.apply(this,n),c);Fa(e),u>0?un(this).transition().duration(u).call(T,p,l,e):un(this).call(m.transform,p,l,e)}}function I(n){for(var o=arguments.length,a=new Array(o>1?o-1:0),r=1;r<o;r++)a[r-1]=arguments[r];if(i.apply(this,arguments)){var s,l,c,u,d=n.touches,h=d.length,g=P(this,a,n.changedTouches.length===h).event(n);for(Ba(n),l=0;l<h;++l)u=[u=fn(c=d[l],this),this.__zoom.invert(u),c.identifier],g.touch0?g.touch1||g.touch0[2]===u[2]||(g.touch1=u,g.taps=0):(g.touch0=u,s=!0,g.taps=1+!!e);e&&(e=clearTimeout(e)),s&&(g.taps<2&&(t=u[0],e=setTimeout((function(){e=null}),p)),ia(this),g.start())}}function D(e){if(this.__zooming){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var o,r,s,l,u=P(this,n).event(e),d=e.changedTouches,h=d.length;for(Fa(e),o=0;o<h;++o)s=fn(r=d[o],this),u.touch0&&u.touch0[2]===r.identifier?u.touch0[0]=s:u.touch1&&u.touch1[2]===r.identifier&&(u.touch1[0]=s);if(r=u.that.__zoom,u.touch1){var p=u.touch0[0],g=u.touch0[1],f=u.touch1[0],v=u.touch1[1],y=(y=f[0]-p[0])*y+(y=f[1]-p[1])*y,m=(m=v[0]-g[0])*m+(m=v[1]-g[1])*m;r=C(r,Math.sqrt(y/m)),s=[(p[0]+f[0])/2,(p[1]+f[1])/2],l=[(g[0]+v[0])/2,(g[1]+v[1])/2]}else{if(!u.touch0)return;s=u.touch0[0],l=u.touch0[1]}u.zoom("touch",a(k(r,s,l),u.extent,c))}}function O(e){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];if(this.__zooming){var r,s,l=P(this,o).event(e),c=e.changedTouches,u=c.length;for(Ba(e),n&&clearTimeout(n),n=setTimeout((function(){n=null}),p),r=0;r<u;++r)s=c[r],l.touch0&&l.touch0[2]===s.identifier?delete l.touch0:l.touch1&&l.touch1[2]===s.identifier&&delete l.touch1;if(l.touch1&&!l.touch0&&(l.touch0=l.touch1,delete l.touch1),l.touch0)l.touch0[1]=this.__zoom.invert(l.touch0[0]);else if(l.end(),2===l.taps&&(s=fn(s,this),Math.hypot(t[0]-s[0],t[1]-s[1])<f)){var d=un(this).on("dblclick.zoom");d&&d.apply(this,arguments)}}}return m.transform=function(e,t,n,i){var o=e.selection?e.selection():e;o.property("__zoom",Xa),e!==o?T(e,t,n,i):o.interrupt().each((function(){P(this,arguments).event(i).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},m.scaleBy=function(e,t,n,i){m.scaleTo(e,(function(){var e=this.__zoom.k,n="function"==typeof t?t.apply(this,arguments):t;return e*n}),n,i)},m.scaleTo=function(e,t,n,i){m.transform(e,(function(){var e=o.apply(this,arguments),i=this.__zoom,r=null==n?b(e):"function"==typeof n?n.apply(this,arguments):n,s=i.invert(r),l="function"==typeof t?t.apply(this,arguments):t;return a(k(C(i,l),r,s),e,c)}),n,i)},m.translateBy=function(e,t,n,i){m.transform(e,(function(){return a(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)}),null,i)},m.translateTo=function(e,t,n,i,r){m.transform(e,(function(){var e=o.apply(this,arguments),r=this.__zoom,s=null==i?b(e):"function"==typeof i?i.apply(this,arguments):i;return a(Ua.translate(s[0],s[1]).scale(r.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)}),i,r)},L.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=un(this.that).datum();h.call(e,this.that,new Ra(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:h}),t)}},m.wheelDelta=function(e){return arguments.length?(r="function"==typeof e?e:za(+e),m):r},m.filter=function(e){return arguments.length?(i="function"==typeof e?e:za(!!e),m):i},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:za(!!e),m):s},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:za([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],m):[l[0],l[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(a=e,m):a},m.trackpad=function(e){return arguments.length?(v=e,m):v},m.preventBackGesture=function(e){return arguments.length?(y=e,m):y},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=h.on.apply(h,arguments);return e===h?m:e},m.clickDistance=function(e){return arguments.length?(g=(e=+e)*e,m):Math.sqrt(g)},m.tapDistance=function(e){return arguments.length?(f=+e,m):f},m},zoomTransform:ja,zoomIdentity:Ua}),qa=function(){function t(n,i,o){e._classCallCheck(this,t),this.canvasController=n,this.isSubflow=i,this.pipelineId=o}return e._createClass(t,[{key:"isDisplayingCurrentPipeline",value:function(){return this.canvasController.getCurrentBreadcrumb().pipelineId===this.pipelineId}},{key:"setDisplayState",value:function(){this.canvasController.getBreadcrumbs().length>1&&this.isDisplayingCurrentPipeline()?this.displayState="sub-flow-full-page":this.isSubflow?this.displayState="sub-flow-in-place":this.displayState="primary-flow-full-page"}},{key:"getDisplayStateMsg",value:function(){return"Display state set to "+this.displayState}},{key:"isDisplayingPrimaryFlowFullPage",value:function(){return"primary-flow-full-page"===this.displayState}},{key:"isDisplayingSubFlow",value:function(){return"sub-flow-in-place"===this.displayState||"sub-flow-full-page"===this.displayState}},{key:"isDisplayingSubFlowInPlace",value:function(){return"sub-flow-in-place"===this.displayState}},{key:"isDisplayingSubFlowFullPage",value:function(){return"sub-flow-full-page"===this.displayState}},{key:"isDisplayingFullPage",value:function(){return"primary-flow-full-page"===this.displayState||"sub-flow-full-page"===this.displayState}}]),t}();function $a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ja(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ja(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==n.return||n.return()}finally{if(s)throw a}}}}function Ja(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var Qa=function(){function t(n){e._classCallCheck(this,t),this.canvasLayout=n}return e._createClass(t,[{key:"isPointInNodeBoundary",value:function(e,t){return e.x>=t.x_pos&&e.x<=t.x_pos+t.width&&e.y>=t.y_pos&&e.y<=t.y_pos+t.height}},{key:"getNodeImageClass",value:function(e){return"d3-node-image"}},{key:"getNodeLabelClass",value:function(e){if(f.CanvasUtils.isExpandedSupernode(e))return"d3-node-label d3-label-single-line "+this.getMessageLabelClass(e.messages);var t=e.layout.labelSingleLine?" d3-label-single-line":" d3-label-multi-line",n="center"===e.layout.labelAlign?" d3-label-center":"";return"d3-node-label "+this.getMessageLabelClass(e.messages)+t+n}},{key:"getNodeLabelTextAreaClass",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?"d3-node-label-entry d3-label-single-line":"d3-node-label-entry"+(e.layout.labelSingleLine?" d3-label-single-line":" d3-label-multi-line")+("center"===e.layout.labelAlign?" d3-label-center":"")}},{key:"getErrorMarkerIcon",value:function(e){var t="";switch(this.getMessageLevel(e.messages)){case l.ERROR:t=l.NODE_ERROR_ICON;break;case l.WARNING:t=l.NODE_WARNING_ICON}return t}},{key:"getMessageLevel",value:function(e){var t="";if(e&&e.length>0){var n,i=$a(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.type===l.ERROR)return o.type;o.type===l.WARNING&&(t=o.type)}}catch(e){i.e(e)}finally{i.f()}}return t}},{key:"getMessageLabelClass",value:function(e){var t="";switch(this.getMessageLevel(e)){case l.ERROR:t="d3-node-error-label";break;case l.WARNING:t="d3-node-warning-label"}return t}},{key:"getErrorMarkerClass",value:function(e){var t="d3-error-circle-off";switch(this.getMessageLevel(e)){case l.ERROR:t="d3-error-circle";break;case l.WARNING:t="d3-warning-circle"}return t}},{key:"getNodeCenterPosX",value:function(e){return e.x_pos+e.width/2}},{key:"getNodeCenterPosY",value:function(e){return e.y_pos+e.height/2}},{key:"getNodeImageCenterPosX",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?e.x_pos+this.canvasLayout.supernodeImagePosX+this.canvasLayout.supernodeImageWidth/2:e.x_pos+this.getElementPosX(e.width,e.layout.imagePosX,e.layout.imagePosition)+e.layout.imageWidth/2}},{key:"getNodeImageCenterPosY",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?e.y_pos+this.canvasLayout.supernodeImagePosY+this.canvasLayout.supernodeImageHeight/2:e.y_pos+this.getElementPosY(e.height,e.layout.imagePosY,e.layout.imagePosition)+e.layout.imageHeight/2}},{key:"getNodeImagePosX",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeImagePosX:this.getElementPosX(e.width,e.layout.imagePosX,e.layout.imagePosition)}},{key:"getNodeImagePosY",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeImagePosY:this.getElementPosY(e.height,e.layout.imagePosY,e.layout.imagePosition)}},{key:"getNodeImageWidth",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeImageWidth:e.layout.imageWidth}},{key:"getNodeImageHeight",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeImageHeight:e.layout.imageHeight}},{key:"getNodeLabelPosX",value:function(e){if(f.CanvasUtils.isExpandedSupernode(e))return this.canvasLayout.supernodeLabelPosX;var t=this.getElementPosX(e.width,e.layout.labelPosX,e.layout.labelPosition);return"center"===e.layout.labelAlign?t-e.layout.labelWidth/2:t}},{key:"getNodeLabelPosY",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeLabelPosY:this.getElementPosY(e.height,e.layout.labelPosY,e.layout.labelPosition)}},{key:"getNodeLabelWidth",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?e.width-this.canvasLayout.supernodeLabelPosX+this.canvasLayout.supernodeErrorPosX:e.layout.labelWidth}},{key:"getNodeLabelHeight",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeLabelHeight:e.layout.labelHeight}},{key:"getNodeLabelEditIconTranslate",value:function(e,t,n,i){return"translate(".concat(this.getNodeLabelEditIconPosX(e,t,n,i),", ").concat(this.getNodeLabelEditIconPosY(e),")")}},{key:"getNodeLabelEditIconPosX",value:function(e,t,n,i){var o=i?this.getNodeLabelHoverWidth(e):this.getNodeLabelWidth(e),a=i?this.getNodeLabelHoverPosX(e):this.getNodeLabelPosX(e),r=t.getBoundingClientRect().width;if("center"===e.layout.labelAlign&&!f.CanvasUtils.isExpandedSupernode(e)){var s=o/2;return a+s+Math.min(s,r/n/2)}var l=Math.min(o,r/n);return this.getNodeLabelPosX(e)+l}},{key:"getNodeLabelEditIconPosY",value:function(e){return this.getNodeLabelPosY(e)}},{key:"getNodeLabelHoverPosX",value:function(e){return e.layout.labelSingleLine&&"center"===e.layout.labelAlign?this.getNodeLabelPosX(e)-250:this.getNodeLabelPosX(e)}},{key:"getNodeLabelHoverWidth",value:function(e){return e.layout.labelSingleLine?"center"===e.layout.labelAlign?e.layout.labelWidth+500:e.layout.labelWidth+40:e.layout.labelWidth}},{key:"getNodeLabelHoverHeight",value:function(e,t,n){if(e.layout.labelSingleLine)return e.layout.labelHeight;var i=t.getBoundingClientRect().height/n;return Math.max(i,e.layout.labelHeight)}},{key:"getNodeLabelTextAreaWidth",value:function(e){return this.getNodeLabelWidth(e)+2*l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getNodeLabelTextAreaHeight",value:function(e){return this.getNodeLabelHeight(e)+2*l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getNodeLabelTextAreaPosX",value:function(e){return this.getNodeLabelPosX(e)-l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getNodeLabelTextAreaPosY",value:function(e){return this.getNodeLabelPosY(e)-l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getNodeEllipsisTranslate",value:function(e){return"translate(".concat(this.getNodeEllipsisPosX(e),", ").concat(this.getNodeEllipsisPosY(e),")")}},{key:"getNodeEllipsisWidth",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeEllipsisWidth:e.layout.ellipsisWidth}},{key:"getNodeEllipsisHeight",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeEllipsisHeight:e.layout.ellipsisHeight}},{key:"getNodeEllipsisIconWidth",value:function(e){return this.getNodeEllipsisWidth(e)-2*e.layout.ellipsisHoverAreaPadding}},{key:"getNodeEllipsisIconHeight",value:function(e){return this.getNodeEllipsisHeight(e)-2*e.layout.ellipsisHoverAreaPadding}},{key:"getNodeEllipsisPosX",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?e.width+this.canvasLayout.supernodeEllipsisPosX:this.getElementPosX(e.width,e.layout.ellipsisPosX,e.layout.ellipsisPosition)}},{key:"getNodeEllipsisPosY",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeEllipsisPosY:this.getElementPosY(e.height,e.layout.ellipsisPosY,e.layout.ellipsisPosition)}},{key:"getNodeExpansionIconTranslate",value:function(e){var t=e.width+this.canvasLayout.supernodeExpansionIconPosX;return"translate(".concat(t,", ").concat(this.canvasLayout.supernodeExpansionIconPosY,")")}},{key:"getNodeErrorPosX",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?e.width+this.canvasLayout.supernodeErrorPosX:this.getElementPosX(e.width,e.layout.errorXPos,e.layout.errorPosition)}},{key:"getNodeErrorPosY",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeErrorPosY:this.getElementPosY(e.height,e.layout.errorYPos,e.layout.errorPosition)}},{key:"getNodeErrorWidth",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeErrorWidth:e.layout.errorWidth}},{key:"getNodeErrorHeight",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeErrorHeight:e.layout.errorHeight}},{key:"getNodeInputPortLeftPosX",value:function(e){return this.getElementPosX(e.width,e.layout.inputPortLeftPosX,e.layout.inputPortLeftPosition)}},{key:"getNodeInputPortLeftPosY",value:function(e){return this.getElementPosY(e.height,e.layout.inputPortLeftPosY,e.layout.inputPortLeftPosition)}},{key:"getNodeOutputPortRightPosX",value:function(e){return this.getElementPosX(e.width,e.layout.outputPortRightPosX,e.layout.outputPortRightPosition)}},{key:"getNodeOutputPortRightPosY",value:function(e){return this.getElementPosY(e.height,e.layout.outputPortRightPosY,e.layout.outputPortRightPosition)}},{key:"getElementPosX",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"topLeft",i=0;return n.endsWith("Center")?i+=e/2:n.endsWith("Right")&&(i+=e),i+Number(t)}},{key:"getElementPosY",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"topLeft",i=0;return n.startsWith("middle")?i+=e/2:n.startsWith("bottom")&&(i+=e),i+Number(t)}},{key:"getSupernodePortXOffset",value:function(e,t){return t?t.find((function(t){return t.subflow_node_ref===e})).cx-this.canvasLayout.supernodeSVGAreaPadding:0}},{key:"getSupernodePortYOffset",value:function(e,t){return t?t.find((function(t){return t.subflow_node_ref===e})).cy:0}}]),t}(),er=function(){function t(){e._classCallCheck(this,t)}return e._createClass(t,[{key:"getCommentCenterPosX",value:function(e){return e.x_pos+e.width/2}},{key:"getCommentCenterPosY",value:function(e){return e.y_pos+e.height/2}}]),t}(),tr=Math.PI,nr=function(){function t(n,i,o,a){e._classCallCheck(this,t),this.canvasLayout=i,this.config=n,this.nodeUtils=o,this.commentUtils=a}return e._createClass(t,[{key:"getNewStraightCommentLinkStartPos",value:function(e,t){return f.CanvasUtils.getOuterCoord(e.x_pos,e.y_pos,e.width,e.height,this.canvasLayout.linkGap,this.commentUtils.getCommentCenterPosX(e),this.commentUtils.getCommentCenterPosY(e),t.x,t.y)}},{key:"getNewStraightNodeLinkStartPos",value:function(e,t,n){var i,o;if("image_center"!==e.layout.drawNodeLinkLineFromTo||f.CanvasUtils.isExpanded(e))if(n){var a=this.getCenterOffset(e,n);i=a.x,o=a.y}else i=this.nodeUtils.getNodeCenterPosX(e),o=this.nodeUtils.getNodeCenterPosY(e);else i=this.nodeUtils.getNodeImageCenterPosX(e),o=this.nodeUtils.getNodeImageCenterPosY(e);return f.CanvasUtils.getOuterCoord(e.x_pos,e.y_pos,e.width,e.height,this.canvasLayout.linkGap,i,o,t.x,t.y)}},{key:"addConnectionPaths",value:function(e){var t=this;return e.forEach((function(e){e.pathInfo=t.getConnectorPathInfo(e)})),e}},{key:"getConnectorPathInfo",value:function(e,t){var n=this.getMinInitialLine(e,t);if(Math.abs(e.x1-e.x2)<20&&Math.abs(e.y1-e.y2)<20)return this.getStraightPath(e);if(e.type===l.NODE_LINK){if(this.canvasLayout.linkType===l.LINK_TYPE_CURVE||this.canvasLayout.linkType===l.LINK_TYPE_ELBOW)return this.getPortLinkPath(e,n)}else if(e.type===l.ASSOCIATION_LINK&&this.config.enableAssocLinkType===l.ASSOC_RIGHT_SIDE_CURVE)return this.getAssociationCurvePath(e,n);return this.getStraightPath(e)}},{key:"getMinInitialLine",value:function(e,t){return e.type===l.COMMENT_LINK?0:e.minInitialLineForElbow?e.minInitialLineForElbow:e.srcObj&&e.srcObj.layout?e.srcObj.layout.minInitialLine:t||10}},{key:"getLinkCoords",value:function(e,t,n,i,o,a){return e.type===l.NODE_LINK?this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT?this.getNodeLinkCoordsForStraightLine(t,i,e):this.getNodeLinkCoordsForPorts(t,n,i,o):e.type===l.ASSOCIATION_LINK?this.config.enableAssocLinkType===l.ASSOC_RIGHT_SIDE_CURVE?this.getAssociationCurveLinkCoords(t,i,a):this.getNodeLinkCoordsForStraightLine(t,i):this.getCommentLinkCoords(t,i)}},{key:"getNodeLinkCoordsForStraightLine",value:function(e,t,n){var i,o,a,r;if("image_center"!==e.layout.drawNodeLinkLineFromTo||f.CanvasUtils.isExpanded(e))if(n&&n.srcOriginInfo){var s=this.getCenterOffset(e,n.srcOriginInfo);i=s.x,o=s.y}else i=this.nodeUtils.getNodeCenterPosX(e),o=this.nodeUtils.getNodeCenterPosY(e);else i=this.nodeUtils.getNodeImageCenterPosX(e),o=this.nodeUtils.getNodeImageCenterPosY(e);if("image_center"!==t.layout.drawNodeLinkLineFromTo||f.CanvasUtils.isExpanded(t))if(n&&n.trgOriginInfo){var l=this.getCenterOffset(t,n.trgOriginInfo);a=l.x,r=l.y}else a=this.nodeUtils.getNodeCenterPosX(t),r=this.nodeUtils.getNodeCenterPosY(t);else a=this.nodeUtils.getNodeImageCenterPosX(t),r=this.nodeUtils.getNodeImageCenterPosY(t);var c=f.CanvasUtils.getOuterCoord(e.x_pos,e.y_pos,e.width,e.height,this.canvasLayout.linkGap,i,o,a,r),u=f.CanvasUtils.getOuterCoord(t.x_pos,t.y_pos,t.width,t.height,this.canvasLayout.linkGap,a,r,i,o);return{originX:c.originX,originY:c.originY,x1:c.x,y1:c.y,x2:u.x,y2:u.y}}},{key:"getCenterOffset",value:function(e,t){var n=t.len+1,i=t.idx+1,o=0,a=0;return t.dir===l.NORTH||t.dir===l.SOUTH?(o=e.x_pos+e.width/n*i,a=this.nodeUtils.getNodeCenterPosY(e)):t.dir!==l.EAST&&t.dir!==l.WEST||(o=this.nodeUtils.getNodeCenterPosX(e),a=e.y_pos+e.height/n*i),{x:o,y:a}}},{key:"getNodeLinkCoordsForPorts",value:function(e,t,n,i){var o=e.width+e.layout.outputPortRightPosX,a=e.layout.outputPortRightPosY,r=n.layout.inputPortLeftPosX,s=n.layout.inputPortLeftPosY;if(this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?(o=e.layout.outputPortBottomPosX,a=e.height+e.layout.outputPortBottomPosY,r=n.layout.inputPortTopPosX,s=n.layout.inputPortTopPosY):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP&&(o=e.layout.outputPortBottomPosX,a=e.layout.outputPortBottomPosY,r=n.layout.inputPortTopPosX,s=n.height+n.layout.inputPortTopPosY),e.outputs&&e.outputs.length>0){var c=e.outputs.find((function(e){return e.id===t}));o=c?c.cx:o,a=c?c.cy:a}if(n.inputs&&n.inputs.length>0){var u=n.inputs.find((function(e){return e.id===i}));r=u?u.cx:r,s=u?u.cy:s}return{x1:e.x_pos+o,y1:e.y_pos+a,x2:n.x_pos+r,y2:n.y_pos+s}}},{key:"getAssociationCurveLinkCoords",value:function(e,t,n){var i=0,o=0;return n===l.ASSOC_VAR_CURVE_RIGHT?(i=e.x_pos+e.width,o=t.x_pos):n===l.ASSOC_VAR_CURVE_LEFT?(i=e.x_pos,o=t.x_pos+t.width):n===l.ASSOC_VAR_DOUBLE_BACK_LEFT?(i=e.x_pos,o=t.x_pos):(i=e.x_pos+e.width,o=t.x_pos+t.width),{x1:i,y1:e.y_pos+e.layout.outputPortRightPosY,x2:o,y2:t.y_pos+t.layout.inputPortLeftPosY}}},{key:"getCommentLinkCoords",value:function(e,t){var n,i,o=this.commentUtils.getCommentCenterPosX(e),a=this.commentUtils.getCommentCenterPosY(e);"image_center"===t.layout.drawCommentLinkLineTo?(n=this.nodeUtils.getNodeImageCenterPosX(t),i=this.nodeUtils.getNodeImageCenterPosY(t)):(n=this.nodeUtils.getNodeCenterPosX(t),i=this.nodeUtils.getNodeCenterPosY(t));var r=f.CanvasUtils.getOuterCoord(e.x_pos,e.y_pos,e.width,e.height,this.canvasLayout.linkGap,o,a,n,i),s=f.CanvasUtils.getOuterCoord(t.x_pos,t.y_pos,t.width,t.height,this.canvasLayout.linkGap,n,i,o,a);return{x1:r.x,y1:r.y,x2:s.x,y2:s.y}}},{key:"getPortLinkPath",value:function(e,t){var n,i,o,a;e.srcObj&&e.trgNode?this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?(n=-(e.srcObj.x_pos+e.srcObj.width),o=-e.srcObj.x_pos,i=-(e.trgNode.x_pos+e.trgNode.width),a=-e.trgNode.x_pos):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP?(n=e.srcObj.x_pos,o=e.srcObj.x_pos+e.srcObj.width,i=e.trgNode.x_pos,a=e.trgNode.x_pos+e.trgNode.width):(n=e.srcObj.y_pos,o=e.srcObj.y_pos+e.srcObj.height,i=e.trgNode.y_pos,a=e.trgNode.y_pos+e.trgNode.height):this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?(n=-e.x1,i=-e.x2,o=-e.x1,a=-e.x2):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP?(n=e.x1,i=e.x2,o=e.x1,a=e.x2):(n=e.y1,i=e.y2,o=e.y1,a=e.y2);var r=e;this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?r=this.rotateData90Degrees(r,true):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP&&(r=this.rotateData90Degrees(r,false));var s=this.canvasLayout.linkType===l.LINK_TYPE_ELBOW?this.getElbowPathInfo(r,t,n,i,o,a):this.getCurvePathInfo(r,t,n,i,o,a);return this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?(s.elements=this.rotateElements90Degrees(s.elements,false),s.centerPoint=this.rotatePoint90Degrees(s.centerPoint.x,s.centerPoint.y,false)):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP&&(s.elements=this.rotateElements90Degrees(s.elements,true),s.centerPoint=this.rotatePoint90Degrees(s.centerPoint.x,s.centerPoint.y,true)),s.path=this.createPath(s.elements),s}},{key:"getCurvePathInfo",value:function(e,t,n,i,o,a){var r={x:0,y:0},s=e.x2-e.x1,l=[];if(l.push({p:"M",x:e.x1,y:e.y1}),s>=t||a>n-this.canvasLayout.wrapAroundNodePadding&&i<o+this.canvasLayout.wrapAroundNodePadding&&e.x2>e.x1){var c=e.x1+(e.x2-e.x1)/2,u=e.y1,d=c,h=e.y2;l.push({p:"C",x:c,y:u,x2:d,y2:h,x3:e.x2,y3:e.y2}),r.x=c,r.y=u+(h-u)/2}else{var p=e.y2-e.y1,g=this.calculateMidY(e,n,o,i,a),f=Math.min(Math.abs(p)/2,-(s-t/2)),v=t-Math.max(s/2,0),y=e.x1+v,m=e.y1,C=y,k=e.y1+(g-e.y1)/2,b=e.x1+(e.x2-e.x1)/2,T=g,P=e.x1-f,L=g,_=e.x2+f,N=g,x=e.x2-v,w=g,S=x,E=g+(e.y2-g)/2;P>_?(l.push({p:"Q",x:y,y:m,x2:C,y2:k},{p:"T",x:P,y:L},{p:"L",x:_,y:N},{p:"Q",x:x,y:w,x2:S,y2:E},{p:"T",x:e.x2,y:e.y2}),r.x=P+(_-P)/2,r.y=L):(l.push({p:"Q",x:y,y:m,x2:C,y2:k},{p:"T",x:b,y:T},{p:"Q",x:x,y:w,x2:S,y2:E},{p:"T",x:e.x2,y:e.y2}),r.x=b,r.y=T)}return{elements:l,centerPoint:r}}},{key:"getElbowPathInfo",value:function(e,t,n,i,o,a){var r,s=e.trgNode?e.trgNode.layout.minFinalLine:30,l={x:0,y:0},c=e.x1+t,u=e.y1,d=c,h=e.y2,p=e.x2-e.x1,g=e.y2-e.y1;r=p>0&&g<4*this.canvasLayout.elbowSize&&g>-4*this.canvasLayout.elbowSize?p<t+s?g/4:g/2:g>=0?this.canvasLayout.elbowSize:-this.canvasLayout.elbowSize;var f=this.canvasLayout.elbowSize,v=!1;p<t+s&&(v=!0,d=e.x2-s,f=Math.min(this.canvasLayout.elbowSize,-(p-(t+s))/2));var y=[];if(y.push({p:"M",x:e.x1,y:e.y1},{p:"L",x:c-this.canvasLayout.elbowSize,y:u},{p:"Q",x:c,y:u,x2:c,y2:u+r}),!1===v)y.push({p:"L",x:d,y:h-r}),l.x=d,l.y=h;else{var m,C,k=p<0?this.calculateMidY(e,n,o,i,a):h-(h-u)/2;k<i&&k<n||k>a&&k>o?(m=k-r,C=h+r):(m=k+r,C=h-r),y.push({p:"L",x:c,y:k-r},{p:"Q",x:c,y:k,x2:c-f,y2:k},{p:"L",x:d+f,y:k},{p:"Q",x:d,y:k,x2:d,y2:m},{p:"L",x:d,y:C}),l.x=c,l.y=k}return y.push({p:"Q",x:d,y:h,x2:d+this.canvasLayout.elbowSize,y2:h},{p:"L",x:e.x2,y:e.y2}),{elements:y,centerPoint:l}}},{key:"calculateMidY",value:function(e,t,n,i,o){return i>=n+this.canvasLayout.wrapAroundNodePadding?n+(i-n)/2:o<=t-this.canvasLayout.wrapAroundNodePadding?o+(t-o)/2:e.y1>e.y2?Math.min(t,i)-this.canvasLayout.wrapAroundSpacing:Math.max(n,o)+this.canvasLayout.wrapAroundSpacing}},{key:"rotateData90Degrees",value:function(e,t){var n=this.rotatePoint90Degrees(e.x1,e.y1,t),i=this.rotatePoint90Degrees(e.x2,e.y2,t);return{x1:n.x,y1:n.y,x2:i.x,y2:i.y}}},{key:"rotateElements90Degrees",value:function(e,t){var n,i=this;return e.forEach((function(e){n=i.rotatePoint90Degrees(e.x,e.y,t),e.x=n.x,e.y=n.y,"Q"!==e.p&&"C"!==e.p||(n=i.rotatePoint90Degrees(e.x2,e.y2,t),e.x2=n.x,e.y2=n.y,"C"===e.p&&(n=i.rotatePoint90Degrees(e.x3,e.y3,t),e.x3=n.x,e.y3=n.y))})),e}},{key:"rotatePoint90Degrees",value:function(e,t,n){return n?{x:t,y:-e}:{x:-t,y:e}}},{key:"createPath",value:function(e){var t=e.length-1,n="";return e.forEach((function(e,i){"M"===e.p?n+="M "+e.x+" "+e.y:"L"===e.p?n+="L "+e.x+" "+e.y:"T"===e.p?n+="T "+e.x+" "+e.y:"Q"===e.p?n+="Q "+e.x+" "+e.y+" "+e.x2+" "+e.y2:"C"===e.p&&(n+="C "+e.x+" "+e.y+" "+e.x2+" "+e.y2+" "+e.x3+" "+e.y3),i<t&&(n+=" ")})),n}},{key:"getStraightPath",value:function(e){var t="M "+e.x1+" "+e.y1+" L "+e.x2+" "+e.y2,n=e.x2-e.x1,i=e.y2-e.y1,o={x:e.x1+n/2,y:e.y1+i/2},a=Math.atan(i/n);return n<0&&(a=tr+a),{path:t,centerPoint:o,angle:a}}},{key:"getAssociationCurvePath",value:function(e,t){return e.assocLinkVariation===l.ASSOC_VAR_CURVE_LEFT?this.getCurveLeftPath(e,t):e.assocLinkVariation===l.ASSOC_VAR_DOUBLE_BACK_LEFT?this.getDoubleBackLeft(e,t):e.assocLinkVariation===l.ASSOC_VAR_DOUBLE_BACK_RIGHT?this.getDoubleBackRight(e,t):this.getCurveRightPath(e,t)}},{key:"getCurveLeftPath",value:function(e,t){var n=e.x1-(e.x1-e.x2)/2;return this.getCurveOutPath(e,t,n)}},{key:"getCurveRightPath",value:function(e,t){var n=e.x1+(e.x2-e.x1)/2;return this.getCurveOutPath(e,t,n)}},{key:"getCurveOutPath",value:function(e,t,n){var i=e.y1,o=n,a=e.y2;return{path:"M "+e.x1+" "+e.y1+" C "+n+" "+i+" "+o+" "+a+" "+e.x2+" "+e.y2,centerPoint:{x:n,y:i+(a-i)/2}}}},{key:"getDoubleBackLeft",value:function(e,t){var n=Math.min(e.x1,e.x2)-t-100;return this.getDoubleBack(e,t,n)}},{key:"getDoubleBackRight",value:function(e,t){var n=Math.max(e.x1,e.x2)+t+100;return this.getDoubleBack(e,t,n)}},{key:"getDoubleBack",value:function(e,t,n){var i=e.y1,o=n,a=e.y2;return{path:"M "+e.x1+" "+e.y1+" C "+n+" "+i+" "+o+" "+a+" "+e.x2+" "+e.y2,centerPoint:{x:this.calcCenterPoint(e.x1,n,o,e.x2),y:this.calcCenterPoint(e.y1,i,a,e.y2)}}}},{key:"calcCenterPoint",value:function(e,t,n,i){var o=.5;return Math.pow(.5,3)*e+3*Math.pow(.5,2)*o*t+3*Math.pow(.5,2)*o*n+Math.pow(o,3)*i}}]),t}(),ir=function(){function t(n){e._classCallCheck(this,t),this.canvasLayout=n}return e._createClass(t,[{key:"getDec",value:function(e,t){return t?t.find((function(t){return t.id===e})):null}},{key:"getDecLabelClass",value:function(e,t){var n=e.label_single_line?" d3-label-single-line":" d3-label-multi-line",i="center"===e.label_align?" d3-label-center":"";return this.getDecClass(e,"d3-".concat(t,"-dec-label"))+n+i}},{key:"getDecLabelTextAreaClass",value:function(e){return"d3-dec-label-entry"+(e.label_single_line?" d3-label-single-line":" d3-label-multi-line")+("center"===e.label_align?" d3-label-center":"")}},{key:"getDecTransform",value:function(e,t,n){return"translate(".concat(this.getDecPosX(e,t,n),", ").concat(this.getDecPosY(e,t,n),")")}},{key:"getDecPosX",value:function(e,t,n){return n===l.DEC_LINK?this.getLinkDecPosX(e,t,n):this.getNodeDecPosX(e,t)}},{key:"getNodeDecPosX",value:function(e,t){var n=e.position||"topLeft",i=0;return"topLeft"===n||"middleLeft"===n||"bottomLeft"===n?i=void 0!==e.x_pos?Number(e.x_pos):t.layout.decoratorLeftX:"topCenter"===n||"middleCenter"===n||"bottomCenter"===n?i=t.width/2+(void 0!==e.x_pos?Number(e.x_pos):t.layout.decoratorCenterX):"topRight"!==n&&"middleRight"!==n&&"bottomRight"!==n||(i=t.width+(void 0!==e.x_pos?Number(e.x_pos):t.layout.decoratorRightX)),i}},{key:"getLinkDecPosX",value:function(e,t,n){var i=e.position||"middle",o=0;return"middle"===i?o=t.pathInfo.centerPoint?t.pathInfo.centerPoint.x:t.x1+(t.x2-t.x1)/2:"source"===i?o=t.pathInfo.sourcePoint?t.pathInfo.sourcePoint.x:t.x1:"target"===i&&(o=t.pathInfo.targetPoint?t.pathInfo.targetPoint.x:t.x2),o=void 0!==e.x_pos?o+Number(e.x_pos):o,e.distance&&a.has_1(t,"pathInfo.angle")&&(o+=Math.cos(t.pathInfo.angle)*e.distance),"center"===e.label_align&&(o-=this.getDecWidth(e,t,n)/2),o}},{key:"getDecPosY",value:function(e,t,n){return n===l.DEC_LINK?this.getLinkDecPosY(e,t):this.getNodeDecPosY(e,t)}},{key:"getNodeDecPosY",value:function(e,t){var n=e.position||"topLeft",i=0;return"topLeft"===n||"topCenter"===n||"topRight"===n?i=void 0!==e.y_pos?Number(e.y_pos):t.layout.decoratorTopY:"middleLeft"===n||"middleCenter"===n||"middleRight"===n?i=t.height/2+(void 0!==e.y_pos?Number(e.y_pos):t.layout.decoratorMiddleY):"bottomLeft"!==n&&"bottomCenter"!==n&&"bottomRight"!==n||(i=t.height+(void 0!==e.y_pos?Number(e.y_pos):t.layout.decoratorBottomY)),i}},{key:"getLinkDecPosY",value:function(e,t){var n=e.position||"middle",i=0;return"middle"===n?i=t.pathInfo.centerPoint?t.pathInfo.centerPoint.y:t.y1+(t.y2-t.y1)/2:"source"===n?i=t.pathInfo.sourcePoint?t.pathInfo.sourcePoint.y:t.y1:"target"===n&&(i=t.pathInfo.targetPoint?t.pathInfo.targetPoint.y:t.y2),i=void 0!==e.y_pos?i+Number(e.y_pos):i,e.distance&&a.has_1(t,"pathInfo.angle")&&(i+=Math.sin(t.pathInfo.angle)*e.distance),i}},{key:"getDecPadding",value:function(e,t,n){return!1===e.outline?0:n===l.DEC_LINK?this.canvasLayout.linkDecoratorPadding:t.layout.decoratorPadding}},{key:"getDecWidth",value:function(e,t,n){return void 0!==e.width?Number(e.width):n===l.DEC_LINK?this.canvasLayout.linkDecoratorWidth:t.layout.decoratorWidth}},{key:"getDecHeight",value:function(e,t,n){return void 0!==e.height?Number(e.height):n===l.DEC_LINK?this.canvasLayout.linkDecoratorHeight:t.layout.decoratorHeight}},{key:"getDecClass",value:function(e,t){var n=t;return e&&e.class_name&&(n+=" "+e.class_name),n}},{key:"getDecImage",value:function(e){return e?e.image:""}},{key:"getDecLabelEditIconTranslate",value:function(e,t,n,i,o){return"translate(".concat(this.getDecLabelEditIconPosX(e,t,n,i,o),", ").concat(this.getDecLabelEditIconPosY(e),")")}},{key:"getDecLabelEditIconPosX",value:function(e,t,n,i,o){return"center"===e.label_align?this.getDecLabelWidth(e,t,n)/2+i.getBoundingClientRect().width/2/o:i.getBoundingClientRect().width/o}},{key:"getDecLabelEditIconPosY",value:function(e){return 0}},{key:"getDecLabelWidth",value:function(e,t,n){return void 0!==e.width?Number(e.width):n===l.DEC_LINK?this.canvasLayout.linkDecoratorLabelWidth:t.layout.decoratorLabelWidth}},{key:"getDecLabelHeight",value:function(e,t,n){return void 0!==e.height?Number(e.height):n===l.DEC_LINK?this.canvasLayout.linkDecoratorLabelHeight:t.layout.decoratorLabelHeight}},{key:"getDecLabelTextAreaWidth",value:function(e,t,n){return this.getDecLabelWidth(e,t,n)+2*l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getDecLabelTextAreaHeight",value:function(e,t,n){return this.getDecLabelHeight(e,t,n)+2*l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getDecLabelTextAreaPosX",value:function(){return-l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getDecLabelTextAreaPosY",value:function(){return-(l.TEXT_AREA_BORDER_ADJUSTMENT-1)}}]),t}(),or=kn({"&":"&","<":"<",">":">",""":'"',"'":"'"}),ar=a.toString_1,rr=or,sr=/&(?:amp|lt|gt|quot|#39);/g,lr=RegExp(sr.source);var cr=function(e){return(e=ar(e))&&lr.test(e)?e.replace(sr,rr):e},ur=function(){function t(){e._classCallCheck(this,t)}return e._createClass(t,null,[{key:"processMarkdownAction",value:function(e,t,n,i){var o=n,a=i,r=null;switch(o===a?(o=this.findFirstSpace(t,o),a=this.findLastSpace(t,a)):this.allWhiteSpace(t,o,a)?o=a:(o=this.findFirstNonSpace(t,o,a),a=this.findLastNonSpace(t,o,a)),e){case"title":case"header":case"subheader":case"body":case"increaseHashes":case"decreaseHashes":r=this.processHeaderCommand(t,o,a,e);break;case"bold":r=this.processWrapCommand(t,o,a,"**");break;case"italics":r=this.processWrapCommand(t,o,a,"_");break;case"strikethrough":r=this.processWrapCommand(t,o,a,"~~");break;case"code":r=this.processCodeCommand(t,o,a);break;case"link":r=this.processLinkCommand(t,o,a);break;case"quote":case"numberedList":case"bulletedList":r=this.processMultiLineCommand(t,o,a,e);break;case"return":r=this.processReturnCommand(t,o,a,n,i)}return r}},{key:"findFirstSpace",value:function(e,t){var n=e.lastIndexOf(" ",t-1)+1,i=e.lastIndexOf("\n",t-1)+1;return Math.max(n,i,0)}},{key:"findLastSpace",value:function(e,t){var n=e.indexOf(" ",t),i=e.indexOf("\n",t);return n=-1===n?e.length:n,i=-1===i?e.length:i,Math.min(n,i,e.length)}},{key:"allWhiteSpace",value:function(e,t,n){return 0===e.slice(t,n).trim().length}},{key:"findFirstNonSpace",value:function(e,t,n){for(var i=t;(" "===e[i]||"\n"===e[i])&&i<=n;)i++;return i}},{key:"findLastNonSpace",value:function(e,t,n){for(var i=n;(" "===e[i-1]||"\n"===e[i-1])&&i>=t;)i--;return i}},{key:"processHeaderCommand",value:function(e,t,n,i){var o=this.findPrecedingNewLine(e,t),a=this.findSuceedingNewLine(e,n),r=e.slice(0,o),s=e.slice(o,a),l=e.slice(a),c=o,u=a,d="",h=s,p=this.getHashCount(s);if(p>0){var g=s.indexOf(" ");d=r+(h=s.slice(g+1))+l,u-=g+1}var f=this.getHeaderSyntax(i,p);return f&&(d=r+f+h+l,c+=f.length,u+=f.length),{newText:d,newStart:c,newEnd:u}}},{key:"getHeaderSyntax",value:function(e,t){switch(e){case"title":return"# ";case"header":return"## ";case"subheader":return"### ";case"body":return!1;case"increaseHashes":return 0===t?"# ":1===t?"## ":2===t&&"### ";case"decreaseHashes":return 0===t?"### ":1!==t&&(2===t?"# ":3===t?"## ":"### ")}return!1}},{key:"getHashCount",value:function(e){return e.startsWith("# ")?1:e.startsWith("## ")?2:e.startsWith("### ")?3:e.startsWith("#### ")?4:e.startsWith("##### ")?5:e.startsWith("###### ")?6:0}},{key:"processWrapCommand",value:function(e,t,n,i){var o="",a=t,r=n,s=e.slice(0,t),l=e.slice(t,n),c=e.slice(n),u=i.length;return s.endsWith(i)&&c.startsWith(i)?(o=s.slice(0,s.length-u)+l+c.slice(u),a=t-u,r=n-u):l.startsWith(i)&&l.endsWith(i)?(o=s+l.slice(0,l.length-u).slice(u)+c,a=t,r=n-2*u):(o=s+i+l+i+c,a=t+u,r=n+u),{newText:o,newStart:a,newEnd:r}}},{key:"processCodeCommand",value:function(e,t,n){return e.slice(t,n).indexOf("\n")>-1?this.processTripleBackTicks(e,t,n):this.processWrapCommand(e,t,n,"`")}},{key:"processTripleBackTicks",value:function(e,t,n){var i=this.findPrecedingNewLine(e,t),o=this.findSuceedingNewLine(e,n),a=e.slice(0,i),r=e.slice(i,o),s=e.slice(o),l=i,c=o,u="";return a.endsWith("```\n")&&s.startsWith("\n```")?(u=a.slice(0,i-4)+r+s.slice(4),l-=4,c-=4):(u=a+"```\n"+r+"\n```"+s,l+=4,c+=4),{newText:u,newStart:l,newEnd:c}}},{key:"processLinkCommand",value:function(e,t,n){var i="",o=t,a=n,r=e.slice(0,t),s=e.slice(t,n),l=e.slice(n);return r.endsWith("[")&&l.startsWith("](url)")?(i=r.slice(0,r.length-1)+s+l.slice(6),o=t-1,a=n-1):"[](url)"===s?(i=r+l,a=o=t):t===n?(i=r+"[](url)"+l,o=t+1,a=t+1):(i=r+"["+s+"](url)"+l,o=t+1,a=n+1),{newText:i,newStart:o,newEnd:a}}},{key:"processMultiLineCommand",value:function(e,t,n,i){return this.isMultiLineMarkdown(e,t,n,i)?this.removeMultiLineMarkdown(e,t,n,i):this.addMultiLineMarkdown(e,t,n,i)}},{key:"isMultiLineMarkdown",value:function(e,t,n,i){var o=this,a=this.findPrecedingNewLine(e,t),r=this.findSuceedingNewLine(e,n);return e.slice(a,r).split("\n").every((function(e){return o.isMultiLineItem(e,i)}))}},{key:"isMultiLineItem",value:function(e,t){switch(t){case"quote":return e.startsWith("> ");case"bulletedList":return e.startsWith("* ");case"numberedList":var n=this.getPrefixNumber(e);return!isNaN(n)&&n>0}return!1}},{key:"getPrefixNumber",value:function(e){var t=e.indexOf(". "),n=e.slice(0,t);return Number(n)}},{key:"removeMultiLineMarkdown",value:function(e,t,n,i){var o=this,a=this.findPrecedingNewLine(e,t),r=this.findSuceedingNewLine(e,n),s=e.slice(0,a),l=e.slice(a,r),c=e.slice(r),u=a,d=r,h=s,p=l.split("\n");return p.forEach((function(e,t){var n=o.removeListPrefix(e,i);d-=e.length-n.length,h+=n,t<p.length-1&&(h+="\n")})),{newText:h+=c,newStart:u,newEnd:d}}},{key:"removeListPrefix",value:function(e,t){switch(t){case"quote":case"bulletedList":return e.slice(2);case"numberedList":var n=e.indexOf(". ");return e.slice(n+2)}return""}},{key:"addMultiLineMarkdown",value:function(e,t,n,i){var o=this,a=this.findPrecedingNewLine(e,t),r=this.findSuceedingNewLine(e,n),s=e.slice(0,a),l=e.slice(a,r),c=e.slice(r),u=a,d=r,h=s;if(""===l){var p=this.getListPrefix(i,1);h=s+p+c,u=a+p.length,d=u}else{var g=l.split("\n");g.forEach((function(t,n){var a=o.getListPrefix(i,n+1,t);d+=a.length-t.length,h+=a,n===g.length-1&&"\n"===e[r]&&"\n"===e[r+1]||(h+="\n")})),h+=c}return{newText:h,newStart:u,newEnd:d}}},{key:"getListPrefix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";switch(e){case"quote":return"> "+n;case"bulletedList":return"* "+n;case"numberedList":return t+". "+n}return null}},{key:"findPrecedingNewLine",value:function(e,t){for(var n=t;n>0&&"\n"!==e[n-1];)n--;return n}},{key:"findSuceedingNewLine",value:function(e,t){for(var n=t;n<e.length&&"\n"!==e[n];)n++;return n}},{key:"processReturnCommand",value:function(e,t,n,i,o){var a=this.findPrecedingNewLine(e,t),r=this.findSuceedingNewLine(e,n),s=e.slice(0,a),l=e.slice(a,r),c=e.slice(r);if(!this.isCursorAtBeginningOfLine(a,i,o)){if(this.isMultiLineItem(l,"quote"))return this.insertMultiLineItem(">",s,l,c,r);if(this.isMultiLineItem(l,"bulletedList"))return this.insertMultiLineItem("*",s,l,c,r);if(this.isMultiLineItem(l,"numberedList")){var u=this.getPrefixNumber(l)+1,d=this.renumberEndText(c,u);return this.insertMultiLineItem(u+".",s,l,d,r)}}return null}},{key:"isCursorAtBeginningOfLine",value:function(e,t,n){return t===n&&t===e}},{key:"insertMultiLineItem",value:function(e,t,n,i,o){var a=t+n+"\n"+e+" "+i,r=o+2+e.length;return{newText:a,newStart:r,newEnd:r}}},{key:"renumberEndText",value:function(e,t){var n=this,i=e.split("\n"),o="",a=!1;return i.forEach((function(e,i){n.isMultiLineItem(e,"numberedList")&&!1===a?o+=n.renumberLine(e,t+i):(o+=e,i>0&&(a=!0)),o+="\n"})),o}},{key:"renumberLine",value:function(e,t){var n=e.indexOf(". ");return t+". "+e.slice(n+2)}}]),t}(),dr=Object.assign({},vn),hr=function(){function t(n,i,o,a,r,s,l,c,u,d){e._classCallCheck(this,t),this.config=n,this.dispUtils=i,this.nodeUtils=o,this.decUtils=a,this.canvasController=r,this.canvasDiv=s,this.activePipeline=l,this.displayCommentsCallback=c,this.displayLinksCallback=u,this.getCommentToolbarPosCallback=d,this.logger=new h.Logger("SvgCanvasTextArea"),this.editingText=!1,this.editingTextId="",this.addingTextToTextArea=!1,this.textAreaHeight=null}return e._createClass(t,[{key:"isEditingText",value:function(){return this.editingText}},{key:"getEditingTextId",value:function(){return this.editingTextId}},{key:"displayCommentTextArea",value:function(e,t){if(this.editingTextData={id:e.id,text:e.content,singleLine:!1,maxCharacters:null,allowReturnKey:!0,textCanBeEmpty:!0,xPos:0,yPos:0,width:e.width,height:e.height,className:"d3-comment-entry",parentDomObj:t,keyboardInputCallback:this.config.enableMarkdownInComments?this.commentKeyboardHandler.bind(this):null,autoSizeCallback:this.autoSizeComment.bind(this),saveTextChangesCallback:this.saveCommentChanges.bind(this),closeTextAreaCallback:this.closeCommentTextArea.bind(this)},this.displayTextArea(this.editingTextData),this.config.enableMarkdownInComments&&this.dispUtils.isDisplayingFullPage()){var n=this.getCommentToolbarPosCallback(e);this.canvasController.openTextToolbar(n.x,n.y,this.markdownActionHandler.bind(this),this.blurInTextToolbar.bind(this))}}},{key:"commentKeyboardHandler",value:function(e){var t=this.getMarkdownAction(e);t&&("return"!==t&&f.CanvasUtils.stopPropagationAndPreventDefault(e),this.markdownActionHandler(t,e))}},{key:"blurInTextToolbar",value:function(e){if(!(this.addingTextToTextArea||e.relatedTarget&&(f.CanvasUtils.getParentElementWithClass(e.relatedTarget,"d3-comment-entry")||f.CanvasUtils.getParentElementWithClass(e.relatedTarget,"text-toolbar")||f.CanvasUtils.getParentElementWithClass(e.relatedTarget,"bx--overflow-menu-options__btn")))){var t=dr.select(this.editingTextData.parentDomObj).selectAll(".d3-foreign-object-text-entry"),n=this.canvasDiv.selectAll(".d3-comment-entry").node();this.saveAndCloseTextArea(t,this.editingTextData,n.value,e)}}},{key:"getMarkdownAction",value:function(e){if(f.CanvasUtils.isCmndCtrlPressed(e))switch(e.keyCode){case 66:return"bold";case 73:return"italics";case 88:return e.shiftKey?"strikethrough":null;case 55:return e.shiftKey?"numberedList":null;case 56:return e.shiftKey?"bulletedList":null;case 69:return"code";case 75:return"link";case 188:return"decreaseHashes";case 190:return e.shiftKey?"quote":"increaseHashes"}else if(13===e.keyCode)return"return";return null}},{key:"markdownActionHandler",value:function(e,t){this.logger.log("markdownActionHandler - action = "+e);var n=this.canvasDiv.selectAll(".d3-comment-entry").node(),i=n.selectionStart,o=n.selectionEnd,a=n.value,r=ur.processMarkdownAction(e,a,i,o);r&&(f.CanvasUtils.stopPropagationAndPreventDefault(t),this.addTextToTextArea(r,n))}},{key:"addTextToTextArea",value:function(e,t){this.addingTextToTextArea=!0;var n=cr(e.newText);t.focus(),t.select(),document.execCommand("insertText",!1,n),t.setSelectionRange(e.newStart,e.newEnd),this.addingTextToTextArea=!1}},{key:"autoSizeComment",value:function(e,t,n){this.logger.log("autoSizeComment - textAreaHt = "+this.textAreaHeight+" scroll ht = "+e.scrollHeight);var i=e.scrollHeight+12;this.textAreaHeight<i&&(this.textAreaHeight=i,t.style("height",this.textAreaHeight+"px"),this.activePipeline.getComment(n.id).height=this.textAreaHeight,this.displayCommentsCallback(),this.displayLinksCallback())}},{key:"saveCommentChanges",value:function(e,t,n){var i=this.activePipeline.getComment(e),o={editType:"editComment",editSource:"canvas",id:i.id,content:t,width:i.width,height:n,x_pos:i.x_pos,y_pos:i.y_pos,pipelineId:this.activePipeline.id};this.canvasController.editActionHandler(o)}},{key:"closeCommentTextArea",value:function(){this.canvasController.closeTextToolbar()}},{key:"displayNodeLabelTextArea",value:function(e,t){dr.select(t).selectAll("div").attr("style","display:none;"),this.editingTextData={id:e.id,text:e.label,singleLine:e.layout.labelSingleLine,maxCharacters:e.layout.labelMaxCharacters,allowReturnKey:e.layout.labelAllowReturnKey,textCanBeEmpty:!1,xPos:this.nodeUtils.getNodeLabelTextAreaPosX(e),yPos:this.nodeUtils.getNodeLabelTextAreaPosY(e),width:this.nodeUtils.getNodeLabelTextAreaWidth(e),height:this.nodeUtils.getNodeLabelTextAreaHeight(e),className:this.nodeUtils.getNodeLabelTextAreaClass(e),parentDomObj:t,autoSizeCallback:this.autoSizeMultiLineLabel.bind(this),saveTextChangesCallback:this.saveNodeLabelChanges.bind(this),closeTextAreaCallback:this.closeNodeLabelTextArea.bind(this)},this.displayTextArea(this.editingTextData)}},{key:"autoSizeMultiLineLabel",value:function(e,t,n){this.logger.log("autoSizeNodeLabel - textAreaHt = "+this.textAreaHeight+" scroll ht = "+e.scrollHeight),n.maxCharacters&&e.value.length>n.maxCharacters&&(e.value=e.value.substring(0,n.maxCharacters)),t.style("height",0);var i=e.scrollHeight+12;this.textAreaHeight=i,t.style("height",this.textAreaHeight+"px")}},{key:"saveNodeLabelChanges",value:function(e,t,n,i){var o={editType:"setNodeLabel",editSource:"canvas",nodeId:e,label:t,pipelineId:this.activePipeline.id};this.canvasController.editActionHandler(o)}},{key:"closeNodeLabelTextArea",value:function(e){dr.select(this.editingTextData.parentDomObj).selectAll("div").attr("style",null)}},{key:"displayDecLabelTextArea",value:function(e,t,n,i){this.displayTextArea({id:e.id,text:e.label,singleLine:e.label_single_line||!1,maxCharacters:e.label_max_characters||null,allowReturnKey:e.label_allow_return_key||!1,textCanBeEmpty:!1,xPos:this.decUtils.getDecLabelTextAreaPosX(),yPos:this.decUtils.getDecLabelTextAreaPosY(),width:this.decUtils.getDecLabelTextAreaWidth(e,t,n),height:this.decUtils.getDecLabelTextAreaHeight(e,t,n),className:this.decUtils.getDecLabelTextAreaClass(e),parentDomObj:i,objId:t.id,objType:n,autoSizeCallback:this.autoSizeMultiLineLabel.bind(this),saveTextChangesCallback:this.saveDecLabelChanges.bind(this),closeTextAreaCallback:null})}},{key:"saveDecLabelChanges",value:function(e,t,n,i){var o={editType:"editDecorationLabel",editSource:"canvas",decId:e,objId:i.objId,objType:i.objType,label:t,pipelineId:this.activePipeline.id};this.canvasController.editActionHandler(o)}},{key:"displayTextArea",value:function(e){var t=this;this.textAreaHeight=e.height,this.editingText=!0,this.editingTextId=e.id;var n=dr.select(e.parentDomObj).append("foreignObject").attr("class","d3-foreign-object-text-entry").attr("width",e.width).attr("height",e.height).attr("x",e.xPos).attr("y",e.yPos),i=n.append("xhtml:textarea").attr("class",e.className).text(cr(e.text)).on("keydown",(function(i){!e.singleLine&&e.allowReturnKey||13!==i.keyCode||f.CanvasUtils.stopPropagationAndPreventDefault(i),27===i.keyCode&&(f.CanvasUtils.stopPropagationAndPreventDefault(i),t.textAreaEscKeyPressed=!0,t.closeTextArea(n,e)),e.maxCharacters&&i.target.value.length>=e.maxCharacters&&!t.textAreaAllowedKeys(i)&&f.CanvasUtils.stopPropagationAndPreventDefault(i),e.keyboardInputCallback&&e.keyboardInputCallback(i)})).on("keyup",(function(t){e.autoSizeCallback(t.target,n,e)})).on("paste",(function(i){t.logger.log("Text area - Paste - Scroll Ht = "+i.target.scrollHeight),setTimeout(e.autoSizeCallback,500,i.target,n,e)})).on("blur",(function(i,o){t.logger.log("Text area - blur"),t.textAreaEscKeyPressed?t.textAreaEscKeyPressed=!1:i.relatedTarget&&f.CanvasUtils.getParentElementWithClass(i.relatedTarget,"text-toolbar")||t.saveAndCloseTextArea(n,e,i.target.value,i)})).on("focus",(function(i,o){t.logger.log("Text area - focus"),e.autoSizeCallback(i.target,n,e)})).on("mousedown click dblclick contextmenu",(function(e,t){e.stopPropagation()}));i.node().focus(),i.node().setSelectionRange(e.text.length,e.text.length)}},{key:"saveAndCloseTextArea",value:function(e,t,n,i){if(!n&&!t.textCanBeEmpty)return f.CanvasUtils.stopPropagationAndPreventDefault(i),void this.closeTextArea(e,t);var o=n;this.closeTextArea(e,t),t.text===o&&this.textAreaHeight===t.height||(this.isCommentBeingUpdated=!0,t.saveTextChangesCallback(t.id,o,this.textAreaHeight,t),this.isCommentBeingUpdatd=!1)}},{key:"closeTextArea",value:function(e,t){t.closeTextAreaCallback&&t.closeTextAreaCallback(t.id),e.remove(),this.editingText=!1,this.editingTextId=""}},{key:"textAreaAllowedKeys",value:function(e){return 46===e.keyCode||8===e.keyCode||37===e.keyCode||39===e.keyCode||38===e.keyCode||40===e.keyCode||65===e.keyCode&&f.CanvasUtils.isCmndCtrlPressed(e)}}]),t}(),pr=function(){function t(n,i){e._classCallCheck(this,t),this.logger=new h.Logger("SVGCanvasActivePipeline"),this.logger.log("constructor - start"),this.initialize(n,i),this.logger.log("constructor - end")}return e._createClass(t,[{key:"initialize",value:function(e,t){this.logger.logStartTimer("initialize"),this.canvasInfo=t,this.pipeline=this.getPipeline(e,t),this.id=this.pipeline.id,this.zoom=this.pipeline.zoom,this.nodes=this.pipeline.nodes,this.comments=this.pipeline.comments,this.links=this.pipeline.links,this.mappedNodes=this.getMappedArray(this.pipeline.nodes),this.mappedComments=this.getMappedArray(this.pipeline.comments),this.mappedLinks=this.getMappedArray(this.pipeline.links),this.pipeline=this.preProcessPipeline(this.pipeline),this.logger.logEndTimer("initialize")}},{key:"getCanvasDimensions",value:function(e){return f.CanvasUtils.getCanvasDimensions(this.pipeline.nodes,this.pipeline.comments,this.pipeline.links,e)}},{key:"getObjectTypeName",value:function(e){return this.getComment(e.id)?"comment":this.getNode(e.id)?"node":"link"}},{key:"getNode",value:function(e){var t=this.mappedNodes[e];return void 0===t?null:t}},{key:"getNodes",value:function(e){var t=this,n=[];return e.forEach((function(e){var i=t.getNode(e);i&&n.push(i)})),n}},{key:"getSupernodes",value:function(){return this.pipeline.nodes.filter((function(e){return f.CanvasUtils.isSupernode(e)}))}},{key:"isEmptyOrBindingsOnly",value:function(){return(a.isEmpty_1(this.pipeline.nodes)||this.containsOnlyBindingNodes())&&a.isEmpty_1(this.pipeline.comments)}},{key:"containsOnlyBindingNodes",value:function(){return!this.pipeline.nodes.find((function(e){return!f.CanvasUtils.isSuperBindingNode(e)}))}},{key:"getComment",value:function(e){var t=this.mappedComments[e];return void 0===t?null:t}},{key:"getNodesAndComments",value:function(){return this.pipeline.nodes.concat(this.pipeline.comments)}},{key:"getNodeOrComment",value:function(e){var t=this.getNode(e);return null===t&&(t=this.getComment(e)),t}},{key:"getLink",value:function(e){var t=this.mappedLinks[e];return void 0===t?null:t}},{key:"replaceLink",value:function(e){var t=this.pipeline.links.findIndex((function(t){return t.id===e.id}));this.pipeline.links.splice(t,1,e),this.mappedLinks=this.getMappedArray(this.pipeline.links)}},{key:"getPipeline",value:function(e,t){var n=t.pipelines.find((function(t){return t.id===e}));return n||{id:e,nodes:[],comments:[],links:[]}}},{key:"preProcessPipeline",value:function(e){var t=this;return this.setAllPortsDisconnected(e),e.links.forEach((function(e){e.type===l.COMMENT_LINK?(e.srcObj=t.getComment(e.srcNodeId),e.trgNode=t.getNode(e.trgNodeId)):(e.srcObj=t.getNode(e.srcNodeId),e.trgNode=t.getNode(e.trgNodeId),e.srcObj&&t.setOutputPortConnected(e.srcObj,e.srcNodePortId),e.trgNode&&t.setInputPortConnected(e.trgNode,e.trgNodePortId))})),e}},{key:"setAllPortsDisconnected",value:function(e){e.nodes.forEach((function(e){e.inputs&&e.inputs.forEach((function(e){return e.isConnected=!1})),e.outputs&&e.outputs.forEach((function(e){return e.isConnected=!1}))}))}},{key:"setInputPortConnected",value:function(e,t){var n=t||f.CanvasUtils.getDefaultInputPortId(e);e.inputs&&e.inputs.forEach((function(e){e.id===n&&(e.isConnected=!0)}))}},{key:"setOutputPortConnected",value:function(e,t){var n=t||f.CanvasUtils.getDefaultOutputPortId(e);e.outputs&&e.outputs.forEach((function(e){e.id===n&&(e.isConnected=!0)}))}},{key:"getMappedArray",value:function(e){return e.reduce((function(e,t){return e[t.id]=t,e}),{})}}]),t}(),gr=Object.assign({},Yn,hi,vn,Ai,Za),fr=require("markdown-it")({html:!1,linkify:!1,typographer:!0}),vr=function(){function t(n,i,o,a,r){var s=this,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};e._classCallCheck(this,t),this.logger=new h.Logger(["SVGCanvasRenderer","PipeId",n]),this.logger.logStartTimer("constructor"+n.substring(0,5)),this.pipelineId=n,this.supernodeInfo=c,this.canvasDiv=i,this.canvasInfo=a,this.config=r,this.canvasController=o,this.objectModel=this.canvasController.getObjectModel(),this.activePipeline=new pr(n,a),this.superRenderers=[],this.instanceId=this.canvasController.getInstanceId(),this.canvasLayout=this.objectModel.getCanvasLayout(),this.dispUtils=new qa(this.canvasController,this.supernodeInfo.d3Selection,this.pipelineId),this.nodeUtils=new Qa(this.canvasLayout),this.commentUtils=new er,this.linkUtils=new nr(this.config,this.canvasLayout,this.nodeUtils,this.commentUtils),this.decUtils=new ir(this.canvasLayout),this.svgCanvasTextArea=new hr(this.config,this.dispUtils,this.nodeUtils,this.decUtils,this.canvasController,this.canvasDiv,this.activePipeline,this.displayComments.bind(this),this.displayLinks.bind(this),this.getCommentToolbarPos.bind(this)),this.dispUtils.setDisplayState(),this.logger.log(this.dispUtils.getDisplayStateMsg()),this.initializeZoomVariables(),this.minScaleExtent=.2,this.maxScaleExtent=1.8,this.commentSizing=!1,this.commentSizingDirection="",this.nodeSizing=!1,this.nodeSizingDirection="",this.nodeSizingObjectsInfo={},this.nodeSizingDetLinksInfo={},this.resizeObjInitialInfo=null,this.notSnappedXPos=0,this.notSnappedYPos=0,this.notSnappedWidth=0,this.notSnappedHeight=0,this.dragging=!1,this.dragOffsetX=0,this.dragOffsetY=0,this.dragRunningX=0,this.dragRunningY=0,this.dragObjects=[],this.dragStartX=0,this.dragStartY=0,this.dragOverLink=null,this.dragOverDetachedLinks=[],this.dragPointerOffsetInNode=null,this.dragNewLinkOverNode=null,this.existingNodeInsertableIntoLink=!1,this.existingNodeAttachableToDetachedLinks=!1,this.selecting=!1,this.movingBindingNodes=!1,this.contextMenuClosedOnZoom=!1,this.regionSelect=!1,this.region={startX:0,startY:0,width:0,height:0},this.regionStartTransformX=0,this.regionStartTransformY=0,this.drawingNewLinkData=null,this.drag=gr.drag().on("start",this.dragStart.bind(this)).on("drag",this.dragMove.bind(this)).on("end",this.dragEnd.bind(this)),this.draggingLinkData=null,this.dragSelectionHandle=gr.drag().on("start",this.dragStartLinkHandle.bind(this)).on("drag",this.dragMoveLinkHandle.bind(this)).on("end",this.dragEndLinkHandle.bind(this)),this.zoom=gr.zoom().trackpad(this.config.enableInteractionType===l.INTERACTION_TRACKPAD).preventBackGesture(!0).wheelDelta((function(e){return-e.deltaY*(s.config.enableInteractionType===l.INTERACTION_TRACKPAD?.02:.002)})).scaleExtent([this.minScaleExtent,this.maxScaleExtent]).on("start",this.zoomStart.bind(this)).on("zoom",this.zoomAction.bind(this)).on("end",this.zoomEnd.bind(this)),this.initializeGhostDiv(),this.canvasSVG=this.createCanvasSVG(),this.canvasGrp=this.createCanvasGroup(this.canvasSVG,"d3-canvas-group"),this.canvasUnderlay=this.createCanvasUnderlay(this.canvasGrp,"d3-canvas-underlay"),this.commentsGrp=this.createCanvasGroup(this.canvasGrp,"d3-comments-group"),this.nodesLinksGrp=this.createCanvasGroup(this.canvasGrp,"d3-nodes-links-group"),this.boundingRectsGrp=this.createBoundingRectanglesGrp(this.canvasGrp,"d3-bounding-rect-group"),this.resetCanvasSVGBehaviors(),this.displayCanvas(),this.dispUtils.isDisplayingFullPage()&&this.restoreZoom(),(this.dispUtils.isDisplayingSubFlowFullPage()||this.canvasLayout.alwaysDisplayBackToParentFlow)&&this.addBackToParentFlowArrow(this.canvasSVG),this.dispUtils.isDisplayingSubFlowFullPage()&&!this.canvasController.getSavedZoom(this.pipelineId)&&this.zoomToFit(),this.dispUtils.isDisplayingSubFlowInPlace()&&(this.supernodeInfo.d3Selection.selectAll(".d3-node-port-input").raise(),this.supernodeInfo.d3Selection.selectAll(".d3-node-port-output").raise()),this.logger.logEndTimer("constructor"+n.substring(0,5))}return e._createClass(t,[{key:"getParentSupernodeDatum",value:function(){var e=this,t=null;return this.canvasInfo.pipelines.forEach((function(n){n.id===e.supernodeInfo.pipelineId&&(t||(t=n.nodes.find((function(t){return f.CanvasUtils.isSupernode(t)&&t.id===e.supernodeInfo.id}))))})),t}},{key:"getZoomTransform",value:function(){return this.zoomTransform}},{key:"initializeZoomVariables",value:function(){this.zoomTransform=gr.zoomIdentity.translate(0,0).scale(1),this.zoomStartPoint={x:0,y:0,k:0}}},{key:"setCanvasInfoRenderer",value:function(e){this.logger.logStartTimer("setCanvasInfoRenderer"+this.pipelineId.substring(0,5)),this.canvasInfo=e,this.activePipeline.initialize(this.pipelineId,e),this.canvasLayout=this.objectModel.getCanvasLayout(),this.dispUtils.setDisplayState(),this.logger.log(this.dispUtils.getDisplayStateMsg()),this.resetCanvasSVGBehaviors(),this.resetCanvasCursor(),this.superRenderers=this.cleanUpSuperRenderers(),this.displayCanvas(),this.logger.logEndTimer("setCanvasInfoRenderer"+this.pipelineId.substring(0,5))}},{key:"cleanUpSuperRenderers",value:function(){var e=this,t=[];return this.activePipeline.getSupernodes().forEach((function(n){var i=e.getRendererForSupernode(n);i&&t.push(i),e.getDiscardedRenderersForSupernode(n).forEach((function(e){return e.canvasSVG.remove()}))})),t}},{key:"clearCanvas",value:function(){this.initializeZoomVariables(),this.canvasSVG.remove()}},{key:"refreshOnSizeChange",value:function(){if(this.logger.log("refreshOnSizeChange"),this.dispUtils.isDisplayingSubFlowFullPage()&&this.displayBindingNodesToFitSVG(),this.config.enableBoundingRectangles&&this.displayBoundingRectangles(),this.config.enablePositionNodeOnRightFlyoutOpen&&this.canvasController.isRightFlyoutOpen()){var e=this.config.enablePositionNodeOnRightFlyoutOpen,t=e.x?e.x:50,n=e.y?e.y:50,i=this.canvasController.getSelectedNodes().map((function(e){return e.id})),o=this.getZoomToReveal(i,t,n);this.zoomTo(o)}}},{key:"hideCanvas",value:function(){this.canvasSVG.style("display","none")}},{key:"displayCanvas",value:function(){this.logger.logStartTimer("displayCanvas"),this.canvasSVG.style("display","inherit"),this.displayComments(),this.displayNodes(),this.displayLinks(),this.dispUtils.isDisplayingSubFlowInPlace()&&this.displaySVGToFitSupernode(),this.dispUtils.isDisplayingSubFlowFullPage()&&this.displayPortsForSubFlowFullPage(),this.config.enableBoundingRectangles&&this.displayBoundingRectangles(),"None"!==this.config.enableCanvasUnderlay&&this.dispUtils.isDisplayingPrimaryFlowFullPage()&&this.setCanvasUnderlaySize(),this.logger.logEndTimer("displayCanvas")}},{key:"displayPortsForSubFlowFullPage",value:function(){this.setPortPositionsForNode(this.getParentSupernodeDatum()),this.displayBindingNodesToFitSVG()}},{key:"displaySVGToFitSupernode",value:function(){this.logger.log("displaySVGToFitSupernode - start");var e=this.getParentSupernodeSVGDimensions();this.canvasSVG.attr("width",e.width),this.canvasSVG.attr("height",e.height),this.canvasSVG.attr("x",e.x),this.canvasSVG.attr("y",e.y);var t=this.canvasSVG.selectChildren(".d3-svg-background");t.attr("width",e.width),t.attr("height",e.height),this.zoomToFit(),this.displayBindingNodesToFitSVG(),this.logger.log("displaySVGToFitSupernode - end")}},{key:"displayBindingNodesToFitSVG",value:function(){this.logger.log("displayBindingNodesToFitSVG - start"),this.setPortPositionsAllNodes(),this.moveSuperBindingNodes(),this.movingBindingNodes=!0,this.displayNodes(),this.displayLinks(),this.movingBindingNodes=!1,this.logger.log("displayBindingNodesToFitSVG - end")}},{key:"getParentSupernodeSVGDimensions",value:function(){var e=this.getParentSupernodeDatum();return{width:e.width-2*this.canvasLayout.supernodeSVGAreaPadding,height:e.height-this.canvasLayout.supernodeTopAreaHeight-this.canvasLayout.supernodeSVGAreaPadding,x:this.canvasLayout.supernodeSVGAreaPadding,y:this.canvasLayout.supernodeTopAreaHeight,x_pos:e.x_pos+this.canvasLayout.supernodeSVGAreaPadding,y_pos:e.y_pos+this.canvasLayout.supernodeTopAreaHeight}}},{key:"moveSuperBindingNodes",value:function(){var e=this,t=this.getTransformedViewportDimensions(),n=this.getParentSupernodeDatum();if(this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM||this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP){var i=n.width-2*this.canvasLayout.supernodeSVGAreaPadding;this.activePipeline.nodes.forEach((function(o){if(o.isSupernodeInputBinding){var a=e.nodeUtils.getSupernodePortXOffset(o.id,n.inputs);o.x_pos=t.width*(a/i)+t.x-o.outputs[0].cx,o.y_pos=e.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?t.y-o.height:t.y+t.height}if(o.isSupernodeOutputBinding){var r=e.nodeUtils.getSupernodePortXOffset(o.id,n.outputs);o.x_pos=t.width*(r/i)+t.x-o.inputs[0].cx,o.y_pos=e.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?o.y_pos=t.y+t.height:o.y_pos=t.y-o.height}}))}else{var o,a;f.CanvasUtils.isExpanded(n)?(o=this.canvasLayout.supernodeTopAreaHeight,a=n.height-(this.canvasLayout.supernodeTopAreaHeight+this.canvasLayout.supernodeSVGAreaPadding)):(o=0,a=n.height),this.activePipeline.nodes.forEach((function(i){if(i.isSupernodeInputBinding){i.x_pos=t.x-i.width;var r=e.nodeUtils.getSupernodePortYOffset(i.id,n.inputs)-o;i.y_pos=t.height*(r/a)+t.y-i.outputs[0].cy}if(i.isSupernodeOutputBinding){i.x_pos=t.x+t.width;var s=e.nodeUtils.getSupernodePortYOffset(i.id,n.outputs)-o;i.y_pos=t.height*(s/a)+t.y-i.inputs[0].cy}}))}}},{key:"displayBoundingRectangles",value:function(){if(this.activePipeline){var e=this.getViewportDimensions(),t=this.getTransformedRect(e,1),n=this.getCanvasDimensionsAdjustedForScale(1),i=this.getCanvasDimensionsAdjustedForScale(1,this.getZoomToFitPadding());this.boundingRectsGrp.selectChildren(".d3-bounding").remove();var o=this.boundingRectsGrp.append("g").attr("class","d3-bounding");o.append("rect").attr("height",e.height).attr("width",e.width).attr("x",0).attr("y",0).style("fill","none").style("stroke","darkorange"),o.append("rect").attr("height",t.height).attr("width",t.width-2).attr("x",t.x).attr("y",t.y).style("fill","none").style("stroke","red"),n&&o.append("rect").attr("height",n.height).attr("width",n.width).attr("x",n.left).attr("y",n.top).style("fill","none").style("stroke","blue"),i&&o.append("rect").attr("height",i.height).attr("width",i.width).attr("x",i.left).attr("y",i.top).style("fill","none").style("stroke","green"),this.config.enableBoundingRectangles&&this.superRenderers.length>0&&this.superRenderers.forEach((function(e){return e.displayBoundingRectangles()}))}}},{key:"isEditingText",value:function(){if(this.svgCanvasTextArea.isEditingText())return!0;var e=!1;return this.superRenderers.forEach((function(t){e||(e=t.isEditingText())})),e}},{key:"isDragging",value:function(){return this.dragging}},{key:"isNodeResizable",value:function(e){return!(!this.config.enableEditingActions||f.CanvasUtils.isSuperBindingNode(e)||f.CanvasUtils.isCollapsedSupernode(e)||!this.config.enableResizableNodes&&!f.CanvasUtils.isExpandedSupernode(e))}},{key:"shouldDisplayNodeSizingArea",value:function(e){return!f.CanvasUtils.isSuperBindingNode(e)&&(f.CanvasUtils.isSupernode(e)||this.config.enableResizableNodes)}},{key:"getAllNodeGroupsSelection",value:function(){return this.nodesLinksGrp.selectChildren(".d3-node-group")}},{key:"getAllLinkGroupsSelection",value:function(){return this.nodesLinksGrp.selectChildren(".d3-link-group")}},{key:"getAllCommentGroupsSelection",value:function(){return this.commentsGrp.selectChildren(".d3-comment-group")}},{key:"getNodeGroupSelectionById",value:function(e){var t=this.getSelectorForId("node_grp",e);return this.nodesLinksGrp.selectChildren(t)}},{key:"getLinkGroupSelectionById",value:function(e){var t=this.getSelectorForId("link_grp",e);return this.nodesLinksGrp.selectChildren(t)}},{key:"getSelectorForId",value:function(e,t,n){return"[data-id='".concat(this.getId(e,t,n),"']")}},{key:"getId",value:function(e,t,n){var i="".concat(e,"_").concat(this.instanceId);return t&&(i+="_".concat(t)),n&&(i+="_".concat(n)),i}},{key:"getMousePosSnapToGrid",value:function(e){var t=e;return this.config.enableSnapToGridType!==l.SNAP_TO_GRID_DURING&&this.config.enableSnapToGridType!==l.SNAP_TO_GRID_AFTER||(t=this.snapToGridPosition(t)),t}},{key:"snapToGridObject",value:function(e){var t=e;return t.x_pos=f.CanvasUtils.snapToGrid(t.x_pos,this.canvasLayout.snapToGridXPx),t.y_pos=f.CanvasUtils.snapToGrid(t.y_pos,this.canvasLayout.snapToGridYPx),t.width=f.CanvasUtils.snapToGrid(t.width,this.canvasLayout.snapToGridXPx),t.height=f.CanvasUtils.snapToGrid(t.height,this.canvasLayout.snapToGridYPx),t}},{key:"getTransformedMousePos",value:function(e){return this.transformPos(this.getMousePos(e,this.canvasSVG))}},{key:"getMousePos",value:function(e,t){var n=gr.pointer(e,t.node());return{x:n[0],y:n[1]}}},{key:"convertPageCoordsToCanvasCoords",value:function(e,t){var n=this.canvasSVG.node().getBoundingClientRect();return this.transformPos({x:e-Math.round(n.left),y:t-Math.round(n.top)})}},{key:"transformPos",value:function(e){return{x:(e.x-this.zoomTransform.x)/this.zoomTransform.k,y:(e.y-this.zoomTransform.y)/this.zoomTransform.k}}},{key:"unTransformPos",value:function(e){return{x:e.x*this.zoomTransform.k+this.zoomTransform.x,y:e.y*this.zoomTransform.k+this.zoomTransform.y}}},{key:"getTransformedRect",value:function(e,t){var n=t/this.zoomTransform.k;return{x:-this.zoomTransform.x/this.zoomTransform.k+n,y:-this.zoomTransform.y/this.zoomTransform.k+n,height:e.height/this.zoomTransform.k-2*n,width:e.width/this.zoomTransform.k-2*n}}},{key:"initializeGhostDiv",value:function(){this.dispUtils.isDisplayingFullPage()&&this.getGhostDivSel().empty()&&this.canvasDiv.append("div").attr("class","d3-ghost-div")}},{key:"getGhostDivSel",value:function(){return this.canvasDiv.selectAll(".d3-ghost-div")}},{key:"getGhostNode",value:function(e){var t=this,n=this.getGhostDimensions(),i=this.canvasController.convertNodeTemplate(e);i.layout=this.canvasController.getObjectModel().getNodeLayout(),i.is_expanded?(i.width=i.expanded_width,i.height=i.expanded_height):i.isResized?(i.width=i.resizeWidth,i.height=i.resizeHeight):(i.width=n.width,i.height=n.height);var o=this.getNodeImage(i),a=this.getImageType(o),r=this.getGhostDivSel(),s=this.objectModel.getNodeLayout(),l=Math.max(s.labelWidth,i.width);r.selectAll(".d3-ghost-svg").remove();var c=r.append("svg").attr("width",l*this.zoomTransform.k).attr("height",(50+i.height)*this.zoomTransform.k).attr("x",0).attr("y",0).attr("class","d3-ghost-svg").append("g").attr("class","d3-node-group");c.append("rect").attr("class","d3-ghost-node").attr("x",0).attr("y",0).attr("width",i.width).attr("height",i.height),c.append(a).attr("class","d3-node-image").each((function(){t.setNodeImageContent(this,i)})).attr("x",this.nodeUtils.getNodeImagePosX(i)).attr("y",this.nodeUtils.getNodeImagePosY(i)).attr("width",this.nodeUtils.getNodeImageWidth(i)).attr("height",this.nodeUtils.getNodeImageHeight(i));var u=c.append("foreignObject").attr("x",this.nodeUtils.getNodeLabelPosX(i)).attr("y",this.nodeUtils.getNodeLabelPosY(i)).attr("width",this.nodeUtils.getNodeLabelWidth(i)).attr("height",this.nodeUtils.getNodeLabelHeight(i)).attr("class","d3-foreign-object-ghost-label"),d=u.append("xhtml:div").attr("class",this.nodeUtils.getNodeLabelClass(i)),h=d.append("xhtml:span").html(i.label).node().getBoundingClientRect().width+4,p=this.nodeUtils.getNodeLabelWidth(i),g=Math.min(p,h),f=Math.max(0,(g-n.width)/2)*this.zoomTransform.k;if(c.attr("transform","translate(".concat(f,", 0) scale(").concat(this.zoomTransform.k,")")),"center"===i.layout.labelAlign){var v=Math.max(0,(p-g)/2);u.attr("width",g).attr("x",this.nodeUtils.getNodeLabelPosX(i)+v),d.attr("width",g)}var y=this.getBrowserZoom(),m=(f+n.width/2*this.zoomTransform.k)*y,C=n.height/2*this.zoomTransform.k*y;return{element:r.node(),centerX:m,centerY:C}}},{key:"getBrowserZoom",value:function(){var e=window.devicePixelRatio;return navigator.userAgent.includes("Chrome")?e=window.devicePixelRatio:navigator.userAgent.includes("Safari")?e=(window.outerWidth-8)/window.innerWidth:navigator.userAgent.includes("Firefox")&&(e=window.devicePixelRatio/2),e}},{key:"getGhostDimensions",value:function(){var e=this.objectModel.getNodeLayout();return{width:e.defaultNodeWidth,height:e.defaultNodeHeight}}},{key:"nodeTemplateDragStart",value:function(e){this.isNodeTemplateInsertableIntoLink(e)&&this.setDataLinkSelectionAreaWider(!0)}},{key:"nodeTemplateDragEnd",value:function(e){this.isNodeTemplateInsertableIntoLink(e)&&this.setDataLinkSelectionAreaWider(!1)}},{key:"nodeTemplateDragOver",value:function(e,t,n){if(this.isNodeTemplateInsertableIntoLink(e)){var i=this.getLinkAtMousePos(t,n);i&&!this.isLinkFullyAttached(i)||this.setInsertNodeIntoLinkHighlighting(i)}if(this.isNodeTemplateAttachableToDetachedLinks(e)){var o=this.convertPageCoordsToCanvasCoords(t,n),a=this.getGhostDimensions(),r={x1:o.x-a.width/2,y1:o.y-a.height/2,x2:o.x+a.width/2,y2:o.y+a.height/2},s=this.canvasController.convertNodeTemplate(e),l=this.getAttachableLinksForNodeAtPos(s,r);this.setDetachedLinkHighlighting(l)}"None"!==this.config.enableCanvasUnderlay&&this.dispUtils.isDisplayingPrimaryFlowFullPage()&&this.setCanvasUnderlaySize(t,n)}},{key:"setInsertNodeIntoLinkHighlighting",value:function(e){e?this.dragOverLink?e.id!==this.dragOverLink.id&&(this.unsetInsertNodeIntoLinkHighlighting(),this.dragOverLink=e,this.setNodeDragOverLinkHighlighting(this.dragOverLink,!0)):(this.dragOverLink=e,this.setNodeDragOverLinkHighlighting(this.dragOverLink,!0)):this.unsetInsertNodeIntoLinkHighlighting()}},{key:"unsetInsertNodeIntoLinkHighlighting",value:function(e){this.dragOverLink&&(this.setNodeDragOverLinkHighlighting(this.dragOverLink,!1),this.dragOverLink=null)}},{key:"setDetachedLinkHighlighting",value:function(e){var t=this;e&&e.length>0?(this.unsetDetachedLinkHighlighting(),this.dragOverDetachedLinks=e,this.dragOverDetachedLinks.forEach((function(e){return t.setNodeDragOverLinkHighlighting(e,!0)}))):this.dragOverDetachedLinks.length>0&&this.unsetDetachedLinkHighlighting()}},{key:"unsetDetachedLinkHighlighting",value:function(){var e=this;this.dragOverDetachedLinks.forEach((function(t){return e.setNodeDragOverLinkHighlighting(t,!1)})),this.dragOverDetachedLinks=[]}},{key:"setNodeDragOverLinkHighlighting",value:function(e,t){this.getLinkGroupSelectionById(e.id).attr("data-drag-node-over",!!t||null)}},{key:"setNewLinkOverNode",value:function(e){var t=this.getNodeNearMousePos(e,this.canvasLayout.nodeProximity);t&&this.isConnectionAllowedToNearbyNode(e,t)?this.dragNewLinkOverNode?t.id!==this.dragNewLinkOverNode.id&&(this.setNewLinkOverNodeHighlighting(this.dragNewLinkOverNode,!1),this.dragNewLinkOverNode=t,this.setNewLinkOverNodeHighlighting(this.dragNewLinkOverNode,!0)):(this.dragNewLinkOverNode=t,this.setNewLinkOverNodeHighlighting(this.dragNewLinkOverNode,!0)):this.dragNewLinkOverNode&&(this.setNewLinkOverNodeHighlighting(this.dragNewLinkOverNode,!1),this.dragNewLinkOverNode=null)}},{key:"isConnectionAllowedToNearbyNode",value:function(e,t){if(this.drawingNewLinkData){if(this.drawingNewLinkData.action===l.NODE_LINK){var n=this.drawingNewLinkData.srcNode,i=t,o=this.drawingNewLinkData.srcNodePortId,a=f.CanvasUtils.getDefaultInputPortId(i);return f.CanvasUtils.isDataConnectionAllowed(o,a,n,i,this.activePipeline.links)}if(this.drawingNewLinkData.action===l.ASSOCIATION_LINK){var r=this.drawingNewLinkData.srcNode,s=t;return f.CanvasUtils.isAssocConnectionAllowed(r,s,this.activePipeline.links)}if(this.drawingNewLinkData.action===l.COMMENT_LINK){var c=this.drawingNewLinkData.srcObjId,u=t.id;return f.CanvasUtils.isCommentLinkConnectionAllowed(c,u,this.activePipeline.links)}}else if(this.draggingLinkData){if(this.getNewLinkOnDrag(e,this.canvasLayout.nodeProximity))return!0}return!1}},{key:"setNewLinkOverNodeHighlighting",value:function(e,t){e&&this.getNodeGroupSelectionById(e.id).attr("data-new-link-over",t?"yes":"no")}},{key:"setNewLinkOverNodeCancel",value:function(){this.setNewLinkOverNodeHighlighting(this.dragNewLinkOverNode,!1),this.dragNewLinkOverNode=null}},{key:"nodeTemplateDropped",value:function(e,t,n){if(null!==e){var i=this.transformMousePosForNode(t,n);this.dragOverLink?(this.canvasController.createNodeFromTemplateOnLinkAt(e,this.dragOverLink,i,this.pipelineId),this.unsetInsertNodeIntoLinkHighlighting()):this.dragOverDetachedLinks.length>0?(this.canvasController.createNodeFromTemplateAttachLinks(e,this.dragOverDetachedLinks,i,this.pipelineId),this.unsetDetachedLinkHighlighting()):this.canvasController.createNodeFromTemplateAt(e,i,this.pipelineId)}}},{key:"externalObjectDropped",value:function(e,t,n){if(null!==e){var i=this.transformMousePosForNode(t,n);this.canvasController.createDroppedExternalObject(e,i,this.pipelineId)}}},{key:"transformMousePosForNode",value:function(e,t){var n=this.convertPageCoordsToCanvasCoords(e,t),i=this.getGhostDimensions();return n.x-=i.width/2,n.y-=i.height/2,this.getMousePosSnapToGrid(n)}},{key:"isNodeTemplateInsertableIntoLink",value:function(e){return this.config.enableInsertNodeDroppedOnLink&&f.CanvasUtils.hasInputAndOutputPorts(e)&&!this.isPortMaxCardinalityZero(e.inputs[0])&&!this.isPortMaxCardinalityZero(e.outputs[0])}},{key:"isExistingNodeInsertableIntoLink",value:function(){return this.config.enableInsertNodeDroppedOnLink&&1===this.dragObjects.length&&f.CanvasUtils.isNode(this.dragObjects[0])&&f.CanvasUtils.hasInputAndOutputPorts(this.dragObjects[0])&&!f.CanvasUtils.isNodeDefaultPortsCardinalityAtMax(this.dragObjects[0],this.activePipeline.links)}},{key:"isExistingNodeAttachableToDetachedLinks",value:function(){return this.config.enableLinkSelection===l.LINK_SELECTION_DETACHABLE&&1===this.dragObjects.length&&f.CanvasUtils.isNode(this.dragObjects[0])}},{key:"isNodeTemplateAttachableToDetachedLinks",value:function(e){return this.config.enableLinkSelection===l.LINK_SELECTION_DETACHABLE}},{key:"getAttachableLinksForNodeAtPos",value:function(e,t){var n=this,i=e.inputs&&e.inputs.length>0,o=e.outputs&&e.outputs.length>0,a=this.activePipeline.links.filter((function(e){return e.srcPos&&o&&f.CanvasUtils.isPosInArea(e.srcPos,t,n.canvasLayout.ghostAreaPadding)?(e.nodeOverSrcPos=!0,!0):e.trgPos&&i&&f.CanvasUtils.isPosInArea(e.trgPos,t,n.canvasLayout.ghostAreaPadding)?(e.nodeOverTrgPos=!0,!0):(e.nodeOverSrcPos=!1,e.nodeOverTrgPos=!1,!1)}));a.length>0&&(a=f.CanvasUtils.getDetachedLinksToUpdate(e,a,this.activePipeline.links).oldLinks);return a}},{key:"isLinkFullyAttached",value:function(e){return!!e&&(void 0!==e.srcNodeId&&void 0!==e.trgNodeId)}},{key:"getNodePort",value:function(e,t,n){var i=this.activePipeline.getNode(e);if(i){var o=("input"===n?i.inputs:i.outputs).find((function(e){return e.id===t}));return void 0===o?null:o}return null}},{key:"setMaxZoomExtent",value:function(e){if(this.dispUtils.isDisplayingFullPage()){var t=this.maxScaleExtent*e;this.zoom.scaleExtent([this.minScaleExtent,t])}else{var n=1*Number(e)/this.zoomTransform.k;this.supernodeInfo.renderer.setMaxZoomExtent(n)}}},{key:"createCanvasSVG",value:function(){var e=this;this.logger.log("Create Canvas SVG.");var t=this.canvasDiv,n={width:"100%",height:"100%",x:0,y:0};this.dispUtils.isDisplayingSubFlowInPlace()&&(t=this.supernodeInfo.d3Selection,n=this.getParentSupernodeSVGDimensions());var i=t.append("svg").attr("class","svg-area").attr("data-pipeline-id",this.activePipeline.id).attr("width",n.width).attr("height",n.height).attr("x",n.x).attr("y",n.y).on("mouseenter",(function(t,n){e.supernodeInfo.renderer&&e.config.enableZoomIntoSubFlows&&e.supernodeInfo.renderer.setMaxZoomExtent(1/e.zoomTransform.k)})).on("mouseleave",(function(t,n){e.supernodeInfo.renderer&&e.config.enableZoomIntoSubFlows&&e.supernodeInfo.renderer.setMaxZoomExtent(1)}));if(i.append("rect").attr("x",0).attr("y",0).attr("width",n.width).attr("height",n.height).attr("data-pipeline-id",this.activePipeline.id).attr("class","d3-svg-background").attr("pointer-events","all").style("cursor",this.getCanvasCursor()),this.dispUtils.isDisplayingFullPage()){var o=i.append("defs");this.createDropShadow(o)}return i}},{key:"resetCanvasSVGBehaviors",value:function(){var e=this;this.canvasSVG.on(".zoom",null),!this.activePipeline.isEmptyOrBindingsOnly()&&this.dispUtils.isDisplayingFullPage()&&this.canvasSVG.call(this.zoom),this.canvasSVG.on("mousemove.zoom",(function(t){e.drawingNewLinkData&&e.drawNewLink(t),e.draggingLinkData&&e.dragLinkHandle(t)})).on("mousedown",(function(t){e.logger.log("Canvas - mousedown"),e.dispUtils.isDisplayingSubFlowInPlace()&&t.button===l.CONTEXT_MENU_BUTTON&&t.stopPropagation()})).on("mouseup.zoom",(function(t){e.logger.log("Canvas - mouseup-zoom"),e.drawingNewLinkData&&e.completeNewLink(t),e.draggingLinkData&&e.completeDraggedLink(t)})).on("click.zoom",(function(t){e.logger.log("Canvas - click-zoom"),e.selecting=!0,e.dispUtils.isDisplayingCurrentPipeline()&&!e.contextMenuClosedOnZoom&&e.canvasController.clearSelections(),e.contextMenuClosedOnZoom=!1,e.selecting=!1,e.canvasController.clickActionHandler({clickType:"contextmenu"===t.type?"SINGLE_CLICK_CONTEXTMENU":"SINGLE_CLICK",objectType:"canvas",selectedObjectIds:e.objectModel.getSelectedObjectIds()})})).on("dblclick.zoom",(function(){e.logger.log("Zoom - double click"),e.canvasController.clickActionHandler({clickType:"DOUBLE_CLICK",objectType:"canvas",selectedObjectIds:e.objectModel.getSelectedObjectIds()})})).on("contextmenu.zoom",(function(t,n){e.logger.log("Zoom - context menu"),e.openContextMenu(t,"canvas")}))}},{key:"resetCanvasCursor",value:function(){var e=".d3-svg-background[data-pipeline-id='"+this.activePipeline.id+"']";this.canvasSVG.select(e).style("cursor",this.getCanvasCursor())}},{key:"getCanvasCursor",value:function(){return this.dispUtils.isDisplayingFullPage()?this.config.enableInteractionType===l.INTERACTION_TRACKPAD||this.activePipeline.isEmptyOrBindingsOnly()?"default":"grab":"pointer"}},{key:"createCanvasGroup",value:function(e,t){return e.append("g").attr("class",t)}},{key:"createCanvasUnderlay",value:function(e,t){return"None"!==this.config.enableCanvasUnderlay&&this.dispUtils.isDisplayingPrimaryFlowFullPage()?e.append("rect").attr("class",t):null}},{key:"createBoundingRectanglesGrp",value:function(e,t){return this.config.enableBoundingRectangles?e.append("g").attr("class",t):null}},{key:"setCanvasUnderlaySize",value:function(){var e=this.getCanvasDimensionsAdjustedForScale(1,this.getZoomToFitPadding());e&&this.canvasUnderlay.attr("x",e.left-50).attr("y",e.top-50).attr("width",e.width+100).attr("height",e.height+100)}},{key:"addBackToParentFlowArrow",value:function(e){var t=this,n=e.append("g").attr("transform","translate(15, 15)").on("mouseenter",(function(e,t){gr.select(this).select("rect").attr("data-pointer-hover","yes")})).on("mouseleave",(function(e,t){gr.select(this).select("rect").attr("data-pointer-hover","no")})).on("click",(function(e){f.CanvasUtils.stopPropagationAndPreventDefault(e),t.canvasController.displayPreviousPipeline()}));n.append("rect").attr("x",0).attr("y",0).attr("width",210).attr("height",40).attr("class","d3-back-to-previous-flow-box"),n.append("svg").attr("x",16).attr("y",11).attr("width",16).attr("height",16).html(l.LEFT_ARROW_ICON).attr("class","d3-back-to-previous-flow-text"),n.append("text").attr("x",40).attr("y",24).attr("class","d3-back-to-previous-flow-text").text("Return to previous flow")}},{key:"createDropShadow",value:function(e){var t=e.append("filter").attr("id",this.getId("node_drop_shadow")).attr("x","-20%").attr("y","-20%").attr("width","200%").attr("height","200%");t.append("feOffset").attr("in","SourceAlpha").attr("dx",1).attr("dy",1).attr("result","offOut"),t.append("feGaussianBlur").attr("in","offOut").attr("stdDeviation","3").attr("result","blurOut"),t.append("feBlend").attr("in","SourceGraphic").attr("in2","blurOut").attr("mode","normal"),t.append("feComponentTransfer").append("feFuncA").attr("type","linear").attr("slope","0.2");var n=t.append("feMerge");n.append("feMergeNode"),n.append("feMergeNode").attr("in","SourceGraphic")}},{key:"restoreZoom",value:function(){var e=this.canvasController.getSavedZoom(this.pipelineId);if(!e&&this.config.enablePanIntoViewOnOpen){var t=this.getCanvasDimensionsAdjustedForScale(1,this.getZoomToFitPadding());t&&(e={x:-t.left,y:-t.top,k:1})}!e&&this.canvasLayout.initialPanX&&this.canvasLayout.initialPanY&&(e={x:this.canvasLayout.initialPanX,y:this.canvasLayout.initialPanY,k:1}),!e||e.k===this.zoomTransform.k&&e.x===this.zoomTransform.x&&e.y===this.zoomTransform.y||this.zoomCanvasInvokeZoomBehavior(e)}},{key:"zoomCanvasInvokeZoomBehavior",value:function(e,t){if(isFinite(e.x)&&isFinite(e.y)&&isFinite(e.k)){var n=gr.zoomIdentity.translate(e.x,e.y).scale(e.k);t?this.canvasSVG.call(this.zoom).transition().duration(t).call(this.zoom.transform,n):this.canvasSVG.call(this.zoom.transform,n)}}},{key:"zoomToFit",value:function(){var e=this.getZoomToFitPadding(),t=this.getCanvasDimensionsAdjustedForScale(1,e),n=this.getViewportDimensions();if(t){var i=n.width/t.width,o=n.height/t.height,a=Math.min(i,o,1),r=(n.width-t.width*a)/2,s=(n.height-t.height*a)/2;r-=a*t.left,s-=a*t.top,this.zoomingToFit=!0,this.zoomCanvasInvokeZoomBehavior({x:r,y:s,k:a}),this.zoomingToFit=!1}}},{key:"getZoomToFitPadding",value:function(){var e=this.canvasLayout.zoomToFitPadding;if(this.dispUtils.isDisplayingSubFlow()){var t=this.getMaxZoomToFitPaddingForConnections()+2*this.canvasLayout.supernodeBindingPortRadius;e=Math.max(e,t)}return e}},{key:"zoomTo",value:function(e){this.zoomCanvasInvokeZoomBehavior(e,500)}},{key:"getZoom",value:function(){return{x:this.zoomTransform.x,y:this.zoomTransform.y,k:this.zoomTransform.k}}},{key:"translateBy",value:function(e,t,n){var i=this.getZoomTransform(),o=gr.zoomIdentity.translate(i.x+e,i.y+t).scale(i.k);this.zoomCanvasInvokeZoomBehavior(o,n)}},{key:"zoomIn",value:function(){if(this.zoomTransform.k<this.maxScaleExtent){var e=Math.min(1.1*this.zoomTransform.k,this.maxScaleExtent);this.canvasSVG.call(this.zoom.scaleTo,e)}}},{key:"zoomOut",value:function(){if(this.zoomTransform.k>this.minScaleExtent){var e=Math.max(this.zoomTransform.k/1.1,this.minScaleExtent);this.canvasSVG.call(this.zoom.scaleTo,e)}}},{key:"isZoomedToMax",value:function(){return!!this.zoomTransform&&this.zoomTransform.k===this.maxScaleExtent}},{key:"isZoomedToMin",value:function(){return!!this.zoomTransform&&this.zoomTransform.k===this.minScaleExtent}},{key:"getZoomToReveal",value:function(e,t,n){var i,o,a=this.getTransformedViewportDimensions(),r=this.activePipeline.getNodes(e),s=f.CanvasUtils.getCanvasDimensions(r,[],[],0),l=this.convertCanvasDimensionsAdjustedForScaleWithPadding(s,1,10),c=parseInt(t,10),u=void 0===n?c:parseInt(n,10);if(l&&(Number.isNaN(c)||Number.isNaN(u)?(l.right>a.x+a.width&&(i=a.x+a.width-l.right),l.left<a.x&&(i=a.x-l.left),l.bottom>a.y+a.height&&(o=a.y+a.height-l.bottom),l.top<a.y&&(o=a.y-l.top)):(i=a.x+a.width*(c/100)-(l.left+l.width/2),o=a.y+a.height*(u/100)-(l.top+l.height/2)),void 0!==i||void 0!==o))return{x:this.zoomTransform.x+(i||0)*this.zoomTransform.k||0,y:this.zoomTransform.y+(o||0)*this.zoomTransform.k||0,k:this.zoomTransform.k};return null}},{key:"getTransformedViewportDimensions",value:function(){var e=this.getViewportDimensions();return this.getTransformedRect(e,0)}},{key:"getViewportDimensions",value:function(){var e={};if(this.dispUtils.isDisplayingSubFlowInPlace()){var t=this.getParentSupernodeSVGDimensions();e.width=t.width,e.height=t.height}else e=this.canvasSVG&&this.canvasSVG.node()?this.canvasSVG.node().getBoundingClientRect():{x:0,y:0,width:1100,height:640};return e}},{key:"zoomStart",value:function(e){if(this.logger.log("zoomStart - "+JSON.stringify(e.transform)),this.canvasController.closeTip(),this.canvasController.isContextMenuDisplayed()&&!this.dispUtils.isDisplayingSubFlowInPlace()&&(this.canvasController.closeContextMenu(),this.contextMenuClosedOnZoom=!0),this.zoomingToFit?this.regionSelect=!1:this.config.enableInteractionType===l.INTERACTION_TRACKPAD&&e.sourceEvent&&1===e.sourceEvent.buttons||this.config.enableInteractionType===l.INTERACTION_MOUSE&&e.sourceEvent&&e.sourceEvent.shiftKey?this.regionSelect=!0:this.regionSelect=!1,this.regionSelect){this.regionStartTransformX=e.transform.x,this.regionStartTransformY=e.transform.y;var t=this.getTransformedMousePos(e);this.region={startX:t.x,startY:t.y,width:0,height:0}}var n=".d3-svg-background[data-pipeline-id='"+this.activePipeline.id+"']";this.regionSelect?this.canvasSVG.select(n).style("cursor","crosshair"):this.canvasSVG.select(n).style("cursor","grabbing"),this.zoomStartPoint={x:e.transform.x,y:e.transform.y,k:e.transform.k},this.previousD3Event={x:e.transform.x,y:e.transform.y,k:e.transform.k},this.zoomCanvasDimensions=f.CanvasUtils.getCanvasDimensions(this.activePipeline.nodes,this.activePipeline.comments,this.activePipeline.links,this.canvasLayout.commentHighlightGap)}},{key:"zoomAction",value:function(e){this.logger.log("zoomAction - "+JSON.stringify(e.transform)),e.transform.k===this.zoomStartPoint.k?this.regionSelect?(this.addTempCursorOverlay("crosshair"),this.drawRegionSelector(e)):(this.addTempCursorOverlay("grabbing"),this.zoomCanvasBackground(e)):(this.zoomCanvasBackground(e),this.zoomCommentToolbar())}},{key:"zoomEnd",value:function(e){if(this.logger.log("zoomEnd - "+JSON.stringify(e.transform)),this.drawingNewLinkData&&(this.stopDrawingNewLink(),this.drawingNewLinkData=null),this.draggingLinkData&&(this.stopDraggingLink(),this.draggingLinkData=null),e.transform.k===this.zoomStartPoint.k&&!0===this.regionSelect){this.removeRegionSelector(),e.transform.x=this.regionStartTransformX,e.transform.y=this.regionStartTransformY;var t=this.getRegionDimensions(),n=t.startX,i=t.startY,o=t.width,a=t.height;this.isSelecting=!0,this.buildLinksArray();var r={x1:n,y1:i,x2:n+o,y2:i+a},s=f.CanvasUtils.selectInRegion(r,this.activePipeline,this.config.enableLinkSelection!==l.LINK_SELECTION_NONE,this.config.enableLinkType,this.config.enableAssocLinkType);this.canvasController.setSelections(s,this.activePipeline.id),this.regionSelect=!1}else if(this.dispUtils.isDisplayingFullPage()&&this.zoomChanged()){this.canvasSVG.property("__zoom",this.zoomTransform);var c={editType:"setZoom",editSource:"canvas",zoom:this.zoomTransform,pipelineId:this.activePipeline.id};this.canvasController.editActionHandler(c)}this.resetCanvasCursor(),this.removeTempCursorOverlay()}},{key:"zoomChanged",value:function(){return this.zoomTransform.k!==this.zoomStartPoint.k||this.zoomTransform.x!==this.zoomStartPoint.x||this.zoomTransform.y!==this.zoomStartPoint.y}},{key:"zoomCanvasBackground",value:function(e){if(this.regionSelect=!1,this.dispUtils.isDisplayingPrimaryFlowFullPage()){var t=this.getTransformIncrement(e);this.zoomTransform=this.zoomConstrainRegular(t,this.getViewportDimensions(),this.zoomCanvasDimensions)}else this.zoomTransform=gr.zoomIdentity.translate(e.transform.x,e.transform.y).scale(e.transform.k);this.canvasGrp.attr("transform",this.zoomTransform),this.config.enableBoundingRectangles&&this.displayBoundingRectangles(),"None"!==this.config.enableCanvasUnderlay&&this.dispUtils.isDisplayingPrimaryFlowFullPage()&&this.setCanvasUnderlaySize(),this.dispUtils.isDisplayingSubFlowFullPage()&&this.displayPortsForSubFlowFullPage()}},{key:"zoomCommentToolbar",value:function(){if(this.config.enableMarkdownInComments&&this.dispUtils.isDisplayingFullPage()&&this.svgCanvasTextArea.isEditingText()){var e=this.activePipeline.getComment(this.svgCanvasTextArea.getEditingTextId());if(e){var t=this.getCommentToolbarPos(e);this.canvasController.moveTextToolbar(t.x,t.y)}}}},{key:"getCommentToolbarPos",value:function(e){var t=this.unTransformPos({x:e.x_pos,y:e.y_pos});return{x:t.x+this.canvasLayout.commentToolbarPosX,y:t.y+this.canvasLayout.commentToolbarPosY}}},{key:"getTransformIncrement",value:function(e){var t=e.transform.x-this.previousD3Event.x,n=e.transform.y-this.previousD3Event.y,i={x:this.zoomTransform.x+t,y:this.zoomTransform.y+n,k:e.transform.k};return this.previousD3Event={x:e.transform.x,y:e.transform.y,k:e.transform.k},i}},{key:"zoomConstrainRegular",value:function(e,t,n){if(!n)return this.zoomTransform;var i=e.k,o=e.x,a=e.y,r=this.convertCanvasDimensionsAdjustedForScaleWithPadding(n,i,this.getZoomToFitPadding()),s=t.width-Math.min(.25*t.width,.25*r.width),l=-Math.max(r.width-.25*t.width,.75*r.width),c=t.height-Math.min(.25*t.height,.25*r.height),u=-Math.max(r.height-.25*t.height,.75*r.height);return o>-r.left+s?o=-r.left+s:o<-r.left+l&&(o=-r.left+l),a>-r.top+c?a=-r.top+c:a<-r.top+u&&(a=-r.top+u),gr.zoomIdentity.translate(o,a).scale(i)}},{key:"getCanvasDimensionsAdjustedForScale",value:function(e,t){var n=this.canvasLayout.commentHighlightGap,i=this.activePipeline.getCanvasDimensions(n);return this.convertCanvasDimensionsAdjustedForScaleWithPadding(i,e,t)}},{key:"convertCanvasDimensionsAdjustedForScaleWithPadding",value:function(e,t,n){var i=n||0;return e?{left:e.left*t-i,top:e.top*t-i,right:e.right*t+i,bottom:e.bottom*t+i,width:e.width*t+2*i,height:e.height*t+2*i}:null}},{key:"drawRegionSelector",value:function(e){var t=this.getTransformedMousePos(e);this.region.width=t.x-this.region.startX,this.region.height=t.y-this.region.startY,this.removeRegionSelector();var n=this.getRegionDimensions(),i=n.startX,o=n.startY,a=n.width,r=n.height;this.canvasGrp.append("rect").attr("width",a).attr("height",r).attr("x",i).attr("y",o).attr("class","d3-region-selector")}},{key:"removeRegionSelector",value:function(){this.canvasGrp.selectAll(".d3-region-selector").remove()}},{key:"getRegionDimensions",value:function(){var e=this.region.startX,t=this.region.startY,n=this.region.width,i=this.region.height;return n<0&&(n=Math.abs(n),e=this.region.startX-n),i<0&&(i=Math.abs(i),t=this.region.startY-i),{startX:e,startY:t,width:n,height:i}}},{key:"initializeResizeVariables",value:function(e){this.resizeObjInitialInfo={x_pos:e.x_pos,y_pos:e.y_pos,width:e.width,height:e.height},this.notSnappedXPos=e.x_pos,this.notSnappedYPos=e.y_pos,this.notSnappedWidth=e.width,this.notSnappedHeight=e.height}},{key:"getDragObjects",value:function(e){var t=this.getSelectedNodesAndComments();return this.config.enableDragWithoutSelect&&-1===t.findIndex((function(t){return t.id===e.id}))?[e]:t}},{key:"dragStart",value:function(e,t){if(this.logger.logStartTimer("dragStart"),this.closeContextMenuIfOpen(),this.commentSizing){var n=this.activePipeline.getComment(t.id);this.initializeResizeVariables(n)}else if(this.nodeSizing){var i=this.activePipeline.getNode(t.id);this.initializeResizeVariables(i)}else this.dragObjectsStart(e,t);this.logger.logEndTimer("dragStart",!0)}},{key:"dragMove",value:function(e,t){this.logger.logStartTimer("dragMove"),this.commentSizing?this.resizeComment(e,t):this.nodeSizing?this.resizeNode(e,t):this.dragObjectsAction(e),this.logger.logEndTimer("dragMove",!0)}},{key:"dragEnd",value:function(e,t){this.logger.logStartTimer("dragEnd"),this.removeTempCursorOverlay(),this.commentSizing?this.endCommentSizing(t):this.nodeSizing?this.endNodeSizing(t):this.dragging&&this.dragObjectsEnd(e,t),this.logger.logEndTimer("dragEnd",!0)}},{key:"dragObjectsStart",value:function(e,t){if(this.existingNodeInsertableIntoLink=!1,this.existingNodeAttachableToDetachedLinks=!1,this.dragging=!0,this.dragOffsetX=0,this.dragOffsetY=0,this.dragRunningX=0,this.dragRunningY=0,this.dragObjects=this.getDragObjects(t),this.dragObjects&&this.dragObjects.length>0&&(this.dragStartX=this.dragObjects[0].x_pos,this.dragStartY=this.dragObjects[0].y_pos),this.isExistingNodeInsertableIntoLink()&&(this.existingNodeInsertableIntoLink=!0,this.setNodeTranslucentState(this.dragObjects[0].id,!0),this.setDataLinkSelectionAreaWider(!0)),this.isExistingNodeAttachableToDetachedLinks()){this.existingNodeAttachableToDetachedLinks=!0;var n=this.getTransformedMousePos(e);this.dragPointerOffsetInNode={x:n.x-this.dragObjects[0].x_pos,y:n.y-this.dragObjects[0].y_pos},this.setNodeTranslucentState(this.dragObjects[0].id,!0)}}},{key:"dragObjectsAction",value:function(e){if(this.dragOffsetX+=e.dx,this.dragOffsetY+=e.dy,this.dispUtils.isDisplayingSubFlowInPlace()&&(this.dragOffsetX>1e3||this.dragOffsetX<-1e3||this.dragOffsetY>1e3||this.dragOffsetY<-1e3))this.dragOffsetX-=e.dx,this.dragOffsetY-=e.dy;else{var t={x:0,y:0};if(this.config.enableSnapToGridType===l.SNAP_TO_GRID_DURING){var n=this.snapToGridDraggedNode();t={x:n.x-this.dragObjects[0].x_pos,y:n.y-this.dragObjects[0].y_pos}}else t={x:e.dx,y:e.dy};this.dragRunningX+=t.x,this.dragRunningY+=t.y,this.dragObjects.forEach((function(e){e.x_pos+=t.x,e.y_pos+=t.y})),this.config.enableLinkSelection===l.LINK_SELECTION_DETACHABLE&&this.getSelectedLinks().forEach((function(e){e.srcPos&&(e.srcPos.x_pos+=t.x,e.srcPos.y_pos+=t.y),e.trgPos&&(e.trgPos.x_pos+=t.x,e.trgPos.y_pos+=t.y)}))}if(this.displayCanvas(),this.existingNodeInsertableIntoLink){var i=this.getLinkAtMousePos(e.sourceEvent.clientX,e.sourceEvent.clientY);(!i||this.isLinkFullyAttached(i)&&this.dragObjects[0].id!==i.srcNodeId&&this.dragObjects[0].id!==i.trgNodeId)&&this.setInsertNodeIntoLinkHighlighting(i)}if(this.existingNodeAttachableToDetachedLinks){var o=this.getTransformedMousePos(e),a=this.dragObjects[0],r={x1:o.x-this.dragPointerOffsetInNode.x,y1:o.y-this.dragPointerOffsetInNode.y,x2:o.x-this.dragPointerOffsetInNode.x+a.width,y2:o.y-this.dragPointerOffsetInNode.y+a.height},s=this.getAttachableLinksForNodeAtPos(a,r);this.setDetachedLinkHighlighting(s)}}},{key:"dragObjectsEnd",value:function(e,t){if(this.dragging=!1,0===this.dragOffsetX&&0===this.dragOffsetY&&this.config.enableDragWithoutSelect)this.selectObjectSourceEvent(e,t);else if(0!==this.dragRunningX||0!==this.dragRunningY){var n=null;if(this.config.enableSnapToGridType===l.SNAP_TO_GRID_AFTER){var i=this.snapToGridDraggedNode();n={x:i.x-this.dragStartX,y:i.y-this.dragStartY}}else n={x:this.dragRunningX,y:this.dragRunningY};this.existingNodeInsertableIntoLink&&this.dragOverLink?this.canvasController.editActionHandler({editType:"insertNodeIntoLink",editSource:"canvas",node:this.dragObjects[0],link:this.dragOverLink,offsetX:n.x,offsetY:n.y,pipelineId:this.activePipeline.id}):this.existingNodeAttachableToDetachedLinks&&this.dragOverDetachedLinks.length>0?this.canvasController.editActionHandler({editType:"attachNodeToLinks",editSource:"canvas",node:this.dragObjects[0],detachedLinks:this.dragOverDetachedLinks,offsetX:n.x,offsetY:n.y,pipelineId:this.activePipeline.id}):this.canvasController.editActionHandler({editType:"moveObjects",editSource:"canvas",nodes:this.dragObjects.map((function(e){return e.id})),links:this.getSelectedLinks().filter((function(e){return e.srcPos||e.trgPos})),offsetX:n.x,offsetY:n.y,pipelineId:this.activePipeline.id})}this.setDataLinkSelectionAreaWider(!1),this.unsetNodeTranslucentState(),this.unsetInsertNodeIntoLinkHighlighting(),this.unsetDetachedLinkHighlighting()}},{key:"dragStartLinkHandle",value:function(e,t){this.logger.logStartTimer("dragStartLinkHandle"),this.closeContextMenuIfOpen(),this.draggingLinkHandle=!0;var n=gr.select(e.sourceEvent.currentTarget),i=this.activePipeline.getLink(t.id),o=m.cloneDeep_1(i),a=this.getLinkGroupSelectionById(t.id);if(this.draggingLinkData={lineInfo:t,link:i,oldLink:o,linkGrpSelection:gr.select(a)},n.attr("class").includes("d3-link-handle-end")?this.draggingLinkData.endBeingDragged="end":n.attr("class").includes("d3-link-handle-start")&&(this.draggingLinkData.endBeingDragged="start"),this.config.enableHighlightUnavailableNodes)if("end"===this.draggingLinkData.endBeingDragged){var r=this.activePipeline.links.filter((function(e){return e.id!==i.id}));this.setUnavailableTargetNodesHighlighting(this.activePipeline.getNode(this.draggingLinkData.link.srcNodeId),this.draggingLinkData.link.srcNodePortId,r)}else if("start"===this.draggingLinkData.endBeingDragged){var s=this.activePipeline.links.filter((function(e){return e.id!==i.id}));this.setUnavailableSourceNodesHighlighting(this.activePipeline.getNode(this.draggingLinkData.oldLink.trgNodeId),this.draggingLinkData.link.trgNodePortId,s)}this.dragLinkHandle(e),this.logger.logEndTimer("dragStartLinkHandle",!0)}},{key:"dragMoveLinkHandle",value:function(e){this.logger.logStartTimer("dragMoveLinkHandle"),this.dragLinkHandle(e),this.logger.logEndTimer("dragMoveLinkHandle",!0)}},{key:"dragEndLinkHandle",value:function(e){this.logger.logStartTimer("dragEndLinkHandle"),this.completeDraggedLink(e),this.draggingLinkHandle=!1,this.logger.logEndTimer("dragEndLinkHandle",!0)}},{key:"setNodeTranslucentState",value:function(e,t){this.getNodeGroupSelectionById(e).classed("d3-node-group-translucent",t)}},{key:"unsetNodeTranslucentState",value:function(){this.dragObjects&&this.dragObjects.length>0&&this.setNodeTranslucentState(this.dragObjects[0].id,!1)}},{key:"snapToGridDraggedNode",value:function(){var e=this.dragStartX+this.dragOffsetX,t=this.dragStartY+this.dragOffsetY;return this.snapToGridPosition({x:e,y:t})}},{key:"snapToGridPosition",value:function(e){return{x:f.CanvasUtils.snapToGrid(e.x,this.canvasLayout.snapToGridXPx),y:f.CanvasUtils.snapToGrid(e.y,this.canvasLayout.snapToGridYPx)}}},{key:"displayNodes",value:function(){this.logger.logStartTimer("displayNodes "+this.getFlags()),this.setPortPositionsAllNodes(),this.commentSizing||(this.dragging&&!this.nodeSizing&&!this.commentSizing||this.movingBindingNodes?this.displayMovedNodes():this.selecting||this.regionSelect?this.displayNodesSelectionStatus():this.displayAllNodes()),this.logger.logEndTimer("displayNodes "+this.getFlags())}},{key:"displayMovedNodes",value:function(){var e=this,t=this.getAllNodeGroupsSelection();t.datum((function(t){return e.activePipeline.getNode(t.id)})).attr("transform",(function(e){return"translate(".concat(e.x_pos,", ").concat(e.y_pos,")")})),this.dispUtils.isDisplayingSubFlow()&&t.each((function(t,n,i){t.isSupernodeInputBinding&&e.updatePortRadiusAndPos(i[n],t,"d3-node-port-output-main"),t.isSupernodeOutputBinding&&(e.updatePortRadiusAndPos(i[n],t,"d3-node-port-input-main"),e.updatePortArrowPath(i[n],"d3-node-port-input-arrow"))}))}},{key:"displayNodesSelectionStatus",value:function(e){var t=this;this.getAllNodeGroupsSelection().selectChildren(".d3-node-selection-highlight").attr("data-selected",(function(e){return t.objectModel.isSelected(e.id,t.activePipeline.id)?"yes":"no"})),this.superRenderers.forEach((function(e){e.selecting=!0,e.displayNodes(),e.selecting=!1}))}},{key:"displayAllNodes",value:function(){var e=this;this.getAllNodeGroupsSelection().data(this.activePipeline.nodes,(function(e){return e.id})).join((function(t){return e.createNodes(t)})).attr("transform",(function(e){return"translate(".concat(e.x_pos,", ").concat(e.y_pos,")")})).attr("class",(function(t){return e.getNodeGroupClass(t)})).attr("style",(function(t){return e.getNodeGrpStyle(t)})).call((function(t){return e.updateNodes(t)}))}},{key:"createNodes",value:function(e){var t=this;this.logger.logStartTimer("createNodes");var n=e.append("g").attr("data-id",(function(e){return t.getId("node_grp",e.id)})).call(this.attachNodeGroupListeners.bind(this));return this.config.enableEditingActions&&n.call(this.drag),n.filter((function(e){return t.shouldDisplayNodeSizingArea(e)})).append("path").attr("class","d3-node-sizing").call(this.attachNodeSizingListeners.bind(this)),n.filter((function(e){return!f.CanvasUtils.isSuperBindingNode(e)})).append("path").attr("class","d3-node-selection-highlight"),n.filter((function(e){return!f.CanvasUtils.isSuperBindingNode(e)})).append("path").attr("class","d3-node-body-outline"),n.filter((function(e){return!f.CanvasUtils.isSuperBindingNode(e)&&e.layout.imageDisplay})).each((function(e,n,i){var o=t.getNodeImage(e),a=t.getImageType(o);gr.select(i[n]).append(a).attr("class",(function(e){return t.nodeUtils.getNodeImageClass(e)}))})),n.filter((function(e){return!f.CanvasUtils.isSuperBindingNode(e)})).append("foreignObject").attr("class","d3-foreign-object-node-label").call(this.attachNodeLabelListeners.bind(this)).append("xhtml:div").append("xhtml:span").call(this.attachNodeLabelSpanListeners.bind(this)),this.logger.logEndTimer("createNodes"),n}},{key:"updateNodes",value:function(e){var t=this;this.logger.logStartTimer("updateNodes"),e.selectChildren(".d3-node-sizing").datum((function(e){return t.activePipeline.getNode(e.id)})).attr("d",(function(e){return t.getNodeShapePathSizing(e)})),e.selectChildren(".d3-node-selection-highlight").datum((function(e){return t.activePipeline.getNode(e.id)})).attr("d",(function(e){return t.getNodeSelectionOutline(e)})).attr("data-selected",(function(e){return t.objectModel.isSelected(e.id,t.activePipeline.id)?"yes":"no"})).attr("style",(function(e){return t.getNodeSelectionOutlineStyle(e,"default")})),e.selectChildren(".d3-node-body-outline").datum((function(e){return t.activePipeline.getNode(e.id)})).attr("d",(function(e){return t.getNodeShapePath(e)})).attr("style",(function(e){return t.getNodeBodyStyle(e,"default")})),e.selectChildren(".d3-node-image").datum((function(e){return t.activePipeline.getNode(e.id)})).each((function(e,n,i){return t.setNodeImageContent(i[n],e)})).attr("x",(function(e){return t.nodeUtils.getNodeImagePosX(e)})).attr("y",(function(e){return t.nodeUtils.getNodeImagePosY(e)})).attr("width",(function(e){return t.nodeUtils.getNodeImageWidth(e)})).attr("height",(function(e){return t.nodeUtils.getNodeImageHeight(e)})).attr("style",(function(e){return t.getNodeImageStyle(e,"default")})),e.selectChildren(".d3-foreign-object-node-label").datum((function(e){return t.activePipeline.getNode(e.id)})).attr("x",(function(e){return t.nodeUtils.getNodeLabelPosX(e)})).attr("y",(function(e){return t.nodeUtils.getNodeLabelPosY(e)})).attr("width",(function(e){return t.nodeUtils.getNodeLabelWidth(e)})).attr("height",(function(e){return t.nodeUtils.getNodeLabelHeight(e)})).select("div").attr("class",(function(e){return t.nodeUtils.getNodeLabelClass(e)})).attr("style",(function(e){return t.getNodeLabelStyle(e,"default")})).select("span").html((function(e){return _n(e.label)})),e.selectChildren(".d3-node-ellipsis-group").attr("transform",(function(e){return t.nodeUtils.getNodeEllipsisTranslate(e)})),e.selectChildren(".d3-node-super-expand-icon-group").attr("transform",(function(e){return t.nodeUtils.getNodeExpansionIconTranslate(e)})),e.each((function(e,n,i){var o=gr.select(i[n]);if(t.displayPorts(o,e),f.CanvasUtils.isSupernode(e)&&t.displaySupernodeContents(e,gr.select(i[n])),!f.CanvasUtils.isSuperBindingNode(e)){t.addErrorMarker(e,o);var a=f.CanvasUtils.getCombinedDecorations(e.layout.decorations,e.decorations);t.displayDecorations(e,l.DEC_NODE,o,a)}})),this.logger.logEndTimer("updateNodes")}},{key:"displaySupernodeContents",value:function(e,t){var n=this.getRendererForSupernode(e);f.CanvasUtils.isExpanded(e)?n?n.setCanvasInfoRenderer(this.canvasInfo):(n=this.createSupernodeRenderer(e,t),this.superRenderers.push(n)):n&&n.hideCanvas(e)}},{key:"displayPorts",value:function(e,t){t.layout.inputPortDisplay&&Array.isArray(t.inputs)&&this.displayInputPorts(e,t),t.layout.outputPortDisplay&&Array.isArray(t.outputs)&&this.displayOutputPorts(e,t)}},{key:"displayInputPorts",value:function(e,t){var n=this,i="."+this.getNodeInputPortClassName();e.selectChildren(i).data(t.inputs,(function(e){return e.id})).join((function(e){return n.createInputPorts(e,t)})).attr("connected",(function(e){return e.isConnected?"yes":"no"})).attr("class",(function(e){return n.getNodeInputPortClassName()+(e.class_name?" "+e.class_name:"")})).call((function(e){return n.updateInputPorts(e,t)}))}},{key:"createInputPorts",value:function(e,t){var n=e.append("g").attr("data-port-id",(function(e){return e.id})).attr("isSupernodeBinding",f.CanvasUtils.isSuperBindingNode(t)?"yes":"no").call(this.attachInputPortListeners.bind(this),t);return n.append(t.layout.inputPortObject).attr("class","d3-node-port-input-main"),this.config.enableAssocLinkCreation||"circle"!==t.layout.inputPortObject||f.CanvasUtils.isSuperBindingNode(t)||n.append("path").attr("class","d3-node-port-input-arrow"),n}},{key:"updateInputPorts",value:function(e,t){var n=this;e.selectChildren(".d3-node-port-input-main").datum((function(e){return t.inputs.find((function(t){return e.id===t.id}))})).each((function(e,i,o){var a=gr.select(o[i]);t.layout.inputPortObject===l.PORT_OBJECT_IMAGE?a.attr("xlink:href",t.layout.inputPortImage).attr("x",e.cx-t.layout.inputPortWidth/2).attr("y",e.cy-t.layout.inputPortHeight/2).attr("width",t.layout.inputPortWidth).attr("height",t.layout.inputPortHeight):a.attr("r",n.getPortRadius(t)).attr("cx",e.cx).attr("cy",e.cy)})),e.selectChildren(".d3-node-port-input-arrow").datum((function(e){return t.inputs.find((function(t){return e.id===t.id}))})).each((function(e,i,o){var a=gr.select(o[i]);t.layout.inputPortObject!==l.PORT_OBJECT_IMAGE&&a.attr("d",n.getPortArrowPath(e)).attr("transform",n.getPortArrowPathTransform(e))}))}},{key:"displayOutputPorts",value:function(e,t){var n=this,i="."+this.getNodeOutputPortClassName(),o=this.config.enableSingleOutputPortDisplay&&t.outputs.length>1?[t.outputs[t.outputs.length-1]]:t.outputs;e.selectChildren(i).data(o,(function(e){return e.id})).join((function(e){return n.createOutputPorts(e,t)})).attr("connected",(function(e){return e.isConnected?"yes":"no"})).attr("class",(function(e){return n.getNodeOutputPortClassName()+(e.class_name?" "+e.class_name:"")})).call((function(e){return n.updateOutputPorts(e,t)}))}},{key:"createOutputPorts",value:function(e,t){var n=e.append("g").attr("data-port-id",(function(e){return e.id})).attr("isSupernodeBinding",f.CanvasUtils.isSuperBindingNode(t)?"yes":"no").call(this.attachOutputPortListeners.bind(this),t);return n.append(t.layout.outputPortObject).attr("class","d3-node-port-output-main"),n}},{key:"updateOutputPorts",value:function(e,t){var n=this;e.selectChildren(".d3-node-port-output-main").datum((function(e){return t.outputs.find((function(t){return e.id===t.id}))})).each((function(e,i,o){var a=gr.select(o[i]);t.layout.outputPortObject===l.PORT_OBJECT_IMAGE?a.attr("xlink:href",t.layout.outputPortImage).attr("x",e.cx-t.layout.outputPortWidth/2).attr("y",e.cy-t.layout.outputPortHeight/2).attr("width",t.layout.outputPortWidth).attr("height",t.layout.outputPortHeight):a.attr("r",n.getPortRadius(t)).attr("cx",e.cx).attr("cy",e.cy)}))}},{key:"attachNodeGroupListeners",value:function(e){var t=this;e.on("mouseenter",(function(e,n){var i=gr.select(e.currentTarget);t.raiseNodeToTop(i),t.setNodeStyles(n,"hover",i),t.addDynamicNodeIcons(n,i),t.canOpenTip(l.TIP_TYPE_NODE)&&(t.canvasController.closeTip(),t.canvasController.openTip({id:t.getId("node_tip",n.id),type:l.TIP_TYPE_NODE,targetObj:e.currentTarget,pipelineId:t.activePipeline.id,node:n}))})).on("mouseleave",(function(e,n){var i=gr.select(e.currentTarget);t.setNodeStyles(n,"default",i),t.removeDynamicNodeIcons(n,i),t.canvasController.closeTip()})).on("mousedown",(function(e,n){t.logger.log("Node Group - mouse down"),t.config.enableDragWithoutSelect||t.selectObjectD3Event(e,n),t.logger.log("Node Group - finished mouse down")})).on("mousemove",(function(e,t){})).on("mouseup",(function(e,n){e.stopPropagation(),t.logger.log("Node Group - mouse up"),t.drawingNewLinkData&&t.completeNewLink(e),t.draggingLinkData&&t.completeDraggedLink(e,n)})).on("click",(function(e,n){t.logger.log("Node Group - click"),e.stopPropagation()})).on("dblclick",(function(e,n){t.logger.log("Node Group - double click"),f.CanvasUtils.stopPropagationAndPreventDefault(e);var i=t.objectModel.getSelectedObjectIds();t.canvasController.clickActionHandler({clickType:"DOUBLE_CLICK",objectType:"node",id:n.id,selectedObjectIds:i,pipelineId:t.activePipeline.id})})).on("contextmenu",(function(e,n){t.logger.log("Node Group - context menu"),f.CanvasUtils.stopPropagationAndPreventDefault(e),f.CanvasUtils.isSuperBindingNode(n)||(t.config.enableDragWithoutSelect&&t.selectObjectD3Event(e,n),t.openContextMenu(e,"node",n))}))}},{key:"attachNodeSizingListeners",value:function(e){var t=this;e.on("mousedown",(function(e,n){t.isNodeResizable(n)&&(t.nodeSizing=!0,t.addTempCursorOverlay(t.nodeSizingCursor))})).on("mousemove mouseenter",(function(e,n){if(t.isNodeResizable(n)&&!t.isRegionSelectOrSizingInProgress()){var i="pointer";t.isPointerCloseToBodyEdge(e,n)||(t.nodeSizingDirection=t.getSizingDirection(e,n,n.layout.nodeCornerResizeArea),t.nodeSizingCursor=t.getCursorBasedOnDirection(t.nodeSizingDirection),i=t.nodeSizingCursor),gr.select(e.currentTarget).style("cursor",i)}})).on("mouseleave",(function(e,t){gr.select(e.currentTarget).style("cursor","pointer")}))}},{key:"attachNodeLabelListeners",value:function(e){var t=this;e.on("mouseenter",(function(e,n){var i=gr.select(e.currentTarget);if(t.config.enableDisplayFullLabelOnHover&&!f.CanvasUtils.isExpandedSupernode(n)){var o=i.selectAll("span");i.attr("x",t.nodeUtils.getNodeLabelHoverPosX(n)).attr("width",t.nodeUtils.getNodeLabelHoverWidth(n)).attr("height",t.nodeUtils.getNodeLabelHoverHeight(n,o.node(),t.zoomTransform.k)),o.classed("d3-label-full",!0)}})).on("mouseleave",(function(e,n){var i=gr.select(e.currentTarget);t.config.enableDisplayFullLabelOnHover&&!f.CanvasUtils.isExpandedSupernode(n)&&(i.attr("x",t.nodeUtils.getNodeLabelPosX(n)).attr("width",t.nodeUtils.getNodeLabelWidth(n)).attr("height",t.nodeUtils.getNodeLabelHeight(n)),i.selectAll("span").classed("d3-label-full",!1))})).on("dblclick",(function(e,n){t.logger.log("Node Label - double click"),n.layout.labelEditable&&t.config.enableEditingActions&&(f.CanvasUtils.stopPropagationAndPreventDefault(e),t.displayNodeLabelTextArea(n,e.currentTarget.parentNode))}))}},{key:"attachNodeLabelSpanListeners",value:function(e){var t=this;e.on("mouseenter",(function(e,n){n.layout.labelEditable&&t.config.enableEditingActions&&t.displayNodeLabelEditIcon(e.currentTarget,n)})).on("mouseleave",(function(e,n){n.layout.labelEditable&&t.config.enableEditingActions&&(t.hideEditIconPending=setTimeout(t.hideEditIcon.bind(t),500,e.currentTarget,n))}))}},{key:"attachInputPortListeners",value:function(e,t){var n=this;e.on("mousedown",(function(e,i){if(n.config.enableAssocLinkCreation&&0===e.button){f.CanvasUtils.stopPropagationAndPreventDefault(e);var o=n.activePipeline.getNode(t.id);n.drawingNewLinkData={srcObjId:t.id,srcPortId:i.id,action:n.config.enableAssocLinkCreation?l.ASSOCIATION_LINK:l.NODE_LINK,srcNode:o,startPos:{x:o.x_pos+i.cx,y:o.y_pos+i.cy},portType:"input",portObject:t.layout.inputPortObject,portImage:t.layout.inputPortImage,portWidth:t.layout.inputPortWidth,portHeight:t.layout.inputPortHeight,portRadius:n.getPortRadius(o),minInitialLine:o.layout.minInitialLine,guideObject:t.layout.inputPortGuideObject,guideImage:t.layout.inputPortGuideImage,linkArray:[]},n.drawNewLink(e)}})).on("mouseenter",(function(e,i){f.CanvasUtils.stopPropagationAndPreventDefault(e),n.canOpenTip(l.TIP_TYPE_PORT)&&(n.canvasController.closeTip(),n.canvasController.openTip({id:n.getId("node_port_tip",i.id),type:l.TIP_TYPE_PORT,targetObj:e.currentTarget,pipelineId:n.activePipeline.id,node:t,port:i}))})).on("mouseleave",(function(){n.canvasController.closeTip()})).on("contextmenu",(function(e,i){n.logger.log("Input Port Circle - context menu"),f.CanvasUtils.stopPropagationAndPreventDefault(e),n.config.enableDragWithoutSelect&&n.selectObjectD3Event(e,t),n.openContextMenu(e,"input_port",t,i)}))}},{key:"attachOutputPortListeners",value:function(e,t){var n=this;e.on("mousedown",(function(e,i){if(0===e.button){f.CanvasUtils.stopPropagationAndPreventDefault(e);var o=n.activePipeline.getNode(t.id);f.CanvasUtils.isSrcCardinalityAtMax(i.id,o,n.activePipeline.links)||(n.drawingNewLinkData={srcObjId:t.id,srcPortId:i.id,action:n.config.enableAssocLinkCreation?l.ASSOCIATION_LINK:l.NODE_LINK,srcNode:o,startPos:{x:o.x_pos+i.cx,y:o.y_pos+i.cy},portType:"output",portObject:t.layout.outputPortObject,portImage:t.layout.outputPortImage,portWidth:t.layout.outputPortWidth,portHeight:t.layout.outputPortHeight,portRadius:n.getPortRadius(o),minInitialLine:o.layout.minInitialLine,guideObject:t.layout.outputPortGuideObject,guideImage:t.layout.outputPortGuideImage,linkArray:[]},n.config.enableHighlightUnavailableNodes&&n.setUnavailableTargetNodesHighlighting(o,i.id,n.activePipeline.links),n.drawNewLink(e))}})).on("mouseenter",(function(e,i){f.CanvasUtils.stopPropagationAndPreventDefault(e),n.canOpenTip(l.TIP_TYPE_PORT)&&(n.canvasController.closeTip(),n.canvasController.openTip({id:n.getId("node_port_tip",i.id),type:l.TIP_TYPE_PORT,targetObj:e.currentTarget,pipelineId:n.activePipeline.id,node:t,port:i}))})).on("mouseleave",(function(){n.canvasController.closeTip()})).on("contextmenu",(function(e,i){n.logger.log("Output Port Circle - context menu"),f.CanvasUtils.stopPropagationAndPreventDefault(e),n.config.enableDragWithoutSelect&&n.selectObjectD3Event(e,t),n.openContextMenu(e,"output_port",t,i)}))}},{key:"setUnavailableTargetNodesHighlighting",value:function(e,t,n){this.getAllNodeGroupsSelection().filter((function(i){return!f.CanvasUtils.isTrgNodeAvailable(i,e,t,n)})).classed("d3-node-unavailable",!0)}},{key:"setUnavailableSourceNodesHighlighting",value:function(e,t,n){this.getAllNodeGroupsSelection().filter((function(i){return!f.CanvasUtils.isSrcNodeAvailable(i,e,t,n)})).classed("d3-node-unavailable",!0)}},{key:"unsetUnavailableNodesHighlighting",value:function(){this.getAllNodeGroupsSelection().classed("d3-node-unavailable",!1)}},{key:"displayNodeLabelEditIcon",value:function(e,t){var n=this,i=e.parentElement.parentElement.parentElement,o=gr.select(i),a=this.nodeUtils.getNodeLabelEditIconTranslate(t,e,this.zoomTransform.k,this.config.enableDisplayFullLabelOnHover);this.displayEditIcon(e,o,a,(function(e,t){return n.displayNodeLabelTextArea(t,e.currentTarget.parentNode)}))}},{key:"displayDecLabelEditIcon",value:function(e,t,n,i){var o=this,a=e.parentElement.parentElement.parentElement,r=gr.select(a),s=this.decUtils.getDecLabelEditIconTranslate(t,n,i,e,this.zoomTransform.k);this.displayEditIcon(e,r,s,(function(e,a){return o.displayDecLabelTextArea(t,n,i,e.currentTarget.parentNode)}))}},{key:"displayEditIcon",value:function(e,t,n,i){var o=this,a=t.append("g").attr("class","d3-label-edit-icon-group").attr("transform",n).on("mouseenter",(function(e,t){o.mouseOverLabelEditIcon=!0})).on("mouseleave",(function(e,t){o.mouseOverLabelEditIcon=!1,o.hideEditIcon(this)})).on("click",(function(e,t){i(e,t),o.mouseOverLabelEditIcon=!1,o.hideEditIcon(this)}));a.append("rect").attr("class","d3-label-edit-icon-background1").attr("width",29).attr("height",24).attr("x",0).attr("y",-4),a.append("rect").attr("class","d3-label-edit-icon-background2").attr("width",24).attr("height",24).attr("x",5).attr("y",-4),a.append("svg").attr("class","d3-node-edit-label-icon").html(l.EDIT_ICON).attr("width",16).attr("height",16).attr("x",9).attr("y",0)}},{key:"hideEditIcon",value:function(e){if(!this.mouseOverLabelEditIcon){var t=e.parentElement.parentElement.parentElement;gr.select(t).selectAll(".d3-label-edit-icon-group").remove()}}},{key:"selectObjectD3Event",value:function(e,t){this.selectObject(t,e.type,e.shiftKey,f.CanvasUtils.isCmndCtrlPressed(e))}},{key:"selectObjectSourceEvent",value:function(e,t){this.selectObject(t,e.type,e.sourceEvent.shiftKey,f.CanvasUtils.isCmndCtrlPressed(e.sourceEvent))}},{key:"selectObject",value:function(e,t,n,i){this.selecting=!0,this.objectModel.isSelected(e.id,this.activePipeline.id)?i&&this.objectModel.toggleSelection(e.id,i,this.activePipeline.id):n?this.objectModel.selectSubGraph(e.id,this.activePipeline.id):this.objectModel.toggleSelection(e.id,i,this.activePipeline.id),this.selecting=!1;var o=this.activePipeline.getObjectTypeName(e);"node"!==o&&"link"!==o||(this.canvasController.clickActionHandler({clickType:"contextmenu"===t||this.ellipsisClicked?"SINGLE_CLICK_CONTEXTMENU":"SINGLE_CLICK",objectType:o,id:e.id,selectedObjectIds:this.objectModel.getSelectedObjectIds(),pipelineId:this.activePipeline.id}),this.ellipsisClicked=!1)}},{key:"displayDecorations",value:function(e,t,n,i){var o=this,a=this,r=i||[],s="d3-".concat(t,"-dec-group"),l="."+s;n.selectChildren(l).data(r,(function(e){return e.id})).join((function(e){return o.createDecorations(e,t,s)})).attr("transform",(function(n){return o.decUtils.getDecTransform(n,e,t)})).on("mousedown",(function(t,n){return n.hotspot?a.callDecoratorCallback(t,e,n):null})).each((function(n,i,a){return o.updateDecoration(n,gr.select(a[i]),t,e)}))}},{key:"createDecorations",value:function(e,t,n){var i=this;return e.append("g").attr("data-id",(function(e){return i.getId("".concat(t,"_dec_group"),e.id)})).attr("class",n).call(this.attachDecGroupListeners.bind(this))}},{key:"updateDecoration",value:function(e,t,n,i){this.updateDecOutlines(e,t,n,i),this.updateDecPaths(e,t,n),this.updateDecImages(e,t,n,i),this.updateDecLabels(e,t,n,i)}},{key:"updateDecOutlines",value:function(e,t,n,i){var o=t.selectChild("rect");e.label||e.path||!1===e.outline?o.remove():(o=o.empty()?t.append("rect"):o).attr("class",this.decUtils.getDecClass(e,"d3-".concat(n,"-dec-outline"))).attr("x",0).attr("y",0).attr("width",this.decUtils.getDecWidth(e,i,n)).attr("height",this.decUtils.getDecHeight(e,i,n)).lower()}},{key:"updateDecPaths",value:function(e,t,n){var i=t.selectChild("path");e.path?(i=i.empty()?t.append("path"):i).attr("class",this.decUtils.getDecClass(e,"d3-".concat(n,"-dec-path"))).attr("x",0).attr("y",0).attr("d",e.path):i.remove()}},{key:"updateDecImages",value:function(e,t,n,i){var o=this,a=t.selectChild("g");if(e.image){var r=this.getImageType(e.image);(a=a.empty()?t.append("g").append(r):a.select(r)).attr("class",this.decUtils.getDecClass(e,"d3-".concat(n,"-dec-image"))).attr("x",this.decUtils.getDecPadding(e,i,n)).attr("y",this.decUtils.getDecPadding(e,i,n)).attr("width",this.decUtils.getDecWidth(e,i,n)-2*this.decUtils.getDecPadding(e,i,n)).attr("height",this.decUtils.getDecHeight(e,i,n)-2*this.decUtils.getDecPadding(e,i,n)).each((function(){return o.setImageContent(a,e.image)}))}else a.remove()}},{key:"updateDecLabels",value:function(e,t,n,i){var o=t.selectChild("foreignObject");e.label?(o.empty()&&(o=t.append("foreignObject").attr("class","d3-foreign-object-dec-label").attr("x",0).attr("y",0).call(this.attachDecLabelListeners.bind(this,i,n))).append("xhtml:div").append("xhtml:span").call(this.attachDecLabelSpanListeners.bind(this,i,n)),o.attr("width",this.decUtils.getDecLabelWidth(e,i,n)).attr("height",this.decUtils.getDecLabelHeight(e,i,n)).select("div").attr("class",this.decUtils.getDecLabelClass(e,n)).select("span").html(_n(e.label))):o.remove()}},{key:"attachDecLabelListeners",value:function(e,t,n){var i=this;n.on("dblclick",(function(n,o){i.logger.log("Decoration Label - double click"),o.label_editable&&i.config.enableEditingActions&&(f.CanvasUtils.stopPropagationAndPreventDefault(n),i.displayDecLabelTextArea(o,e,t,n.currentTarget.parentNode))}))}},{key:"attachDecLabelSpanListeners",value:function(e,t,n){var i=this;n.on("mouseenter",(function(n,o){o.label_editable&&i.config.enableEditingActions&&i.displayDecLabelEditIcon(n.currentTarget,o,e,t)})).on("mouseleave",(function(e,t){t.label_editable&&i.config.enableEditingActions&&(i.hideEditIconPending=setTimeout(i.hideEditIcon.bind(i),500,e.currentTarget,t))}))}},{key:"attachDecGroupListeners",value:function(e){var t=this;e.on("mouseenter",(function(e,n){t.canOpenTip(l.TIP_TYPE_DEC)&&(t.canvasController.closeTip(),t.canvasController.openTip({id:t.getId("dec_tip",n.id),type:l.TIP_TYPE_DEC,targetObj:e.currentTarget,pipelineId:t.activePipeline.id,decoration:n}))})).on("mouseleave",(function(e,n){t.canvasController.closeTip()}))}},{key:"addErrorMarker",value:function(e,t){var n=this,i=t.selectChildren(".node-error-marker");e.messages&&e.messages.length>0?(i.empty()&&t.append("svg").attr("class","node-error-marker"),t.selectChildren(".node-error-marker").attr("class",(function(){return"node-error-marker "+n.nodeUtils.getErrorMarkerClass(e.messages)})).html(this.nodeUtils.getErrorMarkerIcon(e)).attr("width",this.nodeUtils.getNodeErrorWidth(e)).attr("height",this.nodeUtils.getNodeErrorHeight(e)).attr("x",this.nodeUtils.getNodeErrorPosX(e)).attr("y",this.nodeUtils.getNodeErrorPosY(e))):i.empty()||i.remove()}},{key:"getNodeInputPortClassName",value:function(){return this.config.enableAssocLinkCreation?"d3-node-port-input-assoc":"d3-node-port-input"}},{key:"getNodeOutputPortClassName",value:function(){return this.config.enableAssocLinkCreation?"d3-node-port-output-assoc":"d3-node-port-output"}},{key:"setNodeImageContent",value:function(e,t){var n=this.getNodeImage(t),i=gr.select(e);this.setImageContent(i,n)}},{key:"setImageContent",value:function(e,t){if(t!==e.attr("data-image")){var n=this.getImageType(t);e.attr("data-image",t),"svg"===n?(e.selectChild("svg").remove(),gr.svg(t,{cache:"force-cache"}).then((function(t){e.node().append(t.documentElement)}))):e.attr("xlink:href",t)}}},{key:"getNodeImage",value:function(e){if(!e.image)return null;if(e.image===l.USE_DEFAULT_ICON){if(f.CanvasUtils.isSupernode(e))return B}else if(e.image===l.USE_DEFAULT_EXT_ICON&&f.CanvasUtils.isSupernode(e))return F;return e.image}},{key:"getImageType",value:function(e){return e&&e.endsWith(".svg")?"svg":"image"}},{key:"setNodeStyles",value:function(e,t,n){this.setNodeBodyStyles(e,t,n),this.setNodeSelectionOutlineStyles(e,t,n),this.setNodeImageStyles(e,t,n),this.setNodeLabelStyles(e,t,n)}},{key:"setNodeBodyStyles",value:function(e,t,n){var i=this.getNodeBodyStyle(e,t);n.selectChildren(".d3-node-body-outline").attr("style",i)}},{key:"setNodeSelectionOutlineStyles",value:function(e,t,n){var i=this.getNodeSelectionOutlineStyle(e,t);n.selectChildren(".d3-node-selection-highlight").attr("style",i)}},{key:"setNodeImageStyles",value:function(e,t,n){var i=this.getNodeImageStyle(e,t);n.selectChildren(".d3-node-image").attr("style",i)}},{key:"setNodeLabelStyles",value:function(e,t,n){var i=this.getNodeLabelStyle(e,t);n.selectChildren(".d3-node-label").attr("style",i)}},{key:"getNodeBodyStyle",value:function(e,t){var n=f.CanvasUtils.getObjectStyle(e,"body",t);return null===n&&e.layout.dropShadow&&(n="filter:url(".concat(this.getId("#node_drop_shadow"),")")),n}},{key:"getNodeSelectionOutlineStyle",value:function(e,t){return f.CanvasUtils.getObjectStyle(e,"selection_outline",t)}},{key:"getNodeImageStyle",value:function(e,t){return f.CanvasUtils.getObjectStyle(e,"image",t)}},{key:"getNodeLabelStyle",value:function(e,t){return f.CanvasUtils.getObjectStyle(e,"label",t)}},{key:"getNodeGrpStyle",value:function(e){return e.style_temp||e.style||!this.canvasInfo.subdueStyle||this.doesExpandedSupernodeHaveStyledNodes(e)?null:this.canvasInfo.subdueStyle}},{key:"getLinkGrpStyle",value:function(e){return e.style_temp||e.style||!this.canvasInfo.subdueStyle?null:this.canvasInfo.subdueStyle}},{key:"doesExpandedSupernodeHaveStyledNodes",value:function(e){var t=this,n=!1;f.CanvasUtils.isExpandedSupernode(e)&&e.subflow_ref&&e.subflow_ref.pipeline_id_ref&&new pr(e.subflow_ref.pipeline_id_ref,this.canvasInfo).nodes.forEach((function(e){e.style||e.style_temp?n=!0:!n&&f.CanvasUtils.isExpandedSupernode(e)&&(n=t.doesExpandedSupernodeHaveStyledNodes(e))}));return n}},{key:"getMaxZoomToFitPaddingForConnections",value:function(){var e=this.getMaxPaddingForConnectionsFromInputBindingNodes(),t=this.getMaxPaddingForConnectionsToOutputBindingNodes();return Math.max(e,t)}},{key:"getMaxPaddingForConnectionsFromInputBindingNodes",value:function(){var e=this,t=0;return this.activePipeline.nodes.filter((function(e){return e.isSupernodeInputBinding})).forEach((function(n){var i=f.CanvasUtils.getNodePaddingToTargetNodes(n,e.activePipeline.nodes,e.activePipeline.links,e.canvasLayout.linkType);t=Math.max(t,i)})),t}},{key:"getMaxPaddingForConnectionsToOutputBindingNodes",value:function(){var e=this,t=0,n=this.activePipeline.nodes.filter((function(e){return e.isSupernodeOutputBinding}));return this.activePipeline.nodes.forEach((function(i){var o=f.CanvasUtils.getNodePaddingToTargetNodes(i,n,e.activePipeline.links,e.canvasLayout.linkType);t=Math.max(t,o)})),t}},{key:"getPortRadius",value:function(e){return f.CanvasUtils.isSuperBindingNode(e)?this.getBindingPortRadius():e.layout.portRadius}},{key:"getBindingPortRadius",value:function(){return this.canvasLayout.supernodeBindingPortRadius/this.zoomTransform.k}},{key:"addDynamicNodeIcons",value:function(e,t){var n=this;if(!this.nodeSizing&&!f.CanvasUtils.isSuperBindingNode(e)){var i=t.append("g").filter((function(){return e.layout.ellipsisDisplay})).attr("class","d3-node-ellipsis-group").attr("transform",(function(e){return n.nodeUtils.getNodeEllipsisTranslate(e)})).on("mousedown",(function(t){f.CanvasUtils.stopPropagationAndPreventDefault(t),n.ellipsisClicked=!0,n.config.enableDragWithoutSelect||n.selectObjectD3Event(t,e),n.openContextMenu(t,"node",e)}));if(i.append("rect").attr("class","d3-node-ellipsis-background").attr("width",(function(e){return n.nodeUtils.getNodeEllipsisWidth(e)})).attr("height",(function(e){return n.nodeUtils.getNodeEllipsisHeight(e)})).attr("x",0).attr("y",0),i.append("svg").attr("class","d3-node-ellipsis").html(l.NODE_MENU_ICON).attr("width",(function(e){return n.nodeUtils.getNodeEllipsisIconWidth(e)})).attr("height",(function(e){return n.nodeUtils.getNodeEllipsisIconHeight(e)})).attr("x",(function(e){return e.layout.ellipsisHoverAreaPadding})).attr("y",(function(e){return e.layout.ellipsisHoverAreaPadding})),f.CanvasUtils.isExpandedSupernode(e)){var o=t.append("g").attr("transform",(function(e){return n.nodeUtils.getNodeExpansionIconTranslate(e)})).attr("class","d3-node-super-expand-icon-group").on("mousedown",(function(e){f.CanvasUtils.stopPropagationAndPreventDefault(e);var t=n.getSupernodeBreadcrumbs(e.currentTarget);n.canvasController.displaySubPipelineForBreadcrumbs(t)})).on("mouseenter",(function(){gr.select(this).attr("data-pointer-hover","yes")})).on("mouseleave",(function(){gr.select(this).attr("data-pointer-hover","no")}));o.append("rect").attr("class","d3-node-super-expand-icon-background").attr("width",this.canvasLayout.supernodeExpansionIconWidth).attr("height",this.canvasLayout.supernodeExpansionIconHeight).attr("x",0).attr("y",0),o.append("svg").attr("class","d3-node-super-expand-icon").html(l.SUPER_NODE_EXPAND_ICON).attr("width",this.canvasLayout.supernodeExpansionIconWidth-2*this.canvasLayout.supernodeExpansionIconHoverAreaPadding).attr("height",this.canvasLayout.supernodeExpansionIconHeight-2*this.canvasLayout.supernodeExpansionIconHoverAreaPadding).attr("x",this.canvasLayout.supernodeExpansionIconHoverAreaPadding).attr("y",this.canvasLayout.supernodeExpansionIconHoverAreaPadding)}}}},{key:"getSupernodeBreadcrumbs",value:function(e){for(var t=[],n=e.closest(".d3-node-group");n;){var i=n.closest(".svg-area"),o=this.getD3DatumFromDomEl(n),a=i.getAttribute("data-pipeline-id");t.push(this.canvasController.getObjectModel().createBreadcrumb(o,a)),n=i.closest(".d3-node-group")}return t.reverse()}},{key:"getD3DatumFromDomEl",value:function(e){var t=gr.select(e);return t?t.datum():null}},{key:"updatePortRadiusAndPos",value:function(e,t,n){var i=this;gr.select(e).selectAll("."+n).attr("r",(function(){return i.getPortRadius(t)})).attr("cx",(function(e){return e.cx})).attr("cy",(function(e){return e.cy}))}},{key:"updatePortArrowPath",value:function(e,t){var n=this;gr.select(e).selectAll("."+t).attr("d",(function(e){return n.getPortArrowPath(e)})).attr("transform",(function(e){return n.getPortArrowPathTransform(e)}))}},{key:"isPortMaxCardinalityZero",value:function(e){return 0===a.get_1(e,"app_data.ui_data.cardinality.max",1)}},{key:"removeDynamicNodeIcons",value:function(e,t){e.layout.ellipsisDisplay&&t.selectChildren(".d3-node-ellipsis-group").remove(),t.selectChildren(".d3-node-super-expand-icon-group").remove()}},{key:"createSupernodeRenderer",value:function(e,n){return e.subflow_ref&&e.subflow_ref.pipeline_id_ref?new t(e.subflow_ref.pipeline_id_ref,this.canvasDiv,this.canvasController,this.canvasInfo,this.config,{id:e.id,pipelineId:this.activePipeline.id,renderer:this,d3Selection:n}):null}},{key:"getRendererForSupernode",value:function(e){return this.superRenderers.find((function(t){return t.supernodeInfo.id===e.id&&t.activePipeline.id===e.subflow_ref.pipeline_id_ref}))}},{key:"getDiscardedRenderersForSupernode",value:function(e){return this.superRenderers.filter((function(t){return t.supernodeInfo.id===e.id&&t.activePipeline.id!==e.subflow_ref.pipeline_id_ref}))}},{key:"openContextMenu",value:function(e,t,n,i){f.CanvasUtils.stopPropagationAndPreventDefault(e),this.canvasController.contextMenuHandler({type:t,targetObject:"canvas"===t?null:n,id:"canvas"===t?null:n.id,pipelineId:this.activePipeline.id,cmPos:this.getMousePos(e,this.canvasDiv.selectAll("svg")),mousePos:this.getMousePosSnapToGrid(this.getTransformedMousePos(e)),selectedObjectIds:this.objectModel.getSelectedObjectIds(),addBreadcrumbs:n&&n.type===l.SUPER_NODE?this.getSupernodeBreadcrumbs(e.currentTarget):null,port:i,zoom:this.zoomTransform.k})}},{key:"closeContextMenuIfOpen",value:function(){this.canvasController.isContextMenuDisplayed()&&this.canvasController.closeContextMenu()}},{key:"callDecoratorCallback",value:function(e,t,n){e.stopPropagation(),this.canvasController.decorationActionHandler&&this.canvasController.decorationActionHandler(t,n.id,this.activePipeline.id)}},{key:"drawNewLink",value:function(e){if(!1!==this.config.enableEditingActions){this.closeContextMenuIfOpen();var t=this.getTransformedMousePos(e);this.drawingNewLinkData.action===l.COMMENT_LINK?this.drawNewCommentLinkForPorts(t):this.drawNewNodeLinkForPorts(t),this.config.enableHighlightNodeOnNewLinkDrag&&this.setNewLinkOverNode(e)}}},{key:"drawNewNodeLinkForPorts",value:function(e){var t,n=this,i=this,o=this.config.enableAssocLinkCreation?l.ASSOCIATION_LINK:l.NODE_LINK;t=this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT?this.linkUtils.getNewStraightNodeLinkStartPos(this.drawingNewLinkData.srcNode,e):{x:this.drawingNewLinkData.startPos.x,y:this.drawingNewLinkData.startPos.y},this.drawingNewLinkData.linkArray=[{x1:t.x,y1:t.y,x2:e.x,y2:e.y,originX:t.originX,originY:t.originY,type:o}],this.config.enableAssocLinkCreation&&(this.drawingNewLinkData.linkArray[0].assocLinkVariation=this.getNewLinkAssocVariation(this.drawingNewLinkData.linkArray[0].x1,this.drawingNewLinkData.linkArray[0].x2,this.drawingNewLinkData.portType));var a=this.linkUtils.getConnectorPathInfo(this.drawingNewLinkData.linkArray[0],this.drawingNewLinkData.minInitialLine),r=this.nodesLinksGrp.selectAll(".d3-new-connection-line"),s=this.nodesLinksGrp.selectAll(".d3-new-connection-start"),c=this.nodesLinksGrp.selectAll(".d3-new-connection-guide");o===l.NODE_LINK&&this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT&&this.nodeUtils.isPointInNodeBoundary(e,this.drawingNewLinkData.srcNode)?this.removeNewLinkLine():r.data(this.drawingNewLinkData.linkArray).enter().append("path").attr("class","d3-new-connection-line").attr("linkType",o).merge(r).attr("d",a.path).attr("transform",a.transform),this.canvasLayout.linkType!==l.LINK_TYPE_STRAIGHT&&s.data(this.drawingNewLinkData.linkArray).enter().append(this.drawingNewLinkData.portObject).attr("class","d3-new-connection-start").attr("linkType",o).merge(s).each((function(e){i.drawingNewLinkData.portObject===l.PORT_OBJECT_CIRCLE&&gr.select(this).attr("cx",e.x1).attr("cy",e.y1).attr("r",i.drawingNewLinkData.portRadius)})),c.data(this.drawingNewLinkData.linkArray).enter().append(this.drawingNewLinkData.guideObject).attr("class","d3-new-connection-guide").attr("linkType",o).on("mouseup",(function(e){f.CanvasUtils.stopPropagationAndPreventDefault(e),n.completeNewLink(e)})).merge(c).each((function(e){i.drawingNewLinkData.guideObject===l.PORT_OBJECT_IMAGE?gr.select(this).attr("xlink:href",i.drawingNewLinkData.guideImage).attr("x",e.x2-i.drawingNewLinkData.portWidth/2).attr("y",e.y2-i.drawingNewLinkData.portHeight/2).attr("width",i.drawingNewLinkData.portWidth).attr("height",i.drawingNewLinkData.portHeight).attr("transform",i.getLinkImageTransform(e)):gr.select(this).attr("cx",e.x2).attr("cy",e.y2).attr("r",i.drawingNewLinkData.portRadius)}))}},{key:"getLinkImageTransform",value:function(e){var t=0;if(this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT){var n=e.x2-(e.originX||e.x1),i=e.y2-(e.originY||e.y1);return 0===n&&0===i?t=0:(t=Math.atan(i/n)*(180/Math.PI),t=n>=0?t:t+180,this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?t-=90:this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP&&(t+=90)),"rotate(".concat(t,",").concat(e.x2,",").concat(e.y2,")")}return null}},{key:"drawNewCommentLinkForPorts",value:function(e){var t=this,n=this,i=this.activePipeline.getComment(this.drawingNewLinkData.srcObjId),o=this.linkUtils.getNewStraightCommentLinkStartPos(i,e),a=l.COMMENT_LINK;this.drawingNewLinkData.linkArray=[{x1:o.x,y1:o.y,x2:e.x,y2:e.y,type:a}];var r=this.nodesLinksGrp.selectAll(".d3-new-connection-line"),s=this.nodesLinksGrp.selectAll(".d3-new-connection-guide");if(r.data(this.drawingNewLinkData.linkArray).enter().append("path").attr("class","d3-new-connection-line").attr("linkType",a).merge(r).attr("d",(function(e){return n.linkUtils.getConnectorPathInfo(e).path})),s.data(this.drawingNewLinkData.linkArray).enter().append("circle").attr("class","d3-new-connection-guide").attr("linkType",a).on("mouseup",(function(e){f.CanvasUtils.stopPropagationAndPreventDefault(e),t.completeNewLink(e)})).merge(s).attr("cx",(function(e){return e.x2})).attr("cy",(function(e){return e.y2})).attr("r",this.canvasLayout.commentPortRadius),this.canvasLayout.commentLinkArrowHead){var c=this.nodesLinksGrp.selectAll(".d3-new-connection-arrow");c.data(this.drawingNewLinkData.linkArray).enter().append("path").attr("class","d3-new-connection-arrow").attr("linkType",a).on("mouseup",(function(e){f.CanvasUtils.stopPropagationAndPreventDefault(e),t.completeNewLink(e)})).merge(c).attr("d",(function(e){return t.getArrowHead(e)})).attr("transform",(function(e){return t.getArrowHeadTransform(e)}))}}},{key:"completeNewLink",value:function(e){if(!1!==this.config.enableEditingActions){this.config.enableHighlightUnavailableNodes&&this.unsetUnavailableNodesHighlighting();var t=this.getNodeAtMousePos(e);null!==t?this.completeNewLinkOnNode(e,t):this.config.enableLinkSelection!==l.LINK_SELECTION_DETACHABLE||this.drawingNewLinkData.action!==l.NODE_LINK||this.config.enableAssocLinkCreation?this.stopDrawingNewLink():this.completeNewDetachedLink(e)}}},{key:"completeNewLinkOnNode",value:function(e,t){if(this.removeNewLink(),this.config.enableHighlightNodeOnNewLinkDrag&&this.setNewLinkOverNodeCancel(),null!==t){var n=this.drawingNewLinkData.action;if(n===l.NODE_LINK){var i=this.activePipeline.getNode(this.drawingNewLinkData.srcObjId),o=this.drawingNewLinkData.srcPortId,a=this.getInputNodePortId(e,t);if(f.CanvasUtils.isDataConnectionAllowed(o,a,i,t,this.activePipeline.links))this.canvasController.editActionHandler({editType:"linkNodes",editSource:"canvas",nodes:[{id:this.drawingNewLinkData.srcObjId,portId:this.drawingNewLinkData.srcPortId}],targetNodes:[{id:t.id,portId:a}],type:n,linkType:"data",pipelineId:this.pipelineId});else if(this.config.enableLinkReplaceOnNewConnection&&f.CanvasUtils.isDataLinkReplacementAllowed(o,a,i,t,this.activePipeline.links)){var r=f.CanvasUtils.getDataLinksConnectedTo(a,t,this.activePipeline.links);1===r.length&&this.canvasController.editActionHandler({editType:"linkNodesAndReplace",editSource:"canvas",nodes:[{id:this.drawingNewLinkData.srcObjId,portId:this.drawingNewLinkData.srcPortId}],targetNodes:[{id:t.id,portId:a}],type:n,pipelineId:this.pipelineId,replaceLink:r[0]})}}else if(n===l.ASSOCIATION_LINK){var s=this.activePipeline.getNode(this.drawingNewLinkData.srcObjId);f.CanvasUtils.isAssocConnectionAllowed(s,t,this.activePipeline.links)&&this.canvasController.editActionHandler({editType:"linkNodes",editSource:"canvas",nodes:[{id:this.drawingNewLinkData.srcObjId}],targetNodes:[{id:t.id}],type:n,pipelineId:this.pipelineId})}else f.CanvasUtils.isCommentLinkConnectionAllowed(this.drawingNewLinkData.srcObjId,t.id,this.activePipeline.links)&&this.canvasController.editActionHandler({editType:"linkComment",editSource:"canvas",nodes:[this.drawingNewLinkData.srcObjId],targetNodes:[t.id],type:l.COMMENT_LINK,linkType:"comment",pipelineId:this.pipelineId})}this.drawingNewLinkData=null}},{key:"completeNewDetachedLink",value:function(e){this.removeNewLink(),this.config.enableHighlightNodeOnNewLinkDrag&&this.setNewLinkOverNodeCancel();var t=this.getTransformedMousePos(e);this.canvasController.editActionHandler({editType:"createDetachedLink",editSource:"canvas",srcNodeId:this.drawingNewLinkData.srcObjId,srcNodePortId:this.drawingNewLinkData.srcPortId,trgPos:t,type:l.NODE_LINK,pipelineId:this.pipelineId}),this.drawingNewLinkData=null}},{key:"stopDrawingNewLink",value:function(){this.config.enableHighlightNodeOnNewLinkDrag&&this.setNewLinkOverNodeCancel(),this.stopDrawingNewLinkForPorts()}},{key:"stopDrawingNewLinkForPorts",value:function(){var e=this,t=this.drawingNewLinkData.linkArray[0].x1,n=this.drawingNewLinkData.linkArray[0].y1,i=this.drawingNewLinkData.linkArray[0].x2,o=this.drawingNewLinkData.linkArray[0].y2,a=Object.assign({},this.drawingNewLinkData);this.drawingNewLinkData=null;var r="",s=350;this.canvasLayout.linkType===l.LINK_TYPE_CURVE?r="M "+t+" "+n+"C "+i+" "+o+" "+i+" "+o+" "+i+" "+o:this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT?(t<i&&(s=0),r="M "+t+" "+n+"L "+i+" "+o+" "+i+" "+o+" "+i+" "+o):r="M "+t+" "+n+"L "+i+" "+o+"Q "+i+" "+o+" "+i+" "+o+"L "+i+" "+o+"Q "+i+" "+o+" "+i+" "+o+"L "+i+" "+o+"Q "+i+" "+o+" "+i+" "+o+"L "+i+" "+o+"Q "+i+" "+o+" "+i+" "+o+"L "+i+" "+o,this.nodesLinksGrp.selectAll(".d3-new-connection-line").transition().duration(s).attr("d",r).on("end",(function(){e.nodesLinksGrp.selectAll(".d3-new-connection-arrow").remove(),e.nodesLinksGrp.selectAll(".d3-new-connection-guide").transition().duration(1e3).ease(gr.easeElastic).attr("x",t-a.portWidth/2).attr("y",n-a.portHeight/2).attr("cx",t).attr("cy",n).attr("transform",null),e.nodesLinksGrp.selectAll(".d3-new-connection-line").transition().duration(1e3).ease(gr.easeElastic).attr("d","M "+t+" "+n+"L "+t+" "+n).on("end",e.removeNewLink.bind(e))}))}},{key:"removeNewLink",value:function(){this.nodesLinksGrp.selectAll(".d3-new-connection-line").remove(),this.nodesLinksGrp.selectAll(".d3-new-connection-start").remove(),this.nodesLinksGrp.selectAll(".d3-new-connection-guide").remove(),this.nodesLinksGrp.selectAll(".d3-new-connection-arrow").remove()}},{key:"removeNewLinkLine",value:function(){this.nodesLinksGrp.selectAll(".d3-new-connection-line").remove()}},{key:"dragLinkHandle",value:function(e){var t=this.getTransformedMousePos(e),n=this.draggingLinkData.link;"start"===this.draggingLinkData.endBeingDragged?(n.srcPos={x_pos:t.x,y_pos:t.y},delete n.srcNodeId,delete n.srcNodePortId,delete n.srcObj):(n.trgPos={x_pos:t.x,y_pos:t.y},delete n.trgNodeId,delete n.trgNodePortId,delete n.trgNode),this.displayLinks(),this.config.enableHighlightNodeOnNewLinkDrag&&this.setNewLinkOverNode(e)}},{key:"completeDraggedLink",value:function(e){var t=this.getNewLinkOnDrag(e);t?this.canvasController.editActionHandler({editType:"updateLink",editSource:"canvas",newLink:t,pipelineId:this.pipelineId}):(this.activePipeline.replaceLink(this.draggingLinkData.oldLink),this.displayLinks()),this.config.enableHighlightNodeOnNewLinkDrag&&this.setNewLinkOverNodeCancel(),this.unsetUnavailableNodesHighlighting(),this.stopDraggingLink()}},{key:"getNewLinkOnDrag",value:function(e,t){var n=this.draggingLinkData.oldLink,i=m.cloneDeep_1(n);if("start"===this.draggingLinkData.endBeingDragged){delete i.srcNodeId,delete i.srcNodePortId,delete i.srcPos;var o=t?this.getNodeNearMousePos(e,t):this.getNodeAtMousePos(e);o?(i.srcNodeId=o.id,i.srcNodePortId=t?this.getNodePortIdNearMousePos(e,"output_type",o):this.getOutputNodePortId(e,o)):i.srcPos=this.draggingLinkData.link.srcPos}else{delete i.trgNodeId,delete i.trgNodePortId,delete i.trgPos;var a=t?this.getNodeNearMousePos(e,t):this.getNodeAtMousePos(e);a?(i.trgNodeId=a.id,i.trgNodePortId=t?this.getNodePortIdNearMousePos(e,"input_type",a):this.getInputNodePortId(e,a)):i.trgPos=this.draggingLinkData.link.trgPos}return this.config.enableLinkSelection!==l.LINK_SELECTION_DETACHABLE&&(i.srcPos||i.trgPos)?null:this.canExecuteUpdateLinkCommand(i,n)?i:null}},{key:"canExecuteUpdateLinkCommand",value:function(e,t){var n=this.activePipeline.getNode(e.srcNodeId),i=this.activePipeline.getNode(e.trgNodeId),o=this.hasLinkSrcChanged(e,t),a=this.hasLinkTrgChanged(e,t),r=this.activePipeline.links,s=!0;return o&&n&&!f.CanvasUtils.isSrcConnectionAllowedWithDetachedLinks(e.srcNodePortId,n,r)&&(s=!1),a&&i&&!f.CanvasUtils.isTrgConnectionAllowedWithDetachedLinks(e.trgNodePortId,i,r)&&(s=!1),n&&i&&!f.CanvasUtils.isConnectionAllowedWithDetachedLinks(e.srcNodePortId,e.trgNodePortId,n,i,r)&&(s=!1),s}},{key:"hasLinkSrcChanged",value:function(e,t){var n=!1;return e.srcNodeId?(e.srcNodeId!==t.srcNodeId&&(n=!0),e.srcNodePortId!==t.srcNodePortId&&(n=!0)):t.srcPos&&e.srcPos.x_pos===t.srcPos.x_pos&&e.srcPos.y_pos===t.srcPos.y_pos||(n=!0),n}},{key:"hasLinkTrgChanged",value:function(e,t){var n=!1;return e.trgNodeId?(e.trgNodeId!==t.trgNodeId&&(n=!0),e.trgNodePortId!==t.trgNodePortId&&(n=!0)):t.trgPos&&e.trgPos.x_pos===t.trgPos.x_pos&&e.trgPos.y_pos===t.trgPos.y_pos||(n=!0),n}},{key:"stopDraggingLink",value:function(){this.draggingLinkData=null}},{key:"getLinkAtMousePos",value:function(e,t){var n=this.getElementWithClassAtPosition(e,t,"d3-data-link");return this.getNodeLinkForElement(n)}},{key:"getNodeLinkForElement",value:function(e){if(e){var t=gr.select(e).datum();if(t){var n=this.activePipeline.getLink(t.id);if(n&&n.type===l.NODE_LINK)return n}}return null}},{key:"setDataLinkSelectionAreaWider",value:function(e){this.nodesLinksGrp.selectAll(".d3-data-link-selection-area").classed("d3-extra-width",e)}},{key:"getNodeAtMousePos",value:function(e){var t=this.getElementWithClassAtMousePos(e,"d3-node-group");return this.getNodeForElement(t)}},{key:"getInputNodePortId",value:function(e,t){var n=this.getInputNodePortIdAtMousePos(e);return n||(n=f.CanvasUtils.getDefaultInputPortId(t)),n}},{key:"getInputNodePortIdAtMousePos",value:function(e){var t=this.getElementWithClassAtMousePos(e,this.getNodeInputPortClassName());return this.getNodePortIdForElement(t)}},{key:"getOutputNodePortId",value:function(e,t){var n=this.getOutputNodePortIdAtMousePos(e);return n||(n=f.CanvasUtils.getDefaultOutputPortId(t)),n}},{key:"getOutputNodePortIdAtMousePos",value:function(e){var t=this.getElementWithClassAtMousePos(e,this.getNodeOutputPortClassName());return this.getNodePortIdForElement(t)}},{key:"getElementWithClassAtMousePos",value:function(e,t){var n=e.clientX?e.clientX:e.sourceEvent.clientX,i=e.clientY?e.clientY:e.sourceEvent.clientY;return this.getElementWithClassAtPosition(n,i,t)}},{key:"getElementWithClassAtPosition",value:function(e,t,n){for(var i=document.elementsFromPoint(e,t),o=null,a=0;!o&&a<i.length;)o=f.CanvasUtils.getParentElementWithClass(i[a],n),a++;return o}},{key:"getNodeForElement",value:function(e){if(e&&"g"===e.nodeName){var t=gr.select(e).datum();if(t)return this.activePipeline.getNode(t.id)}return null}},{key:"getNodePortIdForElement",value:function(e){return e?gr.select(e).attr("data-port-id"):null}},{key:"getNodeNearMousePos",value:function(e,t){var n=this,i=this.getTransformedMousePos(e),o=null,a=t||0;return this.getAllNodeGroupsSelection().each((function(e){var t=e.layout.portRadius;f.CanvasUtils.isSuperBindingNode(e)&&(t=n.canvasLayout.supernodeBindingPortRadius/n.zoomTransform.k),i.x>=e.x_pos-t-a&&i.x<=e.x_pos+e.width+t+a&&i.y>=e.y_pos-a&&i.y<=e.y_pos+e.height+a&&(o=e)})),o}},{key:"getNodePortIdNearMousePos",value:function(e,t,n){var i=this.getTransformedMousePos(e),o=null,a=null;if(n)if("output_type"===t){var r=this.getAllNodeGroupsSelection().selectChildren("."+this.getNodeOutputPortClassName()).selectChildren(".d3-node-port-output-main");o=this.searchForPortNearMouse(n,i,r,n.layout.outputPortObject,n.width),a=f.CanvasUtils.getDefaultOutputPortId(n)}else{var s=this.getAllNodeGroupsSelection().selectChildren("."+this.getNodeInputPortClassName()).selectChildren(".d3-node-port-input-main");o=this.searchForPortNearMouse(n,i,s,n.layout.inputPortObject,0),a=f.CanvasUtils.getDefaultInputPortId(n)}return o||(o=a),o}},{key:"searchForPortNearMouse",value:function(e,t,n,i,o){var a=null;return n.each((function(n,r,s){var c=gr.select(s[r]);if(i===l.PORT_OBJECT_IMAGE){var u=e.x_pos+Number(c.attr("x")),d=e.y_pos+Number(c.attr("y")),h=Number(c.attr("width")),p=Number(c.attr("height"));t.x>=u&&t.x<=u+o+h&&t.y>=d&&t.y<=d+p&&(a=s[r].getAttribute("data-port-id"))}else{var g=e.x_pos+Number(c.attr("cx")),f=e.y_pos+Number(c.attr("cy"));t.x>=g-e.layout.portRadius&&t.x<=g+e.layout.portRadius&&t.y>=f-e.layout.portRadius&&t.y<=f+e.layout.portRadius&&(a=s[r].getAttribute("data-port-id"))}})),a}},{key:"getNodeShapePathSizing",value:function(e){return this.getRectangleNodeShapePath(e,e.layout.nodeSizingArea)}},{key:"getNodeSelectionOutline",value:function(e){return e.layout.selectionPath&&!f.CanvasUtils.isExpanded(e)?e.layout.selectionPath:"port-arcs"===e.layout.nodeShape?this.getPortArcsNodeShapePath(e):this.getRectangleNodeShapePath(e,e.layout.nodeHighlightGap)}},{key:"getNodeShapePath",value:function(e){return e.layout.bodyPath&&!f.CanvasUtils.isExpanded(e)?e.layout.bodyPath:"port-arcs"===e.layout.nodeShape?this.getPortArcsNodeShapePath(e):this.getRectangleNodeShapePath(e)}},{key:"getRectangleNodeShapePath",value:function(e,t){var n=t||0,i=0-n,o=0-n,a=e.width+n,r=e.height+n,s="M "+i+" "+o+" L "+a+" "+o;return s+=" L "+a+" "+r,s+=" L "+i+" "+r,s+=" Z"}},{key:"getPortArcsNodeShapePath",value:function(e){return this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?this.getPortArcsNodeShapePathVertical(e,e.inputs,e.inputPortsWidth,e.outputs,e.outputPortsWidth):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP?this.getPortArcsNodeShapePathVertical(e,e.outputs,e.outputPortsWidth,e.inputs,e.inputPortsWidth):this.getPortArcsNodeShapePathLeftRight(e)}},{key:"getPortArcsNodeShapePathLeftRight",value:function(e){var t="M 0 0 L "+e.width+" 0 ";if(e.outputs&&e.outputs.length>0){var n=e.layout.portArcOffset;e.outputPortsHeight<e.height&&(n=e.outputs[0].cy-e.layout.portArcRadius),t+=" L "+e.width+" "+n,e.outputs.forEach((function(i,o){n+=2*e.layout.portArcRadius,t+=" A "+e.layout.portArcRadius+" "+e.layout.portArcRadius+" 180 0 1 "+e.width+" "+n,o<e.outputs.length-1&&(n+=e.layout.portArcSpacing,t+=" L "+e.width+" "+n)})),t+=" L "+e.width+" "+e.height}else t+=" L "+e.width+" "+e.height;if(t+=" L 0 "+e.height,e.inputs&&e.inputs.length>0){var i=e.height-e.layout.portArcOffset;e.inputPortsHeight<e.height&&(i=e.inputs[e.inputs.length-1].cy+e.layout.portArcRadius),t+=" L 0 "+i,e.inputs.forEach((function(n,o){i-=2*e.layout.portArcRadius,t+=" A "+e.layout.portArcRadius+" "+e.layout.portArcRadius+" 180 0 1 0 "+i,o<e.inputs.length-1&&(i-=e.layout.portArcSpacing,t+=" L 0 "+i)})),t+=" Z"}else t+=" Z";return t}},{key:"getPortArcsNodeShapePathVertical",value:function(e,t,n,i,o){var a="M 0 0 L 0 "+e.height;if(i&&i.length>0){var r=e.layout.portArcOffset;o<e.width&&(r=i[0].cx-e.layout.portArcRadius),a+=" L "+r+" "+e.height,i.forEach((function(t,n){r+=2*e.layout.portArcRadius,a+=" A "+e.layout.portArcRadius+" "+e.layout.portArcRadius+" 180 0 0 "+r+" "+e.height,n<i.length-1&&(r+=e.layout.portArcSpacing,a+=" L "+r+" "+e.height)})),a+=" L "+e.width+" "+e.height}else a+=" L "+e.width+" "+e.height;if(a+=" L "+e.width+" 0 ",t&&t.length>0){var s=e.width-e.layout.portArcOffset;n<e.width&&(s=t[t.length-1].cx+e.layout.portArcRadius),a+=" L "+s+" 0 ",t.forEach((function(n,i){s-=2*e.layout.portArcRadius,a+=" A "+e.layout.portArcRadius+" "+e.layout.portArcRadius+" 180 0 0 "+s+" 0 ",i<t.length-1&&(s-=e.layout.portArcSpacing,a+=" L "+s+" 0 ")})),a+=" Z"}else a+=" Z";return a}},{key:"setPortPositionsAllNodes",value:function(){var e=this;this.activePipeline.nodes.forEach((function(t){e.setPortPositionsForNode(t)}))}},{key:"setPortPositionsForNode",value:function(e){this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?(this.setPortPositionsVertical(e,e.inputs,e.inputPortsWidth,e.layout.inputPortTopPosX,e.layout.inputPortTopPosY),this.setPortPositionsVertical(e,e.outputs,e.outputPortsWidth,e.layout.outputPortBottomPosX,this.getOutputPortBottomPosY(e))):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP?(this.setPortPositionsVertical(e,e.inputs,e.inputPortsWidth,e.layout.inputPortBottomPosX,this.getInputPortBottomPosY(e)),this.setPortPositionsVertical(e,e.outputs,e.outputPortsWidth,e.layout.outputPortTopPosX,e.layout.outputPortTopPosY)):(this.setPortPositionsLeftRight(e,e.inputs,e.inputPortsHeight,e.layout.inputPortLeftPosX,e.layout.inputPortLeftPosY),this.setPortPositionsLeftRight(e,e.outputs,e.outputPortsHeight,this.nodeUtils.getNodeOutputPortRightPosX(e),this.nodeUtils.getNodeOutputPortRightPosY(e),this.config.enableSingleOutputPortDisplay))}},{key:"getOutputPortBottomPosY",value:function(e){return e.height+e.layout.outputPortBottomPosY}},{key:"getInputPortBottomPosY",value:function(e){return e.height+e.layout.inputPortBottomPosY}},{key:"setPortPositionsVertical",value:function(e,t,n,i,o){if(t&&t.length>0)if(e.width<=e.layout.defaultNodeWidth&&1===t.length)t[0].cx=i,t[0].cy=o;else{var a=0;if(f.CanvasUtils.isExpandedSupernode(e)){var r=e.width-2*this.canvasLayout.supernodeSVGAreaPadding-n;a=2*this.canvasLayout.supernodeSVGAreaPadding+r/2}else n<e.width&&(a=(e.width-n)/2);a+=e.layout.portArcOffset;var s=1;f.CanvasUtils.isSuperBindingNode(e)&&(s=1/this.zoomTransform.k),t.forEach((function(t){a+=e.layout.portArcRadius*s,t.cx=a,t.cy=o,a+=(e.layout.portArcRadius+e.layout.portArcSpacing)*s}))}}},{key:"setPortPositionsLeftRight",value:function(e,t,n,i,o){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];t&&t.length>0&&(e.height<=e.layout.defaultNodeHeight&&1===t.length?(t[0].cx=i,t[0].cy=o):a?this.setPortPositionsLeftRightSinglePort(e,t,i,o):this.setPortPositionsLeftRightAllPorts(e,t,n,i,o))}},{key:"setPortPositionsLeftRightAllPorts",value:function(e,t,n,i,o){var a=0;if(f.CanvasUtils.isExpandedSupernode(e)){var r=e.height-this.canvasLayout.supernodeTopAreaHeight-this.canvasLayout.supernodeSVGAreaPadding-n;a=this.canvasLayout.supernodeTopAreaHeight+this.canvasLayout.supernodeSVGAreaPadding+r/2}else n<e.height&&(a=(e.height-n)/2);a+=e.layout.portArcOffset;var s=1;f.CanvasUtils.isSuperBindingNode(e)&&(s=1/this.zoomTransform.k),t.forEach((function(t){a+=e.layout.portArcRadius*s,t.cx=i,t.cy=a,a+=(e.layout.portArcRadius+e.layout.portArcSpacing)*s}))}},{key:"setPortPositionsLeftRightSinglePort",value:function(e,t,n,i){var o=0;if(f.CanvasUtils.isExpandedSupernode(e)){var a=e.height-this.canvasLayout.supernodeTopAreaHeight-this.canvasLayout.supernodeSVGAreaPadding;o=this.canvasLayout.supernodeTopAreaHeight+a/2}else o=i;t.forEach((function(e){e.cx=n,e.cy=o}))}},{key:"displayComments",value:function(){this.logger.logStartTimer("displayComments "+this.getFlags()),!this.dragging||this.commentSizing||this.nodeSizing||this.isCommentBeingUpdated?this.selecting||this.regionSelect?this.displayCommentsSelectionStatus():this.displayAllComments():this.displayMovedComments(),this.logger.logEndTimer("displayComments "+this.getFlags())}},{key:"displayMovedComments",value:function(){var e=this;this.getAllCommentGroupsSelection().attr("transform",(function(e){return"translate(".concat(e.x_pos,", ").concat(e.y_pos,")")})).datum((function(t){return e.activePipeline.getComment(t.id)}))}},{key:"displayCommentsSelectionStatus",value:function(){var e=this;this.getAllCommentGroupsSelection().selectChildren(".d3-comment-selection-highlight").attr("data-selected",(function(t){return e.objectModel.isSelected(t.id,e.activePipeline.id)?"yes":"no"})),this.superRenderers.forEach((function(e){e.selecting=!0,e.displayComments(),e.selecting=!1}))}},{key:"displayAllComments",value:function(){var e=this;this.getAllCommentGroupsSelection().data(this.activePipeline.comments,(function(e){return e.id})).join((function(t){return e.createComments(t)})).attr("transform",(function(e){return"translate(".concat(e.x_pos,", ").concat(e.y_pos,")")})).attr("class",(function(t){return e.getCommentGroupClass(t)})).call((function(t){return e.updateComments(t)}))}},{key:"createComments",value:function(e){var t=this,n=e.append("g").attr("data-id",(function(e){return t.getId("comment_grp",e.id)})).call(this.attachCommentGroupListeners.bind(this));return this.config.enableEditingActions&&n.call(this.drag),n.append("rect").attr("class","d3-comment-sizing").call(this.attachCommentSizingListeners.bind(this)),n.append("rect").attr("class","d3-comment-selection-highlight"),n.append("rect").attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})).attr("x",0).attr("y",0).attr("class","d3-comment-rect"),n.append("foreignObject").attr("class","d3-foreign-object-comment-text").attr("x",0).attr("y",0).append("xhtml:div").attr("class","d3-comment-text"),n}},{key:"updateComments",value:function(e){var t=this;e.attr("transform",(function(e){return"translate(".concat(e.x_pos,", ").concat(e.y_pos,")")})).attr("class",(function(e){return t.getCommentGroupClass(e)})),e.selectChildren(".d3-comment-sizing").datum((function(e){return t.activePipeline.getComment(e.id)})).attr("x",-this.canvasLayout.commentSizingArea).attr("y",-this.canvasLayout.commentSizingArea).attr("height",(function(e){return e.height+2*t.canvasLayout.commentSizingArea})).attr("width",(function(e){return e.width+2*t.canvasLayout.commentSizingArea})).attr("class","d3-comment-sizing"),e.selectChildren(".d3-comment-selection-highlight").datum((function(e){return t.activePipeline.getComment(e.id)})).attr("x",-this.canvasLayout.commentHighlightGap).attr("y",-this.canvasLayout.commentHighlightGap).attr("height",(function(e){return e.height+2*t.canvasLayout.commentHighlightGap})).attr("width",(function(e){return e.width+2*t.canvasLayout.commentHighlightGap})).attr("data-selected",(function(e){return t.objectModel.isSelected(e.id,t.activePipeline.id)?"yes":"no"})).attr("style",(function(e){return t.getNodeSelectionOutlineStyle(e,"default")})),e.selectChildren(".d3-comment-rect").datum((function(e){return t.activePipeline.getComment(e.id)})).attr("height",(function(e){return e.height})).attr("width",(function(e){return e.width})).attr("class","d3-comment-rect").attr("style",(function(e){return t.getCommentBodyStyle(e,"default")})),e.selectChildren(".d3-foreign-object-comment-text").datum((function(e){return t.activePipeline.getComment(e.id)})).attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})).select("div").attr("style",(function(e){return t.getNodeLabelStyle(e,"default")})).html((function(e){return t.config.enableMarkdownInComments?fr.render(e.content):_n(e.content)}))}},{key:"attachCommentGroupListeners",value:function(e){var t=this;e.on("mouseenter",(function(e,n){t.setCommentStyles(n,"hover",gr.select(e.currentTarget)),t.config.enableEditingActions&&n.id!==t.svgCanvasTextArea.getEditingTextId()&&t.createCommentPort(e.currentTarget,n)})).on("mouseleave",(function(e,n){t.setCommentStyles(n,"default",gr.select(e.currentTarget)),t.config.enableEditingActions&&t.deleteCommentPort(e.currentTarget)})).on("mousedown",(function(e,n){t.logger.log("Comment Group - mouse down"),t.config.enableDragWithoutSelect||t.selectObjectD3Event(e,n),t.logger.log("Comment Group - finished mouse down")})).on("click",(function(e,n){t.logger.log("Comment Group - click"),e.stopPropagation()})).on("dblclick",(function(e,n){t.logger.log("Comment Group - double click"),t.config.enableEditingActions&&(f.CanvasUtils.stopPropagationAndPreventDefault(e),t.deleteCommentPort(e.currentTarget),t.displayCommentTextArea(n,e.currentTarget),t.canvasController.clickActionHandler({clickType:"DOUBLE_CLICK",objectType:"comment",id:n.id,selectedObjectIds:t.objectModel.getSelectedObjectIds(),pipelineId:t.activePipeline.id}))})).on("contextmenu",(function(e,n){t.logger.log("Comment Group - context menu"),t.config.enableDragWithoutSelect&&t.selectObjectD3Event(e,n),t.openContextMenu(e,"comment",n)}))}},{key:"attachCommentSizingListeners",value:function(e){var t=this;e.on("mousedown",(function(e,n){t.commentSizing=!0,t.addTempCursorOverlay(t.commentSizingCursor)})).on("mousemove mouseenter",(function(e,n){if(t.config.enableEditingActions&&!t.isRegionSelectOrSizingInProgress()){var i="pointer";t.isPointerCloseToBodyEdge(e,n)||(t.commentSizingDirection=t.getSizingDirection(e,n,t.canvasLayout.commentCornerResizeArea),t.commentSizingCursor=t.getCursorBasedOnDirection(t.commentSizingDirection),i=t.commentSizingCursor),gr.select(e.currentTarget).style("cursor",i)}}))}},{key:"createCommentPort",value:function(e,t){var n=this;gr.select(e).append("circle").attr("cx",(function(e){return e.width/2})).attr("cy",(function(e){return e.height+n.canvasLayout.commentHighlightGap})).attr("r",this.canvasLayout.commentPortRadius).attr("class","d3-comment-port-circle").on("mousedown",(function(e,i){f.CanvasUtils.stopPropagationAndPreventDefault(e),n.drawingNewLinkData={srcObjId:t.id,action:l.COMMENT_LINK,startPos:{x:t.x_pos-n.canvasLayout.commentHighlightGap,y:t.y_pos-n.canvasLayout.commentHighlightGap},linkArray:[]},n.drawNewLink(e)}))}},{key:"deleteCommentPort",value:function(e){gr.select(e).selectChildren(".d3-comment-port-circle").remove()}},{key:"setCommentStyles",value:function(e,t,n){this.setCommentSelectionOutlineStyles(e,t,n),this.setCommentBodyStyles(e,t,n),this.setCommentTextStyles(e,t,n)}},{key:"setCommentSelectionOutlineStyles",value:function(e,t,n){var i=this.getCommentSelectionOutlineStyle(e,t);n.selectChildren(".d3-comment-selection-highlight").attr("style",i)}},{key:"setCommentBodyStyles",value:function(e,t,n){var i=this.getCommentBodyStyle(e,t);n.selectChildren(".d3-comment-rect").attr("style",i)}},{key:"setCommentTextStyles",value:function(e,t,n){var i=this.getCommentTextStyle(e,t);n.selectChildren(".d3-foreign-object-comment-text").select("div").attr("style",i)}},{key:"getCommentSelectionOutlineStyle",value:function(e,t){return f.CanvasUtils.getObjectStyle(e,"selection_outline",t)}},{key:"getCommentBodyStyle",value:function(e,t){return f.CanvasUtils.getObjectStyle(e,"body",t)}},{key:"getCommentTextStyle",value:function(e,t){return f.CanvasUtils.getObjectStyle(e,"text",t)}},{key:"displayCommentTextArea",value:function(e,t){this.svgCanvasTextArea.displayCommentTextArea(e,t)}},{key:"displayNodeLabelTextArea",value:function(e,t){this.svgCanvasTextArea.displayNodeLabelTextArea(e,t)}},{key:"displayDecLabelTextArea",value:function(e,t,n,i){this.svgCanvasTextArea.displayDecLabelTextArea(e,t,n,i)}},{key:"addTempCursorOverlay",value:function(e){this.dispUtils.isDisplayingFullPage()&&(this.canvasDiv.selectAll(".d3-temp-cursor-overlay").size()>0&&this.removeTempCursorOverlay(),this.canvasSVG.append("rect").attr("x",0).attr("y",0).attr("width","100%").attr("height","100%").attr("data-pipeline-id",this.activePipeline.id).attr("class","d3-temp-cursor-overlay").attr("pointer-events","all").style("cursor",e))}},{key:"removeTempCursorOverlay",value:function(){this.dispUtils.isDisplayingFullPage()&&this.canvasDiv.selectAll(".d3-temp-cursor-overlay").remove()}},{key:"isRegionSelectOrSizingInProgress",value:function(){return!!(this.regionSelect||this.nodeSizing||this.commentSizing)||!(!this.supernodeInfo.renderer||!this.supernodeInfo.renderer.isRegionSelectOrSizingInProgress())}},{key:"isPointerCloseToBodyEdge",value:function(e,t){var n=this.getTransformedMousePos(e),i=t.x_pos+t.width,o=t.y_pos+t.height,a=n.x>=i&&n.x<=i+1&&n.y>=0&&n.y<=o,r=n.y>=o&&n.y<=o+1&&n.x>=0&&n.x<=i;return a||r}},{key:"getSizingDirection",value:function(e,t,n){var i="",o="",a=this.getTransformedMousePos(e);return a.x<t.x_pos+n?i="w":a.x>t.x_pos+t.width-n&&(i="e"),a.y<t.y_pos+n?o="n":a.y>t.y_pos+t.height-n&&(o="s"),o+i}},{key:"getCursorBasedOnDirection",value:function(e){var t;switch(e){case"n":case"s":t="ns-resize";break;case"e":case"w":t="ew-resize";break;case"nw":case"se":t="nwse-resize";break;case"ne":case"sw":t="nesw-resize";break;default:t=""}return t}},{key:"getMinHeight",value:function(e){if(f.CanvasUtils.isSupernode(e)){var t=Math.max(e.inputPortsHeight,e.outputPortsHeight)+this.canvasLayout.supernodeTopAreaHeight+this.canvasLayout.supernodeSVGAreaPadding;return Math.max(this.canvasLayout.supernodeMinHeight,t)}return e.layout.defaultNodeHeight}},{key:"getMinWidth",value:function(e){return f.CanvasUtils.isSupernode(e)?this.canvasLayout.supernodeMinWidth:e.layout.defaultNodeWidth}},{key:"resizeNode",value:function(e,t){var n=this.activePipeline.getNode(t.id),i=Object.assign({},n),o=this.getMinHeight(n),a=this.getMinWidth(n),r=this.resizeObject(e,n,this.nodeSizingDirection,a,o);if(r&&(0!==r.x_pos||0!==r.y_pos||0!==r.width||0!==r.height)){if(f.CanvasUtils.isSupernode(n)&&this.config.enableMoveNodesOnSupernodeResize){var s=f.CanvasUtils.moveSurroundingObjects(i,this.activePipeline.getNodesAndComments(),this.nodeSizingDirection,n.width,n.height,!0),l=f.CanvasUtils.moveSurroundingDetachedLinks(i,this.activePipeline.links,this.nodeSizingDirection,n.width,n.height,!0);this.nodeSizingObjectsInfo=Object.assign(this.nodeSizingObjectsInfo,s),this.nodeSizingDetLinksInfo=Object.assign(this.nodeSizingDetLinksInfo,l)}this.displayComments(),this.displayNodes(),this.displayLinks(),f.CanvasUtils.isSupernode(n)&&(this.dispUtils.isDisplayingSubFlow()&&this.displayBindingNodesToFitSVG(),this.superRenderers.forEach((function(e){return e.displaySVGToFitSupernode()})))}}},{key:"resizeComment",value:function(e,t){var n=this.activePipeline.getComment(t.id);this.resizeObject(e,n,this.commentSizingDirection,20,20),this.displayComments(),this.displayLinks()}},{key:"resizeObject",value:function(e,t,n,i,o){var a=0,r=0,s=0,c=0;n.indexOf("e")>-1&&(s+=e.dx),n.indexOf("s")>-1&&(c+=e.dy),n.indexOf("n")>-1&&(r+=e.dy,c-=e.dy),n.indexOf("w")>-1&&(a+=e.dx,s-=e.dx);var u=0,d=0,h=0,p=0;if(this.config.enableSnapToGridType===l.SNAP_TO_GRID_DURING?(this.notSnappedXPos+=a,this.notSnappedYPos+=r,this.notSnappedWidth+=s,this.notSnappedHeight+=c,u=f.CanvasUtils.snapToGrid(this.notSnappedXPos,this.canvasLayout.snapToGridXPx),d=f.CanvasUtils.snapToGrid(this.notSnappedYPos,this.canvasLayout.snapToGridYPx),h=f.CanvasUtils.snapToGrid(this.notSnappedWidth,this.canvasLayout.snapToGridXPx),p=f.CanvasUtils.snapToGrid(this.notSnappedHeight,this.canvasLayout.snapToGridYPx)):(u=t.x_pos+a,d=t.y_pos+r,h=t.width+s,p=t.height+c),h<i||p<o)return null;var g={width:h-t.width,height:p-t.height,x_pos:u-t.x_pos,y_pos:d-t.y_pos};return t.x_pos=u,t.y_pos=d,t.width=h,t.height=p,g}},{key:"endNodeSizing",value:function(e){var t=this.activePipeline.getNode(e.id);this.config.enableSnapToGridType===l.SNAP_TO_GRID_AFTER&&(t=this.snapToGridObject(t)),this.resizeObjInitialInfo.x_pos===t.x_pos&&this.resizeObjInitialInfo.y_pos===t.y_pos&&this.resizeObjInitialInfo.width===t.width&&this.resizeObjInitialInfo.height===t.height||(this.nodeSizingObjectsInfo[t.id]={width:t.width,height:t.height,x_pos:t.x_pos,y_pos:t.y_pos},(t.height>t.layout.defaultNodeHeight+2||t.width>t.layout.defaultNodeWidth+2)&&(this.nodeSizingObjectsInfo[t.id].isResized=!0,this.nodeSizingObjectsInfo[t.id].resizeWidth=t.width,this.nodeSizingObjectsInfo[t.id].resizeHeight=t.height),this.canvasController.editActionHandler({editType:"resizeObjects",editSource:"canvas",objectsInfo:this.nodeSizingObjectsInfo,detachedLinksInfo:this.nodeSizingDetLinksInfo,pipelineId:this.pipelineId})),this.nodeSizing=!1,this.nodeSizingObjectsInfo={},this.nodeSizingDetLinksInfo={}}},{key:"endCommentSizing",value:function(e){var t=this.activePipeline.getComment(e.id);if(this.config.enableSnapToGridType===l.SNAP_TO_GRID_AFTER&&(t=this.snapToGridObject(t)),this.resizeObjInitialInfo.x_pos!==t.x_pos||this.resizeObjInitialInfo.y_pos!==t.y_pos||this.resizeObjInitialInfo.width!==t.width||this.resizeObjInitialInfo.height!==t.height){var n=[];n[t.id]={width:t.width,height:t.height,x_pos:t.x_pos,y_pos:t.y_pos};var i={editType:"resizeObjects",editSource:"canvas",objectsInfo:n,detachedLinksInfo:{},pipelineId:this.pipelineId};this.canvasController.editActionHandler(i)}this.commentSizing=!1}},{key:"displayLinks",value:function(){this.logger.logStartTimer("displayLinks "+this.getFlags()),this.selecting||this.regionSelect?this.displayLinksSelectionStatus():this.displayAllLinks(),this.logger.logEndTimer("displayLinks "+this.getFlags())}},{key:"displayLinksSelectionStatus",value:function(){var e=this;this.config.enableLinkSelection!==l.LINK_SELECTION_NONE&&(this.getAllLinkGroupsSelection().attr("data-selected",(function(t){return!!e.objectModel.isSelected(t.id,e.activePipeline.id)||null})),this.superRenderers.forEach((function(e){e.selecting=!0,e.displayLinks(),e.selecting=!1})))}},{key:"displayAllLinks",value:function(){var e=this,t=this.buildLinksArray();this.getAllLinkGroupsSelection().data(t,(function(e){return e.id})).join((function(t){return e.createLinks(t)})).attr("class",(function(t){return e.getLinkGroupClass(t)})).attr("style",(function(t){return e.getLinkGrpStyle(t)})).attr("data-selected",(function(t){return!!e.objectModel.isSelected(t.id,e.activePipeline.id)||null})).call((function(n){e.updateLinks(n,t)}))}},{key:"createLinks",value:function(e){var t=this,n=e.append("g").attr("data-id",(function(e){return t.getId("link_grp",e.id)})).call(this.attachLinkGroupListeners.bind(this));return n.append("path").attr("class",(function(e){return t.getLinkSelectionAreaClass(e)})),n.append("path").attr("class","d3-link-line"),n.filter((function(e){return e.type===l.NODE_LINK&&t.canvasLayout.dataLinkArrowHead||e.type===l.COMMENT_LINK&&t.canvasLayout.commentLinkArrowHead||e.type===l.NODE_LINK&&t.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT})).append("path").attr("class","d3-link-line-arrow-head"),n.append("g").attr("class","d3-link-decorations-group"),this.config.enableLinkSelection!==l.LINK_SELECTION_HANDLES&&this.config.enableLinkSelection!==l.LINK_SELECTION_DETACHABLE||n.append("g").attr("class","d3-link-handles-group").each((function(e,n,i){e.type===l.NODE_LINK&&t.createNewHandles(gr.select(i[n]))})),n}},{key:"updateLinks",value:function(e,t){var n=this;e.selectAll(".d3-link-selection-area").datum((function(e){return n.activePipeline.getLink(e.id)})).attr("d",(function(e){return e.pathInfo.path})),e.selectAll(".d3-link-line").datum((function(e){return n.activePipeline.getLink(e.id)})).attr("d",(function(e){return e.pathInfo.path})).attr("class","d3-link-line").attr("style",(function(e){return f.CanvasUtils.getObjectStyle(e,"line","default")})),e.filter((function(e){return e.type===l.NODE_LINK&&n.canvasLayout.dataLinkArrowHead||e.type===l.COMMENT_LINK&&n.canvasLayout.commentLinkArrowHead||e.type===l.NODE_LINK&&n.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT})).selectAll(".d3-link-line-arrow-head").datum((function(e){return n.activePipeline.getLink(e.id)})).attr("d",(function(e){return n.getArrowHead(e)})).attr("transform",(function(e){return n.getArrowHeadTransform(e)})).attr("class","d3-link-line-arrow-head").attr("style",(function(e){return f.CanvasUtils.getObjectStyle(e,"line","default")})),e.each((function(e,t,i){e.type!==l.NODE_LINK&&e.type!==l.ASSOCIATION_LINK||n.displayDecorations(e,l.DEC_LINK,gr.select(i[t]).selectAll(".d3-link-decorations-group"),e.decorations)})),this.config.enableLinkSelection!==l.LINK_SELECTION_HANDLES&&this.config.enableLinkSelection!==l.LINK_SELECTION_DETACHABLE||e.each((function(e,i,o){e.type===l.NODE_LINK&&n.updateHandles(gr.select(o[i]).selectAll(".d3-link-handles-group"),t)})),this.dragging||this.setDisplayOrder(e)}},{key:"attachLinkGroupListeners",value:function(e){var t=this;e.on("mousedown",(function(e,n,i,o){t.logger.log("Link Group - mouse down"),t.config.enableLinkSelection!==l.LINK_SELECTION_NONE&&t.selectObjectD3Event(e,n),e.stopPropagation()})).on("mouseup",(function(){t.logger.log("Link Group - mouse up")})).on("click",(function(e,n){t.logger.log("Link Group - click"),e.stopPropagation()})).on("contextmenu",(function(e,n){t.logger.log("Link Group - context menu"),t.config.enableLinkSelection!==l.LINK_SELECTION_NONE&&t.selectObjectD3Event(e,n),t.openContextMenu(e,"link",n)})).on("mouseenter",(function(e,n){var i=e.currentTarget;t.config.enableLinkSelection!==l.LINK_SELECTION_HANDLES&&t.config.enableLinkSelection!==l.LINK_SELECTION_DETACHABLE||t.raiseLinkToTop(i),t.setLinkLineStyles(i,n,"hover"),t.canOpenTip(l.TIP_TYPE_LINK)&&!t.draggingLinkData&&t.canvasController.openTip({id:t.getId("link_tip",n.id),type:l.TIP_TYPE_LINK,targetObj:i,mousePos:{x:e.clientX,y:e.clientY},pipelineId:t.activePipeline.id,link:n})})).on("mouseleave",(function(e,n){var i=e.currentTarget;i.getAttribute("data-selected")||t.lowerLinkToBottom(i),t.setLinkLineStyles(i,n,"default"),t.canvasController.closeTip()}))}},{key:"createNewHandles",value:function(e){var t=this,n=e.append(this.canvasLayout.linkStartHandleObject).attr("class",(function(e){return"d3-link-handle-start"})).on("mousedown",(function(e,n){t.logger.log("Link start handle - mouse down"),t.config.enableDragWithoutSelect||t.selectObjectD3Event(e,n),t.logger.log("Link end handle - finished mouse down")}));this.config.enableEditingActions&&n.call(this.dragSelectionHandle);var i=e.append(this.canvasLayout.linkEndHandleObject).attr("class",(function(e){return"d3-link-handle-end"})).on("mousedown",(function(e,n){t.logger.log("Link end handle - mouse down"),t.config.enableDragWithoutSelect||t.selectObjectD3Event(e,n),t.logger.log("Link end handle - finished mouse down")}));this.config.enableEditingActions&&i.call(this.dragSelectionHandle)}},{key:"updateHandles",value:function(e,t){var n=this;e.selectAll(".d3-link-handle-start").datum((function(e){return n.activePipeline.getLink(e.id)})).each((function(e,t,i){var o=gr.select(i[t]);"image"===n.canvasLayout.linkStartHandleObject?o.attr("xlink:href",n.canvasLayout.linkStartHandleImage).attr("x",(function(e){return e.x1-n.canvasLayout.linkStartHandleWidth/2})).attr("y",(function(e){return e.y1-n.canvasLayout.linkStartHandleHeight/2})).attr("width",n.canvasLayout.linkStartHandleWidth).attr("height",n.canvasLayout.linkStartHandleHeight):"circle"===n.canvasLayout.linkStartHandleObject&&o.attr("r",n.canvasLayout.linkStartHandleRadius).attr("cx",(function(e){return e.x1})).attr("cy",(function(e){return e.y1}))})),e.selectAll(".d3-link-handle-end").datum((function(e){return n.activePipeline.getLink(e.id)})).each((function(e,t,i){var o=gr.select(i[t]);"image"===n.canvasLayout.linkEndHandleObject?o.attr("xlink:href",n.canvasLayout.linkEndHandleImage).attr("x",(function(e){return e.x2-n.canvasLayout.linkEndHandleWidth/2})).attr("y",(function(e){return e.y2-n.canvasLayout.linkEndHandleHeight/2})).attr("width",n.canvasLayout.linkEndHandleWidth).attr("height",n.canvasLayout.linkEndHandleHeight).attr("transform",(function(e){return n.getLinkImageTransform(e)})):"circle"===n.canvasLayout.linkEndHandleObject&&o.attr("r",n.canvasLayout.linkEndHandleRadius).attr("cx",(function(e){return e.x2})).attr("cy",(function(e){return e.y2}))}))}},{key:"setLinkLineStyles",value:function(e,t,n){var i=f.CanvasUtils.getObjectStyle(t,"line",n),o=gr.select(e);o.select(".d3-link-line").attr("style",i),o.select(".d3-link-line-arrow-head").attr("style",i)}},{key:"getLinkSelectionAreaClass",value:function(e){return"d3-link-selection-area "+(e.type===l.ASSOCIATION_LINK?"d3-association-link-selection-area":e.type===l.COMMENT_LINK?"d3-comment-link-selection-area":"d3-data-link-selection-area")}},{key:"getLinkGroupClass",value:function(e){return"d3-link-group "+this.getLinkTypeClass(e)+" "+this.getLinkCustomClass(e)}},{key:"getLinkCustomClass",value:function(e){return e.class_name&&"canvas-data-link"!==e.class_name&&"canvas-object-link"!==e.class_name&&"canvas-comment-link"!==e.class_name&&"d3-data-link"!==e.class_name&&"d3-association-link"!==e.class_name&&"d3-object-link"!==e.class_name&&"d3-comment-link"!==e.class_name?e.class_name:""}},{key:"getLinkTypeClass",value:function(e){return e.type===l.ASSOCIATION_LINK?this.config.enableAssocLinkType===l.ASSOC_RIGHT_SIDE_CURVE?"d3-association-link":"d3-object-link":e.type===l.COMMENT_LINK?"d3-comment-link":"d3-data-link"}},{key:"getCommentGroupClass",value:function(e){var t="";return e.class_name&&"canvas-comment"!==e.class_name&&"d3-comment-rect"!==e.class_name&&(t=" "+e.class_name),"d3-comment-group"+(this.config.enableEditingActions?" d3-draggable":" d3-non-draggable")+t}},{key:"getNodeGroupClass",value:function(e){var t="";e.class_name&&"canvas-node"!==e.class_name&&"d3-node-body"!==e.class_name&&"d3-node-body-outline"!==e.class_name&&(t=" "+e.class_name);var n=f.CanvasUtils.isExpandedSupernode(e)?" d3-node-supernode-expanded":"",i=this.config.enableEditingActions?" d3-draggable":" d3-non-draggable";return"d3-node-group"+n+(e.isResized?" d3-resized":"")+i+t}},{key:"setDisplayOrder",value:function(e){var t=this;e.filter((function(e){return t.hasOneDecorationOrMore(e)})).lower(),e.filter((function(e){return!t.hasOneDecorationOrMore(e)})).lower(),this.config.enableLinkSelection!==l.LINK_SELECTION_HANDLES&&this.config.enableLinkSelection!==l.LINK_SELECTION_DETACHABLE||this.raiseSelectedLinksToTop()}},{key:"raiseNodeToTop",value:function(e){null!==this.drawingNewLinkData||this.dragging||0!==this.getSelectedLinks().length||e.raise()}},{key:"raiseSelectedLinksToTop",value:function(){this.nodesLinksGrp.selectAll(".d3-link-group[data-selected]").raise()}},{key:"raiseLinkToTop",value:function(e){gr.select(e).raise()}},{key:"lowerLinkToBottom",value:function(e){gr.select(e).lower()}},{key:"hasOneDecorationOrMore",value:function(e){return e.decorations&&e.decorations.length>0}},{key:"isLinkBeingDragged",value:function(e){return this.draggingLinkData&&this.draggingLinkData.link.id===e.id}},{key:"buildLinksArray",value:function(){var e=this,t=[];return this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT&&this.updateLinksForNodes(),this.activePipeline.links.forEach((function(n){var i=null;(i=!(e.config.enableLinkSelection===l.LINK_SELECTION_HANDLES&&e.isLinkBeingDragged(n)||e.config.enableLinkSelection===l.LINK_SELECTION_DETACHABLE)||n.srcObj&&n.trgNode?e.getAttachedLineObj(n):e.getDetachedLineObj(n))&&t.push(i)})),this.canvasLayout.linkType===l.LINK_TYPE_ELBOW&&(t=this.addMinInitialLineForElbow(t)),t=this.linkUtils.addConnectionPaths(t)}},{key:"getAttachedLineObj",value:function(e){var t=e.srcObj,n=e.trgNode;if(t||this.logger.error("Common Canvas error trying to draw a link. A link was specified for source ID '"+e.srcNodeId+"' in the Canvas data that does not have a valid source node/comment."),n||this.logger.error("Common Canvas error trying to draw a link. A link was specified for target ID '"+e.trgNodeId+"' in the Canvas data that does not have a valid target node."),t&&n&&this.shouldDisplayLink(t,n,e.type)){var i=this.getSourcePortId(e,t),o=this.getTargetPortId(e,n),a=e.type===l.ASSOCIATION_LINK&&this.config.enableAssocLinkType===l.ASSOC_RIGHT_SIDE_CURVE?this.getAssocLinkVariation(t,n):null,r=this.linkUtils.getLinkCoords(e,t,i,n,o,a);return e.assocLinkVariation=a,e.srcPortId=i,e.trgPortId=o,e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.originX=r.originX,e.originY=r.originY,e}return null}},{key:"getDetachedLineObj",value:function(e){var t=e.srcObj,n=e.trgNode,i=null,o=null,a={};if(t)if(this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT){var r={x:e.trgPos.x_pos,y:e.trgPos.y_pos},s=this.linkUtils.getNewStraightNodeLinkStartPos(t,r,e.srcOriginInfo);a.x1=s.x,a.y1=s.y,a.originX=s.originX,a.originY=s.originY}else{i=this.getSourcePortId(e,t);var c=this.getOutputPort(t,i);c&&(a.x1=t.x_pos+c.cx,a.y1=t.y_pos+c.cy)}else a.x1=e.srcPos.x_pos,a.y1=e.srcPos.y_pos;if(n)if(this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT){var u={x:e.srcPos.x_pos,y:e.srcPos.y_pos},d=this.linkUtils.getNewStraightNodeLinkStartPos(n,u,e.trgOriginInfo);a.x2=d.x,a.y2=d.y}else{o=this.getTargetPortId(e,n);var h=this.getInputPort(n,o);h&&(a.x2=n.x_pos+h.cx,a.y2=n.y_pos+h.cy)}else a.x2=e.trgPos.x_pos,a.y2=e.trgPos.y_pos;return e.srcPortId=i,e.trgPortId=o,e.x1=a.x1,e.y1=a.y1,e.x2=a.x2,e.y2=a.y2,e.originX=a.originX,e.originY=a.originY,e}},{key:"getOutputPort",value:function(e,t){return e&&e.outputs?e.outputs.find((function(e){return e.id===t})):null}},{key:"getInputPort",value:function(e,t){return e&&e.inputs?e.inputs.find((function(e){return e.id===t})):null}},{key:"getSourcePortId",value:function(e,t){return e.srcNodePortId?e.srcNodePortId:t.outputs&&t.outputs.length>0?t.outputs[0].id:null}},{key:"getTargetPortId",value:function(e,t){return e.trgNodePortId?e.trgNodePortId:t.inputs&&t.inputs.length>0?t.inputs[0].id:null}},{key:"shouldDisplayLink",value:function(e,t,n){return!1!==this.canvasLayout.displayLinkOnOverlap||!this.areLinkedObjectsOverlapping(e,t,n)}},{key:"areLinkedObjectsOverlapping",value:function(e,t,n){var i=n===l.COMMENT_LINK?this.canvasLayout.commentHighlightGap:e.layout.nodeHighlightGap,o=t.layout.nodeHighlightGap,a=e.x_pos-i,r=e.x_pos+e.width+i,s=t.x_pos-o,c=t.x_pos+t.width+o,u=e.y_pos-i,d=e.y_pos+e.height+i,h=t.y_pos-o,p=t.y_pos+t.height+o;return r>=s&&c>=a&&d>=h&&p>=u}},{key:"addMinInitialLineForElbow",value:function(e){var t=this;return this.activePipeline.nodes.forEach((function(n){if(n.outputs&&n.outputs.length>1){var i=t.getNodeOutputLinks(n,e),o=t.sortNodeOutputLinks(i);t.applyMinInitialLine(n,o)}})),e}},{key:"getNodeOutputLinks",value:function(e,t){var n=[];return t.forEach((function(t){t.srcObj&&t.srcObj.id===e.id&&n.push(t)})),n}},{key:"sortNodeOutputLinks",value:function(e){var t=this;return e.sort((function(e,n){var i,o;return t.canvasLayout.linkDirection===l.LINK_DIR_LEFT_RIGHT?(i=Math.abs(e.y1-e.y2),o=Math.abs(n.y1-n.y2)):(i=Math.abs(e.x1-e.x2),o=Math.abs(n.x1-n.x2)),i===o?t.canvasLayout.linkDirection===l.LINK_DIR_LEFT_RIGHT?e.y1<e.y2?1:-1:e.x1<e.x2?1:-1:i<o?1:-1}))}},{key:"applyMinInitialLine",value:function(e,t){var n=e.layout.minInitialLine;t.forEach((function(e){e.minInitialLineForElbow=n,n+=e.srcObj.layout.minInitialLineIncrement}))}},{key:"updateLinksForNodes",value:function(){var e=this;this.activePipeline.nodes.forEach((function(t){return e.updateLinksForNode(t)}))}},{key:"updateLinksForNode",value:function(e){var t=this,n={n:[],s:[],e:[],w:[]};this.activePipeline.links.forEach((function(i){if(i.type===l.NODE_LINK)if(i.trgNode&&i.trgNode.id===e.id){if(i.srcObj){var o=t.getDirAdjusted(i.trgNode,i.srcObj);n[o].push({type:"in",endNode:i.srcObj,link:i})}else if(i.srcPos){var a=t.getDirToEndPos(i.trgNode,i.srcPos.x_pos,i.srcPos.y_pos);n[a].push({type:"in",x:i.srcPos.x_pos,y:i.srcPos.y_pos,link:i})}}else if(i.srcObj&&i.srcObj.id===e.id)if(i.trgNode){var r=t.getDirAdjusted(i.srcObj,i.trgNode);n[r].push({type:"out",endNode:i.trgNode,link:i})}else if(i.trgPos){var s=t.getDirToEndPos(i.srcObj,i.trgPos.x_pos,i.trgPos.y_pos);n[s].push({type:"out",x:i.trgPos.x_pos,y:i.trgPos.y_pos,link:i})}})),n.n=this.sortLinksInfo(n.n,l.NORTH),n.s=this.sortLinksInfo(n.s,l.SOUTH),n.e=this.sortLinksInfo(n.e,l.EAST),n.w=this.sortLinksInfo(n.w,l.WEST),this.updateLinksInfo(n.n,l.NORTH),this.updateLinksInfo(n.s,l.SOUTH),this.updateLinksInfo(n.e,l.EAST),this.updateLinksInfo(n.w,l.WEST)}},{key:"getDirAdjusted",value:function(e,t){var n=this.getDirToNode(e,t);if(n===l.SOUTH)this.getDirToNode(t,e)===l.WEST&&(n=l.EAST);else if(n===l.NORTH){this.getDirToNode(t,e)===l.EAST&&(n=l.WEST)}return n}},{key:"getDirToNode",value:function(e,t){var n=this.nodeUtils.getNodeCenterPosX(t),i=this.nodeUtils.getNodeCenterPosY(t);return this.getDirToEndPos(e,n,i)}},{key:"getDirToEndPos",value:function(e,t,n){var i=this.nodeUtils.getNodeCenterPosX(e),o=this.nodeUtils.getNodeCenterPosY(e),a=e.x_pos,r=e.y_pos,s=e.width,l=e.height;return f.CanvasUtils.getDir(a,r,s,l,i,o,t,n)}},{key:"sortLinksInfo",value:function(e,t){var n=this,i=e;if(i.length>1){var o=this.getLinkInfoGroups(i);Cn(o,(function(e){e.forEach((function(i,o){var a=i.endNode,r=e.length+1;t===l.NORTH||t===l.SOUTH?(i.x=a.x_pos+a.width/r*(o+1),i.y=n.nodeUtils.getNodeCenterPosY(a)):(i.x=n.nodeUtils.getNodeCenterPosX(a),i.y=a.y_pos+a.height/r*(o+1))}))})),i=t===l.NORTH||t===l.SOUTH?i.sort((function(e,t){return e.x>t.x?1:-1})):i.sort((function(e,t){return e.y>t.y?1:-1}))}return i}},{key:"getLinkInfoGroups",value:function(e){var t={};return e.forEach((function(e){e.endNode&&(t[e.endNode.id]||(t[e.endNode.id]=[]),t[e.endNode.id].push(e))})),t}},{key:"updateLinksInfo",value:function(e,t){e.forEach((function(n,i){"out"===n.type?n.link.srcOriginInfo={dir:t,idx:i,len:e.length}:n.link.trgOriginInfo={dir:t,idx:i,len:e.length}}))}},{key:"getNewLinkAssocVariation",value:function(e,t,n){return"input"===n&&e>t?l.ASSOC_VAR_CURVE_LEFT:"output"===n&&e<t?l.ASSOC_VAR_CURVE_RIGHT:l.ASSOC_VAR_DOUBLE_BACK_RIGHT}},{key:"getAssocLinkVariation",value:function(e,t){var n=e.layout.minInitialLine;return t.x_pos>=e.x_pos+e.width+n?l.ASSOC_VAR_CURVE_RIGHT:e.x_pos>=t.x_pos+t.width+n?l.ASSOC_VAR_CURVE_LEFT:l.ASSOC_VAR_DOUBLE_BACK_RIGHT}},{key:"getPortArrowPath",value:function(e){return"M -2 3 L 2 0 -2 -3"}},{key:"getPortArrowPathTransform",value:function(e){var t=this.getAngleBasedOnLinkDirection();return"translate(".concat(e.cx,", ").concat(e.cy,") rotate(").concat(t,")")}},{key:"getArrowHead",value:function(e){return e.type===l.COMMENT_LINK?"string"==typeof this.canvasLayout.commentLinkArrowHead?this.canvasLayout.commentLinkArrowHead:"M -8 3 L 0 0 -8 -3":"string"==typeof this.canvasLayout.dataLinkArrowHead?this.canvasLayout.dataLinkArrowHead:"M -6 6 L 0 0 -6 -6"}},{key:"getArrowHeadTransform",value:function(e){var t=this.canvasLayout.linkType===l.LINK_TYPE_ELBOW?this.getAngleBasedOnLinkDirection():Math.atan2(e.y2-e.y1,e.x2-e.x1)*(180/Math.PI);return"translate(".concat(e.x2,", ").concat(e.y2,") rotate(").concat(t,")")}},{key:"getAngleBasedOnLinkDirection",value:function(){return this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?90:this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP?-90:0}},{key:"getSelectedNodesAndComments",value:function(){var e=this,t=[];return this.activePipeline.nodes.forEach((function(n){e.objectModel.getSelectedObjectIds().includes(n.id)&&t.push(n)})),this.activePipeline.comments.forEach((function(n){e.objectModel.getSelectedObjectIds().includes(n.id)&&t.push(n)})),t}},{key:"getSelectedLinks",value:function(){var e=this,t=[];return this.activePipeline.links.forEach((function(n){e.objectModel.getSelectedObjectIds().includes(n.id)&&t.push(n)})),t}},{key:"canOpenTip",value:function(e){return this.canvasController.isTipEnabled(e)&&!this.selecting&&!this.regionSelect&&!this.dragging&&!this.commentSizing&&!this.nodeSizing&&!this.drawingNewLinkData}},{key:"getDefaultCommentOffset",value:function(){var e=this.canvasLayout.addCommentOffsetX,t=this.canvasLayout.addCommentOffsetY;return this.zoomTransform&&(e=this.zoomTransform.x/this.zoomTransform.k,t=this.zoomTransform.y/this.zoomTransform.k,e=-e+this.canvasLayout.addCommentOffsetX,t=-t+this.canvasLayout.addCommentOffsetY),this.config.enableSnapToGridType===l.SNAP_TO_GRID_DURING||this.config.enableSnapToGridType===l.SNAP_TO_GRID_AFTER?this.snapToGridPosition({x:e,y:t}):{x:e,y:t}}},{key:"getFlags",value:function(){var e="Flags:";return this.dragging&&(e+=" dragging = true"),this.nodeSizing&&(e+=" nodeSizing = true"),this.commentSizing&&(e+=" commentSizing = true"),this.movingBindingNodes&&(e+=" movingBindingNodes = true"),this.selecting&&(e+=" selecting = true"),this.regionSelect&&(e+=" regionSelect = true"),"Flags:"===e&&(e+=" None"),e}}]),t}(),yr=function(){function t(n,i,o,a){e._classCallCheck(this,t),this.logger=new h.Logger(["SVGCanvasD3","FlowId",n.id]),this.logger.logStartTimer("constructor"),this.canvasController=a,this.canvasDiv=un(i),this.logger.logEndTimer("constructor",!0)}return e._createClass(t,[{key:"setCanvasInfo",value:function(e,t){if(this.logger=new h.Logger(["SVGCanvasD3","FlowId",e.id]),this.config&&this.renderer&&this.canvasInfo&&e.id===this.canvasInfo.id&&(!this.renderer||this.renderer.pipelineId===this.canvasController.getCurrentBreadcrumb().pipelineId)&&f.CanvasUtils$1.compareCanvasConfigs(this.config,t))this.logger.logStartTimer("set canvas info"),this.canvasInfo=this.cloneCanvasInfo(e),this.renderer.setCanvasInfoRenderer(this.canvasInfo),this.logger.logEndTimer("set canvas info",!0);else{this.logger.logStartTimer("initializing"),this.canvasInfo=this.cloneCanvasInfo(e),this.config=this.cloneConfig(t),this.renderer&&(this.renderer.clearCanvas(),this.renderer=null);var n=this.canvasController.getCurrentBreadcrumb();this.renderer=new vr(n.pipelineId,this.canvasDiv,this.canvasController,this.canvasInfo,t,{id:n.supernodeId,pipelineId:n.supernodeParentPipelineId}),this.logger.logEndTimer("initializing",!0)}}},{key:"cloneConfig",value:function(e){return Object.assign({},e)}},{key:"cloneCanvasInfo",value:function(e){return m.cloneDeep_1(e)}},{key:"isEditingText",value:function(){return this.renderer.isEditingText()}},{key:"isDragging",value:function(){return this.renderer.isDragging()}},{key:"convertPageCoordsToSnappedCanvasCoords",value:function(e){var t=this.renderer.convertPageCoordsToCanvasCoords(e.x,e.y);return t=this.renderer.getMousePosSnapToGrid(t)}},{key:"nodeTemplateDragStart",value:function(e){this.renderer.nodeTemplateDragStart(e)}},{key:"nodeTemplateDragOver",value:function(e,t,n){this.renderer.nodeTemplateDragOver(e,t,n)}},{key:"nodeTemplateDragEnd",value:function(e){this.renderer.nodeTemplateDragEnd(e)}},{key:"nodeTemplateDropped",value:function(e,t,n){this.renderer.nodeTemplateDropped(e,t,n)}},{key:"externalObjectDropped",value:function(e,t,n){this.renderer.externalObjectDropped(e,t,n)}},{key:"zoomTo",value:function(e){this.renderer.zoomTo(e)}},{key:"translateBy",value:function(e,t,n){this.renderer.translateBy(e,t,n)}},{key:"zoomIn",value:function(){this.renderer.zoomIn()}},{key:"zoomOut",value:function(){this.renderer.zoomOut()}},{key:"zoomToFit",value:function(){this.renderer.zoomToFit()}},{key:"isZoomedToMax",value:function(){return!!this.renderer&&this.renderer.isZoomedToMax()}},{key:"isZoomedToMin",value:function(){return!!this.renderer&&this.renderer.isZoomedToMin()}},{key:"getZoomToReveal",value:function(e,t,n){return this.renderer?this.renderer.getZoomToReveal(e,t,n):null}},{key:"getZoom",value:function(){return this.renderer?this.renderer.getZoom():null}},{key:"refreshOnSizeChange",value:function(){this.renderer&&this.renderer.refreshOnSizeChange()}},{key:"getDefaultCommentOffset",value:function(){return this.renderer.getDefaultCommentOffset()}},{key:"getTransformedViewportDimensions",value:function(){return this.renderer.getTransformedViewportDimensions()}},{key:"getGhostNode",value:function(e){return this.renderer.getGhostNode(e)}}]),t}();function mr(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Cr=function(n){t._inherits(o,n);var i=mr(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={isDropZoneDisplayed:!1},a.logger=new h.Logger("CC-Contents"),a.mainCanvasDivId="canvas-div-"+a.props.canvasController.getInstanceId(),a.svgCanvasDivId="d3-svg-canvas-div-"+a.props.canvasController.getInstanceId(),a.svgCanvasDivSelector="#"+a.svgCanvasDivId,a.dragX=null,a.dragY=null,a.eventListenersAdded=!1,a.mousePos={x:0,y:0},a.drop=a.drop.bind(t._assertThisInitialized(a)),a.focusOnCanvas=a.focusOnCanvas.bind(t._assertThisInitialized(a)),a.setIsDropZoneDisplayed=a.setIsDropZoneDisplayed.bind(t._assertThisInitialized(a)),a.dragOver=a.dragOver.bind(t._assertThisInitialized(a)),a.dragEnter=a.dragEnter.bind(t._assertThisInitialized(a)),a.dragLeave=a.dragLeave.bind(t._assertThisInitialized(a)),a.refreshOnSizeChange=a.refreshOnSizeChange.bind(t._assertThisInitialized(a)),a.getLabel=a.getLabel.bind(t._assertThisInitialized(a)),a.onCut=a.onCut.bind(t._assertThisInitialized(a)),a.onCopy=a.onCopy.bind(t._assertThisInitialized(a)),a.onPaste=a.onPaste.bind(t._assertThisInitialized(a)),a.onKeyDown=a.onKeyDown.bind(t._assertThisInitialized(a)),a.onMouseMove=a.onMouseMove.bind(t._assertThisInitialized(a)),a.first=!1,a.second=!1,a.afterUpdateCallbacks=[],n.canvasController.setCanvasContents(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"componentDidMount",value:function(){this.logger.log("componentDidMount"),this.svgCanvasD3=new yr(this.props.canvasInfo,this.svgCanvasDivSelector,this.props.canvasConfig,this.props.canvasController),this.svgCanvasD3.setCanvasInfo(this.props.canvasInfo,this.props.canvasConfig),this.props.canvasConfig.enableBrowserEditMenu&&this.addEventListeners(),this.focusOnCanvas()}},{key:"componentDidUpdate",value:function(){this.logger.log("componentDidUpdate"),this.svgCanvasD3&&!this.isDropZoneDisplayed()&&(this.svgCanvasD3.setCanvasInfo(this.props.canvasInfo,this.props.canvasConfig),this.afterUpdate()),this.props.canvasConfig.enableBrowserEditMenu?this.addEventListeners():this.removeEventListeners()}},{key:"componentWillUnmount",value:function(){this.removeEventListeners()}},{key:"onCut",value:function(e){e.currentTarget.activeElement.id===this.svgCanvasDivId&&this.props.canvasConfig.enableEditingActions&&(e.preventDefault(),this.props.canvasController.cutToClipboard())}},{key:"onCopy",value:function(e){e.currentTarget.activeElement.id===this.svgCanvasDivId&&this.props.canvasConfig.enableEditingActions&&(e.preventDefault(),this.props.canvasController.copyToClipboard())}},{key:"onPaste",value:function(e){e.currentTarget.activeElement.id===this.svgCanvasDivId&&this.props.canvasConfig.enableEditingActions&&(e.preventDefault(),this.props.canvasController.pasteFromClipboard())}},{key:"onKeyDown",value:function(e){this.props.canvasController.closeTip();var t=this.props.canvasController.getKeyboardConfig().actions;if(!this.svgCanvasD3.isEditingText()&&!this.svgCanvasD3.isDragging()){if(this.props.canvasConfig.enableEditingActions)if(8!==e.keyCode&&46!==e.keyCode||!t.delete){if(f.CanvasUtils.isCmndCtrlPressed(e)&&!e.shiftKey&&90===e.keyCode&&t.undo)f.CanvasUtils.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("undo");else if(f.CanvasUtils.isCmndCtrlPressed(e)&&(e.shiftKey&&90===e.keyCode||89===e.keyCode&&t.redo))f.CanvasUtils.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("redo");else if(f.CanvasUtils.isCmndCtrlPressed(e)&&67===e.keyCode&&t.copyToClipboard)f.CanvasUtils.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("copy");else if(f.CanvasUtils.isCmndCtrlPressed(e)&&88===e.keyCode&&t.cutToClipboard)f.CanvasUtils.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("cut");else if(f.CanvasUtils.isCmndCtrlPressed(e)&&86===e.keyCode&&t.pasteFromClipboard)if(f.CanvasUtils.stopPropagationAndPreventDefault(e),this.mousePos){var n=this.svgCanvasD3.convertPageCoordsToSnappedCanvasCoords(this.mousePos);this.props.canvasController.keyboardActionHandler("paste",n)}else this.props.canvasController.keyboardActionHandler("paste")}else f.CanvasUtils.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("deleteSelectedObjects");f.CanvasUtils.isCmndCtrlPressed(e)&&65===e.keyCode&&t.selectAll?(f.CanvasUtils.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("selectAll")):f.CanvasUtils.isCmndCtrlPressed(e)&&e.shiftKey&&e.altKey&&80===e.keyCode&&(f.CanvasUtils.stopPropagationAndPreventDefault(e),h.Logger.switchLoggingState())}}},{key:"onMouseMove",value:function(e){e.target&&e.target.className&&("svg-area"===e.target.className.baseVal||"d3-svg-background"===e.target.className.baseVal)?this.mousePos={x:e.clientX,y:e.clientY}:this.mousePos=null}},{key:"getLabel",value:function(e){return this.props.intl.formatMessage({id:e,defaultMessage:f.defaultMessages1[e]})}},{key:"getDNDJson",value:function(e){try{return JSON.parse(e.dataTransfer.getData(l.DND_DATA_TEXT))}catch(e){return this.logger.warn("The dragged object's data does not conform to the expected internal format: "+e),null}}},{key:"getSVGCanvasD3",value:function(){return this.svgCanvasD3}},{key:"getStateTag",value:function(){var e=null;return this.props.canvasConfig.enableStateTag!==l.STATE_TAG_READ_ONLY&&this.props.canvasConfig.enableStateTag!==l.STATE_TAG_LOCKED||(e=b.default.createElement(Ke,{stateTagType:this.props.canvasConfig.enableStateTag,canvasController:this.props.canvasController})),e}},{key:"getEmptyCanvas",value:function(){var e=null;return this.props.canvasController.isPrimaryPipelineEmpty()&&(e=this.props.canvasConfig.emptyCanvasContent?b.default.createElement("div",{className:"empty-canvas"},this.props.canvasConfig.emptyCanvasContent):b.default.createElement("div",{className:"empty-canvas"},b.default.createElement("div",{className:"empty-canvas-image"},b.default.createElement(y.FlowData16,null)),b.default.createElement("span",{className:"empty-canvas-text1"},this.getLabel("canvas.flowIsEmpty")),b.default.createElement("span",{className:"empty-canvas-text2"},this.getLabel("canvas.addNodeToStart")))),e}},{key:"getContextMenu",value:function(){return b.default.createElement(Be,{canvasController:this.props.canvasController,containingDivId:this.mainCanvasDivId})}},{key:"getTextToolbar",value:function(){return b.default.createElement(Xe,{canvasController:this.props.canvasController})}},{key:"getDropZone",value:function(){var e=null;return this.isDropZoneDisplayed()&&(e=this.props.canvasConfig.dropZoneCanvasContent?this.props.canvasConfig.dropZoneCanvasContent:b.default.createElement("div",null,b.default.createElement("div",{className:"dropzone-canvas"}),b.default.createElement("div",{className:"dropzone-canvas-rect"}))),e}},{key:"getSVGCanvasDiv",value:function(){return b.default.createElement("div",{tabIndex:"-1",className:"d3-svg-canvas-div",id:this.svgCanvasDivId,onKeyDown:this.onKeyDown})}},{key:"setIsDropZoneDisplayed",value:function(e){e!==this.state.isDropZoneDisplayed&&this.setState({isDropZoneDisplayed:e})}},{key:"isDropZoneDisplayed",value:function(){return this.props.canvasConfig.enableDropZoneOnExternalDrag&&this.state.isDropZoneDisplayed}},{key:"isDataTypeBeingDraggedFile",value:function(e){return!(!e.dataTransfer||!Array.isArray(e.dataTransfer.types))&&e.dataTransfer.types.includes("Files")}},{key:"afterUpdate",value:function(){this.afterUpdateCallbacks.forEach((function(e){return e()}))}},{key:"addAfterUpdateCallback",value:function(e){-1===this.afterUpdateCallbacks.findIndex((function(t){return t===e}))&&this.afterUpdateCallbacks.push(e)}},{key:"removeAfterUpdateCallback",value:function(e){var t=this.afterUpdateCallbacks.findIndex((function(t){return t===e}));t>-1&&this.afterUpdateCallbacks.splice(t,1)}},{key:"addEventListeners",value:function(){this.eventListenersAdded||(document.addEventListener("cut",this.onCut,!0),document.addEventListener("copy",this.onCopy,!0),document.addEventListener("paste",this.onPaste,!0),document.addEventListener("mousemove",this.onMouseMove,!0),this.eventListenersAdded=!0)}},{key:"removeEventListeners",value:function(){this.eventListenersAdded&&(document.removeEventListener("cut",this.onCut,!0),document.removeEventListener("copy",this.onCopy,!0),document.removeEventListener("paste",this.onPaste,!0),document.removeEventListener("mousemove",this.onMouseMove,!0),this.eventListenersAdded=!1)}},{key:"drop",value:function(e){if(e.preventDefault(),this.setIsDropZoneDisplayed(!1),this.first=!1,this.second=!1,this.props.canvasConfig.enableEditingActions){var t=this.props.canvasController.getDragNodeTemplate();if(t)this.svgCanvasD3.nodeTemplateDropped(t,e.clientX,e.clientY),this.props.canvasController.nodeTemplateDragEnd();else{var n=this.getDNDJson(e);n||(n={operation:"addToCanvas",data:{dataTransfer:e.dataTransfer,editType:"createFromExternalObject"}}),this.svgCanvasD3.externalObjectDropped(n,e.clientX,e.clientY)}}}},{key:"dragOver",value:function(e){if(Math.abs(this.dragX-e.clientX)>5||Math.abs(this.dragY-e.clientY)>5){this.dragX=e.clientX,this.dragY=e.clientY;var t=this.props.canvasController.getDragNodeTemplate();t&&this.svgCanvasD3.nodeTemplateDragOver(t,e.clientX,e.clientY)}}},{key:"dragEnter",value:function(e){this.dragX=null,this.dragY=null,this.isDataTypeBeingDraggedFile(e)&&(this.first?this.second=!0:(this.first=!0,this.setIsDropZoneDisplayed(!0))),e.preventDefault()}},{key:"dragLeave",value:function(e){this.isDataTypeBeingDraggedFile(e)&&(this.second?this.second=!1:this.first&&(this.first=!1),this.first||this.second||this.setIsDropZoneDisplayed(!1)),e.preventDefault()}},{key:"focusOnCanvas",value:function(){document.getElementById(this.svgCanvasDivId)&&document.getElementById(this.svgCanvasDivId).focus()}},{key:"refreshOnSizeChange",value:function(){this.svgCanvasD3&&this.svgCanvasD3.refreshOnSizeChange()}},{key:"render",value:function(){this.logger.log("render");var e=this.getStateTag(),t=this.getEmptyCanvas(),n=this.getContextMenu(),i=this.getTextToolbar(),o=this.getDropZone(),a=this.getSVGCanvasDiv(),r=this.props.canvasConfig.enableRightFlyoutUnderToolbar?"common-canvas-main":null,s=this.props.canvasConfig.enableRightFlyoutUnderToolbar?"common-canvas-drop-div-under-toolbar":"common-canvas-drop-div";return s="None"===this.props.canvasConfig.enableToolbarLayout?s+" common-canvas-toolbar-none":s,s=this.props.bottomPanelIsOpen?s+" common-canvas-bottom-panel-is-open":s,b.default.createElement("main",{"aria-label":this.getLabel("canvas.label"),role:"main",className:r},b.default.createElement(P.default,{handleWidth:!0,handleHeight:!0,onResize:this.refreshOnSizeChange},b.default.createElement("div",{id:this.mainCanvasDivId,className:s,onDrop:this.drop,onDragOver:this.dragOver,onDragEnter:this.dragEnter,onDragLeave:this.dragLeave},t,a,n,i,o,e)))}}]),o}(b.default.Component),kr=i.connect((function(e,t){return{canvasInfo:e.canvasinfo,canvasConfig:e.canvasconfig,bottomPanelIsOpen:e.bottompanel.isOpen,selectionInfo:e.selectioninfo,breadcrumbs:e.breadcrumbs}}))(o.injectIntl(Cr));function br(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Tr=function(n){t._inherits(o,n);var i=br(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).getLabel=a.getLabel.bind(t._assertThisInitialized(a)),a.toolbarActionHandler=a.toolbarActionHandler.bind(t._assertThisInitialized(a)),a.logger=new h.Logger("CC-Toolbar"),a}return e._createClass(o,[{key:"getLabel",value:function(e,t){var n=f.defaultMessages1[e]?f.defaultMessages1[e]:Fe[e];return this.props.intl.formatMessage({id:e,defaultMessage:n},t)}},{key:"getDefaultToolbar",value:function(){return{leftBar:[{action:"undo",label:this.getLabel("canvas.undo"),enable:!0},{action:"redo",label:this.getLabel("canvas.redo"),enable:!0},{action:"cut",label:this.getLabel("edit.cutSelection"),enable:!0},{action:"copy",label:this.getLabel("edit.copySelection"),enable:!0},{action:"paste",label:this.getLabel("edit.pasteSelection"),enable:!0},{action:"createAutoComment",label:this.getLabel("canvas.addComment"),enable:!0},{action:"deleteSelectedObjects",label:this.getLabel("canvas.deleteObject"),enable:!0}],rightBar:[{action:"zoomIn",label:this.getLabel("toolbar.zoomIn"),enable:!0},{action:"zoomOut",label:this.getLabel("toolbar.zoomOut"),enable:!0},{action:"zoomToFit",label:this.getLabel("toolbar.zoomToFit"),enable:!0}]}}},{key:"getConvertedLegacyToolbar",value:function(e){return{leftBar:e,rightBar:this.getDefaultRightBar()}}},{key:"getDefaultRightBar",value:function(){return[{action:"zoomIn",label:this.getLabel("toolbar.zoomIn"),enable:!0},{action:"zoomOut",label:this.getLabel("toolbar.zoomOut"),enable:!0},{action:"zoomToFit",label:this.getLabel("toolbar.zoomToFit"),enable:!0}]}},{key:"getNotificationClassName",value:function(){var e=this.props.canvasController.getNotificationMessagesMaxType(),t=l.NOTIFICATION_ICON_CLASS;return e===l.ERROR?t+=" error":e===l.WARNING?t+=" warning":e===l.SUCCESS?t+=" success":e===l.INFO&&(t+=" info"),t}},{key:"generateToolbarConfig",value:function(){var e=this.copyConfig();return e?Array.isArray(e)?e=this.getConvertedLegacyToolbar(e):void 0===e.rightBar&&(e.rightBar=this.getDefaultRightBar()):e=this.getDefaultToolbar(),e=Object.assign({},e,{leftBar:this.optionallyAddPaletteTool(e.leftBar||[])},{rightBar:this.optionallyAddNotificationTool(e.rightBar||[])})}},{key:"copyConfig",value:function(){if(!this.props.config)return null;if(Array.isArray(this.props.config))return u._toConsumableArray(this.props.config);var e={};return this.props.config.overrideAutoEnableDisable&&(e.overrideAutoEnableDisable=!0),this.props.config&&this.props.config.leftBar&&(e.leftBar=u._toConsumableArray(this.props.config.leftBar)),this.props.config&&this.props.config.rightBar&&(e.rightBar=u._toConsumableArray(this.props.config.rightBar)),e}},{key:"toolbarActionHandler",value:function(e){this.props.canvasController.toolbarActionHandler(e)}},{key:"optionallyAddPaletteTool",value:function(e){var t=this.getLabel("toolbar.palette"),n=e;return e&&e.length>0&&"palette"===e[0].action&&(t=e[0].label?e[0].label:t,n=e.slice(1),e.length>1&&e[1].divider&&(n=e.slice(2))),this.props.isPaletteEnabled?[{action:"togglePalette",label:t,enable:!0,iconTypeOverride:this.props.isPaletteOpen?"paletteClose":"paletteOpen"},{divider:!0}].concat(n):n}},{key:"optionallyAddNotificationTool",value:function(e){if(this.props.notificationConfig&&void 0!==this.props.notificationConfig.action&&void 0!==this.props.notificationConfig.enable){var t=this.props.notificationMessages.length,n=[{divider:!0},{action:l.TOOLBAR_TOGGLE_NOTIFICATION_PANEL,label:this.props.notificationConfig.label,enable:!0,isSelected:this.props.isNotificationOpen,className:this.getNotificationClassName(),textContent:t>9?"9+":t.toString()}];return e.concat(n)}return e}},{key:"configureToolbarButtonsState",value:function(e){if(!this.props.enableInternalObjectModel||e.overrideAutoEnableDisable)return e;if(void 0!==e){var t=this.props.enableEditingActions;this.applyToolState("undo",e,t&&this.props.canUndo),this.applyToolState("redo",e,t&&this.props.canRedo),this.applyToolState("cut",e,t&&this.props.canCutCopy),this.applyToolState("copy",e,t&&this.props.canCutCopy),this.applyToolState("paste",e,t&&this.props.canPaste),this.applyToolState("deleteSelectedObjects",e,t&&this.props.canDelete),this.applyToolState("createAutoComment",e,t),this.applyToolState("arrangeHorizontally",e,t),this.applyToolState("arrangeVertically",e,t),this.applyToolState("zoomIn",e,this.props.canZoomIn),this.applyToolState("zoomOut",e,this.props.canZoomOut),this.applyToolState("zoomToFit",e,this.props.canZoomToFit)}return e}},{key:"addUndoRedoCommandLabels",value:function(e){var t=this.props.undoLabel,n=this.props.redoLabel;if(t){var i=this.findTool("undo",e);i&&(i.label=this.getLabel("canvas.undoCommand",{undo_command:t}))}if(n){var o=this.findTool("redo",e);o&&(o.label=this.getLabel("canvas.redoCommand",{redo_command:n}))}return e}},{key:"applyToolState",value:function(e,t,n){var i=this.findTool(e,t);i?i.enable=n:this.logger.log("Toolbar tool "+e+" could not be found to set state to "+n)}},{key:"findTool",value:function(e,t){var n={};return t.leftBar&&(n=t.leftBar.find((function(t){return t.action===e}))),!n&&t.rightBar&&(n=t.rightBar.find((function(t){return t.action===e}))),n}},{key:"render",value:function(){this.logger.log("render");var e=this.generateToolbarConfig();e=this.configureToolbarButtonsState(e),e=this.addUndoRedoCommandLabels(e);var t=null;return this.props.enableToolbarLayout===l.TOOLBAR_LAYOUT_TOP&&(t=b.default.createElement("section",{"aria-label":this.getLabel("toolbar.label"),role:"toolbar"},b.default.createElement(c.Toolbar,{config:e,instanceId:this.props.canvasController.getInstanceId(),toolbarActionHandler:this.toolbarActionHandler,additionalText:{overflowMenuLabel:this.getLabel("toolbar.overflowMenu")}}))),t}}]),o}(b.default.Component),Pr=i.connect((function(e,t){return{enableToolbarLayout:e.canvasconfig.enableToolbarLayout,config:e.canvastoolbar.config,isPaletteEnabled:e.canvasconfig.enablePaletteLayout!==l.PALETTE_LAYOUT_NONE,isPaletteOpen:e.palette.isOpen,isNotificationOpen:e.notificationpanel.isOpen,notificationConfig:e.notificationpanel.config,notificationMessages:e.notifications,enableInternalObjectModel:e.canvasconfig.enableInternalObjectModel,enableEditingActions:e.canvasconfig.enableEditingActions,canUndo:t.canvasController.canUndo(),canRedo:t.canvasController.canRedo(),canCutCopy:t.canvasController.canCutCopy(),canPaste:t.canvasController.canPaste(),canDelete:t.canvasController.canDelete(),canZoomIn:t.canvasController.canZoomIn(),canZoomOut:t.canvasController.canZoomOut(),canZoomToFit:t.canvasController.canZoomToFit(),undoLabel:t.canvasController.getUndoLabel(),redoLabel:t.canvasController.getRedoLabel()}}))(o.injectIntl(Tr));function Lr(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var _r=function(n){t._inherits(o,n);var i=Lr(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).logger=new h.Logger("CC-RightFlyout"),n}return e._createClass(o,[{key:"render",value:function(){this.logger.log("render");var e=b.default.createElement("div",{className:"right-flyout-panel"});if(this.props.content&&this.props.isOpen){var t=this.props.enableRightFlyoutUnderToolbar?"right-flyout-panel under-toolbar":"right-flyout-panel";e=b.default.createElement("div",{className:t},this.props.content)}return e}}]),o}(b.default.Component),Nr=i.connect((function(e,t){return{isOpen:e.rightflyout.isOpen,content:e.rightflyout.content,enableRightFlyoutUnderToolbar:e.canvasconfig.enableRightFlyoutUnderToolbar}}))(_r);function xr(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var wr=function(n){t._inherits(o,n);var i=xr(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).logger=new h.Logger("CC-Bottom-Panel"),a.onMouseUp=a.onMouseUp.bind(t._assertThisInitialized(a)),a.onMouseDown=a.onMouseDown.bind(t._assertThisInitialized(a)),a.onMouseMoveY=a.onMouseMoveY.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"onMouseDown",value:function(e){0===e.button&&(document.addEventListener("mousemove",this.onMouseMoveY,!0),document.addEventListener("mouseup",this.onMouseUp,!0),this.posY=e.clientY,e.preventDefault())}},{key:"onMouseUp",value:function(e){document.removeEventListener("mousemove",this.onMouseMoveY,!0),document.removeEventListener("mouseup",this.onMouseUp,!0)}},{key:"onMouseMoveY",value:function(e){if(e.clientY){var t=e.clientY-this.posY,n=this.props.panelHeight-t;this.props.canvasController.setBottomPanelHeight(this.limitHeight(n)),this.posY=e.clientY}}},{key:"limitHeight",value:function(e){var t=document.getElementById(this.props.containingDivId),n=e;if(t){var i=t.getBoundingClientRect().height-100;n=Math.min(Math.max(n,75),i)}return n}},{key:"render",value:function(){this.logger.log("render");var e=null;if(this.props.bottomPanelIsOpen){var t=this.limitHeight(this.props.panelHeight)+"px";e=b.default.createElement("div",{className:"bottom-panel",style:{height:t}},b.default.createElement("div",{className:"bottom-panel-drag",onMouseDown:this.onMouseDown}),b.default.createElement("div",{className:"bottom-panel-contents"},this.props.bottomPanelContent))}return e}}]),o}(b.default.Component),Sr=i.connect((function(e,t){return{bottomPanelIsOpen:e.bottompanel.isOpen,bottomPanelContent:e.bottompanel.content,panelHeight:e.bottompanel.panelHeight}}))(wr);function Er(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Ir=function(n){t._inherits(o,n);var i=Er(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={},a.logger=new h.Logger("NotificationPanel"),a.handleNotificationPanelClickOutside=a.handleNotificationPanelClickOutside.bind(t._assertThisInitialized(a)),a.closeNotificationPanel=a.closeNotificationPanel.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleNotificationPanelClickOutside,!0)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleNotificationPanelClickOutside,!0)}},{key:"getNotifications",value:function(){var e=[];if(!this.props.messages)return e;for(var t=0;t<this.props.messages.length;t++){var n=this.props.messages[t],i=n.callback?" clickable ":"",o=n.type,a=b.default.createElement("div",{className:"notification-message-type"},b.default.createElement(r.Icon,{type:o,className:"notification-message-icon-".concat(o)})),s=n.title?b.default.createElement("div",{className:"notification-message-title"},n.title):null,l=n.subtitle?b.default.createElement("div",{className:"notification-message-subtitle"},n.subtitle,b.default.createElement("hr",null)):null,c=n.closeMessage?b.default.createElement("div",{className:"notification-message-close",onClick:this.deleteNotification.bind(this,n.id)},n.closeMessage):null,u=n.timestamp?b.default.createElement("div",{className:"notification-message-timestamp"},b.default.createElement("div",{className:"notification-message-timestamp-icon"},b.default.createElement(r.Icon,{type:"time"})),b.default.createElement("div",{className:"notification-message-string"},n.timestamp)):null;e.push(b.default.createElement("div",{className:"notifications-button-container",key:t+"-"+n.id},b.default.createElement("div",{className:"notifications "+i+n.type,onClick:this.notificationCallback.bind(this,n.id,n.callback)},a,b.default.createElement("div",{className:"notification-message-details"},s,l,b.default.createElement("div",{className:"notification-message-content"},n.content),u,c))))}return e}},{key:"handleNotificationPanelClickOutside",value:function(e){if(this.props.isNotificationOpen&&this.props.notificationConfig&&!this.props.notificationConfig.keepOpen){var t=document.getElementsByClassName(l.NOTIFICATION_ICON_CLASS)[0],n=document.getElementsByClassName("notification-panel-header")[0],i=document.getElementsByClassName("notification-panel-messages-container")[0];t&&!t.contains(e.target)&&n&&!n.contains(e.target)&&i&&!i.contains(e.target)&&(this.props.canvasController.toolbarActionHandler("closeNotificationPanel"),e.stopPropagation())}}},{key:"notificationCallback",value:function(e,t){t&&t(e)}},{key:"deleteNotification",value:function(e){this.props.canvasController.deleteNotificationMessages(e)}},{key:"clearNotificationMessages",value:function(){this.props.canvasController.clearNotificationMessages(),"function"==typeof this.props.notificationConfig.clearAllCallback&&this.props.notificationConfig.clearAllCallback()}},{key:"closeNotificationPanel",value:function(){this.props.canvasController.toolbarActionHandler("closeNotificationPanel")}},{key:"render",value:function(){if(this.logger.log("render"),!this.props.notificationConfig)return null;var e=this.props.isNotificationOpen?"":"panel-hidden",t=this.props.notificationConfig&&this.props.notificationConfig.notificationHeader?this.props.notificationConfig.notificationHeader:l.DEFAULT_NOTIFICATION_HEADER,n=this.props.notificationConfig&&this.props.notificationConfig.notificationSubtitle?b.default.createElement("div",{className:"notification-panel-subtitle"},this.props.notificationConfig.notificationSubtitle):null,i=this.props.messages.length>0?this.getNotifications():b.default.createElement("div",{className:"notification-panel-empty-message-container"},b.default.createElement("div",{className:"notification-panel-empty-message"},this.props.notificationConfig&&this.props.notificationConfig.emptyMessage?this.props.notificationConfig.emptyMessage:null)),o=this.props.notificationConfig&&this.props.notificationConfig.clearAllMessage?b.default.createElement("div",{className:"notification-panel-clear-all-container"},b.default.createElement(d.Button,{className:"notification-panel-clear-all",onClick:this.clearNotificationMessages.bind(this),kind:"ghost",size:"small",disabled:0===this.props.messages.length},this.props.notificationConfig.clearAllMessage)):null;return b.default.createElement("div",{className:"notification-panel-container "+e},b.default.createElement("div",{className:"notification-panel"},b.default.createElement("div",{className:"notification-panel-header-container"},b.default.createElement("div",{className:"notification-panel-header"},t,b.default.createElement(y.Close16,{className:"notification-panel-close-icon",onClick:this.closeNotificationPanel})),n),b.default.createElement("div",{className:"notification-panel-messages-container"},b.default.createElement("div",{className:"notification-panel-messages"},i),o)))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.messages!==t.messages?{messages:e.messages}:{}}}]),o}(b.default.Component),Dr=i.connect((function(e,t){return{notificationConfig:e.notificationpanel.config,isNotificationOpen:e.notificationpanel.isOpen,messages:e.notifications}}))(Ir);function Or(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Ar=function(n){t._inherits(o,n);var i=Or(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).logger=new h.Logger("CC-CentralItems"),n}return e._createClass(o,[{key:"render",value:function(){this.logger.log("render");var e=b.default.createElement(Nr,null),t=b.default.createElement(Pr,{canvasController:this.props.canvasController}),n=b.default.createElement(Dr,{canvasController:this.props.canvasController}),i=b.default.createElement(kr,{canvasController:this.props.canvasController}),o=b.default.createElement(Sr,{canvasController:this.props.canvasController,containingDivId:this.props.containingDivId});return this.props.enableRightFlyoutUnderToolbar?b.default.createElement("div",{className:"common-canvas-right-side-items-under-toolbar"},t,b.default.createElement("div",{id:this.props.containingDivId,className:"common-canvas-items-container-under-toolbar"},b.default.createElement("div",{className:"common-canvas-with-bottom-panel"},i,o),b.default.createElement("div",null,e),n)):b.default.createElement("div",{className:"common-canvas-right-side-items"},b.default.createElement("div",{id:this.props.containingDivId,className:"common-canvas-items-container"},t,i,o,n),e)}}]),o}(b.default.Component),Mr=i.connect((function(e,t){return{enableRightFlyoutUnderToolbar:e.canvasconfig.enableRightFlyoutUnderToolbar}}))(Ar);function zr(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Rr=function(n){t._inherits(a,n);var o=zr(a);function a(n){var i;return e._classCallCheck(this,a),(i=o.call(this,n)).logger=new h.Logger(["CommonCanvas"]),i.logger.log("constructor"),i.initializeController=i.initializeController.bind(t._assertThisInitialized(i)),i.containingDivId="common-canvas-items-container-"+n.canvasController.getInstanceId(),n.canvasController.setIntl(n.intl),i.initializeController(n),i}return e._createClass(a,[{key:"componentDidUpdate",value:function(){this.logger.log("componentDidUpdate"),this.initializeController(this.props)}},{key:"onDragOver",value:function(e){e.preventDefault()}},{key:"onDrop",value:function(e){e.preventDefault()}},{key:"initializeController",value:function(e){this.logger.logStartTimer("initializeController"),e.canvasController.setCanvasConfig(e.config),e.canvasController.setContextMenuConfig(e.contextMenuConfig),e.canvasController.setKeyboardConfig(e.keyboardConfig),e.canvasController.setToolbarConfig(e.toolbarConfig),e.canvasController.setNotificationPanelConfig(e.notificationConfig),e.canvasController.setRightFlyoutConfig({content:e.rightFlyoutContent,isOpen:e.showRightFlyout}),e.canvasController.setBottomPanelConfig({content:e.bottomPanelContent,isOpen:e.showBottomPanel}),e.canvasController.setHandlers({contextMenuHandler:e.contextMenuHandler,beforeEditActionHandler:e.beforeEditActionHandler,editActionHandler:e.editActionHandler,clickActionHandler:e.clickActionHandler,decorationActionHandler:e.decorationActionHandler,tipHandler:e.tipHandler,layoutHandler:e.layoutHandler,idGeneratorHandler:e.idGeneratorHandler,selectionChangeHandler:e.selectionChangeHandler,actionLabelHandler:e.actionLabelHandler}),this.logger.logEndTimer("initializeController")}},{key:"generateClass",value:function(){var e="common-canvas";return e+=this.isEditingAllowed()?"":" config-editing-actions-false",e+=this.props.config&&this.props.config.enableParentClass?" "+this.props.config.enableParentClass:""}},{key:"isEditingAllowed",value:function(){return this.props.config&&(void 0===this.props.config.enableEditingActions||!0===this.props.config.enableEditingActions)}},{key:"render",value:function(){this.logger.log("render");var e=b.default.createElement(He,{canvasController:this.props.canvasController}),t=b.default.createElement(Me,{canvasController:this.props.canvasController,containingDivId:this.containingDivId}),n=b.default.createElement(Mr,{canvasController:this.props.canvasController,containingDivId:this.containingDivId}),o=this.generateClass();return b.default.createElement(i.Provider,{store:this.props.canvasController.getStore()},b.default.createElement("div",{className:o,onDragOver:this.onDragOver,onDrop:this.onDrop},t,n,e))}}]),a}(b.default.Component),Hr=o.injectIntl(Rr);exports.commonCanvas=Hr;
|
|
2
|
-
//# sourceMappingURL=common-canvas-
|
|
1
|
+
"use strict";var e=require("./createClass-6db89a23.js"),t=require("./getPrototypeOf-bf88242f.js"),n=require("react"),i=require("react-redux"),o=require("react-intl"),a=require("./isArrayLikeObject-f3b27f64.js"),r=require("./icon-1ef0f3b9.js"),s=require("react-inlinesvg"),l=require("./canvas-constants-34cdb7df.js"),c=require("./toolbar-59ce5251.js"),u=require("./datarecord-metadata-v3-schema-6b6384ff.js"),d=require("carbon-components-react"),h=require("./canvas-logger-a0f1beaa.js"),p=require("./lib/tooltip.js"),g=require("react-resize-detector"),f=require("./canvas-controller-ccb05f9f.js"),v=require("./lib/context-menu.js"),y=require("@carbon/icons-react"),m=require("./en-7a0f1db1.js"),C=require("./_baseForOwn-7d4e8506.js");function k(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=k(n),T=k(s),P=k(g),L="Find palette nodes",_="No results found.",N="Try adjusting your search to find what you're looking for.",x="Results restricted to 10 nodes. Try refining your search.",w="Show more",S="Show less",E="Flyout Palette",I="Dialog Palette";function D(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var O=function(n){t._inherits(o,n);var i=D(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={hover:!1},a.iconClicked=a.iconClicked.bind(t._assertThisInitialized(a)),a.mouseEnter=a.mouseEnter.bind(t._assertThisInitialized(a)),a.mouseLeave=a.mouseLeave.bind(t._assertThisInitialized(a)),a.mouseDown=a.mouseDown.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"iconClicked",value:function(){this.props.iconClickedMethod()}},{key:"mouseEnter",value:function(){this.setState({hover:!0})}},{key:"mouseLeave",value:function(){this.setState({hover:!1})}},{key:"mouseDown",value:function(e){e.stopPropagation()}},{key:"render",value:function(){var e=this.props.selectedIconName;return this.props.isSelected||(e=this.state.hover?this.props.hoverIconName:this.props.deselectedIconName),b.default.createElement("div",{draggable:"false",className:"palette-three-way-icon-div"},b.default.createElement("img",{src:e,draggable:"false",onClick:this.iconClicked,onMouseEnter:this.mouseEnter,onMouseLeave:this.mouseLeave,onMouseDown:this.mouseDown}))}}]),o}(b.default.Component),A=O;function M(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var z=function(n){t._inherits(o,n);var i=M(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={},a.mouseDown=a.mouseDown.bind(t._assertThisInitialized(a)),a.doubleClick=a.doubleClick.bind(t._assertThisInitialized(a)),a.close=a.close.bind(t._assertThisInitialized(a)),a.gridViewSelected=a.gridViewSelected.bind(t._assertThisInitialized(a)),a.listViewSelected=a.listViewSelected.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"mouseDown",value:function(e){this.props.mouseDownMethod(e)}},{key:"doubleClick",value:function(e){this.props.windowMaximizeMethod(e)}},{key:"close",value:function(e){this.props.canvasController.closePalette(e)}},{key:"gridViewSelected",value:function(){this.props.showGridMethod(!0)}},{key:"listViewSelected",value:function(){this.props.showGridMethod(!1)}},{key:"render",value:function(){return b.default.createElement("div",{className:"palette-dialog-topbar",onMouseDown:this.mouseDown,onDoubleClick:this.doubleClick},b.default.createElement("span",{className:"left-navbar"},b.default.createElement(A,{iconClickedMethod:this.gridViewSelected,isSelected:this.props.showGrid,selectedIconName:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20enable-background%3D%22new%200%200%2016%2016%22%3E%3Cg%20fill%3D%22%233D70B2%22%3E%3Cpath%20d%3D%22m9.8%200h6.2v6.2h-6.2z%22%2F%3E%3Cpath%20d%3D%22M8.6%2C0H7.4H0v7.4v1.2V16h7.4h1.2H16V8.6V7.4H8.6V0z%20M7.4%2C14.8H1.2V8.6h6.2V14.8z%20M14.8%2C8.6v6.2H8.6V8.6%20%20H14.8z%20M1.2%2C7.4V1.2h6.2v6.2H1.2z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",hoverIconName:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20enable-background%3D%22new%200%200%2016%2016%22%3E%3Cg%20fill%3D%22%235596e6%22%3E%3Cpath%20d%3D%22m9.8%200h6.2v6.2h-6.2z%22%2F%3E%3Cpath%20d%3D%22M8.6%2C0H7.4H0v7.4v1.2V16h7.4h1.2H16V8.6V7.4H8.6V0z%20M7.4%2C14.8H1.2V8.6h6.2V14.8z%20M14.8%2C8.6v6.2H8.6V8.6%20%20H14.8z%20M1.2%2C7.4V1.2h6.2v6.2H1.2z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",deselectedIconName:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20enable-background%3D%22new%200%200%2016%2016%22%3E%3Cg%20fill%3D%22%23C7C7C7%22%3E%3Cpath%20d%3D%22m9.8%200h6.2v6.2h-6.2z%22%2F%3E%3Cpath%20d%3D%22M8.6%2C0H7.4H0v7.4v1.2V16h7.4h1.2H16V8.6V7.4H8.6V0z%20M7.4%2C14.8H1.2V8.6h6.2V14.8z%20M14.8%2C8.6v6.2H8.6V8.6%20%20H14.8z%20M1.2%2C7.4V1.2h6.2v6.2H1.2z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"}),b.default.createElement(A,{iconClickedMethod:this.listViewSelected,isSelected:!this.props.showGrid,selectedIconName:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20enable-background%3D%22new%200%200%2016%2016%22%3E%3Cg%20fill%3D%22%233D70B2%22%3E%3Cpath%20d%3D%22m0%2014.5h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%2014.5h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%209.7h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%209.7h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%204.8h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%204.8h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%200h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%200h12.7v1.5h-12.7z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",hoverIconName:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20enable-background%3D%22new%200%200%2016%2016%22%3E%3Cg%20fill%3D%22%235596e6%22%3E%3Cpath%20d%3D%22m0%2014.5h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%2014.5h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%209.7h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%209.7h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%204.8h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%204.8h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%200h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%200h12.7v1.5h-12.7z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E",deselectedIconName:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2016%2016%22%20enable-background%3D%22new%200%200%2016%2016%22%3E%3Cg%20fill%3D%22%23C7C7C7%22%3E%3Cpath%20d%3D%22m0%2014.5h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%2014.5h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%209.7h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%209.7h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%204.8h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%204.8h12.7v1.5h-12.7z%22%2F%3E%3Cpath%20d%3D%22m0%200h1.5v1.5h-1.5z%22%2F%3E%3Cpath%20d%3D%22m3.3%200h12.7v1.5h-12.7z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"})),b.default.createElement("span",{className:"right-navbar"},b.default.createElement("a",{className:"secondary-action",onClick:this.close},b.default.createElement("img",{src:"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2032%2032%22%3E%3Cpath%20style%3D%22fill%3A%233D70B2%22%20d%3D%22M20.293%2010.293L16%2014.586l-4.293-4.293-1.414%201.414L14.586%2016l-4.293%204.293%201.414%201.414L16%2017.414l4.293%204.293%201.414-1.414L17.414%2016l4.293-4.293z%22%2F%3E%3Cpath%20style%3D%22fill%3A%233D70B2%22%20d%3D%22M16%202C8.269%202%202%208.269%202%2016s6.269%2014%2014%2014%2014-6.269%2014-14S23.731%202%2016%202zm0%2026C9.383%2028%204%2022.617%204%2016S9.383%204%2016%204s12%205.383%2012%2012-5.383%2012-12%2012z%22%2F%3E%3C%2Fsvg%3E",draggable:"false",className:"close-icon"}))))}}]),o}(b.default.Component);function R(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var H=function(n){t._inherits(o,n);var i=R(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={},a.categorySelected=a.categorySelected.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"categorySelected",value:function(e){this.props.categorySelectedMethod(e)}},{key:"render",value:function(){var e="palette-dialog-category";return this.props.selectedCategory===this.props.category.label&&(e="palette-dialog-category-selected"),b.default.createElement("div",{"data-id":this.props.category.id,className:e,onClick:this.categorySelected},this.props.category.label)}}]),o}(b.default.Component);function U(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var j=function(n){t._inherits(o,n);var i=U(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).state={},n}return e._createClass(o,[{key:"render",value:function(){for(var e=[],t=0;t<this.props.categories.length;t++)e.push(b.default.createElement(H,{key:this.props.categories[t].label,category:this.props.categories[t],selectedCategory:this.props.selectedCategory,categorySelectedMethod:this.props.categorySelectedMethod}));return b.default.createElement("div",{className:"palette-dialog-categories palette-scroll"},e)}}]),o}(b.default.Component),B="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2060%22%3E%20%3Cpath%20d%3D%22M32%2C42a1.61%2C1.61%2C0%2C0%2C1-.8-.2L9.28%2C30.15l1.6-2.94L32%2C38.47%2C53.12%2C27.21l1.6%2C2.94L32.8%2C41.84A1.71%2C1.71%2C0%2C0%2C1%2C32%2C42Z%22%2F%3E%20%3Cpath%20d%3D%22M32%2C52.05a1.72%2C1.72%2C0%2C0%2C1-.8-.2L9.28%2C40.17l1.6-2.94L32%2C48.48%2C53.12%2C37.23l1.6%2C2.94L32.8%2C51.85A1.72%2C1.72%2C0%2C0%2C1%2C32%2C52.05Z%22%2F%3E%20%3Cpath%20d%3D%22M32%2C32a1.72%2C1.72%2C0%2C0%2C1-.8-.2L9.28%2C20.14a1.66%2C1.66%2C0%2C0%2C1%2C0-2.94L31.2%2C5.52a1.68%2C1.68%2C0%2C0%2C1%2C1.6%2C0L54.72%2C17.2a1.66%2C1.66%2C0%2C0%2C1%2C.69%2C2.26%2C1.74%2C1.74%2C0%2C0%2C1-.69.68L32.8%2C31.82A1.72%2C1.72%2C0%2C0%2C1%2C32%2C32ZM13.64%2C18.67%2C32%2C28.46l18.36-9.79L32%2C8.88Z%22%2F%3E%20%3Crect%20x%3D%225.02%22%20y%3D%221.98%22%20width%3D%2253.96%22%20height%3D%2253.41%22%20fill%3D%22none%22%2F%3E%3C%2Fsvg%3E",F="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2060%22%3E%20%3Cdefs%3E%20%20%3CclipPath%20id%3D%22a%22%3E%20%20%20%3Cpolygon%20points%3D%2217.28%204.63%2026.88%2014.07%2024.74%2015.87%2018.94%2010.35%2018.94%2026.29%2015.78%2026.29%2015.78%2010.35%209.97%2016.12%207.91%2014.04%2017.28%204.63%22%2F%3E%20%20%3C%2FclipPath%3E%20%20%3CclipPath%20id%3D%22b%22%3E%20%20%20%3Cpath%20d%3D%22M32.39%2C6.36l.2.1%2C20.35%2C11a2.7%2C2.7%2C0%2C0%2C1%2C1.11%2C1.11%2C2.74%2C2.74%2C0%2C0%2C1-.89%2C3.59l-.22.13L33%2C33a2.66%2C2.66%2C0%2C0%2C1-2.51%2C0l-6-3.13a1.83%2C1.83%2C0%2C1%2C1%2C1.69-3.25l5.57%2C2.89%2C18-9.69L30.85%2C9.68A1.83%2C1.83%2C0%2C0%2C1%2C30%2C7.39l.09-.19A1.83%2C1.83%2C0%2C0%2C1%2C32.39%2C6.36Z%22%20%20%20clip-path%3D%22url%28%23a%29%22%2F%3E%20%20%3C%2FclipPath%3E%20%3C%2Fdefs%3E%20%3Cpolygon%20points%3D%2217.28%204.63%2026.88%2014.07%2024.74%2015.87%2018.94%2010.35%2018.94%2026.29%2015.78%2026.29%2015.78%2010.35%209.97%2016.12%207.91%2014.04%2017.28%204.63%22%2F%3E%20%3Cpath%20d%3D%22M32.39%2C6.36l.2.1%2C20.35%2C11a2.7%2C2.7%2C0%2C0%2C1%2C1.11%2C1.11%2C2.74%2C2.74%2C0%2C0%2C1-.89%2C3.59l-.22.13L33%2C33a2.66%2C2.66%2C0%2C0%2C1-2.51%2C0l-6-3.13a1.83%2C1.83%2C0%2C1%2C1%2C1.69-3.25l5.57%2C2.89%2C18-9.69L30.85%2C9.68A1.83%2C1.83%2C0%2C0%2C1%2C30%2C7.39l.09-.19A1.83%2C1.83%2C0%2C0%2C1%2C32.39%2C6.36Z%22%2F%3E%20%3Cpath%20d%3D%22M53%2C28.53l1.62%2C3L32.52%2C43.43a1.59%2C1.59%2C0%2C0%2C1-.8.21%2C1.66%2C1.66%2C0%2C0%2C1-.81-.21L8.8%2C31.53l1.61-3L31.72%2C40Z%22%2F%3E%20%3Cpath%20d%3D%22M53%2C38.74l1.62%2C3L32.52%2C53.64a1.69%2C1.69%2C0%2C0%2C1-.8.2%2C1.76%2C1.76%2C0%2C0%2C1-.81-.2L8.8%2C41.73l1.61-3L31.72%2C50.21Z%22%2F%3E%3C%2Fsvg%3E";function G(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Y=function(n){t._inherits(o,n);var i=G(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={},a.ghostData=null,a.onDragStart=a.onDragStart.bind(t._assertThisInitialized(a)),a.onDragEnd=a.onDragEnd.bind(t._assertThisInitialized(a)),a.onDoubleClick=a.onDoubleClick.bind(t._assertThisInitialized(a)),a.onMouseOver=a.onMouseOver.bind(t._assertThisInitialized(a)),a.onMouseLeave=a.onMouseLeave.bind(t._assertThisInitialized(a)),a.onMouseDown=a.onMouseDown.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"onMouseDown",value:function(){this.props.canvasController.closeTip(),this.ghostData=this.props.canvasController.getGhostNode(this.props.nodeTemplate)}},{key:"onDragStart",value:function(e){this.props.canvasController.nodeTemplateDragStart(this.props.nodeTemplate),e.dataTransfer.setData(l.DND_DATA_TEXT,""),this.ghostData&&e.dataTransfer.setDragImage(this.ghostData.element,this.ghostData.centerX,this.ghostData.centerY)}},{key:"onDragEnd",value:function(){this.props.canvasController.nodeTemplateDragEnd()}},{key:"onDoubleClick",value:function(){this.props.canvasController.createAutoNode&&this.props.canvasController.createAutoNode(this.props.nodeTemplate)}},{key:"onMouseOver",value:function(e){if(0===e.buttons){var t=this.props.category.empty_text?{app_data:{ui_data:{label:this.props.category.empty_text}}}:this.props.nodeTemplate;this.props.canvasController.openTip({id:"paletteTip_"+this.props.nodeTemplate.op,type:l.TIP_TYPE_PALETTE_ITEM,targetObj:e.currentTarget,nodeTemplate:t,category:this.props.category})}}},{key:"onMouseLeave",value:function(){this.props.canvasController.closeTip()}},{key:"render",value:function(){var e="";a.has_1(this.props.nodeTemplate,"app_data.ui_data.label")&&(e=this.props.nodeTemplate.app_data.ui_data.label);var t=b.default.createElement("div",{className:"node-icon"});if(a.has_1(this.props.nodeTemplate,"app_data.ui_data.image")){var n=this.props.nodeTemplate.app_data.ui_data.image;n===l.USE_DEFAULT_ICON?n=B:n===l.USE_DEFAULT_EXT_ICON&&(n=F),t=n.endsWith(".svg")?b.default.createElement(T.default,{src:n,className:"node-icon",alt:e}):b.default.createElement("img",{src:n,className:"node-icon",alt:e})}var i=this.props.isEditingEnabled?"true":"false",o="palette-dialog-grid-node-text";return this.props.category&&0===this.props.category.node_types.length&&this.props.category.empty_text&&(e=this.props.category.empty_text,i="false",o="palette-dialog-grid-node-text-warning",t=b.default.createElement(r.Icon,{type:l.CANVAS_CARBON_ICONS.WARNING_UNFILLED,className:"palette-dialog-grid-node-icon-warning",draggable:"false"})),b.default.createElement("div",{id:this.props.nodeTemplate.id,"data-id":this.props.nodeTemplate.op,draggable:i,onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave,onMouseDown:this.props.isEditingEnabled?this.onMouseDown:null,onDragStart:this.props.isEditingEnabled?this.onDragStart:null,onDragEnd:this.props.isEditingEnabled?this.onDragEnd:null,onDoubleClick:this.props.isEditingEnabled?this.onDoubleClick:null,className:"palette-dialog-grid-node-outer"},b.default.createElement("div",{className:"palette-dialog-grid-node-inner"},b.default.createElement("div",{className:"palette-dialog-grid-node-icon"},t),b.default.createElement("div",{className:o},e)))}}]),o}(b.default.Component),X=Y;function W(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var V=function(n){t._inherits(o,n);var i=W(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).state={},n}return e._createClass(o,[{key:"render",value:function(){var e=[];if(this.props.category&&this.props.category.node_types&&0===this.props.category.node_types.length&&this.props.category.empty_text)e.push(b.default.createElement(X,{key:"pal_grid_node_empty",category:this.props.category,nodeTemplate:{},canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled}));else for(var t=0;t<this.props.nodeTypes.length;t++)e.push(b.default.createElement(X,{key:"pal_grid_node_"+t,category:this.props.category,nodeTemplate:this.props.nodeTypes[t],canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled}));return b.default.createElement("div",{width:"100%",className:"palette-scroll"},e)}}]),o}(b.default.Component);function K(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Z=function(n){t._inherits(o,n);var i=K(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={showFullDescription:!1},a.ghostData=null,a.showFullDescription=a.showFullDescription.bind(t._assertThisInitialized(a)),a.showShortDescription=a.showShortDescription.bind(t._assertThisInitialized(a)),a.onDragStart=a.onDragStart.bind(t._assertThisInitialized(a)),a.onDragEnd=a.onDragEnd.bind(t._assertThisInitialized(a)),a.onDoubleClick=a.onDoubleClick.bind(t._assertThisInitialized(a)),a.onMouseOver=a.onMouseOver.bind(t._assertThisInitialized(a)),a.onMouseLeave=a.onMouseLeave.bind(t._assertThisInitialized(a)),a.onMouseDown=a.onMouseDown.bind(t._assertThisInitialized(a)),a.onKeyPress=a.onKeyPress.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"onMouseDown",value:function(){this.props.canvasController.closeTip(),this.ghostData=this.props.canvasController.getGhostNode(this.props.nodeTypeInfo.nodeType)}},{key:"onDragStart",value:function(e){this.props.canvasController.nodeTemplateDragStart(this.props.nodeTypeInfo.nodeType),e.dataTransfer.setData(l.DND_DATA_TEXT,""),this.ghostData&&e.dataTransfer.setDragImage(this.ghostData.element,this.ghostData.centerX,this.ghostData.centerY)}},{key:"onKeyPress",value:function(e){" "!==e.key&&"Space"!==e.code&&32!==e.keyCode||this.onDoubleClick()}},{key:"onDragEnd",value:function(){this.props.canvasController.nodeTemplateDragEnd()}},{key:"onDoubleClick",value:function(){this.props.canvasController.createAutoNode&&this.props.canvasController.createAutoNode(this.props.nodeTypeInfo.nodeType)}},{key:"onMouseOver",value:function(e){if(!this.props.isDisplaySearchResult&&0===e.buttons){var t=this.props.nodeTypeInfo.category.empty_text?{app_data:{ui_data:{label:this.props.nodeTypeInfo.category.empty_text}}}:this.props.nodeTypeInfo.nodeType;this.props.canvasController.openTip({id:"paletteTip_"+this.props.nodeTypeInfo.nodeType.op,type:l.TIP_TYPE_PALETTE_ITEM,targetObj:e.currentTarget,nodeTemplate:t,category:this.props.nodeTypeInfo.category})}}},{key:"onMouseLeave",value:function(){this.props.canvasController.closeTip()}},{key:"getHighlightedCategoryLabel",value:function(){return this.getHighlightedText(this.props.nodeTypeInfo.category.label,this.props.nodeTypeInfo.occurrenceInfo.catLabelOccurrences)}},{key:"getHighlightedLabel",value:function(){return this.getHighlightedText(this.props.nodeTypeInfo.nodeType.app_data.ui_data.label,this.props.nodeTypeInfo.occurrenceInfo.nodeLabelOccurrences)}},{key:"getHighlightedDesc",value:function(){var e=this.props.nodeTypeInfo.nodeType.app_data.ui_data.description,t=this.props.nodeTypeInfo.occurrenceInfo.nodeDescOccurrences,n=!1;if(e.length>150&&(n=!0,!this.state.showFullDescription)){var i=this.getAbbreviatedDescription(e,t,150);e=i.abbrDesc,t=i.occurrences}var o=this.getHighlightedText(e,t);if(n)if(this.state.showFullDescription){var a=this.props.intl.formatMessage({id:"palette.flyout.search.less",defaultMessage:S});o.push(b.default.createElement("div",{key:"l_btn",className:"palette-list-item-desc-button",onClick:this.showShortDescription},a))}else{var r=this.props.intl.formatMessage({id:"palette.flyout.search.more",defaultMessage:w});o.push(b.default.createElement("div",{key:"m_btn",className:"palette-list-item-desc-button",onClick:this.showFullDescription},r))}return o}},{key:"getAbbreviatedDescription",value:function(e,t,n){if(0===t.length)return{abbrDesc:e.substring(0,n)+" ...",occurrences:t};var i=t[0].start,o=e.length-i,a="",r=0;return i<n?(r=0,a=e.substring(r,n)+" ..."):o>n?(r=i,a="... "+e.substring(r,i+n)+" ...",r-=4):(r=e.length-n,a="... "+e.substring(r,e.length),r-=4),{abbrDesc:a,occurrences:t.map((function(e){return{start:e.start-r,end:e.end-r}}))}}},{key:"getHighlightedText",value:function(e,t){if(!t||0===t.length)return[b.default.createElement("span",{key:"o"},e)];var n=[],i=0,o="";return t.forEach((function(a,r){o=e.substring(i,a.start),n.push(b.default.createElement("span",{key:"s"+r},o)),o=e.substring(a.start,a.end),n.push(b.default.createElement("mark",{key:"m"+r},o)),i=a.end,r===t.length-1&&a.end<e.length&&(o=e.substring(a.end),n.push(b.default.createElement("span",{key:"f"+r},o)))})),n}},{key:"showFullDescription",value:function(){this.setState({showFullDescription:!0})}},{key:"showShortDescription",value:function(){this.setState({showFullDescription:!1})}},{key:"imageDrag",value:function(){return!1}},{key:"render",value:function(){var e=null,t=this.props.isEditingEnabled?"true":"false",n=null;if(a.has_1(this.props.nodeTypeInfo.nodeType,"app_data.ui_data.image")){var i=this.props.nodeTypeInfo.nodeType.app_data.ui_data.palette_image?this.props.nodeTypeInfo.nodeType.app_data.ui_data.palette_image:this.props.nodeTypeInfo.nodeType.app_data.ui_data.image;i===l.USE_DEFAULT_ICON?i=B:i===l.USE_DEFAULT_EXT_ICON&&(i=F),n=i.endsWith(".svg")?b.default.createElement(T.default,{src:i,className:"palette-list-item-icon",draggable:"false"}):b.default.createElement("img",{src:i,className:"palette-list-item-icon",draggable:"false"})}!a.has_1(this.props.nodeTypeInfo.nodeType,"app_data.ui_data.label")||!this.props.isPaletteOpen&&n||(e=this.props.isDisplaySearchResult?this.getHighlightedLabel():b.default.createElement("span",null,this.props.nodeTypeInfo.nodeType.app_data.ui_data.label));var o=this.props.isShowRanking&&this.props.isDisplaySearchResult&&a.has_1(this.props.nodeTypeInfo,"occurrenceInfo.ranking")?b.default.createElement("span",null,this.props.nodeTypeInfo.occurrenceInfo.ranking):null;0===this.props.nodeTypeInfo.category.node_types.length&&this.props.nodeTypeInfo.category.empty_text&&(this.props.isPaletteOpen&&(e=this.props.nodeTypeInfo.category.empty_text),t="false",n=b.default.createElement(r.Icon,{type:l.CANVAS_CARBON_ICONS.WARNING_UNFILLED,className:"palette-list-item-icon-warning",draggable:"false"}));var s=this.props.isDisplaySearchResult?"palette-list-item search-result":"palette-list-item",c=this.props.isDisplaySearchResult?b.default.createElement("div",{className:"palette-list-item-category-label"},this.getHighlightedCategoryLabel()):null,u=this.props.isDisplaySearchResult&&a.has_1(this.props.nodeTypeInfo.nodeType,"app_data.ui_data.description")&&this.props.nodeTypeInfo.nodeType.app_data.ui_data.description?b.default.createElement("div",{className:"palette-list-item-description"},this.getHighlightedDesc()):null,d=e?b.default.createElement("div",{className:"palette-list-item-text-div",tabIndex:"-1"},e):null;return b.default.createElement("div",{id:this.props.nodeTypeInfo.nodeType.id,"data-id":this.props.nodeTypeInfo.nodeType.op,tabIndex:0,draggable:t,className:s,onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave,onKeyPress:this.props.isEditingEnabled?this.onKeyPress:null,onMouseDown:this.props.isEditingEnabled?this.onMouseDown:null,onDragStart:this.props.isEditingEnabled?this.onDragStart:null,onDragEnd:this.props.isEditingEnabled?this.onDragEnd:null,onDoubleClick:this.props.isEditingEnabled?this.onDoubleClick:null},c,b.default.createElement("div",{className:"palette-list-item-icon-and-text",tabIndex:"-1"},n,d,o),u)}}]),o}(b.default.Component),q=o.injectIntl(Z);function $(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var J=function(n){t._inherits(o,n);var i=$(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).state={},n}return e._createClass(o,[{key:"render",value:function(){var e=[];if(this.props.category&&this.props.category.node_types&&0===this.props.category.node_types.length&&this.props.category.empty_text)e.push(b.default.createElement("div",{key:"item_empty"},b.default.createElement(q,{nodeTypeInfo:{nodeType:{},category:this.props.category},isDisplaySearchResult:!1,canvasController:this.props.canvasController,isPaletteOpen:this.props.isPaletteOpen,isEditingEnabled:this.props.isEditingEnabled})));else for(var t=0;t<this.props.nodeTypeInfos.length;t++){var n="item_"+t;e.push(b.default.createElement(q,{key:n,nodeTypeInfo:this.props.nodeTypeInfos[t],isDisplaySearchResult:!1,canvasController:this.props.canvasController,isPaletteOpen:this.props.isPaletteOpen,isEditingEnabled:this.props.isEditingEnabled}))}return b.default.createElement("div",{width:"100%",draggable:"false",className:"palette-content-list palette-scroll"},e)}}]),o}(b.default.Component);function Q(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var ee=function(n){t._inherits(o,n);var i=Q(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={selectedCategory:""},a.categorySelected=a.categorySelected.bind(t._assertThisInitialized(a)),a.getUniqueCategories=a.getUniqueCategories.bind(t._assertThisInitialized(a)),a.getSelectedCategory=a.getSelectedCategory.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"getUniqueCategories",value:function(e){var t=[];if(e)for(var n=0;n<e.length;n++)-1===t.indexOf(e[n].label)&&t.push(e[n]);return t}},{key:"getSelectedCategory",value:function(e){var t={};if(e)for(var n=0;n<e.length;n++)e[n].label===this.state.selectedCategory&&(t=e[n]);return t}},{key:"categorySelected",value:function(e){this.setState({selectedCategory:e.target.firstChild.data})}},{key:"render",value:function(){var e=this.getUniqueCategories(this.props.paletteJSON.categories),t=this.getSelectedCategory(this.props.paletteJSON.categories),n=t&&t.node_types?t.node_types:[],i=n.map((function(e){return{nodeType:e,category:t}})),o=this.props.showGrid?b.default.createElement(V,{category:t,nodeTypes:n,canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled}):b.default.createElement(J,{category:t,nodeTypeInfos:i,canvasController:this.props.canvasController,isPaletteOpen:!0,isEditingEnabled:this.props.isEditingEnabled});return b.default.createElement("div",{className:"palette-dialog-content",ref:"palettecontent"},b.default.createElement(j,{categories:e,selectedCategory:this.state.selectedCategory,categorySelectedMethod:this.categorySelected}),o)}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.paletteJSON&&e.paletteJSON.categories&&e.paletteJSON.categories.length>0&&""===t.selectedCategory?{selectedCategory:e.paletteJSON.categories[0].label}:{}}}]),o}(b.default.Component);function te(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var ne=function(n){t._inherits(o,n);var i=te(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={xPos:100,yPos:100,showGrid:!0},a.showGrid=a.showGrid.bind(t._assertThisInitialized(a)),a.mouseDownOnTopBar=a.mouseDownOnTopBar.bind(t._assertThisInitialized(a)),a.mouseDownOnPalette=a.mouseDownOnPalette.bind(t._assertThisInitialized(a)),a.mouseMove=a.mouseMove.bind(t._assertThisInitialized(a)),a.mouseUp=a.mouseUp.bind(t._assertThisInitialized(a)),a.windowResize=a.windowResize.bind(t._assertThisInitialized(a)),a.windowMaximize=a.windowMaximize.bind(t._assertThisInitialized(a)),a.getPaletteDiv=a.getPaletteDiv.bind(t._assertThisInitialized(a)),a.resizePalette=a.resizePalette.bind(t._assertThisInitialized(a)),a.movePalette=a.movePalette.bind(t._assertThisInitialized(a)),a.setResizingCursors=a.setResizingCursors.bind(t._assertThisInitialized(a)),a.setSizingHoverEdge=a.setSizingHoverEdge.bind(t._assertThisInitialized(a)),a.snapToWidth=a.snapToWidth.bind(t._assertThisInitialized(a)),a.snapToHeight=a.snapToHeight.bind(t._assertThisInitialized(a)),a.removePx=a.removePx.bind(t._assertThisInitialized(a)),a.dragging=!1,a.dragOffsetY=0,a.dragOffsetX=0,a.verticalSizingAction="",a.verticalSizingHover="",a.horizontalSizingAction="",a.hoizontalSizingHover="",a.savedWidth=0,a.savedLeft=0,a.savedHeight=0,a.savedTop=0,a.hoverZoneSize=3,a.totalHoverZoneSize=2*a.hoverZoneSize,a.adjustedWidth=137,a.adjustedHeight=51,a.adjustedScrollBarWidth=15,a.isMaximized=!1,a.paletteNodes=[],a.hackPaletteOffset=46,a.hackPaletteTopOffset=a.hackPaletteOffset+4,window.addEventListener("mousemove",a.mouseMove,!1),window.addEventListener("mouseup",a.mouseUp,!1),window.addEventListener("resize",a.windowResize,!1),a}return e._createClass(o,[{key:"componentDidUpdate",value:function(){this.windowResize()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mousemove",this.mouseMove),window.removeEventListener("mouseup",this.mouseUp),window.removeEventListener("resize",this.windowResize)}},{key:"getAdjustedMousePositionBottom",value:function(e,t){var n=e.clientY;return n>t.offsetTop+t.offsetHeight-this.hoverZoneSize&&(n=t.offsetTop+t.offsetHeight-this.hoverZoneSize),n}},{key:"getAdjustedMousePositionLeft",value:function(e,t){var n=e.clientX;return n<t.offsetLeft+this.hoverZoneSize&&(n=t.offsetLeft+this.hoverZoneSize),n}},{key:"getAdjustedMousePositionRight",value:function(e,t){var n=e.clientX;return n>t.offsetLeft+t.offsetWidth-this.hoverZoneSize&&(n=t.offsetLeft+t.offsetWidth-this.hoverZoneSize),n}},{key:"getAdjustedMousePositionTop",value:function(e,t){var n=e.clientY;return n<t.offsetTop+this.hoverZoneSize&&(n=t.offsetTop+this.hoverZoneSize),n}},{key:"getPaletteDiv",value:function(){return this.refs.palette}},{key:"getStyleProperty",value:function(e,t){var n=e.charAt(0),i=e.substring(1),o="#"===n?document.getElementById(i):document.getElementsByClassName(i)[0];return window.getComputedStyle(o,null).getPropertyValue(t)}},{key:"setResizingCursors",value:function(e){var t=this.getPaletteDiv();this.setSizingHoverEdge(e,t),"top"===this.verticalSizingHover?"left"===this.horizontalSizingHover?t.style.cursor="nwse-resize":"right"===this.horizontalSizingHover?t.style.cursor="nesw-resize":t.style.cursor="ns-resize":"bottom"===this.verticalSizingHover?"left"===this.horizontalSizingHover?t.style.cursor="nesw-resize":"right"===this.horizontalSizingHover?t.style.cursor="nwse-resize":t.style.cursor="ns-resize":"left"===this.horizontalSizingHover||"right"===this.horizontalSizingHover?t.style.cursor="ew-resize":t.style.cursor="default"}},{key:"setContentDivHeight",value:function(e,t){var n=t-this.removePx(this.getStyleProperty(".palette-dialog-topbar","height"))-this.totalHoverZoneSize+"px",i=e.childNodes[1];i.style.height=n,i.childNodes[0].style.height=n,i.childNodes[1].style.height=n,i.childNodes[2].style.height=n}},{key:"setSizingHoverEdge",value:function(e,t){e.clientX>t.offsetLeft&&e.clientX<t.offsetLeft+this.totalHoverZoneSize?this.horizontalSizingHover="left":e.clientX<t.offsetLeft+t.offsetWidth&&e.clientX>t.offsetLeft+t.offsetWidth-this.totalHoverZoneSize?this.horizontalSizingHover="right":(this.horizontalSizingHover="",this.horizontalSizingAction=""),e.clientY>t.offsetTop+this.hackPaletteTopOffset&&e.clientY<t.offsetTop+this.hackPaletteTopOffset+this.totalHoverZoneSize?this.verticalSizingHover="top":e.clientY<t.offsetTop+t.offsetHeight+this.hackPaletteOffset&&e.clientY>t.offsetTop+t.offsetHeight+this.hackPaletteOffset-this.totalHoverZoneSize?this.verticalSizingHover="bottom":(this.verticalSizingHover="",this.verticalSizingAction="")}},{key:"mouseDownOnTopBar",value:function(e){this.dragging=!0;var t=this.getPaletteDiv();this.dragOffsetX=e.clientX-t.offsetLeft,this.dragOffsetY=e.clientY-t.offsetTop}},{key:"mouseDownOnPalette",value:function(e){var t=this.getPaletteDiv();""===this.verticalSizingHover&&""===this.horizontalSizingHover||(this.verticalSizingAction=this.verticalSizingHover,this.horizontalSizingAction=this.horizontalSizingHover,this.savedWidth=t.offsetWidth,this.savedLeft=t.offsetLeft,this.savedHeight=t.offsetHeight,this.savedTop=t.offsetTop)}},{key:"mouseMove",value:function(e){""!==this.verticalSizingAction||""!==this.horizontalSizingAction?this.resizePalette(e):!0===this.dragging?this.movePalette(e):this.setResizingCursors(e)}},{key:"mouseUp",value:function(){var e=this.getPaletteDiv();if(this.state.showGrid&&""!==this.horizontalSizingAction){var t=this.removePx(e.style.width);""!==t&&(t=this.snapToWidth(t)),e.style.width=t+"px";var n=e.childNodes[1].childNodes[1];n.clientHeight<n.scrollHeight&&(e.style.width=t+this.adjustedScrollBarWidth+"px")}if(""!==this.verticalSizingAction){var i=this.removePx(e.style.height);if(""!==i){var o=this.snapToHeight(i);e.style.height=o+"px",this.setContentDivHeight(e,o)}}this.dragging=!1,this.verticalSizingAction="",this.horizontalSizingAction="",this.verticalSizingHover="",this.horizontalSizingHover=""}},{key:"movePalette",value:function(e){var t=this.getPaletteDiv(),n=document.getElementById(this.props.parentDivId),i=e.clientX-this.dragOffsetX,o=e.clientY-this.dragOffsetY;i<n.offsetLeft+this.hoverZoneSize&&(i=n.offsetLeft+this.hoverZoneSize),o<n.offsetTop+this.hoverZoneSize&&(o=n.offsetTop+this.hoverZoneSize),i+t.offsetWidth>n.offsetLeft+n.offsetWidth&&(i=n.offsetLeft+n.offsetWidth-t.offsetWidth-this.hoverZoneSize),o+t.offsetHeight>n.offsetTop+n.offsetHeight&&(o=n.offsetTop+n.offsetHeight-t.offsetHeight-this.hoverZoneSize),t.style.left=i+"px",t.style.top=o+"px"}},{key:"removePx",value:function(e){return parseInt(e.substring(0,e.indexOf("px")),10)}},{key:"resizePalette",value:function(e){var t=this.getPaletteDiv(),n=document.getElementById(this.props.parentDivId);this.isMaximized=!1;var i=this.removePx(this.getStyleProperty(".palette-dialog-grid-node-outer","width"))+this.removePx(this.getStyleProperty(".palette-dialog-categories","min-width"))+2*this.hoverZoneSize,o=this.removePx(this.getStyleProperty(".palette-dialog-grid-node-outer","height"))+this.removePx(this.getStyleProperty(".palette-dialog-topbar","height"))+2*this.hoverZoneSize;if("left"===this.horizontalSizingAction){var a=this.getAdjustedMousePositionLeft(e,n),r=this.savedWidth-(a-this.savedLeft);r<=i?t.style.width=i+"px":(t.style.width=r+"px",t.style.left=a+"px")}if("right"===this.horizontalSizingAction){var s=this.getAdjustedMousePositionRight(e,n)-this.savedLeft;s<=i&&(s=i),t.style.width=s+"px"}if("top"===this.verticalSizingAction){var l=this.getAdjustedMousePositionTop(e,n),c=this.savedHeight-(l-this.savedTop);c<=o?(t.style.height=o+"px",this.setContentDivHeight(t,this.minHeight)):(t.style.height=c+"px",t.style.top=l-this.dragOffsetY+"px",this.setContentDivHeight(t,c))}if("bottom"===this.verticalSizingAction){var u=this.getAdjustedMousePositionBottom(e,n)-this.savedTop-this.hackPaletteOffset;u<=o&&(u=o),t.style.height=u+"px",this.setContentDivHeight(t,u)}}},{key:"snapToWidth",value:function(e){var t=this.removePx(this.getStyleProperty(".palette-dialog-grid-node-outer","width"));return Math.round((e-this.adjustedWidth)/t)*t+this.adjustedWidth}},{key:"snapToHeight",value:function(e){var t=this.state.showGrid?this.removePx(this.getStyleProperty(".palette-dialog-grid-node-outer","height")):this.removePx(this.getStyleProperty(".palette-list-item","height"));return Math.round((e-this.adjustedHeight)/t)*t+this.adjustedHeight}},{key:"windowResize",value:function(){var e=this.getPaletteDiv(),t=document.getElementById(this.props.parentDivId);if(t)if(this.isMaximized){var n=t.offsetLeft+this.hoverZoneSize;e.style.left=n+"px";var i=t.offsetWidth-this.totalHoverZoneSize;e.style.width=i+"px";var o=t.offsetTop+this.hoverZoneSize;e.style.top=o+"px";var a=t.offsetHeight-this.totalHoverZoneSize;e.style.height=a+"px",this.setContentDivHeight(e,a)}else{if(e.offsetLeft+e.offsetWidth+this.hoverZoneSize>t.offsetLeft+t.offsetWidth){var r=t.offsetLeft+t.offsetWidth-e.offsetWidth-this.hoverZoneSize;e.style.left=r+"px"}var s=t.offsetWidth-this.totalHoverZoneSize;if(s<e.offsetWidth&&(e.style.width=s+"px",e.style.left=t.offsetLeft+t.offsetWidth-e.offsetWidth-this.hoverZoneSize+"px"),e.offsetTop+e.offsetHeight+this.hoverZoneSize>t.offsetTop+t.offsetHeight){var l=t.offsetTop+t.offsetHeight-e.offsetHeight-this.hoverZoneSize;e.style.top=l+"px"}var c=t.offsetHeight-this.totalHoverZoneSize;c<e.offsetHeight&&(e.style.height=c+"px",e.style.top=t.offsetTop+t.offsetHeight-e.offsetHeight-this.hoverZoneSize+"px",this.setContentDivHeight(e,c))}}},{key:"windowMaximize",value:function(){var e=this.getPaletteDiv(),t=document.getElementById(this.props.parentDivId);if(t)if(this.isMaximized)e.style.width=this.savedWidth+"px",e.style.left=this.savedLeft+"px",e.style.height=this.savedHeight+"px",e.style.top=this.savedTop+"px",this.setContentDivHeight(e,this.savedHeight),this.isMaximized=!1,this.windowResize();else{this.savedWidth=e.offsetWidth,this.savedLeft=e.offsetLeft,this.savedHeight=e.offsetHeight,this.savedTop=e.offsetTop;var n=t.offsetWidth-this.totalHoverZoneSize+1;e.style.width=n+"px",e.style.left=t.offsetLeft+this.hoverZoneSize+"px";var i=t.offsetHeight-this.totalHoverZoneSize+1;e.style.height=i+"px",e.style.top=t.offsetTop+this.hoverZoneSize+"px",this.setContentDivHeight(e,i),this.isMaximized=!0}}},{key:"showGrid",value:function(e){this.setState({showGrid:e})}},{key:"render",value:function(){var e=this.props.showPalette?"block":"none";return b.default.createElement("nav",{"aria-label":this.props.intl.formatMessage({id:"palette.dialog.label",defaultMessage:I}),role:"navigation"},b.default.createElement("div",{className:"palette-dialog-div",ref:"palette",onMouseDown:this.mouseDownOnPalette,style:{display:e}},b.default.createElement(z,{mouseDownMethod:this.mouseDownOnTopBar,showGridMethod:this.showGrid,windowMaximizeMethod:this.windowMaximize,showGrid:this.state.showGrid,canvasController:this.props.canvasController}),b.default.createElement(ee,{paletteJSON:this.props.paletteJSON,showGrid:this.state.showGrid,canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled})))}}]),o}(b.default.Component),ie=o.injectIntl(ne),oe=a._root,ae=function(){return oe.Date.now()},re=a.isObject_1,se=ae,le=c.toNumber_1,ce=Math.max,ue=Math.min;var de=function(e,t,n){var i,o,a,r,s,l,c=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,a=o;return i=o=void 0,c=t,r=e.apply(a,n)}function g(e){return c=e,s=setTimeout(v,t),u?p(e):r}function f(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=a}function v(){var e=se();if(f(e))return y(e);s=setTimeout(v,function(e){var n=t-(e-l);return d?ue(n,a-(e-c)):n}(e))}function y(e){return s=void 0,h&&i?p(e):(i=o=void 0,r)}function m(){var e=se(),n=f(e);if(i=arguments,o=this,l=e,n){if(void 0===s)return g(l);if(d)return clearTimeout(s),s=setTimeout(v,t),p(l)}return void 0===s&&(s=setTimeout(v,t)),r}return t=le(t)||0,re(n)&&(u=!!n.leading,a=(d="maxWait"in n)?ce(le(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),m.cancel=function(){void 0!==s&&clearTimeout(s),c=0,i=l=o=s=void 0},m.flush=function(){return void 0===s?r:y(se())},m};function he(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return pe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pe(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==n.return||n.return()}finally{if(s)throw a}}}}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function ge(e,t){var n=[];if(e.node_types){var i,o=he(e.node_types);try{for(o.s();!(i=o.n()).done;){var a=i.value,r=fe(a,e,t);r&&n.push({nodeType:a,category:e,occurrenceInfo:r})}}catch(e){o.e(e)}finally{o.f()}}return n}function fe(e,t,n){if(n.length>0){var i=function(e,t){var n=ve(a.has_1(e,"label")&&e.label?e.label.toLowerCase():"",t),i=n.occurrences,o=n.hitCounts;return{catLabelOccurrences:i,catLabelHitCounts:o}}(t,n),o=i.catLabelOccurrences,r=i.catLabelHitCounts,s=function(e,t){var n=ve(a.has_1(e,"app_data.ui_data.label")&&e.app_data.ui_data.label?e.app_data.ui_data.label.toLowerCase():"",t),i=n.occurrences,o=n.hitCounts;return{nodeLabelOccurrences:i,nodeLabelHitCounts:o}}(e,n),l=s.nodeLabelOccurrences,c=s.nodeLabelHitCounts,u=function(e,t){var n=ve(a.has_1(e,"app_data.ui_data.description")&&e.app_data.ui_data.description?e.app_data.ui_data.description.toLowerCase():"",t),i=n.occurrences,o=n.hitCounts;return{nodeDescOccurrences:i,nodeDescHitCounts:o}}(e,n),d=u.nodeDescOccurrences,h=u.nodeDescHitCounts;if(o.length>0||l.length>0||d.length>0){var p=function(e,t,n,i){for(var o=0,a=0,r=0;r<i;r++)o+=e[r]+10*t[r]+n[r],e[r]+t[r]+n[r]>0&&a++;return o+50*a}(r,c,h,n.length);return{catLabelOccurrences:o,nodeLabelOccurrences:l,nodeDescOccurrences:d,ranking:p}}}return null}function ve(e,t){var n=[],i=[];return t.forEach((function(t){if(t){var o=function(e,t){var n=[],i=0,o=0,a=0;for(;o>-1&&a<20;)(o=e.indexOf(t,i))>-1&&(n.push({start:o,end:o+t.length}),i=o+t.length,a++);return n}(e,t);n=function(e,t){if(0===e.length)return t;if(0===t.length)return e;var n=[];t.forEach((function(t){var i=!1;e.forEach((function(e){t.start<=e.start&&t.end>=e.end?(e.start=t.start,e.end=t.end,i=!0):t.start>=e.start&&t.start<e.end?(t.end>=e.end&&(e.end=t.end),i=!0):t.end>e.start&&t.end<=e.end&&(t.start<e.start&&(e.start=t.start),i=!0)})),i||n.push(t)}));var i=e.concat(n);return i=i.sort((function(e,t){return e.start<t.start?-1:1}))}(n,o),i.push(o.length>0?1:0)}})),{occurrences:n,hitCounts:i}}function ye(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var me=function(n){t._inherits(o,n);var i=ye(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={isOpen:!1},a.onMouseOver=a.onMouseOver.bind(t._assertThisInitialized(a)),a.onMouseLeave=a.onMouseLeave.bind(t._assertThisInitialized(a)),a.categorySelected=a.categorySelected.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"onMouseOver",value:function(e){this.props.canvasController.openTip({id:"paletteTip_"+this.props.category.id,type:l.TIP_TYPE_PALETTE_CATEGORY,targetObj:e.currentTarget,category:this.props.category})}},{key:"onMouseLeave",value:function(){this.props.canvasController.closeTip()}},{key:"getDisplayLabel",value:function(){return!0===this.props.isPaletteOpen?this.props.category.label:!this.props.category.image&&this.props.category.label&&this.props.category.label.length>0?this.props.category.label.substr(0,3):null}},{key:"getInlineLoadingRenderCategory",value:function(){var e="";this.props.isPaletteOpen&&(e=this.props.category.loading_text);var t=b.default.createElement("div",{className:"palette-flyout-category"},b.default.createElement("div",{className:"palette-flyout-category-item-loading"},b.default.createElement(d.InlineLoading,{description:e,iconDescription:e,onSuccess:function(){return null},status:"active",successDelay:1500})));return b.default.createElement(d.AccordionItem,{className:"palette-loading-category",title:t})}},{key:"getRenderCategory",value:function(){var e=this,t=this.getTitleObj(),n=this.getContent();return b.default.createElement(d.AccordionItem,{title:t,onHeadingClick:function(t){var n=t.isOpen;return e.setState({isOpen:n})}},n)}},{key:"getTitleObj",value:function(){var e=this.getItemImage(),t=this.getItemText();return b.default.createElement("div",{className:"palette-flyout-category","data-id":a.get_1(this.props.category,"id",""),onClick:this.categorySelected,value:this.props.category.label,onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave},b.default.createElement("div",{className:"palette-flyout-category-item"},e,t))}},{key:"getItemText",value:function(){var e=null,t=this.getDisplayLabel();if(!0===this.props.isPaletteOpen){var n=this.props.category.image?"palette-flyout-category-text":"palette-flyout-category-text-no-image";e=b.default.createElement("span",{className:n},t)}else!this.props.category.image&&this.props.category.label&&this.props.category.label.length>0&&(e=b.default.createElement("span",{className:"palette-flyout-category-text-abbr"},t));return e}},{key:"getItemImage",value:function(){var e=null;return this.props.category.image&&""!==this.props.category.image&&(e=this.props.category.image.endsWith(".svg")?b.default.createElement("div",null,b.default.createElement(T.default,{src:this.props.category.image,className:"palette-flyout-category-item-icon",draggable:"false"})):b.default.createElement("div",null,b.default.createElement("img",{src:this.props.category.image,className:"palette-flyout-category-item-icon",draggable:"false"}))),e}},{key:"getContent",value:function(){var e=this;if(this.state.isOpen){var t=this.props.category.node_types.map((function(t){return{nodeType:t,category:e.props.category}}));return b.default.createElement(J,{key:this.props.category.id+"-nodes",category:this.props.category,nodeTypeInfos:t,canvasController:this.props.canvasController,isPaletteOpen:this.props.isPaletteOpen,isEditingEnabled:this.props.isEditingEnabled})}return null}},{key:"categorySelected",value:function(){this.props.categorySelectedMethod(this.props.category.id)}},{key:"render",value:function(){return this.props.category.loading_text?this.getInlineLoadingRenderCategory():this.getRenderCategory()}}]),o}(b.default.Component);function Ce(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var ke=function(n){t._inherits(o,n);var i=Ce(o);function o(){var n;return e._classCallCheck(this,o),(n=i.call(this)).state={searchString:""},n.searchOnClick=n.searchOnClick.bind(t._assertThisInitialized(n)),n.handleSearchStringChange=n.handleSearchStringChange.bind(t._assertThisInitialized(n)),n}return e._createClass(o,[{key:"handleSearchStringChange",value:function(e){var t=this,n=e.target.value||"";this.setState({searchString:n},(function(){return t.props.handleSearchStringChange(n)}))}},{key:"searchOnClick",value:function(){this.props.isPaletteOpen||this.props.canvasController.openPalette()}},{key:"render",value:function(){var e=this.props.intl.formatMessage({id:"palette.flyout.search.placeholder",defaultMessage:L});return b.default.createElement("div",{className:"palette-flyout-search-container",id:"palette-flyout-search"},b.default.createElement(d.Search,{key:"palette-flyout-search",className:"palette-flyout-search",placeholder:e,onChange:this.handleSearchStringChange,size:"sm",value:this.state.searchString,labelText:e,onClick:this.searchOnClick}))}}]),o}(b.default.Component),be=o.injectIntl(ke);function Te(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Pe=function(n){t._inherits(o,n);var i=Te(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).state={},n}return e._createClass(o,[{key:"getNoResultsDiv",value:function(){var e=this.props.intl.formatMessage({id:"palette.flyout.search.noresults",defaultMessage:_}),t=this.props.intl.formatMessage({id:"palette.flyout.search.adjustsearch",defaultMessage:N});return b.default.createElement("div",null,b.default.createElement("div",{className:"palette-no-results-title"},e),b.default.createElement("br",null),b.default.createElement("div",{className:"palette-no-results-desc"},t))}},{key:"getContentListDiv",value:function(){for(var e=[],t=0;t<this.props.nodeTypeInfos.length;t++){var n="item_"+t;e.push(b.default.createElement("div",{key:n},b.default.createElement(q,{nodeTypeInfo:this.props.nodeTypeInfos[t],isDisplaySearchResult:!0,isShowRanking:this.props.isShowRanking,canvasController:this.props.canvasController,isPaletteOpen:this.props.isPaletteOpen,isEditingEnabled:this.props.isEditingEnabled})))}if(this.props.isNodeTypeInfosArrayTruncated){var i=this.props.intl.formatMessage({id:"palette.flyout.search.resultsrestricted",defaultMessage:x});e.push(b.default.createElement("div",{key:"restrict-item",className:"palette-flyout-restrict-item"},i))}return b.default.createElement("div",{width:"100%",draggable:"false",className:"palette-scroll"},e)}},{key:"render",value:function(){return 0===this.props.nodeTypeInfos.length?this.getNoResultsDiv():this.getContentListDiv()}}]),o}(b.default.Component),Le=o.injectIntl(Pe);function _e(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ne(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ne(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==n.return||n.return()}finally{if(s)throw a}}}}function Ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function xe(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var we=new h.Logger("PaletteFlyoutContent"),Se=function(n){t._inherits(o,n);var i=xe(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={selectedCategoryIds:[],searchString:""},a.categories=[],a.categorySelected=a.categorySelected.bind(t._assertThisInitialized(a)),a.getUniqueCategories=a.getUniqueCategories.bind(t._assertThisInitialized(a)),a.setSearchString=a.setSearchString.bind(t._assertThisInitialized(a)),a.handleSearchStringChange=a.handleSearchStringChange.bind(t._assertThisInitialized(a)),a.setSearchStringThrottled=de(a.setSearchString,200),a}return e._createClass(o,[{key:"getUniqueCategories",value:function(e){var t=[];if(e){var n,i=_e(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;-1===t.indexOf(o.label)&&t.push(o)}}catch(e){i.e(e)}finally{i.f()}}return t}},{key:"getContentDivs",value:function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];t.push(b.default.createElement("div",{key:i.label+"-container"},b.default.createElement(me,{key:i.id,category:i,categorySelectedMethod:this.categorySelected,canvasController:this.props.canvasController,isPaletteOpen:this.props.isPaletteOpen,isEditingEnabled:this.props.isEditingEnabled})))}return b.default.createElement(d.Accordion,null,t)}},{key:"getFilteredContentDivs",value:function(e){we.logStartTimer("getFilteredNodeTypeInfos");var t=function(e,t){for(var n=[],i=t.toLowerCase().split(" ").filter((function(e){return""!==e})),o=0;o<e.length;o++)n.push.apply(n,u._toConsumableArray(ge(e[o],i)));return n.sort((function(e,t){return e.occurrenceInfo.ranking<=t.occurrenceInfo.ranking?1:-1}))}(this.categories,this.state.searchString);we.logEndTimer("getFilteredNodeTypeInfos");var n=!1;return t.length>10&&(t=t.slice(0,10),n=!0),[b.default.createElement(Le,{key:"filtered-nodes",nodeTypeInfos:t,canvasController:this.props.canvasController,isPaletteOpen:this.props.isPaletteOpen,isEditingEnabled:this.props.isEditingEnabled,isNodeTypeInfosArrayTruncated:n})]}},{key:"setSearchString",value:function(){this.setState({searchString:this.ss})}},{key:"handleSearchStringChange",value:function(e){this.ss=e,this.setSearchStringThrottled()}},{key:"categorySelected",value:function(e){var t=this.isCategorySelected(e)?this.state.selectedCategoryIds.filter((function(t){return t!==e})):this.state.selectedCategoryIds.concat(e);this.setState({selectedCategoryIds:t})}},{key:"isCategorySelected",value:function(e){return this.state.selectedCategoryIds.some((function(t){return t===e}))}},{key:"render",value:function(){this.categories=this.getUniqueCategories(this.props.paletteJSON.categories);var e=this.props.isPaletteOpen&&this.state.searchString?this.getFilteredContentDivs(this.categories):this.getContentDivs(this.categories),t=b.default.createElement("div",{className:"palette-flyout-categories"},e),n=b.default.createElement(be,{handleSearchStringChange:this.handleSearchStringChange,isPaletteOpen:this.props.isPaletteOpen,canvasController:this.props.canvasController});return b.default.createElement("div",{className:"palette-flyout-content"},n,t)}}]),o}(b.default.Component);function Ee(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Ie=function(n){t._inherits(o,n);var i=Ee(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).paletteNodes=[],n}return e._createClass(o,[{key:"render",value:function(){var e="palette-flyout-div";return this.props.showPalette?e+=" palette-flyout-div-open":(e+=" palette-flyout-div-closed",this.props.enableNarrowPalette&&(e+=" palette-flyout-div-narrow")),b.default.createElement("nav",{"aria-label":this.props.intl.formatMessage({id:"palette.flyout.label",defaultMessage:E}),role:"navigation"},b.default.createElement("div",{className:e},b.default.createElement(Se,{paletteJSON:this.props.paletteJSON,canvasController:this.props.canvasController,isPaletteOpen:this.props.showPalette,isEditingEnabled:this.props.isEditingEnabled})))}}]),o}(b.default.Component),De=o.injectIntl(Ie);function Oe(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Ae=function(n){t._inherits(o,n);var i=Oe(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).logger=new h.Logger("Palette"),n}return e._createClass(o,[{key:"render",value:function(){this.logger.log("render");var e=null;return this.props.enablePaletteLayout===l.PALETTE_LAYOUT_FLYOUT?e=b.default.createElement(De,{enableNarrowPalette:this.props.enableNarrowPalette,paletteJSON:this.props.paletteJSON,showPalette:this.props.showPalette,canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled}):this.props.enablePaletteLayout===l.PALETTE_LAYOUT_MODAL&&(e=b.default.createElement(ie,{paletteJSON:this.props.paletteJSON,showPalette:this.props.showPalette,parentDivId:this.props.containingDivId,canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled})),e}}]),o}(b.default.Component),Me=i.connect((function(e,t){return{enablePaletteLayout:e.canvasconfig.enablePaletteLayout,enableNarrowPalette:e.canvasconfig.enableNarrowPalette,isEditingEnabled:e.canvasconfig.enableEditingActions,paletteJSON:e.palette.content,showPalette:void 0!==e.palette.isOpen&&e.palette.isOpen}}))(Ae);function ze(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Re=function(n){t._inherits(o,n);var i=ze(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={},a.handleClick=a.handleClick.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.handleClick,!0)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.handleClick,!0)}},{key:"handleClick",value:function(e){this.props.canvasController.closeTip()}},{key:"render",value:function(){var e=null,t=null;switch(this.props.type){case l.TIP_TYPE_PALETTE_ITEM:case l.TIP_TYPE_PALETTE_CATEGORY:t="right";break;case l.TIP_TYPE_NODE:case l.TIP_TYPE_PORT:case l.TIP_TYPE_DEC:case l.TIP_TYPE_LINK:case l.TIP_TYPE_STATE_TAG:default:t="bottom"}if(this.props.customContent)e=this.props.customContent;else switch(this.props.type){case l.TIP_TYPE_PALETTE_ITEM:e=b.default.createElement("div",{className:"tip-palette-item"},b.default.createElement("div",{className:"tip-palette-category"},this.props.category.label),b.default.createElement("div",{className:"tip-palette-label"},this.props.nodeTemplate.app_data.ui_data.label),this.props.nodeTemplate.app_data.ui_data.description?b.default.createElement("div",{className:"tip-palette-desc"},this.props.nodeTemplate.app_data.ui_data.description):"");break;case l.TIP_TYPE_PALETTE_CATEGORY:e=b.default.createElement("div",{className:"tip-palette-item"},b.default.createElement("div",{className:"tip-palette-label"},this.props.category.label),this.props.category.description?b.default.createElement("div",{className:"tip-palette-desc"},this.props.category.description):"");break;case l.TIP_TYPE_NODE:var n=null;this.props.canvasController.getObjectModel().hasErrorMessage(this.props.node)?n=b.default.createElement(r.Icon,{type:l.ERROR,className:"tip-node-status error"}):this.props.canvasController.getObjectModel().hasWarningMessage(this.props.node)&&(n=b.default.createElement(r.Icon,{type:l.WARNING,className:"tip-node-status warning"}));var i=this.props.canvasController.getObjectModel().getPaletteNode(this.props.node.op),o=this.props.node.label,s=i&&i.app_data&&i.app_data.ui_data?i.app_data.ui_data.label:o;if(o!==s&&(o+=" (".concat(s,")")),!(n||o||s||this.props.node.description))return null;e=b.default.createElement("div",{className:"tip-node"},n,b.default.createElement("div",{className:"tip-node-label"},o),this.props.node.description?b.default.createElement("div",{className:"tip-node-desc"},this.props.node.description):"");break;case l.TIP_TYPE_PORT:e=a.isEmpty_1(this.props.port.label)?null:b.default.createElement("div",{className:"tip-port"},this.props.port.label);break;case l.TIP_TYPE_DEC:e=a.isEmpty_1(this.props.decoration.tooltip)?null:b.default.createElement("div",{className:"tip-decoration"},this.props.decoration.tooltip);break;case l.TIP_TYPE_LINK:break;case l.TIP_TYPE_STATE_TAG:e=a.isEmpty_1(this.props.stateTagText)?null:b.default.createElement("div",{className:"tip-state-tag"},this.props.stateTagText);break;default:e=null}return null!==e?b.default.createElement(p,{tip:e,direction:t,id:this.props.id,targetObj:this.props.targetObj,mousePos:this.props.mousePos,className:[l.TIP_TYPE_NODE,l.TIP_TYPE_PORT,l.TIP_TYPE_DEC,l.TIP_TYPE_LINK].includes(this.props.type)?"definition-tooltip":null}):null}}]),o}(b.default.Component),He=i.connect((function(e,t){return{id:e.tooltip.id,type:e.tooltip.type,targetObj:e.tooltip.targetObj,mousePos:e.tooltip.mousePos,customContent:e.tooltip.customContent,node:e.tooltip.node,port:e.tooltip.port,decoration:e.tooltip.decoration,nodeTemplate:e.tooltip.nodeTemplate,category:e.tooltip.category,stateTagText:e.tooltip.stateTagText}}))(Re);function Ue(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var je=function(n){t._inherits(o,n);var i=Ue(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).logger=new h.Logger("CC-ContextMenu"),n}return e._createClass(o,[{key:"render",value:function(){this.logger.log("render");var e=null;return a.isEmpty_1(this.props.contextMenuDef)||(e=b.default.createElement(v,{containingDivId:this.props.containingDivId,contextMenuDef:this.props.contextMenuDef,contextMenuActionHandler:this.props.canvasController.contextMenuActionHandler,contextMenuPos:this.props.canvasController.getContextMenuPos(),closeContextMenu:this.props.canvasController.closeContextMenu,stopPropagation:!0})),e}}]),o}(b.default.Component),Be=i.connect((function(e,t){return{contextMenuDef:e.contextmenu.menuDef}}))(je),Fe={"toolbar.palette":"Palette","toolbar.zoomIn":"Zoom in","toolbar.zoomOut":"Zoom out","toolbar.zoomToFit":"Zoom to fit","toolbar.overflowMenu":"Overflow menu","toolbar.label":"Canvas toolbar"};function Ge(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Ye=function(n){t._inherits(o,n);var i=Ge(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).getLabel=a.getLabel.bind(t._assertThisInitialized(a)),a.logger=new h.Logger("CC-Toolbar"),a}return e._createClass(o,[{key:"getLabel",value:function(e,t){var n=f.defaultMessages1[e]?f.defaultMessages1[e]:Fe[e];return this.props.intl.formatMessage({id:e,defaultMessage:n},t)}},{key:"getJsxLabel",value:function(e,t,n){var i=f.CanvasUtils.isMacintosh()?"⌘":"Ctrl",o=t?i+" + "+t:null,a=n?i+" + "+n:null;return b.default.createElement("div",null,this.getLabel(e),b.default.createElement("br",null),o,b.default.createElement("br",null),a)}},{key:"getTextToolbar",value:function(){var e=this,t=this.getJsxLabel("texttoolbar.headerAction",">","<"),n=this.getJsxLabel("texttoolbar.boldAction","b"),i=this.getJsxLabel("texttoolbar.italicsAction","i"),o=this.getJsxLabel("texttoolbar.strikethroughAction","shift + x"),a=this.getJsxLabel("texttoolbar.codeAction","e"),r=this.getJsxLabel("texttoolbar.linkAction","k"),s=this.getJsxLabel("texttoolbar.quoteAction","shift + >"),l=this.getJsxLabel("texttoolbar.numberedListAction","shift + 7"),c=this.getJsxLabel("texttoolbar.bulletedListAction","shift + 8");return{leftBar:[{action:"header",tooltip:t,jsx:b.default.createElement("div",null,b.default.createElement(d.OverflowMenu,{id:"headerMenu",iconDescription:"",renderIcon:y.TextScale32},b.default.createElement(d.OverflowMenuItem,{itemText:this.getLabel("texttoolbar.titleAction"),onClick:function(t){return e.props.actionHandler("title",t)}}),b.default.createElement(d.OverflowMenuItem,{itemText:this.getLabel("texttoolbar.headerAction"),onClick:function(t){return e.props.actionHandler("header",t)}}),b.default.createElement(d.OverflowMenuItem,{itemText:this.getLabel("texttoolbar.subheaderAction"),onClick:function(t){return e.props.actionHandler("subheader",t)}}),b.default.createElement(d.OverflowMenuItem,{itemText:this.getLabel("texttoolbar.bodyAction"),onClick:function(t){return e.props.actionHandler("body",t)}})),b.default.createElement("svg",{className:"text-toolbar-tick-svg"},b.default.createElement("path",{d:"M 39 39 L 39 33 33 39 Z",className:"text-toolbar-tick-mark"})))},{divider:!0},{action:"bold",label:n,enable:!0,iconEnabled:b.default.createElement(y.TextBold32,null)},{action:"italics",label:i,enable:!0,iconEnabled:b.default.createElement(y.TextItalic32,null)},{action:"strikethrough",label:o,enable:!0,iconEnabled:b.default.createElement(y.TextStrikethrough32,null)},{divider:!0},{action:"code",label:a,enable:!0,iconEnabled:b.default.createElement(y.Code32,null)},{divider:!0},{action:"link",label:r,enable:!0,iconEnabled:b.default.createElement(y.Link32,null)},{divider:!0},{action:"quote",label:s,enable:!0,iconEnabled:b.default.createElement(y.TextIndentMore32,null)},{divider:!0},{action:"numberedList",label:l,enable:!0,iconEnabled:b.default.createElement(y.ListNumbered32,null)},{action:"bulletedList",label:c,enable:!0,iconEnabled:b.default.createElement(y.ListBulleted32,null)}]}}},{key:"render",value:function(){this.logger.log("render");var e=null;return this.props.isOpen&&(e=b.default.createElement("div",{className:"text-toolbar",style:{left:this.props.pos_x,top:this.props.pos_y},onBlur:this.props.blurHandler},b.default.createElement(c.Toolbar,{config:this.getTextToolbar(),instanceId:this.props.canvasController.getInstanceId(),toolbarActionHandler:this.props.actionHandler,tooltipDirection:"top"}))),e}}]),o}(b.default.Component),Xe=i.connect((function(e,t){return{isOpen:e.texttoolbar.isOpen,pos_x:e.texttoolbar.pos_x,pos_y:e.texttoolbar.pos_y,actionHandler:e.texttoolbar.actionHandler,blurHandler:e.texttoolbar.blurHandler}}))(o.injectIntl(Ye));function We(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Ve=function(n){t._inherits(o,n);var i=We(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).logger=new h.Logger("CC-StateTag"),a.onMouseOver=a.onMouseOver.bind(t._assertThisInitialized(a)),a.onMouseLeave=a.onMouseLeave.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"onMouseOver",value:function(e){var t;this.props.stateTagType===l.STATE_TAG_LOCKED?t=this.getLabel("canvas.stateTagTipLocked"):this.props.stateTagType===l.STATE_TAG_READ_ONLY&&(t=this.getLabel("canvas.stateTagTipReadOnly")),this.props.canvasController.openTip({id:"stateTagTip",type:l.TIP_TYPE_STATE_TAG,stateTagType:this.props.stateTagType,stateTagText:t,targetObj:e.currentTarget})}},{key:"onMouseLeave",value:function(){this.props.canvasController.closeTip()}},{key:"getLabel",value:function(e){return this.props.intl.formatMessage({id:e,defaultMessage:f.defaultMessages1[e]})}},{key:"getStateTag",value:function(e,t){return b.default.createElement("div",{className:"state-tag",onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave},t,b.default.createElement("span",null,e))}},{key:"render",value:function(){this.logger.log("render");var e=null;if(this.props.stateTagType===l.STATE_TAG_LOCKED){var t=this.getLabel("canvas.stateTagLocked");e=this.getStateTag(t,b.default.createElement(y.Locked16,null))}else if(this.props.stateTagType===l.STATE_TAG_READ_ONLY){var n=this.getLabel("canvas.stateTagReadOnly");e=this.getStateTag(n,b.default.createElement(y.EditOff16,null))}return e}}]),o}(b.default.Component),Ke=o.injectIntl(Ve),Ze="http://www.w3.org/1999/xhtml",qe={svg:"http://www.w3.org/2000/svg",xhtml:Ze,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function $e(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),qe.hasOwnProperty(t)?{space:qe[t],local:e}:e}function Je(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ze&&t.documentElement.namespaceURI===Ze?t.createElement(e):t.createElementNS(n,e)}}function Qe(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function et(e){var t=$e(e);return(t.local?Qe:Je)(t)}function tt(){}function nt(e){return null==e?tt:function(){return this.querySelector(e)}}function it(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}function ot(){return[]}function at(e){return null==e?ot:function(){return this.querySelectorAll(e)}}function rt(e){return function(){return this.matches(e)}}function st(e){return function(t){return t.matches(e)}}var lt=Array.prototype.find;function ct(){return this.firstElementChild}var ut=Array.prototype.filter;function dt(){return Array.from(this.children)}function ht(e){return new Array(e.length)}function pt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function gt(e){return function(){return e}}function ft(e,t,n,i,o,a){for(var r,s=0,l=t.length,c=a.length;s<c;++s)(r=t[s])?(r.__data__=a[s],i[s]=r):n[s]=new pt(e,a[s]);for(;s<l;++s)(r=t[s])&&(o[s]=r)}function vt(e,t,n,i,o,a,r){var s,l,c,u=new Map,d=t.length,h=a.length,p=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(p[s]=c=r.call(l,l.__data__,s,t)+"",u.has(c)?o[s]=l:u.set(c,l));for(s=0;s<h;++s)c=r.call(e,a[s],s,a)+"",(l=u.get(c))?(i[s]=l,l.__data__=a[s],u.delete(c)):n[s]=new pt(e,a[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(o[s]=l)}function yt(e){return e.__data__}function mt(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function Ct(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function kt(e){return function(){this.removeAttribute(e)}}function bt(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Tt(e,t){return function(){this.setAttribute(e,t)}}function Pt(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Lt(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function _t(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Nt(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function xt(e){return function(){this.style.removeProperty(e)}}function wt(e,t,n){return function(){this.style.setProperty(e,t,n)}}function St(e,t,n){return function(){var i=t.apply(this,arguments);null==i?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function Et(e,t){return e.style.getPropertyValue(t)||Nt(e).getComputedStyle(e,null).getPropertyValue(t)}function It(e){return function(){delete this[e]}}function Dt(e,t){return function(){this[e]=t}}function Ot(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function At(e){return e.trim().split(/^|\s+/)}function Mt(e){return e.classList||new zt(e)}function zt(e){this._node=e,this._names=At(e.getAttribute("class")||"")}function Rt(e,t){for(var n=Mt(e),i=-1,o=t.length;++i<o;)n.add(t[i])}function Ht(e,t){for(var n=Mt(e),i=-1,o=t.length;++i<o;)n.remove(t[i])}function Ut(e){return function(){Rt(this,e)}}function jt(e){return function(){Ht(this,e)}}function Bt(e,t){return function(){(t.apply(this,arguments)?Rt:Ht)(this,e)}}function Ft(){this.textContent=""}function Gt(e){return function(){this.textContent=e}}function Yt(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Xt(){this.innerHTML=""}function Wt(e){return function(){this.innerHTML=e}}function Vt(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Kt(){this.nextSibling&&this.parentNode.appendChild(this)}function Zt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function qt(){return null}function $t(){var e=this.parentNode;e&&e.removeChild(this)}function Jt(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Qt(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function en(e){return e.trim().split(/^|\s+/).map((function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}))}function tn(e){return function(){var t=this.__on;if(t){for(var n,i=0,o=-1,a=t.length;i<a;++i)n=t[i],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function nn(e,t,n){return function(){var i,o=this.__on,a=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var r=0,s=o.length;r<s;++r)if((i=o[r]).type===e.type&&i.name===e.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),void(i.value=t);this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},o?o.push(i):this.__on=[i]}}function on(e,t,n){var i=Nt(e),o=i.CustomEvent;"function"==typeof o?o=new o(t,n):(o=i.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function an(e,t){return function(){return on(this,e,t)}}function rn(e,t){return function(){return on(this,e,t.apply(this,arguments))}}pt.prototype={constructor:pt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}},zt.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var sn=[null];function ln(e,t){this._groups=e,this._parents=t}function cn(){return new ln([[document.documentElement]],sn)}function un(e){return"string"==typeof e?new ln([[document.querySelector(e)]],[document.documentElement]):new ln([[e]],sn)}ln.prototype=cn.prototype={constructor:ln,select:function(e){"function"!=typeof e&&(e=nt(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var a,r,s=t[o],l=s.length,c=i[o]=new Array(l),u=0;u<l;++u)(a=s[u])&&(r=e.call(a,a.__data__,u,s))&&("__data__"in a&&(r.__data__=a.__data__),c[u]=r);return new ln(i,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return it(e.apply(this,arguments))}}(e):at(e);for(var t=this._groups,n=t.length,i=[],o=[],a=0;a<n;++a)for(var r,s=t[a],l=s.length,c=0;c<l;++c)(r=s[c])&&(i.push(e.call(r,r.__data__,c,s)),o.push(r));return new ln(i,o)},selectChild:function(e){return this.select(null==e?ct:function(e){return function(){return lt.call(this.children,e)}}("function"==typeof e?e:st(e)))},selectChildren:function(e){return this.selectAll(null==e?dt:function(e){return function(){return ut.call(this.children,e)}}("function"==typeof e?e:st(e)))},filter:function(e){"function"!=typeof e&&(e=rt(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var a,r=t[o],s=r.length,l=i[o]=[],c=0;c<s;++c)(a=r[c])&&e.call(a,a.__data__,c,r)&&l.push(a);return new ln(i,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,yt);var n=t?vt:ft,i=this._parents,o=this._groups;"function"!=typeof e&&(e=gt(e));for(var a=o.length,r=new Array(a),s=new Array(a),l=new Array(a),c=0;c<a;++c){var u=i[c],d=o[c],h=d.length,p=mt(e.call(u,u&&u.__data__,c,i)),g=p.length,f=s[c]=new Array(g),v=r[c]=new Array(g),y=l[c]=new Array(h);n(u,d,f,v,y,p,t);for(var m,C,k=0,b=0;k<g;++k)if(m=f[k]){for(k>=b&&(b=k+1);!(C=v[b])&&++b<g;);m._next=C||null}}return(r=new ln(r,i))._enter=s,r._exit=l,r},enter:function(){return new ln(this._enter||this._groups.map(ht),this._parents)},exit:function(){return new ln(this._exit||this._groups.map(ht),this._parents)},join:function(e,t,n){var i=this.enter(),o=this,a=this.exit();return"function"==typeof e?(i=e(i))&&(i=i.selection()):i=i.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?a.remove():n(a),i&&o?i.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,i=t._groups,o=n.length,a=i.length,r=Math.min(o,a),s=new Array(o),l=0;l<r;++l)for(var c,u=n[l],d=i[l],h=u.length,p=s[l]=new Array(h),g=0;g<h;++g)(c=u[g]||d[g])&&(p[g]=c);for(;l<o;++l)s[l]=n[l];return new ln(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var i,o=e[t],a=o.length-1,r=o[a];--a>=0;)(i=o[a])&&(r&&4^i.compareDocumentPosition(r)&&r.parentNode.insertBefore(i,r),r=i);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=Ct);for(var n=this._groups,i=n.length,o=new Array(i),a=0;a<i;++a){for(var r,s=n[a],l=s.length,c=o[a]=new Array(l),u=0;u<l;++u)(r=s[u])&&(c[u]=r);c.sort(t)}return new ln(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i=e[t],o=0,a=i.length;o<a;++o){var r=i[o];if(r)return r}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,i=t.length;n<i;++n)for(var o,a=t[n],r=0,s=a.length;r<s;++r)(o=a[r])&&e.call(o,o.__data__,r,a);return this},attr:function(e,t){var n=$e(e);if(arguments.length<2){var i=this.node();return n.local?i.getAttributeNS(n.space,n.local):i.getAttribute(n)}return this.each((null==t?n.local?bt:kt:"function"==typeof t?n.local?_t:Lt:n.local?Pt:Tt)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?xt:"function"==typeof t?St:wt)(e,t,null==n?"":n)):Et(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?It:"function"==typeof t?Ot:Dt)(e,t)):this.node()[e]},classed:function(e,t){var n=At(e+"");if(arguments.length<2){for(var i=Mt(this.node()),o=-1,a=n.length;++o<a;)if(!i.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?Bt:t?Ut:jt)(n,t))},text:function(e){return arguments.length?this.each(null==e?Ft:("function"==typeof e?Yt:Gt)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Xt:("function"==typeof e?Vt:Wt)(e)):this.node().innerHTML},raise:function(){return this.each(Kt)},lower:function(){return this.each(Zt)},append:function(e){var t="function"==typeof e?e:et(e);return this.select((function(){return this.appendChild(t.apply(this,arguments))}))},insert:function(e,t){var n="function"==typeof e?e:et(e),i=null==t?qt:"function"==typeof t?t:nt(t);return this.select((function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)}))},remove:function(){return this.each($t)},clone:function(e){return this.select(e?Qt:Jt)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var i,o,a=en(e+""),r=a.length;if(!(arguments.length<2)){for(s=t?nn:tn,i=0;i<r;++i)this.each(s(a[i],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(i=0,l=s[c];i<r;++i)if((o=a[i]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?rn:an)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i,o=e[t],a=0,r=o.length;a<r;++a)(i=o[a])&&(yield i)}};var dn=0;function hn(){return new pn}function pn(){this._="@"+(++dn).toString(36)}function gn(e){let t;for(;t=e.sourceEvent;)e=t;return e}function fn(e,t){if(e=gn(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,[(i=i.matrixTransform(t.getScreenCTM().inverse())).x,i.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}pn.prototype=hn.prototype={constructor:pn,get:function(e){for(var t=this._;!(t in e);)if(!(e=e.parentNode))return;return e[t]},set:function(e,t){return e[this._]=t},remove:function(e){return this._ in e&&delete e[this._]},toString:function(){return this._}};var vn=Object.freeze({__proto__:null,create:function(e){return un(et(e).call(document.documentElement))},creator:et,local:hn,matcher:rt,namespace:$e,namespaces:qe,pointer:fn,pointers:function(e,t){return e.target&&(e=gn(e),void 0===t&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,(e=>fn(e,t)))},select:un,selectAll:function(e){return"string"==typeof e?new ln([document.querySelectorAll(e)],[document.documentElement]):new ln([it(e)],sn)},selection:cn,selector:nt,selectorAll:at,style:Et,window:Nt}),yn=C._baseForOwn,mn=f._castFunction;var Cn=function(e,t){return e&&yn(e,mn(t))};var kn=function(e){return function(t){return null==e?void 0:e[t]}},bn=kn({"&":"&","<":"<",">":">",'"':""","'":"'"}),Tn=a.toString_1,Pn=/[&<>"']/g,Ln=RegExp(Pn.source);var _n=function(e){return(e=Tn(e))&&Ln.test(e)?e.replace(Pn,bn):e},Nn={value:()=>{}};function xn(){for(var e,t=0,n=arguments.length,i={};t<n;++t){if(!(e=arguments[t]+"")||e in i||/[\s.]/.test(e))throw new Error("illegal type: "+e);i[e]=[]}return new wn(i)}function wn(e){this._=e}function Sn(e,t){return e.trim().split(/^|\s+/).map((function(e){var n="",i=e.indexOf(".");if(i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:n}}))}function En(e,t){for(var n,i=0,o=e.length;i<o;++i)if((n=e[i]).name===t)return n.value}function In(e,t,n){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=Nn,e=e.slice(0,i).concat(e.slice(i+1));break}return null!=n&&e.push({name:t,value:n}),e}wn.prototype=xn.prototype={constructor:wn,on:function(e,t){var n,i=this._,o=Sn(e+"",i),a=-1,r=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a<r;)if(n=(e=o[a]).type)i[n]=In(i[n],e.name,t);else if(null==t)for(n in i)i[n]=In(i[n],e.name,null);return this}for(;++a<r;)if((n=(e=o[a]).type)&&(n=En(i[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new wn(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,i,o=new Array(n),a=0;a<n;++a)o[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(i=this._[e]).length;a<n;++a)i[a].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],o=0,a=i.length;o<a;++o)i[o].value.apply(t,n)}};const Dn={passive:!1},On={capture:!0,passive:!1};function An(e){e.stopImmediatePropagation()}function Mn(e){e.preventDefault(),e.stopImmediatePropagation()}function zn(e){var t=e.document.documentElement,n=un(e).on("dragstart.drag",Mn,On);"onselectstart"in t?n.on("selectstart.drag",Mn,On):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Rn(e,t){var n=e.document.documentElement,i=un(e).on("dragstart.drag",null);t&&(i.on("click.drag",Mn,On),setTimeout((function(){i.on("click.drag",null)}),0)),"onselectstart"in n?i.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var Hn=e=>()=>e;function Un(e,{sourceEvent:t,subject:n,target:i,identifier:o,active:a,x:r,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:r,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function jn(e){return!e.ctrlKey&&!e.button}function Bn(){return this.parentNode}function Fn(e,t){return null==t?{x:e.x,y:e.y}:t}function Gn(){return navigator.maxTouchPoints||"ontouchstart"in this}Un.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var Yn=Object.freeze({__proto__:null,drag:function(){var e,t,n,i,o=jn,a=Bn,r=Fn,s=Gn,l={},c=xn("start","drag","end"),u=0,d=0;function h(e){e.on("mousedown.drag",p).filter(s).on("touchstart.drag",v).on("touchmove.drag",y,Dn).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(r,s){if(!i&&o.call(this,r,s)){var l=C(this,a.call(this,r,s),r,s,"mouse");l&&(un(r.view).on("mousemove.drag",g,On).on("mouseup.drag",f,On),zn(r.view),An(r),n=!1,e=r.clientX,t=r.clientY,l("start",r))}}function g(i){if(Mn(i),!n){var o=i.clientX-e,a=i.clientY-t;n=o*o+a*a>d}l.mouse("drag",i)}function f(e){un(e.view).on("mousemove.drag mouseup.drag",null),Rn(e.view,n),Mn(e),l.mouse("end",e)}function v(e,t){if(o.call(this,e,t)){var n,i,r=e.changedTouches,s=a.call(this,e,t),l=r.length;for(n=0;n<l;++n)(i=C(this,s,e,t,r[n].identifier,r[n]))&&(An(e),i("start",e,r[n]))}}function y(e){var t,n,i=e.changedTouches,o=i.length;for(t=0;t<o;++t)(n=l[i[t].identifier])&&(Mn(e),n("drag",e,i[t]))}function m(e){var t,n,o=e.changedTouches,a=o.length;for(i&&clearTimeout(i),i=setTimeout((function(){i=null}),500),t=0;t<a;++t)(n=l[o[t].identifier])&&(An(e),n("end",e,o[t]))}function C(e,t,n,i,o,a){var s,d,p,g=c.copy(),f=fn(a||n,t);if(null!=(p=r.call(e,new Un("beforestart",{sourceEvent:n,target:h,identifier:o,active:u,x:f[0],y:f[1],dx:0,dy:0,dispatch:g}),i)))return s=p.x-f[0]||0,d=p.y-f[1]||0,function n(a,r,c){var v,y=f;switch(a){case"start":l[o]=n,v=u++;break;case"end":delete l[o],--u;case"drag":f=fn(c||r,t),v=u}g.call(a,e,new Un(a,{sourceEvent:r,subject:p,target:h,identifier:o,active:v,x:f[0]+s,y:f[1]+d,dx:f[0]-y[0],dy:f[1]-y[1],dispatch:g}),i)}}return h.filter=function(e){return arguments.length?(o="function"==typeof e?e:Hn(!!e),h):o},h.container=function(e){return arguments.length?(a="function"==typeof e?e:Hn(e),h):a},h.subject=function(e){return arguments.length?(r="function"==typeof e?e:Hn(e),h):r},h.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Hn(!!e),h):s},h.on=function(){var e=c.on.apply(c,arguments);return e===c?h:e},h.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,h):Math.sqrt(d)},h},dragDisable:zn,dragEnable:Rn});function Xn(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}function Wn(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Vn=function e(t){function n(e){return Math.pow(e,t)}return t=+t,n.exponent=e,n}(3),Kn=function e(t){function n(e){return 1-Math.pow(1-e,t)}return t=+t,n.exponent=e,n}(3),Zn=function e(t){function n(e){return((e*=2)<=1?Math.pow(e,t):2-Math.pow(2-e,t))/2}return t=+t,n.exponent=e,n}(3),qn=Math.PI,$n=qn/2;function Jn(e){return(1-Math.cos(qn*e))/2}function Qn(e){return 1.0009775171065494*(Math.pow(2,-10*e)-.0009765625)}function ei(e){return((e*=2)<=1?Qn(1-e):2-Qn(e-1))/2}function ti(e){return((e*=2)<=1?1-Math.sqrt(1-e*e):Math.sqrt(1-(e-=2)*e)+1)/2}var ni=4/11,ii=7.5625;function oi(e){return(e=+e)<ni?ii*e*e:e<.7272727272727273?ii*(e-=.5454545454545454)*e+.75:e<.9090909090909091?ii*(e-=.8181818181818182)*e+.9375:ii*(e-=.9545454545454546)*e+.984375}var ai=function e(t){function n(e){return(e=+e)*e*(t*(e-1)+e)}return t=+t,n.overshoot=e,n}(1.70158),ri=function e(t){function n(e){return--e*e*((e+1)*t+e)+1}return t=+t,n.overshoot=e,n}(1.70158),si=function e(t){function n(e){return((e*=2)<1?e*e*((t+1)*e-t):(e-=2)*e*((t+1)*e+t)+2)/2}return t=+t,n.overshoot=e,n}(1.70158),li=2*Math.PI,ci=function e(t,n){var i=Math.asin(1/(t=Math.max(1,t)))*(n/=li);function o(e){return t*Qn(- --e)*Math.sin((i-e)/n)}return o.amplitude=function(t){return e(t,n*li)},o.period=function(n){return e(t,n)},o}(1,.3),ui=function e(t,n){var i=Math.asin(1/(t=Math.max(1,t)))*(n/=li);function o(e){return 1-t*Qn(e=+e)*Math.sin((e+i)/n)}return o.amplitude=function(t){return e(t,n*li)},o.period=function(n){return e(t,n)},o}(1,.3),di=function e(t,n){var i=Math.asin(1/(t=Math.max(1,t)))*(n/=li);function o(e){return((e=2*e-1)<0?t*Qn(-e)*Math.sin((i-e)/n):2-t*Qn(e)*Math.sin((i+e)/n))/2}return o.amplitude=function(t){return e(t,n*li)},o.period=function(n){return e(t,n)},o}(1,.3),hi=Object.freeze({__proto__:null,easeLinear:e=>+e,easeQuad:Xn,easeQuadIn:function(e){return e*e},easeQuadOut:function(e){return e*(2-e)},easeQuadInOut:Xn,easeCubic:Wn,easeCubicIn:function(e){return e*e*e},easeCubicOut:function(e){return--e*e*e+1},easeCubicInOut:Wn,easePoly:Zn,easePolyIn:Vn,easePolyOut:Kn,easePolyInOut:Zn,easeSin:Jn,easeSinIn:function(e){return 1==+e?1:1-Math.cos(e*$n)},easeSinOut:function(e){return Math.sin(e*$n)},easeSinInOut:Jn,easeExp:ei,easeExpIn:function(e){return Qn(1-+e)},easeExpOut:function(e){return 1-Qn(e)},easeExpInOut:ei,easeCircle:ti,easeCircleIn:function(e){return 1-Math.sqrt(1-e*e)},easeCircleOut:function(e){return Math.sqrt(1- --e*e)},easeCircleInOut:ti,easeBounce:oi,easeBounceIn:function(e){return 1-oi(1-e)},easeBounceOut:oi,easeBounceInOut:function(e){return((e*=2)<=1?1-oi(1-e):oi(e-1)+1)/2},easeBack:si,easeBackIn:ai,easeBackOut:ri,easeBackInOut:si,easeElastic:ui,easeElasticIn:ci,easeElasticOut:ui,easeElasticInOut:di});function pi(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.blob()}function gi(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.arrayBuffer()}var fi={},vi={};function yi(e){return new Function("d","return {"+e.map((function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'})).join(",")+"}")}function mi(e){var t=Object.create(null),n=[];return e.forEach((function(e){for(var i in e)i in t||n.push(t[i]=i)})),n}function Ci(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function ki(e){var t,n=e.getUTCHours(),i=e.getUTCMinutes(),o=e.getUTCSeconds(),a=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":((t=e.getUTCFullYear())<0?"-"+Ci(-t,6):t>9999?"+"+Ci(t,6):Ci(t,4))+"-"+Ci(e.getUTCMonth()+1,2)+"-"+Ci(e.getUTCDate(),2)+(a?"T"+Ci(n,2)+":"+Ci(i,2)+":"+Ci(o,2)+"."+Ci(a,3)+"Z":o?"T"+Ci(n,2)+":"+Ci(i,2)+":"+Ci(o,2)+"Z":i||n?"T"+Ci(n,2)+":"+Ci(i,2)+"Z":"")}function bi(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,o=[],a=e.length,r=0,s=0,l=a<=0,c=!1;function u(){if(l)return vi;if(c)return c=!1,fi;var t,i,o=r;if(34===e.charCodeAt(o)){for(;r++<a&&34!==e.charCodeAt(r)||34===e.charCodeAt(++r););return(t=r)>=a?l=!0:10===(i=e.charCodeAt(r++))?c=!0:13===i&&(c=!0,10===e.charCodeAt(r)&&++r),e.slice(o+1,t-1).replace(/""/g,'"')}for(;r<a;){if(10===(i=e.charCodeAt(t=r++)))c=!0;else if(13===i)c=!0,10===e.charCodeAt(r)&&++r;else if(i!==n)continue;return e.slice(o,t)}return l=!0,e.slice(o,a)}for(10===e.charCodeAt(a-1)&&--a,13===e.charCodeAt(a-1)&&--a;(i=u())!==vi;){for(var d=[];i!==fi&&i!==vi;)d.push(i),i=u();t&&null==(d=t(d,s++))||o.push(d)}return o}function o(t,n){return t.map((function(t){return n.map((function(e){return r(t[e])})).join(e)}))}function a(t){return t.map(r).join(e)}function r(e){return null==e?"":e instanceof Date?ki(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,o,a=i(e,(function(e,i){if(n)return n(e,i-1);o=e,n=t?function(e,t){var n=yi(e);return function(i,o){return t(n(i),o,e)}}(e,t):yi(e)}));return a.columns=o||[],a},parseRows:i,format:function(t,n){return null==n&&(n=mi(t)),[n.map(r).join(e)].concat(o(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=mi(e)),o(e,t).join("\n")},formatRows:function(e){return e.map(a).join("\n")},formatRow:a,formatValue:r}}var Ti=bi(",").parse,Pi=bi("\t").parse;function Li(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.text()}function _i(e,t){return fetch(e,t).then(Li)}function Ni(e){return function(t,n,i){return 2===arguments.length&&"function"==typeof n&&(i=n,n=void 0),_i(t,n).then((function(t){return e(t,i)}))}}var xi=Ni(Ti),wi=Ni(Pi);function Si(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);if(204!==e.status&&205!==e.status)return e.json()}function Ei(e){return(t,n)=>_i(t,n).then((t=>(new DOMParser).parseFromString(t,e)))}var Ii=Ei("application/xml"),Di=Ei("text/html"),Oi=Ei("image/svg+xml"),Ai=Object.freeze({__proto__:null,blob:function(e,t){return fetch(e,t).then(pi)},buffer:function(e,t){return fetch(e,t).then(gi)},dsv:function(e,t,n,i){3===arguments.length&&"function"==typeof n&&(i=n,n=void 0);var o=bi(e);return _i(t,n).then((function(e){return o.parse(e,i)}))},csv:xi,tsv:wi,image:function(e,t){return new Promise((function(n,i){var o=new Image;for(var a in t)o[a]=t[a];o.onerror=i,o.onload=function(){n(o)},o.src=e}))},json:function(e,t){return fetch(e,t).then(Si)},text:_i,xml:Ii,html:Di,svg:Oi});function Mi(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zi(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function Ri(){}var Hi=1/.7,Ui="\\s*([+-]?\\d+)\\s*",ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Bi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Fi=/^#([0-9a-f]{3,8})$/,Gi=new RegExp(`^rgb\\(${Ui},${Ui},${Ui}\\)$`),Yi=new RegExp(`^rgb\\(${Bi},${Bi},${Bi}\\)$`),Xi=new RegExp(`^rgba\\(${Ui},${Ui},${Ui},${ji}\\)$`),Wi=new RegExp(`^rgba\\(${Bi},${Bi},${Bi},${ji}\\)$`),Vi=new RegExp(`^hsl\\(${ji},${Bi},${Bi}\\)$`),Ki=new RegExp(`^hsla\\(${ji},${Bi},${Bi},${ji}\\)$`),Zi={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function qi(){return this.rgb().formatHex()}function $i(){return this.rgb().formatRgb()}function Ji(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Fi.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?Qi(t):3===n?new io(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?eo(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?eo(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Gi.exec(e))?new io(t[1],t[2],t[3],1):(t=Yi.exec(e))?new io(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Xi.exec(e))?eo(t[1],t[2],t[3],t[4]):(t=Wi.exec(e))?eo(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Vi.exec(e))?co(t[1],t[2]/100,t[3]/100,1):(t=Ki.exec(e))?co(t[1],t[2]/100,t[3]/100,t[4]):Zi.hasOwnProperty(e)?Qi(Zi[e]):"transparent"===e?new io(NaN,NaN,NaN,0):null}function Qi(e){return new io(e>>16&255,e>>8&255,255&e,1)}function eo(e,t,n,i){return i<=0&&(e=t=n=NaN),new io(e,t,n,i)}function to(e){return e instanceof Ri||(e=Ji(e)),e?new io((e=e.rgb()).r,e.g,e.b,e.opacity):new io}function no(e,t,n,i){return 1===arguments.length?to(e):new io(e,t,n,null==i?1:i)}function io(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function oo(){return`#${lo(this.r)}${lo(this.g)}${lo(this.b)}`}function ao(){const e=ro(this.opacity);return`${1===e?"rgb(":"rgba("}${so(this.r)}, ${so(this.g)}, ${so(this.b)}${1===e?")":`, ${e})`}`}function ro(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function so(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function lo(e){return((e=so(e))<16?"0":"")+e.toString(16)}function co(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ho(e,t,n,i)}function uo(e){if(e instanceof ho)return new ho(e.h,e.s,e.l,e.opacity);if(e instanceof Ri||(e=Ji(e)),!e)return new ho;if(e instanceof ho)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,o=Math.min(t,n,i),a=Math.max(t,n,i),r=NaN,s=a-o,l=(a+o)/2;return s?(r=t===a?(n-i)/s+6*(n<i):n===a?(i-t)/s+2:(t-n)/s+4,s/=l<.5?a+o:2-a-o,r*=60):s=l>0&&l<1?0:r,new ho(r,s,l,e.opacity)}function ho(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function po(e){return(e=(e||0)%360)<0?e+360:e}function go(e){return Math.max(0,Math.min(1,e||0))}function fo(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}Mi(Ri,Ji,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qi,formatHex:qi,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return uo(this).formatHsl()},formatRgb:$i,toString:$i}),Mi(io,no,zi(Ri,{brighter(e){return e=null==e?Hi:Math.pow(Hi,e),new io(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new io(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new io(so(this.r),so(this.g),so(this.b),ro(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:oo,formatHex:oo,formatHex8:function(){return`#${lo(this.r)}${lo(this.g)}${lo(this.b)}${lo(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:ao,toString:ao})),Mi(ho,(function(e,t,n,i){return 1===arguments.length?uo(e):new ho(e,t,n,null==i?1:i)}),zi(Ri,{brighter(e){return e=null==e?Hi:Math.pow(Hi,e),new ho(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new ho(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*t,o=2*n-i;return new io(fo(e>=240?e-240:e+120,o,i),fo(e,o,i),fo(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new ho(po(this.h),go(this.s),go(this.l),ro(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ro(this.opacity);return`${1===e?"hsl(":"hsla("}${po(this.h)}, ${100*go(this.s)}%, ${100*go(this.l)}%${1===e?")":`, ${e})`}`}}));var vo=e=>()=>e;function yo(e){return 1==(e=+e)?mo:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(i){return Math.pow(e+i*t,n)}}(t,n,e):vo(isNaN(t)?n:t)}}function mo(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):vo(isNaN(e)?t:e)}var Co=function e(t){var n=yo(t);function i(e,t){var i=n((e=no(e)).r,(t=no(t)).r),o=n(e.g,t.g),a=n(e.b,t.b),r=mo(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=o(t),e.b=a(t),e.opacity=r(t),e+""}}return i.gamma=e,i}(1);function ko(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var bo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,To=new RegExp(bo.source,"g");function Po(e,t){var n,i,o,a=bo.lastIndex=To.lastIndex=0,r=-1,s=[],l=[];for(e+="",t+="";(n=bo.exec(e))&&(i=To.exec(t));)(o=i.index)>a&&(o=t.slice(a,o),s[r]?s[r]+=o:s[++r]=o),(n=n[0])===(i=i[0])?s[r]?s[r]+=i:s[++r]=i:(s[++r]=null,l.push({i:r,x:ko(n,i)})),a=To.lastIndex;return a<t.length&&(o=t.slice(a),s[r]?s[r]+=o:s[++r]=o),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,i=0;i<t;++i)s[(n=l[i]).i]=n.x(e);return s.join("")})}var Lo,_o=180/Math.PI,No={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function xo(e,t,n,i,o,a){var r,s,l;return(r=Math.sqrt(e*e+t*t))&&(e/=r,t/=r),(l=e*n+t*i)&&(n-=e*l,i-=t*l),(s=Math.sqrt(n*n+i*i))&&(n/=s,i/=s,l/=s),e*i<t*n&&(e=-e,t=-t,l=-l,r=-r),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*_o,skewX:Math.atan(l)*_o,scaleX:r,scaleY:s}}function wo(e,t,n,i){function o(e){return e.length?e.pop()+" ":""}return function(a,r){var s=[],l=[];return a=e(a),r=e(r),function(e,i,o,a,r,s){if(e!==o||i!==a){var l=r.push("translate(",null,t,null,n);s.push({i:l-4,x:ko(e,o)},{i:l-2,x:ko(i,a)})}else(o||a)&&r.push("translate("+o+t+a+n)}(a.translateX,a.translateY,r.translateX,r.translateY,s,l),function(e,t,n,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(o(n)+"rotate(",null,i)-2,x:ko(e,t)})):t&&n.push(o(n)+"rotate("+t+i)}(a.rotate,r.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(o(n)+"skewX(",null,i)-2,x:ko(e,t)}):t&&n.push(o(n)+"skewX("+t+i)}(a.skewX,r.skewX,s,l),function(e,t,n,i,a,r){if(e!==n||t!==i){var s=a.push(o(a)+"scale(",null,",",null,")");r.push({i:s-4,x:ko(e,n)},{i:s-2,x:ko(t,i)})}else 1===n&&1===i||a.push(o(a)+"scale("+n+","+i+")")}(a.scaleX,a.scaleY,r.scaleX,r.scaleY,s,l),a=r=null,function(e){for(var t,n=-1,i=l.length;++n<i;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var So=wo((function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?No:xo(t.a,t.b,t.c,t.d,t.e,t.f)}),"px, ","px)","deg)"),Eo=wo((function(e){return null==e?No:(Lo||(Lo=document.createElementNS("http://www.w3.org/2000/svg","g")),Lo.setAttribute("transform",e),(e=Lo.transform.baseVal.consolidate())?xo((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):No)}),", ",")",")");function Io(e){return((e=Math.exp(e))+1/e)/2}var Do,Oo,Ao=function e(t,n,i){function o(e,o){var a,r,s=e[0],l=e[1],c=e[2],u=o[0],d=o[1],h=o[2],p=u-s,g=d-l,f=p*p+g*g;if(f<1e-12)r=Math.log(h/c)/t,a=function(e){return[s+e*p,l+e*g,c*Math.exp(t*e*r)]};else{var v=Math.sqrt(f),y=(h*h-c*c+i*f)/(2*c*n*v),m=(h*h-c*c-i*f)/(2*h*n*v),C=Math.log(Math.sqrt(y*y+1)-y),k=Math.log(Math.sqrt(m*m+1)-m);r=(k-C)/t,a=function(e){var i,o=e*r,a=Io(C),u=c/(n*v)*(a*(i=t*o+C,((i=Math.exp(2*i))-1)/(i+1))-function(e){return((e=Math.exp(e))-1/e)/2}(C));return[s+u*p,l+u*g,c*a/Io(t*o+C)]}}return a.duration=1e3*r*t/Math.SQRT2,a}return o.rho=function(t){var n=Math.max(.001,+t),i=n*n;return e(n,i,i*i)},o}(Math.SQRT2,2,4),Mo=0,zo=0,Ro=0,Ho=0,Uo=0,jo=0,Bo="object"==typeof performance&&performance.now?performance:Date,Fo="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Go(){return Uo||(Fo(Yo),Uo=Bo.now()+jo)}function Yo(){Uo=0}function Xo(){this._call=this._time=this._next=null}function Wo(e,t,n){var i=new Xo;return i.restart(e,t,n),i}function Vo(){Uo=(Ho=Bo.now())+jo,Mo=zo=0;try{!function(){Go(),++Mo;for(var e,t=Do;t;)(e=Uo-t._time)>=0&&t._call.call(void 0,e),t=t._next;--Mo}()}finally{Mo=0,function(){var e,t,n=Do,i=1/0;for(;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:Do=t);Oo=e,Zo(i)}(),Uo=0}}function Ko(){var e=Bo.now(),t=e-Ho;t>1e3&&(jo-=t,Ho=e)}function Zo(e){Mo||(zo&&(zo=clearTimeout(zo)),e-Uo>24?(e<1/0&&(zo=setTimeout(Vo,e-Bo.now()-jo)),Ro&&(Ro=clearInterval(Ro))):(Ro||(Ho=Bo.now(),Ro=setInterval(Ko,1e3)),Mo=1,Fo(Vo)))}function qo(e,t,n){var i=new Xo;return t=null==t?0:+t,i.restart((n=>{i.stop(),e(n+t)}),t,n),i}Xo.prototype=Wo.prototype={constructor:Xo,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Go():+n)+(null==t?0:+t),this._next||Oo===this||(Oo?Oo._next=this:Do=this,Oo=this),this._call=e,this._time=n,Zo()},stop:function(){this._call&&(this._call=null,this._time=1/0,Zo())}};var $o=xn("start","end","cancel","interrupt"),Jo=[];function Qo(e,t,n,i,o,a){var r=e.__transition;if(r){if(n in r)return}else e.__transition={};!function(e,t,n){var i,o=e.__transition;function a(e){n.state=1,n.timer.restart(r,n.delay,n.time),n.delay<=e&&r(e-n.delay)}function r(a){var c,u,d,h;if(1!==n.state)return l();for(c in o)if((h=o[c]).name===n.name){if(3===h.state)return qo(r);4===h.state?(h.state=6,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete o[c]):+c<t&&(h.state=6,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete o[c])}if(qo((function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))})),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,i=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=h);i.length=u+1}}function s(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,r=i.length;++a<r;)i[a].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var i in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=Wo(a,0,n.time)}(e,n,{name:t,index:i,group:o,on:$o,tween:Jo,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function ea(e,t){var n=na(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function ta(e,t){var n=na(e,t);if(n.state>3)throw new Error("too late; already running");return n}function na(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function ia(e,t){var n,i,o,a=e.__transition,r=!0;if(a){for(o in t=null==t?null:t+"",a)(n=a[o]).name===t?(i=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[o]):r=!1;r&&delete e.__transition}}function oa(e,t){var n,i;return function(){var o=ta(this,e),a=o.tween;if(a!==n)for(var r=0,s=(i=n=a).length;r<s;++r)if(i[r].name===t){(i=i.slice()).splice(r,1);break}o.tween=i}}function aa(e,t,n){var i,o;if("function"!=typeof n)throw new Error;return function(){var a=ta(this,e),r=a.tween;if(r!==i){o=(i=r).slice();for(var s={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=s;break}l===c&&o.push(s)}a.tween=o}}function ra(e,t,n){var i=e._id;return e.each((function(){var e=ta(this,i);(e.value||(e.value={}))[t]=n.apply(this,arguments)})),function(e){return na(e,i).value[t]}}function sa(e,t){var n;return("number"==typeof t?ko:t instanceof Ji?Co:(n=Ji(t))?(t=n,Co):Po)(e,t)}function la(e){return function(){this.removeAttribute(e)}}function ca(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ua(e,t,n){var i,o,a=n+"";return function(){var r=this.getAttribute(e);return r===a?null:r===i?o:o=t(i=r,n)}}function da(e,t,n){var i,o,a=n+"";return function(){var r=this.getAttributeNS(e.space,e.local);return r===a?null:r===i?o:o=t(i=r,n)}}function ha(e,t,n){var i,o,a;return function(){var r,s,l=n(this);if(null!=l)return(r=this.getAttribute(e))===(s=l+"")?null:r===i&&s===o?a:(o=s,a=t(i=r,l));this.removeAttribute(e)}}function pa(e,t,n){var i,o,a;return function(){var r,s,l=n(this);if(null!=l)return(r=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:r===i&&s===o?a:(o=s,a=t(i=r,l));this.removeAttributeNS(e.space,e.local)}}function ga(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function fa(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function va(e,t){var n,i;function o(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&fa(e,o)),n}return o._value=t,o}function ya(e,t){var n,i;function o(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&ga(e,o)),n}return o._value=t,o}function ma(e,t){return function(){ea(this,e).delay=+t.apply(this,arguments)}}function Ca(e,t){return t=+t,function(){ea(this,e).delay=t}}function ka(e,t){return function(){ta(this,e).duration=+t.apply(this,arguments)}}function ba(e,t){return t=+t,function(){ta(this,e).duration=t}}function Ta(e,t){if("function"!=typeof t)throw new Error;return function(){ta(this,e).ease=t}}function Pa(e,t,n){var i,o,a=function(e){return(e+"").trim().split(/^|\s+/).every((function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e}))}(t)?ea:ta;return function(){var r=a(this,e),s=r.on;s!==i&&(o=(i=s).copy()).on(t,n),r.on=o}}var La=cn.prototype.constructor;function _a(e){return function(){this.style.removeProperty(e)}}function Na(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}function xa(e,t,n){var i,o;function a(){var a=t.apply(this,arguments);return a!==o&&(i=(o=a)&&Na(e,a,n)),i}return a._value=t,a}function wa(e){return function(t){this.textContent=e.call(this,t)}}function Sa(e){var t,n;function i(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&wa(i)),t}return i._value=e,i}var Ea=0;function Ia(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function Da(){return++Ea}var Oa=cn.prototype;Ia.prototype={constructor:Ia,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=nt(e));for(var i=this._groups,o=i.length,a=new Array(o),r=0;r<o;++r)for(var s,l,c=i[r],u=c.length,d=a[r]=new Array(u),h=0;h<u;++h)(s=c[h])&&(l=e.call(s,s.__data__,h,c))&&("__data__"in s&&(l.__data__=s.__data__),d[h]=l,Qo(d[h],t,n,h,d,na(s,n)));return new Ia(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=at(e));for(var i=this._groups,o=i.length,a=[],r=[],s=0;s<o;++s)for(var l,c=i[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var h,p=e.call(l,l.__data__,d,c),g=na(l,n),f=0,v=p.length;f<v;++f)(h=p[f])&&Qo(h,t,n,f,p,g);a.push(p),r.push(l)}return new Ia(a,r,t,n)},selectChild:Oa.selectChild,selectChildren:Oa.selectChildren,filter:function(e){"function"!=typeof e&&(e=rt(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var a,r=t[o],s=r.length,l=i[o]=[],c=0;c<s;++c)(a=r[c])&&e.call(a,a.__data__,c,r)&&l.push(a);return new Ia(i,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,i=t.length,o=n.length,a=Math.min(i,o),r=new Array(i),s=0;s<a;++s)for(var l,c=t[s],u=n[s],d=c.length,h=r[s]=new Array(d),p=0;p<d;++p)(l=c[p]||u[p])&&(h[p]=l);for(;s<i;++s)r[s]=t[s];return new Ia(r,this._parents,this._name,this._id)},selection:function(){return new La(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=Da(),i=this._groups,o=i.length,a=0;a<o;++a)for(var r,s=i[a],l=s.length,c=0;c<l;++c)if(r=s[c]){var u=na(r,t);Qo(r,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ia(i,this._parents,e,n)},call:Oa.call,nodes:Oa.nodes,node:Oa.node,size:Oa.size,empty:Oa.empty,each:Oa.each,on:function(e,t){var n=this._id;return arguments.length<2?na(this.node(),n).on.on(e):this.each(Pa(n,e,t))},attr:function(e,t){var n=$e(e),i="transform"===n?Eo:sa;return this.attrTween(e,"function"==typeof t?(n.local?pa:ha)(n,i,ra(this,"attr."+e,t)):null==t?(n.local?ca:la)(n):(n.local?da:ua)(n,i,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var i=$e(e);return this.tween(n,(i.local?va:ya)(i,t))},style:function(e,t,n){var i="transform"==(e+="")?So:sa;return null==t?this.styleTween(e,function(e,t){var n,i,o;return function(){var a=Et(this,e),r=(this.style.removeProperty(e),Et(this,e));return a===r?null:a===n&&r===i?o:o=t(n=a,i=r)}}(e,i)).on("end.style."+e,_a(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var i,o,a;return function(){var r=Et(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=Et(this,e)),r===l?null:r===i&&l===o?a:(o=l,a=t(i=r,s))}}(e,i,ra(this,"style."+e,t))).each(function(e,t){var n,i,o,a,r="style."+t,s="end."+r;return function(){var l=ta(this,e),c=l.on,u=null==l.value[r]?a||(a=_a(t)):void 0;c===n&&o===u||(i=(n=c).copy()).on(s,o=u),l.on=i}}(this._id,e)):this.styleTween(e,function(e,t,n){var i,o,a=n+"";return function(){var r=Et(this,e);return r===a?null:r===i?o:o=t(i=r,n)}}(e,i,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(null==t)return this.tween(i,null);if("function"!=typeof t)throw new Error;return this.tween(i,xa(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(ra(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,Sa(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var i,o=na(this.node(),n).tween,a=0,r=o.length;a<r;++a)if((i=o[a]).name===e)return i.value;return null}return this.each((null==t?oa:aa)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?ma:Ca)(t,e)):na(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?ka:ba)(t,e)):na(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(Ta(t,e)):na(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;ta(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,i=n._id,o=n.size();return new Promise((function(a,r){var s={value:r},l={value:function(){0==--o&&a()}};n.each((function(){var n=ta(this,i),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t})),0===o&&a()}))},[Symbol.iterator]:Oa[Symbol.iterator]};var Aa={time:null,delay:0,duration:250,ease:Wn};function Ma(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}cn.prototype.interrupt=function(e){return this.each((function(){ia(this,e)}))},cn.prototype.transition=function(e){var t,n;e instanceof Ia?(t=e._id,e=e._name):(t=Da(),(n=Aa).time=Go(),e=null==e?null:e+"");for(var i=this._groups,o=i.length,a=0;a<o;++a)for(var r,s=i[a],l=s.length,c=0;c<l;++c)(r=s[c])&&Qo(r,e,t,c,s,n||Ma(r,t));return new Ia(i,this._parents,e,t)};var za=function(e){return function(){return e}};function Ra(e,t){var n=t.sourceEvent,i=t.target,o=t.transform,a=t.dispatch;Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:a}})}function Ha(e,t,n){this.k=e,this.x=t,this.y=n}Ha.prototype={constructor:Ha,scale:function(e){return 1===e?this:new Ha(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new Ha(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ua=new Ha(1,0,0);function ja(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ua;return e.__zoom}function Ba(e){e.stopImmediatePropagation()}function Fa(e){e.preventDefault(),e.stopImmediatePropagation()}function Ga(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function Ya(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function Xa(){return this.__zoom||Ua}function Wa(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Va(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ka(e,t,n){var i=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],r=e.invertY(t[1][1])-n[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),r>a?(a+r)/2:Math.min(0,a)||Math.max(0,r))}ja.prototype=Ha.prototype;var Za=Object.freeze({__proto__:null,zoom:function(){var e,t,n,i=Ga,o=Ya,a=Ka,r=Wa,s=Va,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=Ao,h=xn("start","zoom","end"),p=500,g=0,f=10,v=!1,y=!1;function m(e){e.property("__zoom",Xa).on("wheel.zoom",_).on("mousedown.zoom",S).on("dblclick.zoom",E).on("gesturestart",N).on("gesturechange",x).on("gestureend",w).filter(s).on("touchstart.zoom",I).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function C(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new Ha(t,e.x,e.y)}function k(e,t,n){var i=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return i===e.x&&o===e.y?e:new Ha(e.k,i,o)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function T(e,t,n,i){e.on("start.zoom",(function(){P(this,arguments).event(i).start()})).on("interrupt.zoom end.zoom",(function(){P(this,arguments).event(i).end()})).tween("zoom",(function(){var e=this,a=arguments,r=P(e,a).event(i),s=o.apply(e,a),l=null==n?b(s):"function"==typeof n?n.apply(e,a):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,h="function"==typeof t?t.apply(e,a):t,p=d(u.invert(l).concat(c/u.k),h.invert(l).concat(c/h.k));return function(e){if(1===e)e=h;else{var t=p(e),n=c/t[2];e=new Ha(n,l[0]-t[0]*n,l[1]-t[1]*n)}r.zoom(null,e)}}))}function P(e,t,n){return!n&&e.__zooming||new L(e,t)}function L(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function _(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if(y&&Fa(e),i.apply(this,arguments)){var s=P(this,n).event(e),u=this.__zoom,d=Math.max(l[0],Math.min(l[1],u.k*Math.pow(2,r.apply(this,arguments)))),h=fn(e);if(s.wheel)s.mouse[0][0]===h[0]&&s.mouse[0][1]===h[1]||(s.mouse[1]=u.invert(s.mouse[0]=h)),clearTimeout(s.wheel);else{if(u.k===d)return;!v||e.ctrlKey||e.safariPinchZoom||(s.wheelTransX=-u.x,s.wheelTransY=-u.y),s.mouse=[h,u.invert(h)],ia(this),s.start()}if(Fa(e),s.wheel=setTimeout(f,150),!v||e.ctrlKey||e.safariPinchZoom)s.zoom("mouse",a(k(C(u,d),s.mouse[0],s.mouse[1]),s.extent,c));else{s.wheelTransX+=e.deltaX,s.wheelTransY+=e.deltaY;var p=[u.x,u.y],g=[u.x+s.wheelTransX,u.y+s.wheelTransY];s.zoom("mouse",a(k(u,p,g),s.extent,c))}}function f(){s.wheel=null,s.end()}}function N(e){Fa(e),this.scale=e.scale}function x(e){Fa(e),this.__zoom&&(e.deltaY=100*(this.scale-e.scale),this.scale=e.scale),e.safariPinchZoom=!0,_.apply(this,[e].concat(Array.prototype.slice.call(arguments)))}function w(e){Fa(e)}function S(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r<t;r++)o[r-1]=arguments[r];if(!n&&i.apply(this,arguments)){var s=P(this,o,!0).event(e),l=un(e.view).on("mousemove.zoom",f,!0).on("mouseup.zoom",v,!0),u=fn(e,d),d=e.currentTarget,h=e.clientX,p=e.clientY;zn(e.view),Ba(e),s.mouse=[u,this.__zoom.invert(u)],ia(this),s.start()}function f(e){if(Fa(e),!s.moved){var t=e.clientX-h,n=e.clientY-p;s.moved=t*t+n*n>g}s.event(e).zoom("mouse",a(k(s.that.__zoom,s.mouse[0]=fn(e,d),s.mouse[1]),s.extent,c))}function v(e){l.on("mousemove.zoom mouseup.zoom",null),Rn(e.view,s.moved),Fa(e),s.event(e).end()}}function E(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(i.apply(this,arguments)){var s=this.__zoom,l=fn(e.changedTouches?e.changedTouches[0]:e,this),d=s.invert(l),h=s.k*(e.shiftKey?.5:2),p=a(k(C(s,h),l,d),o.apply(this,n),c);Fa(e),u>0?un(this).transition().duration(u).call(T,p,l,e):un(this).call(m.transform,p,l,e)}}function I(n){for(var o=arguments.length,a=new Array(o>1?o-1:0),r=1;r<o;r++)a[r-1]=arguments[r];if(i.apply(this,arguments)){var s,l,c,u,d=n.touches,h=d.length,g=P(this,a,n.changedTouches.length===h).event(n);for(Ba(n),l=0;l<h;++l)u=[u=fn(c=d[l],this),this.__zoom.invert(u),c.identifier],g.touch0?g.touch1||g.touch0[2]===u[2]||(g.touch1=u,g.taps=0):(g.touch0=u,s=!0,g.taps=1+!!e);e&&(e=clearTimeout(e)),s&&(g.taps<2&&(t=u[0],e=setTimeout((function(){e=null}),p)),ia(this),g.start())}}function D(e){if(this.__zooming){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var o,r,s,l,u=P(this,n).event(e),d=e.changedTouches,h=d.length;for(Fa(e),o=0;o<h;++o)s=fn(r=d[o],this),u.touch0&&u.touch0[2]===r.identifier?u.touch0[0]=s:u.touch1&&u.touch1[2]===r.identifier&&(u.touch1[0]=s);if(r=u.that.__zoom,u.touch1){var p=u.touch0[0],g=u.touch0[1],f=u.touch1[0],v=u.touch1[1],y=(y=f[0]-p[0])*y+(y=f[1]-p[1])*y,m=(m=v[0]-g[0])*m+(m=v[1]-g[1])*m;r=C(r,Math.sqrt(y/m)),s=[(p[0]+f[0])/2,(p[1]+f[1])/2],l=[(g[0]+v[0])/2,(g[1]+v[1])/2]}else{if(!u.touch0)return;s=u.touch0[0],l=u.touch0[1]}u.zoom("touch",a(k(r,s,l),u.extent,c))}}function O(e){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];if(this.__zooming){var r,s,l=P(this,o).event(e),c=e.changedTouches,u=c.length;for(Ba(e),n&&clearTimeout(n),n=setTimeout((function(){n=null}),p),r=0;r<u;++r)s=c[r],l.touch0&&l.touch0[2]===s.identifier?delete l.touch0:l.touch1&&l.touch1[2]===s.identifier&&delete l.touch1;if(l.touch1&&!l.touch0&&(l.touch0=l.touch1,delete l.touch1),l.touch0)l.touch0[1]=this.__zoom.invert(l.touch0[0]);else if(l.end(),2===l.taps&&(s=fn(s,this),Math.hypot(t[0]-s[0],t[1]-s[1])<f)){var d=un(this).on("dblclick.zoom");d&&d.apply(this,arguments)}}}return m.transform=function(e,t,n,i){var o=e.selection?e.selection():e;o.property("__zoom",Xa),e!==o?T(e,t,n,i):o.interrupt().each((function(){P(this,arguments).event(i).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()}))},m.scaleBy=function(e,t,n,i){m.scaleTo(e,(function(){var e=this.__zoom.k,n="function"==typeof t?t.apply(this,arguments):t;return e*n}),n,i)},m.scaleTo=function(e,t,n,i){m.transform(e,(function(){var e=o.apply(this,arguments),i=this.__zoom,r=null==n?b(e):"function"==typeof n?n.apply(this,arguments):n,s=i.invert(r),l="function"==typeof t?t.apply(this,arguments):t;return a(k(C(i,l),r,s),e,c)}),n,i)},m.translateBy=function(e,t,n,i){m.transform(e,(function(){return a(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)}),null,i)},m.translateTo=function(e,t,n,i,r){m.transform(e,(function(){var e=o.apply(this,arguments),r=this.__zoom,s=null==i?b(e):"function"==typeof i?i.apply(this,arguments):i;return a(Ua.translate(s[0],s[1]).scale(r.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)}),i,r)},L.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=un(this.that).datum();h.call(e,this.that,new Ra(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:h}),t)}},m.wheelDelta=function(e){return arguments.length?(r="function"==typeof e?e:za(+e),m):r},m.filter=function(e){return arguments.length?(i="function"==typeof e?e:za(!!e),m):i},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:za(!!e),m):s},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:za([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],m):[l[0],l[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(a=e,m):a},m.trackpad=function(e){return arguments.length?(v=e,m):v},m.preventBackGesture=function(e){return arguments.length?(y=e,m):y},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=h.on.apply(h,arguments);return e===h?m:e},m.clickDistance=function(e){return arguments.length?(g=(e=+e)*e,m):Math.sqrt(g)},m.tapDistance=function(e){return arguments.length?(f=+e,m):f},m},zoomTransform:ja,zoomIdentity:Ua}),qa=function(){function t(n,i,o){e._classCallCheck(this,t),this.canvasController=n,this.isSubflow=i,this.pipelineId=o}return e._createClass(t,[{key:"isDisplayingCurrentPipeline",value:function(){return this.canvasController.getCurrentBreadcrumb().pipelineId===this.pipelineId}},{key:"setDisplayState",value:function(){this.canvasController.getBreadcrumbs().length>1&&this.isDisplayingCurrentPipeline()?this.displayState="sub-flow-full-page":this.isSubflow?this.displayState="sub-flow-in-place":this.displayState="primary-flow-full-page"}},{key:"getDisplayStateMsg",value:function(){return"Display state set to "+this.displayState}},{key:"isDisplayingPrimaryFlowFullPage",value:function(){return"primary-flow-full-page"===this.displayState}},{key:"isDisplayingSubFlow",value:function(){return"sub-flow-in-place"===this.displayState||"sub-flow-full-page"===this.displayState}},{key:"isDisplayingSubFlowInPlace",value:function(){return"sub-flow-in-place"===this.displayState}},{key:"isDisplayingSubFlowFullPage",value:function(){return"sub-flow-full-page"===this.displayState}},{key:"isDisplayingFullPage",value:function(){return"primary-flow-full-page"===this.displayState||"sub-flow-full-page"===this.displayState}}]),t}();function $a(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Ja(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ja(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return r=e.done,e},e:function(e){s=!0,a=e},f:function(){try{r||null==n.return||n.return()}finally{if(s)throw a}}}}function Ja(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var Qa=function(){function t(n){e._classCallCheck(this,t),this.canvasLayout=n}return e._createClass(t,[{key:"isPointInNodeBoundary",value:function(e,t){return e.x>=t.x_pos&&e.x<=t.x_pos+t.width&&e.y>=t.y_pos&&e.y<=t.y_pos+t.height}},{key:"getNodeImageClass",value:function(e){return"d3-node-image"}},{key:"getNodeLabelClass",value:function(e){if(f.CanvasUtils.isExpandedSupernode(e))return"d3-node-label d3-label-single-line "+this.getMessageLabelClass(e.messages);var t=e.layout.labelSingleLine?" d3-label-single-line":" d3-label-multi-line",n="center"===e.layout.labelAlign?" d3-label-center":"";return"d3-node-label "+this.getMessageLabelClass(e.messages)+t+n}},{key:"getNodeLabelTextAreaClass",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?"d3-node-label-entry d3-label-single-line":"d3-node-label-entry"+(e.layout.labelSingleLine?" d3-label-single-line":" d3-label-multi-line")+("center"===e.layout.labelAlign?" d3-label-center":"")}},{key:"getErrorMarkerIcon",value:function(e){var t="";switch(this.getMessageLevel(e.messages)){case l.ERROR:t=l.NODE_ERROR_ICON;break;case l.WARNING:t=l.NODE_WARNING_ICON}return t}},{key:"getMessageLevel",value:function(e){var t="";if(e&&e.length>0){var n,i=$a(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.type===l.ERROR)return o.type;o.type===l.WARNING&&(t=o.type)}}catch(e){i.e(e)}finally{i.f()}}return t}},{key:"getMessageLabelClass",value:function(e){var t="";switch(this.getMessageLevel(e)){case l.ERROR:t="d3-node-error-label";break;case l.WARNING:t="d3-node-warning-label"}return t}},{key:"getErrorMarkerClass",value:function(e){var t="d3-error-circle-off";switch(this.getMessageLevel(e)){case l.ERROR:t="d3-error-circle";break;case l.WARNING:t="d3-warning-circle"}return t}},{key:"getNodeCenterPosX",value:function(e){return e.x_pos+e.width/2}},{key:"getNodeCenterPosY",value:function(e){return e.y_pos+e.height/2}},{key:"getNodeImageCenterPosX",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?e.x_pos+this.canvasLayout.supernodeImagePosX+this.canvasLayout.supernodeImageWidth/2:e.x_pos+this.getElementPosX(e.width,e.layout.imagePosX,e.layout.imagePosition)+e.layout.imageWidth/2}},{key:"getNodeImageCenterPosY",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?e.y_pos+this.canvasLayout.supernodeImagePosY+this.canvasLayout.supernodeImageHeight/2:e.y_pos+this.getElementPosY(e.height,e.layout.imagePosY,e.layout.imagePosition)+e.layout.imageHeight/2}},{key:"getNodeImagePosX",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeImagePosX:this.getElementPosX(e.width,e.layout.imagePosX,e.layout.imagePosition)}},{key:"getNodeImagePosY",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeImagePosY:this.getElementPosY(e.height,e.layout.imagePosY,e.layout.imagePosition)}},{key:"getNodeImageWidth",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeImageWidth:e.layout.imageWidth}},{key:"getNodeImageHeight",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeImageHeight:e.layout.imageHeight}},{key:"getNodeLabelPosX",value:function(e){if(f.CanvasUtils.isExpandedSupernode(e))return this.canvasLayout.supernodeLabelPosX;var t=this.getElementPosX(e.width,e.layout.labelPosX,e.layout.labelPosition);return"center"===e.layout.labelAlign?t-e.layout.labelWidth/2:t}},{key:"getNodeLabelPosY",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeLabelPosY:this.getElementPosY(e.height,e.layout.labelPosY,e.layout.labelPosition)}},{key:"getNodeLabelWidth",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?e.width-this.canvasLayout.supernodeLabelPosX+this.canvasLayout.supernodeErrorPosX:e.layout.labelWidth}},{key:"getNodeLabelHeight",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeLabelHeight:e.layout.labelHeight}},{key:"getNodeLabelEditIconTranslate",value:function(e,t,n,i){return"translate(".concat(this.getNodeLabelEditIconPosX(e,t,n,i),", ").concat(this.getNodeLabelEditIconPosY(e),")")}},{key:"getNodeLabelEditIconPosX",value:function(e,t,n,i){var o=i?this.getNodeLabelHoverWidth(e):this.getNodeLabelWidth(e),a=i?this.getNodeLabelHoverPosX(e):this.getNodeLabelPosX(e),r=t.getBoundingClientRect().width;if("center"===e.layout.labelAlign&&!f.CanvasUtils.isExpandedSupernode(e)){var s=o/2;return a+s+Math.min(s,r/n/2)}var l=Math.min(o,r/n);return this.getNodeLabelPosX(e)+l}},{key:"getNodeLabelEditIconPosY",value:function(e){return this.getNodeLabelPosY(e)}},{key:"getNodeLabelHoverPosX",value:function(e){return e.layout.labelSingleLine&&"center"===e.layout.labelAlign?this.getNodeLabelPosX(e)-250:this.getNodeLabelPosX(e)}},{key:"getNodeLabelHoverWidth",value:function(e){return e.layout.labelSingleLine?"center"===e.layout.labelAlign?e.layout.labelWidth+500:e.layout.labelWidth+40:e.layout.labelWidth}},{key:"getNodeLabelHoverHeight",value:function(e,t,n){if(e.layout.labelSingleLine)return e.layout.labelHeight;var i=t.getBoundingClientRect().height/n;return Math.max(i,e.layout.labelHeight)}},{key:"getNodeLabelTextAreaWidth",value:function(e){return this.getNodeLabelWidth(e)+2*l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getNodeLabelTextAreaHeight",value:function(e){return this.getNodeLabelHeight(e)+2*l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getNodeLabelTextAreaPosX",value:function(e){return this.getNodeLabelPosX(e)-l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getNodeLabelTextAreaPosY",value:function(e){return this.getNodeLabelPosY(e)-l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getNodeEllipsisTranslate",value:function(e){return"translate(".concat(this.getNodeEllipsisPosX(e),", ").concat(this.getNodeEllipsisPosY(e),")")}},{key:"getNodeEllipsisWidth",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeEllipsisWidth:e.layout.ellipsisWidth}},{key:"getNodeEllipsisHeight",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeEllipsisHeight:e.layout.ellipsisHeight}},{key:"getNodeEllipsisIconWidth",value:function(e){return this.getNodeEllipsisWidth(e)-2*e.layout.ellipsisHoverAreaPadding}},{key:"getNodeEllipsisIconHeight",value:function(e){return this.getNodeEllipsisHeight(e)-2*e.layout.ellipsisHoverAreaPadding}},{key:"getNodeEllipsisPosX",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?e.width+this.canvasLayout.supernodeEllipsisPosX:this.getElementPosX(e.width,e.layout.ellipsisPosX,e.layout.ellipsisPosition)}},{key:"getNodeEllipsisPosY",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeEllipsisPosY:this.getElementPosY(e.height,e.layout.ellipsisPosY,e.layout.ellipsisPosition)}},{key:"getNodeExpansionIconTranslate",value:function(e){var t=e.width+this.canvasLayout.supernodeExpansionIconPosX;return"translate(".concat(t,", ").concat(this.canvasLayout.supernodeExpansionIconPosY,")")}},{key:"getNodeErrorPosX",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?e.width+this.canvasLayout.supernodeErrorPosX:this.getElementPosX(e.width,e.layout.errorXPos,e.layout.errorPosition)}},{key:"getNodeErrorPosY",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeErrorPosY:this.getElementPosY(e.height,e.layout.errorYPos,e.layout.errorPosition)}},{key:"getNodeErrorWidth",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeErrorWidth:e.layout.errorWidth}},{key:"getNodeErrorHeight",value:function(e){return f.CanvasUtils.isExpandedSupernode(e)?this.canvasLayout.supernodeErrorHeight:e.layout.errorHeight}},{key:"getNodeInputPortLeftPosX",value:function(e){return this.getElementPosX(e.width,e.layout.inputPortLeftPosX,e.layout.inputPortLeftPosition)}},{key:"getNodeInputPortLeftPosY",value:function(e){return this.getElementPosY(e.height,e.layout.inputPortLeftPosY,e.layout.inputPortLeftPosition)}},{key:"getNodeOutputPortRightPosX",value:function(e){return this.getElementPosX(e.width,e.layout.outputPortRightPosX,e.layout.outputPortRightPosition)}},{key:"getNodeOutputPortRightPosY",value:function(e){return this.getElementPosY(e.height,e.layout.outputPortRightPosY,e.layout.outputPortRightPosition)}},{key:"getElementPosX",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"topLeft",i=0;return n.endsWith("Center")?i+=e/2:n.endsWith("Right")&&(i+=e),i+Number(t)}},{key:"getElementPosY",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"topLeft",i=0;return n.startsWith("middle")?i+=e/2:n.startsWith("bottom")&&(i+=e),i+Number(t)}},{key:"getSupernodePortXOffset",value:function(e,t){return t?t.find((function(t){return t.subflow_node_ref===e})).cx-this.canvasLayout.supernodeSVGAreaPadding:0}},{key:"getSupernodePortYOffset",value:function(e,t){return t?t.find((function(t){return t.subflow_node_ref===e})).cy:0}}]),t}(),er=function(){function t(){e._classCallCheck(this,t)}return e._createClass(t,[{key:"getCommentCenterPosX",value:function(e){return e.x_pos+e.width/2}},{key:"getCommentCenterPosY",value:function(e){return e.y_pos+e.height/2}}]),t}(),tr=Math.PI,nr=function(){function t(n,i,o,a){e._classCallCheck(this,t),this.canvasLayout=i,this.config=n,this.nodeUtils=o,this.commentUtils=a}return e._createClass(t,[{key:"getNewStraightCommentLinkStartPos",value:function(e,t){return f.CanvasUtils.getOuterCoord(e.x_pos,e.y_pos,e.width,e.height,this.canvasLayout.linkGap,this.commentUtils.getCommentCenterPosX(e),this.commentUtils.getCommentCenterPosY(e),t.x,t.y)}},{key:"getNewStraightNodeLinkStartPos",value:function(e,t,n){var i,o;if("image_center"!==e.layout.drawNodeLinkLineFromTo||f.CanvasUtils.isExpanded(e))if(n){var a=this.getCenterOffset(e,n);i=a.x,o=a.y}else i=this.nodeUtils.getNodeCenterPosX(e),o=this.nodeUtils.getNodeCenterPosY(e);else i=this.nodeUtils.getNodeImageCenterPosX(e),o=this.nodeUtils.getNodeImageCenterPosY(e);return f.CanvasUtils.getOuterCoord(e.x_pos,e.y_pos,e.width,e.height,this.canvasLayout.linkGap,i,o,t.x,t.y)}},{key:"addConnectionPaths",value:function(e){var t=this;return e.forEach((function(e){e.pathInfo=t.getConnectorPathInfo(e)})),e}},{key:"getConnectorPathInfo",value:function(e,t){var n=this.getMinInitialLine(e,t);if(Math.abs(e.x1-e.x2)<20&&Math.abs(e.y1-e.y2)<20)return this.getStraightPath(e);if(e.type===l.NODE_LINK){if(this.canvasLayout.linkType===l.LINK_TYPE_CURVE||this.canvasLayout.linkType===l.LINK_TYPE_ELBOW)return this.getPortLinkPath(e,n)}else if(e.type===l.ASSOCIATION_LINK&&this.config.enableAssocLinkType===l.ASSOC_RIGHT_SIDE_CURVE)return this.getAssociationCurvePath(e,n);return this.getStraightPath(e)}},{key:"getMinInitialLine",value:function(e,t){return e.type===l.COMMENT_LINK?0:e.minInitialLineForElbow?e.minInitialLineForElbow:e.srcObj&&e.srcObj.layout?e.srcObj.layout.minInitialLine:t||10}},{key:"getLinkCoords",value:function(e,t,n,i,o,a){return e.type===l.NODE_LINK?this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT?this.getNodeLinkCoordsForStraightLine(t,i,e):this.getNodeLinkCoordsForPorts(t,n,i,o):e.type===l.ASSOCIATION_LINK?this.config.enableAssocLinkType===l.ASSOC_RIGHT_SIDE_CURVE?this.getAssociationCurveLinkCoords(t,i,a):this.getNodeLinkCoordsForStraightLine(t,i):this.getCommentLinkCoords(t,i)}},{key:"getNodeLinkCoordsForStraightLine",value:function(e,t,n){var i,o,a,r;if("image_center"!==e.layout.drawNodeLinkLineFromTo||f.CanvasUtils.isExpanded(e))if(n&&n.srcOriginInfo){var s=this.getCenterOffset(e,n.srcOriginInfo);i=s.x,o=s.y}else i=this.nodeUtils.getNodeCenterPosX(e),o=this.nodeUtils.getNodeCenterPosY(e);else i=this.nodeUtils.getNodeImageCenterPosX(e),o=this.nodeUtils.getNodeImageCenterPosY(e);if("image_center"!==t.layout.drawNodeLinkLineFromTo||f.CanvasUtils.isExpanded(t))if(n&&n.trgOriginInfo){var l=this.getCenterOffset(t,n.trgOriginInfo);a=l.x,r=l.y}else a=this.nodeUtils.getNodeCenterPosX(t),r=this.nodeUtils.getNodeCenterPosY(t);else a=this.nodeUtils.getNodeImageCenterPosX(t),r=this.nodeUtils.getNodeImageCenterPosY(t);var c=f.CanvasUtils.getOuterCoord(e.x_pos,e.y_pos,e.width,e.height,this.canvasLayout.linkGap,i,o,a,r),u=f.CanvasUtils.getOuterCoord(t.x_pos,t.y_pos,t.width,t.height,this.canvasLayout.linkGap,a,r,i,o);return{originX:c.originX,originY:c.originY,x1:c.x,y1:c.y,x2:u.x,y2:u.y}}},{key:"getCenterOffset",value:function(e,t){var n=t.len+1,i=t.idx+1,o=0,a=0;return t.dir===l.NORTH||t.dir===l.SOUTH?(o=e.x_pos+e.width/n*i,a=this.nodeUtils.getNodeCenterPosY(e)):t.dir!==l.EAST&&t.dir!==l.WEST||(o=this.nodeUtils.getNodeCenterPosX(e),a=e.y_pos+e.height/n*i),{x:o,y:a}}},{key:"getNodeLinkCoordsForPorts",value:function(e,t,n,i){var o=e.width+e.layout.outputPortRightPosX,a=e.layout.outputPortRightPosY,r=n.layout.inputPortLeftPosX,s=n.layout.inputPortLeftPosY;if(this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?(o=e.layout.outputPortBottomPosX,a=e.height+e.layout.outputPortBottomPosY,r=n.layout.inputPortTopPosX,s=n.layout.inputPortTopPosY):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP&&(o=e.layout.outputPortBottomPosX,a=e.layout.outputPortBottomPosY,r=n.layout.inputPortTopPosX,s=n.height+n.layout.inputPortTopPosY),e.outputs&&e.outputs.length>0){var c=e.outputs.find((function(e){return e.id===t}));o=c?c.cx:o,a=c?c.cy:a}if(n.inputs&&n.inputs.length>0){var u=n.inputs.find((function(e){return e.id===i}));r=u?u.cx:r,s=u?u.cy:s}return{x1:e.x_pos+o,y1:e.y_pos+a,x2:n.x_pos+r,y2:n.y_pos+s}}},{key:"getAssociationCurveLinkCoords",value:function(e,t,n){var i=0,o=0;return n===l.ASSOC_VAR_CURVE_RIGHT?(i=e.x_pos+e.width,o=t.x_pos):n===l.ASSOC_VAR_CURVE_LEFT?(i=e.x_pos,o=t.x_pos+t.width):n===l.ASSOC_VAR_DOUBLE_BACK_LEFT?(i=e.x_pos,o=t.x_pos):(i=e.x_pos+e.width,o=t.x_pos+t.width),{x1:i,y1:e.y_pos+e.layout.outputPortRightPosY,x2:o,y2:t.y_pos+t.layout.inputPortLeftPosY}}},{key:"getCommentLinkCoords",value:function(e,t){var n,i,o=this.commentUtils.getCommentCenterPosX(e),a=this.commentUtils.getCommentCenterPosY(e);"image_center"===t.layout.drawCommentLinkLineTo?(n=this.nodeUtils.getNodeImageCenterPosX(t),i=this.nodeUtils.getNodeImageCenterPosY(t)):(n=this.nodeUtils.getNodeCenterPosX(t),i=this.nodeUtils.getNodeCenterPosY(t));var r=f.CanvasUtils.getOuterCoord(e.x_pos,e.y_pos,e.width,e.height,this.canvasLayout.linkGap,o,a,n,i),s=f.CanvasUtils.getOuterCoord(t.x_pos,t.y_pos,t.width,t.height,this.canvasLayout.linkGap,n,i,o,a);return{x1:r.x,y1:r.y,x2:s.x,y2:s.y}}},{key:"getPortLinkPath",value:function(e,t){var n,i,o,a;e.srcObj&&e.trgNode?this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?(n=-(e.srcObj.x_pos+e.srcObj.width),o=-e.srcObj.x_pos,i=-(e.trgNode.x_pos+e.trgNode.width),a=-e.trgNode.x_pos):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP?(n=e.srcObj.x_pos,o=e.srcObj.x_pos+e.srcObj.width,i=e.trgNode.x_pos,a=e.trgNode.x_pos+e.trgNode.width):(n=e.srcObj.y_pos,o=e.srcObj.y_pos+e.srcObj.height,i=e.trgNode.y_pos,a=e.trgNode.y_pos+e.trgNode.height):this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?(n=-e.x1,i=-e.x2,o=-e.x1,a=-e.x2):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP?(n=e.x1,i=e.x2,o=e.x1,a=e.x2):(n=e.y1,i=e.y2,o=e.y1,a=e.y2);var r=e;this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?r=this.rotateData90Degrees(r,true):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP&&(r=this.rotateData90Degrees(r,false));var s=this.canvasLayout.linkType===l.LINK_TYPE_ELBOW?this.getElbowPathInfo(r,t,n,i,o,a):this.getCurvePathInfo(r,t,n,i,o,a);return this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?(s.elements=this.rotateElements90Degrees(s.elements,false),s.centerPoint=this.rotatePoint90Degrees(s.centerPoint.x,s.centerPoint.y,false)):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP&&(s.elements=this.rotateElements90Degrees(s.elements,true),s.centerPoint=this.rotatePoint90Degrees(s.centerPoint.x,s.centerPoint.y,true)),s.path=this.createPath(s.elements),s}},{key:"getCurvePathInfo",value:function(e,t,n,i,o,a){var r={x:0,y:0},s=e.x2-e.x1,l=[];if(l.push({p:"M",x:e.x1,y:e.y1}),s>=t||a>n-this.canvasLayout.wrapAroundNodePadding&&i<o+this.canvasLayout.wrapAroundNodePadding&&e.x2>e.x1){var c=e.x1+(e.x2-e.x1)/2,u=e.y1,d=c,h=e.y2;l.push({p:"C",x:c,y:u,x2:d,y2:h,x3:e.x2,y3:e.y2}),r.x=c,r.y=u+(h-u)/2}else{var p=e.y2-e.y1,g=this.calculateMidY(e,n,o,i,a),f=Math.min(Math.abs(p)/2,-(s-t/2)),v=t-Math.max(s/2,0),y=e.x1+v,m=e.y1,C=y,k=e.y1+(g-e.y1)/2,b=e.x1+(e.x2-e.x1)/2,T=g,P=e.x1-f,L=g,_=e.x2+f,N=g,x=e.x2-v,w=g,S=x,E=g+(e.y2-g)/2;P>_?(l.push({p:"Q",x:y,y:m,x2:C,y2:k},{p:"T",x:P,y:L},{p:"L",x:_,y:N},{p:"Q",x:x,y:w,x2:S,y2:E},{p:"T",x:e.x2,y:e.y2}),r.x=P+(_-P)/2,r.y=L):(l.push({p:"Q",x:y,y:m,x2:C,y2:k},{p:"T",x:b,y:T},{p:"Q",x:x,y:w,x2:S,y2:E},{p:"T",x:e.x2,y:e.y2}),r.x=b,r.y=T)}return{elements:l,centerPoint:r}}},{key:"getElbowPathInfo",value:function(e,t,n,i,o,a){var r,s=e.trgNode?e.trgNode.layout.minFinalLine:30,l={x:0,y:0},c=e.x1+t,u=e.y1,d=c,h=e.y2,p=e.x2-e.x1,g=e.y2-e.y1;r=p>0&&g<4*this.canvasLayout.elbowSize&&g>-4*this.canvasLayout.elbowSize?p<t+s?g/4:g/2:g>=0?this.canvasLayout.elbowSize:-this.canvasLayout.elbowSize;var f=this.canvasLayout.elbowSize,v=!1;p<t+s&&(v=!0,d=e.x2-s,f=Math.min(this.canvasLayout.elbowSize,-(p-(t+s))/2));var y=[];if(y.push({p:"M",x:e.x1,y:e.y1},{p:"L",x:c-this.canvasLayout.elbowSize,y:u},{p:"Q",x:c,y:u,x2:c,y2:u+r}),!1===v)y.push({p:"L",x:d,y:h-r}),l.x=d,l.y=h;else{var m,C,k=p<0?this.calculateMidY(e,n,o,i,a):h-(h-u)/2;k<i&&k<n||k>a&&k>o?(m=k-r,C=h+r):(m=k+r,C=h-r),y.push({p:"L",x:c,y:k-r},{p:"Q",x:c,y:k,x2:c-f,y2:k},{p:"L",x:d+f,y:k},{p:"Q",x:d,y:k,x2:d,y2:m},{p:"L",x:d,y:C}),l.x=c,l.y=k}return y.push({p:"Q",x:d,y:h,x2:d+this.canvasLayout.elbowSize,y2:h},{p:"L",x:e.x2,y:e.y2}),{elements:y,centerPoint:l}}},{key:"calculateMidY",value:function(e,t,n,i,o){return i>=n+this.canvasLayout.wrapAroundNodePadding?n+(i-n)/2:o<=t-this.canvasLayout.wrapAroundNodePadding?o+(t-o)/2:e.y1>e.y2?Math.min(t,i)-this.canvasLayout.wrapAroundSpacing:Math.max(n,o)+this.canvasLayout.wrapAroundSpacing}},{key:"rotateData90Degrees",value:function(e,t){var n=this.rotatePoint90Degrees(e.x1,e.y1,t),i=this.rotatePoint90Degrees(e.x2,e.y2,t);return{x1:n.x,y1:n.y,x2:i.x,y2:i.y}}},{key:"rotateElements90Degrees",value:function(e,t){var n,i=this;return e.forEach((function(e){n=i.rotatePoint90Degrees(e.x,e.y,t),e.x=n.x,e.y=n.y,"Q"!==e.p&&"C"!==e.p||(n=i.rotatePoint90Degrees(e.x2,e.y2,t),e.x2=n.x,e.y2=n.y,"C"===e.p&&(n=i.rotatePoint90Degrees(e.x3,e.y3,t),e.x3=n.x,e.y3=n.y))})),e}},{key:"rotatePoint90Degrees",value:function(e,t,n){return n?{x:t,y:-e}:{x:-t,y:e}}},{key:"createPath",value:function(e){var t=e.length-1,n="";return e.forEach((function(e,i){"M"===e.p?n+="M "+e.x+" "+e.y:"L"===e.p?n+="L "+e.x+" "+e.y:"T"===e.p?n+="T "+e.x+" "+e.y:"Q"===e.p?n+="Q "+e.x+" "+e.y+" "+e.x2+" "+e.y2:"C"===e.p&&(n+="C "+e.x+" "+e.y+" "+e.x2+" "+e.y2+" "+e.x3+" "+e.y3),i<t&&(n+=" ")})),n}},{key:"getStraightPath",value:function(e){var t="M "+e.x1+" "+e.y1+" L "+e.x2+" "+e.y2,n=e.x2-e.x1,i=e.y2-e.y1,o={x:e.x1+n/2,y:e.y1+i/2},a=Math.atan(i/n);return n<0&&(a=tr+a),{path:t,centerPoint:o,angle:a}}},{key:"getAssociationCurvePath",value:function(e,t){return e.assocLinkVariation===l.ASSOC_VAR_CURVE_LEFT?this.getCurveLeftPath(e,t):e.assocLinkVariation===l.ASSOC_VAR_DOUBLE_BACK_LEFT?this.getDoubleBackLeft(e,t):e.assocLinkVariation===l.ASSOC_VAR_DOUBLE_BACK_RIGHT?this.getDoubleBackRight(e,t):this.getCurveRightPath(e,t)}},{key:"getCurveLeftPath",value:function(e,t){var n=e.x1-(e.x1-e.x2)/2;return this.getCurveOutPath(e,t,n)}},{key:"getCurveRightPath",value:function(e,t){var n=e.x1+(e.x2-e.x1)/2;return this.getCurveOutPath(e,t,n)}},{key:"getCurveOutPath",value:function(e,t,n){var i=e.y1,o=n,a=e.y2;return{path:"M "+e.x1+" "+e.y1+" C "+n+" "+i+" "+o+" "+a+" "+e.x2+" "+e.y2,centerPoint:{x:n,y:i+(a-i)/2}}}},{key:"getDoubleBackLeft",value:function(e,t){var n=Math.min(e.x1,e.x2)-t-100;return this.getDoubleBack(e,t,n)}},{key:"getDoubleBackRight",value:function(e,t){var n=Math.max(e.x1,e.x2)+t+100;return this.getDoubleBack(e,t,n)}},{key:"getDoubleBack",value:function(e,t,n){var i=e.y1,o=n,a=e.y2;return{path:"M "+e.x1+" "+e.y1+" C "+n+" "+i+" "+o+" "+a+" "+e.x2+" "+e.y2,centerPoint:{x:this.calcCenterPoint(e.x1,n,o,e.x2),y:this.calcCenterPoint(e.y1,i,a,e.y2)}}}},{key:"calcCenterPoint",value:function(e,t,n,i){var o=.5;return Math.pow(.5,3)*e+3*Math.pow(.5,2)*o*t+3*Math.pow(.5,2)*o*n+Math.pow(o,3)*i}}]),t}(),ir=function(){function t(n){e._classCallCheck(this,t),this.canvasLayout=n}return e._createClass(t,[{key:"getDec",value:function(e,t){return t?t.find((function(t){return t.id===e})):null}},{key:"getDecLabelClass",value:function(e,t){var n=e.label_single_line?" d3-label-single-line":" d3-label-multi-line",i="center"===e.label_align?" d3-label-center":"";return this.getDecClass(e,"d3-".concat(t,"-dec-label"))+n+i}},{key:"getDecLabelTextAreaClass",value:function(e){return"d3-dec-label-entry"+(e.label_single_line?" d3-label-single-line":" d3-label-multi-line")+("center"===e.label_align?" d3-label-center":"")}},{key:"getDecTransform",value:function(e,t,n){return"translate(".concat(this.getDecPosX(e,t,n),", ").concat(this.getDecPosY(e,t,n),")")}},{key:"getDecPosX",value:function(e,t,n){return n===l.DEC_LINK?this.getLinkDecPosX(e,t,n):this.getNodeDecPosX(e,t)}},{key:"getNodeDecPosX",value:function(e,t){var n=e.position||"topLeft",i=0;return"topLeft"===n||"middleLeft"===n||"bottomLeft"===n?i=void 0!==e.x_pos?Number(e.x_pos):t.layout.decoratorLeftX:"topCenter"===n||"middleCenter"===n||"bottomCenter"===n?i=t.width/2+(void 0!==e.x_pos?Number(e.x_pos):t.layout.decoratorCenterX):"topRight"!==n&&"middleRight"!==n&&"bottomRight"!==n||(i=t.width+(void 0!==e.x_pos?Number(e.x_pos):t.layout.decoratorRightX)),i}},{key:"getLinkDecPosX",value:function(e,t,n){var i=e.position||"middle",o=0;return"middle"===i?o=t.pathInfo.centerPoint?t.pathInfo.centerPoint.x:t.x1+(t.x2-t.x1)/2:"source"===i?o=t.pathInfo.sourcePoint?t.pathInfo.sourcePoint.x:t.x1:"target"===i&&(o=t.pathInfo.targetPoint?t.pathInfo.targetPoint.x:t.x2),o=void 0!==e.x_pos?o+Number(e.x_pos):o,e.distance&&a.has_1(t,"pathInfo.angle")&&(o+=Math.cos(t.pathInfo.angle)*e.distance),"center"===e.label_align&&(o-=this.getDecWidth(e,t,n)/2),o}},{key:"getDecPosY",value:function(e,t,n){return n===l.DEC_LINK?this.getLinkDecPosY(e,t):this.getNodeDecPosY(e,t)}},{key:"getNodeDecPosY",value:function(e,t){var n=e.position||"topLeft",i=0;return"topLeft"===n||"topCenter"===n||"topRight"===n?i=void 0!==e.y_pos?Number(e.y_pos):t.layout.decoratorTopY:"middleLeft"===n||"middleCenter"===n||"middleRight"===n?i=t.height/2+(void 0!==e.y_pos?Number(e.y_pos):t.layout.decoratorMiddleY):"bottomLeft"!==n&&"bottomCenter"!==n&&"bottomRight"!==n||(i=t.height+(void 0!==e.y_pos?Number(e.y_pos):t.layout.decoratorBottomY)),i}},{key:"getLinkDecPosY",value:function(e,t){var n=e.position||"middle",i=0;return"middle"===n?i=t.pathInfo.centerPoint?t.pathInfo.centerPoint.y:t.y1+(t.y2-t.y1)/2:"source"===n?i=t.pathInfo.sourcePoint?t.pathInfo.sourcePoint.y:t.y1:"target"===n&&(i=t.pathInfo.targetPoint?t.pathInfo.targetPoint.y:t.y2),i=void 0!==e.y_pos?i+Number(e.y_pos):i,e.distance&&a.has_1(t,"pathInfo.angle")&&(i+=Math.sin(t.pathInfo.angle)*e.distance),i}},{key:"getDecPadding",value:function(e,t,n){return!1===e.outline?0:n===l.DEC_LINK?this.canvasLayout.linkDecoratorPadding:t.layout.decoratorPadding}},{key:"getDecWidth",value:function(e,t,n){return void 0!==e.width?Number(e.width):n===l.DEC_LINK?this.canvasLayout.linkDecoratorWidth:t.layout.decoratorWidth}},{key:"getDecHeight",value:function(e,t,n){return void 0!==e.height?Number(e.height):n===l.DEC_LINK?this.canvasLayout.linkDecoratorHeight:t.layout.decoratorHeight}},{key:"getDecClass",value:function(e,t){var n=t;return e&&e.class_name&&(n+=" "+e.class_name),n}},{key:"getDecImage",value:function(e){return e?e.image:""}},{key:"getDecLabelEditIconTranslate",value:function(e,t,n,i,o){return"translate(".concat(this.getDecLabelEditIconPosX(e,t,n,i,o),", ").concat(this.getDecLabelEditIconPosY(e),")")}},{key:"getDecLabelEditIconPosX",value:function(e,t,n,i,o){return"center"===e.label_align?this.getDecLabelWidth(e,t,n)/2+i.getBoundingClientRect().width/2/o:i.getBoundingClientRect().width/o}},{key:"getDecLabelEditIconPosY",value:function(e){return 0}},{key:"getDecLabelWidth",value:function(e,t,n){return void 0!==e.width?Number(e.width):n===l.DEC_LINK?this.canvasLayout.linkDecoratorLabelWidth:t.layout.decoratorLabelWidth}},{key:"getDecLabelHeight",value:function(e,t,n){return void 0!==e.height?Number(e.height):n===l.DEC_LINK?this.canvasLayout.linkDecoratorLabelHeight:t.layout.decoratorLabelHeight}},{key:"getDecLabelTextAreaWidth",value:function(e,t,n){return this.getDecLabelWidth(e,t,n)+2*l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getDecLabelTextAreaHeight",value:function(e,t,n){return this.getDecLabelHeight(e,t,n)+2*l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getDecLabelTextAreaPosX",value:function(){return-l.TEXT_AREA_BORDER_ADJUSTMENT}},{key:"getDecLabelTextAreaPosY",value:function(){return-(l.TEXT_AREA_BORDER_ADJUSTMENT-1)}}]),t}(),or=kn({"&":"&","<":"<",">":">",""":'"',"'":"'"}),ar=a.toString_1,rr=or,sr=/&(?:amp|lt|gt|quot|#39);/g,lr=RegExp(sr.source);var cr=function(e){return(e=ar(e))&&lr.test(e)?e.replace(sr,rr):e},ur=function(){function t(){e._classCallCheck(this,t)}return e._createClass(t,null,[{key:"processMarkdownAction",value:function(e,t,n,i){var o=n,a=i,r=null;switch(o===a?(o=this.findFirstSpace(t,o),a=this.findLastSpace(t,a)):this.allWhiteSpace(t,o,a)?o=a:(o=this.findFirstNonSpace(t,o,a),a=this.findLastNonSpace(t,o,a)),e){case"title":case"header":case"subheader":case"body":case"increaseHashes":case"decreaseHashes":r=this.processHeaderCommand(t,o,a,e);break;case"bold":r=this.processWrapCommand(t,o,a,"**");break;case"italics":r=this.processWrapCommand(t,o,a,"_");break;case"strikethrough":r=this.processWrapCommand(t,o,a,"~~");break;case"code":r=this.processCodeCommand(t,o,a);break;case"link":r=this.processLinkCommand(t,o,a);break;case"quote":case"numberedList":case"bulletedList":r=this.processMultiLineCommand(t,o,a,e);break;case"return":r=this.processReturnCommand(t,o,a,n,i)}return r}},{key:"findFirstSpace",value:function(e,t){var n=e.lastIndexOf(" ",t-1)+1,i=e.lastIndexOf("\n",t-1)+1;return Math.max(n,i,0)}},{key:"findLastSpace",value:function(e,t){var n=e.indexOf(" ",t),i=e.indexOf("\n",t);return n=-1===n?e.length:n,i=-1===i?e.length:i,Math.min(n,i,e.length)}},{key:"allWhiteSpace",value:function(e,t,n){return 0===e.slice(t,n).trim().length}},{key:"findFirstNonSpace",value:function(e,t,n){for(var i=t;(" "===e[i]||"\n"===e[i])&&i<=n;)i++;return i}},{key:"findLastNonSpace",value:function(e,t,n){for(var i=n;(" "===e[i-1]||"\n"===e[i-1])&&i>=t;)i--;return i}},{key:"processHeaderCommand",value:function(e,t,n,i){var o=this.findPrecedingNewLine(e,t),a=this.findSuceedingNewLine(e,n),r=e.slice(0,o),s=e.slice(o,a),l=e.slice(a),c=o,u=a,d="",h=s,p=this.getHashCount(s);if(p>0){var g=s.indexOf(" ");d=r+(h=s.slice(g+1))+l,u-=g+1}var f=this.getHeaderSyntax(i,p);return f&&(d=r+f+h+l,c+=f.length,u+=f.length),{newText:d,newStart:c,newEnd:u}}},{key:"getHeaderSyntax",value:function(e,t){switch(e){case"title":return"# ";case"header":return"## ";case"subheader":return"### ";case"body":return!1;case"increaseHashes":return 0===t?"# ":1===t?"## ":2===t&&"### ";case"decreaseHashes":return 0===t?"### ":1!==t&&(2===t?"# ":3===t?"## ":"### ")}return!1}},{key:"getHashCount",value:function(e){return e.startsWith("# ")?1:e.startsWith("## ")?2:e.startsWith("### ")?3:e.startsWith("#### ")?4:e.startsWith("##### ")?5:e.startsWith("###### ")?6:0}},{key:"processWrapCommand",value:function(e,t,n,i){var o="",a=t,r=n,s=e.slice(0,t),l=e.slice(t,n),c=e.slice(n),u=i.length;return s.endsWith(i)&&c.startsWith(i)?(o=s.slice(0,s.length-u)+l+c.slice(u),a=t-u,r=n-u):l.startsWith(i)&&l.endsWith(i)?(o=s+l.slice(0,l.length-u).slice(u)+c,a=t,r=n-2*u):(o=s+i+l+i+c,a=t+u,r=n+u),{newText:o,newStart:a,newEnd:r}}},{key:"processCodeCommand",value:function(e,t,n){return e.slice(t,n).indexOf("\n")>-1?this.processTripleBackTicks(e,t,n):this.processWrapCommand(e,t,n,"`")}},{key:"processTripleBackTicks",value:function(e,t,n){var i=this.findPrecedingNewLine(e,t),o=this.findSuceedingNewLine(e,n),a=e.slice(0,i),r=e.slice(i,o),s=e.slice(o),l=i,c=o,u="";return a.endsWith("```\n")&&s.startsWith("\n```")?(u=a.slice(0,i-4)+r+s.slice(4),l-=4,c-=4):(u=a+"```\n"+r+"\n```"+s,l+=4,c+=4),{newText:u,newStart:l,newEnd:c}}},{key:"processLinkCommand",value:function(e,t,n){var i="",o=t,a=n,r=e.slice(0,t),s=e.slice(t,n),l=e.slice(n);return r.endsWith("[")&&l.startsWith("](url)")?(i=r.slice(0,r.length-1)+s+l.slice(6),o=t-1,a=n-1):"[](url)"===s?(i=r+l,a=o=t):t===n?(i=r+"[](url)"+l,o=t+1,a=t+1):(i=r+"["+s+"](url)"+l,o=t+1,a=n+1),{newText:i,newStart:o,newEnd:a}}},{key:"processMultiLineCommand",value:function(e,t,n,i){return this.isMultiLineMarkdown(e,t,n,i)?this.removeMultiLineMarkdown(e,t,n,i):this.addMultiLineMarkdown(e,t,n,i)}},{key:"isMultiLineMarkdown",value:function(e,t,n,i){var o=this,a=this.findPrecedingNewLine(e,t),r=this.findSuceedingNewLine(e,n);return e.slice(a,r).split("\n").every((function(e){return o.isMultiLineItem(e,i)}))}},{key:"isMultiLineItem",value:function(e,t){switch(t){case"quote":return e.startsWith("> ");case"bulletedList":return e.startsWith("* ");case"numberedList":var n=this.getPrefixNumber(e);return!isNaN(n)&&n>0}return!1}},{key:"getPrefixNumber",value:function(e){var t=e.indexOf(". "),n=e.slice(0,t);return Number(n)}},{key:"removeMultiLineMarkdown",value:function(e,t,n,i){var o=this,a=this.findPrecedingNewLine(e,t),r=this.findSuceedingNewLine(e,n),s=e.slice(0,a),l=e.slice(a,r),c=e.slice(r),u=a,d=r,h=s,p=l.split("\n");return p.forEach((function(e,t){var n=o.removeListPrefix(e,i);d-=e.length-n.length,h+=n,t<p.length-1&&(h+="\n")})),{newText:h+=c,newStart:u,newEnd:d}}},{key:"removeListPrefix",value:function(e,t){switch(t){case"quote":case"bulletedList":return e.slice(2);case"numberedList":var n=e.indexOf(". ");return e.slice(n+2)}return""}},{key:"addMultiLineMarkdown",value:function(e,t,n,i){var o=this,a=this.findPrecedingNewLine(e,t),r=this.findSuceedingNewLine(e,n),s=e.slice(0,a),l=e.slice(a,r),c=e.slice(r),u=a,d=r,h=s;if(""===l){var p=this.getListPrefix(i,1);h=s+p+c,u=a+p.length,d=u}else{var g=l.split("\n");g.forEach((function(t,n){var a=o.getListPrefix(i,n+1,t);d+=a.length-t.length,h+=a,n===g.length-1&&"\n"===e[r]&&"\n"===e[r+1]||(h+="\n")})),h+=c}return{newText:h,newStart:u,newEnd:d}}},{key:"getListPrefix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";switch(e){case"quote":return"> "+n;case"bulletedList":return"* "+n;case"numberedList":return t+". "+n}return null}},{key:"findPrecedingNewLine",value:function(e,t){for(var n=t;n>0&&"\n"!==e[n-1];)n--;return n}},{key:"findSuceedingNewLine",value:function(e,t){for(var n=t;n<e.length&&"\n"!==e[n];)n++;return n}},{key:"processReturnCommand",value:function(e,t,n,i,o){var a=this.findPrecedingNewLine(e,t),r=this.findSuceedingNewLine(e,n),s=e.slice(0,a),l=e.slice(a,r),c=e.slice(r);if(!this.isCursorAtBeginningOfLine(a,i,o)){if(this.isMultiLineItem(l,"quote"))return this.insertMultiLineItem(">",s,l,c,r);if(this.isMultiLineItem(l,"bulletedList"))return this.insertMultiLineItem("*",s,l,c,r);if(this.isMultiLineItem(l,"numberedList")){var u=this.getPrefixNumber(l)+1,d=this.renumberEndText(c,u);return this.insertMultiLineItem(u+".",s,l,d,r)}}return null}},{key:"isCursorAtBeginningOfLine",value:function(e,t,n){return t===n&&t===e}},{key:"insertMultiLineItem",value:function(e,t,n,i,o){var a=t+n+"\n"+e+" "+i,r=o+2+e.length;return{newText:a,newStart:r,newEnd:r}}},{key:"renumberEndText",value:function(e,t){var n=this,i=e.split("\n"),o="",a=!1;return i.forEach((function(e,i){n.isMultiLineItem(e,"numberedList")&&!1===a?o+=n.renumberLine(e,t+i):(o+=e,i>0&&(a=!0)),o+="\n"})),o}},{key:"renumberLine",value:function(e,t){var n=e.indexOf(". ");return t+". "+e.slice(n+2)}}]),t}(),dr=Object.assign({},vn),hr=function(){function t(n,i,o,a,r,s,l,c,u,d){e._classCallCheck(this,t),this.config=n,this.dispUtils=i,this.nodeUtils=o,this.decUtils=a,this.canvasController=r,this.canvasDiv=s,this.activePipeline=l,this.displayCommentsCallback=c,this.displayLinksCallback=u,this.getCommentToolbarPosCallback=d,this.logger=new h.Logger("SvgCanvasTextArea"),this.editingText=!1,this.editingTextId="",this.addingTextToTextArea=!1,this.textAreaHeight=null}return e._createClass(t,[{key:"isEditingText",value:function(){return this.editingText}},{key:"getEditingTextId",value:function(){return this.editingTextId}},{key:"displayCommentTextArea",value:function(e,t){if(this.editingTextData={id:e.id,text:e.content,singleLine:!1,maxCharacters:null,allowReturnKey:!0,textCanBeEmpty:!0,xPos:0,yPos:0,width:e.width,height:e.height,className:"d3-comment-entry",parentDomObj:t,keyboardInputCallback:this.config.enableMarkdownInComments?this.commentKeyboardHandler.bind(this):null,autoSizeCallback:this.autoSizeComment.bind(this),saveTextChangesCallback:this.saveCommentChanges.bind(this),closeTextAreaCallback:this.closeCommentTextArea.bind(this)},this.displayTextArea(this.editingTextData),this.config.enableMarkdownInComments&&this.dispUtils.isDisplayingFullPage()){var n=this.getCommentToolbarPosCallback(e);this.canvasController.openTextToolbar(n.x,n.y,this.markdownActionHandler.bind(this),this.blurInTextToolbar.bind(this))}}},{key:"commentKeyboardHandler",value:function(e){var t=this.getMarkdownAction(e);t&&("return"!==t&&f.CanvasUtils.stopPropagationAndPreventDefault(e),this.markdownActionHandler(t,e))}},{key:"blurInTextToolbar",value:function(e){if(!(this.addingTextToTextArea||e.relatedTarget&&(f.CanvasUtils.getParentElementWithClass(e.relatedTarget,"d3-comment-entry")||f.CanvasUtils.getParentElementWithClass(e.relatedTarget,"text-toolbar")||f.CanvasUtils.getParentElementWithClass(e.relatedTarget,"bx--overflow-menu-options__btn")))){var t=dr.select(this.editingTextData.parentDomObj).selectAll(".d3-foreign-object-text-entry"),n=this.canvasDiv.selectAll(".d3-comment-entry").node();this.saveAndCloseTextArea(t,this.editingTextData,n.value,e)}}},{key:"getMarkdownAction",value:function(e){if(f.CanvasUtils.isCmndCtrlPressed(e))switch(e.keyCode){case 66:return"bold";case 73:return"italics";case 88:return e.shiftKey?"strikethrough":null;case 55:return e.shiftKey?"numberedList":null;case 56:return e.shiftKey?"bulletedList":null;case 69:return"code";case 75:return"link";case 188:return"decreaseHashes";case 190:return e.shiftKey?"quote":"increaseHashes"}else if(13===e.keyCode)return"return";return null}},{key:"markdownActionHandler",value:function(e,t){this.logger.log("markdownActionHandler - action = "+e);var n=this.canvasDiv.selectAll(".d3-comment-entry").node(),i=n.selectionStart,o=n.selectionEnd,a=n.value,r=ur.processMarkdownAction(e,a,i,o);r&&(f.CanvasUtils.stopPropagationAndPreventDefault(t),this.addTextToTextArea(r,n))}},{key:"addTextToTextArea",value:function(e,t){this.addingTextToTextArea=!0;var n=cr(e.newText);t.focus(),t.select(),document.execCommand("insertText",!1,n),t.setSelectionRange(e.newStart,e.newEnd),this.addingTextToTextArea=!1}},{key:"autoSizeComment",value:function(e,t,n){this.logger.log("autoSizeComment - textAreaHt = "+this.textAreaHeight+" scroll ht = "+e.scrollHeight);var i=e.scrollHeight+12;this.textAreaHeight<i&&(this.textAreaHeight=i,t.style("height",this.textAreaHeight+"px"),this.activePipeline.getComment(n.id).height=this.textAreaHeight,this.displayCommentsCallback(),this.displayLinksCallback())}},{key:"saveCommentChanges",value:function(e,t,n){var i=this.activePipeline.getComment(e),o={editType:"editComment",editSource:"canvas",id:i.id,content:t,width:i.width,height:n,x_pos:i.x_pos,y_pos:i.y_pos,pipelineId:this.activePipeline.id};this.canvasController.editActionHandler(o)}},{key:"closeCommentTextArea",value:function(){this.canvasController.closeTextToolbar()}},{key:"displayNodeLabelTextArea",value:function(e,t){dr.select(t).selectAll("div").attr("style","display:none;"),this.editingTextData={id:e.id,text:e.label,singleLine:e.layout.labelSingleLine,maxCharacters:e.layout.labelMaxCharacters,allowReturnKey:e.layout.labelAllowReturnKey,textCanBeEmpty:!1,xPos:this.nodeUtils.getNodeLabelTextAreaPosX(e),yPos:this.nodeUtils.getNodeLabelTextAreaPosY(e),width:this.nodeUtils.getNodeLabelTextAreaWidth(e),height:this.nodeUtils.getNodeLabelTextAreaHeight(e),className:this.nodeUtils.getNodeLabelTextAreaClass(e),parentDomObj:t,autoSizeCallback:this.autoSizeMultiLineLabel.bind(this),saveTextChangesCallback:this.saveNodeLabelChanges.bind(this),closeTextAreaCallback:this.closeNodeLabelTextArea.bind(this)},this.displayTextArea(this.editingTextData)}},{key:"autoSizeMultiLineLabel",value:function(e,t,n){this.logger.log("autoSizeNodeLabel - textAreaHt = "+this.textAreaHeight+" scroll ht = "+e.scrollHeight),n.maxCharacters&&e.value.length>n.maxCharacters&&(e.value=e.value.substring(0,n.maxCharacters)),t.style("height",0);var i=e.scrollHeight+12;this.textAreaHeight=i,t.style("height",this.textAreaHeight+"px")}},{key:"saveNodeLabelChanges",value:function(e,t,n,i){var o={editType:"setNodeLabel",editSource:"canvas",nodeId:e,label:t,pipelineId:this.activePipeline.id};this.canvasController.editActionHandler(o)}},{key:"closeNodeLabelTextArea",value:function(e){dr.select(this.editingTextData.parentDomObj).selectAll("div").attr("style",null)}},{key:"displayDecLabelTextArea",value:function(e,t,n,i){this.displayTextArea({id:e.id,text:e.label,singleLine:e.label_single_line||!1,maxCharacters:e.label_max_characters||null,allowReturnKey:e.label_allow_return_key||!1,textCanBeEmpty:!1,xPos:this.decUtils.getDecLabelTextAreaPosX(),yPos:this.decUtils.getDecLabelTextAreaPosY(),width:this.decUtils.getDecLabelTextAreaWidth(e,t,n),height:this.decUtils.getDecLabelTextAreaHeight(e,t,n),className:this.decUtils.getDecLabelTextAreaClass(e),parentDomObj:i,objId:t.id,objType:n,autoSizeCallback:this.autoSizeMultiLineLabel.bind(this),saveTextChangesCallback:this.saveDecLabelChanges.bind(this),closeTextAreaCallback:null})}},{key:"saveDecLabelChanges",value:function(e,t,n,i){var o={editType:"editDecorationLabel",editSource:"canvas",decId:e,objId:i.objId,objType:i.objType,label:t,pipelineId:this.activePipeline.id};this.canvasController.editActionHandler(o)}},{key:"displayTextArea",value:function(e){var t=this;this.textAreaHeight=e.height,this.editingText=!0,this.editingTextId=e.id;var n=dr.select(e.parentDomObj).append("foreignObject").attr("class","d3-foreign-object-text-entry").attr("width",e.width).attr("height",e.height).attr("x",e.xPos).attr("y",e.yPos),i=n.append("xhtml:textarea").attr("class",e.className).text(cr(e.text)).on("keydown",(function(i){!e.singleLine&&e.allowReturnKey||13!==i.keyCode||f.CanvasUtils.stopPropagationAndPreventDefault(i),27===i.keyCode&&(f.CanvasUtils.stopPropagationAndPreventDefault(i),t.textAreaEscKeyPressed=!0,t.closeTextArea(n,e)),e.maxCharacters&&i.target.value.length>=e.maxCharacters&&!t.textAreaAllowedKeys(i)&&f.CanvasUtils.stopPropagationAndPreventDefault(i),e.keyboardInputCallback&&e.keyboardInputCallback(i)})).on("keyup",(function(t){e.autoSizeCallback(t.target,n,e)})).on("paste",(function(i){t.logger.log("Text area - Paste - Scroll Ht = "+i.target.scrollHeight),setTimeout(e.autoSizeCallback,500,i.target,n,e)})).on("blur",(function(i,o){t.logger.log("Text area - blur"),t.textAreaEscKeyPressed?t.textAreaEscKeyPressed=!1:i.relatedTarget&&f.CanvasUtils.getParentElementWithClass(i.relatedTarget,"text-toolbar")||t.saveAndCloseTextArea(n,e,i.target.value,i)})).on("focus",(function(i,o){t.logger.log("Text area - focus"),e.autoSizeCallback(i.target,n,e)})).on("mousedown click dblclick contextmenu",(function(e,t){e.stopPropagation()}));i.node().focus(),i.node().setSelectionRange(e.text.length,e.text.length)}},{key:"saveAndCloseTextArea",value:function(e,t,n,i){if(!n&&!t.textCanBeEmpty)return f.CanvasUtils.stopPropagationAndPreventDefault(i),void this.closeTextArea(e,t);var o=n;this.closeTextArea(e,t),t.text===o&&this.textAreaHeight===t.height||(this.isCommentBeingUpdated=!0,t.saveTextChangesCallback(t.id,o,this.textAreaHeight,t),this.isCommentBeingUpdatd=!1)}},{key:"closeTextArea",value:function(e,t){t.closeTextAreaCallback&&t.closeTextAreaCallback(t.id),e.remove(),this.editingText=!1,this.editingTextId=""}},{key:"textAreaAllowedKeys",value:function(e){return 46===e.keyCode||8===e.keyCode||37===e.keyCode||39===e.keyCode||38===e.keyCode||40===e.keyCode||65===e.keyCode&&f.CanvasUtils.isCmndCtrlPressed(e)}}]),t}(),pr=function(){function t(n,i){e._classCallCheck(this,t),this.logger=new h.Logger("SVGCanvasActivePipeline"),this.logger.log("constructor - start"),this.initialize(n,i),this.logger.log("constructor - end")}return e._createClass(t,[{key:"initialize",value:function(e,t){this.logger.logStartTimer("initialize"),this.canvasInfo=t,this.pipeline=this.getPipeline(e,t),this.id=this.pipeline.id,this.zoom=this.pipeline.zoom,this.nodes=this.pipeline.nodes,this.comments=this.pipeline.comments,this.links=this.pipeline.links,this.mappedNodes=this.getMappedArray(this.pipeline.nodes),this.mappedComments=this.getMappedArray(this.pipeline.comments),this.mappedLinks=this.getMappedArray(this.pipeline.links),this.pipeline=this.preProcessPipeline(this.pipeline),this.logger.logEndTimer("initialize")}},{key:"getCanvasDimensions",value:function(e){return f.CanvasUtils.getCanvasDimensions(this.pipeline.nodes,this.pipeline.comments,this.pipeline.links,e)}},{key:"getObjectTypeName",value:function(e){return this.getComment(e.id)?"comment":this.getNode(e.id)?"node":"link"}},{key:"getNode",value:function(e){var t=this.mappedNodes[e];return void 0===t?null:t}},{key:"getNodes",value:function(e){var t=this,n=[];return e.forEach((function(e){var i=t.getNode(e);i&&n.push(i)})),n}},{key:"getSupernodes",value:function(){return this.pipeline.nodes.filter((function(e){return f.CanvasUtils.isSupernode(e)}))}},{key:"isEmptyOrBindingsOnly",value:function(){return(a.isEmpty_1(this.pipeline.nodes)||this.containsOnlyBindingNodes())&&a.isEmpty_1(this.pipeline.comments)}},{key:"containsOnlyBindingNodes",value:function(){return!this.pipeline.nodes.find((function(e){return!f.CanvasUtils.isSuperBindingNode(e)}))}},{key:"getComment",value:function(e){var t=this.mappedComments[e];return void 0===t?null:t}},{key:"getNodesAndComments",value:function(){return this.pipeline.nodes.concat(this.pipeline.comments)}},{key:"getNodeOrComment",value:function(e){var t=this.getNode(e);return null===t&&(t=this.getComment(e)),t}},{key:"getLink",value:function(e){var t=this.mappedLinks[e];return void 0===t?null:t}},{key:"replaceLink",value:function(e){var t=this.pipeline.links.findIndex((function(t){return t.id===e.id}));this.pipeline.links.splice(t,1,e),this.mappedLinks=this.getMappedArray(this.pipeline.links)}},{key:"getPipeline",value:function(e,t){var n=t.pipelines.find((function(t){return t.id===e}));return n||{id:e,nodes:[],comments:[],links:[]}}},{key:"preProcessPipeline",value:function(e){var t=this;return this.setAllPortsDisconnected(e),e.links.forEach((function(e){e.type===l.COMMENT_LINK?(e.srcObj=t.getComment(e.srcNodeId),e.trgNode=t.getNode(e.trgNodeId)):(e.srcObj=t.getNode(e.srcNodeId),e.trgNode=t.getNode(e.trgNodeId),e.srcObj&&t.setOutputPortConnected(e.srcObj,e.srcNodePortId),e.trgNode&&t.setInputPortConnected(e.trgNode,e.trgNodePortId))})),e}},{key:"setAllPortsDisconnected",value:function(e){e.nodes.forEach((function(e){e.inputs&&e.inputs.forEach((function(e){return e.isConnected=!1})),e.outputs&&e.outputs.forEach((function(e){return e.isConnected=!1}))}))}},{key:"setInputPortConnected",value:function(e,t){var n=t||f.CanvasUtils.getDefaultInputPortId(e);e.inputs&&e.inputs.forEach((function(e){e.id===n&&(e.isConnected=!0)}))}},{key:"setOutputPortConnected",value:function(e,t){var n=t||f.CanvasUtils.getDefaultOutputPortId(e);e.outputs&&e.outputs.forEach((function(e){e.id===n&&(e.isConnected=!0)}))}},{key:"getMappedArray",value:function(e){return e.reduce((function(e,t){return e[t.id]=t,e}),{})}}]),t}(),gr=Object.assign({},Yn,hi,vn,Ai,Za),fr=require("markdown-it")({html:!1,linkify:!1,typographer:!0}),vr=function(){function t(n,i,o,a,r){var s=this,c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};e._classCallCheck(this,t),this.logger=new h.Logger(["SVGCanvasRenderer","PipeId",n]),this.logger.logStartTimer("constructor"+n.substring(0,5)),this.pipelineId=n,this.supernodeInfo=c,this.canvasDiv=i,this.canvasInfo=a,this.config=r,this.canvasController=o,this.objectModel=this.canvasController.getObjectModel(),this.activePipeline=new pr(n,a),this.superRenderers=[],this.instanceId=this.canvasController.getInstanceId(),this.canvasLayout=this.objectModel.getCanvasLayout(),this.dispUtils=new qa(this.canvasController,this.supernodeInfo.d3Selection,this.pipelineId),this.nodeUtils=new Qa(this.canvasLayout),this.commentUtils=new er,this.linkUtils=new nr(this.config,this.canvasLayout,this.nodeUtils,this.commentUtils),this.decUtils=new ir(this.canvasLayout),this.svgCanvasTextArea=new hr(this.config,this.dispUtils,this.nodeUtils,this.decUtils,this.canvasController,this.canvasDiv,this.activePipeline,this.displayComments.bind(this),this.displayLinks.bind(this),this.getCommentToolbarPos.bind(this)),this.dispUtils.setDisplayState(),this.logger.log(this.dispUtils.getDisplayStateMsg()),this.initializeZoomVariables(),this.minScaleExtent=.2,this.maxScaleExtent=1.8,this.commentSizing=!1,this.commentSizingDirection="",this.nodeSizing=!1,this.nodeSizingDirection="",this.nodeSizingObjectsInfo={},this.nodeSizingDetLinksInfo={},this.resizeObjInitialInfo=null,this.notSnappedXPos=0,this.notSnappedYPos=0,this.notSnappedWidth=0,this.notSnappedHeight=0,this.dragging=!1,this.dragOffsetX=0,this.dragOffsetY=0,this.dragRunningX=0,this.dragRunningY=0,this.dragObjects=[],this.dragStartX=0,this.dragStartY=0,this.dragOverLink=null,this.dragOverDetachedLinks=[],this.dragPointerOffsetInNode=null,this.dragNewLinkOverNode=null,this.existingNodeInsertableIntoLink=!1,this.existingNodeAttachableToDetachedLinks=!1,this.selecting=!1,this.movingBindingNodes=!1,this.contextMenuClosedOnZoom=!1,this.regionSelect=!1,this.region={startX:0,startY:0,width:0,height:0},this.regionStartTransformX=0,this.regionStartTransformY=0,this.drawingNewLinkData=null,this.drag=gr.drag().on("start",this.dragStart.bind(this)).on("drag",this.dragMove.bind(this)).on("end",this.dragEnd.bind(this)),this.draggingLinkData=null,this.dragSelectionHandle=gr.drag().on("start",this.dragStartLinkHandle.bind(this)).on("drag",this.dragMoveLinkHandle.bind(this)).on("end",this.dragEndLinkHandle.bind(this)),this.zoom=gr.zoom().trackpad(this.config.enableInteractionType===l.INTERACTION_TRACKPAD).preventBackGesture(!0).wheelDelta((function(e){return-e.deltaY*(s.config.enableInteractionType===l.INTERACTION_TRACKPAD?.02:.002)})).scaleExtent([this.minScaleExtent,this.maxScaleExtent]).on("start",this.zoomStart.bind(this)).on("zoom",this.zoomAction.bind(this)).on("end",this.zoomEnd.bind(this)),this.initializeGhostDiv(),this.canvasSVG=this.createCanvasSVG(),this.canvasGrp=this.createCanvasGroup(this.canvasSVG,"d3-canvas-group"),this.canvasUnderlay=this.createCanvasUnderlay(this.canvasGrp,"d3-canvas-underlay"),this.commentsGrp=this.createCanvasGroup(this.canvasGrp,"d3-comments-group"),this.nodesLinksGrp=this.createCanvasGroup(this.canvasGrp,"d3-nodes-links-group"),this.boundingRectsGrp=this.createBoundingRectanglesGrp(this.canvasGrp,"d3-bounding-rect-group"),this.resetCanvasSVGBehaviors(),this.displayCanvas(),this.dispUtils.isDisplayingFullPage()&&this.restoreZoom(),(this.dispUtils.isDisplayingSubFlowFullPage()||this.canvasLayout.alwaysDisplayBackToParentFlow)&&this.addBackToParentFlowArrow(this.canvasSVG),this.dispUtils.isDisplayingSubFlowFullPage()&&!this.canvasController.getSavedZoom(this.pipelineId)&&this.zoomToFit(),this.dispUtils.isDisplayingSubFlowInPlace()&&(this.supernodeInfo.d3Selection.selectAll(".d3-node-port-input").raise(),this.supernodeInfo.d3Selection.selectAll(".d3-node-port-output").raise()),this.logger.logEndTimer("constructor"+n.substring(0,5))}return e._createClass(t,[{key:"getParentSupernodeDatum",value:function(){var e=this,t=null;return this.canvasInfo.pipelines.forEach((function(n){n.id===e.supernodeInfo.pipelineId&&(t||(t=n.nodes.find((function(t){return f.CanvasUtils.isSupernode(t)&&t.id===e.supernodeInfo.id}))))})),t}},{key:"getZoomTransform",value:function(){return this.zoomTransform}},{key:"initializeZoomVariables",value:function(){this.zoomTransform=gr.zoomIdentity.translate(0,0).scale(1),this.zoomStartPoint={x:0,y:0,k:0}}},{key:"setCanvasInfoRenderer",value:function(e){this.logger.logStartTimer("setCanvasInfoRenderer"+this.pipelineId.substring(0,5)),this.canvasInfo=e,this.activePipeline.initialize(this.pipelineId,e),this.canvasLayout=this.objectModel.getCanvasLayout(),this.dispUtils.setDisplayState(),this.logger.log(this.dispUtils.getDisplayStateMsg()),this.resetCanvasSVGBehaviors(),this.resetCanvasCursor(),this.superRenderers=this.cleanUpSuperRenderers(),this.displayCanvas(),this.logger.logEndTimer("setCanvasInfoRenderer"+this.pipelineId.substring(0,5))}},{key:"cleanUpSuperRenderers",value:function(){var e=this,t=[];return this.activePipeline.getSupernodes().forEach((function(n){var i=e.getRendererForSupernode(n);i&&t.push(i),e.getDiscardedRenderersForSupernode(n).forEach((function(e){return e.canvasSVG.remove()}))})),t}},{key:"clearCanvas",value:function(){this.initializeZoomVariables(),this.canvasSVG.remove()}},{key:"refreshOnSizeChange",value:function(){if(this.logger.log("refreshOnSizeChange"),this.dispUtils.isDisplayingSubFlowFullPage()&&this.displayBindingNodesToFitSVG(),this.config.enableBoundingRectangles&&this.displayBoundingRectangles(),this.config.enablePositionNodeOnRightFlyoutOpen&&this.canvasController.isRightFlyoutOpen()){var e=this.config.enablePositionNodeOnRightFlyoutOpen,t=e.x?e.x:50,n=e.y?e.y:50,i=this.canvasController.getSelectedNodes().map((function(e){return e.id})),o=this.getZoomToReveal(i,t,n);this.zoomTo(o)}}},{key:"hideCanvas",value:function(){this.canvasSVG.style("display","none")}},{key:"displayCanvas",value:function(){this.logger.logStartTimer("displayCanvas"),this.canvasSVG.style("display","inherit"),this.displayComments(),this.displayNodes(),this.displayLinks(),this.dispUtils.isDisplayingSubFlowInPlace()&&this.displaySVGToFitSupernode(),this.dispUtils.isDisplayingSubFlowFullPage()&&this.displayPortsForSubFlowFullPage(),this.config.enableBoundingRectangles&&this.displayBoundingRectangles(),"None"!==this.config.enableCanvasUnderlay&&this.dispUtils.isDisplayingPrimaryFlowFullPage()&&this.setCanvasUnderlaySize(),this.logger.logEndTimer("displayCanvas")}},{key:"displayPortsForSubFlowFullPage",value:function(){this.setPortPositionsForNode(this.getParentSupernodeDatum()),this.displayBindingNodesToFitSVG()}},{key:"displaySVGToFitSupernode",value:function(){this.logger.log("displaySVGToFitSupernode - start");var e=this.getParentSupernodeSVGDimensions();this.canvasSVG.attr("width",e.width),this.canvasSVG.attr("height",e.height),this.canvasSVG.attr("x",e.x),this.canvasSVG.attr("y",e.y);var t=this.canvasSVG.selectChildren(".d3-svg-background");t.attr("width",e.width),t.attr("height",e.height),this.zoomToFit(),this.displayBindingNodesToFitSVG(),this.logger.log("displaySVGToFitSupernode - end")}},{key:"displayBindingNodesToFitSVG",value:function(){this.logger.log("displayBindingNodesToFitSVG - start"),this.setPortPositionsAllNodes(),this.moveSuperBindingNodes(),this.movingBindingNodes=!0,this.displayNodes(),this.displayLinks(),this.movingBindingNodes=!1,this.logger.log("displayBindingNodesToFitSVG - end")}},{key:"getParentSupernodeSVGDimensions",value:function(){var e=this.getParentSupernodeDatum();return{width:e.width-2*this.canvasLayout.supernodeSVGAreaPadding,height:e.height-this.canvasLayout.supernodeTopAreaHeight-this.canvasLayout.supernodeSVGAreaPadding,x:this.canvasLayout.supernodeSVGAreaPadding,y:this.canvasLayout.supernodeTopAreaHeight,x_pos:e.x_pos+this.canvasLayout.supernodeSVGAreaPadding,y_pos:e.y_pos+this.canvasLayout.supernodeTopAreaHeight}}},{key:"moveSuperBindingNodes",value:function(){var e=this,t=this.getTransformedViewportDimensions(),n=this.getParentSupernodeDatum();if(this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM||this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP){var i=n.width-2*this.canvasLayout.supernodeSVGAreaPadding;this.activePipeline.nodes.forEach((function(o){if(o.isSupernodeInputBinding){var a=e.nodeUtils.getSupernodePortXOffset(o.id,n.inputs);o.x_pos=t.width*(a/i)+t.x-o.outputs[0].cx,o.y_pos=e.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?t.y-o.height:t.y+t.height}if(o.isSupernodeOutputBinding){var r=e.nodeUtils.getSupernodePortXOffset(o.id,n.outputs);o.x_pos=t.width*(r/i)+t.x-o.inputs[0].cx,o.y_pos=e.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?o.y_pos=t.y+t.height:o.y_pos=t.y-o.height}}))}else{var o,a;f.CanvasUtils.isExpanded(n)?(o=this.canvasLayout.supernodeTopAreaHeight,a=n.height-(this.canvasLayout.supernodeTopAreaHeight+this.canvasLayout.supernodeSVGAreaPadding)):(o=0,a=n.height),this.activePipeline.nodes.forEach((function(i){if(i.isSupernodeInputBinding){i.x_pos=t.x-i.width;var r=e.nodeUtils.getSupernodePortYOffset(i.id,n.inputs)-o;i.y_pos=t.height*(r/a)+t.y-i.outputs[0].cy}if(i.isSupernodeOutputBinding){i.x_pos=t.x+t.width;var s=e.nodeUtils.getSupernodePortYOffset(i.id,n.outputs)-o;i.y_pos=t.height*(s/a)+t.y-i.inputs[0].cy}}))}}},{key:"displayBoundingRectangles",value:function(){if(this.activePipeline){var e=this.getViewportDimensions(),t=this.getTransformedRect(e,1),n=this.getCanvasDimensionsAdjustedForScale(1),i=this.getCanvasDimensionsAdjustedForScale(1,this.getZoomToFitPadding());this.boundingRectsGrp.selectChildren(".d3-bounding").remove();var o=this.boundingRectsGrp.append("g").attr("class","d3-bounding");o.append("rect").attr("height",e.height).attr("width",e.width).attr("x",0).attr("y",0).style("fill","none").style("stroke","darkorange"),o.append("rect").attr("height",t.height).attr("width",t.width-2).attr("x",t.x).attr("y",t.y).style("fill","none").style("stroke","red"),n&&o.append("rect").attr("height",n.height).attr("width",n.width).attr("x",n.left).attr("y",n.top).style("fill","none").style("stroke","blue"),i&&o.append("rect").attr("height",i.height).attr("width",i.width).attr("x",i.left).attr("y",i.top).style("fill","none").style("stroke","green"),this.config.enableBoundingRectangles&&this.superRenderers.length>0&&this.superRenderers.forEach((function(e){return e.displayBoundingRectangles()}))}}},{key:"isEditingText",value:function(){if(this.svgCanvasTextArea.isEditingText())return!0;var e=!1;return this.superRenderers.forEach((function(t){e||(e=t.isEditingText())})),e}},{key:"isDragging",value:function(){return this.dragging}},{key:"isNodeResizable",value:function(e){return!(!this.config.enableEditingActions||f.CanvasUtils.isSuperBindingNode(e)||f.CanvasUtils.isCollapsedSupernode(e)||!this.config.enableResizableNodes&&!f.CanvasUtils.isExpandedSupernode(e))}},{key:"shouldDisplayNodeSizingArea",value:function(e){return!f.CanvasUtils.isSuperBindingNode(e)&&(f.CanvasUtils.isSupernode(e)||this.config.enableResizableNodes)}},{key:"getAllNodeGroupsSelection",value:function(){return this.nodesLinksGrp.selectChildren(".d3-node-group")}},{key:"getAllLinkGroupsSelection",value:function(){return this.nodesLinksGrp.selectChildren(".d3-link-group")}},{key:"getAllCommentGroupsSelection",value:function(){return this.commentsGrp.selectChildren(".d3-comment-group")}},{key:"getNodeGroupSelectionById",value:function(e){var t=this.getSelectorForId("node_grp",e);return this.nodesLinksGrp.selectChildren(t)}},{key:"getLinkGroupSelectionById",value:function(e){var t=this.getSelectorForId("link_grp",e);return this.nodesLinksGrp.selectChildren(t)}},{key:"getSelectorForId",value:function(e,t,n){return"[data-id='".concat(this.getId(e,t,n),"']")}},{key:"getId",value:function(e,t,n){var i="".concat(e,"_").concat(this.instanceId);return t&&(i+="_".concat(t)),n&&(i+="_".concat(n)),i}},{key:"getMousePosSnapToGrid",value:function(e){var t=e;return this.config.enableSnapToGridType!==l.SNAP_TO_GRID_DURING&&this.config.enableSnapToGridType!==l.SNAP_TO_GRID_AFTER||(t=this.snapToGridPosition(t)),t}},{key:"snapToGridObject",value:function(e){var t=e;return t.x_pos=f.CanvasUtils.snapToGrid(t.x_pos,this.canvasLayout.snapToGridXPx),t.y_pos=f.CanvasUtils.snapToGrid(t.y_pos,this.canvasLayout.snapToGridYPx),t.width=f.CanvasUtils.snapToGrid(t.width,this.canvasLayout.snapToGridXPx),t.height=f.CanvasUtils.snapToGrid(t.height,this.canvasLayout.snapToGridYPx),t}},{key:"getTransformedMousePos",value:function(e){return this.transformPos(this.getMousePos(e,this.canvasSVG))}},{key:"getMousePos",value:function(e,t){var n=gr.pointer(e,t.node());return{x:n[0],y:n[1]}}},{key:"convertPageCoordsToCanvasCoords",value:function(e,t){var n=this.canvasSVG.node().getBoundingClientRect();return this.transformPos({x:e-Math.round(n.left),y:t-Math.round(n.top)})}},{key:"transformPos",value:function(e){return{x:(e.x-this.zoomTransform.x)/this.zoomTransform.k,y:(e.y-this.zoomTransform.y)/this.zoomTransform.k}}},{key:"unTransformPos",value:function(e){return{x:e.x*this.zoomTransform.k+this.zoomTransform.x,y:e.y*this.zoomTransform.k+this.zoomTransform.y}}},{key:"getTransformedRect",value:function(e,t){var n=t/this.zoomTransform.k;return{x:-this.zoomTransform.x/this.zoomTransform.k+n,y:-this.zoomTransform.y/this.zoomTransform.k+n,height:e.height/this.zoomTransform.k-2*n,width:e.width/this.zoomTransform.k-2*n}}},{key:"initializeGhostDiv",value:function(){this.dispUtils.isDisplayingFullPage()&&this.getGhostDivSel().empty()&&this.canvasDiv.append("div").attr("class","d3-ghost-div")}},{key:"getGhostDivSel",value:function(){return this.canvasDiv.selectAll(".d3-ghost-div")}},{key:"getGhostNode",value:function(e){var t=this,n=this.getGhostDimensions(),i=this.canvasController.convertNodeTemplate(e);i.layout=this.canvasController.getObjectModel().getNodeLayout(),i.is_expanded?(i.width=i.expanded_width,i.height=i.expanded_height):i.isResized?(i.width=i.resizeWidth,i.height=i.resizeHeight):(i.width=n.width,i.height=n.height);var o=this.getNodeImage(i),a=this.getImageType(o),r=this.getGhostDivSel(),s=this.objectModel.getNodeLayout(),l=Math.max(s.labelWidth,i.width);r.selectAll(".d3-ghost-svg").remove();var c=r.append("svg").attr("width",l*this.zoomTransform.k).attr("height",(50+i.height)*this.zoomTransform.k).attr("x",0).attr("y",0).attr("class","d3-ghost-svg").append("g").attr("class","d3-node-group");c.append("rect").attr("class","d3-ghost-node").attr("x",0).attr("y",0).attr("width",i.width).attr("height",i.height),c.append(a).attr("class","d3-node-image").each((function(){t.setNodeImageContent(this,i)})).attr("x",this.nodeUtils.getNodeImagePosX(i)).attr("y",this.nodeUtils.getNodeImagePosY(i)).attr("width",this.nodeUtils.getNodeImageWidth(i)).attr("height",this.nodeUtils.getNodeImageHeight(i));var u=c.append("foreignObject").attr("x",this.nodeUtils.getNodeLabelPosX(i)).attr("y",this.nodeUtils.getNodeLabelPosY(i)).attr("width",this.nodeUtils.getNodeLabelWidth(i)).attr("height",this.nodeUtils.getNodeLabelHeight(i)).attr("class","d3-foreign-object-ghost-label"),d=u.append("xhtml:div").attr("class",this.nodeUtils.getNodeLabelClass(i)),h=d.append("xhtml:span").html(i.label).node().getBoundingClientRect().width+4,p=this.nodeUtils.getNodeLabelWidth(i),g=Math.min(p,h),f=Math.max(0,(g-n.width)/2)*this.zoomTransform.k;if(c.attr("transform","translate(".concat(f,", 0) scale(").concat(this.zoomTransform.k,")")),"center"===i.layout.labelAlign){var v=Math.max(0,(p-g)/2);u.attr("width",g).attr("x",this.nodeUtils.getNodeLabelPosX(i)+v),d.attr("width",g)}var y=this.getBrowserZoom(),m=(f+n.width/2*this.zoomTransform.k)*y,C=n.height/2*this.zoomTransform.k*y;return{element:r.node(),centerX:m,centerY:C}}},{key:"getBrowserZoom",value:function(){var e=window.devicePixelRatio;return navigator.userAgent.includes("Chrome")?e=window.devicePixelRatio:navigator.userAgent.includes("Safari")?e=(window.outerWidth-8)/window.innerWidth:navigator.userAgent.includes("Firefox")&&(e=window.devicePixelRatio/2),e}},{key:"getGhostDimensions",value:function(){var e=this.objectModel.getNodeLayout();return{width:e.defaultNodeWidth,height:e.defaultNodeHeight}}},{key:"nodeTemplateDragStart",value:function(e){this.isNodeTemplateInsertableIntoLink(e)&&this.setDataLinkSelectionAreaWider(!0)}},{key:"nodeTemplateDragEnd",value:function(e){this.isNodeTemplateInsertableIntoLink(e)&&this.setDataLinkSelectionAreaWider(!1)}},{key:"nodeTemplateDragOver",value:function(e,t,n){if(this.isNodeTemplateInsertableIntoLink(e)){var i=this.getLinkAtMousePos(t,n);i&&!this.isLinkFullyAttached(i)||this.setInsertNodeIntoLinkHighlighting(i)}if(this.isNodeTemplateAttachableToDetachedLinks(e)){var o=this.convertPageCoordsToCanvasCoords(t,n),a=this.getGhostDimensions(),r={x1:o.x-a.width/2,y1:o.y-a.height/2,x2:o.x+a.width/2,y2:o.y+a.height/2},s=this.canvasController.convertNodeTemplate(e),l=this.getAttachableLinksForNodeAtPos(s,r);this.setDetachedLinkHighlighting(l)}"None"!==this.config.enableCanvasUnderlay&&this.dispUtils.isDisplayingPrimaryFlowFullPage()&&this.setCanvasUnderlaySize(t,n)}},{key:"setInsertNodeIntoLinkHighlighting",value:function(e){e?this.dragOverLink?e.id!==this.dragOverLink.id&&(this.unsetInsertNodeIntoLinkHighlighting(),this.dragOverLink=e,this.setNodeDragOverLinkHighlighting(this.dragOverLink,!0)):(this.dragOverLink=e,this.setNodeDragOverLinkHighlighting(this.dragOverLink,!0)):this.unsetInsertNodeIntoLinkHighlighting()}},{key:"unsetInsertNodeIntoLinkHighlighting",value:function(e){this.dragOverLink&&(this.setNodeDragOverLinkHighlighting(this.dragOverLink,!1),this.dragOverLink=null)}},{key:"setDetachedLinkHighlighting",value:function(e){var t=this;e&&e.length>0?(this.unsetDetachedLinkHighlighting(),this.dragOverDetachedLinks=e,this.dragOverDetachedLinks.forEach((function(e){return t.setNodeDragOverLinkHighlighting(e,!0)}))):this.dragOverDetachedLinks.length>0&&this.unsetDetachedLinkHighlighting()}},{key:"unsetDetachedLinkHighlighting",value:function(){var e=this;this.dragOverDetachedLinks.forEach((function(t){return e.setNodeDragOverLinkHighlighting(t,!1)})),this.dragOverDetachedLinks=[]}},{key:"setNodeDragOverLinkHighlighting",value:function(e,t){this.getLinkGroupSelectionById(e.id).attr("data-drag-node-over",!!t||null)}},{key:"setNewLinkOverNode",value:function(e){var t=this.getNodeNearMousePos(e,this.canvasLayout.nodeProximity);t&&this.isConnectionAllowedToNearbyNode(e,t)?this.dragNewLinkOverNode?t.id!==this.dragNewLinkOverNode.id&&(this.setNewLinkOverNodeHighlighting(this.dragNewLinkOverNode,!1),this.dragNewLinkOverNode=t,this.setNewLinkOverNodeHighlighting(this.dragNewLinkOverNode,!0)):(this.dragNewLinkOverNode=t,this.setNewLinkOverNodeHighlighting(this.dragNewLinkOverNode,!0)):this.dragNewLinkOverNode&&(this.setNewLinkOverNodeHighlighting(this.dragNewLinkOverNode,!1),this.dragNewLinkOverNode=null)}},{key:"isConnectionAllowedToNearbyNode",value:function(e,t){if(this.drawingNewLinkData){if(this.drawingNewLinkData.action===l.NODE_LINK){var n=this.drawingNewLinkData.srcNode,i=t,o=this.drawingNewLinkData.srcNodePortId,a=f.CanvasUtils.getDefaultInputPortId(i);return f.CanvasUtils.isDataConnectionAllowed(o,a,n,i,this.activePipeline.links)}if(this.drawingNewLinkData.action===l.ASSOCIATION_LINK){var r=this.drawingNewLinkData.srcNode,s=t;return f.CanvasUtils.isAssocConnectionAllowed(r,s,this.activePipeline.links)}if(this.drawingNewLinkData.action===l.COMMENT_LINK){var c=this.drawingNewLinkData.srcObjId,u=t.id;return f.CanvasUtils.isCommentLinkConnectionAllowed(c,u,this.activePipeline.links)}}else if(this.draggingLinkData){if(this.getNewLinkOnDrag(e,this.canvasLayout.nodeProximity))return!0}return!1}},{key:"setNewLinkOverNodeHighlighting",value:function(e,t){e&&this.getNodeGroupSelectionById(e.id).attr("data-new-link-over",t?"yes":"no")}},{key:"setNewLinkOverNodeCancel",value:function(){this.setNewLinkOverNodeHighlighting(this.dragNewLinkOverNode,!1),this.dragNewLinkOverNode=null}},{key:"nodeTemplateDropped",value:function(e,t,n){if(null!==e){var i=this.transformMousePosForNode(t,n);this.dragOverLink?(this.canvasController.createNodeFromTemplateOnLinkAt(e,this.dragOverLink,i,this.pipelineId),this.unsetInsertNodeIntoLinkHighlighting()):this.dragOverDetachedLinks.length>0?(this.canvasController.createNodeFromTemplateAttachLinks(e,this.dragOverDetachedLinks,i,this.pipelineId),this.unsetDetachedLinkHighlighting()):this.canvasController.createNodeFromTemplateAt(e,i,this.pipelineId)}}},{key:"externalObjectDropped",value:function(e,t,n){if(null!==e){var i=this.transformMousePosForNode(t,n);this.canvasController.createDroppedExternalObject(e,i,this.pipelineId)}}},{key:"transformMousePosForNode",value:function(e,t){var n=this.convertPageCoordsToCanvasCoords(e,t),i=this.getGhostDimensions();return n.x-=i.width/2,n.y-=i.height/2,this.getMousePosSnapToGrid(n)}},{key:"isNodeTemplateInsertableIntoLink",value:function(e){return this.config.enableInsertNodeDroppedOnLink&&f.CanvasUtils.hasInputAndOutputPorts(e)&&!this.isPortMaxCardinalityZero(e.inputs[0])&&!this.isPortMaxCardinalityZero(e.outputs[0])}},{key:"isExistingNodeInsertableIntoLink",value:function(){return this.config.enableInsertNodeDroppedOnLink&&1===this.dragObjects.length&&f.CanvasUtils.isNode(this.dragObjects[0])&&f.CanvasUtils.hasInputAndOutputPorts(this.dragObjects[0])&&!f.CanvasUtils.isNodeDefaultPortsCardinalityAtMax(this.dragObjects[0],this.activePipeline.links)}},{key:"isExistingNodeAttachableToDetachedLinks",value:function(){return this.config.enableLinkSelection===l.LINK_SELECTION_DETACHABLE&&1===this.dragObjects.length&&f.CanvasUtils.isNode(this.dragObjects[0])}},{key:"isNodeTemplateAttachableToDetachedLinks",value:function(e){return this.config.enableLinkSelection===l.LINK_SELECTION_DETACHABLE}},{key:"getAttachableLinksForNodeAtPos",value:function(e,t){var n=this,i=e.inputs&&e.inputs.length>0,o=e.outputs&&e.outputs.length>0,a=this.activePipeline.links.filter((function(e){return e.srcPos&&o&&f.CanvasUtils.isPosInArea(e.srcPos,t,n.canvasLayout.ghostAreaPadding)?(e.nodeOverSrcPos=!0,!0):e.trgPos&&i&&f.CanvasUtils.isPosInArea(e.trgPos,t,n.canvasLayout.ghostAreaPadding)?(e.nodeOverTrgPos=!0,!0):(e.nodeOverSrcPos=!1,e.nodeOverTrgPos=!1,!1)}));a.length>0&&(a=f.CanvasUtils.getDetachedLinksToUpdate(e,a,this.activePipeline.links).oldLinks);return a}},{key:"isLinkFullyAttached",value:function(e){return!!e&&(void 0!==e.srcNodeId&&void 0!==e.trgNodeId)}},{key:"getNodePort",value:function(e,t,n){var i=this.activePipeline.getNode(e);if(i){var o=("input"===n?i.inputs:i.outputs).find((function(e){return e.id===t}));return void 0===o?null:o}return null}},{key:"setMaxZoomExtent",value:function(e){if(this.dispUtils.isDisplayingFullPage()){var t=this.maxScaleExtent*e;this.zoom.scaleExtent([this.minScaleExtent,t])}else{var n=1*Number(e)/this.zoomTransform.k;this.supernodeInfo.renderer.setMaxZoomExtent(n)}}},{key:"createCanvasSVG",value:function(){var e=this;this.logger.log("Create Canvas SVG.");var t=this.canvasDiv,n={width:"100%",height:"100%",x:0,y:0};this.dispUtils.isDisplayingSubFlowInPlace()&&(t=this.supernodeInfo.d3Selection,n=this.getParentSupernodeSVGDimensions());var i=t.append("svg").attr("class","svg-area").attr("data-pipeline-id",this.activePipeline.id).attr("width",n.width).attr("height",n.height).attr("x",n.x).attr("y",n.y).on("mouseenter",(function(t,n){e.supernodeInfo.renderer&&e.config.enableZoomIntoSubFlows&&e.supernodeInfo.renderer.setMaxZoomExtent(1/e.zoomTransform.k)})).on("mouseleave",(function(t,n){e.supernodeInfo.renderer&&e.config.enableZoomIntoSubFlows&&e.supernodeInfo.renderer.setMaxZoomExtent(1)}));if(i.append("rect").attr("x",0).attr("y",0).attr("width",n.width).attr("height",n.height).attr("data-pipeline-id",this.activePipeline.id).attr("class","d3-svg-background").attr("pointer-events","all").style("cursor",this.getCanvasCursor()),this.dispUtils.isDisplayingFullPage()){var o=i.append("defs");this.createDropShadow(o)}return i}},{key:"resetCanvasSVGBehaviors",value:function(){var e=this;this.canvasSVG.on(".zoom",null),!this.activePipeline.isEmptyOrBindingsOnly()&&this.dispUtils.isDisplayingFullPage()&&this.canvasSVG.call(this.zoom),this.canvasSVG.on("mousemove.zoom",(function(t){e.drawingNewLinkData&&e.drawNewLink(t),e.draggingLinkData&&e.dragLinkHandle(t)})).on("mousedown",(function(t){e.logger.log("Canvas - mousedown"),e.dispUtils.isDisplayingSubFlowInPlace()&&t.button===l.CONTEXT_MENU_BUTTON&&t.stopPropagation()})).on("mouseup.zoom",(function(t){e.logger.log("Canvas - mouseup-zoom"),e.drawingNewLinkData&&e.completeNewLink(t),e.draggingLinkData&&e.completeDraggedLink(t)})).on("click.zoom",(function(t){e.logger.log("Canvas - click-zoom"),e.selecting=!0,e.dispUtils.isDisplayingCurrentPipeline()&&!e.contextMenuClosedOnZoom&&e.canvasController.clearSelections(),e.contextMenuClosedOnZoom=!1,e.selecting=!1,e.canvasController.clickActionHandler({clickType:"contextmenu"===t.type?"SINGLE_CLICK_CONTEXTMENU":"SINGLE_CLICK",objectType:"canvas",selectedObjectIds:e.objectModel.getSelectedObjectIds()})})).on("dblclick.zoom",(function(){e.logger.log("Zoom - double click"),e.canvasController.clickActionHandler({clickType:"DOUBLE_CLICK",objectType:"canvas",selectedObjectIds:e.objectModel.getSelectedObjectIds()})})).on("contextmenu.zoom",(function(t,n){e.logger.log("Zoom - context menu"),e.openContextMenu(t,"canvas")}))}},{key:"resetCanvasCursor",value:function(){var e=".d3-svg-background[data-pipeline-id='"+this.activePipeline.id+"']";this.canvasSVG.select(e).style("cursor",this.getCanvasCursor())}},{key:"getCanvasCursor",value:function(){return this.dispUtils.isDisplayingFullPage()?this.config.enableInteractionType===l.INTERACTION_TRACKPAD||this.activePipeline.isEmptyOrBindingsOnly()?"default":"grab":"pointer"}},{key:"createCanvasGroup",value:function(e,t){return e.append("g").attr("class",t)}},{key:"createCanvasUnderlay",value:function(e,t){return"None"!==this.config.enableCanvasUnderlay&&this.dispUtils.isDisplayingPrimaryFlowFullPage()?e.append("rect").attr("class",t):null}},{key:"createBoundingRectanglesGrp",value:function(e,t){return this.config.enableBoundingRectangles?e.append("g").attr("class",t):null}},{key:"setCanvasUnderlaySize",value:function(){var e=this.getCanvasDimensionsAdjustedForScale(1,this.getZoomToFitPadding());e&&this.canvasUnderlay.attr("x",e.left-50).attr("y",e.top-50).attr("width",e.width+100).attr("height",e.height+100)}},{key:"addBackToParentFlowArrow",value:function(e){var t=this,n=e.append("g").attr("transform","translate(15, 15)").on("mouseenter",(function(e,t){gr.select(this).select("rect").attr("data-pointer-hover","yes")})).on("mouseleave",(function(e,t){gr.select(this).select("rect").attr("data-pointer-hover","no")})).on("mousedown mouseup",(function(e){f.CanvasUtils.stopPropagationAndPreventDefault(e)})).on("click",(function(e){f.CanvasUtils.stopPropagationAndPreventDefault(e),t.canvasController.displayPreviousPipeline()}));n.append("rect").attr("x",0).attr("y",0).attr("width",210).attr("height",40).attr("class","d3-back-to-previous-flow-box"),n.append("svg").attr("x",16).attr("y",11).attr("width",16).attr("height",16).html(l.LEFT_ARROW_ICON).attr("class","d3-back-to-previous-flow-text"),n.append("text").attr("x",40).attr("y",24).attr("class","d3-back-to-previous-flow-text").text("Return to previous flow")}},{key:"createDropShadow",value:function(e){var t=e.append("filter").attr("id",this.getId("node_drop_shadow")).attr("x","-20%").attr("y","-20%").attr("width","200%").attr("height","200%");t.append("feOffset").attr("in","SourceAlpha").attr("dx",1).attr("dy",1).attr("result","offOut"),t.append("feGaussianBlur").attr("in","offOut").attr("stdDeviation","3").attr("result","blurOut"),t.append("feBlend").attr("in","SourceGraphic").attr("in2","blurOut").attr("mode","normal"),t.append("feComponentTransfer").append("feFuncA").attr("type","linear").attr("slope","0.2");var n=t.append("feMerge");n.append("feMergeNode"),n.append("feMergeNode").attr("in","SourceGraphic")}},{key:"restoreZoom",value:function(){var e=this.canvasController.getSavedZoom(this.pipelineId);if(!e&&this.config.enablePanIntoViewOnOpen){var t=this.getCanvasDimensionsAdjustedForScale(1,this.getZoomToFitPadding());t&&(e={x:-t.left,y:-t.top,k:1})}!e&&this.canvasLayout.initialPanX&&this.canvasLayout.initialPanY&&(e={x:this.canvasLayout.initialPanX,y:this.canvasLayout.initialPanY,k:1}),!e||e.k===this.zoomTransform.k&&e.x===this.zoomTransform.x&&e.y===this.zoomTransform.y||this.zoomCanvasInvokeZoomBehavior(e)}},{key:"zoomCanvasInvokeZoomBehavior",value:function(e,t){if(isFinite(e.x)&&isFinite(e.y)&&isFinite(e.k)){var n=gr.zoomIdentity.translate(e.x,e.y).scale(e.k);t?this.canvasSVG.call(this.zoom).transition().duration(t).call(this.zoom.transform,n):this.canvasSVG.call(this.zoom.transform,n)}}},{key:"zoomToFit",value:function(){var e=this.getZoomToFitPadding(),t=this.getCanvasDimensionsAdjustedForScale(1,e),n=this.getViewportDimensions();if(t){var i=n.width/t.width,o=n.height/t.height,a=Math.min(i,o,1),r=(n.width-t.width*a)/2,s=(n.height-t.height*a)/2;r-=a*t.left,s-=a*t.top,this.zoomingToFit=!0,this.zoomCanvasInvokeZoomBehavior({x:r,y:s,k:a}),this.zoomingToFit=!1}}},{key:"getZoomToFitPadding",value:function(){var e=this.canvasLayout.zoomToFitPadding;if(this.dispUtils.isDisplayingSubFlow()){var t=this.getMaxZoomToFitPaddingForConnections()+2*this.canvasLayout.supernodeBindingPortRadius;e=Math.max(e,t)}return e}},{key:"zoomTo",value:function(e){this.zoomCanvasInvokeZoomBehavior(e,500)}},{key:"getZoom",value:function(){return{x:this.zoomTransform.x,y:this.zoomTransform.y,k:this.zoomTransform.k}}},{key:"translateBy",value:function(e,t,n){var i=this.getZoomTransform(),o=gr.zoomIdentity.translate(i.x+e,i.y+t).scale(i.k);this.zoomCanvasInvokeZoomBehavior(o,n)}},{key:"zoomIn",value:function(){if(this.zoomTransform.k<this.maxScaleExtent){var e=Math.min(1.1*this.zoomTransform.k,this.maxScaleExtent);this.canvasSVG.call(this.zoom.scaleTo,e)}}},{key:"zoomOut",value:function(){if(this.zoomTransform.k>this.minScaleExtent){var e=Math.max(this.zoomTransform.k/1.1,this.minScaleExtent);this.canvasSVG.call(this.zoom.scaleTo,e)}}},{key:"isZoomedToMax",value:function(){return!!this.zoomTransform&&this.zoomTransform.k===this.maxScaleExtent}},{key:"isZoomedToMin",value:function(){return!!this.zoomTransform&&this.zoomTransform.k===this.minScaleExtent}},{key:"getZoomToReveal",value:function(e,t,n){var i,o,a=this.getTransformedViewportDimensions(),r=this.activePipeline.getNodes(e),s=f.CanvasUtils.getCanvasDimensions(r,[],[],0),l=this.convertCanvasDimensionsAdjustedForScaleWithPadding(s,1,10),c=parseInt(t,10),u=void 0===n?c:parseInt(n,10);if(l&&(Number.isNaN(c)||Number.isNaN(u)?(l.right>a.x+a.width&&(i=a.x+a.width-l.right),l.left<a.x&&(i=a.x-l.left),l.bottom>a.y+a.height&&(o=a.y+a.height-l.bottom),l.top<a.y&&(o=a.y-l.top)):(i=a.x+a.width*(c/100)-(l.left+l.width/2),o=a.y+a.height*(u/100)-(l.top+l.height/2)),void 0!==i||void 0!==o))return{x:this.zoomTransform.x+(i||0)*this.zoomTransform.k||0,y:this.zoomTransform.y+(o||0)*this.zoomTransform.k||0,k:this.zoomTransform.k};return null}},{key:"getTransformedViewportDimensions",value:function(){var e=this.getViewportDimensions();return this.getTransformedRect(e,0)}},{key:"getViewportDimensions",value:function(){var e={};if(this.dispUtils.isDisplayingSubFlowInPlace()){var t=this.getParentSupernodeSVGDimensions();e.width=t.width,e.height=t.height}else e=this.canvasSVG&&this.canvasSVG.node()?this.canvasSVG.node().getBoundingClientRect():{x:0,y:0,width:1100,height:640};return e}},{key:"zoomStart",value:function(e){if(this.logger.log("zoomStart - "+JSON.stringify(e.transform)),this.canvasController.closeTip(),this.canvasController.isContextMenuDisplayed()&&!this.dispUtils.isDisplayingSubFlowInPlace()&&(this.canvasController.closeContextMenu(),this.contextMenuClosedOnZoom=!0),this.zoomingToFit?this.regionSelect=!1:this.config.enableInteractionType===l.INTERACTION_TRACKPAD&&e.sourceEvent&&1===e.sourceEvent.buttons||this.config.enableInteractionType===l.INTERACTION_MOUSE&&e.sourceEvent&&e.sourceEvent.shiftKey?this.regionSelect=!0:this.regionSelect=!1,this.regionSelect){this.regionStartTransformX=e.transform.x,this.regionStartTransformY=e.transform.y;var t=this.getTransformedMousePos(e);this.region={startX:t.x,startY:t.y,width:0,height:0}}var n=".d3-svg-background[data-pipeline-id='"+this.activePipeline.id+"']";this.regionSelect?this.canvasSVG.select(n).style("cursor","crosshair"):this.canvasSVG.select(n).style("cursor","grabbing"),this.zoomStartPoint={x:e.transform.x,y:e.transform.y,k:e.transform.k},this.previousD3Event={x:e.transform.x,y:e.transform.y,k:e.transform.k},this.zoomCanvasDimensions=f.CanvasUtils.getCanvasDimensions(this.activePipeline.nodes,this.activePipeline.comments,this.activePipeline.links,this.canvasLayout.commentHighlightGap)}},{key:"zoomAction",value:function(e){this.logger.log("zoomAction - "+JSON.stringify(e.transform)),e.transform.k===this.zoomStartPoint.k?this.regionSelect?(this.addTempCursorOverlay("crosshair"),this.drawRegionSelector(e)):(this.addTempCursorOverlay("grabbing"),this.zoomCanvasBackground(e)):(this.zoomCanvasBackground(e),this.zoomCommentToolbar())}},{key:"zoomEnd",value:function(e){if(this.logger.log("zoomEnd - "+JSON.stringify(e.transform)),this.drawingNewLinkData&&(this.stopDrawingNewLink(),this.drawingNewLinkData=null),this.draggingLinkData&&(this.stopDraggingLink(),this.draggingLinkData=null),e.transform.k===this.zoomStartPoint.k&&!0===this.regionSelect){this.removeRegionSelector(),e.transform.x=this.regionStartTransformX,e.transform.y=this.regionStartTransformY;var t=this.getRegionDimensions(),n=t.startX,i=t.startY,o=t.width,a=t.height;this.isSelecting=!0,this.buildLinksArray();var r={x1:n,y1:i,x2:n+o,y2:i+a},s=f.CanvasUtils.selectInRegion(r,this.activePipeline,this.config.enableLinkSelection!==l.LINK_SELECTION_NONE,this.config.enableLinkType,this.config.enableAssocLinkType);this.canvasController.setSelections(s,this.activePipeline.id),this.regionSelect=!1}else if(this.dispUtils.isDisplayingFullPage()&&this.zoomChanged()){this.canvasSVG.property("__zoom",this.zoomTransform);var c={editType:"setZoom",editSource:"canvas",zoom:this.zoomTransform,pipelineId:this.activePipeline.id};this.canvasController.editActionHandler(c)}this.resetCanvasCursor(),this.removeTempCursorOverlay()}},{key:"zoomChanged",value:function(){return this.zoomTransform.k!==this.zoomStartPoint.k||this.zoomTransform.x!==this.zoomStartPoint.x||this.zoomTransform.y!==this.zoomStartPoint.y}},{key:"zoomCanvasBackground",value:function(e){if(this.regionSelect=!1,this.dispUtils.isDisplayingPrimaryFlowFullPage()){var t=this.getTransformIncrement(e);this.zoomTransform=this.zoomConstrainRegular(t,this.getViewportDimensions(),this.zoomCanvasDimensions)}else this.zoomTransform=gr.zoomIdentity.translate(e.transform.x,e.transform.y).scale(e.transform.k);this.canvasGrp.attr("transform",this.zoomTransform),this.config.enableBoundingRectangles&&this.displayBoundingRectangles(),"None"!==this.config.enableCanvasUnderlay&&this.dispUtils.isDisplayingPrimaryFlowFullPage()&&this.setCanvasUnderlaySize(),this.dispUtils.isDisplayingSubFlowFullPage()&&this.displayPortsForSubFlowFullPage()}},{key:"zoomCommentToolbar",value:function(){if(this.config.enableMarkdownInComments&&this.dispUtils.isDisplayingFullPage()&&this.svgCanvasTextArea.isEditingText()){var e=this.activePipeline.getComment(this.svgCanvasTextArea.getEditingTextId());if(e){var t=this.getCommentToolbarPos(e);this.canvasController.moveTextToolbar(t.x,t.y)}}}},{key:"getCommentToolbarPos",value:function(e){var t=this.unTransformPos({x:e.x_pos,y:e.y_pos});return{x:t.x+this.canvasLayout.commentToolbarPosX,y:t.y+this.canvasLayout.commentToolbarPosY}}},{key:"getTransformIncrement",value:function(e){var t=e.transform.x-this.previousD3Event.x,n=e.transform.y-this.previousD3Event.y,i={x:this.zoomTransform.x+t,y:this.zoomTransform.y+n,k:e.transform.k};return this.previousD3Event={x:e.transform.x,y:e.transform.y,k:e.transform.k},i}},{key:"zoomConstrainRegular",value:function(e,t,n){if(!n)return this.zoomTransform;var i=e.k,o=e.x,a=e.y,r=this.convertCanvasDimensionsAdjustedForScaleWithPadding(n,i,this.getZoomToFitPadding()),s=t.width-Math.min(.25*t.width,.25*r.width),l=-Math.max(r.width-.25*t.width,.75*r.width),c=t.height-Math.min(.25*t.height,.25*r.height),u=-Math.max(r.height-.25*t.height,.75*r.height);return o>-r.left+s?o=-r.left+s:o<-r.left+l&&(o=-r.left+l),a>-r.top+c?a=-r.top+c:a<-r.top+u&&(a=-r.top+u),gr.zoomIdentity.translate(o,a).scale(i)}},{key:"getCanvasDimensionsAdjustedForScale",value:function(e,t){var n=this.canvasLayout.commentHighlightGap,i=this.activePipeline.getCanvasDimensions(n);return this.convertCanvasDimensionsAdjustedForScaleWithPadding(i,e,t)}},{key:"convertCanvasDimensionsAdjustedForScaleWithPadding",value:function(e,t,n){var i=n||0;return e?{left:e.left*t-i,top:e.top*t-i,right:e.right*t+i,bottom:e.bottom*t+i,width:e.width*t+2*i,height:e.height*t+2*i}:null}},{key:"drawRegionSelector",value:function(e){var t=this.getTransformedMousePos(e);this.region.width=t.x-this.region.startX,this.region.height=t.y-this.region.startY,this.removeRegionSelector();var n=this.getRegionDimensions(),i=n.startX,o=n.startY,a=n.width,r=n.height;this.canvasGrp.append("rect").attr("width",a).attr("height",r).attr("x",i).attr("y",o).attr("class","d3-region-selector")}},{key:"removeRegionSelector",value:function(){this.canvasGrp.selectAll(".d3-region-selector").remove()}},{key:"getRegionDimensions",value:function(){var e=this.region.startX,t=this.region.startY,n=this.region.width,i=this.region.height;return n<0&&(n=Math.abs(n),e=this.region.startX-n),i<0&&(i=Math.abs(i),t=this.region.startY-i),{startX:e,startY:t,width:n,height:i}}},{key:"initializeResizeVariables",value:function(e){this.resizeObjInitialInfo={x_pos:e.x_pos,y_pos:e.y_pos,width:e.width,height:e.height},this.notSnappedXPos=e.x_pos,this.notSnappedYPos=e.y_pos,this.notSnappedWidth=e.width,this.notSnappedHeight=e.height}},{key:"getDragObjects",value:function(e){var t=this.getSelectedNodesAndComments();return this.config.enableDragWithoutSelect&&-1===t.findIndex((function(t){return t.id===e.id}))?[e]:t}},{key:"dragStart",value:function(e,t){if(this.logger.logStartTimer("dragStart"),this.closeContextMenuIfOpen(),this.commentSizing){var n=this.activePipeline.getComment(t.id);this.initializeResizeVariables(n)}else if(this.nodeSizing){var i=this.activePipeline.getNode(t.id);this.initializeResizeVariables(i)}else this.dragObjectsStart(e,t);this.logger.logEndTimer("dragStart",!0)}},{key:"dragMove",value:function(e,t){this.logger.logStartTimer("dragMove"),this.commentSizing?this.resizeComment(e,t):this.nodeSizing?this.resizeNode(e,t):this.dragObjectsAction(e),this.logger.logEndTimer("dragMove",!0)}},{key:"dragEnd",value:function(e,t){this.logger.logStartTimer("dragEnd"),this.removeTempCursorOverlay(),this.commentSizing?this.endCommentSizing(t):this.nodeSizing?this.endNodeSizing(t):this.dragging&&this.dragObjectsEnd(e,t),this.logger.logEndTimer("dragEnd",!0)}},{key:"dragObjectsStart",value:function(e,t){if(this.existingNodeInsertableIntoLink=!1,this.existingNodeAttachableToDetachedLinks=!1,this.dragging=!0,this.dragOffsetX=0,this.dragOffsetY=0,this.dragRunningX=0,this.dragRunningY=0,this.dragObjects=this.getDragObjects(t),this.dragObjects&&this.dragObjects.length>0&&(this.dragStartX=this.dragObjects[0].x_pos,this.dragStartY=this.dragObjects[0].y_pos),this.isExistingNodeInsertableIntoLink()&&(this.existingNodeInsertableIntoLink=!0,this.setNodeTranslucentState(this.dragObjects[0].id,!0),this.setDataLinkSelectionAreaWider(!0)),this.isExistingNodeAttachableToDetachedLinks()){this.existingNodeAttachableToDetachedLinks=!0;var n=this.getTransformedMousePos(e);this.dragPointerOffsetInNode={x:n.x-this.dragObjects[0].x_pos,y:n.y-this.dragObjects[0].y_pos},this.setNodeTranslucentState(this.dragObjects[0].id,!0)}}},{key:"dragObjectsAction",value:function(e){if(this.dragOffsetX+=e.dx,this.dragOffsetY+=e.dy,this.dispUtils.isDisplayingSubFlowInPlace()&&(this.dragOffsetX>1e3||this.dragOffsetX<-1e3||this.dragOffsetY>1e3||this.dragOffsetY<-1e3))this.dragOffsetX-=e.dx,this.dragOffsetY-=e.dy;else{var t={x:0,y:0};if(this.config.enableSnapToGridType===l.SNAP_TO_GRID_DURING){var n=this.snapToGridDraggedNode();t={x:n.x-this.dragObjects[0].x_pos,y:n.y-this.dragObjects[0].y_pos}}else t={x:e.dx,y:e.dy};this.dragRunningX+=t.x,this.dragRunningY+=t.y,this.dragObjects.forEach((function(e){e.x_pos+=t.x,e.y_pos+=t.y})),this.config.enableLinkSelection===l.LINK_SELECTION_DETACHABLE&&this.getSelectedLinks().forEach((function(e){e.srcPos&&(e.srcPos.x_pos+=t.x,e.srcPos.y_pos+=t.y),e.trgPos&&(e.trgPos.x_pos+=t.x,e.trgPos.y_pos+=t.y)}))}if(this.displayCanvas(),this.existingNodeInsertableIntoLink){var i=this.getLinkAtMousePos(e.sourceEvent.clientX,e.sourceEvent.clientY);(!i||this.isLinkFullyAttached(i)&&this.dragObjects[0].id!==i.srcNodeId&&this.dragObjects[0].id!==i.trgNodeId)&&this.setInsertNodeIntoLinkHighlighting(i)}if(this.existingNodeAttachableToDetachedLinks){var o=this.getTransformedMousePos(e),a=this.dragObjects[0],r={x1:o.x-this.dragPointerOffsetInNode.x,y1:o.y-this.dragPointerOffsetInNode.y,x2:o.x-this.dragPointerOffsetInNode.x+a.width,y2:o.y-this.dragPointerOffsetInNode.y+a.height},s=this.getAttachableLinksForNodeAtPos(a,r);this.setDetachedLinkHighlighting(s)}}},{key:"dragObjectsEnd",value:function(e,t){if(this.dragging=!1,0===this.dragOffsetX&&0===this.dragOffsetY&&this.config.enableDragWithoutSelect)this.selectObjectSourceEvent(e,t);else if(0!==this.dragRunningX||0!==this.dragRunningY){var n=null;if(this.config.enableSnapToGridType===l.SNAP_TO_GRID_AFTER){var i=this.snapToGridDraggedNode();n={x:i.x-this.dragStartX,y:i.y-this.dragStartY}}else n={x:this.dragRunningX,y:this.dragRunningY};this.existingNodeInsertableIntoLink&&this.dragOverLink?this.canvasController.editActionHandler({editType:"insertNodeIntoLink",editSource:"canvas",node:this.dragObjects[0],link:this.dragOverLink,offsetX:n.x,offsetY:n.y,pipelineId:this.activePipeline.id}):this.existingNodeAttachableToDetachedLinks&&this.dragOverDetachedLinks.length>0?this.canvasController.editActionHandler({editType:"attachNodeToLinks",editSource:"canvas",node:this.dragObjects[0],detachedLinks:this.dragOverDetachedLinks,offsetX:n.x,offsetY:n.y,pipelineId:this.activePipeline.id}):this.canvasController.editActionHandler({editType:"moveObjects",editSource:"canvas",nodes:this.dragObjects.map((function(e){return e.id})),links:this.getSelectedLinks().filter((function(e){return e.srcPos||e.trgPos})),offsetX:n.x,offsetY:n.y,pipelineId:this.activePipeline.id})}this.setDataLinkSelectionAreaWider(!1),this.unsetNodeTranslucentState(),this.unsetInsertNodeIntoLinkHighlighting(),this.unsetDetachedLinkHighlighting()}},{key:"dragStartLinkHandle",value:function(e,t){this.logger.logStartTimer("dragStartLinkHandle"),this.closeContextMenuIfOpen(),this.draggingLinkHandle=!0;var n=gr.select(e.sourceEvent.currentTarget),i=this.activePipeline.getLink(t.id),o=m.cloneDeep_1(i),a=this.getLinkGroupSelectionById(t.id);if(this.draggingLinkData={lineInfo:t,link:i,oldLink:o,linkGrpSelection:gr.select(a)},n.attr("class").includes("d3-link-handle-end")?this.draggingLinkData.endBeingDragged="end":n.attr("class").includes("d3-link-handle-start")&&(this.draggingLinkData.endBeingDragged="start"),this.config.enableHighlightUnavailableNodes)if("end"===this.draggingLinkData.endBeingDragged){var r=this.activePipeline.links.filter((function(e){return e.id!==i.id}));this.setUnavailableTargetNodesHighlighting(this.activePipeline.getNode(this.draggingLinkData.link.srcNodeId),this.draggingLinkData.link.srcNodePortId,r)}else if("start"===this.draggingLinkData.endBeingDragged){var s=this.activePipeline.links.filter((function(e){return e.id!==i.id}));this.setUnavailableSourceNodesHighlighting(this.activePipeline.getNode(this.draggingLinkData.oldLink.trgNodeId),this.draggingLinkData.link.trgNodePortId,s)}this.dragLinkHandle(e),this.logger.logEndTimer("dragStartLinkHandle",!0)}},{key:"dragMoveLinkHandle",value:function(e){this.logger.logStartTimer("dragMoveLinkHandle"),this.dragLinkHandle(e),this.logger.logEndTimer("dragMoveLinkHandle",!0)}},{key:"dragEndLinkHandle",value:function(e){this.logger.logStartTimer("dragEndLinkHandle"),this.completeDraggedLink(e),this.draggingLinkHandle=!1,this.logger.logEndTimer("dragEndLinkHandle",!0)}},{key:"setNodeTranslucentState",value:function(e,t){this.getNodeGroupSelectionById(e).classed("d3-node-group-translucent",t)}},{key:"unsetNodeTranslucentState",value:function(){this.dragObjects&&this.dragObjects.length>0&&this.setNodeTranslucentState(this.dragObjects[0].id,!1)}},{key:"snapToGridDraggedNode",value:function(){var e=this.dragStartX+this.dragOffsetX,t=this.dragStartY+this.dragOffsetY;return this.snapToGridPosition({x:e,y:t})}},{key:"snapToGridPosition",value:function(e){return{x:f.CanvasUtils.snapToGrid(e.x,this.canvasLayout.snapToGridXPx),y:f.CanvasUtils.snapToGrid(e.y,this.canvasLayout.snapToGridYPx)}}},{key:"displayNodes",value:function(){this.logger.logStartTimer("displayNodes "+this.getFlags()),this.setPortPositionsAllNodes(),this.commentSizing||(this.dragging&&!this.nodeSizing&&!this.commentSizing||this.movingBindingNodes?this.displayMovedNodes():this.selecting||this.regionSelect?this.displayNodesSelectionStatus():this.displayAllNodes()),this.logger.logEndTimer("displayNodes "+this.getFlags())}},{key:"displayMovedNodes",value:function(){var e=this,t=this.getAllNodeGroupsSelection();t.datum((function(t){return e.activePipeline.getNode(t.id)})).attr("transform",(function(e){return"translate(".concat(e.x_pos,", ").concat(e.y_pos,")")})),this.dispUtils.isDisplayingSubFlow()&&t.each((function(t,n,i){t.isSupernodeInputBinding&&e.updatePortRadiusAndPos(i[n],t,"d3-node-port-output-main"),t.isSupernodeOutputBinding&&(e.updatePortRadiusAndPos(i[n],t,"d3-node-port-input-main"),e.updatePortArrowPath(i[n],"d3-node-port-input-arrow"))}))}},{key:"displayNodesSelectionStatus",value:function(e){var t=this;this.getAllNodeGroupsSelection().selectChildren(".d3-node-selection-highlight").attr("data-selected",(function(e){return t.objectModel.isSelected(e.id,t.activePipeline.id)?"yes":"no"})),this.superRenderers.forEach((function(e){e.selecting=!0,e.displayNodes(),e.selecting=!1}))}},{key:"displayAllNodes",value:function(){var e=this;this.getAllNodeGroupsSelection().data(this.activePipeline.nodes,(function(e){return e.id})).join((function(t){return e.createNodes(t)})).attr("transform",(function(e){return"translate(".concat(e.x_pos,", ").concat(e.y_pos,")")})).attr("class",(function(t){return e.getNodeGroupClass(t)})).attr("style",(function(t){return e.getNodeGrpStyle(t)})).call((function(t){return e.updateNodes(t)}))}},{key:"createNodes",value:function(e){var t=this;this.logger.logStartTimer("createNodes");var n=e.append("g").attr("data-id",(function(e){return t.getId("node_grp",e.id)})).call(this.attachNodeGroupListeners.bind(this));return this.config.enableEditingActions&&n.call(this.drag),n.filter((function(e){return t.shouldDisplayNodeSizingArea(e)})).append("path").attr("class","d3-node-sizing").call(this.attachNodeSizingListeners.bind(this)),n.filter((function(e){return!f.CanvasUtils.isSuperBindingNode(e)})).append("path").attr("class","d3-node-selection-highlight"),n.filter((function(e){return!f.CanvasUtils.isSuperBindingNode(e)})).append("path").attr("class","d3-node-body-outline"),n.filter((function(e){return!f.CanvasUtils.isSuperBindingNode(e)&&e.layout.imageDisplay})).each((function(e,n,i){var o=t.getNodeImage(e),a=t.getImageType(o);gr.select(i[n]).append(a).attr("class",(function(e){return t.nodeUtils.getNodeImageClass(e)}))})),n.filter((function(e){return!f.CanvasUtils.isSuperBindingNode(e)})).append("foreignObject").attr("class","d3-foreign-object-node-label").call(this.attachNodeLabelListeners.bind(this)).append("xhtml:div").append("xhtml:span").call(this.attachNodeLabelSpanListeners.bind(this)),this.logger.logEndTimer("createNodes"),n}},{key:"updateNodes",value:function(e){var t=this;this.logger.logStartTimer("updateNodes"),e.selectChildren(".d3-node-sizing").datum((function(e){return t.activePipeline.getNode(e.id)})).attr("d",(function(e){return t.getNodeShapePathSizing(e)})),e.selectChildren(".d3-node-selection-highlight").datum((function(e){return t.activePipeline.getNode(e.id)})).attr("d",(function(e){return t.getNodeSelectionOutline(e)})).attr("data-selected",(function(e){return t.objectModel.isSelected(e.id,t.activePipeline.id)?"yes":"no"})).attr("style",(function(e){return t.getNodeSelectionOutlineStyle(e,"default")})),e.selectChildren(".d3-node-body-outline").datum((function(e){return t.activePipeline.getNode(e.id)})).attr("d",(function(e){return t.getNodeShapePath(e)})).attr("style",(function(e){return t.getNodeBodyStyle(e,"default")})),e.selectChildren(".d3-node-image").datum((function(e){return t.activePipeline.getNode(e.id)})).each((function(e,n,i){return t.setNodeImageContent(i[n],e)})).attr("x",(function(e){return t.nodeUtils.getNodeImagePosX(e)})).attr("y",(function(e){return t.nodeUtils.getNodeImagePosY(e)})).attr("width",(function(e){return t.nodeUtils.getNodeImageWidth(e)})).attr("height",(function(e){return t.nodeUtils.getNodeImageHeight(e)})).attr("style",(function(e){return t.getNodeImageStyle(e,"default")})),e.selectChildren(".d3-foreign-object-node-label").datum((function(e){return t.activePipeline.getNode(e.id)})).attr("x",(function(e){return t.nodeUtils.getNodeLabelPosX(e)})).attr("y",(function(e){return t.nodeUtils.getNodeLabelPosY(e)})).attr("width",(function(e){return t.nodeUtils.getNodeLabelWidth(e)})).attr("height",(function(e){return t.nodeUtils.getNodeLabelHeight(e)})).select("div").attr("class",(function(e){return t.nodeUtils.getNodeLabelClass(e)})).attr("style",(function(e){return t.getNodeLabelStyle(e,"default")})).select("span").html((function(e){return _n(e.label)})),e.selectChildren(".d3-node-ellipsis-group").attr("transform",(function(e){return t.nodeUtils.getNodeEllipsisTranslate(e)})),e.selectChildren(".d3-node-super-expand-icon-group").attr("transform",(function(e){return t.nodeUtils.getNodeExpansionIconTranslate(e)})),e.each((function(e,n,i){var o=gr.select(i[n]);if(t.displayPorts(o,e),f.CanvasUtils.isSupernode(e)&&t.displaySupernodeContents(e,gr.select(i[n])),!f.CanvasUtils.isSuperBindingNode(e)){t.addErrorMarker(e,o);var a=f.CanvasUtils.getCombinedDecorations(e.layout.decorations,e.decorations);t.displayDecorations(e,l.DEC_NODE,o,a)}})),this.logger.logEndTimer("updateNodes")}},{key:"displaySupernodeContents",value:function(e,t){var n=this.getRendererForSupernode(e);f.CanvasUtils.isExpanded(e)?n?n.setCanvasInfoRenderer(this.canvasInfo):(n=this.createSupernodeRenderer(e,t),this.superRenderers.push(n)):n&&n.hideCanvas(e)}},{key:"displayPorts",value:function(e,t){t.layout.inputPortDisplay&&Array.isArray(t.inputs)&&this.displayInputPorts(e,t),t.layout.outputPortDisplay&&Array.isArray(t.outputs)&&this.displayOutputPorts(e,t)}},{key:"displayInputPorts",value:function(e,t){var n=this,i="."+this.getNodeInputPortClassName();e.selectChildren(i).data(t.inputs,(function(e){return e.id})).join((function(e){return n.createInputPorts(e,t)})).attr("connected",(function(e){return e.isConnected?"yes":"no"})).attr("class",(function(e){return n.getNodeInputPortClassName()+(e.class_name?" "+e.class_name:"")})).call((function(e){return n.updateInputPorts(e,t)}))}},{key:"createInputPorts",value:function(e,t){var n=e.append("g").attr("data-port-id",(function(e){return e.id})).attr("isSupernodeBinding",f.CanvasUtils.isSuperBindingNode(t)?"yes":"no").call(this.attachInputPortListeners.bind(this),t);return n.append(t.layout.inputPortObject).attr("class","d3-node-port-input-main"),this.config.enableAssocLinkCreation||"circle"!==t.layout.inputPortObject||f.CanvasUtils.isSuperBindingNode(t)||n.append("path").attr("class","d3-node-port-input-arrow"),n}},{key:"updateInputPorts",value:function(e,t){var n=this;e.selectChildren(".d3-node-port-input-main").datum((function(e){return t.inputs.find((function(t){return e.id===t.id}))})).each((function(e,i,o){var a=gr.select(o[i]);t.layout.inputPortObject===l.PORT_OBJECT_IMAGE?a.attr("xlink:href",t.layout.inputPortImage).attr("x",e.cx-t.layout.inputPortWidth/2).attr("y",e.cy-t.layout.inputPortHeight/2).attr("width",t.layout.inputPortWidth).attr("height",t.layout.inputPortHeight):a.attr("r",n.getPortRadius(t)).attr("cx",e.cx).attr("cy",e.cy)})),e.selectChildren(".d3-node-port-input-arrow").datum((function(e){return t.inputs.find((function(t){return e.id===t.id}))})).each((function(e,i,o){var a=gr.select(o[i]);t.layout.inputPortObject!==l.PORT_OBJECT_IMAGE&&a.attr("d",n.getPortArrowPath(e)).attr("transform",n.getPortArrowPathTransform(e))}))}},{key:"displayOutputPorts",value:function(e,t){var n=this,i="."+this.getNodeOutputPortClassName(),o=this.config.enableSingleOutputPortDisplay&&t.outputs.length>1?[t.outputs[t.outputs.length-1]]:t.outputs;e.selectChildren(i).data(o,(function(e){return e.id})).join((function(e){return n.createOutputPorts(e,t)})).attr("connected",(function(e){return e.isConnected?"yes":"no"})).attr("class",(function(e){return n.getNodeOutputPortClassName()+(e.class_name?" "+e.class_name:"")})).call((function(e){return n.updateOutputPorts(e,t)}))}},{key:"createOutputPorts",value:function(e,t){var n=e.append("g").attr("data-port-id",(function(e){return e.id})).attr("isSupernodeBinding",f.CanvasUtils.isSuperBindingNode(t)?"yes":"no").call(this.attachOutputPortListeners.bind(this),t);return n.append(t.layout.outputPortObject).attr("class","d3-node-port-output-main"),n}},{key:"updateOutputPorts",value:function(e,t){var n=this;e.selectChildren(".d3-node-port-output-main").datum((function(e){return t.outputs.find((function(t){return e.id===t.id}))})).each((function(e,i,o){var a=gr.select(o[i]);t.layout.outputPortObject===l.PORT_OBJECT_IMAGE?a.attr("xlink:href",t.layout.outputPortImage).attr("x",e.cx-t.layout.outputPortWidth/2).attr("y",e.cy-t.layout.outputPortHeight/2).attr("width",t.layout.outputPortWidth).attr("height",t.layout.outputPortHeight):a.attr("r",n.getPortRadius(t)).attr("cx",e.cx).attr("cy",e.cy)}))}},{key:"attachNodeGroupListeners",value:function(e){var t=this;e.on("mouseenter",(function(e,n){var i=gr.select(e.currentTarget);t.raiseNodeToTop(i),t.setNodeStyles(n,"hover",i),t.addDynamicNodeIcons(n,i),t.canOpenTip(l.TIP_TYPE_NODE)&&(t.canvasController.closeTip(),t.canvasController.openTip({id:t.getId("node_tip",n.id),type:l.TIP_TYPE_NODE,targetObj:e.currentTarget,pipelineId:t.activePipeline.id,node:n}))})).on("mouseleave",(function(e,n){var i=gr.select(e.currentTarget);t.setNodeStyles(n,"default",i),t.removeDynamicNodeIcons(n,i),t.canvasController.closeTip()})).on("mousedown",(function(e,n){t.logger.log("Node Group - mouse down"),t.config.enableDragWithoutSelect||t.selectObjectD3Event(e,n),t.logger.log("Node Group - finished mouse down")})).on("mousemove",(function(e,t){})).on("mouseup",(function(e,n){e.stopPropagation(),t.logger.log("Node Group - mouse up"),t.drawingNewLinkData&&t.completeNewLink(e),t.draggingLinkData&&t.completeDraggedLink(e,n)})).on("click",(function(e,n){t.logger.log("Node Group - click"),e.stopPropagation()})).on("dblclick",(function(e,n){t.logger.log("Node Group - double click"),f.CanvasUtils.stopPropagationAndPreventDefault(e);var i=t.objectModel.getSelectedObjectIds();t.canvasController.clickActionHandler({clickType:"DOUBLE_CLICK",objectType:"node",id:n.id,selectedObjectIds:i,pipelineId:t.activePipeline.id})})).on("contextmenu",(function(e,n){t.logger.log("Node Group - context menu"),f.CanvasUtils.stopPropagationAndPreventDefault(e),f.CanvasUtils.isSuperBindingNode(n)||(t.config.enableDragWithoutSelect&&t.selectObjectD3Event(e,n),t.openContextMenu(e,"node",n))}))}},{key:"attachNodeSizingListeners",value:function(e){var t=this;e.on("mousedown",(function(e,n){t.isNodeResizable(n)&&(t.nodeSizing=!0,t.addTempCursorOverlay(t.nodeSizingCursor))})).on("mousemove mouseenter",(function(e,n){if(t.isNodeResizable(n)&&!t.isRegionSelectOrSizingInProgress()){var i="pointer";t.isPointerCloseToBodyEdge(e,n)||(t.nodeSizingDirection=t.getSizingDirection(e,n,n.layout.nodeCornerResizeArea),t.nodeSizingCursor=t.getCursorBasedOnDirection(t.nodeSizingDirection),i=t.nodeSizingCursor),gr.select(e.currentTarget).style("cursor",i)}})).on("mouseleave",(function(e,t){gr.select(e.currentTarget).style("cursor","pointer")}))}},{key:"attachNodeLabelListeners",value:function(e){var t=this;e.on("mouseenter",(function(e,n){var i=gr.select(e.currentTarget);if(t.config.enableDisplayFullLabelOnHover&&!f.CanvasUtils.isExpandedSupernode(n)){var o=i.selectAll("span");i.attr("x",t.nodeUtils.getNodeLabelHoverPosX(n)).attr("width",t.nodeUtils.getNodeLabelHoverWidth(n)).attr("height",t.nodeUtils.getNodeLabelHoverHeight(n,o.node(),t.zoomTransform.k)),o.classed("d3-label-full",!0)}})).on("mouseleave",(function(e,n){var i=gr.select(e.currentTarget);t.config.enableDisplayFullLabelOnHover&&!f.CanvasUtils.isExpandedSupernode(n)&&(i.attr("x",t.nodeUtils.getNodeLabelPosX(n)).attr("width",t.nodeUtils.getNodeLabelWidth(n)).attr("height",t.nodeUtils.getNodeLabelHeight(n)),i.selectAll("span").classed("d3-label-full",!1))})).on("dblclick",(function(e,n){t.logger.log("Node Label - double click"),n.layout.labelEditable&&t.config.enableEditingActions&&(f.CanvasUtils.stopPropagationAndPreventDefault(e),t.displayNodeLabelTextArea(n,e.currentTarget.parentNode))}))}},{key:"attachNodeLabelSpanListeners",value:function(e){var t=this;e.on("mouseenter",(function(e,n){n.layout.labelEditable&&t.config.enableEditingActions&&t.displayNodeLabelEditIcon(e.currentTarget,n)})).on("mouseleave",(function(e,n){n.layout.labelEditable&&t.config.enableEditingActions&&(t.hideEditIconPending=setTimeout(t.hideEditIcon.bind(t),500,e.currentTarget,n))}))}},{key:"attachInputPortListeners",value:function(e,t){var n=this;e.on("mousedown",(function(e,i){if(n.config.enableAssocLinkCreation&&0===e.button){f.CanvasUtils.stopPropagationAndPreventDefault(e);var o=n.activePipeline.getNode(t.id);n.drawingNewLinkData={srcObjId:t.id,srcPortId:i.id,action:n.config.enableAssocLinkCreation?l.ASSOCIATION_LINK:l.NODE_LINK,srcNode:o,startPos:{x:o.x_pos+i.cx,y:o.y_pos+i.cy},portType:"input",portObject:t.layout.inputPortObject,portImage:t.layout.inputPortImage,portWidth:t.layout.inputPortWidth,portHeight:t.layout.inputPortHeight,portRadius:n.getPortRadius(o),minInitialLine:o.layout.minInitialLine,guideObject:t.layout.inputPortGuideObject,guideImage:t.layout.inputPortGuideImage,linkArray:[]},n.drawNewLink(e)}})).on("mouseenter",(function(e,i){f.CanvasUtils.stopPropagationAndPreventDefault(e),n.canOpenTip(l.TIP_TYPE_PORT)&&(n.canvasController.closeTip(),n.canvasController.openTip({id:n.getId("node_port_tip",i.id),type:l.TIP_TYPE_PORT,targetObj:e.currentTarget,pipelineId:n.activePipeline.id,node:t,port:i}))})).on("mouseleave",(function(){n.canvasController.closeTip()})).on("contextmenu",(function(e,i){n.logger.log("Input Port Circle - context menu"),f.CanvasUtils.stopPropagationAndPreventDefault(e),n.config.enableDragWithoutSelect&&n.selectObjectD3Event(e,t),n.openContextMenu(e,"input_port",t,i)}))}},{key:"attachOutputPortListeners",value:function(e,t){var n=this;e.on("mousedown",(function(e,i){if(0===e.button){f.CanvasUtils.stopPropagationAndPreventDefault(e);var o=n.activePipeline.getNode(t.id);f.CanvasUtils.isSrcCardinalityAtMax(i.id,o,n.activePipeline.links)||(n.drawingNewLinkData={srcObjId:t.id,srcPortId:i.id,action:n.config.enableAssocLinkCreation?l.ASSOCIATION_LINK:l.NODE_LINK,srcNode:o,startPos:{x:o.x_pos+i.cx,y:o.y_pos+i.cy},portType:"output",portObject:t.layout.outputPortObject,portImage:t.layout.outputPortImage,portWidth:t.layout.outputPortWidth,portHeight:t.layout.outputPortHeight,portRadius:n.getPortRadius(o),minInitialLine:o.layout.minInitialLine,guideObject:t.layout.outputPortGuideObject,guideImage:t.layout.outputPortGuideImage,linkArray:[]},n.config.enableHighlightUnavailableNodes&&n.setUnavailableTargetNodesHighlighting(o,i.id,n.activePipeline.links),n.drawNewLink(e))}})).on("mouseenter",(function(e,i){f.CanvasUtils.stopPropagationAndPreventDefault(e),n.canOpenTip(l.TIP_TYPE_PORT)&&(n.canvasController.closeTip(),n.canvasController.openTip({id:n.getId("node_port_tip",i.id),type:l.TIP_TYPE_PORT,targetObj:e.currentTarget,pipelineId:n.activePipeline.id,node:t,port:i}))})).on("mouseleave",(function(){n.canvasController.closeTip()})).on("contextmenu",(function(e,i){n.logger.log("Output Port Circle - context menu"),f.CanvasUtils.stopPropagationAndPreventDefault(e),n.config.enableDragWithoutSelect&&n.selectObjectD3Event(e,t),n.openContextMenu(e,"output_port",t,i)}))}},{key:"setUnavailableTargetNodesHighlighting",value:function(e,t,n){this.getAllNodeGroupsSelection().filter((function(i){return!f.CanvasUtils.isTrgNodeAvailable(i,e,t,n)})).classed("d3-node-unavailable",!0)}},{key:"setUnavailableSourceNodesHighlighting",value:function(e,t,n){this.getAllNodeGroupsSelection().filter((function(i){return!f.CanvasUtils.isSrcNodeAvailable(i,e,t,n)})).classed("d3-node-unavailable",!0)}},{key:"unsetUnavailableNodesHighlighting",value:function(){this.getAllNodeGroupsSelection().classed("d3-node-unavailable",!1)}},{key:"displayNodeLabelEditIcon",value:function(e,t){var n=this,i=e.parentElement.parentElement.parentElement,o=gr.select(i),a=this.nodeUtils.getNodeLabelEditIconTranslate(t,e,this.zoomTransform.k,this.config.enableDisplayFullLabelOnHover);this.displayEditIcon(e,o,a,(function(e,t){return n.displayNodeLabelTextArea(t,e.currentTarget.parentNode)}))}},{key:"displayDecLabelEditIcon",value:function(e,t,n,i){var o=this,a=e.parentElement.parentElement.parentElement,r=gr.select(a),s=this.decUtils.getDecLabelEditIconTranslate(t,n,i,e,this.zoomTransform.k);this.displayEditIcon(e,r,s,(function(e,a){return o.displayDecLabelTextArea(t,n,i,e.currentTarget.parentNode)}))}},{key:"displayEditIcon",value:function(e,t,n,i){var o=this,a=t.append("g").attr("class","d3-label-edit-icon-group").attr("transform",n).on("mouseenter",(function(e,t){o.mouseOverLabelEditIcon=!0})).on("mouseleave",(function(e,t){o.mouseOverLabelEditIcon=!1,o.hideEditIcon(this)})).on("click",(function(e,t){i(e,t),o.mouseOverLabelEditIcon=!1,o.hideEditIcon(this)}));a.append("rect").attr("class","d3-label-edit-icon-background1").attr("width",29).attr("height",24).attr("x",0).attr("y",-4),a.append("rect").attr("class","d3-label-edit-icon-background2").attr("width",24).attr("height",24).attr("x",5).attr("y",-4),a.append("svg").attr("class","d3-node-edit-label-icon").html(l.EDIT_ICON).attr("width",16).attr("height",16).attr("x",9).attr("y",0)}},{key:"hideEditIcon",value:function(e){if(!this.mouseOverLabelEditIcon){var t=e.parentElement.parentElement.parentElement;gr.select(t).selectAll(".d3-label-edit-icon-group").remove()}}},{key:"selectObjectD3Event",value:function(e,t){this.selectObject(t,e.type,e.shiftKey,f.CanvasUtils.isCmndCtrlPressed(e))}},{key:"selectObjectSourceEvent",value:function(e,t){this.selectObject(t,e.type,e.sourceEvent.shiftKey,f.CanvasUtils.isCmndCtrlPressed(e.sourceEvent))}},{key:"selectObject",value:function(e,t,n,i){this.selecting=!0,this.objectModel.isSelected(e.id,this.activePipeline.id)?i&&this.objectModel.toggleSelection(e.id,i,this.activePipeline.id):n?this.objectModel.selectSubGraph(e.id,this.activePipeline.id):this.objectModel.toggleSelection(e.id,i,this.activePipeline.id),this.selecting=!1;var o=this.activePipeline.getObjectTypeName(e);"node"!==o&&"link"!==o||(this.canvasController.clickActionHandler({clickType:"contextmenu"===t||this.ellipsisClicked?"SINGLE_CLICK_CONTEXTMENU":"SINGLE_CLICK",objectType:o,id:e.id,selectedObjectIds:this.objectModel.getSelectedObjectIds(),pipelineId:this.activePipeline.id}),this.ellipsisClicked=!1)}},{key:"displayDecorations",value:function(e,t,n,i){var o=this,a=this,r=i||[],s="d3-".concat(t,"-dec-group"),l="."+s;n.selectChildren(l).data(r,(function(e){return e.id})).join((function(e){return o.createDecorations(e,t,s)})).attr("transform",(function(n){return o.decUtils.getDecTransform(n,e,t)})).on("mousedown",(function(t,n){return n.hotspot?a.callDecoratorCallback(t,e,n):null})).each((function(n,i,a){return o.updateDecoration(n,gr.select(a[i]),t,e)}))}},{key:"createDecorations",value:function(e,t,n){var i=this;return e.append("g").attr("data-id",(function(e){return i.getId("".concat(t,"_dec_group"),e.id)})).attr("class",n).call(this.attachDecGroupListeners.bind(this))}},{key:"updateDecoration",value:function(e,t,n,i){this.updateDecOutlines(e,t,n,i),this.updateDecPaths(e,t,n),this.updateDecImages(e,t,n,i),this.updateDecLabels(e,t,n,i)}},{key:"updateDecOutlines",value:function(e,t,n,i){var o=t.selectChild("rect");e.label||e.path||!1===e.outline?o.remove():(o=o.empty()?t.append("rect"):o).attr("class",this.decUtils.getDecClass(e,"d3-".concat(n,"-dec-outline"))).attr("x",0).attr("y",0).attr("width",this.decUtils.getDecWidth(e,i,n)).attr("height",this.decUtils.getDecHeight(e,i,n)).lower()}},{key:"updateDecPaths",value:function(e,t,n){var i=t.selectChild("path");e.path?(i=i.empty()?t.append("path"):i).attr("class",this.decUtils.getDecClass(e,"d3-".concat(n,"-dec-path"))).attr("x",0).attr("y",0).attr("d",e.path):i.remove()}},{key:"updateDecImages",value:function(e,t,n,i){var o=this,a=t.selectChild("g");if(e.image){var r=this.getImageType(e.image);(a=a.empty()?t.append("g").append(r):a.select(r)).attr("class",this.decUtils.getDecClass(e,"d3-".concat(n,"-dec-image"))).attr("x",this.decUtils.getDecPadding(e,i,n)).attr("y",this.decUtils.getDecPadding(e,i,n)).attr("width",this.decUtils.getDecWidth(e,i,n)-2*this.decUtils.getDecPadding(e,i,n)).attr("height",this.decUtils.getDecHeight(e,i,n)-2*this.decUtils.getDecPadding(e,i,n)).each((function(){return o.setImageContent(a,e.image)}))}else a.remove()}},{key:"updateDecLabels",value:function(e,t,n,i){var o=t.selectChild("foreignObject");e.label?(o.empty()&&(o=t.append("foreignObject").attr("class","d3-foreign-object-dec-label").attr("x",0).attr("y",0).call(this.attachDecLabelListeners.bind(this,i,n))).append("xhtml:div").append("xhtml:span").call(this.attachDecLabelSpanListeners.bind(this,i,n)),o.attr("width",this.decUtils.getDecLabelWidth(e,i,n)).attr("height",this.decUtils.getDecLabelHeight(e,i,n)).select("div").attr("class",this.decUtils.getDecLabelClass(e,n)).select("span").html(_n(e.label))):o.remove()}},{key:"attachDecLabelListeners",value:function(e,t,n){var i=this;n.on("dblclick",(function(n,o){i.logger.log("Decoration Label - double click"),o.label_editable&&i.config.enableEditingActions&&(f.CanvasUtils.stopPropagationAndPreventDefault(n),i.displayDecLabelTextArea(o,e,t,n.currentTarget.parentNode))}))}},{key:"attachDecLabelSpanListeners",value:function(e,t,n){var i=this;n.on("mouseenter",(function(n,o){o.label_editable&&i.config.enableEditingActions&&i.displayDecLabelEditIcon(n.currentTarget,o,e,t)})).on("mouseleave",(function(e,t){t.label_editable&&i.config.enableEditingActions&&(i.hideEditIconPending=setTimeout(i.hideEditIcon.bind(i),500,e.currentTarget,t))}))}},{key:"attachDecGroupListeners",value:function(e){var t=this;e.on("mouseenter",(function(e,n){t.canOpenTip(l.TIP_TYPE_DEC)&&(t.canvasController.closeTip(),t.canvasController.openTip({id:t.getId("dec_tip",n.id),type:l.TIP_TYPE_DEC,targetObj:e.currentTarget,pipelineId:t.activePipeline.id,decoration:n}))})).on("mouseleave",(function(e,n){t.canvasController.closeTip()}))}},{key:"addErrorMarker",value:function(e,t){var n=this,i=t.selectChildren(".node-error-marker");e.messages&&e.messages.length>0?(i.empty()&&t.append("svg").attr("class","node-error-marker"),t.selectChildren(".node-error-marker").attr("class",(function(){return"node-error-marker "+n.nodeUtils.getErrorMarkerClass(e.messages)})).html(this.nodeUtils.getErrorMarkerIcon(e)).attr("width",this.nodeUtils.getNodeErrorWidth(e)).attr("height",this.nodeUtils.getNodeErrorHeight(e)).attr("x",this.nodeUtils.getNodeErrorPosX(e)).attr("y",this.nodeUtils.getNodeErrorPosY(e))):i.empty()||i.remove()}},{key:"getNodeInputPortClassName",value:function(){return this.config.enableAssocLinkCreation?"d3-node-port-input-assoc":"d3-node-port-input"}},{key:"getNodeOutputPortClassName",value:function(){return this.config.enableAssocLinkCreation?"d3-node-port-output-assoc":"d3-node-port-output"}},{key:"setNodeImageContent",value:function(e,t){var n=this.getNodeImage(t),i=gr.select(e);this.setImageContent(i,n)}},{key:"setImageContent",value:function(e,t){if(t!==e.attr("data-image")){var n=this.getImageType(t);e.attr("data-image",t),"svg"===n?(e.selectChild("svg").remove(),gr.svg(t,{cache:"force-cache"}).then((function(t){e.node().append(t.documentElement)}))):e.attr("xlink:href",t)}}},{key:"getNodeImage",value:function(e){if(!e.image)return null;if(e.image===l.USE_DEFAULT_ICON){if(f.CanvasUtils.isSupernode(e))return B}else if(e.image===l.USE_DEFAULT_EXT_ICON&&f.CanvasUtils.isSupernode(e))return F;return e.image}},{key:"getImageType",value:function(e){return e&&e.endsWith(".svg")?"svg":"image"}},{key:"setNodeStyles",value:function(e,t,n){this.setNodeBodyStyles(e,t,n),this.setNodeSelectionOutlineStyles(e,t,n),this.setNodeImageStyles(e,t,n),this.setNodeLabelStyles(e,t,n)}},{key:"setNodeBodyStyles",value:function(e,t,n){var i=this.getNodeBodyStyle(e,t);n.selectChildren(".d3-node-body-outline").attr("style",i)}},{key:"setNodeSelectionOutlineStyles",value:function(e,t,n){var i=this.getNodeSelectionOutlineStyle(e,t);n.selectChildren(".d3-node-selection-highlight").attr("style",i)}},{key:"setNodeImageStyles",value:function(e,t,n){var i=this.getNodeImageStyle(e,t);n.selectChildren(".d3-node-image").attr("style",i)}},{key:"setNodeLabelStyles",value:function(e,t,n){var i=this.getNodeLabelStyle(e,t);n.selectChildren(".d3-node-label").attr("style",i)}},{key:"getNodeBodyStyle",value:function(e,t){var n=f.CanvasUtils.getObjectStyle(e,"body",t);return null===n&&e.layout.dropShadow&&(n="filter:url(".concat(this.getId("#node_drop_shadow"),")")),n}},{key:"getNodeSelectionOutlineStyle",value:function(e,t){return f.CanvasUtils.getObjectStyle(e,"selection_outline",t)}},{key:"getNodeImageStyle",value:function(e,t){return f.CanvasUtils.getObjectStyle(e,"image",t)}},{key:"getNodeLabelStyle",value:function(e,t){return f.CanvasUtils.getObjectStyle(e,"label",t)}},{key:"getNodeGrpStyle",value:function(e){return e.style_temp||e.style||!this.canvasInfo.subdueStyle||this.doesExpandedSupernodeHaveStyledNodes(e)?null:this.canvasInfo.subdueStyle}},{key:"getLinkGrpStyle",value:function(e){return e.style_temp||e.style||!this.canvasInfo.subdueStyle?null:this.canvasInfo.subdueStyle}},{key:"doesExpandedSupernodeHaveStyledNodes",value:function(e){var t=this,n=!1;f.CanvasUtils.isExpandedSupernode(e)&&e.subflow_ref&&e.subflow_ref.pipeline_id_ref&&new pr(e.subflow_ref.pipeline_id_ref,this.canvasInfo).nodes.forEach((function(e){e.style||e.style_temp?n=!0:!n&&f.CanvasUtils.isExpandedSupernode(e)&&(n=t.doesExpandedSupernodeHaveStyledNodes(e))}));return n}},{key:"getMaxZoomToFitPaddingForConnections",value:function(){var e=this.getMaxPaddingForConnectionsFromInputBindingNodes(),t=this.getMaxPaddingForConnectionsToOutputBindingNodes();return Math.max(e,t)}},{key:"getMaxPaddingForConnectionsFromInputBindingNodes",value:function(){var e=this,t=0;return this.activePipeline.nodes.filter((function(e){return e.isSupernodeInputBinding})).forEach((function(n){var i=f.CanvasUtils.getNodePaddingToTargetNodes(n,e.activePipeline.nodes,e.activePipeline.links,e.canvasLayout.linkType);t=Math.max(t,i)})),t}},{key:"getMaxPaddingForConnectionsToOutputBindingNodes",value:function(){var e=this,t=0,n=this.activePipeline.nodes.filter((function(e){return e.isSupernodeOutputBinding}));return this.activePipeline.nodes.forEach((function(i){var o=f.CanvasUtils.getNodePaddingToTargetNodes(i,n,e.activePipeline.links,e.canvasLayout.linkType);t=Math.max(t,o)})),t}},{key:"getPortRadius",value:function(e){return f.CanvasUtils.isSuperBindingNode(e)?this.getBindingPortRadius():e.layout.portRadius}},{key:"getBindingPortRadius",value:function(){return this.canvasLayout.supernodeBindingPortRadius/this.zoomTransform.k}},{key:"addDynamicNodeIcons",value:function(e,t){var n=this;if(!this.nodeSizing&&!f.CanvasUtils.isSuperBindingNode(e)){var i=t.append("g").filter((function(){return e.layout.ellipsisDisplay})).attr("class","d3-node-ellipsis-group").attr("transform",(function(e){return n.nodeUtils.getNodeEllipsisTranslate(e)})).on("mousedown",(function(t){f.CanvasUtils.stopPropagationAndPreventDefault(t),n.ellipsisClicked=!0,n.config.enableDragWithoutSelect||n.selectObjectD3Event(t,e),n.openContextMenu(t,"node",e)}));if(i.append("rect").attr("class","d3-node-ellipsis-background").attr("width",(function(e){return n.nodeUtils.getNodeEllipsisWidth(e)})).attr("height",(function(e){return n.nodeUtils.getNodeEllipsisHeight(e)})).attr("x",0).attr("y",0),i.append("svg").attr("class","d3-node-ellipsis").html(l.NODE_MENU_ICON).attr("width",(function(e){return n.nodeUtils.getNodeEllipsisIconWidth(e)})).attr("height",(function(e){return n.nodeUtils.getNodeEllipsisIconHeight(e)})).attr("x",(function(e){return e.layout.ellipsisHoverAreaPadding})).attr("y",(function(e){return e.layout.ellipsisHoverAreaPadding})),f.CanvasUtils.isExpandedSupernode(e)){var o=t.append("g").attr("transform",(function(e){return n.nodeUtils.getNodeExpansionIconTranslate(e)})).attr("class","d3-node-super-expand-icon-group").on("mousedown",(function(e){f.CanvasUtils.stopPropagationAndPreventDefault(e);var t=n.getSupernodeBreadcrumbs(e.currentTarget);n.canvasController.displaySubPipelineForBreadcrumbs(t)})).on("mouseenter",(function(){gr.select(this).attr("data-pointer-hover","yes")})).on("mouseleave",(function(){gr.select(this).attr("data-pointer-hover","no")}));o.append("rect").attr("class","d3-node-super-expand-icon-background").attr("width",this.canvasLayout.supernodeExpansionIconWidth).attr("height",this.canvasLayout.supernodeExpansionIconHeight).attr("x",0).attr("y",0),o.append("svg").attr("class","d3-node-super-expand-icon").html(l.SUPER_NODE_EXPAND_ICON).attr("width",this.canvasLayout.supernodeExpansionIconWidth-2*this.canvasLayout.supernodeExpansionIconHoverAreaPadding).attr("height",this.canvasLayout.supernodeExpansionIconHeight-2*this.canvasLayout.supernodeExpansionIconHoverAreaPadding).attr("x",this.canvasLayout.supernodeExpansionIconHoverAreaPadding).attr("y",this.canvasLayout.supernodeExpansionIconHoverAreaPadding)}}}},{key:"getSupernodeBreadcrumbs",value:function(e){for(var t=[],n=e.closest(".d3-node-group");n;){var i=n.closest(".svg-area"),o=this.getD3DatumFromDomEl(n),a=i.getAttribute("data-pipeline-id");t.push(this.canvasController.getObjectModel().createBreadcrumb(o,a)),n=i.closest(".d3-node-group")}return t.reverse()}},{key:"getD3DatumFromDomEl",value:function(e){var t=gr.select(e);return t?t.datum():null}},{key:"updatePortRadiusAndPos",value:function(e,t,n){var i=this;gr.select(e).selectAll("."+n).attr("r",(function(){return i.getPortRadius(t)})).attr("cx",(function(e){return e.cx})).attr("cy",(function(e){return e.cy}))}},{key:"updatePortArrowPath",value:function(e,t){var n=this;gr.select(e).selectAll("."+t).attr("d",(function(e){return n.getPortArrowPath(e)})).attr("transform",(function(e){return n.getPortArrowPathTransform(e)}))}},{key:"isPortMaxCardinalityZero",value:function(e){return 0===a.get_1(e,"app_data.ui_data.cardinality.max",1)}},{key:"removeDynamicNodeIcons",value:function(e,t){e.layout.ellipsisDisplay&&t.selectChildren(".d3-node-ellipsis-group").remove(),t.selectChildren(".d3-node-super-expand-icon-group").remove()}},{key:"createSupernodeRenderer",value:function(e,n){return e.subflow_ref&&e.subflow_ref.pipeline_id_ref?new t(e.subflow_ref.pipeline_id_ref,this.canvasDiv,this.canvasController,this.canvasInfo,this.config,{id:e.id,pipelineId:this.activePipeline.id,renderer:this,d3Selection:n}):null}},{key:"getRendererForSupernode",value:function(e){return this.superRenderers.find((function(t){return t.supernodeInfo.id===e.id&&t.activePipeline.id===e.subflow_ref.pipeline_id_ref}))}},{key:"getDiscardedRenderersForSupernode",value:function(e){return this.superRenderers.filter((function(t){return t.supernodeInfo.id===e.id&&t.activePipeline.id!==e.subflow_ref.pipeline_id_ref}))}},{key:"openContextMenu",value:function(e,t,n,i){f.CanvasUtils.stopPropagationAndPreventDefault(e),this.canvasController.contextMenuHandler({type:t,targetObject:"canvas"===t?null:n,id:"canvas"===t?null:n.id,pipelineId:this.activePipeline.id,cmPos:this.getMousePos(e,this.canvasDiv.selectAll("svg")),mousePos:this.getMousePosSnapToGrid(this.getTransformedMousePos(e)),selectedObjectIds:this.objectModel.getSelectedObjectIds(),addBreadcrumbs:n&&n.type===l.SUPER_NODE?this.getSupernodeBreadcrumbs(e.currentTarget):null,port:i,zoom:this.zoomTransform.k})}},{key:"closeContextMenuIfOpen",value:function(){this.canvasController.isContextMenuDisplayed()&&this.canvasController.closeContextMenu()}},{key:"callDecoratorCallback",value:function(e,t,n){e.stopPropagation(),this.canvasController.decorationActionHandler&&this.canvasController.decorationActionHandler(t,n.id,this.activePipeline.id)}},{key:"drawNewLink",value:function(e){if(!1!==this.config.enableEditingActions){this.closeContextMenuIfOpen();var t=this.getTransformedMousePos(e);this.drawingNewLinkData.action===l.COMMENT_LINK?this.drawNewCommentLinkForPorts(t):this.drawNewNodeLinkForPorts(t),this.config.enableHighlightNodeOnNewLinkDrag&&this.setNewLinkOverNode(e)}}},{key:"drawNewNodeLinkForPorts",value:function(e){var t,n=this,i=this,o=this.config.enableAssocLinkCreation?l.ASSOCIATION_LINK:l.NODE_LINK;t=this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT?this.linkUtils.getNewStraightNodeLinkStartPos(this.drawingNewLinkData.srcNode,e):{x:this.drawingNewLinkData.startPos.x,y:this.drawingNewLinkData.startPos.y},this.drawingNewLinkData.linkArray=[{x1:t.x,y1:t.y,x2:e.x,y2:e.y,originX:t.originX,originY:t.originY,type:o}],this.config.enableAssocLinkCreation&&(this.drawingNewLinkData.linkArray[0].assocLinkVariation=this.getNewLinkAssocVariation(this.drawingNewLinkData.linkArray[0].x1,this.drawingNewLinkData.linkArray[0].x2,this.drawingNewLinkData.portType));var a=this.linkUtils.getConnectorPathInfo(this.drawingNewLinkData.linkArray[0],this.drawingNewLinkData.minInitialLine),r=this.nodesLinksGrp.selectAll(".d3-new-connection-line"),s=this.nodesLinksGrp.selectAll(".d3-new-connection-start"),c=this.nodesLinksGrp.selectAll(".d3-new-connection-guide");o===l.NODE_LINK&&this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT&&this.nodeUtils.isPointInNodeBoundary(e,this.drawingNewLinkData.srcNode)?this.removeNewLinkLine():r.data(this.drawingNewLinkData.linkArray).enter().append("path").attr("class","d3-new-connection-line").attr("linkType",o).merge(r).attr("d",a.path).attr("transform",a.transform),this.canvasLayout.linkType!==l.LINK_TYPE_STRAIGHT&&s.data(this.drawingNewLinkData.linkArray).enter().append(this.drawingNewLinkData.portObject).attr("class","d3-new-connection-start").attr("linkType",o).merge(s).each((function(e){i.drawingNewLinkData.portObject===l.PORT_OBJECT_CIRCLE&&gr.select(this).attr("cx",e.x1).attr("cy",e.y1).attr("r",i.drawingNewLinkData.portRadius)})),c.data(this.drawingNewLinkData.linkArray).enter().append(this.drawingNewLinkData.guideObject).attr("class","d3-new-connection-guide").attr("linkType",o).on("mouseup",(function(e){f.CanvasUtils.stopPropagationAndPreventDefault(e),n.completeNewLink(e)})).merge(c).each((function(e){i.drawingNewLinkData.guideObject===l.PORT_OBJECT_IMAGE?gr.select(this).attr("xlink:href",i.drawingNewLinkData.guideImage).attr("x",e.x2-i.drawingNewLinkData.portWidth/2).attr("y",e.y2-i.drawingNewLinkData.portHeight/2).attr("width",i.drawingNewLinkData.portWidth).attr("height",i.drawingNewLinkData.portHeight).attr("transform",i.getLinkImageTransform(e)):gr.select(this).attr("cx",e.x2).attr("cy",e.y2).attr("r",i.drawingNewLinkData.portRadius)}))}},{key:"getLinkImageTransform",value:function(e){var t=0;if(this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT){var n=e.x2-(e.originX||e.x1),i=e.y2-(e.originY||e.y1);return 0===n&&0===i?t=0:(t=Math.atan(i/n)*(180/Math.PI),t=n>=0?t:t+180,this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?t-=90:this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP&&(t+=90)),"rotate(".concat(t,",").concat(e.x2,",").concat(e.y2,")")}return null}},{key:"drawNewCommentLinkForPorts",value:function(e){var t=this,n=this,i=this.activePipeline.getComment(this.drawingNewLinkData.srcObjId),o=this.linkUtils.getNewStraightCommentLinkStartPos(i,e),a=l.COMMENT_LINK;this.drawingNewLinkData.linkArray=[{x1:o.x,y1:o.y,x2:e.x,y2:e.y,type:a}];var r=this.nodesLinksGrp.selectAll(".d3-new-connection-line"),s=this.nodesLinksGrp.selectAll(".d3-new-connection-guide");if(r.data(this.drawingNewLinkData.linkArray).enter().append("path").attr("class","d3-new-connection-line").attr("linkType",a).merge(r).attr("d",(function(e){return n.linkUtils.getConnectorPathInfo(e).path})),s.data(this.drawingNewLinkData.linkArray).enter().append("circle").attr("class","d3-new-connection-guide").attr("linkType",a).on("mouseup",(function(e){f.CanvasUtils.stopPropagationAndPreventDefault(e),t.completeNewLink(e)})).merge(s).attr("cx",(function(e){return e.x2})).attr("cy",(function(e){return e.y2})).attr("r",this.canvasLayout.commentPortRadius),this.canvasLayout.commentLinkArrowHead){var c=this.nodesLinksGrp.selectAll(".d3-new-connection-arrow");c.data(this.drawingNewLinkData.linkArray).enter().append("path").attr("class","d3-new-connection-arrow").attr("linkType",a).on("mouseup",(function(e){f.CanvasUtils.stopPropagationAndPreventDefault(e),t.completeNewLink(e)})).merge(c).attr("d",(function(e){return t.getArrowHead(e)})).attr("transform",(function(e){return t.getArrowHeadTransform(e)}))}}},{key:"completeNewLink",value:function(e){if(!1!==this.config.enableEditingActions){this.config.enableHighlightUnavailableNodes&&this.unsetUnavailableNodesHighlighting();var t=this.getNodeAtMousePos(e);null!==t?this.completeNewLinkOnNode(e,t):this.config.enableLinkSelection!==l.LINK_SELECTION_DETACHABLE||this.drawingNewLinkData.action!==l.NODE_LINK||this.config.enableAssocLinkCreation?this.stopDrawingNewLink():this.completeNewDetachedLink(e)}}},{key:"completeNewLinkOnNode",value:function(e,t){if(this.removeNewLink(),this.config.enableHighlightNodeOnNewLinkDrag&&this.setNewLinkOverNodeCancel(),null!==t){var n=this.drawingNewLinkData.action;if(n===l.NODE_LINK){var i=this.activePipeline.getNode(this.drawingNewLinkData.srcObjId),o=this.drawingNewLinkData.srcPortId,a=this.getInputNodePortId(e,t);if(f.CanvasUtils.isDataConnectionAllowed(o,a,i,t,this.activePipeline.links))this.canvasController.editActionHandler({editType:"linkNodes",editSource:"canvas",nodes:[{id:this.drawingNewLinkData.srcObjId,portId:this.drawingNewLinkData.srcPortId}],targetNodes:[{id:t.id,portId:a}],type:n,linkType:"data",pipelineId:this.pipelineId});else if(this.config.enableLinkReplaceOnNewConnection&&f.CanvasUtils.isDataLinkReplacementAllowed(o,a,i,t,this.activePipeline.links)){var r=f.CanvasUtils.getDataLinksConnectedTo(a,t,this.activePipeline.links);1===r.length&&this.canvasController.editActionHandler({editType:"linkNodesAndReplace",editSource:"canvas",nodes:[{id:this.drawingNewLinkData.srcObjId,portId:this.drawingNewLinkData.srcPortId}],targetNodes:[{id:t.id,portId:a}],type:n,pipelineId:this.pipelineId,replaceLink:r[0]})}}else if(n===l.ASSOCIATION_LINK){var s=this.activePipeline.getNode(this.drawingNewLinkData.srcObjId);f.CanvasUtils.isAssocConnectionAllowed(s,t,this.activePipeline.links)&&this.canvasController.editActionHandler({editType:"linkNodes",editSource:"canvas",nodes:[{id:this.drawingNewLinkData.srcObjId}],targetNodes:[{id:t.id}],type:n,pipelineId:this.pipelineId})}else f.CanvasUtils.isCommentLinkConnectionAllowed(this.drawingNewLinkData.srcObjId,t.id,this.activePipeline.links)&&this.canvasController.editActionHandler({editType:"linkComment",editSource:"canvas",nodes:[this.drawingNewLinkData.srcObjId],targetNodes:[t.id],type:l.COMMENT_LINK,linkType:"comment",pipelineId:this.pipelineId})}this.drawingNewLinkData=null}},{key:"completeNewDetachedLink",value:function(e){this.removeNewLink(),this.config.enableHighlightNodeOnNewLinkDrag&&this.setNewLinkOverNodeCancel();var t=this.getTransformedMousePos(e);this.canvasController.editActionHandler({editType:"createDetachedLink",editSource:"canvas",srcNodeId:this.drawingNewLinkData.srcObjId,srcNodePortId:this.drawingNewLinkData.srcPortId,trgPos:t,type:l.NODE_LINK,pipelineId:this.pipelineId}),this.drawingNewLinkData=null}},{key:"stopDrawingNewLink",value:function(){this.config.enableHighlightNodeOnNewLinkDrag&&this.setNewLinkOverNodeCancel(),this.stopDrawingNewLinkForPorts()}},{key:"stopDrawingNewLinkForPorts",value:function(){var e=this,t=this.drawingNewLinkData.linkArray[0].x1,n=this.drawingNewLinkData.linkArray[0].y1,i=this.drawingNewLinkData.linkArray[0].x2,o=this.drawingNewLinkData.linkArray[0].y2,a=Object.assign({},this.drawingNewLinkData);this.drawingNewLinkData=null;var r="",s=350;this.canvasLayout.linkType===l.LINK_TYPE_CURVE?r="M "+t+" "+n+"C "+i+" "+o+" "+i+" "+o+" "+i+" "+o:this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT?(t<i&&(s=0),r="M "+t+" "+n+"L "+i+" "+o+" "+i+" "+o+" "+i+" "+o):r="M "+t+" "+n+"L "+i+" "+o+"Q "+i+" "+o+" "+i+" "+o+"L "+i+" "+o+"Q "+i+" "+o+" "+i+" "+o+"L "+i+" "+o+"Q "+i+" "+o+" "+i+" "+o+"L "+i+" "+o+"Q "+i+" "+o+" "+i+" "+o+"L "+i+" "+o,this.nodesLinksGrp.selectAll(".d3-new-connection-line").transition().duration(s).attr("d",r).on("end",(function(){e.nodesLinksGrp.selectAll(".d3-new-connection-arrow").remove(),e.nodesLinksGrp.selectAll(".d3-new-connection-guide").transition().duration(1e3).ease(gr.easeElastic).attr("x",t-a.portWidth/2).attr("y",n-a.portHeight/2).attr("cx",t).attr("cy",n).attr("transform",null),e.nodesLinksGrp.selectAll(".d3-new-connection-line").transition().duration(1e3).ease(gr.easeElastic).attr("d","M "+t+" "+n+"L "+t+" "+n).on("end",e.removeNewLink.bind(e))}))}},{key:"removeNewLink",value:function(){this.nodesLinksGrp.selectAll(".d3-new-connection-line").remove(),this.nodesLinksGrp.selectAll(".d3-new-connection-start").remove(),this.nodesLinksGrp.selectAll(".d3-new-connection-guide").remove(),this.nodesLinksGrp.selectAll(".d3-new-connection-arrow").remove()}},{key:"removeNewLinkLine",value:function(){this.nodesLinksGrp.selectAll(".d3-new-connection-line").remove()}},{key:"dragLinkHandle",value:function(e){var t=this.getTransformedMousePos(e),n=this.draggingLinkData.link;"start"===this.draggingLinkData.endBeingDragged?(n.srcPos={x_pos:t.x,y_pos:t.y},delete n.srcNodeId,delete n.srcNodePortId,delete n.srcObj):(n.trgPos={x_pos:t.x,y_pos:t.y},delete n.trgNodeId,delete n.trgNodePortId,delete n.trgNode),this.displayLinks(),this.config.enableHighlightNodeOnNewLinkDrag&&this.setNewLinkOverNode(e)}},{key:"completeDraggedLink",value:function(e){var t=this.getNewLinkOnDrag(e);t?this.canvasController.editActionHandler({editType:"updateLink",editSource:"canvas",newLink:t,pipelineId:this.pipelineId}):(this.activePipeline.replaceLink(this.draggingLinkData.oldLink),this.displayLinks()),this.config.enableHighlightNodeOnNewLinkDrag&&this.setNewLinkOverNodeCancel(),this.unsetUnavailableNodesHighlighting(),this.stopDraggingLink()}},{key:"getNewLinkOnDrag",value:function(e,t){var n=this.draggingLinkData.oldLink,i=m.cloneDeep_1(n);if("start"===this.draggingLinkData.endBeingDragged){delete i.srcNodeId,delete i.srcNodePortId,delete i.srcPos;var o=t?this.getNodeNearMousePos(e,t):this.getNodeAtMousePos(e);o?(i.srcNodeId=o.id,i.srcNodePortId=t?this.getNodePortIdNearMousePos(e,"output_type",o):this.getOutputNodePortId(e,o)):i.srcPos=this.draggingLinkData.link.srcPos}else{delete i.trgNodeId,delete i.trgNodePortId,delete i.trgPos;var a=t?this.getNodeNearMousePos(e,t):this.getNodeAtMousePos(e);a?(i.trgNodeId=a.id,i.trgNodePortId=t?this.getNodePortIdNearMousePos(e,"input_type",a):this.getInputNodePortId(e,a)):i.trgPos=this.draggingLinkData.link.trgPos}return this.config.enableLinkSelection!==l.LINK_SELECTION_DETACHABLE&&(i.srcPos||i.trgPos)?null:this.canExecuteUpdateLinkCommand(i,n)?i:null}},{key:"canExecuteUpdateLinkCommand",value:function(e,t){var n=this.activePipeline.getNode(e.srcNodeId),i=this.activePipeline.getNode(e.trgNodeId),o=this.hasLinkSrcChanged(e,t),a=this.hasLinkTrgChanged(e,t),r=this.activePipeline.links,s=!0;return o&&n&&!f.CanvasUtils.isSrcConnectionAllowedWithDetachedLinks(e.srcNodePortId,n,r)&&(s=!1),a&&i&&!f.CanvasUtils.isTrgConnectionAllowedWithDetachedLinks(e.trgNodePortId,i,r)&&(s=!1),n&&i&&!f.CanvasUtils.isConnectionAllowedWithDetachedLinks(e.srcNodePortId,e.trgNodePortId,n,i,r)&&(s=!1),s}},{key:"hasLinkSrcChanged",value:function(e,t){var n=!1;return e.srcNodeId?(e.srcNodeId!==t.srcNodeId&&(n=!0),e.srcNodePortId!==t.srcNodePortId&&(n=!0)):t.srcPos&&e.srcPos.x_pos===t.srcPos.x_pos&&e.srcPos.y_pos===t.srcPos.y_pos||(n=!0),n}},{key:"hasLinkTrgChanged",value:function(e,t){var n=!1;return e.trgNodeId?(e.trgNodeId!==t.trgNodeId&&(n=!0),e.trgNodePortId!==t.trgNodePortId&&(n=!0)):t.trgPos&&e.trgPos.x_pos===t.trgPos.x_pos&&e.trgPos.y_pos===t.trgPos.y_pos||(n=!0),n}},{key:"stopDraggingLink",value:function(){this.draggingLinkData=null}},{key:"getLinkAtMousePos",value:function(e,t){var n=this.getElementWithClassAtPosition(e,t,"d3-data-link");return this.getNodeLinkForElement(n)}},{key:"getNodeLinkForElement",value:function(e){if(e){var t=gr.select(e).datum();if(t){var n=this.activePipeline.getLink(t.id);if(n&&n.type===l.NODE_LINK)return n}}return null}},{key:"setDataLinkSelectionAreaWider",value:function(e){this.nodesLinksGrp.selectAll(".d3-data-link-selection-area").classed("d3-extra-width",e)}},{key:"getNodeAtMousePos",value:function(e){var t=this.getElementWithClassAtMousePos(e,"d3-node-group");return this.getNodeForElement(t)}},{key:"getInputNodePortId",value:function(e,t){var n=this.getInputNodePortIdAtMousePos(e);return n||(n=f.CanvasUtils.getDefaultInputPortId(t)),n}},{key:"getInputNodePortIdAtMousePos",value:function(e){var t=this.getElementWithClassAtMousePos(e,this.getNodeInputPortClassName());return this.getNodePortIdForElement(t)}},{key:"getOutputNodePortId",value:function(e,t){var n=this.getOutputNodePortIdAtMousePos(e);return n||(n=f.CanvasUtils.getDefaultOutputPortId(t)),n}},{key:"getOutputNodePortIdAtMousePos",value:function(e){var t=this.getElementWithClassAtMousePos(e,this.getNodeOutputPortClassName());return this.getNodePortIdForElement(t)}},{key:"getElementWithClassAtMousePos",value:function(e,t){var n=e.clientX?e.clientX:e.sourceEvent.clientX,i=e.clientY?e.clientY:e.sourceEvent.clientY;return this.getElementWithClassAtPosition(n,i,t)}},{key:"getElementWithClassAtPosition",value:function(e,t,n){for(var i=document.elementsFromPoint(e,t),o=null,a=0;!o&&a<i.length;)o=f.CanvasUtils.getParentElementWithClass(i[a],n),a++;return o}},{key:"getNodeForElement",value:function(e){if(e&&"g"===e.nodeName){var t=gr.select(e).datum();if(t)return this.activePipeline.getNode(t.id)}return null}},{key:"getNodePortIdForElement",value:function(e){return e?gr.select(e).attr("data-port-id"):null}},{key:"getNodeNearMousePos",value:function(e,t){var n=this,i=this.getTransformedMousePos(e),o=null,a=t||0;return this.getAllNodeGroupsSelection().each((function(e){var t=e.layout.portRadius;f.CanvasUtils.isSuperBindingNode(e)&&(t=n.canvasLayout.supernodeBindingPortRadius/n.zoomTransform.k),i.x>=e.x_pos-t-a&&i.x<=e.x_pos+e.width+t+a&&i.y>=e.y_pos-a&&i.y<=e.y_pos+e.height+a&&(o=e)})),o}},{key:"getNodePortIdNearMousePos",value:function(e,t,n){var i=this.getTransformedMousePos(e),o=null,a=null;if(n)if("output_type"===t){var r=this.getAllNodeGroupsSelection().selectChildren("."+this.getNodeOutputPortClassName()).selectChildren(".d3-node-port-output-main");o=this.searchForPortNearMouse(n,i,r,n.layout.outputPortObject,n.width),a=f.CanvasUtils.getDefaultOutputPortId(n)}else{var s=this.getAllNodeGroupsSelection().selectChildren("."+this.getNodeInputPortClassName()).selectChildren(".d3-node-port-input-main");o=this.searchForPortNearMouse(n,i,s,n.layout.inputPortObject,0),a=f.CanvasUtils.getDefaultInputPortId(n)}return o||(o=a),o}},{key:"searchForPortNearMouse",value:function(e,t,n,i,o){var a=null;return n.each((function(n,r,s){var c=gr.select(s[r]);if(i===l.PORT_OBJECT_IMAGE){var u=e.x_pos+Number(c.attr("x")),d=e.y_pos+Number(c.attr("y")),h=Number(c.attr("width")),p=Number(c.attr("height"));t.x>=u&&t.x<=u+o+h&&t.y>=d&&t.y<=d+p&&(a=s[r].getAttribute("data-port-id"))}else{var g=e.x_pos+Number(c.attr("cx")),f=e.y_pos+Number(c.attr("cy"));t.x>=g-e.layout.portRadius&&t.x<=g+e.layout.portRadius&&t.y>=f-e.layout.portRadius&&t.y<=f+e.layout.portRadius&&(a=s[r].getAttribute("data-port-id"))}})),a}},{key:"getNodeShapePathSizing",value:function(e){return this.getRectangleNodeShapePath(e,e.layout.nodeSizingArea)}},{key:"getNodeSelectionOutline",value:function(e){return e.layout.selectionPath&&!f.CanvasUtils.isExpanded(e)?e.layout.selectionPath:"port-arcs"===e.layout.nodeShape?this.getPortArcsNodeShapePath(e):this.getRectangleNodeShapePath(e,e.layout.nodeHighlightGap)}},{key:"getNodeShapePath",value:function(e){return e.layout.bodyPath&&!f.CanvasUtils.isExpanded(e)?e.layout.bodyPath:"port-arcs"===e.layout.nodeShape?this.getPortArcsNodeShapePath(e):this.getRectangleNodeShapePath(e)}},{key:"getRectangleNodeShapePath",value:function(e,t){var n=t||0,i=0-n,o=0-n,a=e.width+n,r=e.height+n,s="M "+i+" "+o+" L "+a+" "+o;return s+=" L "+a+" "+r,s+=" L "+i+" "+r,s+=" Z"}},{key:"getPortArcsNodeShapePath",value:function(e){return this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?this.getPortArcsNodeShapePathVertical(e,e.inputs,e.inputPortsWidth,e.outputs,e.outputPortsWidth):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP?this.getPortArcsNodeShapePathVertical(e,e.outputs,e.outputPortsWidth,e.inputs,e.inputPortsWidth):this.getPortArcsNodeShapePathLeftRight(e)}},{key:"getPortArcsNodeShapePathLeftRight",value:function(e){var t="M 0 0 L "+e.width+" 0 ";if(e.outputs&&e.outputs.length>0){var n=e.layout.portArcOffset;e.outputPortsHeight<e.height&&(n=e.outputs[0].cy-e.layout.portArcRadius),t+=" L "+e.width+" "+n,e.outputs.forEach((function(i,o){n+=2*e.layout.portArcRadius,t+=" A "+e.layout.portArcRadius+" "+e.layout.portArcRadius+" 180 0 1 "+e.width+" "+n,o<e.outputs.length-1&&(n+=e.layout.portArcSpacing,t+=" L "+e.width+" "+n)})),t+=" L "+e.width+" "+e.height}else t+=" L "+e.width+" "+e.height;if(t+=" L 0 "+e.height,e.inputs&&e.inputs.length>0){var i=e.height-e.layout.portArcOffset;e.inputPortsHeight<e.height&&(i=e.inputs[e.inputs.length-1].cy+e.layout.portArcRadius),t+=" L 0 "+i,e.inputs.forEach((function(n,o){i-=2*e.layout.portArcRadius,t+=" A "+e.layout.portArcRadius+" "+e.layout.portArcRadius+" 180 0 1 0 "+i,o<e.inputs.length-1&&(i-=e.layout.portArcSpacing,t+=" L 0 "+i)})),t+=" Z"}else t+=" Z";return t}},{key:"getPortArcsNodeShapePathVertical",value:function(e,t,n,i,o){var a="M 0 0 L 0 "+e.height;if(i&&i.length>0){var r=e.layout.portArcOffset;o<e.width&&(r=i[0].cx-e.layout.portArcRadius),a+=" L "+r+" "+e.height,i.forEach((function(t,n){r+=2*e.layout.portArcRadius,a+=" A "+e.layout.portArcRadius+" "+e.layout.portArcRadius+" 180 0 0 "+r+" "+e.height,n<i.length-1&&(r+=e.layout.portArcSpacing,a+=" L "+r+" "+e.height)})),a+=" L "+e.width+" "+e.height}else a+=" L "+e.width+" "+e.height;if(a+=" L "+e.width+" 0 ",t&&t.length>0){var s=e.width-e.layout.portArcOffset;n<e.width&&(s=t[t.length-1].cx+e.layout.portArcRadius),a+=" L "+s+" 0 ",t.forEach((function(n,i){s-=2*e.layout.portArcRadius,a+=" A "+e.layout.portArcRadius+" "+e.layout.portArcRadius+" 180 0 0 "+s+" 0 ",i<t.length-1&&(s-=e.layout.portArcSpacing,a+=" L "+s+" 0 ")})),a+=" Z"}else a+=" Z";return a}},{key:"setPortPositionsAllNodes",value:function(){var e=this;this.activePipeline.nodes.forEach((function(t){e.setPortPositionsForNode(t)}))}},{key:"setPortPositionsForNode",value:function(e){this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?(this.setPortPositionsVertical(e,e.inputs,e.inputPortsWidth,e.layout.inputPortTopPosX,e.layout.inputPortTopPosY),this.setPortPositionsVertical(e,e.outputs,e.outputPortsWidth,e.layout.outputPortBottomPosX,this.getOutputPortBottomPosY(e))):this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP?(this.setPortPositionsVertical(e,e.inputs,e.inputPortsWidth,e.layout.inputPortBottomPosX,this.getInputPortBottomPosY(e)),this.setPortPositionsVertical(e,e.outputs,e.outputPortsWidth,e.layout.outputPortTopPosX,e.layout.outputPortTopPosY)):(this.setPortPositionsLeftRight(e,e.inputs,e.inputPortsHeight,e.layout.inputPortLeftPosX,e.layout.inputPortLeftPosY),this.setPortPositionsLeftRight(e,e.outputs,e.outputPortsHeight,this.nodeUtils.getNodeOutputPortRightPosX(e),this.nodeUtils.getNodeOutputPortRightPosY(e),this.config.enableSingleOutputPortDisplay))}},{key:"getOutputPortBottomPosY",value:function(e){return e.height+e.layout.outputPortBottomPosY}},{key:"getInputPortBottomPosY",value:function(e){return e.height+e.layout.inputPortBottomPosY}},{key:"setPortPositionsVertical",value:function(e,t,n,i,o){if(t&&t.length>0)if(e.width<=e.layout.defaultNodeWidth&&1===t.length)t[0].cx=i,t[0].cy=o;else{var a=0;if(f.CanvasUtils.isExpandedSupernode(e)){var r=e.width-2*this.canvasLayout.supernodeSVGAreaPadding-n;a=2*this.canvasLayout.supernodeSVGAreaPadding+r/2}else n<e.width&&(a=(e.width-n)/2);a+=e.layout.portArcOffset;var s=1;f.CanvasUtils.isSuperBindingNode(e)&&(s=1/this.zoomTransform.k),t.forEach((function(t){a+=e.layout.portArcRadius*s,t.cx=a,t.cy=o,a+=(e.layout.portArcRadius+e.layout.portArcSpacing)*s}))}}},{key:"setPortPositionsLeftRight",value:function(e,t,n,i,o){var a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];t&&t.length>0&&(e.height<=e.layout.defaultNodeHeight&&1===t.length?(t[0].cx=i,t[0].cy=o):a?this.setPortPositionsLeftRightSinglePort(e,t,i,o):this.setPortPositionsLeftRightAllPorts(e,t,n,i,o))}},{key:"setPortPositionsLeftRightAllPorts",value:function(e,t,n,i,o){var a=0;if(f.CanvasUtils.isExpandedSupernode(e)){var r=e.height-this.canvasLayout.supernodeTopAreaHeight-this.canvasLayout.supernodeSVGAreaPadding-n;a=this.canvasLayout.supernodeTopAreaHeight+this.canvasLayout.supernodeSVGAreaPadding+r/2}else n<e.height&&(a=(e.height-n)/2);a+=e.layout.portArcOffset;var s=1;f.CanvasUtils.isSuperBindingNode(e)&&(s=1/this.zoomTransform.k),t.forEach((function(t){a+=e.layout.portArcRadius*s,t.cx=i,t.cy=a,a+=(e.layout.portArcRadius+e.layout.portArcSpacing)*s}))}},{key:"setPortPositionsLeftRightSinglePort",value:function(e,t,n,i){var o=0;if(f.CanvasUtils.isExpandedSupernode(e)){var a=e.height-this.canvasLayout.supernodeTopAreaHeight-this.canvasLayout.supernodeSVGAreaPadding;o=this.canvasLayout.supernodeTopAreaHeight+a/2}else o=i;t.forEach((function(e){e.cx=n,e.cy=o}))}},{key:"displayComments",value:function(){this.logger.logStartTimer("displayComments "+this.getFlags()),!this.dragging||this.commentSizing||this.nodeSizing||this.isCommentBeingUpdated?this.selecting||this.regionSelect?this.displayCommentsSelectionStatus():this.displayAllComments():this.displayMovedComments(),this.logger.logEndTimer("displayComments "+this.getFlags())}},{key:"displayMovedComments",value:function(){var e=this;this.getAllCommentGroupsSelection().attr("transform",(function(e){return"translate(".concat(e.x_pos,", ").concat(e.y_pos,")")})).datum((function(t){return e.activePipeline.getComment(t.id)}))}},{key:"displayCommentsSelectionStatus",value:function(){var e=this;this.getAllCommentGroupsSelection().selectChildren(".d3-comment-selection-highlight").attr("data-selected",(function(t){return e.objectModel.isSelected(t.id,e.activePipeline.id)?"yes":"no"})),this.superRenderers.forEach((function(e){e.selecting=!0,e.displayComments(),e.selecting=!1}))}},{key:"displayAllComments",value:function(){var e=this;this.getAllCommentGroupsSelection().data(this.activePipeline.comments,(function(e){return e.id})).join((function(t){return e.createComments(t)})).attr("transform",(function(e){return"translate(".concat(e.x_pos,", ").concat(e.y_pos,")")})).attr("class",(function(t){return e.getCommentGroupClass(t)})).call((function(t){return e.updateComments(t)}))}},{key:"createComments",value:function(e){var t=this,n=e.append("g").attr("data-id",(function(e){return t.getId("comment_grp",e.id)})).call(this.attachCommentGroupListeners.bind(this));return this.config.enableEditingActions&&n.call(this.drag),n.append("rect").attr("class","d3-comment-sizing").call(this.attachCommentSizingListeners.bind(this)),n.append("rect").attr("class","d3-comment-selection-highlight"),n.append("rect").attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})).attr("x",0).attr("y",0).attr("class","d3-comment-rect"),n.append("foreignObject").attr("class","d3-foreign-object-comment-text").attr("x",0).attr("y",0).append("xhtml:div").attr("class","d3-comment-text"),n}},{key:"updateComments",value:function(e){var t=this;e.attr("transform",(function(e){return"translate(".concat(e.x_pos,", ").concat(e.y_pos,")")})).attr("class",(function(e){return t.getCommentGroupClass(e)})),e.selectChildren(".d3-comment-sizing").datum((function(e){return t.activePipeline.getComment(e.id)})).attr("x",-this.canvasLayout.commentSizingArea).attr("y",-this.canvasLayout.commentSizingArea).attr("height",(function(e){return e.height+2*t.canvasLayout.commentSizingArea})).attr("width",(function(e){return e.width+2*t.canvasLayout.commentSizingArea})).attr("class","d3-comment-sizing"),e.selectChildren(".d3-comment-selection-highlight").datum((function(e){return t.activePipeline.getComment(e.id)})).attr("x",-this.canvasLayout.commentHighlightGap).attr("y",-this.canvasLayout.commentHighlightGap).attr("height",(function(e){return e.height+2*t.canvasLayout.commentHighlightGap})).attr("width",(function(e){return e.width+2*t.canvasLayout.commentHighlightGap})).attr("data-selected",(function(e){return t.objectModel.isSelected(e.id,t.activePipeline.id)?"yes":"no"})).attr("style",(function(e){return t.getNodeSelectionOutlineStyle(e,"default")})),e.selectChildren(".d3-comment-rect").datum((function(e){return t.activePipeline.getComment(e.id)})).attr("height",(function(e){return e.height})).attr("width",(function(e){return e.width})).attr("class","d3-comment-rect").attr("style",(function(e){return t.getCommentBodyStyle(e,"default")})),e.selectChildren(".d3-foreign-object-comment-text").datum((function(e){return t.activePipeline.getComment(e.id)})).attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})).select("div").attr("style",(function(e){return t.getNodeLabelStyle(e,"default")})).html((function(e){return t.config.enableMarkdownInComments?fr.render(e.content):_n(e.content)}))}},{key:"attachCommentGroupListeners",value:function(e){var t=this;e.on("mouseenter",(function(e,n){t.setCommentStyles(n,"hover",gr.select(e.currentTarget)),t.config.enableEditingActions&&n.id!==t.svgCanvasTextArea.getEditingTextId()&&t.createCommentPort(e.currentTarget,n)})).on("mouseleave",(function(e,n){t.setCommentStyles(n,"default",gr.select(e.currentTarget)),t.config.enableEditingActions&&t.deleteCommentPort(e.currentTarget)})).on("mousedown",(function(e,n){t.logger.log("Comment Group - mouse down"),t.config.enableDragWithoutSelect||t.selectObjectD3Event(e,n),t.logger.log("Comment Group - finished mouse down")})).on("click",(function(e,n){t.logger.log("Comment Group - click"),e.stopPropagation()})).on("dblclick",(function(e,n){t.logger.log("Comment Group - double click"),t.config.enableEditingActions&&(f.CanvasUtils.stopPropagationAndPreventDefault(e),t.deleteCommentPort(e.currentTarget),t.displayCommentTextArea(n,e.currentTarget),t.canvasController.clickActionHandler({clickType:"DOUBLE_CLICK",objectType:"comment",id:n.id,selectedObjectIds:t.objectModel.getSelectedObjectIds(),pipelineId:t.activePipeline.id}))})).on("contextmenu",(function(e,n){t.logger.log("Comment Group - context menu"),t.config.enableDragWithoutSelect&&t.selectObjectD3Event(e,n),t.openContextMenu(e,"comment",n)}))}},{key:"attachCommentSizingListeners",value:function(e){var t=this;e.on("mousedown",(function(e,n){t.commentSizing=!0,t.addTempCursorOverlay(t.commentSizingCursor)})).on("mousemove mouseenter",(function(e,n){if(t.config.enableEditingActions&&!t.isRegionSelectOrSizingInProgress()){var i="pointer";t.isPointerCloseToBodyEdge(e,n)||(t.commentSizingDirection=t.getSizingDirection(e,n,t.canvasLayout.commentCornerResizeArea),t.commentSizingCursor=t.getCursorBasedOnDirection(t.commentSizingDirection),i=t.commentSizingCursor),gr.select(e.currentTarget).style("cursor",i)}}))}},{key:"createCommentPort",value:function(e,t){var n=this;gr.select(e).append("circle").attr("cx",(function(e){return e.width/2})).attr("cy",(function(e){return e.height+n.canvasLayout.commentHighlightGap})).attr("r",this.canvasLayout.commentPortRadius).attr("class","d3-comment-port-circle").on("mousedown",(function(e,i){f.CanvasUtils.stopPropagationAndPreventDefault(e),n.drawingNewLinkData={srcObjId:t.id,action:l.COMMENT_LINK,startPos:{x:t.x_pos-n.canvasLayout.commentHighlightGap,y:t.y_pos-n.canvasLayout.commentHighlightGap},linkArray:[]},n.drawNewLink(e)}))}},{key:"deleteCommentPort",value:function(e){gr.select(e).selectChildren(".d3-comment-port-circle").remove()}},{key:"setCommentStyles",value:function(e,t,n){this.setCommentSelectionOutlineStyles(e,t,n),this.setCommentBodyStyles(e,t,n),this.setCommentTextStyles(e,t,n)}},{key:"setCommentSelectionOutlineStyles",value:function(e,t,n){var i=this.getCommentSelectionOutlineStyle(e,t);n.selectChildren(".d3-comment-selection-highlight").attr("style",i)}},{key:"setCommentBodyStyles",value:function(e,t,n){var i=this.getCommentBodyStyle(e,t);n.selectChildren(".d3-comment-rect").attr("style",i)}},{key:"setCommentTextStyles",value:function(e,t,n){var i=this.getCommentTextStyle(e,t);n.selectChildren(".d3-foreign-object-comment-text").select("div").attr("style",i)}},{key:"getCommentSelectionOutlineStyle",value:function(e,t){return f.CanvasUtils.getObjectStyle(e,"selection_outline",t)}},{key:"getCommentBodyStyle",value:function(e,t){return f.CanvasUtils.getObjectStyle(e,"body",t)}},{key:"getCommentTextStyle",value:function(e,t){return f.CanvasUtils.getObjectStyle(e,"text",t)}},{key:"displayCommentTextArea",value:function(e,t){this.svgCanvasTextArea.displayCommentTextArea(e,t)}},{key:"displayNodeLabelTextArea",value:function(e,t){this.svgCanvasTextArea.displayNodeLabelTextArea(e,t)}},{key:"displayDecLabelTextArea",value:function(e,t,n,i){this.svgCanvasTextArea.displayDecLabelTextArea(e,t,n,i)}},{key:"addTempCursorOverlay",value:function(e){this.dispUtils.isDisplayingFullPage()&&(this.canvasDiv.selectAll(".d3-temp-cursor-overlay").size()>0&&this.removeTempCursorOverlay(),this.canvasSVG.append("rect").attr("x",0).attr("y",0).attr("width","100%").attr("height","100%").attr("data-pipeline-id",this.activePipeline.id).attr("class","d3-temp-cursor-overlay").attr("pointer-events","all").style("cursor",e))}},{key:"removeTempCursorOverlay",value:function(){this.dispUtils.isDisplayingFullPage()&&this.canvasDiv.selectAll(".d3-temp-cursor-overlay").remove()}},{key:"isRegionSelectOrSizingInProgress",value:function(){return!!(this.regionSelect||this.nodeSizing||this.commentSizing)||!(!this.supernodeInfo.renderer||!this.supernodeInfo.renderer.isRegionSelectOrSizingInProgress())}},{key:"isPointerCloseToBodyEdge",value:function(e,t){var n=this.getTransformedMousePos(e),i=t.x_pos+t.width,o=t.y_pos+t.height,a=n.x>=i&&n.x<=i+1&&n.y>=0&&n.y<=o,r=n.y>=o&&n.y<=o+1&&n.x>=0&&n.x<=i;return a||r}},{key:"getSizingDirection",value:function(e,t,n){var i="",o="",a=this.getTransformedMousePos(e);return a.x<t.x_pos+n?i="w":a.x>t.x_pos+t.width-n&&(i="e"),a.y<t.y_pos+n?o="n":a.y>t.y_pos+t.height-n&&(o="s"),o+i}},{key:"getCursorBasedOnDirection",value:function(e){var t;switch(e){case"n":case"s":t="ns-resize";break;case"e":case"w":t="ew-resize";break;case"nw":case"se":t="nwse-resize";break;case"ne":case"sw":t="nesw-resize";break;default:t=""}return t}},{key:"getMinHeight",value:function(e){if(f.CanvasUtils.isSupernode(e)){var t=Math.max(e.inputPortsHeight,e.outputPortsHeight)+this.canvasLayout.supernodeTopAreaHeight+this.canvasLayout.supernodeSVGAreaPadding;return Math.max(this.canvasLayout.supernodeMinHeight,t)}return e.layout.defaultNodeHeight}},{key:"getMinWidth",value:function(e){return f.CanvasUtils.isSupernode(e)?this.canvasLayout.supernodeMinWidth:e.layout.defaultNodeWidth}},{key:"resizeNode",value:function(e,t){var n=this.activePipeline.getNode(t.id),i=Object.assign({},n),o=this.getMinHeight(n),a=this.getMinWidth(n),r=this.resizeObject(e,n,this.nodeSizingDirection,a,o);if(r&&(0!==r.x_pos||0!==r.y_pos||0!==r.width||0!==r.height)){if(f.CanvasUtils.isSupernode(n)&&this.config.enableMoveNodesOnSupernodeResize){var s=f.CanvasUtils.moveSurroundingObjects(i,this.activePipeline.getNodesAndComments(),this.nodeSizingDirection,n.width,n.height,!0),l=f.CanvasUtils.moveSurroundingDetachedLinks(i,this.activePipeline.links,this.nodeSizingDirection,n.width,n.height,!0);this.nodeSizingObjectsInfo=Object.assign(this.nodeSizingObjectsInfo,s),this.nodeSizingDetLinksInfo=Object.assign(this.nodeSizingDetLinksInfo,l)}this.displayComments(),this.displayNodes(),this.displayLinks(),f.CanvasUtils.isSupernode(n)&&(this.dispUtils.isDisplayingSubFlow()&&this.displayBindingNodesToFitSVG(),this.superRenderers.forEach((function(e){return e.displaySVGToFitSupernode()})))}}},{key:"resizeComment",value:function(e,t){var n=this.activePipeline.getComment(t.id);this.resizeObject(e,n,this.commentSizingDirection,20,20),this.displayComments(),this.displayLinks()}},{key:"resizeObject",value:function(e,t,n,i,o){var a=0,r=0,s=0,c=0;n.indexOf("e")>-1&&(s+=e.dx),n.indexOf("s")>-1&&(c+=e.dy),n.indexOf("n")>-1&&(r+=e.dy,c-=e.dy),n.indexOf("w")>-1&&(a+=e.dx,s-=e.dx);var u=0,d=0,h=0,p=0;if(this.config.enableSnapToGridType===l.SNAP_TO_GRID_DURING?(this.notSnappedXPos+=a,this.notSnappedYPos+=r,this.notSnappedWidth+=s,this.notSnappedHeight+=c,u=f.CanvasUtils.snapToGrid(this.notSnappedXPos,this.canvasLayout.snapToGridXPx),d=f.CanvasUtils.snapToGrid(this.notSnappedYPos,this.canvasLayout.snapToGridYPx),h=f.CanvasUtils.snapToGrid(this.notSnappedWidth,this.canvasLayout.snapToGridXPx),p=f.CanvasUtils.snapToGrid(this.notSnappedHeight,this.canvasLayout.snapToGridYPx)):(u=t.x_pos+a,d=t.y_pos+r,h=t.width+s,p=t.height+c),h<i||p<o)return null;var g={width:h-t.width,height:p-t.height,x_pos:u-t.x_pos,y_pos:d-t.y_pos};return t.x_pos=u,t.y_pos=d,t.width=h,t.height=p,g}},{key:"endNodeSizing",value:function(e){var t=this.activePipeline.getNode(e.id);this.config.enableSnapToGridType===l.SNAP_TO_GRID_AFTER&&(t=this.snapToGridObject(t)),this.resizeObjInitialInfo.x_pos===t.x_pos&&this.resizeObjInitialInfo.y_pos===t.y_pos&&this.resizeObjInitialInfo.width===t.width&&this.resizeObjInitialInfo.height===t.height||(this.nodeSizingObjectsInfo[t.id]={width:t.width,height:t.height,x_pos:t.x_pos,y_pos:t.y_pos},(t.height>t.layout.defaultNodeHeight+2||t.width>t.layout.defaultNodeWidth+2)&&(this.nodeSizingObjectsInfo[t.id].isResized=!0,this.nodeSizingObjectsInfo[t.id].resizeWidth=t.width,this.nodeSizingObjectsInfo[t.id].resizeHeight=t.height),this.canvasController.editActionHandler({editType:"resizeObjects",editSource:"canvas",objectsInfo:this.nodeSizingObjectsInfo,detachedLinksInfo:this.nodeSizingDetLinksInfo,pipelineId:this.pipelineId})),this.nodeSizing=!1,this.nodeSizingObjectsInfo={},this.nodeSizingDetLinksInfo={}}},{key:"endCommentSizing",value:function(e){var t=this.activePipeline.getComment(e.id);if(this.config.enableSnapToGridType===l.SNAP_TO_GRID_AFTER&&(t=this.snapToGridObject(t)),this.resizeObjInitialInfo.x_pos!==t.x_pos||this.resizeObjInitialInfo.y_pos!==t.y_pos||this.resizeObjInitialInfo.width!==t.width||this.resizeObjInitialInfo.height!==t.height){var n=[];n[t.id]={width:t.width,height:t.height,x_pos:t.x_pos,y_pos:t.y_pos};var i={editType:"resizeObjects",editSource:"canvas",objectsInfo:n,detachedLinksInfo:{},pipelineId:this.pipelineId};this.canvasController.editActionHandler(i)}this.commentSizing=!1}},{key:"displayLinks",value:function(){this.logger.logStartTimer("displayLinks "+this.getFlags()),this.selecting||this.regionSelect?this.displayLinksSelectionStatus():this.displayAllLinks(),this.logger.logEndTimer("displayLinks "+this.getFlags())}},{key:"displayLinksSelectionStatus",value:function(){var e=this;this.config.enableLinkSelection!==l.LINK_SELECTION_NONE&&(this.getAllLinkGroupsSelection().attr("data-selected",(function(t){return!!e.objectModel.isSelected(t.id,e.activePipeline.id)||null})),this.superRenderers.forEach((function(e){e.selecting=!0,e.displayLinks(),e.selecting=!1})))}},{key:"displayAllLinks",value:function(){var e=this,t=this.buildLinksArray();this.getAllLinkGroupsSelection().data(t,(function(e){return e.id})).join((function(t){return e.createLinks(t)})).attr("class",(function(t){return e.getLinkGroupClass(t)})).attr("style",(function(t){return e.getLinkGrpStyle(t)})).attr("data-selected",(function(t){return!!e.objectModel.isSelected(t.id,e.activePipeline.id)||null})).call((function(n){e.updateLinks(n,t)}))}},{key:"createLinks",value:function(e){var t=this,n=e.append("g").attr("data-id",(function(e){return t.getId("link_grp",e.id)})).call(this.attachLinkGroupListeners.bind(this));return n.append("path").attr("class",(function(e){return t.getLinkSelectionAreaClass(e)})),n.append("path").attr("class","d3-link-line"),n.filter((function(e){return e.type===l.NODE_LINK&&t.canvasLayout.dataLinkArrowHead||e.type===l.COMMENT_LINK&&t.canvasLayout.commentLinkArrowHead||e.type===l.NODE_LINK&&t.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT})).append("path").attr("class","d3-link-line-arrow-head"),n.append("g").attr("class","d3-link-decorations-group"),this.config.enableLinkSelection!==l.LINK_SELECTION_HANDLES&&this.config.enableLinkSelection!==l.LINK_SELECTION_DETACHABLE||n.append("g").attr("class","d3-link-handles-group").each((function(e,n,i){e.type===l.NODE_LINK&&t.createNewHandles(gr.select(i[n]))})),n}},{key:"updateLinks",value:function(e,t){var n=this;e.selectAll(".d3-link-selection-area").datum((function(e){return n.activePipeline.getLink(e.id)})).attr("d",(function(e){return e.pathInfo.path})),e.selectAll(".d3-link-line").datum((function(e){return n.activePipeline.getLink(e.id)})).attr("d",(function(e){return e.pathInfo.path})).attr("class","d3-link-line").attr("style",(function(e){return f.CanvasUtils.getObjectStyle(e,"line","default")})),e.filter((function(e){return e.type===l.NODE_LINK&&n.canvasLayout.dataLinkArrowHead||e.type===l.COMMENT_LINK&&n.canvasLayout.commentLinkArrowHead||e.type===l.NODE_LINK&&n.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT})).selectAll(".d3-link-line-arrow-head").datum((function(e){return n.activePipeline.getLink(e.id)})).attr("d",(function(e){return n.getArrowHead(e)})).attr("transform",(function(e){return n.getArrowHeadTransform(e)})).attr("class","d3-link-line-arrow-head").attr("style",(function(e){return f.CanvasUtils.getObjectStyle(e,"line","default")})),e.each((function(e,t,i){e.type!==l.NODE_LINK&&e.type!==l.ASSOCIATION_LINK||n.displayDecorations(e,l.DEC_LINK,gr.select(i[t]).selectAll(".d3-link-decorations-group"),e.decorations)})),this.config.enableLinkSelection!==l.LINK_SELECTION_HANDLES&&this.config.enableLinkSelection!==l.LINK_SELECTION_DETACHABLE||e.each((function(e,i,o){e.type===l.NODE_LINK&&n.updateHandles(gr.select(o[i]).selectAll(".d3-link-handles-group"),t)})),this.dragging||this.setDisplayOrder(e)}},{key:"attachLinkGroupListeners",value:function(e){var t=this;e.on("mousedown",(function(e,n,i,o){t.logger.log("Link Group - mouse down"),t.config.enableLinkSelection!==l.LINK_SELECTION_NONE&&t.selectObjectD3Event(e,n),e.stopPropagation()})).on("mouseup",(function(){t.logger.log("Link Group - mouse up")})).on("click",(function(e,n){t.logger.log("Link Group - click"),e.stopPropagation()})).on("contextmenu",(function(e,n){t.logger.log("Link Group - context menu"),t.config.enableLinkSelection!==l.LINK_SELECTION_NONE&&t.selectObjectD3Event(e,n),t.openContextMenu(e,"link",n)})).on("mouseenter",(function(e,n){var i=e.currentTarget;t.config.enableLinkSelection!==l.LINK_SELECTION_HANDLES&&t.config.enableLinkSelection!==l.LINK_SELECTION_DETACHABLE||t.raiseLinkToTop(i),t.setLinkLineStyles(i,n,"hover"),t.canOpenTip(l.TIP_TYPE_LINK)&&!t.draggingLinkData&&t.canvasController.openTip({id:t.getId("link_tip",n.id),type:l.TIP_TYPE_LINK,targetObj:i,mousePos:{x:e.clientX,y:e.clientY},pipelineId:t.activePipeline.id,link:n})})).on("mouseleave",(function(e,n){var i=e.currentTarget;i.getAttribute("data-selected")||t.lowerLinkToBottom(i),t.setLinkLineStyles(i,n,"default"),t.canvasController.closeTip()}))}},{key:"createNewHandles",value:function(e){var t=this,n=e.append(this.canvasLayout.linkStartHandleObject).attr("class",(function(e){return"d3-link-handle-start"})).on("mousedown",(function(e,n){t.logger.log("Link start handle - mouse down"),t.config.enableDragWithoutSelect||t.selectObjectD3Event(e,n),t.logger.log("Link end handle - finished mouse down")}));this.config.enableEditingActions&&n.call(this.dragSelectionHandle);var i=e.append(this.canvasLayout.linkEndHandleObject).attr("class",(function(e){return"d3-link-handle-end"})).on("mousedown",(function(e,n){t.logger.log("Link end handle - mouse down"),t.config.enableDragWithoutSelect||t.selectObjectD3Event(e,n),t.logger.log("Link end handle - finished mouse down")}));this.config.enableEditingActions&&i.call(this.dragSelectionHandle)}},{key:"updateHandles",value:function(e,t){var n=this;e.selectAll(".d3-link-handle-start").datum((function(e){return n.activePipeline.getLink(e.id)})).each((function(e,t,i){var o=gr.select(i[t]);"image"===n.canvasLayout.linkStartHandleObject?o.attr("xlink:href",n.canvasLayout.linkStartHandleImage).attr("x",(function(e){return e.x1-n.canvasLayout.linkStartHandleWidth/2})).attr("y",(function(e){return e.y1-n.canvasLayout.linkStartHandleHeight/2})).attr("width",n.canvasLayout.linkStartHandleWidth).attr("height",n.canvasLayout.linkStartHandleHeight):"circle"===n.canvasLayout.linkStartHandleObject&&o.attr("r",n.canvasLayout.linkStartHandleRadius).attr("cx",(function(e){return e.x1})).attr("cy",(function(e){return e.y1}))})),e.selectAll(".d3-link-handle-end").datum((function(e){return n.activePipeline.getLink(e.id)})).each((function(e,t,i){var o=gr.select(i[t]);"image"===n.canvasLayout.linkEndHandleObject?o.attr("xlink:href",n.canvasLayout.linkEndHandleImage).attr("x",(function(e){return e.x2-n.canvasLayout.linkEndHandleWidth/2})).attr("y",(function(e){return e.y2-n.canvasLayout.linkEndHandleHeight/2})).attr("width",n.canvasLayout.linkEndHandleWidth).attr("height",n.canvasLayout.linkEndHandleHeight).attr("transform",(function(e){return n.getLinkImageTransform(e)})):"circle"===n.canvasLayout.linkEndHandleObject&&o.attr("r",n.canvasLayout.linkEndHandleRadius).attr("cx",(function(e){return e.x2})).attr("cy",(function(e){return e.y2}))}))}},{key:"setLinkLineStyles",value:function(e,t,n){var i=f.CanvasUtils.getObjectStyle(t,"line",n),o=gr.select(e);o.select(".d3-link-line").attr("style",i),o.select(".d3-link-line-arrow-head").attr("style",i)}},{key:"getLinkSelectionAreaClass",value:function(e){return"d3-link-selection-area "+(e.type===l.ASSOCIATION_LINK?"d3-association-link-selection-area":e.type===l.COMMENT_LINK?"d3-comment-link-selection-area":"d3-data-link-selection-area")}},{key:"getLinkGroupClass",value:function(e){return"d3-link-group "+this.getLinkTypeClass(e)+" "+this.getLinkCustomClass(e)}},{key:"getLinkCustomClass",value:function(e){return e.class_name&&"canvas-data-link"!==e.class_name&&"canvas-object-link"!==e.class_name&&"canvas-comment-link"!==e.class_name&&"d3-data-link"!==e.class_name&&"d3-association-link"!==e.class_name&&"d3-object-link"!==e.class_name&&"d3-comment-link"!==e.class_name?e.class_name:""}},{key:"getLinkTypeClass",value:function(e){return e.type===l.ASSOCIATION_LINK?this.config.enableAssocLinkType===l.ASSOC_RIGHT_SIDE_CURVE?"d3-association-link":"d3-object-link":e.type===l.COMMENT_LINK?"d3-comment-link":"d3-data-link"}},{key:"getCommentGroupClass",value:function(e){var t="";return e.class_name&&"canvas-comment"!==e.class_name&&"d3-comment-rect"!==e.class_name&&(t=" "+e.class_name),"d3-comment-group"+(this.config.enableEditingActions?" d3-draggable":" d3-non-draggable")+t}},{key:"getNodeGroupClass",value:function(e){var t="";e.class_name&&"canvas-node"!==e.class_name&&"d3-node-body"!==e.class_name&&"d3-node-body-outline"!==e.class_name&&(t=" "+e.class_name);var n=f.CanvasUtils.isExpandedSupernode(e)?" d3-node-supernode-expanded":"",i=this.config.enableEditingActions?" d3-draggable":" d3-non-draggable";return"d3-node-group"+n+(e.isResized?" d3-resized":"")+i+t}},{key:"setDisplayOrder",value:function(e){var t=this;e.filter((function(e){return t.hasOneDecorationOrMore(e)})).lower(),e.filter((function(e){return!t.hasOneDecorationOrMore(e)})).lower(),this.config.enableLinkSelection!==l.LINK_SELECTION_HANDLES&&this.config.enableLinkSelection!==l.LINK_SELECTION_DETACHABLE||this.raiseSelectedLinksToTop()}},{key:"raiseNodeToTop",value:function(e){null!==this.drawingNewLinkData||this.dragging||0!==this.getSelectedLinks().length||e.raise()}},{key:"raiseSelectedLinksToTop",value:function(){this.nodesLinksGrp.selectAll(".d3-link-group[data-selected]").raise()}},{key:"raiseLinkToTop",value:function(e){gr.select(e).raise()}},{key:"lowerLinkToBottom",value:function(e){gr.select(e).lower()}},{key:"hasOneDecorationOrMore",value:function(e){return e.decorations&&e.decorations.length>0}},{key:"isLinkBeingDragged",value:function(e){return this.draggingLinkData&&this.draggingLinkData.link.id===e.id}},{key:"buildLinksArray",value:function(){var e=this,t=[];return this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT&&this.updateLinksForNodes(),this.activePipeline.links.forEach((function(n){var i=null;(i=!(e.config.enableLinkSelection===l.LINK_SELECTION_HANDLES&&e.isLinkBeingDragged(n)||e.config.enableLinkSelection===l.LINK_SELECTION_DETACHABLE)||n.srcObj&&n.trgNode?e.getAttachedLineObj(n):e.getDetachedLineObj(n))&&t.push(i)})),this.canvasLayout.linkType===l.LINK_TYPE_ELBOW&&(t=this.addMinInitialLineForElbow(t)),t=this.linkUtils.addConnectionPaths(t)}},{key:"getAttachedLineObj",value:function(e){var t=e.srcObj,n=e.trgNode;if(t||this.logger.error("Common Canvas error trying to draw a link. A link was specified for source ID '"+e.srcNodeId+"' in the Canvas data that does not have a valid source node/comment."),n||this.logger.error("Common Canvas error trying to draw a link. A link was specified for target ID '"+e.trgNodeId+"' in the Canvas data that does not have a valid target node."),t&&n&&this.shouldDisplayLink(t,n,e.type)){var i=this.getSourcePortId(e,t),o=this.getTargetPortId(e,n),a=e.type===l.ASSOCIATION_LINK&&this.config.enableAssocLinkType===l.ASSOC_RIGHT_SIDE_CURVE?this.getAssocLinkVariation(t,n):null,r=this.linkUtils.getLinkCoords(e,t,i,n,o,a);return e.assocLinkVariation=a,e.srcPortId=i,e.trgPortId=o,e.x1=r.x1,e.y1=r.y1,e.x2=r.x2,e.y2=r.y2,e.originX=r.originX,e.originY=r.originY,e}return null}},{key:"getDetachedLineObj",value:function(e){var t=e.srcObj,n=e.trgNode,i=null,o=null,a={};if(t)if(this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT){var r={x:e.trgPos.x_pos,y:e.trgPos.y_pos},s=this.linkUtils.getNewStraightNodeLinkStartPos(t,r,e.srcOriginInfo);a.x1=s.x,a.y1=s.y,a.originX=s.originX,a.originY=s.originY}else{i=this.getSourcePortId(e,t);var c=this.getOutputPort(t,i);c&&(a.x1=t.x_pos+c.cx,a.y1=t.y_pos+c.cy)}else a.x1=e.srcPos.x_pos,a.y1=e.srcPos.y_pos;if(n)if(this.canvasLayout.linkType===l.LINK_TYPE_STRAIGHT){var u={x:e.srcPos.x_pos,y:e.srcPos.y_pos},d=this.linkUtils.getNewStraightNodeLinkStartPos(n,u,e.trgOriginInfo);a.x2=d.x,a.y2=d.y}else{o=this.getTargetPortId(e,n);var h=this.getInputPort(n,o);h&&(a.x2=n.x_pos+h.cx,a.y2=n.y_pos+h.cy)}else a.x2=e.trgPos.x_pos,a.y2=e.trgPos.y_pos;return e.srcPortId=i,e.trgPortId=o,e.x1=a.x1,e.y1=a.y1,e.x2=a.x2,e.y2=a.y2,e.originX=a.originX,e.originY=a.originY,e}},{key:"getOutputPort",value:function(e,t){return e&&e.outputs?e.outputs.find((function(e){return e.id===t})):null}},{key:"getInputPort",value:function(e,t){return e&&e.inputs?e.inputs.find((function(e){return e.id===t})):null}},{key:"getSourcePortId",value:function(e,t){return e.srcNodePortId?e.srcNodePortId:t.outputs&&t.outputs.length>0?t.outputs[0].id:null}},{key:"getTargetPortId",value:function(e,t){return e.trgNodePortId?e.trgNodePortId:t.inputs&&t.inputs.length>0?t.inputs[0].id:null}},{key:"shouldDisplayLink",value:function(e,t,n){return!1!==this.canvasLayout.displayLinkOnOverlap||!this.areLinkedObjectsOverlapping(e,t,n)}},{key:"areLinkedObjectsOverlapping",value:function(e,t,n){var i=n===l.COMMENT_LINK?this.canvasLayout.commentHighlightGap:e.layout.nodeHighlightGap,o=t.layout.nodeHighlightGap,a=e.x_pos-i,r=e.x_pos+e.width+i,s=t.x_pos-o,c=t.x_pos+t.width+o,u=e.y_pos-i,d=e.y_pos+e.height+i,h=t.y_pos-o,p=t.y_pos+t.height+o;return r>=s&&c>=a&&d>=h&&p>=u}},{key:"addMinInitialLineForElbow",value:function(e){var t=this;return this.activePipeline.nodes.forEach((function(n){if(n.outputs&&n.outputs.length>1){var i=t.getNodeOutputLinks(n,e),o=t.sortNodeOutputLinks(i);t.applyMinInitialLine(n,o)}})),e}},{key:"getNodeOutputLinks",value:function(e,t){var n=[];return t.forEach((function(t){t.srcObj&&t.srcObj.id===e.id&&n.push(t)})),n}},{key:"sortNodeOutputLinks",value:function(e){var t=this;return e.sort((function(e,n){var i,o;return t.canvasLayout.linkDirection===l.LINK_DIR_LEFT_RIGHT?(i=Math.abs(e.y1-e.y2),o=Math.abs(n.y1-n.y2)):(i=Math.abs(e.x1-e.x2),o=Math.abs(n.x1-n.x2)),i===o?t.canvasLayout.linkDirection===l.LINK_DIR_LEFT_RIGHT?e.y1<e.y2?1:-1:e.x1<e.x2?1:-1:i<o?1:-1}))}},{key:"applyMinInitialLine",value:function(e,t){var n=e.layout.minInitialLine;t.forEach((function(e){e.minInitialLineForElbow=n,n+=e.srcObj.layout.minInitialLineIncrement}))}},{key:"updateLinksForNodes",value:function(){var e=this;this.activePipeline.nodes.forEach((function(t){return e.updateLinksForNode(t)}))}},{key:"updateLinksForNode",value:function(e){var t=this,n={n:[],s:[],e:[],w:[]};this.activePipeline.links.forEach((function(i){if(i.type===l.NODE_LINK)if(i.trgNode&&i.trgNode.id===e.id){if(i.srcObj){var o=t.getDirAdjusted(i.trgNode,i.srcObj);n[o].push({type:"in",endNode:i.srcObj,link:i})}else if(i.srcPos){var a=t.getDirToEndPos(i.trgNode,i.srcPos.x_pos,i.srcPos.y_pos);n[a].push({type:"in",x:i.srcPos.x_pos,y:i.srcPos.y_pos,link:i})}}else if(i.srcObj&&i.srcObj.id===e.id)if(i.trgNode){var r=t.getDirAdjusted(i.srcObj,i.trgNode);n[r].push({type:"out",endNode:i.trgNode,link:i})}else if(i.trgPos){var s=t.getDirToEndPos(i.srcObj,i.trgPos.x_pos,i.trgPos.y_pos);n[s].push({type:"out",x:i.trgPos.x_pos,y:i.trgPos.y_pos,link:i})}})),n.n=this.sortLinksInfo(n.n,l.NORTH),n.s=this.sortLinksInfo(n.s,l.SOUTH),n.e=this.sortLinksInfo(n.e,l.EAST),n.w=this.sortLinksInfo(n.w,l.WEST),this.updateLinksInfo(n.n,l.NORTH),this.updateLinksInfo(n.s,l.SOUTH),this.updateLinksInfo(n.e,l.EAST),this.updateLinksInfo(n.w,l.WEST)}},{key:"getDirAdjusted",value:function(e,t){var n=this.getDirToNode(e,t);if(n===l.SOUTH)this.getDirToNode(t,e)===l.WEST&&(n=l.EAST);else if(n===l.NORTH){this.getDirToNode(t,e)===l.EAST&&(n=l.WEST)}return n}},{key:"getDirToNode",value:function(e,t){var n=this.nodeUtils.getNodeCenterPosX(t),i=this.nodeUtils.getNodeCenterPosY(t);return this.getDirToEndPos(e,n,i)}},{key:"getDirToEndPos",value:function(e,t,n){var i=this.nodeUtils.getNodeCenterPosX(e),o=this.nodeUtils.getNodeCenterPosY(e),a=e.x_pos,r=e.y_pos,s=e.width,l=e.height;return f.CanvasUtils.getDir(a,r,s,l,i,o,t,n)}},{key:"sortLinksInfo",value:function(e,t){var n=this,i=e;if(i.length>1){var o=this.getLinkInfoGroups(i);Cn(o,(function(e){e.forEach((function(i,o){var a=i.endNode,r=e.length+1;t===l.NORTH||t===l.SOUTH?(i.x=a.x_pos+a.width/r*(o+1),i.y=n.nodeUtils.getNodeCenterPosY(a)):(i.x=n.nodeUtils.getNodeCenterPosX(a),i.y=a.y_pos+a.height/r*(o+1))}))})),i=t===l.NORTH||t===l.SOUTH?i.sort((function(e,t){return e.x>t.x?1:-1})):i.sort((function(e,t){return e.y>t.y?1:-1}))}return i}},{key:"getLinkInfoGroups",value:function(e){var t={};return e.forEach((function(e){e.endNode&&(t[e.endNode.id]||(t[e.endNode.id]=[]),t[e.endNode.id].push(e))})),t}},{key:"updateLinksInfo",value:function(e,t){e.forEach((function(n,i){"out"===n.type?n.link.srcOriginInfo={dir:t,idx:i,len:e.length}:n.link.trgOriginInfo={dir:t,idx:i,len:e.length}}))}},{key:"getNewLinkAssocVariation",value:function(e,t,n){return"input"===n&&e>t?l.ASSOC_VAR_CURVE_LEFT:"output"===n&&e<t?l.ASSOC_VAR_CURVE_RIGHT:l.ASSOC_VAR_DOUBLE_BACK_RIGHT}},{key:"getAssocLinkVariation",value:function(e,t){var n=e.layout.minInitialLine;return t.x_pos>=e.x_pos+e.width+n?l.ASSOC_VAR_CURVE_RIGHT:e.x_pos>=t.x_pos+t.width+n?l.ASSOC_VAR_CURVE_LEFT:l.ASSOC_VAR_DOUBLE_BACK_RIGHT}},{key:"getPortArrowPath",value:function(e){return"M -2 3 L 2 0 -2 -3"}},{key:"getPortArrowPathTransform",value:function(e){var t=this.getAngleBasedOnLinkDirection();return"translate(".concat(e.cx,", ").concat(e.cy,") rotate(").concat(t,")")}},{key:"getArrowHead",value:function(e){return e.type===l.COMMENT_LINK?"string"==typeof this.canvasLayout.commentLinkArrowHead?this.canvasLayout.commentLinkArrowHead:"M -8 3 L 0 0 -8 -3":"string"==typeof this.canvasLayout.dataLinkArrowHead?this.canvasLayout.dataLinkArrowHead:"M -6 6 L 0 0 -6 -6"}},{key:"getArrowHeadTransform",value:function(e){var t=this.canvasLayout.linkType===l.LINK_TYPE_ELBOW?this.getAngleBasedOnLinkDirection():Math.atan2(e.y2-e.y1,e.x2-e.x1)*(180/Math.PI);return"translate(".concat(e.x2,", ").concat(e.y2,") rotate(").concat(t,")")}},{key:"getAngleBasedOnLinkDirection",value:function(){return this.canvasLayout.linkDirection===l.LINK_DIR_TOP_BOTTOM?90:this.canvasLayout.linkDirection===l.LINK_DIR_BOTTOM_TOP?-90:0}},{key:"getSelectedNodesAndComments",value:function(){var e=this,t=[];return this.activePipeline.nodes.forEach((function(n){e.objectModel.getSelectedObjectIds().includes(n.id)&&t.push(n)})),this.activePipeline.comments.forEach((function(n){e.objectModel.getSelectedObjectIds().includes(n.id)&&t.push(n)})),t}},{key:"getSelectedLinks",value:function(){var e=this,t=[];return this.activePipeline.links.forEach((function(n){e.objectModel.getSelectedObjectIds().includes(n.id)&&t.push(n)})),t}},{key:"canOpenTip",value:function(e){return this.canvasController.isTipEnabled(e)&&!this.selecting&&!this.regionSelect&&!this.dragging&&!this.commentSizing&&!this.nodeSizing&&!this.drawingNewLinkData}},{key:"getDefaultCommentOffset",value:function(){var e=this.canvasLayout.addCommentOffsetX,t=this.canvasLayout.addCommentOffsetY;return this.zoomTransform&&(e=this.zoomTransform.x/this.zoomTransform.k,t=this.zoomTransform.y/this.zoomTransform.k,e=-e+this.canvasLayout.addCommentOffsetX,t=-t+this.canvasLayout.addCommentOffsetY),this.config.enableSnapToGridType===l.SNAP_TO_GRID_DURING||this.config.enableSnapToGridType===l.SNAP_TO_GRID_AFTER?this.snapToGridPosition({x:e,y:t}):{x:e,y:t}}},{key:"getFlags",value:function(){var e="Flags:";return this.dragging&&(e+=" dragging = true"),this.nodeSizing&&(e+=" nodeSizing = true"),this.commentSizing&&(e+=" commentSizing = true"),this.movingBindingNodes&&(e+=" movingBindingNodes = true"),this.selecting&&(e+=" selecting = true"),this.regionSelect&&(e+=" regionSelect = true"),"Flags:"===e&&(e+=" None"),e}}]),t}(),yr=function(){function t(n,i,o,a){e._classCallCheck(this,t),this.logger=new h.Logger(["SVGCanvasD3","FlowId",n.id]),this.logger.logStartTimer("constructor"),this.canvasController=a,this.canvasDiv=un(i),this.logger.logEndTimer("constructor",!0)}return e._createClass(t,[{key:"setCanvasInfo",value:function(e,t){if(this.logger=new h.Logger(["SVGCanvasD3","FlowId",e.id]),this.config&&this.renderer&&this.canvasInfo&&e.id===this.canvasInfo.id&&(!this.renderer||this.renderer.pipelineId===this.canvasController.getCurrentBreadcrumb().pipelineId)&&f.CanvasUtils$1.compareCanvasConfigs(this.config,t))this.logger.logStartTimer("set canvas info"),this.canvasInfo=this.cloneCanvasInfo(e),this.renderer.setCanvasInfoRenderer(this.canvasInfo),this.logger.logEndTimer("set canvas info",!0);else{this.logger.logStartTimer("initializing"),this.canvasInfo=this.cloneCanvasInfo(e),this.config=this.cloneConfig(t),this.renderer&&(this.renderer.clearCanvas(),this.renderer=null);var n=this.canvasController.getCurrentBreadcrumb();this.renderer=new vr(n.pipelineId,this.canvasDiv,this.canvasController,this.canvasInfo,t,{id:n.supernodeId,pipelineId:n.supernodeParentPipelineId}),this.logger.logEndTimer("initializing",!0)}}},{key:"cloneConfig",value:function(e){return Object.assign({},e)}},{key:"cloneCanvasInfo",value:function(e){return m.cloneDeep_1(e)}},{key:"isEditingText",value:function(){return this.renderer.isEditingText()}},{key:"isDragging",value:function(){return this.renderer.isDragging()}},{key:"convertPageCoordsToSnappedCanvasCoords",value:function(e){var t=this.renderer.convertPageCoordsToCanvasCoords(e.x,e.y);return t=this.renderer.getMousePosSnapToGrid(t)}},{key:"nodeTemplateDragStart",value:function(e){this.renderer.nodeTemplateDragStart(e)}},{key:"nodeTemplateDragOver",value:function(e,t,n){this.renderer.nodeTemplateDragOver(e,t,n)}},{key:"nodeTemplateDragEnd",value:function(e){this.renderer.nodeTemplateDragEnd(e)}},{key:"nodeTemplateDropped",value:function(e,t,n){this.renderer.nodeTemplateDropped(e,t,n)}},{key:"externalObjectDropped",value:function(e,t,n){this.renderer.externalObjectDropped(e,t,n)}},{key:"zoomTo",value:function(e){this.renderer.zoomTo(e)}},{key:"translateBy",value:function(e,t,n){this.renderer.translateBy(e,t,n)}},{key:"zoomIn",value:function(){this.renderer.zoomIn()}},{key:"zoomOut",value:function(){this.renderer.zoomOut()}},{key:"zoomToFit",value:function(){this.renderer.zoomToFit()}},{key:"isZoomedToMax",value:function(){return!!this.renderer&&this.renderer.isZoomedToMax()}},{key:"isZoomedToMin",value:function(){return!!this.renderer&&this.renderer.isZoomedToMin()}},{key:"getZoomToReveal",value:function(e,t,n){return this.renderer?this.renderer.getZoomToReveal(e,t,n):null}},{key:"getZoom",value:function(){return this.renderer?this.renderer.getZoom():null}},{key:"refreshOnSizeChange",value:function(){this.renderer&&this.renderer.refreshOnSizeChange()}},{key:"getDefaultCommentOffset",value:function(){return this.renderer.getDefaultCommentOffset()}},{key:"getTransformedViewportDimensions",value:function(){return this.renderer.getTransformedViewportDimensions()}},{key:"getGhostNode",value:function(e){return this.renderer.getGhostNode(e)}}]),t}();function mr(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Cr=function(n){t._inherits(o,n);var i=mr(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={isDropZoneDisplayed:!1},a.logger=new h.Logger("CC-Contents"),a.mainCanvasDivId="canvas-div-"+a.props.canvasController.getInstanceId(),a.svgCanvasDivId="d3-svg-canvas-div-"+a.props.canvasController.getInstanceId(),a.svgCanvasDivSelector="#"+a.svgCanvasDivId,a.dragX=null,a.dragY=null,a.eventListenersAdded=!1,a.mousePos={x:0,y:0},a.drop=a.drop.bind(t._assertThisInitialized(a)),a.focusOnCanvas=a.focusOnCanvas.bind(t._assertThisInitialized(a)),a.setIsDropZoneDisplayed=a.setIsDropZoneDisplayed.bind(t._assertThisInitialized(a)),a.dragOver=a.dragOver.bind(t._assertThisInitialized(a)),a.dragEnter=a.dragEnter.bind(t._assertThisInitialized(a)),a.dragLeave=a.dragLeave.bind(t._assertThisInitialized(a)),a.refreshOnSizeChange=a.refreshOnSizeChange.bind(t._assertThisInitialized(a)),a.getLabel=a.getLabel.bind(t._assertThisInitialized(a)),a.onCut=a.onCut.bind(t._assertThisInitialized(a)),a.onCopy=a.onCopy.bind(t._assertThisInitialized(a)),a.onPaste=a.onPaste.bind(t._assertThisInitialized(a)),a.onKeyDown=a.onKeyDown.bind(t._assertThisInitialized(a)),a.onMouseMove=a.onMouseMove.bind(t._assertThisInitialized(a)),a.first=!1,a.second=!1,a.afterUpdateCallbacks=[],n.canvasController.setCanvasContents(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"componentDidMount",value:function(){this.logger.log("componentDidMount"),this.svgCanvasD3=new yr(this.props.canvasInfo,this.svgCanvasDivSelector,this.props.canvasConfig,this.props.canvasController),this.svgCanvasD3.setCanvasInfo(this.props.canvasInfo,this.props.canvasConfig),this.props.canvasConfig.enableBrowserEditMenu&&this.addEventListeners(),this.focusOnCanvas()}},{key:"componentDidUpdate",value:function(){this.logger.log("componentDidUpdate"),this.svgCanvasD3&&!this.isDropZoneDisplayed()&&(this.svgCanvasD3.setCanvasInfo(this.props.canvasInfo,this.props.canvasConfig),this.afterUpdate()),this.props.canvasConfig.enableBrowserEditMenu?this.addEventListeners():this.removeEventListeners()}},{key:"componentWillUnmount",value:function(){this.removeEventListeners()}},{key:"onCut",value:function(e){e.currentTarget.activeElement.id===this.svgCanvasDivId&&this.props.canvasConfig.enableEditingActions&&(e.preventDefault(),this.props.canvasController.cutToClipboard())}},{key:"onCopy",value:function(e){e.currentTarget.activeElement.id===this.svgCanvasDivId&&this.props.canvasConfig.enableEditingActions&&(e.preventDefault(),this.props.canvasController.copyToClipboard())}},{key:"onPaste",value:function(e){e.currentTarget.activeElement.id===this.svgCanvasDivId&&this.props.canvasConfig.enableEditingActions&&(e.preventDefault(),this.props.canvasController.pasteFromClipboard())}},{key:"onKeyDown",value:function(e){this.props.canvasController.closeTip();var t=this.props.canvasController.getKeyboardConfig().actions;if(!this.svgCanvasD3.isEditingText()&&!this.svgCanvasD3.isDragging()){if(this.props.canvasConfig.enableEditingActions)if(8!==e.keyCode&&46!==e.keyCode||!t.delete){if(f.CanvasUtils.isCmndCtrlPressed(e)&&!e.shiftKey&&90===e.keyCode&&t.undo)f.CanvasUtils.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("undo");else if(f.CanvasUtils.isCmndCtrlPressed(e)&&(e.shiftKey&&90===e.keyCode||89===e.keyCode&&t.redo))f.CanvasUtils.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("redo");else if(f.CanvasUtils.isCmndCtrlPressed(e)&&67===e.keyCode&&t.copyToClipboard)f.CanvasUtils.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("copy");else if(f.CanvasUtils.isCmndCtrlPressed(e)&&88===e.keyCode&&t.cutToClipboard)f.CanvasUtils.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("cut");else if(f.CanvasUtils.isCmndCtrlPressed(e)&&86===e.keyCode&&t.pasteFromClipboard)if(f.CanvasUtils.stopPropagationAndPreventDefault(e),this.mousePos){var n=this.svgCanvasD3.convertPageCoordsToSnappedCanvasCoords(this.mousePos);this.props.canvasController.keyboardActionHandler("paste",n)}else this.props.canvasController.keyboardActionHandler("paste")}else f.CanvasUtils.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("deleteSelectedObjects");f.CanvasUtils.isCmndCtrlPressed(e)&&65===e.keyCode&&t.selectAll?(f.CanvasUtils.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("selectAll")):f.CanvasUtils.isCmndCtrlPressed(e)&&e.shiftKey&&e.altKey&&80===e.keyCode&&(f.CanvasUtils.stopPropagationAndPreventDefault(e),h.Logger.switchLoggingState())}}},{key:"onMouseMove",value:function(e){e.target&&e.target.className&&("svg-area"===e.target.className.baseVal||"d3-svg-background"===e.target.className.baseVal)?this.mousePos={x:e.clientX,y:e.clientY}:this.mousePos=null}},{key:"getLabel",value:function(e){return this.props.intl.formatMessage({id:e,defaultMessage:f.defaultMessages1[e]})}},{key:"getDNDJson",value:function(e){try{return JSON.parse(e.dataTransfer.getData(l.DND_DATA_TEXT))}catch(e){return this.logger.warn("The dragged object's data does not conform to the expected internal format: "+e),null}}},{key:"getSVGCanvasD3",value:function(){return this.svgCanvasD3}},{key:"getStateTag",value:function(){var e=null;return this.props.canvasConfig.enableStateTag!==l.STATE_TAG_READ_ONLY&&this.props.canvasConfig.enableStateTag!==l.STATE_TAG_LOCKED||(e=b.default.createElement(Ke,{stateTagType:this.props.canvasConfig.enableStateTag,canvasController:this.props.canvasController})),e}},{key:"getEmptyCanvas",value:function(){var e=null;return this.props.canvasController.isPrimaryPipelineEmpty()&&(e=this.props.canvasConfig.emptyCanvasContent?b.default.createElement("div",{className:"empty-canvas"},this.props.canvasConfig.emptyCanvasContent):b.default.createElement("div",{className:"empty-canvas"},b.default.createElement("div",{className:"empty-canvas-image"},b.default.createElement(y.FlowData16,null)),b.default.createElement("span",{className:"empty-canvas-text1"},this.getLabel("canvas.flowIsEmpty")),b.default.createElement("span",{className:"empty-canvas-text2"},this.getLabel("canvas.addNodeToStart")))),e}},{key:"getContextMenu",value:function(){return b.default.createElement(Be,{canvasController:this.props.canvasController,containingDivId:this.mainCanvasDivId})}},{key:"getTextToolbar",value:function(){return b.default.createElement(Xe,{canvasController:this.props.canvasController})}},{key:"getDropZone",value:function(){var e=null;return this.isDropZoneDisplayed()&&(e=this.props.canvasConfig.dropZoneCanvasContent?this.props.canvasConfig.dropZoneCanvasContent:b.default.createElement("div",null,b.default.createElement("div",{className:"dropzone-canvas"}),b.default.createElement("div",{className:"dropzone-canvas-rect"}))),e}},{key:"getSVGCanvasDiv",value:function(){return b.default.createElement("div",{tabIndex:"-1",className:"d3-svg-canvas-div",id:this.svgCanvasDivId,onKeyDown:this.onKeyDown})}},{key:"setIsDropZoneDisplayed",value:function(e){e!==this.state.isDropZoneDisplayed&&this.setState({isDropZoneDisplayed:e})}},{key:"isDropZoneDisplayed",value:function(){return this.props.canvasConfig.enableDropZoneOnExternalDrag&&this.state.isDropZoneDisplayed}},{key:"isDataTypeBeingDraggedFile",value:function(e){return!(!e.dataTransfer||!Array.isArray(e.dataTransfer.types))&&e.dataTransfer.types.includes("Files")}},{key:"afterUpdate",value:function(){this.afterUpdateCallbacks.forEach((function(e){return e()}))}},{key:"addAfterUpdateCallback",value:function(e){-1===this.afterUpdateCallbacks.findIndex((function(t){return t===e}))&&this.afterUpdateCallbacks.push(e)}},{key:"removeAfterUpdateCallback",value:function(e){var t=this.afterUpdateCallbacks.findIndex((function(t){return t===e}));t>-1&&this.afterUpdateCallbacks.splice(t,1)}},{key:"addEventListeners",value:function(){this.eventListenersAdded||(document.addEventListener("cut",this.onCut,!0),document.addEventListener("copy",this.onCopy,!0),document.addEventListener("paste",this.onPaste,!0),document.addEventListener("mousemove",this.onMouseMove,!0),this.eventListenersAdded=!0)}},{key:"removeEventListeners",value:function(){this.eventListenersAdded&&(document.removeEventListener("cut",this.onCut,!0),document.removeEventListener("copy",this.onCopy,!0),document.removeEventListener("paste",this.onPaste,!0),document.removeEventListener("mousemove",this.onMouseMove,!0),this.eventListenersAdded=!1)}},{key:"drop",value:function(e){if(e.preventDefault(),this.setIsDropZoneDisplayed(!1),this.first=!1,this.second=!1,this.props.canvasConfig.enableEditingActions){var t=this.props.canvasController.getDragNodeTemplate();if(t)this.svgCanvasD3.nodeTemplateDropped(t,e.clientX,e.clientY),this.props.canvasController.nodeTemplateDragEnd();else{var n=this.getDNDJson(e);n||(n={operation:"addToCanvas",data:{dataTransfer:e.dataTransfer,editType:"createFromExternalObject"}}),this.svgCanvasD3.externalObjectDropped(n,e.clientX,e.clientY)}}}},{key:"dragOver",value:function(e){if(Math.abs(this.dragX-e.clientX)>5||Math.abs(this.dragY-e.clientY)>5){this.dragX=e.clientX,this.dragY=e.clientY;var t=this.props.canvasController.getDragNodeTemplate();t&&this.svgCanvasD3.nodeTemplateDragOver(t,e.clientX,e.clientY)}}},{key:"dragEnter",value:function(e){this.dragX=null,this.dragY=null,this.isDataTypeBeingDraggedFile(e)&&(this.first?this.second=!0:(this.first=!0,this.setIsDropZoneDisplayed(!0))),e.preventDefault()}},{key:"dragLeave",value:function(e){this.isDataTypeBeingDraggedFile(e)&&(this.second?this.second=!1:this.first&&(this.first=!1),this.first||this.second||this.setIsDropZoneDisplayed(!1)),e.preventDefault()}},{key:"focusOnCanvas",value:function(){document.getElementById(this.svgCanvasDivId)&&document.getElementById(this.svgCanvasDivId).focus()}},{key:"refreshOnSizeChange",value:function(){this.svgCanvasD3&&this.svgCanvasD3.refreshOnSizeChange()}},{key:"render",value:function(){this.logger.log("render");var e=this.getStateTag(),t=this.getEmptyCanvas(),n=this.getContextMenu(),i=this.getTextToolbar(),o=this.getDropZone(),a=this.getSVGCanvasDiv(),r=this.props.canvasConfig.enableRightFlyoutUnderToolbar?"common-canvas-main":null,s=this.props.canvasConfig.enableRightFlyoutUnderToolbar?"common-canvas-drop-div-under-toolbar":"common-canvas-drop-div";return s="None"===this.props.canvasConfig.enableToolbarLayout?s+" common-canvas-toolbar-none":s,s=this.props.bottomPanelIsOpen?s+" common-canvas-bottom-panel-is-open":s,b.default.createElement("main",{"aria-label":this.getLabel("canvas.label"),role:"main",className:r},b.default.createElement(P.default,{handleWidth:!0,handleHeight:!0,onResize:this.refreshOnSizeChange},b.default.createElement("div",{id:this.mainCanvasDivId,className:s,onDrop:this.drop,onDragOver:this.dragOver,onDragEnter:this.dragEnter,onDragLeave:this.dragLeave},t,a,n,i,o,e)))}}]),o}(b.default.Component),kr=i.connect((function(e,t){return{canvasInfo:e.canvasinfo,canvasConfig:e.canvasconfig,bottomPanelIsOpen:e.bottompanel.isOpen,selectionInfo:e.selectioninfo,breadcrumbs:e.breadcrumbs}}))(o.injectIntl(Cr));function br(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Tr=function(n){t._inherits(o,n);var i=br(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).getLabel=a.getLabel.bind(t._assertThisInitialized(a)),a.toolbarActionHandler=a.toolbarActionHandler.bind(t._assertThisInitialized(a)),a.logger=new h.Logger("CC-Toolbar"),a}return e._createClass(o,[{key:"getLabel",value:function(e,t){var n=f.defaultMessages1[e]?f.defaultMessages1[e]:Fe[e];return this.props.intl.formatMessage({id:e,defaultMessage:n},t)}},{key:"getDefaultToolbar",value:function(){return{leftBar:[{action:"undo",label:this.getLabel("canvas.undo"),enable:!0},{action:"redo",label:this.getLabel("canvas.redo"),enable:!0},{action:"cut",label:this.getLabel("edit.cutSelection"),enable:!0},{action:"copy",label:this.getLabel("edit.copySelection"),enable:!0},{action:"paste",label:this.getLabel("edit.pasteSelection"),enable:!0},{action:"createAutoComment",label:this.getLabel("canvas.addComment"),enable:!0},{action:"deleteSelectedObjects",label:this.getLabel("canvas.deleteObject"),enable:!0}],rightBar:[{action:"zoomIn",label:this.getLabel("toolbar.zoomIn"),enable:!0},{action:"zoomOut",label:this.getLabel("toolbar.zoomOut"),enable:!0},{action:"zoomToFit",label:this.getLabel("toolbar.zoomToFit"),enable:!0}]}}},{key:"getConvertedLegacyToolbar",value:function(e){return{leftBar:e,rightBar:this.getDefaultRightBar()}}},{key:"getDefaultRightBar",value:function(){return[{action:"zoomIn",label:this.getLabel("toolbar.zoomIn"),enable:!0},{action:"zoomOut",label:this.getLabel("toolbar.zoomOut"),enable:!0},{action:"zoomToFit",label:this.getLabel("toolbar.zoomToFit"),enable:!0}]}},{key:"getNotificationClassName",value:function(){var e=this.props.canvasController.getNotificationMessagesMaxType(),t=l.NOTIFICATION_ICON_CLASS;return e===l.ERROR?t+=" error":e===l.WARNING?t+=" warning":e===l.SUCCESS?t+=" success":e===l.INFO&&(t+=" info"),t}},{key:"generateToolbarConfig",value:function(){var e=this.copyConfig();return e?Array.isArray(e)?e=this.getConvertedLegacyToolbar(e):void 0===e.rightBar&&(e.rightBar=this.getDefaultRightBar()):e=this.getDefaultToolbar(),e=Object.assign({},e,{leftBar:this.optionallyAddPaletteTool(e.leftBar||[])},{rightBar:this.optionallyAddNotificationTool(e.rightBar||[])})}},{key:"copyConfig",value:function(){if(!this.props.config)return null;if(Array.isArray(this.props.config))return u._toConsumableArray(this.props.config);var e={};return this.props.config.overrideAutoEnableDisable&&(e.overrideAutoEnableDisable=!0),this.props.config&&this.props.config.leftBar&&(e.leftBar=u._toConsumableArray(this.props.config.leftBar)),this.props.config&&this.props.config.rightBar&&(e.rightBar=u._toConsumableArray(this.props.config.rightBar)),e}},{key:"toolbarActionHandler",value:function(e){this.props.canvasController.toolbarActionHandler(e)}},{key:"optionallyAddPaletteTool",value:function(e){var t=this.getLabel("toolbar.palette"),n=e;return e&&e.length>0&&"palette"===e[0].action&&(t=e[0].label?e[0].label:t,n=e.slice(1),e.length>1&&e[1].divider&&(n=e.slice(2))),this.props.isPaletteEnabled?[{action:"togglePalette",label:t,enable:!0,iconTypeOverride:this.props.isPaletteOpen?"paletteClose":"paletteOpen"},{divider:!0}].concat(n):n}},{key:"optionallyAddNotificationTool",value:function(e){if(this.props.notificationConfig&&void 0!==this.props.notificationConfig.action&&void 0!==this.props.notificationConfig.enable){var t=this.props.notificationMessages.length,n=[{divider:!0},{action:l.TOOLBAR_TOGGLE_NOTIFICATION_PANEL,label:this.props.notificationConfig.label,enable:!0,isSelected:this.props.isNotificationOpen,className:this.getNotificationClassName(),textContent:t>9?"9+":t.toString()}];return e.concat(n)}return e}},{key:"configureToolbarButtonsState",value:function(e){if(!this.props.enableInternalObjectModel||e.overrideAutoEnableDisable)return e;if(void 0!==e){var t=this.props.enableEditingActions;this.applyToolState("undo",e,t&&this.props.canUndo),this.applyToolState("redo",e,t&&this.props.canRedo),this.applyToolState("cut",e,t&&this.props.canCutCopy),this.applyToolState("copy",e,t&&this.props.canCutCopy),this.applyToolState("paste",e,t&&this.props.canPaste),this.applyToolState("deleteSelectedObjects",e,t&&this.props.canDelete),this.applyToolState("createAutoComment",e,t),this.applyToolState("arrangeHorizontally",e,t),this.applyToolState("arrangeVertically",e,t),this.applyToolState("zoomIn",e,this.props.canZoomIn),this.applyToolState("zoomOut",e,this.props.canZoomOut),this.applyToolState("zoomToFit",e,this.props.canZoomToFit)}return e}},{key:"addUndoRedoCommandLabels",value:function(e){var t=this.props.undoLabel,n=this.props.redoLabel;if(t){var i=this.findTool("undo",e);i&&(i.label=this.getLabel("canvas.undoCommand",{undo_command:t}))}if(n){var o=this.findTool("redo",e);o&&(o.label=this.getLabel("canvas.redoCommand",{redo_command:n}))}return e}},{key:"applyToolState",value:function(e,t,n){var i=this.findTool(e,t);i?i.enable=n:this.logger.log("Toolbar tool "+e+" could not be found to set state to "+n)}},{key:"findTool",value:function(e,t){var n={};return t.leftBar&&(n=t.leftBar.find((function(t){return t.action===e}))),!n&&t.rightBar&&(n=t.rightBar.find((function(t){return t.action===e}))),n}},{key:"render",value:function(){this.logger.log("render");var e=this.generateToolbarConfig();e=this.configureToolbarButtonsState(e),e=this.addUndoRedoCommandLabels(e);var t=null;return this.props.enableToolbarLayout===l.TOOLBAR_LAYOUT_TOP&&(t=b.default.createElement("section",{"aria-label":this.getLabel("toolbar.label"),role:"toolbar"},b.default.createElement(c.Toolbar,{config:e,instanceId:this.props.canvasController.getInstanceId(),toolbarActionHandler:this.toolbarActionHandler,additionalText:{overflowMenuLabel:this.getLabel("toolbar.overflowMenu")}}))),t}}]),o}(b.default.Component),Pr=i.connect((function(e,t){return{enableToolbarLayout:e.canvasconfig.enableToolbarLayout,config:e.canvastoolbar.config,isPaletteEnabled:e.canvasconfig.enablePaletteLayout!==l.PALETTE_LAYOUT_NONE,isPaletteOpen:e.palette.isOpen,isNotificationOpen:e.notificationpanel.isOpen,notificationConfig:e.notificationpanel.config,notificationMessages:e.notifications,enableInternalObjectModel:e.canvasconfig.enableInternalObjectModel,enableEditingActions:e.canvasconfig.enableEditingActions,canUndo:t.canvasController.canUndo(),canRedo:t.canvasController.canRedo(),canCutCopy:t.canvasController.canCutCopy(),canPaste:t.canvasController.canPaste(),canDelete:t.canvasController.canDelete(),canZoomIn:t.canvasController.canZoomIn(),canZoomOut:t.canvasController.canZoomOut(),canZoomToFit:t.canvasController.canZoomToFit(),undoLabel:t.canvasController.getUndoLabel(),redoLabel:t.canvasController.getRedoLabel()}}))(o.injectIntl(Tr));function Lr(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var _r=function(n){t._inherits(o,n);var i=Lr(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).logger=new h.Logger("CC-RightFlyout"),n}return e._createClass(o,[{key:"render",value:function(){this.logger.log("render");var e=b.default.createElement("div",{className:"right-flyout-panel"});if(this.props.content&&this.props.isOpen){var t=this.props.enableRightFlyoutUnderToolbar?"right-flyout-panel under-toolbar":"right-flyout-panel";e=b.default.createElement("div",{className:t},this.props.content)}return e}}]),o}(b.default.Component),Nr=i.connect((function(e,t){return{isOpen:e.rightflyout.isOpen,content:e.rightflyout.content,enableRightFlyoutUnderToolbar:e.canvasconfig.enableRightFlyoutUnderToolbar}}))(_r);function xr(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var wr=function(n){t._inherits(o,n);var i=xr(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).logger=new h.Logger("CC-Bottom-Panel"),a.onMouseUp=a.onMouseUp.bind(t._assertThisInitialized(a)),a.onMouseDown=a.onMouseDown.bind(t._assertThisInitialized(a)),a.onMouseMoveY=a.onMouseMoveY.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"onMouseDown",value:function(e){0===e.button&&(document.addEventListener("mousemove",this.onMouseMoveY,!0),document.addEventListener("mouseup",this.onMouseUp,!0),this.posY=e.clientY,e.preventDefault())}},{key:"onMouseUp",value:function(e){document.removeEventListener("mousemove",this.onMouseMoveY,!0),document.removeEventListener("mouseup",this.onMouseUp,!0)}},{key:"onMouseMoveY",value:function(e){if(e.clientY){var t=e.clientY-this.posY,n=this.props.panelHeight-t;this.props.canvasController.setBottomPanelHeight(this.limitHeight(n)),this.posY=e.clientY}}},{key:"limitHeight",value:function(e){var t=document.getElementById(this.props.containingDivId),n=e;if(t){var i=t.getBoundingClientRect().height-100;n=Math.min(Math.max(n,75),i)}return n}},{key:"render",value:function(){this.logger.log("render");var e=null;if(this.props.bottomPanelIsOpen){var t=this.limitHeight(this.props.panelHeight)+"px";e=b.default.createElement("div",{className:"bottom-panel",style:{height:t}},b.default.createElement("div",{className:"bottom-panel-drag",onMouseDown:this.onMouseDown}),b.default.createElement("div",{className:"bottom-panel-contents"},this.props.bottomPanelContent))}return e}}]),o}(b.default.Component),Sr=i.connect((function(e,t){return{bottomPanelIsOpen:e.bottompanel.isOpen,bottomPanelContent:e.bottompanel.content,panelHeight:e.bottompanel.panelHeight}}))(wr);function Er(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Ir=function(n){t._inherits(o,n);var i=Er(o);function o(n){var a;return e._classCallCheck(this,o),(a=i.call(this,n)).state={},a.logger=new h.Logger("NotificationPanel"),a.handleNotificationPanelClickOutside=a.handleNotificationPanelClickOutside.bind(t._assertThisInitialized(a)),a.closeNotificationPanel=a.closeNotificationPanel.bind(t._assertThisInitialized(a)),a}return e._createClass(o,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleNotificationPanelClickOutside,!0)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleNotificationPanelClickOutside,!0)}},{key:"getNotifications",value:function(){var e=[];if(!this.props.messages)return e;for(var t=0;t<this.props.messages.length;t++){var n=this.props.messages[t],i=n.callback?" clickable ":"",o=n.type,a=b.default.createElement("div",{className:"notification-message-type"},b.default.createElement(r.Icon,{type:o,className:"notification-message-icon-".concat(o)})),s=n.title?b.default.createElement("div",{className:"notification-message-title"},n.title):null,l=n.subtitle?b.default.createElement("div",{className:"notification-message-subtitle"},n.subtitle,b.default.createElement("hr",null)):null,c=n.closeMessage?b.default.createElement("div",{className:"notification-message-close",onClick:this.deleteNotification.bind(this,n.id)},n.closeMessage):null,u=n.timestamp?b.default.createElement("div",{className:"notification-message-timestamp"},b.default.createElement("div",{className:"notification-message-timestamp-icon"},b.default.createElement(r.Icon,{type:"time"})),b.default.createElement("div",{className:"notification-message-string"},n.timestamp)):null;e.push(b.default.createElement("div",{className:"notifications-button-container",key:t+"-"+n.id},b.default.createElement("div",{className:"notifications "+i+n.type,onClick:this.notificationCallback.bind(this,n.id,n.callback)},a,b.default.createElement("div",{className:"notification-message-details"},s,l,b.default.createElement("div",{className:"notification-message-content"},n.content),u,c))))}return e}},{key:"handleNotificationPanelClickOutside",value:function(e){if(this.props.isNotificationOpen&&this.props.notificationConfig&&!this.props.notificationConfig.keepOpen){var t=document.getElementsByClassName(l.NOTIFICATION_ICON_CLASS)[0],n=document.getElementsByClassName("notification-panel-header")[0],i=document.getElementsByClassName("notification-panel-messages-container")[0];t&&!t.contains(e.target)&&n&&!n.contains(e.target)&&i&&!i.contains(e.target)&&(this.props.canvasController.toolbarActionHandler("closeNotificationPanel"),e.stopPropagation())}}},{key:"notificationCallback",value:function(e,t){t&&t(e)}},{key:"deleteNotification",value:function(e){this.props.canvasController.deleteNotificationMessages(e)}},{key:"clearNotificationMessages",value:function(){this.props.canvasController.clearNotificationMessages(),"function"==typeof this.props.notificationConfig.clearAllCallback&&this.props.notificationConfig.clearAllCallback()}},{key:"closeNotificationPanel",value:function(){this.props.canvasController.toolbarActionHandler("closeNotificationPanel")}},{key:"render",value:function(){if(this.logger.log("render"),!this.props.notificationConfig)return null;var e=this.props.isNotificationOpen?"":"panel-hidden",t=this.props.notificationConfig&&this.props.notificationConfig.notificationHeader?this.props.notificationConfig.notificationHeader:l.DEFAULT_NOTIFICATION_HEADER,n=this.props.notificationConfig&&this.props.notificationConfig.notificationSubtitle?b.default.createElement("div",{className:"notification-panel-subtitle"},this.props.notificationConfig.notificationSubtitle):null,i=this.props.messages.length>0?this.getNotifications():b.default.createElement("div",{className:"notification-panel-empty-message-container"},b.default.createElement("div",{className:"notification-panel-empty-message"},this.props.notificationConfig&&this.props.notificationConfig.emptyMessage?this.props.notificationConfig.emptyMessage:null)),o=this.props.notificationConfig&&this.props.notificationConfig.clearAllMessage?b.default.createElement("div",{className:"notification-panel-clear-all-container"},b.default.createElement(d.Button,{className:"notification-panel-clear-all",onClick:this.clearNotificationMessages.bind(this),kind:"ghost",size:"small",disabled:0===this.props.messages.length},this.props.notificationConfig.clearAllMessage)):null;return b.default.createElement("div",{className:"notification-panel-container "+e},b.default.createElement("div",{className:"notification-panel"},b.default.createElement("div",{className:"notification-panel-header-container"},b.default.createElement("div",{className:"notification-panel-header"},t,b.default.createElement(y.Close16,{className:"notification-panel-close-icon",onClick:this.closeNotificationPanel})),n),b.default.createElement("div",{className:"notification-panel-messages-container"},b.default.createElement("div",{className:"notification-panel-messages"},i),o)))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.messages!==t.messages?{messages:e.messages}:{}}}]),o}(b.default.Component),Dr=i.connect((function(e,t){return{notificationConfig:e.notificationpanel.config,isNotificationOpen:e.notificationpanel.isOpen,messages:e.notifications}}))(Ir);function Or(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Ar=function(n){t._inherits(o,n);var i=Or(o);function o(t){var n;return e._classCallCheck(this,o),(n=i.call(this,t)).logger=new h.Logger("CC-CentralItems"),n}return e._createClass(o,[{key:"render",value:function(){this.logger.log("render");var e=b.default.createElement(Nr,null),t=b.default.createElement(Pr,{canvasController:this.props.canvasController}),n=b.default.createElement(Dr,{canvasController:this.props.canvasController}),i=b.default.createElement(kr,{canvasController:this.props.canvasController}),o=b.default.createElement(Sr,{canvasController:this.props.canvasController,containingDivId:this.props.containingDivId});return this.props.enableRightFlyoutUnderToolbar?b.default.createElement("div",{className:"common-canvas-right-side-items-under-toolbar"},t,b.default.createElement("div",{id:this.props.containingDivId,className:"common-canvas-items-container-under-toolbar"},b.default.createElement("div",{className:"common-canvas-with-bottom-panel"},i,o),b.default.createElement("div",null,e),n)):b.default.createElement("div",{className:"common-canvas-right-side-items"},b.default.createElement("div",{id:this.props.containingDivId,className:"common-canvas-items-container"},t,i,o,n),e)}}]),o}(b.default.Component),Mr=i.connect((function(e,t){return{enableRightFlyoutUnderToolbar:e.canvasconfig.enableRightFlyoutUnderToolbar}}))(Ar);function zr(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,o=t._getPrototypeOf(e);if(n){var a=t._getPrototypeOf(this).constructor;i=Reflect.construct(o,arguments,a)}else i=o.apply(this,arguments);return t._possibleConstructorReturn(this,i)}}var Rr=function(n){t._inherits(a,n);var o=zr(a);function a(n){var i;return e._classCallCheck(this,a),(i=o.call(this,n)).logger=new h.Logger(["CommonCanvas"]),i.logger.log("constructor"),i.initializeController=i.initializeController.bind(t._assertThisInitialized(i)),i.containingDivId="common-canvas-items-container-"+n.canvasController.getInstanceId(),n.canvasController.setIntl(n.intl),i.initializeController(n),i}return e._createClass(a,[{key:"componentDidUpdate",value:function(){this.logger.log("componentDidUpdate"),this.initializeController(this.props)}},{key:"onDragOver",value:function(e){e.preventDefault()}},{key:"onDrop",value:function(e){e.preventDefault()}},{key:"initializeController",value:function(e){this.logger.logStartTimer("initializeController"),e.canvasController.setCanvasConfig(e.config),e.canvasController.setContextMenuConfig(e.contextMenuConfig),e.canvasController.setKeyboardConfig(e.keyboardConfig),e.canvasController.setToolbarConfig(e.toolbarConfig),e.canvasController.setNotificationPanelConfig(e.notificationConfig),e.canvasController.setRightFlyoutConfig({content:e.rightFlyoutContent,isOpen:e.showRightFlyout}),e.canvasController.setBottomPanelConfig({content:e.bottomPanelContent,isOpen:e.showBottomPanel}),e.canvasController.setHandlers({contextMenuHandler:e.contextMenuHandler,beforeEditActionHandler:e.beforeEditActionHandler,editActionHandler:e.editActionHandler,clickActionHandler:e.clickActionHandler,decorationActionHandler:e.decorationActionHandler,tipHandler:e.tipHandler,layoutHandler:e.layoutHandler,idGeneratorHandler:e.idGeneratorHandler,selectionChangeHandler:e.selectionChangeHandler,actionLabelHandler:e.actionLabelHandler}),this.logger.logEndTimer("initializeController")}},{key:"generateClass",value:function(){var e="common-canvas";return e+=this.isEditingAllowed()?"":" config-editing-actions-false",e+=this.props.config&&this.props.config.enableParentClass?" "+this.props.config.enableParentClass:""}},{key:"isEditingAllowed",value:function(){return this.props.config&&(void 0===this.props.config.enableEditingActions||!0===this.props.config.enableEditingActions)}},{key:"render",value:function(){this.logger.log("render");var e=b.default.createElement(He,{canvasController:this.props.canvasController}),t=b.default.createElement(Me,{canvasController:this.props.canvasController,containingDivId:this.containingDivId}),n=b.default.createElement(Mr,{canvasController:this.props.canvasController,containingDivId:this.containingDivId}),o=this.generateClass();return b.default.createElement(i.Provider,{store:this.props.canvasController.getStore()},b.default.createElement("div",{className:o,onDragOver:this.onDragOver,onDrop:this.onDrop},t,n,e))}}]),a}(b.default.Component),Hr=o.injectIntl(Rr);exports.commonCanvas=Hr;
|
|
2
|
+
//# sourceMappingURL=common-canvas-bcfe04ef.js.map
|