@elyra/canvas 13.44.0 → 13.45.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/ChevronRight-3d8ca494.js +2 -0
  2. package/dist/ChevronRight-3d8ca494.js.map +1 -0
  3. package/dist/ChevronRight-42b5629a.js +2 -0
  4. package/dist/ChevronRight-42b5629a.js.map +1 -0
  5. package/dist/Close-1b1822b0.js +2 -0
  6. package/dist/Close-1b1822b0.js.map +1 -0
  7. package/dist/Close-c707c8f7.js +2 -0
  8. package/dist/Close-c707c8f7.js.map +1 -0
  9. package/dist/Time-3da3c23b.js +2 -0
  10. package/dist/Time-3da3c23b.js.map +1 -0
  11. package/dist/Time-4b4e32e7.js +2 -0
  12. package/dist/Time-4b4e32e7.js.map +1 -0
  13. package/dist/canvas-controller-16cb4e8a.js +2 -0
  14. package/dist/{canvas-controller-897a5f51.js.map → canvas-controller-16cb4e8a.js.map} +1 -1
  15. package/dist/canvas-controller-bcb2b669.js +2 -0
  16. package/dist/{canvas-controller-42118244.js.map → canvas-controller-bcb2b669.js.map} +1 -1
  17. package/dist/common-canvas-175bb642.js +2 -0
  18. package/dist/common-canvas-175bb642.js.map +1 -0
  19. package/dist/common-canvas-86a290bd.js +2 -0
  20. package/dist/common-canvas-86a290bd.js.map +1 -0
  21. package/dist/common-canvas.cjs +1 -1
  22. package/dist/common-canvas.cjs.map +1 -1
  23. package/dist/common-canvas.js +1 -1
  24. package/dist/common-canvas.js.map +1 -1
  25. package/dist/common-properties-3860224b.js +2 -0
  26. package/dist/common-properties-3860224b.js.map +1 -0
  27. package/dist/common-properties-bb42fec5.js +2 -0
  28. package/dist/common-properties-bb42fec5.js.map +1 -0
  29. package/dist/{context-menu-wrapper-39831e91.js → context-menu-wrapper-0fdb9b4c.js} +2 -2
  30. package/dist/{context-menu-wrapper-39831e91.js.map → context-menu-wrapper-0fdb9b4c.js.map} +1 -1
  31. package/dist/{context-menu-wrapper-9f1b71a8.js → context-menu-wrapper-8933071e.js} +2 -2
  32. package/dist/{context-menu-wrapper-9f1b71a8.js.map → context-menu-wrapper-8933071e.js.map} +1 -1
  33. package/dist/flexible-table-8ce77a9c.js +2 -0
  34. package/dist/flexible-table-8ce77a9c.js.map +1 -0
  35. package/dist/flexible-table-e16bd245.js +2 -0
  36. package/dist/flexible-table-e16bd245.js.map +1 -0
  37. package/dist/index-0ad294bf.js +2 -0
  38. package/dist/index-0ad294bf.js.map +1 -0
  39. package/dist/index-37817c66.js +2 -0
  40. package/dist/index-37817c66.js.map +1 -0
  41. package/dist/keyboard-utils-81dcfd3f.js +2 -0
  42. package/dist/keyboard-utils-81dcfd3f.js.map +1 -0
  43. package/dist/keyboard-utils-d9b6ba48.js +2 -0
  44. package/dist/keyboard-utils-d9b6ba48.js.map +1 -0
  45. package/dist/lib/canvas-controller.cjs +1 -1
  46. package/dist/lib/canvas-controller.js +1 -1
  47. package/dist/lib/canvas.cjs +1 -1
  48. package/dist/lib/canvas.js +1 -1
  49. package/dist/lib/context-menu.cjs +1 -1
  50. package/dist/lib/context-menu.js +1 -1
  51. package/dist/lib/properties/field-picker.cjs +1 -1
  52. package/dist/lib/properties/field-picker.js +1 -1
  53. package/dist/lib/properties/flexible-table.cjs +1 -1
  54. package/dist/lib/properties/flexible-table.js +1 -1
  55. package/dist/lib/properties.cjs +1 -1
  56. package/dist/lib/properties.js +1 -1
  57. package/dist/styles/common-canvas.min.css +1 -1
  58. package/dist/styles/common-canvas.min.css.map +1 -1
  59. package/eslint.config.mjs +4 -2
  60. package/locales/common-canvas/locales/en.json +2 -0
  61. package/locales/common-canvas/locales/eo.json +2 -0
  62. package/package.json +3 -3
  63. package/rollup.config.js +15 -8
  64. package/src/common-canvas/canvas-controller.js +50 -24
  65. package/src/common-canvas/cc-toolbar.jsx +46 -1
  66. package/src/common-properties/components/table-toolbar/table-toolbar.jsx +12 -7
  67. package/src/common-properties/controls/abstract-table.jsx +5 -3
  68. package/src/common-properties/controls/expression/expression.scss +22 -7
  69. package/src/common-properties/controls/textarea/textarea.jsx +8 -2
  70. package/src/common-properties/controls/textfield/textfield.jsx +7 -1
  71. package/src/common-properties/properties-controller.js +12 -0
  72. package/src/common-properties/properties-main/properties-main.jsx +1 -0
  73. package/src/toolbar/toolbar-sub-menu.jsx +1 -1
  74. package/src/toolbar/toolbar.jsx +4 -1
  75. package/stats.html +1 -1
  76. package/types/canvas-controller.d.ts +60 -44
  77. package/types/common-properties.d.ts +7 -0
  78. package/dist/ChevronRight-362f2dfd.js +0 -2
  79. package/dist/ChevronRight-362f2dfd.js.map +0 -1
  80. package/dist/ChevronRight-f4724ce3.js +0 -2
  81. package/dist/ChevronRight-f4724ce3.js.map +0 -1
  82. package/dist/Close-00f026a1.js +0 -2
  83. package/dist/Close-00f026a1.js.map +0 -1
  84. package/dist/Close-3a206dc0.js +0 -2
  85. package/dist/Close-3a206dc0.js.map +0 -1
  86. package/dist/Time-b0f9a9cb.js +0 -2
  87. package/dist/Time-b0f9a9cb.js.map +0 -1
  88. package/dist/Time-e622883c.js +0 -2
  89. package/dist/Time-e622883c.js.map +0 -1
  90. package/dist/canvas-controller-42118244.js +0 -2
  91. package/dist/canvas-controller-897a5f51.js +0 -2
  92. package/dist/common-canvas-7e31f7ac.js +0 -2
  93. package/dist/common-canvas-7e31f7ac.js.map +0 -1
  94. package/dist/common-canvas-d4a073a3.js +0 -2
  95. package/dist/common-canvas-d4a073a3.js.map +0 -1
  96. package/dist/common-properties-3d129050.js +0 -2
  97. package/dist/common-properties-3d129050.js.map +0 -1
  98. package/dist/common-properties-d1008563.js +0 -2
  99. package/dist/common-properties-d1008563.js.map +0 -1
  100. package/dist/flexible-table-1b07a6ff.js +0 -2
  101. package/dist/flexible-table-1b07a6ff.js.map +0 -1
  102. package/dist/flexible-table-40f665e8.js +0 -2
  103. package/dist/flexible-table-40f665e8.js.map +0 -1
  104. package/dist/index-653a393b.js +0 -2
  105. package/dist/index-653a393b.js.map +0 -1
  106. package/dist/index-a6a232be.js +0 -2
  107. package/dist/index-a6a232be.js.map +0 -1
  108. package/dist/keyboard-utils-a23c5d52.js +0 -11
  109. package/dist/keyboard-utils-a23c5d52.js.map +0 -1
  110. package/dist/keyboard-utils-b5a20c84.js +0 -11
  111. package/dist/keyboard-utils-b5a20c84.js.map +0 -1
@@ -1,2 +0,0 @@
1
- import{_ as e,a as t,b as n}from"./createClass-a140e270.js";import{_ as i,a as o,b as r}from"./inherits-860188e5.js";import a from"react";import{connect as s,Provider as l}from"react-redux";import{injectIntl as c}from"react-intl";import{p as u,c as d,t as h,_ as p,S as g,i as f,a as v,n as y}from"./canvas-controller-42118244.js";import{d as m,T as b,c as k,C as x}from"./Close-3a206dc0.js";import{b as C}from"./datarecord-metadata-v3-schema-73031f6a.js";import{h as P,ad as L,ae as w,g as S,af as T,ag as N,ab as D,ah as O,ai as E,aj as I,ak as A,al as j,am as _,an as M,ao as z,ap as H,ac as F,aq as R,ar as B,as as G,at as U,au as W,av as V,aw as Z,ax as X,ay as Y,az as K,aA as q,aB as $,aC as J,aD as Q,aE as ee,aF as te,aG as ne,aH as ie,aI as oe,aJ as re,aK as ae,aL as se,aM as le,aN as ce,aO as ue,aP as de,aQ as he,aR as pe,aS as ge,aT as fe,aU as ve,aV as ye,aW as me,aX as be,aY as ke,aZ as xe,a_ as Ce,a$ as Pe,b0 as Le,b1 as we,b2 as Se,b3 as Te,b4 as Ne,b5 as De,b6 as Oe,b7 as Ee,b8 as Ie,b9 as Ae,ba as je,bb as _e,bc as Me,bd as ze,be as He,bf as Fe,bg as Re,bh as Be,bi as Ge,bj as Ue,bk as We,bl as Ve,bm as Ze,bn as Xe,bo as Ye,bp as Ke,G as qe,T as $e,bq as Je,br as Qe,bs as et,bt as tt,bu as nt}from"./common-canvas-utils-7ef1d091.js";import{AccordionItem as it,InlineLoading as ot,Search as rt,Accordion as at,Button as st}from"@carbon/react";import lt from"react-inlinesvg";import{c as ct,I as ut,i as dt,j as ht,K as pt}from"./keyboard-utils-a23c5d52.js";import{L as gt}from"./canvas-logger-3584cb6d.js";import{i as ft,t as vt}from"./isArrayLikeObject-8496ff7c.js";import{c as yt,_ as mt,t as bt,b as kt}from"./toInteger-ea444724.js";import xt from"./lib/tooltip.js";import{d as Ct,W as Pt,b as Lt,L as wt,I as St,c as Tt,T as Nt}from"./Time-e622883c.js";import{C as Dt,a as Ot}from"./context-menu-wrapper-9f1b71a8.js";import{c as Et}from"./en-dceabf36.js";import{_ as It}from"./defineProperty-f3298a15.js";import At from"markdown-it";import jt from"react-dom";function _t(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Mt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mt(e,t):void 0}}(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 r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function Mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function zt(e,t){var n=[];if(e.node_types){var i,o=_t(e.node_types);try{for(o.s();!(i=o.n()).done;){var r=i.value,a=Ht(r,e,t);a&&n.push({nodeType:r,category:e,occurrenceInfo:a})}}catch(e){o.e(e)}finally{o.f()}}return n}function Ht(e,t,n){if(n.length>0){var i=function(e,t){var n=P(e,"label")&&e.label?e.label.toLowerCase():"",i=Ft(n,t),o=i.occurrences,r=i.hitCounts;return{catLabelOccurrences:o,catLabelHitCounts:r}}(t,n),o=i.catLabelOccurrences,r=i.catLabelHitCounts,a=function(e,t){var n=P(e,"app_data.ui_data.label")&&e.app_data.ui_data.label?e.app_data.ui_data.label.toLowerCase():"",i=Ft(n,t),o=i.occurrences,r=i.hitCounts;return{nodeLabelOccurrences:o,nodeLabelHitCounts:r}}(e,n),s=a.nodeLabelOccurrences,l=a.nodeLabelHitCounts,c=function(e,t){var n=P(e,"app_data.ui_data.description")&&e.app_data.ui_data.description?e.app_data.ui_data.description.toLowerCase():"",i=Ft(n,t),o=i.occurrences,r=i.hitCounts;return{nodeDescOccurrences:o,nodeDescHitCounts:r}}(e,n),u=c.nodeDescOccurrences,d=c.nodeDescHitCounts;if(o.length>0||s.length>0||u.length>0){var h=function(e,t,n,i){for(var o=0,r=0,a=0;a<i;a++)o+=e[a]+10*t[a]+n[a],e[a]+t[a]+n[a]>0&&r++;return o+50*r}(r,l,d,n.length);return{catLabelOccurrences:o,nodeLabelOccurrences:s,nodeDescOccurrences:u,ranking:h}}}return null}function Ft(e,t){var n=[],i=[];return t.forEach(function(t){if(t){var o=function(e,t){var n=[],i=0,o=0,r=0;for(;o>-1&&r<20;)(o=e.indexOf(t,i))>-1&&(n.push({start:o,end:o+t.length}),i=o+t.length,r++);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 Rt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Rt=function(){return!!e})()}var Bt=c(function(n){function s(){return t(this,s),e=this,i=arguments,n=o(n=s),r(e,Rt()?Reflect.construct(n,i||[],o(e).constructor):n.apply(e,i));var e,n,i}return i(s,n),e(s,[{key:"render",value:function(){var e=this.props.intl.formatMessage({id:this.props.id,defaultMessage:u[this.props.id]});return a.createElement("div",{key:"l_btn",className:"palette-list-item-desc-button",onClick:this.props.onClick},e)}}])}(a.Component));const Gt=ut,Ut=dt;let Wt=a;Wt=ct.__toESM(Wt);let Vt=ht.exports;const Zt=Wt.default.forwardRef(function({children:e,size:t=16,...n},i){return 16===t||"16"===t||"16px"===t?Wt.default.createElement(Gt,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",...n},(0,Vt.jsx)("path",{d:"M8,1C4.1,1,1,4.1,1,8s3.1,7,7,7s7-3.1,7-7S11.9,1,8,1z M8,14c-3.3,0-6-2.7-6-6s2.7-6,6-6s6,2.7,6,6S11.3,14,8,14z"}),(0,Vt.jsx)("path",{d:"M7.5 4H8.5V9H7.5z"}),(0,Vt.jsx)("path",{d:"M8,10.2c-0.4,0-0.8,0.3-0.8,0.8s0.3,0.8,0.8,0.8c0.4,0,0.8-0.3,0.8-0.8S8.4,10.2,8,10.2z"}),e):Wt.default.createElement(Gt,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,Vt.jsx)("path",{d:"M16,2A14,14,0,1,0,30,16,14,14,0,0,0,16,2Zm0,26A12,12,0,1,1,28,16,12,12,0,0,1,16,28Z"}),(0,Vt.jsx)("path",{d:"M15 8H17V19H15z"}),(0,Vt.jsx)("path",{d:"M16,22a1.5,1.5,0,1,0,1.5,1.5A1.5,1.5,0,0,0,16,22Z"}),e)});"production"!==process.env.NODE_ENV&&(Zt.propTypes=Ut.iconPropTypes);var Xt=Zt,Yt="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",Kt="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%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 qt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(qt=function(){return!!e})()}var $t=function(s){function l(e){var n,i,a,s;return t(this,l),i=this,s=[e],a=o(a=l),(n=r(i,qt()?Reflect.construct(a,s||[],o(i).constructor):a.apply(i,s))).state={showFullDescription:!1},n.ghostData=null,n.showFullDescription=n.showFullDescription.bind(n),n.showShortDescription=n.showShortDescription.bind(n),n.onDragStart=n.onDragStart.bind(n),n.onDragEnd=n.onDragEnd.bind(n),n.onClick=n.onClick.bind(n),n.onDoubleClick=n.onDoubleClick.bind(n),n.onMouseOver=n.onMouseOver.bind(n),n.onMouseLeave=n.onMouseLeave.bind(n),n.onMouseDown=n.onMouseDown.bind(n),n.onKeyDown=n.onKeyDown.bind(n),n}return i(l,s),e(l,[{key:"onMouseDown",value:function(){this.props.canvasController.closeTip(),this.props.setFocusIndex&&this.props.setFocusIndex(),this.ghostData=this.props.canvasController.getGhostNode(this.props.nodeTypeInfo.nodeType)}},{key:"onDragStart",value:function(e){this.props.canvasController.closeTip(),this.props.canvasController.nodeTemplateDragStart(this.ghostData.nodeTemplate),e.dataTransfer.setData(L,""),this.ghostData&&e.dataTransfer.setDragImage(this.ghostData.element,this.ghostData.centerX,this.ghostData.centerY)}},{key:"onKeyDown",value:function(e){pt.createAutoNode(e)?(this.createAutoNode(!0),e.stopPropagation()):pt.createAutoNodeNoLink(e)?this.createAutoNode(!1):pt.nextNodeInCategory(e)&&this.props.nextNodeInCategory?this.props.nextNodeInCategory(e):pt.previousNodeInCategory(e)&&this.props.previousNodeInCategory?this.props.previousNodeInCategory(e):pt.tabFocusOutOfPalette(e)&&this.props.tabOut&&this.props.tabOut(e)}},{key:"onDragEnd",value:function(){this.props.canvasController.nodeTemplateDragEnd()}},{key:"onDoubleClick",value:function(){this.props.allowClickToAdd||this.createAutoNode(!0)}},{key:"onClick",value:function(e){this.props.allowClickToAdd&&this.createAutoNode(!0),e.stopPropagation()}},{key:"onMouseOver",value:function(e){this.props.isDisplaySearchResult||0!==e.buttons||this.displayTip()}},{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(e){return this.getHighlightedText(e,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);return n&&(this.state.showFullDescription?o.push(a.createElement(Bt,{id:"palette.flyout.search.less",onClick:this.showShortDescription})):o.push(a.createElement(Bt,{id:"palette.flyout.search.more",onClick:this.showFullDescription}))),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,r="",a=0;return i<n?(a=0,r=e.substring(a,n)+" ..."):o>n?(a=i,r="... "+e.substring(a,i+n)+" ...",a-=4):(a=e.length-n,r="... "+e.substring(a,e.length),a-=4),{abbrDesc:r,occurrences:t.map(function(e){return{start:e.start-a,end:e.end-a}})}}},{key:"getHighlightedText",value:function(e,t){if(!t||0===t.length)return[a.createElement("span",{key:"o"},e)];var n=[],i=0,o="";return t.forEach(function(r,s){o=e.substring(i,r.start),n.push(a.createElement("span",{key:"s"+s},o)),o=e.substring(r.start,r.end),n.push(a.createElement("mark",{key:"m"+s},o)),i=r.end,s===t.length-1&&r.end<e.length&&(o=e.substring(r.end),n.push(a.createElement("span",{key:"f"+s},o)))}),n}},{key:"getMainDivClass",value:function(){var e,t=null===(e=this.props.nodeTypeInfo)||void 0===e||null===(e=e.nodeType)||void 0===e||null===(e=e.app_data)||void 0===e||null===(e=e.ui_data)||void 0===e?void 0:e.palette_class_name,n=this.props.isDisplaySearchResult?"palette-list-item search-result":"palette-list-item";return n+=t?" "+t:"",n+=this.props.isPaletteWide?"":" palette-narrow"}},{key:"showFullDescription",value:function(){this.setState({showFullDescription:!0})}},{key:"showShortDescription",value:function(){this.setState({showFullDescription:!1})}},{key:"focus",value:function(){this.itemRef.current.focus(),this.displayTip()}},{key:"displayTip",value:function(){this.props.canvasController.closeTip();var e=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:w,targetObj:this.itemRef.current,nodeTemplate:e,category:this.props.nodeTypeInfo.category})}},{key:"isItemDisabled",value:function(){var e,t=null===(e=this.props.nodeTypeInfo.nodeType)||void 0===e||null===(e=e.app_data)||void 0===e||null===(e=e.ui_data)||void 0===e?void 0:e.palette_disabled;return!this.props.isEditingEnabled||t}},{key:"createAutoNode",value:function(e){this.props.createAutoNode&&!this.isItemDisabled()&&this.props.createAutoNode(this.props.nodeTypeInfo.nodeType,e)}},{key:"render",value:function(){var e,t=null,i=S(this.props,"nodeTypeInfo.nodeType.app_data.ui_data.label",""),o=this.isItemDisabled()?"false":"true",r=null,s=this.isItemDisabled();if(P(this.props.nodeTypeInfo.nodeType,"app_data.ui_data.image")){var l=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;l===T?l=Yt:l===N&&(l=Kt),"object"===n(l)&&a.isValidElement(l)?r=l:"string"==typeof l&&(r=l.endsWith(".svg")?a.createElement(lt,{src:l,className:"palette-list-item-icon",draggable:"false","aria-hidden":"true"}):a.createElement("img",{src:l,className:"palette-list-item-icon",draggable:"false",alt:""}))}i&&(this.props.isPaletteWide||!r?t=this.props.isDisplaySearchResult?this.getHighlightedLabel(i):a.createElement("span",null,i):this.props.isPaletteWide||(t=a.createElement("span",null,i)));var c=this.props.isShowRanking&&this.props.isDisplaySearchResult&&P(this.props.nodeTypeInfo,"occurrenceInfo.ranking")?a.createElement("span",null,this.props.nodeTypeInfo.occurrenceInfo.ranking):null;0===this.props.nodeTypeInfo.category.node_types.length&&this.props.nodeTypeInfo.category.empty_text&&(i=this.props.nodeTypeInfo.category.empty_text,this.props.isPaletteWide&&(t=a.createElement("span",null,i)),o="false",r=a.createElement(Xt,{className:"palette-list-item-icon-warning",draggable:"false"}));var u=this.getMainDivClass(),d=this.props.isDisplaySearchResult?a.createElement("div",{className:"palette-list-item-category-label"},this.getHighlightedCategoryLabel()):null,h=this.props.isDisplaySearchResult&&null!==(e=this.props)&&void 0!==e&&null!==(e=e.nodeTypeInfo)&&void 0!==e&&null!==(e=e.nodeType)&&void 0!==e&&null!==(e=e.app_data)&&void 0!==e&&null!==(e=e.ui_data)&&void 0!==e&&e.description?a.createElement("div",{className:"palette-list-item-description"},this.getHighlightedDesc()):null,p=t?a.createElement("div",{className:"palette-list-item-text-div"},t):null;return this.itemRef=a.createRef(),a.createElement("div",{ref:this.itemRef,"data-id":this.props.nodeTypeInfo.nodeType.op,tabIndex:this.props.tabIndex,role:"button","aria-disabled":s,draggable:o,className:u,onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave,onKeyDown:this.props.isEditingEnabled?this.onKeyDown:null,onMouseDown:this.props.isEditingEnabled?this.onMouseDown:null,onDragStart:this.props.isEditingEnabled?this.onDragStart:null,onDragEnd:this.props.isEditingEnabled?this.onDragEnd:null,onClick:this.props.isEditingEnabled?this.onClick:null,onDoubleClick:this.props.isEditingEnabled?this.onDoubleClick:null},d,a.createElement("div",{className:"palette-list-item-icon-and-text"},r,p,c),h)}}])}(a.Component),Jt=$t;function Qt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Qt=function(){return!!e})()}var en=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,Qt()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).currentFocusIndex=0,n.contentItemRefs=[],n.nextNodeInCategory=n.nextNodeInCategory.bind(n),n.previousNodeInCategory=n.previousNodeInCategory.bind(n),n}return i(s,n),e(s,[{key:"setFirstNode",value:function(){this.currentFocusIndex=0,this.contentItemRefs[this.currentFocusIndex].current.focus()}},{key:"setFocusIndex",value:function(e){this.currentFocusIndex=e}},{key:"nextNodeInCategory",value:function(e){this.currentFocusIndex++,this.currentFocusIndex>this.contentItemRefs.length-1&&(this.currentFocusIndex=0),this.contentItemRefs[this.currentFocusIndex].current.focus(),D.stopPropagationAndPreventDefault(e)}},{key:"previousNodeInCategory",value:function(e){this.currentFocusIndex--,this.currentFocusIndex<0&&(this.currentFocusIndex=this.contentItemRefs.length-1),this.contentItemRefs[this.currentFocusIndex].current.focus(),D.stopPropagationAndPreventDefault(e)}},{key:"render",value:function(){var e=[];if(this.contentItemRefs=[],this.props.category&&this.props.category.node_types&&0===this.props.category.node_types.length&&this.props.category.empty_text)e.push(a.createElement("div",{key:"item_empty"},a.createElement(Jt,{tabIndex:0,nodeTypeInfo:{nodeType:{},category:this.props.category},isDisplaySearchResult:!1,canvasController:this.props.canvasController,allowClickToAdd:this.props.allowClickToAdd,isPaletteWide:this.props.isPaletteWide,isEditingEnabled:this.props.isEditingEnabled})));else for(var t=0;t<this.props.nodeTypeInfos.length;t++){var n="item_"+t,i=a.createRef();this.contentItemRefs.push(i),e.push(a.createElement(Jt,{ref:i,key:n,tabIndex:-1,nodeTypeInfo:this.props.nodeTypeInfos[t],isDisplaySearchResult:!1,canvasController:this.props.canvasController,isPaletteWide:this.props.isPaletteWide,isEditingEnabled:this.props.isEditingEnabled,nextNodeInCategory:this.nextNodeInCategory,previousNodeInCategory:this.previousNodeInCategory,setFocusIndex:this.setFocusIndex.bind(this,t),allowClickToAdd:this.props.allowClickToAdd,createAutoNode:this.props.createAutoNode}))}return a.createElement("div",{width:"100%",draggable:"false",className:"palette-content-list palette-scroll"},e)}}])}(a.Component);function tn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(tn=function(){return!!e})()}var nn=function(s){function l(e){var n,i,a,s;return t(this,l),i=this,s=[e],a=o(a=l),(n=r(i,tn()?Reflect.construct(a,s||[],o(i).constructor):a.apply(i,s))).onMouseOver=n.onMouseOver.bind(n),n.onMouseLeave=n.onMouseLeave.bind(n),n.onFocus=n.onFocus.bind(n),n.onKeyDownCategory=n.onKeyDownCategory.bind(n),n.onHeadingClick=n.onHeadingClick.bind(n),n.getTitleObj=n.getTitleObj.bind(n),n}return i(l,s),e(l,[{key:"onMouseOver",value:function(e){this.displayTip(e)}},{key:"onMouseLeave",value:function(){this.props.canvasController.closeTip()}},{key:"onFocus",value:function(e){this.displayTip(e)}},{key:"onKeyDownCategory",value:function(e){pt.openCategory(e)?(this.onHeadingClick(),D.stopPropagationAndPreventDefault(e)):this.props.category.is_open&&pt.fromCategoryToFirstNode(e)?(this.pclRef.current.setFirstNode(),D.stopPropagationAndPreventDefault(e)):pt.tabFocusOutOfPalette(e)&&this.props.tabOut&&this.props.tabOut(e)}},{key:"onHeadingClick",value:function(){this.props.category.is_open?this.props.canvasController.closePaletteCategory(this.props.category.id):this.props.canvasController.openPaletteCategory(this.props.category.id)}},{key:"getInlineLoadingRenderCategory",value:function(){var e="";this.props.isPaletteWide&&(e=this.props.category.loading_text);var t=a.createElement("div",{className:"palette-flyout-category"},a.createElement("div",{className:"palette-flyout-category-item-loading"},a.createElement(ot,{description:e,onSuccess:function(){return null},status:"active",successDelay:1500})));return a.createElement(it,{className:"palette-loading-category",title:t})}},{key:"getRenderCategory",value:function(){var e=this.getTitleObj(),t=this.getContent();return a.createElement(it,{title:e,open:this.props.category.is_open,onKeyDown:this.onKeyDownCategory,onFocus:this.onFocus,onHeadingClick:this.onHeadingClick},t)}},{key:"getTitleObj",value:function(){var e=this.getItemImage(),t=this.getItemText();return this.catRef=a.createRef(),a.createElement("div",{className:"palette-flyout-category",ref:this.catRef,"data-id":S(this.props.category,"id",""),value:this.props.category.label,onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave},a.createElement("div",{className:"palette-flyout-category-item",tabIndex:-1},e,t))}},{key:"getItemText",value:function(){var e=null;if(this.props.isPaletteWide){var t=this.props.category.image?"palette-flyout-category-text":"palette-flyout-category-text-no-image";e=a.createElement("span",{className:t},this.props.category.label)}else e=!this.props.category.image&&this.props.category.label&&this.props.category.label.length>0?a.createElement("span",{className:"palette-flyout-category-text-abbr"},this.props.category.label.substr(0,3)):a.createElement("span",{className:"palette-flyout-category-text-zero-size"},this.props.category.label);return e}},{key:"getItemImage",value:function(){var e=null;return this.props.category.image&&""!==this.props.category.image&&(e="object"===n(this.props.category.image)&&a.isValidElement(this.props.category.image)?this.props.category.image:this.props.category.image.endsWith(".svg")?a.createElement("div",null,a.createElement(lt,{src:this.props.category.image,className:"palette-flyout-category-item-icon",draggable:"false","aria-hidden":"true"})):a.createElement("div",null,a.createElement("img",{src:this.props.category.image,className:"palette-flyout-category-item-icon",draggable:"false",alt:this.props.category.label}))),e}},{key:"getContent",value:function(){var e=this;if(this.props.category.is_open){var t=this.props.category.node_types.map(function(t){return{nodeType:t,category:e.props.category}});return this.pclRef=a.createRef(),a.createElement(en,{ref:this.pclRef,key:this.props.category.id+"-nodes",category:this.props.category,nodeTypeInfos:t,canvasController:this.props.canvasController,allowClickToAdd:this.props.allowClickToAdd,isPaletteWide:this.props.isPaletteWide,isEditingEnabled:this.props.isEditingEnabled,createAutoNode:this.props.createAutoNode})}return null}},{key:"displayTip",value:function(){this.props.canvasController.closeTip(),this.props.canvasController.openTip({id:"paletteTip_"+this.props.category.id,type:O,targetObj:this.catRef.current,category:this.props.category})}},{key:"render",value:function(){return this.props.category.loading_text?this.getInlineLoadingRenderCategory():this.getRenderCategory()}}])}(a.Component);function on(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(on=function(){return!!e})()}var rn=c(function(n){function s(){var e,n,i,a;return t(this,s),n=this,i=o(i=s),(e=r(n,on()?Reflect.construct(i,a||[],o(n).constructor):i.apply(n,a))).state={searchString:""},e.searchOnClick=e.searchOnClick.bind(e),e.handleSearchStringChange=e.handleSearchStringChange.bind(e),e}return i(s,n),e(s,[{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.isPaletteWide||this.props.canvasController.openPalette()}},{key:"render",value:function(){var e=this.props.intl.formatMessage({id:"palette.flyout.search.placeholder",defaultMessage:u["palette.flyout.search.placeholder"]});return a.createElement("div",{className:"palette-flyout-search-container",id:"palette-flyout-search"},a.createElement(rt,{className:"palette-flyout-search",placeholder:e,onChange:this.handleSearchStringChange,size:"sm",value:this.state.searchString,labelText:e,onClick:this.searchOnClick}))}}])}(a.Component));function an(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(an=function(){return!!e})()}var sn=c(function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,an()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).state={},n.onKeyDownResults=n.onKeyDownResults.bind(n),n}return i(s,n),e(s,[{key:"onKeyDownResults",value:function(e){pt.tabFocusOutOfPalette(e)&&this.props.tabOutOfOfPalette(e)}},{key:"getNoResultsDiv",value:function(){var e=this.props.intl.formatMessage({id:"palette.flyout.search.noresults",defaultMessage:u["palette.flyout.search.noresults"]}),t=this.props.intl.formatMessage({id:"palette.flyout.search.adjustsearch",defaultMessage:u["palette.flyout.search.adjustsearch"]});return a.createElement("div",{tabIndex:0,onKeyDown:this.onKeyDownResults},a.createElement("div",{className:"palette-no-results-title"},e),a.createElement("br",null),a.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,i=t===this.props.nodeTypeInfos.length-1,o=!this.props.isNodeTypeInfosArrayTruncated;e.push(a.createElement("div",{key:n},a.createElement(Jt,{tabIndex:0,nodeTypeInfo:this.props.nodeTypeInfos[t],isDisplaySearchResult:!0,isShowRanking:this.props.isShowRanking,canvasController:this.props.canvasController,isPaletteWide:this.props.isPaletteWide,isEditingEnabled:this.props.isEditingEnabled,allowClickToAdd:this.props.allowClickToAdd,createAutoNode:this.props.createAutoNode,tabOut:i&&o?this.props.tabOutOfOfPalette:null})))}if(this.props.isNodeTypeInfosArrayTruncated){var r=this.props.intl.formatMessage({id:"palette.flyout.search.resultsrestricted",defaultMessage:u["palette.flyout.search.resultsrestricted"]});e.push(a.createElement("div",{key:"restrict-item",className:"palette-flyout-restrict-item",onKeyDown:this.onKeyDownResults},r))}return a.createElement("div",{width:"100%",draggable:"false",className:"palette-scroll"},e)}},{key:"render",value:function(){return 0===this.props.nodeTypeInfos.length?this.getNoResultsDiv():this.getContentListDiv()}}])}(a.Component));function ln(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return cn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cn(e,t):void 0}}(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 r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function cn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function un(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(un=function(){return!!e})()}var dn=new gt("PaletteFlyoutContent"),hn=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,un()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).state={searchString:""},n.categories=[],n.getUniqueCategories=n.getUniqueCategories.bind(n),n.setSearchString=n.setSearchString.bind(n),n.handleSearchStringChange=n.handleSearchStringChange.bind(n),n.setSearchStringThrottled=m(n.setSearchString,200),n}return i(s,n),e(s,[{key:"getUniqueCategories",value:function(e){var t=[];if(e){var n,i=ln(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(a.createElement("div",{key:i.label+"-container"},a.createElement(nn,{key:i.id,category:i,canvasController:this.props.canvasController,allowClickToAdd:this.props.allowClickToAdd,isPaletteWide:this.props.isPaletteWide,isEditingEnabled:this.props.isEditingEnabled,createAutoNode:this.props.createAutoNode,tabOut:n===e.length-1?this.props.tabOutOfOfPalette:null})))}return a.createElement(at,null,t)}},{key:"getFilteredContentDivs",value:function(e){dn.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,C(zt(e[o],i)));return n.sort(function(e,t){return e.occurrenceInfo.ranking<=t.occurrenceInfo.ranking?1:-1})}(this.categories,this.state.searchString);dn.logEndTimer("getFilteredNodeTypeInfos");var n=!1;return t.length>10&&(t=t.slice(0,10),n=!0),[a.createElement(sn,{key:"filtered-nodes",nodeTypeInfos:t,canvasController:this.props.canvasController,allowClickToAdd:this.props.allowClickToAdd,isPaletteWide:this.props.isPaletteWide,isEditingEnabled:this.props.isEditingEnabled,isNodeTypeInfosArrayTruncated:n,createAutoNode:this.props.createAutoNode,tabOutOfOfPalette:this.props.tabOutOfOfPalette})]}},{key:"setSearchString",value:function(){this.setState({searchString:this.ss})}},{key:"handleSearchStringChange",value:function(e){this.ss=e,this.setSearchStringThrottled(),this.props.isPaletteWide||this.props.canvasController.openPalette()}},{key:"render",value:function(){this.categories=this.getUniqueCategories(this.props.paletteJSON.categories);var e=this.props.isPaletteWide&&this.state.searchString?this.getFilteredContentDivs(this.categories):this.getContentDivs(this.categories),t=a.createElement("div",{className:"palette-flyout-categories",tabIndex:"-1"},e),n=a.createElement(rn,{canvasController:this.props.canvasController,handleSearchStringChange:this.handleSearchStringChange,isPaletteWide:this.props.isPaletteWide}),i=this.props.paletteHeader&&!this.state.searchString&&this.props.isPaletteWide?this.props.paletteHeader:null,o="palette-flyout-content";return o+=i?" with-palette-header":"",a.createElement("div",{className:o},n,i,t)}}])}(a.Component);function pn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(pn=function(){return!!e})()}var gn=c(function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,pn()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).paletteNodes=[],n}return i(s,n),e(s,[{key:"render",value:function(){var e="palette-flyout-div";this.props.isPaletteWide?e+=" palette-flyout-div-open":e+=" palette-flyout-div-narrow";var t=this.props.intl.formatMessage({id:"palette.flyout.label",defaultMessage:u["palette.flyout.label"]});return a.createElement("div",{role:"region","aria-label":t,className:"palette-nav"},a.createElement("div",{className:e},a.createElement(hn,{canvasController:this.props.canvasController,paletteJSON:this.props.paletteJSON,paletteHeader:this.props.paletteHeader,allowClickToAdd:this.props.allowClickToAdd,isEditingEnabled:this.props.isEditingEnabled,isPaletteWide:this.props.isPaletteWide,createAutoNode:this.props.createAutoNode,tabOutOfOfPalette:this.props.tabOutOfOfPalette})))}}])}(a.Component));function fn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(fn=function(){return!!e})()}var vn=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,fn()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).logger=new gt("Palette"),n.createAutoNode=n.createAutoNode.bind(n),n}return i(s,n),e(s,[{key:"createAutoNode",value:function(e,t){var n=this.props.canvasController.convertNodeTemplate(e);this.props.createAutoNode?this.props.createAutoNode(n,t):this.props.canvasController.createAutoNode&&this.props.canvasController.createAutoNode(n,t)}},{key:"render",value:function(){return this.logger.log("render"),a.createElement(gn,{canvasController:this.props.canvasController,paletteJSON:this.props.paletteJSON,paletteHeader:this.props.paletteHeader,allowClickToAdd:this.props.allowClickToAdd,isEditingEnabled:this.props.isEditingEnabled,isPaletteWide:this.props.isPaletteWide,createAutoNode:this.createAutoNode,tabOutOfOfPalette:this.props.tabOutOfOfPalette})}}])}(a.Component),yn=s(function(e,t){return{paletteJSON:e.palette.content,isEditingEnabled:e.canvasconfig.enableEditingActions,paletteHeader:e.canvasconfig.enablePaletteHeader,allowClickToAdd:e.canvasconfig.enableSingleClickAddFromPalette,isPaletteWide:e.canvasconfig.enablePaletteLayout===E||e.canvasconfig.enablePaletteLayout===I&&e.palette.isOpen}})(vn);const mn=ut,bn=dt;let kn=a;kn=ct.__toESM(kn);let xn=ht.exports;const Cn=kn.default.forwardRef(function({children:e,size:t=16,...n},i){return kn.default.createElement(mn,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,xn.jsx)("path",{d:"M16,2C8.2,2,2,8.2,2,16s6.2,14,14,14s14-6.2,14-14S23.8,2,16,2z M16,28C9.4,28,4,22.6,4,16S9.4,4,16,4s12,5.4,12,12 S22.6,28,16,28z"}),(0,xn.jsx)("path",{d:"M21.4 23 16 17.6 10.6 23 9 21.4 14.4 16 9 10.6 10.6 9 16 14.4 21.4 9 23 10.6 17.6 16 23 21.4z"}),e)});"production"!==process.env.NODE_ENV&&(Cn.propTypes=bn.iconPropTypes);var Pn=Cn;const Ln=ut,wn=dt;let Sn=a;Sn=ct.__toESM(Sn);let Tn=ht.exports;const Nn=Sn.default.forwardRef(function({children:e,size:t=16,...n},i){return Sn.default.createElement(Ln,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,Tn.jsx)("path",{d:"M12,4H6A2,2,0,0,0,4,6v6a2,2,0,0,0,2,2h6a2,2,0,0,0,2-2V6A2,2,0,0,0,12,4Zm0,8H6V6h6Z"}),(0,Tn.jsx)("path",{d:"M26,4H20a2,2,0,0,0-2,2v6a2,2,0,0,0,2,2h6a2,2,0,0,0,2-2V6A2,2,0,0,0,26,4Zm0,8H20V6h6Z"}),(0,Tn.jsx)("path",{d:"M12,18H6a2,2,0,0,0-2,2v6a2,2,0,0,0,2,2h6a2,2,0,0,0,2-2V20A2,2,0,0,0,12,18Zm0,8H6V20h6Z"}),(0,Tn.jsx)("path",{d:"M26,18H20a2,2,0,0,0-2,2v6a2,2,0,0,0,2,2h6a2,2,0,0,0,2-2V20A2,2,0,0,0,26,18Zm0,8H20V20h6Z"}),e)});"production"!==process.env.NODE_ENV&&(Nn.propTypes=wn.iconPropTypes);var Dn=Nn;const On=ut,En=dt;let In=a;In=ct.__toESM(In);let An=ht.exports;const jn=In.default.forwardRef(function({children:e,size:t=16,...n},i){return In.default.createElement(On,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,An.jsx)("path",{d:"M10 6H28V8H10z"}),(0,An.jsx)("path",{d:"M10 24H28V26H10z"}),(0,An.jsx)("path",{d:"M10 15H28V17H10z"}),(0,An.jsx)("path",{d:"M4 15H6V17H4z"}),(0,An.jsx)("path",{d:"M4 6H6V8H4z"}),(0,An.jsx)("path",{d:"M4 24H6V26H4z"}),e)});"production"!==process.env.NODE_ENV&&(jn.propTypes=En.iconPropTypes);var _n=jn;function Mn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Mn=function(){return!!e})()}var zn=c(function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,Mn()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).state={},n.mouseDown=n.mouseDown.bind(n),n.doubleClick=n.doubleClick.bind(n),n.toolbarActionHandler=n.toolbarActionHandler.bind(n),n}return i(s,n),e(s,[{key:"mouseDown",value:function(e){this.props.mouseDownMethod(e)}},{key:"doubleClick",value:function(e){this.props.windowMaximizeMethod(e)}},{key:"toolbarActionHandler",value:function(e){"close"===e?this.props.canvasController.closePalette():"grid"===e?this.props.showGridMethod(!0):"list"===e&&this.props.showGridMethod(!1)}},{key:"render",value:function(){var e=this.props.intl.formatMessage({id:"palette.dialog.grid"}),t=this.props.intl.formatMessage({id:"palette.dialog.list"}),n=this.props.intl.formatMessage({id:"palette.dialog.close"}),i={leftBar:[{action:"grid",label:e,iconEnabled:a.createElement(Dn,null),enable:!0,isSelected:this.props.showGrid},{action:"list",label:t,iconEnabled:a.createElement(_n,null),enable:!0,isSelected:!this.props.showGrid},{divider:!0}],rightBar:[{divider:!0},{action:"close",label:n,iconEnabled:a.createElement(Pn,null),enable:!0}]};return a.createElement("div",{className:"palette-dialog-topbar",onMouseDown:this.mouseDown,onDoubleClick:this.doubleClick},a.createElement(b,{instanceId:0,config:i,toolbarActionHandler:this.toolbarActionHandler,additionalText:{overflowMenuLabel:this.props.intl.formatMessage({id:"toolbar.overflowMenu"}),ariaLabel:this.props.intl.formatMessage({id:"toolbar.paletteDialogToolbarLabel"})}}))}}])}(a.Component));function Hn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Hn=function(){return!!e})()}var Fn=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,Hn()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).state={},n.categorySelected=n.categorySelected.bind(n),n}return i(s,n),e(s,[{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"),a.createElement("div",{"data-id":this.props.category.id,className:e,onClick:this.categorySelected},this.props.category.label)}}])}(a.Component);function Rn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Rn=function(){return!!e})()}var Bn=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,Rn()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).state={},n}return i(s,n),e(s,[{key:"render",value:function(){for(var e=[],t=0;t<this.props.categories.length;t++)e.push(a.createElement(Fn,{key:this.props.categories[t].label,category:this.props.categories[t],selectedCategory:this.props.selectedCategory,categorySelectedMethod:this.props.categorySelectedMethod}));return a.createElement("div",{className:"palette-dialog-categories palette-scroll"},e)}}])}(a.Component);function Gn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Gn=function(){return!!e})()}var Un=function(s){function l(e){var n,i,a,s;return t(this,l),i=this,s=[e],a=o(a=l),(n=r(i,Gn()?Reflect.construct(a,s||[],o(i).constructor):a.apply(i,s))).state={},n.ghostData=null,n.onDragStart=n.onDragStart.bind(n),n.onDragEnd=n.onDragEnd.bind(n),n.onClick=n.onClick.bind(n),n.onDoubleClick=n.onDoubleClick.bind(n),n.onMouseOver=n.onMouseOver.bind(n),n.onMouseLeave=n.onMouseLeave.bind(n),n.onMouseDown=n.onMouseDown.bind(n),n}return i(l,s),e(l,[{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.ghostData.nodeTemplate),e.dataTransfer.setData(L,""),this.ghostData&&e.dataTransfer.setDragImage(this.ghostData.element,this.ghostData.centerX,this.ghostData.centerY)}},{key:"onDragEnd",value:function(){this.props.canvasController.nodeTemplateDragEnd()}},{key:"onClick",value:function(){this.props.allowClickToAdd&&this.createAutoNode()}},{key:"onDoubleClick",value:function(){this.createAutoNode()}},{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:w,targetObj:e.currentTarget,nodeTemplate:t,category:this.props.category})}}},{key:"onMouseLeave",value:function(){this.props.canvasController.closeTip()}},{key:"createAutoNode",value:function(){if(this.props.canvasController.createAutoNode){var e=this.props.canvasController.convertNodeTemplate(this.props.nodeTemplate);this.props.canvasController.createAutoNode(e)}}},{key:"render",value:function(){var e="";P(this.props.nodeTemplate,"app_data.ui_data.label")&&(e=this.props.nodeTemplate.app_data.ui_data.label);var t=a.createElement("div",{className:"node-icon"});if(P(this.props.nodeTemplate,"app_data.ui_data.image")){var i=this.props.nodeTemplate.app_data.ui_data.image;i===T?i=Yt:i===N&&(i=Kt),"object"===n(i)&&a.isValidElement(i)?t=i:"string"==typeof i&&(t=i.endsWith(".svg")?a.createElement(lt,{src:i,className:"node-icon","aria-label":e}):a.createElement("img",{src:i,className:"node-icon",alt:e}))}var o=this.props.isEditingEnabled?"true":"false",r="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,o="false",r="palette-dialog-grid-node-text-warning",t=a.createElement(Xt,{className:"palette-dialog-grid-node-icon-warning",draggable:"false"})),a.createElement("div",{id:this.props.nodeTemplate.id,"data-id":this.props.nodeTemplate.op,draggable:o,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,onClick:this.props.isEditingEnabled?this.onClick:null,onDoubleClick:this.props.isEditingEnabled?this.onDoubleClick:null,className:"palette-dialog-grid-node-outer"},a.createElement("div",{className:"palette-dialog-grid-node-inner"},a.createElement("div",{className:"palette-dialog-grid-node-icon"},t),a.createElement("div",{className:r},e)))}}])}(a.Component),Wn=Un;function Vn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Vn=function(){return!!e})()}var Zn=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,Vn()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).state={},n}return i(s,n),e(s,[{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(a.createElement(Wn,{key:"pal_grid_node_empty",category:this.props.category,nodeTemplate:{},canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled,allowClickToAdd:this.props.allowClickToAdd}));else for(var t=0;t<this.props.nodeTypes.length;t++)e.push(a.createElement(Wn,{key:"pal_grid_node_"+t,category:this.props.category,nodeTemplate:this.props.nodeTypes[t],canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled,allowClickToAdd:this.props.allowClickToAdd}));return a.createElement("div",{width:"100%",className:"palette-scroll"},e)}}])}(a.Component);function Xn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Xn=function(){return!!e})()}var Yn=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,Xn()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).state={selectedCategory:""},n.categorySelected=n.categorySelected.bind(n),n.getUniqueCategories=n.getUniqueCategories.bind(n),n.getSelectedCategory=n.getSelectedCategory.bind(n),n}return i(s,n),e(s,[{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?a.createElement(Zn,{category:t,nodeTypes:n,canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled,allowClickToAdd:this.props.allowClickToAdd}):a.createElement(en,{category:t,nodeTypeInfos:i,canvasController:this.props.canvasController,isPaletteWide:!0,isEditingEnabled:this.props.isEditingEnabled,allowClickToAdd:this.props.allowClickToAdd});return a.createElement("div",{className:"palette-dialog-content"},a.createElement(Bn,{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}:{}}}])}(a.Component);function Kn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Kn=function(){return!!e})()}var qn=function(n){function s(e){var n,i,l,c;return t(this,s),i=this,c=[e],l=o(l=s),(n=r(i,Kn()?Reflect.construct(l,c||[],o(i).constructor):l.apply(i,c))).state={xPos:100,yPos:100,showGrid:!0},n.showGrid=n.showGrid.bind(n),n.mouseDownOnTopBar=n.mouseDownOnTopBar.bind(n),n.mouseDownOnPalette=n.mouseDownOnPalette.bind(n),n.mouseMove=n.mouseMove.bind(n),n.mouseUp=n.mouseUp.bind(n),n.windowResize=n.windowResize.bind(n),n.windowMaximize=n.windowMaximize.bind(n),n.getPaletteDiv=n.getPaletteDiv.bind(n),n.resizePalette=n.resizePalette.bind(n),n.movePalette=n.movePalette.bind(n),n.setResizingCursors=n.setResizingCursors.bind(n),n.setSizingHoverEdge=n.setSizingHoverEdge.bind(n),n.snapToWidth=n.snapToWidth.bind(n),n.snapToHeight=n.snapToHeight.bind(n),n.removePx=n.removePx.bind(n),n.dragging=!1,n.dragOffsetY=0,n.dragOffsetX=0,n.verticalSizingAction="",n.verticalSizingHover="",n.horizontalSizingAction="",n.horizontalSizingHover="",n.savedWidth=0,n.savedLeft=0,n.savedHeight=0,n.savedTop=0,n.hoverZoneSize=3,n.totalHoverZoneSize=2*n.hoverZoneSize,n.adjustedWidth=137,n.adjustedHeight=51,n.adjustedScrollBarWidth=15,n.isMaximized=!1,n.paletteNodes=[],n.dialogPaletteDivRef=a.createRef(),n.hackPaletteOffset=46,n.hackPaletteTopOffset=n.hackPaletteOffset+4,window.addEventListener("mousemove",n.mouseMove,!1),window.addEventListener("mouseup",n.mouseUp,!1),window.addEventListener("resize",n.windowResize,!1),n}return i(s,n),e(s,[{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(){var e;return null===(e=this.dialogPaletteDivRef)||void 0===e?void 0:e.current}},{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}},{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.containingDivId),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.containingDivId);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 r=this.getAdjustedMousePositionLeft(e,n),a=this.savedWidth-(r-this.savedLeft);a<=i?t.style.width=i+"px":(t.style.width=a+"px",t.style.left=r+"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.containingDivId);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 r=t.offsetHeight-this.totalHoverZoneSize;e.style.height=r+"px",this.setContentDivHeight(e,r)}else{if(e.offsetLeft+e.offsetWidth+this.hoverZoneSize>t.offsetLeft+t.offsetWidth){var a=t.offsetLeft+t.offsetWidth-e.offsetWidth-this.hoverZoneSize;e.style.left=a+"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.containingDivId);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.intl.formatMessage({id:"palette.dialog.label",defaultMessage:u["palette.dialog.label"]});return a.createElement("div",{role:"region","aria-label":e},a.createElement("div",{ref:this.dialogPaletteDivRef,className:"palette-dialog-div",onMouseDown:this.mouseDownOnPalette},a.createElement(zn,{mouseDownMethod:this.mouseDownOnTopBar,showGridMethod:this.showGrid,windowMaximizeMethod:this.windowMaximize,showGrid:this.state.showGrid,canvasController:this.props.canvasController}),a.createElement(Yn,{paletteJSON:this.props.paletteJSON,showGrid:this.state.showGrid,canvasController:this.props.canvasController,isEditingEnabled:this.props.isEditingEnabled,allowClickToAdd:this.props.allowClickToAdd})))}}])}(a.Component),$n=c(qn);function Jn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Jn=function(){return!!e})()}var Qn=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,Jn()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).logger=new gt("PaletteDialog"),n}return i(s,n),e(s,[{key:"render",value:function(){return this.logger.log("render"),a.createElement($n,{canvasController:this.props.canvasController,paletteJSON:this.props.paletteJSON,containingDivId:this.props.containingDivId,allowClickToAdd:this.props.allowClickToAdd,isEditingEnabled:this.props.isEditingEnabled})}}])}(a.Component),ei=s(function(e,t){return{paletteJSON:e.palette.content,allowClickToAdd:e.canvasconfig.enableSingleClickAddFromPalette,isEditingEnabled:e.canvasconfig.enableEditingActions}})(c(Qn));function ti(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ti=function(){return!!e})()}var ni=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,ti()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).state={},n.handleClick=n.handleClick.bind(n),n}return i(s,n),e(s,[{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 w:case O:t="right";break;default:t="bottom"}if(this.props.customContent)e=this.props.customContent;else switch(this.props.type){case w:e=a.createElement("div",{className:"tip-palette-item"},a.createElement("div",{className:"tip-palette-category"},this.props.category.label),a.createElement("div",{className:"tip-palette-label"},this.props.nodeTemplate.app_data.ui_data.label),this.props.nodeTemplate.app_data.ui_data.description?a.createElement("div",{className:"tip-palette-desc"},this.props.nodeTemplate.app_data.ui_data.description):"");break;case O:e=a.createElement("div",{className:"tip-palette-item"},a.createElement("div",{className:"tip-palette-label"},this.props.category.label),this.props.category.description?a.createElement("div",{className:"tip-palette-desc"},this.props.category.description):"");break;case z:var n=null;this.props.canvasController.getObjectModel().hasErrorMessage(this.props.node)?n=a.createElement(Ct,{className:yt("canvas-state-icon-error","tip-node-status","error")}):this.props.canvasController.getObjectModel().hasWarningMessage(this.props.node)&&(n=a.createElement(Pt,{className:yt("canvas-state-icon-warning","tip-node-status","warning")}));var i=this.props.canvasController.getObjectModel().getPaletteNode(this.props.node.op),o=this.props.node.label,r=i&&i.app_data&&i.app_data.ui_data?i.app_data.ui_data.label:o;if(o!==r&&(o+=" (".concat(r,")")),!(n||o||r||this.props.node.description))return null;e=a.createElement("div",{className:"tip-node"},n,a.createElement("div",{className:"tip-node-label"},o),this.props.node.description?a.createElement("div",{className:"tip-node-desc"},this.props.node.description):"");break;case M:e=ft(this.props.port.label)?null:a.createElement("div",{className:"tip-port"},this.props.port.label);break;case _:e=ft(this.props.decoration.tooltip)?null:a.createElement("div",{className:"tip-decoration"},this.props.decoration.tooltip);break;case j:break;case A:e=ft(this.props.stateTagText)?null:a.createElement("div",{className:"tip-state-tag"},this.props.stateTagText);break;default:e=null}return null!==e?a.createElement(xt,{tip:e,direction:t,id:this.props.id,targetObj:this.props.targetObj,mousePos:this.props.mousePos,className:[z,M,_,j].includes(this.props.type)?"definition-tooltip":null}):null}}])}(a.Component),ii=s(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}})(ni);function oi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(oi=function(){return!!e})()}var ri=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,oi()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).logger=new gt("CC-Context-Menu"),n}return i(s,n),e(s,[{key:"render",value:function(){this.logger.log("render");var e=null;return this.props.showContextMenu&&(e=a.createElement(Dt,{containingDivId:this.props.containingDivId,contextMenuDef:this.props.contextMenuDef,contextMenuActionHandler:this.props.canvasController.contextMenuActionHandler,contextMenuPos:this.props.contextMenuPos,closeContextMenu:this.props.canvasController.closeContextMenu,stopPropagation:!0})),e}}])}(a.Component),ai=s(function(e,t){return{contextMenuDef:e.contextmenu.menuDef,contextMenuPos:e.contextmenu.source.cmPos||{x:0,y:0},showContextMenu:e.contextmenu.isOpen}})(ri),si=vt,li=mt,ci=bt,ui=Math.max,di=Math.min;var hi=function(e,t,n){var i=null==e?0:e.length;if(!i)return-1;var o=i-1;return void 0!==n&&(o=ci(n),o=n<0?ui(i+o,0):di(o,i-1)),si(e,li(t),o,!0)};function pi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(pi=function(){return!!e})()}var gi=function(s){function l(e){var n,i,a,s;return t(this,l),i=this,s=[e],a=o(a=l),(n=r(i,pi()?Reflect.construct(a,s||[],o(i).constructor):a.apply(i,s))).logger=new gt("CC-Context-Toolbar"),n.onMouseEnter=n.onMouseEnter.bind(n),n.onMouseLeave=n.onMouseLeave.bind(n),n.toolbarActionHandler=n.toolbarActionHandler.bind(n),n.colorClicked=n.colorClicked.bind(n),n.closeContextToolbar=n.closeContextToolbar.bind(n),n}return i(l,s),e(l,[{key:"onMouseLeave",value:function(e){var t=this;this.props.canvasController.setMouseInContextToolbar(!1),setTimeout(function(){return t.props.canvasController.closeContextToolbar()},200)}},{key:"onMouseEnter",value:function(e){this.props.canvasController.setMouseInContextToolbar(!0)}},{key:"getToolbarConfig",value:function(e){var t=this,n=e.toolbarItems,i=e.overflowMenuItems,o=[];return n.forEach(function(e){return o.push(t.getMenuItem(e))}),i.forEach(function(e){return o.push(t.getMenuItem(e))}),{leftBar:o,rightBar:[]}}},{key:"getMenuItem",value:function(e){if(e.divider)return{divider:!0};var t=this.getSubPanelInfo(e),n=!t.subPanel&&e.menu?this.getSubMenu(e):null;return{action:e.action,label:e.label,subMenu:n,subPanel:t.subPanel,subPanelData:t.subPanelData,enable:this.getEnable(e),iconEnabled:e.icon}}},{key:"getSubPanelInfo",value:function(e){var t=this;return"colorBackground"===e.action?{subPanel:Ot,subPanelData:{clickActionHandler:function(e,n){return t.colorClicked(e,n)}}}:{}}},{key:"getSubMenu",value:function(e){var t=this;return"object"===n(e.menu)?e.menu.map(function(e){return e.divider?{divider:!0}:{action:e.action,label:e.label,enable:t.getEnable(e),iconEnabled:e.icon}}):null}},{key:"getEnable",value:function(e){return void 0===e.enable||e.enable}},{key:"getContextToolbarWidth",value:function(e,t){var n=e.filter(function(e){return e.divider}),i=n.length,o=1*i,r=t.length>0?1:0;return 34*(e.length+r-i)+o-(t.length>0?5:0)}},{key:"removeUnnecessaryDividers",value:function(e){var t=e.findIndex(function(e){return!e.divider}),n=hi(e,function(e){return!e.divider}),i=e.slice(t,n+1),o=[],r=!1;return i.forEach(function(e){e.divider?(r||o.push(e),r=!0):(o.push(e),r=!1)}),o}},{key:"toolbarActionHandler",value:function(e,t,n){this.closeContextToolbar(),this.props.canvasController.contextMenuActionHandler(e,t,n)}},{key:"closeContextToolbar",value:function(){this.props.canvasController.setMouseInContextToolbar(!1),this.props.canvasController.setMouseInObject(null),this.props.canvasController.closeContextToolbar(H)}},{key:"colorClicked",value:function(e,t){this.toolbarActionHandler("colorSelectedObjects",t,{color:e})}},{key:"shouldCenterJustifyToolbar",value:function(){var e=this.props.contextSource.type;return"link"===e||"canvas"===e||"input_port"===e||"output_port"===e||"node"===e&&"topCenter"===this.props.contextSource.targetObject.layout.contextToolbarPosition&&!this.props.contextSource.targetObject.is_expanded}},{key:"adjustPosToFit",value:function(e,t,n,i){var o=document.getElementById(this.props.containingDivId),r=o?o.getBoundingClientRect():{top:-1e3,bottom:1e3,left:-1e3,right:1e3},a=0,s=0,l=e,c=t,u=e+n-(r.right-r.left),d=a-e,h=t+i-(r.bottom-r.top),p=s-t;return u>0?l-=u+2:d>0&&(l+=d+2),h>0?c-=h+2:p>0&&(c+=p+2),{x:l,y:c}}},{key:"render",value:function(){this.logger.log("render");var e=null;if(this.props.showContextMenu){var t=this.props.contextMenuDef.filter(function(e){return e.toolbarItem}),n=this.props.contextMenuDef.filter(function(e){return!e.toolbarItem});n=this.removeUnnecessaryDividers(n);var i=this.getToolbarConfig({toolbarItems:t,overflowMenuItems:n}),o=this.getContextToolbarWidth(t,n),r=this.props.contextSource.cmPos||{x:0,y:0},s=this.shouldCenterJustifyToolbar()?r.x-o/2:r.x-o,l=r.y-34,c=this.adjustPosToFit(s,l,o,34);s=c.x,l=c.y;var u=this.props.contextSource.cause===H;e=a.createElement("div",{className:"context-toolbar floating-toolbar",style:{left:s,top:l,width:o},onMouseEnter:this.onMouseEnter,onMouseLeave:this.onMouseLeave},a.createElement(b,{config:i,instanceId:this.props.canvasController.getInstanceId(),containingDivId:this.props.containingDivId,toolbarActionHandler:this.toolbarActionHandler,tooltipDirection:"top",setInitialFocus:u,closeToolbarOnEsc:!0,closeToolbar:this.closeContextToolbar,size:"sm",additionalText:{overflowMenuLabel:this.props.canvasController.labelUtil.getLabel("toolbar.overflowMenu"),ariaLabel:this.props.canvasController.labelUtil.getLabel("toolbar.contextToolbarLabel")}}))}return e}}])}(a.Component),fi=s(function(e,t){return{contextMenuDef:e.contextmenu.menuDef,contextSource:e.contextmenu.source,showContextMenu:e.contextmenu.isOpen}})(gi);const vi=ut,yi=dt;let mi=a;mi=ct.__toESM(mi);let bi=ht.exports;const ki=mi.default.forwardRef(function({children:e,size:t=16,...n},i){return mi.default.createElement(vi,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,bi.jsx)("path",{d:"M26,30H6a2.0023,2.0023,0,0,1-2-2V4A2.0023,2.0023,0,0,1,6,2H26a2.0023,2.0023,0,0,1,2,2V28A2.0023,2.0023,0,0,1,26,30ZM6,4V28H26V4Z"}),(0,bi.jsx)("path",{d:"M10 7H22V9H10z",transform:"matrix(-1 0 0 -1 32 16)"}),(0,bi.jsx)("path",{d:"M12 12H20V14H12z",transform:"matrix(-1 0 0 -1 32 26)"}),e)});"production"!==process.env.NODE_ENV&&(ki.propTypes=yi.iconPropTypes);var xi=ki;const Ci=ut,Pi=dt;let Li=a;Li=ct.__toESM(Li);let wi=ht.exports;const Si=Li.default.forwardRef(function({children:e,size:t=16,...n},i){return Li.default.createElement(Ci,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,wi.jsx)("path",{d:"M26,30H6a2.0023,2.0023,0,0,1-2-2V4A2.0023,2.0023,0,0,1,6,2H26a2.0023,2.0023,0,0,1,2,2V28A2.0023,2.0023,0,0,1,26,30ZM6,4V28H26V4Z"}),(0,wi.jsx)("path",{d:"M10 13H22V15H10z",transform:"matrix(-1 0 0 -1 32 28)"}),(0,wi.jsx)("path",{d:"M12 18H20V20H12z",transform:"matrix(-1 0 0 -1 32 38)"}),e)});"production"!==process.env.NODE_ENV&&(Si.propTypes=Pi.iconPropTypes);var Ti=Si;const Ni=ut,Di=dt;let Oi=a;Oi=ct.__toESM(Oi);let Ei=ht.exports;const Ii=Oi.default.forwardRef(function({children:e,size:t=16,...n},i){return Oi.default.createElement(Ni,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,Ei.jsx)("path",{d:"M26,30H6a2.0023,2.0023,0,0,1-2-2V4A2.0023,2.0023,0,0,1,6,2H26a2.0023,2.0023,0,0,1,2,2V28A2.0023,2.0023,0,0,1,26,30ZM6,4V28H26V4Z"}),(0,Ei.jsx)("path",{d:"M10 18H22V20H10z",transform:"matrix(-1 0 0 -1 32 38)"}),(0,Ei.jsx)("path",{d:"M12 23H20V25H12z",transform:"matrix(-1 0 0 -1 32 48)"}),e)});"production"!==process.env.NODE_ENV&&(Ii.propTypes=Di.iconPropTypes);var Ai=Ii;const ji=ut,_i=dt;let Mi=a;Mi=ct.__toESM(Mi);let zi=ht.exports;const Hi=Mi.default.forwardRef(function({children:e,size:t=16,...n},i){return Mi.default.createElement(ji,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,zi.jsx)("path",{d:"M31 16 24 23 22.59 21.59 28.17 16 22.59 10.41 24 9 31 16z"}),(0,zi.jsx)("path",{d:"M1 16 8 9 9.41 10.41 3.83 16 9.41 21.59 8 23 1 16z"}),(0,zi.jsx)("path",{d:"M5.91 15H26.080000000000002V17H5.91z",transform:"rotate(-75 15.996 16)"}),e)});"production"!==process.env.NODE_ENV&&(Hi.propTypes=_i.iconPropTypes);var Fi=Hi;const Ri=ut,Bi=dt;let Gi=a;Gi=ct.__toESM(Gi);let Ui=ht.exports;const Wi=Gi.default.forwardRef(function({children:e,size:t=16,...n},i){return Gi.default.createElement(Ri,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,Ui.jsx)("path",{d:"M29.25,6.76a6,6,0,0,0-8.5,0l1.42,1.42a4,4,0,1,1,5.67,5.67l-8,8a4,4,0,1,1-5.67-5.66l1.41-1.42-1.41-1.42-1.42,1.42a6,6,0,0,0,0,8.5A6,6,0,0,0,17,25a6,6,0,0,0,4.27-1.76l8-8A6,6,0,0,0,29.25,6.76Z"}),(0,Ui.jsx)("path",{d:"M4.19,24.82a4,4,0,0,1,0-5.67l8-8a4,4,0,0,1,5.67,0A3.94,3.94,0,0,1,19,14a4,4,0,0,1-1.17,2.85L15.71,19l1.42,1.42,2.12-2.12a6,6,0,0,0-8.51-8.51l-8,8a6,6,0,0,0,0,8.51A6,6,0,0,0,7,28a6.07,6.07,0,0,0,4.28-1.76L9.86,24.82A4,4,0,0,1,4.19,24.82Z"}),e)});"production"!==process.env.NODE_ENV&&(Wi.propTypes=Bi.iconPropTypes);var Vi=Wi;const Zi=ut,Xi=dt;let Yi=a;Yi=ct.__toESM(Yi);let Ki=ht.exports;const qi=Yi.default.forwardRef(function({children:e,size:t=16,...n},i){return Yi.default.createElement(Zi,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,Ki.jsx)("path",{strokeWidth:"0",d:"m26,4H6c-1.1046,0-2,.8954-2,2v20c0,1.1046.8954,2,2,2h20c1.1046,0,2-.8954,2-2V6c0-1.1046-.8954-2-2-2ZM6,26V6h20v20H6Z"}),e)});"production"!==process.env.NODE_ENV&&(qi.propTypes=Xi.iconPropTypes);var $i=qi;const Ji=ut,Qi=dt;let eo=a;eo=ct.__toESM(eo);let to=ht.exports;const no=eo.default.forwardRef(function({children:e,size:t=16,...n},i){return eo.default.createElement(Ji,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,to.jsx)("path",{d:"M6 6H26V8H6z"}),(0,to.jsx)("path",{d:"M10 12H22V14H10z"}),(0,to.jsx)("path",{d:"M6 18H26V20H6z"}),(0,to.jsx)("path",{d:"M10 24H22V26H10z"}),e)});"production"!==process.env.NODE_ENV&&(no.propTypes=Qi.iconPropTypes);var io=no;const oo=ut,ro=dt;let ao=a;ao=ct.__toESM(ao);let so=ht.exports;const lo=ao.default.forwardRef(function({children:e,size:t=16,...n},i){return ao.default.createElement(oo,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,so.jsx)("path",{d:"M12 6H26V8H12z"}),(0,so.jsx)("path",{d:"M12 12H22V14H12z"}),(0,so.jsx)("path",{d:"M12 18H26V20H12z"}),(0,so.jsx)("path",{d:"M12 24H22V26H12z"}),(0,so.jsx)("path",{d:"M6 4H8V28H6z"}),e)});"production"!==process.env.NODE_ENV&&(lo.propTypes=ro.iconPropTypes);var co=lo;const uo=ut,ho=dt;let po=a;po=ct.__toESM(po);let go=ht.exports;const fo=po.default.forwardRef(function({children:e,size:t=16,...n},i){return po.default.createElement(uo,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,go.jsx)("path",{d:"M6 6H20V8H6z"}),(0,go.jsx)("path",{d:"M10 12H20V14H10z"}),(0,go.jsx)("path",{d:"M6 18H20V20H6z"}),(0,go.jsx)("path",{d:"M10 24H20V26H10z"}),(0,go.jsx)("path",{d:"M24 4H26V28H24z"}),e)});"production"!==process.env.NODE_ENV&&(fo.propTypes=ho.iconPropTypes);var vo=fo;const yo=ut,mo=dt;let bo=a;bo=ct.__toESM(bo);let ko=ht.exports;const xo=bo.default.forwardRef(function({children:e,size:t=16,...n},i){return bo.default.createElement(yo,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,ko.jsx)("path",{d:"M22,21h2L17,4H15L8,21h2l1.61-4h8.74Zm-9.57-6,3.44-8.37h.26L19.54,15Z"}),(0,ko.jsx)("path",{d:"M6 24H26V28H6z"}),e)});"production"!==process.env.NODE_ENV&&(xo.propTypes=mo.iconPropTypes);var Co=xo;const Po=ut,Lo=dt;let wo=a;wo=ct.__toESM(wo);let So=ht.exports;const To=wo.default.forwardRef(function({children:e,size:t=16,...n},i){return wo.default.createElement(Po,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,So.jsx)("path",{d:"M25,12H20v2h5a1.0008,1.0008,0,0,1,1,1v2H22a3.0033,3.0033,0,0,0-3,3v1a3.0033,3.0033,0,0,0,3,3h6V15A3.0033,3.0033,0,0,0,25,12ZM22,22a1.0008,1.0008,0,0,1-1-1V20a1.0008,1.0008,0,0,1,1-1h4v3Z"}),(0,So.jsx)("path",{d:"M16,24h2L12,7H10L4,24H6l1.6936-5h6.6135ZM8.3711,17l2.4966-7.3711.2668.0005L13.63,17Z"}),e)});"production"!==process.env.NODE_ENV&&(To.propTypes=Lo.iconPropTypes);var No=To;const Do=ut,Oo=dt;let Eo=a;Eo=ct.__toESM(Eo);let Io=ht.exports;const Ao=Eo.default.forwardRef(function({children:e,size:t=16,...n},i){return Eo.default.createElement(Do,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,Io.jsx)("path",{d:"M20 6H30V8H20z"}),(0,Io.jsx)("path",{d:"M20 12H27V14H20z"}),(0,Io.jsx)("path",{d:"M20 18H30V20H20z"}),(0,Io.jsx)("path",{d:"M20 24H27V26H20z"}),(0,Io.jsx)("path",{d:"M14 4H16V28H14z"}),(0,Io.jsx)("path",{d:"M3.85 22.5 2.44 21.12 8.73 15 2.44 8.88 3.85 7.5 11.56 15 3.85 22.5z"}),e)});"production"!==process.env.NODE_ENV&&(Ao.propTypes=Oo.iconPropTypes);var jo=Ao;const _o=ut,Mo=dt;let zo=a;zo=ct.__toESM(zo);let Ho=ht.exports;const Fo=zo.default.forwardRef(function({children:e,size:t=16,...n},i){return zo.default.createElement(_o,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,Ho.jsx)("path",{d:"M18.25,25H9V7h8.5a5.25,5.25,0,0,1,4,8.65A5.25,5.25,0,0,1,18.25,25ZM12,22h6.23a2.25,2.25,0,1,0,0-4.5H12Zm0-7.5h5.5a2.25,2.25,0,1,0,0-4.5H12Z"}),e)});"production"!==process.env.NODE_ENV&&(Fo.propTypes=Mo.iconPropTypes);var Ro=Fo;const Bo=ut,Go=dt;let Uo=a;Uo=ct.__toESM(Uo);let Wo=ht.exports;const Vo=Uo.default.forwardRef(function({children:e,size:t=16,...n},i){return Uo.default.createElement(Bo,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,Wo.jsx)("path",{d:"M25 9 25 7 12 7 12 9 17.14 9 12.77 23 7 23 7 25 20 25 20 23 14.86 23 19.23 9 25 9z"}),e)});"production"!==process.env.NODE_ENV&&(Vo.propTypes=Go.iconPropTypes);var Zo=Vo;const Xo=ut,Yo=dt;let Ko=a;Ko=ct.__toESM(Ko);let qo=ht.exports;const $o=Ko.default.forwardRef(function({children:e,size:t=16,...n},i){return Ko.default.createElement(Xo,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,qo.jsx)("path",{d:"M4 26H28V28H4z"}),(0,qo.jsx)("path",{d:"M16,23a7,7,0,0,1-7-7V5h2V16a5,5,0,0,0,10,0V5h2V16A7,7,0,0,1,16,23Z"}),e)});"production"!==process.env.NODE_ENV&&($o.propTypes=Yo.iconPropTypes);var Jo=$o;const Qo=ut,er=dt;let tr=a;tr=ct.__toESM(tr);let nr=ht.exports;const ir=tr.default.forwardRef(function({children:e,size:t=16,...n},i){return tr.default.createElement(Qo,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,nr.jsx)("path",{d:"M30 5 30 8 22 8 22 26 19 26 19 8 11 8 11 5 30 5z"}),(0,nr.jsx)("path",{d:"M7 26 7 14 2 14 2 12 14 12 14 14 9 14 9 26 7 26z"}),e)});"production"!==process.env.NODE_ENV&&(ir.propTypes=er.iconPropTypes);var or=ir;const rr=ut,ar=dt;let sr=a;sr=ct.__toESM(sr);let lr=ht.exports;const cr=sr.default.forwardRef(function({children:e,size:t=16,...n},i){return sr.default.createElement(rr,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,lr.jsx)("path",{d:"M28,15H17.9563c-.4522-.1237-.9037-.2324-1.3381-.3352-2.8077-.6641-4.396-1.1506-4.396-3.4231a2.8684,2.8684,0,0,1,.7866-2.145,4.7888,4.7888,0,0,1,3.0137-1.09c2.8291-.07,4.1347.8894,5.2011,2.35l1.6153-1.1792a7.4727,7.4727,0,0,0-6.83-3.1706,6.7726,6.7726,0,0,0-4.4,1.6611,4.8274,4.8274,0,0,0-1.3862,3.5735A4.3723,4.3723,0,0,0,11.9573,15H4v2H17.6519c1.9668.57,3.1432,1.3123,3.1733,3.3579a3.119,3.119,0,0,1-.8623,2.3931A5.8241,5.8241,0,0,1,16.2432,24a6.6344,6.6344,0,0,1-5.1451-2.6912L9.5649,22.593A8.5262,8.5262,0,0,0,16.2119,26c.0088-.0012.042,0,.1,0A7.67,7.67,0,0,0,21.36,24.1812a5.0779,5.0779,0,0,0,1.4648-3.8531A4.952,4.952,0,0,0,21.6753,17H28Z"}),e)});"production"!==process.env.NODE_ENV&&(cr.propTypes=ar.iconPropTypes);var ur=cr;function dr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(dr=function(){return!!e})()}var hr=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,dr()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).getLabel=n.getLabel.bind(n),n.onKeyDown=n.onKeyDown.bind(n),n.logger=new gt("CC-Text-Toolbar"),n}return i(s,n),e(s,[{key:"onKeyDown",value:function(e){pt.returnToTextEditing(e)&&(this.props.canvasController.focusOnTextEntryElement(e),e.stopPropagation(),e.preventDefault())}},{key:"getLabel",value:function(e,t){var n=d[e]?d[e]:h[e];return this.props.intl.formatMessage({id:e,defaultMessage:n},t)}},{key:"getJsxLabel",value:function(e,t,n){var i=D.isMacintosh()?"⌘":"Ctrl",o=t?i+" + "+t:null,r=n?i+" + "+n:null;return a.createElement("div",null,this.getLabel(e),a.createElement("br",null),o,a.createElement("br",null),r)}},{key:"getMarkdownToolbar",value:function(){var e=this.getJsxLabel("texttoolbar.boldAction","b"),t=this.getJsxLabel("texttoolbar.italicsAction","i"),n=this.getJsxLabel("texttoolbar.strikethroughAction","shift + x"),i=this.getJsxLabel("texttoolbar.headerAction","1","2"),o=this.getJsxLabel("texttoolbar.codeAction","e"),r=this.getJsxLabel("texttoolbar.linkAction","k"),s=this.getJsxLabel("texttoolbar.quoteAction","shift + I"),l=this.getJsxLabel("texttoolbar.numberedListAction","shift + 7"),c=this.getJsxLabel("texttoolbar.bulletedListAction","shift + 8");return{leftBar:[{action:"headerStyle",tooltip:i,enable:!0,subMenu:[{action:"title",label:this.getLabel("texttoolbar.titleAction"),enable:!0},{action:"header",label:this.getLabel("texttoolbar.headerAction"),enable:!0},{action:"subheader",label:this.getLabel("texttoolbar.subheaderAction"),enable:!0},{action:"body",label:this.getLabel("texttoolbar.bodyAction"),enable:!0}],closeSubAreaOnClick:!0,iconEnabled:a.createElement(or,{size:32})},{divider:!0},{action:"bold",label:e,enable:!0,iconEnabled:a.createElement(Ro,{size:32})},{action:"italics",label:t,enable:!0,iconEnabled:a.createElement(Zo,{size:32})},{action:"strikethrough",label:n,enable:!0,iconEnabled:a.createElement(ur,{size:32})},{divider:!0},{action:"code",label:o,enable:!0,iconEnabled:a.createElement(Fi,{size:32})},{divider:!0},{action:"link",label:r,enable:!0,iconEnabled:a.createElement(Vi,{size:32})},{divider:!0},{action:"quote",label:s,enable:!0,iconEnabled:a.createElement(jo,{size:32})},{divider:!0},{action:"numberedList",label:l,enable:!0,iconEnabled:a.createElement(Lt,{size:32})},{action:"bulletedList",label:c,enable:!0,iconEnabled:a.createElement(wt,{size:32})}]}}},{key:"getWysiwygToolbar",value:function(){var e=this,t=this.getLabel("texttoolbar.boldAction"),n=this.getLabel("texttoolbar.italicsAction"),i=this.getLabel("texttoolbar.underline"),o=this.getLabel("texttoolbar.strikethroughAction"),r=[{action:"font-ibm-plex-sans",label:this.getLabel("texttoolbar.fontIBMPlexSans"),enable:!0,isSelected:!0},{action:"font-ibm-plex-serif",label:this.getLabel("texttoolbar.fontIBMPlexSerif"),enable:!0},{action:"font-ibm-plex-sans-condensed",label:this.getLabel("texttoolbar.fontIBMPlexSansCon"),enable:!0},{action:"font-ibm-plex-mono",label:this.getLabel("texttoolbar.fontIBMPlexMono"),enable:!0},{action:"font-arial",label:this.getLabel("texttoolbar.fontArial"),enable:!0},{action:"font-comic-sans-ms",label:this.getLabel("texttoolbar.fontComicSansMS"),enable:!0},{action:"font-gill-sans",label:this.getLabel("texttoolbar.fontGillSans"),enable:!0},{action:"font-helvetica-neue",label:this.getLabel("texttoolbar.fontHelveticaNeue"),enable:!0},{action:"font-times-new-roman",label:this.getLabel("texttoolbar.fontTimesNewRoman"),enable:!0},{action:"font-verdana",label:this.getLabel("texttoolbar.fontVerdana"),enable:!0}],s=[{action:"text-size-10",label:"10",enable:!0},{action:"text-size-11",label:"11",enable:!0},{action:"text-size-12",label:"12",enable:!0,isSelected:!0},{action:"text-size-14",label:"14",enable:!0},{action:"text-size-18",label:"18",enable:!0},{action:"text-size-24",label:"24",enable:!0},{action:"text-size-30",label:"30",enable:!0},{action:"text-size-36",label:"36",enable:!0},{action:"text-size-48",label:"48",enable:!0},{action:"text-size-60",label:"60",enable:!0},{action:"text-size-72",label:"72",enable:!0},{action:"text-size-96",label:"96",enable:!0}],l=[{action:"align-left",label:this.getLabel("texttoolbar.alignHorizLeft"),enable:!0,iconEnabled:a.createElement(co,{size:32}),isSelected:!0},{action:"align-center",label:this.getLabel("texttoolbar.alignHorizCenter"),enable:!0,iconEnabled:a.createElement(io,{size:32})},{action:"align-right",label:this.getLabel("texttoolbar.alignHorizRight"),enable:!0,iconEnabled:a.createElement(vo,{size:32})}],c=[{action:"align-top",label:this.getLabel("texttoolbar.alignVertTop"),enable:!0,iconEnabled:a.createElement(xi,{size:32}),isSelected:!0},{action:"align-middle",label:this.getLabel("texttoolbar.alignVertMiddle"),enable:!0,iconEnabled:a.createElement(Ti,{size:32})},{action:"align-bottom",label:this.getLabel("texttoolbar.alignVertBottom"),enable:!0,iconEnabled:a.createElement(Ai,{size:32})}],u=[{action:"outline-none",label:this.getLabel("texttoolbar.outlineNone"),enable:!0},{action:"outline-solid",label:this.getLabel("texttoolbar.outlineSolid"),enable:!0,isSelected:!0}];this.setSelectedMenuElement("fontType",this.props.formats,r),this.setSelectedMenuElement("textSize",this.props.formats,s),this.setSelectedMenuElement("alignHorizontally",this.props.formats,l),this.setSelectedMenuElement("alignVertically",this.props.formats,c),this.setSelectedMenuElement("outlineStyle",this.props.formats,u);var d=this.getFormatValue("textColor",this.props.formats)||"#000000",h=this.getFormatValue("backgroundColor",this.props.formats)||"#FFFFFF",p=Boolean(this.getFormatType("bold",this.props.formats)),g=Boolean(this.getFormatType("italics",this.props.formats)),f=this.getFormatValue("textDecoration",this.props.formats),v=null==f?void 0:f.includes("underline"),y=null==f?void 0:f.includes("strikethrough");return{leftBar:[{action:"submenu-font",label:this.getLabel("texttoolbar.fontAction"),iconEnabled:a.createElement(No,{size:32}),enable:!0,subMenu:r,closeSubAreaOnClick:!0},{action:"submenu-text-size",label:this.getLabel("texttoolbar.textSize"),iconEnabled:a.createElement(or,{size:32}),enable:!0,subMenu:s,closeSubAreaOnClick:!0},{action:"bold",label:t,enable:!0,iconEnabled:a.createElement(Ro,{size:32}),isSelected:p},{action:"italics",label:n,enable:!0,iconEnabled:a.createElement(Zo,{size:32}),isSelected:g},{action:"underline",label:i,enable:!0,iconEnabled:a.createElement(Jo,{size:32}),isSelected:v},{action:"strikethrough",label:o,enable:!0,iconEnabled:a.createElement(ur,{size:32}),isSelected:y},{divider:!0},{action:"submenu-text-color",label:this.getLabel("texttoolbar.colorText"),iconEnabled:a.createElement(Co,{size:32}),enable:!0,subPanel:Ot,subPanelData:{type:F,selectedColor:d,clickActionHandler:function(t,n){return e.props.actionHandler("text-color",n,t)}},closeSubAreaOnClick:!0},{action:"submenu-align-horiz",label:this.getLabel("texttoolbar.alignHoriz"),iconEnabled:a.createElement(io,{size:32}),enable:!0,subMenu:l,closeSubAreaOnClick:!0},{action:"submenu-align-vert",label:this.getLabel("texttoolbar.alignVert"),iconEnabled:a.createElement(Ti,{size:32}),enable:!0,subMenu:c,closeSubAreaOnClick:!0},{action:"submenu-background-color",label:this.getLabel("texttoolbar.colorBackground"),iconEnabled:a.createElement(k,{size:32}),enable:!0,subPanel:Ot,subPanelData:{type:F,selectedColor:h,clickActionHandler:function(t,n){return e.props.actionHandler("background-color",n,t)}},closeSubAreaOnClick:!0},{action:"sub-menu-outline",label:this.getLabel("texttoolbar.outline"),iconEnabled:a.createElement($i,{size:32}),enable:!0,subMenu:u,closeSubAreaOnClick:!0}]}}},{key:"setSelectedMenuElement",value:function(e,t,n){var i=this.getFormatValue(e,t);i&&n.forEach(function(e){return e.isSelected=e.action===i})}},{key:"getFormatValue",value:function(e,t){var n=this.getFormatType(e,t);return null==n?void 0:n.value}},{key:"getFormatType",value:function(e,t){return t?t.find(function(t){return t.type===e}):null}},{key:"getTextToolbarConfig",value:function(){return this.props.contentType===R?this.getMarkdownToolbar():this.props.contentType===F?this.getWysiwygToolbar():{leftBar:[]}}},{key:"render",value:function(){this.logger.log("render");var e=null;return this.props.isOpen&&(e=a.createElement("div",{className:"text-toolbar floating-toolbar",style:{left:this.props.pos_x,top:this.props.pos_y},onBlur:this.props.blurHandler,onKeyDown:this.onKeyDown},a.createElement(b,{config:this.getTextToolbarConfig(),instanceId:this.props.canvasController.getInstanceId(),containingDivId:this.props.containingDivId,toolbarActionHandler:this.props.actionHandler,tooltipDirection:"top",size:"sm",additionalText:{overflowMenuLabel:this.getLabel("toolbar.overflowMenu"),ariaLabel:this.getLabel("toolbar.textToolbarLabel")}}))),e}}])}(a.Component),pr=s(function(e,t){return{isOpen:e.texttoolbar.isOpen,pos_x:e.texttoolbar.pos_x,pos_y:e.texttoolbar.pos_y,formats:e.texttoolbar.formats,contentType:e.texttoolbar.contentType,actionHandler:e.texttoolbar.actionHandler,blurHandler:e.texttoolbar.blurHandler}})(c(hr));const gr=ut,fr=dt;let vr=a;vr=ct.__toESM(vr);let yr=ht.exports;const mr=vr.default.forwardRef(function({children:e,size:t=16,...n},i){return vr.default.createElement(gr,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,yr.jsx)("path",{d:"M24,14H22V8A6,6,0,0,0,10,8v6H8a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H24a2,2,0,0,0,2-2V16A2,2,0,0,0,24,14ZM12,8a4,4,0,0,1,8,0v6H12ZM24,28H8V16H24Z"}),e)});"production"!==process.env.NODE_ENV&&(mr.propTypes=fr.iconPropTypes);var br=mr;const kr=ut,xr=dt;let Cr=a;Cr=ct.__toESM(Cr);let Pr=ht.exports;const Lr=Cr.default.forwardRef(function({children:e,size:t=16,...n},i){return Cr.default.createElement(kr,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,Pr.jsx)("path",{d:"M30,28.6L3.4,2L2,3.4l10.1,10.1L4,21.6V28h6.4l8.1-8.1L28.6,30L30,28.6z M9.6,26H6v-3.6l7.5-7.5l3.6,3.6L9.6,26z"}),(0,Pr.jsx)("path",{d:"M29.4,6.2L29.4,6.2l-3.6-3.6c-0.8-0.8-2-0.8-2.8,0l0,0l0,0l-8,8l1.4,1.4L20,8.4l3.6,3.6L20,15.6l1.4,1.4l8-8 C30.2,8.2,30.2,7,29.4,6.2L29.4,6.2z M25,10.6L21.4,7l3-3L28,7.6L25,10.6z"}),e)});"production"!==process.env.NODE_ENV&&(Lr.propTypes=xr.iconPropTypes);var wr=Lr;function Sr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Sr=function(){return!!e})()}var Tr=c(function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,Sr()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).logger=new gt("CC-StateTag"),n.onMouseOver=n.onMouseOver.bind(n),n.onMouseLeave=n.onMouseLeave.bind(n),n}return i(s,n),e(s,[{key:"onMouseOver",value:function(e){var t;this.props.stateTagType===B?t=this.getLabel("canvas.stateTagTipLocked"):this.props.stateTagType===G&&(t=this.getLabel("canvas.stateTagTipReadOnly")),this.props.canvasController.openTip({id:"stateTagTip",type:A,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:d[e]})}},{key:"getStateTag",value:function(e,t){return a.createElement("div",{className:"state-tag",onMouseOver:this.onMouseOver,onMouseLeave:this.onMouseLeave},t,a.createElement("span",null,e))}},{key:"render",value:function(){this.logger.log("render");var e=null;if(this.props.stateTagType===B){var t=this.getLabel("canvas.stateTagLocked");e=this.getStateTag(t,a.createElement(br,null))}else if(this.props.stateTagType===G){var n=this.getLabel("canvas.stateTagReadOnly");e=this.getStateTag(n,a.createElement(wr,null))}return e}}])}(a.Component));const Nr=ut,Dr=dt;let Or=a;Or=ct.__toESM(Or);let Er=ht.exports;const Ir=Or.default.forwardRef(function({children:e,size:t=16,...n},i){return Or.default.createElement(Nr,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,Er.jsx)("path",{d:"M20,23H11.86a4.17,4.17,0,0,0-.43-1L22,11.43A3.86,3.86,0,0,0,24,12a4,4,0,1,0-3.86-5H11.86a4,4,0,1,0,0,2h8.28a4.17,4.17,0,0,0,.43,1L10,20.57A3.86,3.86,0,0,0,8,20a4,4,0,1,0,3.86,5H20v3h8V20H20ZM8,10a2,2,0,1,1,2-2A2,2,0,0,1,8,10ZM24,6a2,2,0,1,1-2,2A2,2,0,0,1,24,6ZM8,26a2,2,0,1,1,2-2A2,2,0,0,1,8,26Zm14-4h4v4H22Z"}),e)});"production"!==process.env.NODE_ENV&&(Ir.propTypes=Dr.iconPropTypes);var Ar=Ir;const jr=ut,_r=dt;let Mr=a;Mr=ct.__toESM(Mr);let zr=ht.exports;const Hr=Mr.default.forwardRef(function({children:e,size:t=16,...n},i){return 16===t||"16"===t||"16px"===t?Mr.default.createElement(jr,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor",...n},(0,zr.jsx)("path",{d:"M6.7 12.3 2.9 8.5 15 8.5 15 7.5 2.9 7.5 6.7 3.7 6 3 1 8 6 13z"}),e):Mr.default.createElement(jr,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,zr.jsx)("path",{d:"M14 26 15.41 24.59 7.83 17 28 17 28 15 7.83 15 15.41 7.41 14 6 4 16 14 26z"}),e)});"production"!==process.env.NODE_ENV&&(Hr.propTypes=_r.iconPropTypes);var Fr=Hr,Rr="http://www.w3.org/1999/xhtml",Br={svg:"http://www.w3.org/2000/svg",xhtml:Rr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Gr(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),Br.hasOwnProperty(t)?{space:Br[t],local:e}:e}function Ur(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Rr&&t.documentElement.namespaceURI===Rr?t.createElement(e):t.createElementNS(n,e)}}function Wr(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Vr(e){var t=Gr(e);return(t.local?Wr:Ur)(t)}function Zr(){}function Xr(e){return null==e?Zr:function(){return this.querySelector(e)}}function Yr(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}function Kr(){return[]}function qr(e){return null==e?Kr:function(){return this.querySelectorAll(e)}}function $r(e){return function(){return this.matches(e)}}function Jr(e){return function(t){return t.matches(e)}}var Qr=Array.prototype.find;function ea(){return this.firstElementChild}var ta=Array.prototype.filter;function na(){return Array.from(this.children)}function ia(e){return new Array(e.length)}function oa(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function ra(e,t,n,i,o,r){for(var a,s=0,l=t.length,c=r.length;s<c;++s)(a=t[s])?(a.__data__=r[s],i[s]=a):n[s]=new oa(e,r[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function aa(e,t,n,i,o,r,a){var s,l,c,u=new Map,d=t.length,h=r.length,p=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(p[s]=c=a.call(l,l.__data__,s,t)+"",u.has(c)?o[s]=l:u.set(c,l));for(s=0;s<h;++s)c=a.call(e,r[s],s,r)+"",(l=u.get(c))?(i[s]=l,l.__data__=r[s],u.delete(c)):n[s]=new oa(e,r[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(o[s]=l)}function sa(e){return e.__data__}function la(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function ca(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ua(e){return function(){this.removeAttribute(e)}}function da(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ha(e,t){return function(){this.setAttribute(e,t)}}function pa(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ga(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function fa(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 va(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function ya(e){return function(){this.style.removeProperty(e)}}function ma(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ba(e,t,n){return function(){var i=t.apply(this,arguments);null==i?this.style.removeProperty(e):this.style.setProperty(e,i,n)}}function ka(e,t){return e.style.getPropertyValue(t)||va(e).getComputedStyle(e,null).getPropertyValue(t)}function xa(e){return function(){delete this[e]}}function Ca(e,t){return function(){this[e]=t}}function Pa(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function La(e){return e.trim().split(/^|\s+/)}function wa(e){return e.classList||new Sa(e)}function Sa(e){this._node=e,this._names=La(e.getAttribute("class")||"")}function Ta(e,t){for(var n=wa(e),i=-1,o=t.length;++i<o;)n.add(t[i])}function Na(e,t){for(var n=wa(e),i=-1,o=t.length;++i<o;)n.remove(t[i])}function Da(e){return function(){Ta(this,e)}}function Oa(e){return function(){Na(this,e)}}function Ea(e,t){return function(){(t.apply(this,arguments)?Ta:Na)(this,e)}}function Ia(){this.textContent=""}function Aa(e){return function(){this.textContent=e}}function ja(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function _a(){this.innerHTML=""}function Ma(e){return function(){this.innerHTML=e}}function za(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Ha(){this.nextSibling&&this.parentNode.appendChild(this)}function Fa(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ra(){return null}function Ba(){var e=this.parentNode;e&&e.removeChild(this)}function Ga(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ua(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Wa(e){return function(){var t=this.__on;if(t){for(var n,i=0,o=-1,r=t.length;i<r;++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 Va(e,t,n){return function(){var i,o=this.__on,r=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var a=0,s=o.length;a<s;++a)if((i=o[a]).type===e.type&&i.name===e.name)return this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=r,i.options=n),void(i.value=t);this.addEventListener(e.type,r,n),i={type:e.type,name:e.name,value:t,listener:r,options:n},o?o.push(i):this.__on=[i]}}function Za(e,t,n){var i=va(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 Xa(e,t){return function(){return Za(this,e,t)}}function Ya(e,t){return function(){return Za(this,e,t.apply(this,arguments))}}oa.prototype={constructor:oa,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)}},Sa.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 Ka=[null];function qa(e,t){this._groups=e,this._parents=t}function $a(){return new qa([[document.documentElement]],Ka)}function Ja(e){return"string"==typeof e?new qa([[document.querySelector(e)]],[document.documentElement]):new qa([[e]],Ka)}qa.prototype=$a.prototype={constructor:qa,select:function(e){"function"!=typeof e&&(e=Xr(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var r,a,s=t[o],l=s.length,c=i[o]=new Array(l),u=0;u<l;++u)(r=s[u])&&(a=e.call(r,r.__data__,u,s))&&("__data__"in r&&(a.__data__=r.__data__),c[u]=a);return new qa(i,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return Yr(e.apply(this,arguments))}}(e):qr(e);for(var t=this._groups,n=t.length,i=[],o=[],r=0;r<n;++r)for(var a,s=t[r],l=s.length,c=0;c<l;++c)(a=s[c])&&(i.push(e.call(a,a.__data__,c,s)),o.push(a));return new qa(i,o)},selectChild:function(e){return this.select(null==e?ea:function(e){return function(){return Qr.call(this.children,e)}}("function"==typeof e?e:Jr(e)))},selectChildren:function(e){return this.selectAll(null==e?na:function(e){return function(){return ta.call(this.children,e)}}("function"==typeof e?e:Jr(e)))},filter:function(e){"function"!=typeof e&&(e=$r(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var r,a=t[o],s=a.length,l=i[o]=[],c=0;c<s;++c)(r=a[c])&&e.call(r,r.__data__,c,a)&&l.push(r);return new qa(i,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,sa);var n,i=t?aa:ra,o=this._parents,r=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var a=r.length,s=new Array(a),l=new Array(a),c=new Array(a),u=0;u<a;++u){var d=o[u],h=r[u],p=h.length,g=la(e.call(d,d&&d.__data__,u,o)),f=g.length,v=l[u]=new Array(f),y=s[u]=new Array(f);i(d,h,v,y,c[u]=new Array(p),g,t);for(var m,b,k=0,x=0;k<f;++k)if(m=v[k]){for(k>=x&&(x=k+1);!(b=y[x])&&++x<f;);m._next=b||null}}return(s=new qa(s,o))._enter=l,s._exit=c,s},enter:function(){return new qa(this._enter||this._groups.map(ia),this._parents)},exit:function(){return new qa(this._exit||this._groups.map(ia),this._parents)},join:function(e,t,n){var i=this.enter(),o=this,r=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?r.remove():n(r),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,r=i.length,a=Math.min(o,r),s=new Array(o),l=0;l<a;++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 qa(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],r=o.length-1,a=o[r];--r>=0;)(i=o[r])&&(a&&4^i.compareDocumentPosition(a)&&a.parentNode.insertBefore(i,a),a=i);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=ca);for(var n=this._groups,i=n.length,o=new Array(i),r=0;r<i;++r){for(var a,s=n[r],l=s.length,c=o[r]=new Array(l),u=0;u<l;++u)(a=s[u])&&(c[u]=a);c.sort(t)}return new qa(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,r=i.length;o<r;++o){var a=i[o];if(a)return a}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,r=t[n],a=0,s=r.length;a<s;++a)(o=r[a])&&e.call(o,o.__data__,a,r);return this},attr:function(e,t){var n=Gr(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?da:ua:"function"==typeof t?n.local?fa:ga:n.local?pa:ha)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?ya:"function"==typeof t?ba:ma)(e,t,null==n?"":n)):ka(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?xa:"function"==typeof t?Pa:Ca)(e,t)):this.node()[e]},classed:function(e,t){var n=La(e+"");if(arguments.length<2){for(var i=wa(this.node()),o=-1,r=n.length;++o<r;)if(!i.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?Ea:t?Da:Oa)(n,t))},text:function(e){return arguments.length?this.each(null==e?Ia:("function"==typeof e?ja:Aa)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?_a:("function"==typeof e?za:Ma)(e)):this.node().innerHTML},raise:function(){return this.each(Ha)},lower:function(){return this.each(Fa)},append:function(e){var t="function"==typeof e?e:Vr(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:Vr(e),i=null==t?Ra:"function"==typeof t?t:Xr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),i.apply(this,arguments)||null)})},remove:function(){return this.each(Ba)},clone:function(e){return this.select(e?Ua:Ga)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var i,o,r=function(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}})}(e+""),a=r.length;if(!(arguments.length<2)){for(s=t?Va:Wa,i=0;i<a;++i)this.each(s(r[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<a;++i)if((o=r[i]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?Ya:Xa)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var i,o=e[t],r=0,a=o.length;r<a;++r)(i=o[r])&&(yield i)}};var Qa=0;function es(){return new ts}function ts(){this._="@"+(++Qa).toString(36)}function ns(e){let t;for(;t=e.sourceEvent;)e=t;return e}function is(e,t){if(e=ns(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]}ts.prototype=es.prototype={constructor:ts,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 os=Object.freeze({__proto__:null,create:function(e){return Ja(Vr(e).call(document.documentElement))},creator:Vr,local:es,matcher:$r,namespace:Gr,namespaces:Br,pointer:is,pointers:function(e,t){return e.target&&(e=ns(e),void 0===t&&(t=e.currentTarget),e=e.touches||[e]),Array.from(e,e=>is(e,t))},select:Ja,selectAll:function(e){return"string"==typeof e?new qa([document.querySelectorAll(e)],[document.documentElement]):new qa([Yr(e)],Ka)},selection:$a,selector:Xr,selectorAll:qr,style:ka,window:va}),rs=kt,as=p;var ss=function(e,t){return e&&rs(e,as(t))};var ls=function(e){return function(t){return null==e?void 0:e[t]}},cs=ls({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),us=U,ds=/[&<>"']/g,hs=RegExp(ds.source);var ps=function(e){return(e=us(e))&&hs.test(e)?e.replace(ds,cs):e};function gs(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.blob()}function fs(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.arrayBuffer()}var vs={},ys={};function ms(e){return new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+'] || ""'}).join(",")+"}")}function bs(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 ks(e,t){var n=e+"",i=n.length;return i<t?new Array(t-i+1).join(0)+n:n}function xs(e){var t,n=e.getUTCHours(),i=e.getUTCMinutes(),o=e.getUTCSeconds(),r=e.getUTCMilliseconds();return isNaN(e)?"Invalid Date":((t=e.getUTCFullYear())<0?"-"+ks(-t,6):t>9999?"+"+ks(t,6):ks(t,4))+"-"+ks(e.getUTCMonth()+1,2)+"-"+ks(e.getUTCDate(),2)+(r?"T"+ks(n,2)+":"+ks(i,2)+":"+ks(o,2)+"."+ks(r,3)+"Z":o?"T"+ks(n,2)+":"+ks(i,2)+":"+ks(o,2)+"Z":i||n?"T"+ks(n,2)+":"+ks(i,2)+"Z":"")}function Cs(e){var t=new RegExp('["'+e+"\n\r]"),n=e.charCodeAt(0);function i(e,t){var i,o=[],r=e.length,a=0,s=0,l=r<=0,c=!1;function u(){if(l)return ys;if(c)return c=!1,vs;var t,i,o=a;if(34===e.charCodeAt(o)){for(;a++<r&&34!==e.charCodeAt(a)||34===e.charCodeAt(++a););return(t=a)>=r?l=!0:10===(i=e.charCodeAt(a++))?c=!0:13===i&&(c=!0,10===e.charCodeAt(a)&&++a),e.slice(o+1,t-1).replace(/""/g,'"')}for(;a<r;){if(10===(i=e.charCodeAt(t=a++)))c=!0;else if(13===i)c=!0,10===e.charCodeAt(a)&&++a;else if(i!==n)continue;return e.slice(o,t)}return l=!0,e.slice(o,r)}for(10===e.charCodeAt(r-1)&&--r,13===e.charCodeAt(r-1)&&--r;(i=u())!==ys;){for(var d=[];i!==vs&&i!==ys;)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 a(t[e])}).join(e)})}function r(t){return t.map(a).join(e)}function a(e){return null==e?"":e instanceof Date?xs(e):t.test(e+="")?'"'+e.replace(/"/g,'""')+'"':e}return{parse:function(e,t){var n,o,r=i(e,function(e,i){if(n)return n(e,i-1);o=e,n=t?function(e,t){var n=ms(e);return function(i,o){return t(n(i),o,e)}}(e,t):ms(e)});return r.columns=o||[],r},parseRows:i,format:function(t,n){return null==n&&(n=bs(t)),[n.map(a).join(e)].concat(o(t,n)).join("\n")},formatBody:function(e,t){return null==t&&(t=bs(e)),o(e,t).join("\n")},formatRows:function(e){return e.map(r).join("\n")},formatRow:r,formatValue:a}}var Ps=Cs(",").parse,Ls=Cs("\t").parse;function ws(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);return e.text()}function Ss(e,t){return fetch(e,t).then(ws)}function Ts(e){return function(t,n,i){return 2===arguments.length&&"function"==typeof n&&(i=n,n=void 0),Ss(t,n).then(function(t){return e(t,i)})}}var Ns=Ts(Ps),Ds=Ts(Ls);function Os(e){if(!e.ok)throw new Error(e.status+" "+e.statusText);if(204!==e.status&&205!==e.status)return e.json()}function Es(e){return(t,n)=>Ss(t,n).then(t=>(new DOMParser).parseFromString(t,e))}var Is=Es("application/xml"),As=Es("text/html"),js=Es("image/svg+xml"),_s=Object.freeze({__proto__:null,blob:function(e,t){return fetch(e,t).then(gs)},buffer:function(e,t){return fetch(e,t).then(fs)},dsv:function(e,t,n,i){3===arguments.length&&"function"==typeof n&&(i=n,n=void 0);var o=Cs(e);return Ss(t,n).then(function(e){return o.parse(e,i)})},csv:Ns,tsv:Ds,image:function(e,t){return new Promise(function(n,i){var o=new Image;for(var r in t)o[r]=t[r];o.onerror=i,o.onload=function(){n(o)},o.src=e})},json:function(e,t){return fetch(e,t).then(Os)},text:Ss,xml:Is,html:As,svg:js}),Ms=function(){return e(function e(n,i,o,r){t(this,e),this.canvasController=n,this.isSubflow=i,this.pipelineId=o,this.breadcrumbs=r},[{key:"isDisplayingCurrentPipeline",value:function(){return this.breadcrumbs[this.breadcrumbs.length-1].pipelineId===this.pipelineId}},{key:"setDisplayState",value:function(){this.breadcrumbs.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}}])}();function zs(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Hs(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Hs(e,t):void 0}}(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 r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function Hs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}var Fs=new Map([["d3-focus-path",1],["d3-node-sizing",2],["d3-node-selection-highlight",3],["d3-node-body-outline",4],["d3-foreign-object-external-node",5],["d3-node-image",6],["d3-foreign-object-node-label",7],["d3-node-ellipsis-group",8],["d3-node-super-expand-icon-group",9],["d3-node-port-input",10],["d3-node-port-output",10],["d3-svg-canvas-underlay",11],["d3-node-error-marker",12],["d3-node-dec-group",13]]),Rs=function(){return e(function e(){t(this,e)},null,[{key:"getBeforeElement",value:function(e,t){var n;if(null==e||!e.children)return null;var i=null!==(n=Fs.get(t))&&void 0!==n?n:999;return this.getNextChildElement(e,i)}},{key:"getNextChildElement",value:function(e,t){var n=this,i=Array.from(e.children).find(function(e){return n.shouldChildComeAfter(e,t)});return null!=i?i:null}},{key:"shouldChildComeAfter",value:function(e,t){var n,i=zs(e.classList);try{for(i.s();!(n=i.n()).done;){var o=n.value,r=Fs.get(o);if(void 0!==r&&r>t)return!0}}catch(e){i.e(e)}finally{i.f()}return!1}},{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:"getNodeLabelClass",value:function(e){if(D.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 D.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 W:t=Y;break;case V:t=X}return t}},{key:"getMessageLevel",value:function(e){var t="";if(e&&e.length>0){var n,i=zs(e);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(o.type===W)return o.type;o.type===V&&(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 W:t="d3-node-error-label";break;case V:t="d3-node-warning-label"}return t}},{key:"getErrorMarkerClass",value:function(e){var t="d3-error-circle-off";switch(this.getMessageLevel(e)){case W:t="d3-error-circle";break;case V: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 D.isExpandedSupernode(e)?e.x_pos+e.layout.supernodeImagePosX+e.layout.supernodeImageWidth/2:e.x_pos+D.getElementPosX(e.width,e.layout.imagePosX,e.layout.imagePosition)+e.layout.imageWidth/2}},{key:"getNodeImageCenterPosY",value:function(e){return D.isExpandedSupernode(e)?e.y_pos+e.layout.supernodeImagePosY+e.layout.supernodeImageHeight/2:e.y_pos+D.getElementPosY(e.height,e.layout.imagePosY,e.layout.imagePosition)+e.layout.imageHeight/2}},{key:"getNodeImagePosX",value:function(e){return D.isExpandedSupernode(e)?e.layout.supernodeImagePosX:D.getElementPosX(e.width,e.layout.imagePosX,e.layout.imagePosition)}},{key:"getNodeImagePosY",value:function(e){return D.isExpandedSupernode(e)?e.layout.supernodeImagePosY:D.getElementPosY(e.height,e.layout.imagePosY,e.layout.imagePosition)}},{key:"getNodeImageWidth",value:function(e){return D.isExpandedSupernode(e)?e.layout.supernodeImageWidth:e.layout.imageWidth}},{key:"getNodeImageHeight",value:function(e){return D.isExpandedSupernode(e)?e.layout.supernodeImageHeight:e.layout.imageHeight}},{key:"getNodeLabelPosX",value:function(e){if(D.isExpandedSupernode(e))return e.layout.supernodeLabelPosX;var t=D.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 D.isExpandedSupernode(e)?e.layout.supernodeLabelPosY:D.getElementPosY(e.height,e.layout.labelPosY,e.layout.labelPosition)}},{key:"getNodeLabelWidth",value:function(e){return D.isExpandedSupernode(e)?e.width-e.layout.supernodeLabelPosX+e.layout.supernodeErrorPosX:e.layout.labelWidth}},{key:"getNodeLabelHeight",value:function(e){return D.isExpandedSupernode(e)?e.layout.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),r=i?this.getNodeLabelHoverPosX(e):this.getNodeLabelPosX(e),a=t.getBoundingClientRect().width;if("center"===e.layout.labelAlign&&!D.isExpandedSupernode(e)){var s=o/2;return r+s+Math.min(s,a/n/2)}var l=Math.min(o,a/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*Z}},{key:"getNodeLabelTextAreaHeight",value:function(e){return this.getNodeLabelHeight(e)+2*Z}},{key:"getNodeLabelTextAreaPosX",value:function(e){return this.getNodeLabelPosX(e)-Z}},{key:"getNodeLabelTextAreaPosY",value:function(e){return this.getNodeLabelPosY(e)-Z}},{key:"getNodeEllipsisTranslate",value:function(e){return"translate(".concat(this.getNodeEllipsisPosX(e),", ").concat(this.getNodeEllipsisPosY(e),")")}},{key:"getNodeEllipsisWidth",value:function(e){return D.isExpandedSupernode(e)?e.layout.supernodeEllipsisWidth:e.layout.ellipsisWidth}},{key:"getNodeEllipsisHeight",value:function(e){return D.isExpandedSupernode(e)?e.layout.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 D.isExpandedSupernode(e)?e.width+e.layout.supernodeEllipsisPosX:D.getElementPosX(e.width,e.layout.ellipsisPosX,e.layout.ellipsisPosition)}},{key:"getNodeEllipsisPosY",value:function(e){return D.isExpandedSupernode(e)?e.layout.supernodeEllipsisPosY:D.getElementPosY(e.height,e.layout.ellipsisPosY,e.layout.ellipsisPosition)}},{key:"getNodeExpansionIconTranslate",value:function(e){var t=e.width+e.layout.supernodeExpansionIconPosX;return"translate(".concat(t,", ").concat(e.layout.supernodeExpansionIconPosY,")")}},{key:"getNodeErrorPosX",value:function(e){return D.isExpandedSupernode(e)?e.width+e.layout.supernodeErrorPosX:D.getElementPosX(e.width,e.layout.errorXPos,e.layout.errorPosition)}},{key:"getNodeErrorPosY",value:function(e){return D.isExpandedSupernode(e)?e.layout.supernodeErrorPosY:D.getElementPosY(e.height,e.layout.errorYPos,e.layout.errorPosition)}},{key:"getNodeErrorWidth",value:function(e){return D.isExpandedSupernode(e)?e.layout.supernodeErrorWidth:e.layout.errorWidth}},{key:"getNodeErrorHeight",value:function(e){return D.isExpandedSupernode(e)?e.layout.supernodeErrorHeight:e.layout.errorHeight}},{key:"getSupernodePortXOffset",value:function(e,t,n){return t?t.find(function(t){return t.subflow_node_ref===e}).cx-n.layout.supernodeSVGAreaPadding:0}},{key:"getSupernodePortYOffset",value:function(e,t){return t?t.find(function(t){return t.subflow_node_ref===e}).cy:0}},{key:"getNodeImage",value:function(e){if(!e.image)return null;if(e.image===T){if(D.isSupernode(e))return Yt}else if(e.image===N&&D.isSupernode(e))return Kt;return e.image}},{key:"getImageType",value:function(e,t,i){if(e)if("object"===n(e)){if(t&&t.isValidJsxElement(e))return"jsx"}else if("string"==typeof e)return e.endsWith(".svg")&&"SVGAsImage"!==(null==i?void 0:i.enableImageDisplay)?"svg":"image";return null}},{key:"getNodeNearPos",value:function(e,t,n){var i=null,o=t||0;return n.forEach(function(t){e.x>=t.x_pos-o&&e.x<=t.x_pos+t.width+o&&e.y>=t.y_pos-o&&e.y<=t.y_pos+t.height+o&&(i=t)}),i}}])}();function Bs(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Gs(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gs(e,t):void 0}}(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 r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function Gs(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}var Us=function(){return e(function e(){t(this,e)},null,[{key:"getCommentCenterPosX",value:function(e){return e.x_pos+e.width/2}},{key:"getCommentCenterPosY",value:function(e){return e.y_pos+e.height/2}},{key:"insertCommentHighlight",value:function(e,t){var n=(new DOMParser).parseFromString(e,"text/html").getElementsByTagName("body")[0],i=(null==n?void 0:n.innerText)||"",o=new RegExp(t,"gi"),r=i.matchAll(o);if(r){var a,s=Bs(r);try{for(s.s();!(a=s.n()).done;){var l=a.value,c=[];this.searchForElementInfos(n,l.index,l.index+t.length,0,c),this.insertMarkElements(c)}}catch(e){s.e(e)}finally{s.f()}return n.outerHTML}return e}},{key:"searchForElementInfos",value:function(e,t,n,i,o){var r,a=i,s=i,l=Bs(e.childNodes);try{for(l.s();!(r=l.n()).done;){var c=r.value;if(c.nodeType===Node.TEXT_NODE){var u,d=null==c||null===(u=c.textContent)||void 0===u?void 0:u.length;if(s=a+d,a<n&&s>t){var h=t>a?t-a:0,p=n<s?n-a:d;o.push({splitStart:h,splitEnd:p,node:c})}}else c.nodeType===Node.ELEMENT_NODE&&(s=a=this.searchForElementInfos(c,t,n,s,o))}}catch(e){l.e(e)}finally{l.f()}return s}},{key:"insertMarkElements",value:function(e){for(var t=0;t<e.length;t++){var n=e[t],i=n.node,o=i.parentElement,r=i.textContent,a=document.createElement("mark");if(0===n.splitStart&&n.splitEnd===r.length){var s=document.createTextNode(r.slice(0,n.splitEnd));a.appendChild(s),o.replaceChild(a,i)}else if(n.splitStart>0&&n.splitEnd===r.length){var l=document.createTextNode(r.slice(0,n.splitStart)),c=document.createTextNode(r.slice(n.splitStart));a.appendChild(c),o.insertBefore(l,i),o.replaceChild(a,i)}else if(0===n.splitStart&&n.splitEnd<r.length){var u=document.createTextNode(r.slice(0,n.splitEnd)),d=document.createTextNode(r.slice(n.splitEnd));a.appendChild(u),o.insertBefore(a,i),o.replaceChild(d,i)}else{var h=document.createTextNode(r.slice(0,n.splitStart)),p=document.createTextNode(r.slice(n.splitStart,n.splitEnd)),g=document.createTextNode(r.slice(n.splitEnd));a.appendChild(p),o.insertBefore(h,i),o.insertBefore(a,i),o.replaceChild(g,i)}}}}])}();function Ws(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Vs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ws(Object(n),!0).forEach(function(t){It(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ws(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Zs,Xs=!1,Ys=!0,Ks=function(){return e(function e(n,i){t(this,e),this.canvasLayout=i,this.config=n},[{key:"getNewStraightCommentLinkStartPos",value:function(e,t){return D.getOuterCoord(e.x_pos,e.y_pos,e.width,e.height,this.canvasLayout.linkGap,Us.getCommentCenterPosX(e),Us.getCommentCenterPosY(e),t.x,t.y)}},{key:"getNewFreeformNodeLinkStartPos",value:function(e,t,n){var i,o;if("image_center"!==e.layout.drawNodeLinkLineFromTo||D.isExpanded(e))if(n){var r=this.getCenterOffset(e,n,!1);i=r.x,o=r.y}else i=Rs.getNodeCenterPosX(e),o=Rs.getNodeCenterPosY(e);else i=Rs.getNodeImageCenterPosX(e),o=Rs.getNodeImageCenterPosY(e);return D.getOuterCoord(e.x_pos,e.y_pos,e.width,e.height,this.canvasLayout.linkGap,i,o,t.x,t.y)}},{key:"getLinkCoords",value:function(e,t,n,i,o,r){return e.type===K?this.canvasLayout.linkMethod===q?this.getNodeLinkCoordsForFreeform(t,i,e):g.getNodeLinkCoordsForPortsConnection(t,n,i,o):e.type===$?this.config.enableAssocLinkType===J?this.getAssociationCurveLinkCoords(t,i,r):this.getAssociationLinkCoords(t,i):this.getCommentLinkCoords(t,i)}},{key:"getNodeLinkCoordsForFreeform",value:function(e,t,n){var i,o,r,a,s,l,c,u,d=e.id===t.id;if("image_center"!==e.layout.drawNodeLinkLineFromTo||this.canvasLayout.linkType!==Q||D.isExpanded(e))if(n&&n.srcFreeformInfo){var h=this.getCenterOffset(e,n.srcFreeformInfo,d);i=h.x,o=h.y}else i=Rs.getNodeCenterPosX(e),o=Rs.getNodeCenterPosY(e);else i=Rs.getNodeImageCenterPosX(e),o=Rs.getNodeImageCenterPosY(e);if("image_center"!==t.layout.drawNodeLinkLineFromTo||this.canvasLayout.linkType!==Q||D.isExpanded(t))if(n&&n.trgFreeformInfo){var p=this.getCenterOffset(t,n.trgFreeformInfo,d);r=p.x,a=p.y}else r=Rs.getNodeCenterPosX(t),a=Rs.getNodeCenterPosY(t);else r=Rs.getNodeImageCenterPosX(t),a=Rs.getNodeImageCenterPosY(t);if(this.canvasLayout.linkType!==Q||d)return n.srcFreeformInfo.dir===ee?(s=i+this.canvasLayout.linkGap,l=o):n.srcFreeformInfo.dir===te?(s=i-this.canvasLayout.linkGap,l=o):n.srcFreeformInfo.dir===ne?(s=i,l=o+this.canvasLayout.linkGap):n.srcFreeformInfo.dir===ie&&(s=i,l=o-this.canvasLayout.linkGap),n.trgFreeformInfo.dir===ee?(c=r+this.canvasLayout.linkGap,u=a):n.trgFreeformInfo.dir===te?(c=r-this.canvasLayout.linkGap,u=a):n.trgFreeformInfo.dir===ne?(c=r,u=a+this.canvasLayout.linkGap):n.trgFreeformInfo.dir===ie&&(c=r,u=a-this.canvasLayout.linkGap),{originX:0,originY:0,x1:s,y1:l,x2:c,y2:u,srcDir:n.srcFreeformInfo.dir,trgDir:n.trgFreeformInfo.dir};var g=D.getOuterCoord(e.x_pos,e.y_pos,e.width,e.height,this.canvasLayout.linkGap,i,o,r,a),f=D.getOuterCoord(t.x_pos,t.y_pos,t.width,t.height,this.canvasLayout.linkGap,r,a,i,o);return{originX:g.originX,originY:g.originY,x1:g.x,y1:g.y,x2:f.x,y2:f.y,srcDir:g.dir,trgDir:f.dir}}},{key:"getCenterOffset",value:function(e,t,n){var i=t.len+1,o=t.idx+1,r=0,a=0;return t.dir===ie||t.dir===ne?(r=e.x_pos+e.width/i*o,a=this.getYPosForCenterOffset(e,t.dir,n)):t.dir!==ee&&t.dir!==te||(r=this.getXPosForCenterOffset(e,t.dir,n),a=e.y_pos+e.height/i*o),{x:r,y:a}}},{key:"getYPosForCenterOffset",value:function(e,t,n){return this.canvasLayout.linkType!==Q||n?t===ne?e.y_pos+e.height:e.y_pos:Rs.getNodeCenterPosY(e)}},{key:"getXPosForCenterOffset",value:function(e,t,n){return this.canvasLayout.linkType!==Q||n?t===ee?e.x_pos+e.width:e.x_pos:Rs.getNodeCenterPosX(e)}},{key:"getAssociationCurveLinkCoords",value:function(e,t,n){var i=0,o=0;return n===oe?(i=e.width,o=0):n===re?(i=0,o=t.width):n===ae?(i=0,o=0):(i=e.width,o=t.width),{x1:e.x_pos+i,y1:e.y_pos+g.getNodePortPosY(e.layout.outputPortPositions[0],e),x2:t.x_pos+o,y2:t.y_pos+g.getNodePortPosY(t.layout.inputPortPositions[0],t)}}},{key:"getCommentLinkCoords",value:function(e,t){var n,i,o=Us.getCommentCenterPosX(e),r=Us.getCommentCenterPosY(e);"image_center"===t.layout.drawCommentLinkLineTo?(n=Rs.getNodeImageCenterPosX(t),i=Rs.getNodeImageCenterPosY(t)):(n=Rs.getNodeCenterPosX(t),i=Rs.getNodeCenterPosY(t));var a=D.getOuterCoord(e.x_pos,e.y_pos,e.width,e.height,this.canvasLayout.linkGap,o,r,n,i),s=D.getOuterCoord(t.x_pos,t.y_pos,t.width,t.height,this.canvasLayout.linkGap,n,i,o,r);return{x1:a.x,y1:a.y,x2:s.x,y2:s.y}}},{key:"getAssociationLinkCoords",value:function(e,t){var n=Rs.getNodeCenterPosX(e),i=Rs.getNodeCenterPosY(e),o=Rs.getNodeCenterPosX(t),r=Rs.getNodeCenterPosY(t),a=D.getOuterCoord(e.x_pos,e.y_pos,e.width,e.height,this.canvasLayout.linkGap,n,i,o,r),s=D.getOuterCoord(t.x_pos,t.y_pos,t.width,t.height,this.canvasLayout.linkGap,o,r,n,i);return{originX:a.originX,originY:a.originY,x1:a.x,y1:a.y,x2:s.x,y2:s.y,srcDir:a.dir,trgDir:s.dir}}},{key:"addConnectionPaths",value:function(e){var t=this;return e.forEach(function(e){e.coordsUpdated&&(e.pathInfo=t.getConnectorPathInfo(e))}),e}},{key:"getConnectorPathInfo",value:function(e,t){var n=this.getMinInitialLine(e,t);return e.type===K?this.canvasLayout.linkMethod===q&&this.canvasLayout.linkType===Q?this.getStraightPath(e,n):this.getNodeLinkPathInfo(e,n):e.type===$&&this.config.enableAssocLinkType===J?this.getAssociationCurvePath(e,n):this.getStraightPath(e,n)}},{key:"getMinInitialLine",value:function(e,t){return e.type===se?0:e.minInitialLineForElbow?e.minInitialLineForElbow:e.srcObj&&e.srcObj.layout?e.srcObj.layout.minInitialLine:t||30}},{key:"getNodeLinkPathInfo",value:function(e,t){var n,i,o,r,a=e;a.srcObj&&a.trgNode?a.srcDir===ne?(n=-(a.srcObj.x_pos+a.srcObj.width),o=-a.srcObj.x_pos,i=-(a.trgNode.x_pos+a.trgNode.width),r=-a.trgNode.x_pos):a.srcDir===ie?(n=a.srcObj.x_pos,o=a.srcObj.x_pos+a.srcObj.width,i=a.trgNode.x_pos,r=a.trgNode.x_pos+a.trgNode.width):a.srcDir===te?(n=-(a.srcObj.y_pos+a.srcObj.height),o=-a.srcObj.y_pos,i=-(a.trgNode.y_pos+a.trgNode.height),r=-a.trgNode.y_pos):(n=a.srcObj.y_pos,o=a.srcObj.y_pos+a.srcObj.height,i=a.trgNode.y_pos,r=a.trgNode.y_pos+a.trgNode.height):a.srcDir===ne?(n=-a.x1,i=-a.x2,o=-a.x1,r=-a.x2):a.srcDir===ie?(n=a.x1,i=a.x2,o=a.x1,r=a.x2):a.srcDir===te?(n=-a.y1,i=-a.y2,o=-a.y1,r=-a.y2):(n=a.y1,i=a.y2,o=a.y1,r=a.y2),a.srcDir===ne?a=this.rotateData90Degrees(a,Ys):a.srcDir===ie?a=this.rotateData90Degrees(a,Xs):a.srcDir===te&&(a=this.rotateData90Degrees(a,Xs),a=this.rotateData90Degrees(a,Xs)),a.trgDir=this.getRotatedTrgDir(a);var s=a.srcDir;a.srcDir=ee;var l=this.getPathInfo({link:a,minInitialLine:t,topSrc:n,topTrg:i,bottomSrc:o,bottomTrg:r});return a.srcDir=s,a.srcDir===ne?(l.elements=this.rotateElements90Degrees(l.elements,Xs),l.centerPoint=this.rotatePoint90Degrees(l.centerPoint.x,l.centerPoint.y,Xs)):a.srcDir===ie?(l.elements=this.rotateElements90Degrees(l.elements,Ys),l.centerPoint=this.rotatePoint90Degrees(l.centerPoint.x,l.centerPoint.y,Ys)):a.srcDir===te&&(l.elements=this.rotateElements90Degrees(l.elements,Ys),l.elements=this.rotateElements90Degrees(l.elements,Ys),l.centerPoint=this.rotatePoint90Degrees(l.centerPoint.x,l.centerPoint.y,Ys),l.centerPoint=this.rotatePoint90Degrees(l.centerPoint.x,l.centerPoint.y,Ys)),l.path=this.createPath(l.elements),l}},{key:"rotateData90Degrees",value:function(e,t){var n=this.rotatePoint90Degrees(e.x1,e.y1,t),i=this.rotatePoint90Degrees(e.x2,e.y2,t);return Vs(Vs({},e),{},{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:"getRotatedTrgDir",value:function(e){if(e.srcDir===ne)switch(e.trgDir){case ne:return ee;case ie:return te;case te:return ne;default:return ie}else if(e.srcDir===ie)switch(e.trgDir){case ne:return te;case ie:return ee;case te:return ie;default:return ne}else if(e.srcDir===te)switch(e.trgDir){case ne:return ie;case ie:return ne;case te:return ee;default:return te}return e.trgDir}},{key:"getStraightPath",value:function(e,t){if(e.srcNodeId&&e.trgNodeId&&e.srcNodeId===e.trgNodeId)return this.selfRefLinkPath(e,t);if(e.centerDragPos&&"revertLink"!==e.centerDragPos)return this.getStraightPathForCenterDrag(e);var n="M "+e.x1+" "+e.y1+" L "+e.x2+" "+e.y2,i=e.x2-e.x1,o=e.y2-e.y1;return{path:n,centerPoint:{x:e.x1+i/2,y:e.y1+o/2},angle:D.calculateAngle(e.x1,e.y1,e.x2,e.y2)}}},{key:"getStraightPathForCenterDrag",value:function(e){return{path:"M "+e.x1+" "+e.y1+" L "+e.centerDragPos.x+" "+e.centerDragPos.y+" "+e.x2+" "+e.y2,centerPoint:{x:e.centerDragPos.x,y:e.centerDragPos.y},angle:D.calculateAngle(e.centerDragPos.x,e.centerDragPos.y,e.x2,e.y2)}}},{key:"selfRefLinkPath",value:function(e,t){var n=e.y2-t,i=e.x1+t;return{path:"M "+e.x1+" "+e.y1+" L "+i+" "+e.y1+" "+i+" "+n+" "+e.x2+" "+n+" "+e.x2+" "+e.y2,centerPoint:{x:e.x2+(i-e.x2)/2,y:n},angle:180}}},{key:"getAssociationCurvePath",value:function(e,t){return e.assocLinkVariation===re?this.getCurveLeftPath(e,t):e.assocLinkVariation===ae?this.getDoubleBackLeft(e,t):e.assocLinkVariation===le?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,r=e.y2;return{path:"M "+e.x1+" "+e.y1+" C "+n+" "+i+" "+o+" "+r+" "+e.x2+" "+e.y2,centerPoint:{x:n,y:i+(r-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,r=e.y2;return{path:"M "+e.x1+" "+e.y1+" C "+n+" "+i+" "+o+" "+r+" "+e.x2+" "+e.y2,centerPoint:{x:D.getCenterPointCubicBezier(e.x1,n,o,e.x2),y:D.getCenterPointCubicBezier(e.y1,i,r,e.y2)}}}},{key:"getPathInfo",value:function(e){switch(e.minFinalLine=e.link.trgNode?e.link.trgNode.layout.minFinalLine:30,e.link.trgDir){case ie:return this.getPathInfoEN(e);case ne:return this.getPathInfoES(e);case ee:return this.getPathInfoEE(e);default:return this.getPathInfoEW(e)}}},{key:"getPathInfoEW",value:function(e){var t=this.canvasLayout.wrapAroundNodePadding,n=e.link.x2-e.link.x1;if(n>e.minInitialLine+e.minFinalLine||n>0&&e.topSrc-t<e.bottomTrg&&e.bottomSrc+t>e.topTrg){var i={},o={};if(i.x=e.link.x1+e.minInitialLine,i.y=e.link.y1,o.x=i.x,o.y=e.link.y2,n>0){var r=2*e.minInitialLine-n;r>0&&(i.x=e.link.x1+e.minInitialLine-r/2,o.x=i.x)}return this.get3PartLink(e,i,o)}var a={},s={},l={},c={},u=this.calculateMidY(e.link,e.topSrc,e.bottomSrc,e.topTrg,e.bottomTrg);return a.x=e.link.x1+e.minInitialLine,a.y=e.link.y1,s.x=a.x,s.y=u,l.x=e.link.x2-e.minFinalLine,l.y=s.y,c.x=l.x,c.y=e.link.y2,this.get5PartLink(e,a,s,l,c)}},{key:"getPathInfoEE",value:function(e){var t=this.canvasLayout.wrapAroundNodePadding;if(e.topTrg-t<e.link.y1&&e.bottomTrg+t>e.link.y1){var n={},i={},o={},r={};return n.x=e.link.x1+e.minInitialLine,n.y=e.link.y1,i.x=n.x,i.y=e.link.x1>=e.link.x2?e.link.y1+(e.link.y2-e.link.y1)/2:e.topTrg-t,o.x=e.link.x2+e.minFinalLine,o.y=i.y,r.x=o.x,r.y=e.link.y2,e.link.x2<e.link.x1&&(i.y=e.topSrc-t,o.y=i.y),this.get5PartLink(e,n,i,o,r)}var a={},s={};return a.x=Math.max(e.link.x1+e.minInitialLine,e.link.x2+e.minFinalLine),a.y=e.link.y1,s.x=a.x,s.y=e.link.y2,this.get3PartLink(e,a,s)}},{key:"getPathInfoEN",value:function(e){if(e.link.y2>e.link.y1+e.minFinalLine&&e.link.x2>e.link.x1+e.minInitialLine){var t={};return t.x=e.link.x2,t.y=e.link.y1,this.get2PartLink(e,t)}var n={},i={},o={},r=e.link.y2-e.minFinalLine;return e.link.x2<e.link.x1&&(e.topTrg>e.bottomSrc+e.minFinalLine+this.canvasLayout.wrapAroundNodePadding?r=e.topTrg-e.minFinalLine:e.topTrg>e.topSrc&&(r=e.topSrc-this.canvasLayout.wrapAroundNodePadding)),n.x=e.link.x1+e.minInitialLine,n.y=e.link.y1,i.x=n.x,i.y=r,o.x=e.link.x2,o.y=i.y,this.get4PartLink(e,n,i,o)}},{key:"getPathInfoES",value:function(e){if(e.link.y1>e.link.y2+e.minFinalLine&&e.link.x2>e.link.x1){var t={};return t.x=e.link.x2,t.y=e.link.y1,this.get2PartLink(e,t)}var n={},i={},o={},r=e.link.y2+e.minFinalLine;return e.link.x2<e.link.x1&&(e.bottomTrg<e.topSrc-e.minFinalLine-this.canvasLayout.wrapAroundNodePadding?r=e.bottomTrg+e.minFinalLine:e.bottomTrg<e.bottomSrc&&(r=e.bottomSrc+this.canvasLayout.wrapAroundNodePadding)),n.x=e.link.x1+e.minInitialLine,n.y=e.link.y1,i.x=n.x,i.y=r,o.x=e.link.x2,o.y=i.y,this.get4PartLink(e,n,i,o)}},{key:"calculateMidY",value:function(e,t,n,i,o){var r;if(i>=n+this.canvasLayout.wrapAroundNodePadding)r=n+(i-n)/2;else if(o<=t-this.canvasLayout.wrapAroundNodePadding)r=o+(t-o)/2;else{var a=Math.max(n,o),s=a-e.y1,l=a-e.y2,c=Math.min(t,i);r=s+l>e.y1-c+(e.y2-c)?c-this.canvasLayout.wrapAroundSpacing:a+this.canvasLayout.wrapAroundSpacing}return r}},{key:"get2PartLink",value:function(e,t){switch(this.canvasLayout.linkType){case ue:return this.get2PartElbow(e,t);case Q:return this.get2PartStraight(e,t);case ce:return this.get2PartParallax(e,t);default:return this.get2PartCurve(e,t)}}},{key:"get3PartLink",value:function(e,t,n){switch(this.canvasLayout.linkType){case ue:return this.get3PartElbow(e,t,n);case Q:return this.get3PartStraight(e,t,n);case ce:return this.get3PartParallax(e,t,n);default:return this.get3PartCurve(e,t,n)}}},{key:"get4PartLink",value:function(e,t,n,i){switch(this.canvasLayout.linkType){case ue:return this.get4PartElbow(e,t,n,i);case Q:return this.get4PartStraight(e,t,n,i);case ce:return this.get4PartParallax(e,t,n,i);default:return this.get4PartCurve(e,t,n,i)}}},{key:"get5PartLink",value:function(e,t,n,i,o){switch(this.canvasLayout.linkType){case ue:return this.get5PartElbow(e,t,n,i,o);case Q:return this.get5PartStraight(e,t,n,i,o);case ce:return this.get5PartParallax(e,t,n,i,o);default:return this.get5PartCurve(e,t,n,i,o)}}},{key:"get2PartElbow",value:function(e,t){var n=e.link.y2<t.y?-this.canvasLayout.elbowSize:this.canvasLayout.elbowSize;return{elements:[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:t.x-this.canvasLayout.elbowSize,y:t.y},{p:"Q",x:t.x,y:t.y,x2:t.x,y2:t.y+n},{p:"L",x:e.link.x2,y:e.link.y2}],centerPoint:{x:e.link.x1+(e.link.x2-e.link.x1)/2,y:e.link.y1}}}},{key:"get3PartElbow",value:function(e,t,n){var i=this.canvasLayout.elbowSize,o=this.adjustElbowSize(n.y,t.y),r=e.link.x2>n.x?this.canvasLayout.elbowSize:-this.canvasLayout.elbowSize;return{elements:[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:t.x-i,y:t.y},{p:"Q",x:t.x,y:t.y,x2:t.x,y2:t.y+o},{p:"L",x:n.x,y:n.y-o},{p:"Q",x:n.x,y:n.y,x2:n.x+r,y2:n.y},{p:"L",x:e.link.x2,y:e.link.y2}],centerPoint:{x:t.x,y:e.link.y1+(e.link.y2-e.link.y1)/2}}}},{key:"get4PartElbow",value:function(e,t,n,i){var o=this.canvasLayout.elbowSize,r=this.adjustElbowSize(n.y,t.y),a=this.adjustElbowSize(t.x,i.x),s=i.y>e.link.y2?this.canvasLayout.elbowSize:-this.canvasLayout.elbowSize;return{elements:[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:t.x-o,y:t.y},{p:"Q",x:t.x,y:t.y,x2:t.x,y2:t.y+r},{p:"L",x:n.x,y:n.y-r},{p:"Q",x:n.x,y:n.y,x2:n.x-a,y2:n.y},{p:"L",x:i.x+a,y:i.y},{p:"Q",x:i.x,y:i.y,x2:i.x,y2:i.y-s},{p:"L",x:e.link.x2,y:e.link.y2}],centerPoint:{x:n.x+(i.x-n.x)/2,y:n.y}}}},{key:"get5PartElbow",value:function(e,t,n,i,o){var r=this.canvasLayout.elbowSize,a=this.adjustElbowSize(n.y,t.y),s=this.adjustElbowSize(t.x,i.x),l=this.adjustElbowSize(i.y,o.y),c=e.link.x2<o.x?-this.canvasLayout.elbowSize:this.canvasLayout.elbowSize;return{elements:[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:t.x-r,y:t.y},{p:"Q",x:t.x,y:t.y,x2:t.x,y2:t.y+a},{p:"L",x:n.x,y:n.y-a},{p:"Q",x:n.x,y:n.y,x2:n.x-s,y2:n.y},{p:"L",x:i.x+s,y:i.y},{p:"Q",x:i.x,y:i.y,x2:i.x,y2:i.y-l},{p:"L",x:o.x,y:o.y+l},{p:"Q",x:o.x,y:o.y,x2:o.x+c,y2:o.y},{p:"L",x:e.link.x2,y:e.link.y2}],centerPoint:{x:n.x+(i.x-n.x)/2,y:n.y}}}},{key:"adjustElbowSize",value:function(e,t){var n=this.canvasLayout.elbowSize,i=t-e;return i<2*this.canvasLayout.elbowSize&&i>-2*this.canvasLayout.elbowSize&&(n=Math.abs(i)/2),n=i>0?-n:n}},{key:"get2PartParallax",value:function(e,t){var n=e.link.y2>e.link.y1?-e.minFinalLine:e.minFinalLine,i={},o={};return i.x=e.link.x1+e.minInitialLine,i.y=t.y,o.x=t.x,o.y=e.link.y2+n,{elements:[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:i.x,y:t.y},{p:"L",x:o.x,y:o.y},{p:"L",x:e.link.x2,y:e.link.y2}],centerPoint:{x:i.x+(t.x-i.x)/2,y:i.y+(o.y-i.y)/2}}}},{key:"get3PartParallax",value:function(e,t,n){var i,o={x:0,y:0};if(e.link.x2>n.x){var r={};r.x=e.link.x2-Math.min(e.minFinalLine,e.link.x2-t.x),r.y=e.link.y2,i=[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:t.x,y:t.y},{p:"L",x:r.x,y:r.y},{p:"L",x:e.link.x2,y:e.link.y2}],o={x:t.x+(r.x-t.x)/2,y:t.y+(r.y-t.y)/2}}else e.link.x2<e.link.x1+e.minInitialLine?(i=[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:t.x,y:t.y},{p:"L",x:Math.max(n.x,e.link.x2),y:e.link.y2},{p:"L",x:e.link.x2,y:e.link.y2}],o={x:e.link.x2+(n.x-e.link.x2)/2,y:n.y}):(i=[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:t.x,y:t.y},{p:"L",x:e.link.x2+e.minFinalLine,y:e.link.y2},{p:"L",x:e.link.x2,y:e.link.y2}],o={x:t.x,y:t.y+(e.link.y2-t.y)/2});return{elements:i,centerPoint:o}}},{key:"get4PartParallax",value:function(e,t,n,i){return{elements:[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:t.x,y:t.y},{p:"L",x:n.x,y:n.y},{p:"L",x:i.x,y:i.y},{p:"L",x:e.link.x2,y:e.link.y2}],centerPoint:{x:i.x+(n.x-i.x)/2,y:n.y}}}},{key:"get5PartParallax",value:function(e,t,n,i,o){return{elements:[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:t.x,y:t.y},{p:"L",x:n.x,y:n.y},{p:"L",x:i.x,y:i.y},{p:"L",x:o.x,y:o.y},{p:"L",x:e.link.x2,y:e.link.y2}],centerPoint:{x:i.x+(n.x-i.x)/2,y:n.y}}}},{key:"get2PartStraight",value:function(e,t){return{elements:[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:e.link.x2,y:e.link.y2}],centerPoint:{x:e.link.x1+(e.link.x2-e.link.x1)/2,y:e.link.y1+(e.link.y2-e.link.y1)/2}}}},{key:"get3PartStraight",value:function(e,t,n){var i,o={x:0,y:0};return n.x<e.link.x2?(i=[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:e.link.x2,y:e.link.y2}],o={x:e.link.x1+(e.link.x2-e.link.x1)/2,y:e.link.y1+(e.link.y2-e.link.y1)/2}):e.link.x2<e.link.x1?(i=[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:t.x,y:n.y},{p:"L",x:e.link.x2,y:e.link.y2}],o={x:e.link.x2+(n.x-e.link.x2)/2,y:n.y}):(i=[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:t.x+e.minFinalLine,y:t.y},{p:"L",x:e.link.x2,y:e.link.y2}],o={x:e.link.x1+(t.x-e.link.x1)/2,y:e.link.y1}),{elements:i,centerPoint:o}}},{key:"get4PartStraight",value:function(e,t,n,i){return{elements:[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:e.link.x1+e.minInitialLine,y:n.y},{p:"L",x:e.link.x2,y:n.y},{p:"L",x:e.link.x2,y:e.link.y2}],centerPoint:{x:i.x+(n.x-i.x)/2,y:n.y}}}},{key:"get5PartStraight",value:function(e,t,n,i,o){var r=o.x>e.link.x2?e.minFinalLine:-e.minFinalLine;return{elements:[{p:"M",x:e.link.x1,y:e.link.y1},{p:"L",x:t.x,y:n.y},{p:"L",x:e.link.x2+r,y:n.y},{p:"L",x:e.link.x2+r,y:e.link.y2},{p:"L",x:e.link.x2,y:e.link.y2}],centerPoint:{x:i.x+(n.x-i.x)/2,y:n.y}}}},{key:"get2PartCurve",value:function(e,t){return{elements:[{p:"M",x:e.link.x1,y:e.link.y1},{p:"Q",x:t.x,y:t.y,x2:e.link.x2,y2:e.link.y2}],centerPoint:{x:D.getCenterPointQuadBezier(e.link.x1,t.x,e.link.x2),y:D.getCenterPointQuadBezier(e.link.y1,t.y,e.link.y2)}}}},{key:"get3PartCurve",value:function(e,t,n){var i,o;if(t.x>e.link.x2)i=[{p:"M",x:e.link.x1,y:e.link.y1},{p:"C",x:t.x+80,y:t.y,x2:n.x+20,y2:n.y,x3:e.link.x2,y3:e.link.y2}],o={x:D.getCenterPointCubicBezier(e.link.x1,t.x+80,n.x,e.link.x2),y:D.getCenterPointCubicBezier(e.link.y1,t.y,n.y,e.link.y2)};else{var r={};r.x=e.link.x1+(e.link.x2-e.link.x1)/2,i=[{p:"M",x:e.link.x1,y:e.link.y1},{p:"C",x:r.x,y:t.y,x2:r.x,y2:n.y,x3:e.link.x2,y3:e.link.y2}],o={x:r.x,y:t.y+(n.y-t.y)/2}}return{elements:i,centerPoint:o}}},{key:"get4PartCurve",value:function(e,t,n,i){var o=e.link.x2-t.x,r=Math.min(200,Math.abs(o)),a=o>0?-r/2:r/2,s={},l={},c={};return s.x=t.x,s.y=t.y+(n.y-t.y)/2,l.x=n.x-a,l.y=n.y,c.x=i.x+a,c.y=n.y,{elements:[{p:"M",x:e.link.x1,y:e.link.y1},{p:"Q",x:t.x,y:t.y,x2:s.x,y2:s.y},{p:"Q",x:n.x,y:n.y,x2:l.x,y2:l.y},{p:"L",x:c.x,y:c.y},{p:"Q",x:i.x,y:i.y,x2:e.link.x2,y2:e.link.y2}],centerPoint:l}}},{key:"get5PartCurve",value:function(e,t,n,i,o){var r=o.x-t.x,a=Math.min(200,Math.abs(r)),s=r>0?-a/2:a/2,l={},c={},u={},d={};return l.x=t.x,l.y=t.y+(n.y-t.y)/2,c.x=n.x-s,c.y=n.y,u.x=i.x+s,u.y=n.y,d.x=i.x,d.y=e.link.y2-(e.link.y2-i.y)/2,{elements:[{p:"M",x:e.link.x1,y:e.link.y1},{p:"Q",x:t.x,y:t.y,x2:l.x,y2:l.y},{p:"Q",x:n.x,y:n.y,x2:c.x,y2:c.y},{p:"L",x:u.x,y:u.y},{p:"Q",x:i.x,y:i.y,x2:d.x,y2:d.y},{p:"Q",x:o.x,y:o.y,x2:e.link.x2,y2:e.link.y2}],centerPoint:c}}},{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}}])}(),qs=function(){return e(function e(n){t(this,e),this.canvasLayout=n},[{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-entry")+("center"===e.label_align?" d3-label-center":"")}},{key:"getDecTransform",value:function(e,t,n){var i=this.getDecRotateTransform(e,t,n);return"translate(".concat(this.getDecPosX(e,t,n),", ").concat(this.getDecPosY(e,t,n),")")+i}},{key:"getDecRotateTransform",value:function(e,t,n){if("link"===n&&e.rotate){var i="source"===e.position?D.getLinkEndAngle(t,de,this.canvasLayout):D.getLinkEndAngle(t,he,this.canvasLayout);return" rotate(".concat(i,")")}return""}},{key:"getDecPosX",value:function(e,t,n){return n===pe?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;if("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&&P(t,"pathInfo.angle")){var r=t.pathInfo.angle*(Math.PI/180);o+=Math.cos(r)*e.distance}return"center"===e.label_align&&(o-=this.getDecWidth(e,t,n)/2),o}},{key:"getDecPosY",value:function(e,t,n){return n===pe?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;if("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&&P(t,"pathInfo.angle")){var o=t.pathInfo.angle*(Math.PI/180);i+=Math.sin(o)*e.distance}return i}},{key:"getDecPadding",value:function(e,t,n){return!1===e.outline?0:n===pe?this.canvasLayout.linkDecoratorPadding:t.layout.decoratorPadding}},{key:"getDecWidth",value:function(e,t,n){return void 0!==e.width?Number(e.width):n===pe?this.canvasLayout.linkDecoratorWidth:t.layout.decoratorWidth}},{key:"getDecHeight",value:function(e,t,n){return void 0!==e.height?Number(e.height):n===pe?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){var r=Math.min(i.getBoundingClientRect().width,this.getDecLabelWidth(e,t,n));return"center"===e.label_align?this.getDecLabelWidth(e,t,n)/2+r/2/o:r/o}},{key:"getDecLabelEditIconPosY",value:function(e){return 0}},{key:"getDecLabelWidth",value:function(e,t,n){return void 0!==e.width?Number(e.width):n===pe?this.canvasLayout.linkDecoratorLabelWidth:t.layout.decoratorLabelWidth}},{key:"getDecLabelHeight",value:function(e,t,n){return void 0!==e.height?Number(e.height):n===pe?this.canvasLayout.linkDecoratorLabelHeight:t.layout.decoratorLabelHeight}},{key:"getDecLabelTextAreaWidth",value:function(e,t,n){return this.getDecLabelWidth(e,t,n)+2*Z}},{key:"getDecLabelTextAreaHeight",value:function(e,t,n){return this.getDecLabelHeight(e,t,n)+2*Z}},{key:"getDecLabelTextAreaPosX",value:function(){return-Z}},{key:"getDecLabelTextAreaPosY",value:function(){return-(Z-1)}}])}(),$s=jt;if("production"===process.env.NODE_ENV)Zs=$s.createRoot,$s.hydrateRoot;else{var Js=$s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Zs=function(e,t){Js.usingClientEntryPoint=!0;try{return $s.createRoot(e,t)}finally{Js.usingClientEntryPoint=!1}}}var Qs=function(){return e(function e(n){t(this,e),this.logger=new gt("SVGCanvasExternal"),this.ren=n},[{key:"isValidJsxElement",value:function(e){return a.isValidElement(e)}},{key:"isReact18OrHigher",value:function(){return Number(a.version.split(".")[0])>=18}},{key:"addNodeExternalObject",value:function(e,t,n,i){var o=a.createElement(e.layout.nodeExternalObject,{nodeData:e,pipelineData:i,canvasController:this.ren.canvasController,externalUtils:this});this.renderExternalObject(o,n[t])}},{key:"addNodeImageExternalObject",value:function(e,t,n){this.renderExternalObject(e,n[t])}},{key:"addDecExternalObject",value:function(e,t,n){this.renderExternalObject(e.jsx,n[t])}},{key:"addJsxExternalObject",value:function(e,t,n){this.renderExternalObject(e,n[t])}},{key:"renderExternalObject",value:function(e,t){this.isReact18OrHigher()?(t.ccExtRoot||(t.ccExtRoot=Zs(t)),t.ccExtRoot.render(e)):jt.render(e,t)}},{key:"removeExternalObject",value:function(e,t,n){if(this.isReact18OrHigher()){var i=n[t];i.ccExtRoot||(i.ccExtRoot=Zs(i)),setTimeout(function(){i.ccExtRoot.unmount(),i.ccExtRoot=null})}else jt.unmountComponentAtNode(n[t])}},{key:"getActiveNodes",value:function(){return this.ren.activePipeline.getNodes()}},{key:"getActiveNode",value:function(e){return this.ren.activePipeline.getNode(e)}},{key:"setPortPositions",value:function(e){var t=this.ren.activePipeline.getNode(e.nodeId),n=this.ren.zoomUtils.getZoomScale();e.inputPositions&&e.inputPositions.forEach(function(e){var i=t.inputs.find(function(t){return t.id===e.id});i.cx=e.cx/n,i.cy=e.cy/n,i.dir=D.getPortDir(i.cx,i.cy,t)}),e.outputPositions&&e.outputPositions.forEach(function(e){var i=t.outputs.find(function(t){return t.id===e.id});i.cx=e.cx/n,i.cy=e.cy/n,i.dir=D.getPortDir(i.cx,i.cy,t)}),this.ren.displayMovedLinks()}},{key:"setNodesProperties",value:function(e){var t=this;e&&(e.forEach(function(e){var n=t.ren.activePipeline.getNode(e.id);e.height&&(n.height=e.height),e.width&&(n.width=e.width),e.x_pos&&(n.x_pos=e.x_pos),e.y_pos&&(n.y_pos=e.y_pos)}),this.ren.displayNodes())}},{key:"raiseNodeToTopById",value:function(e){this.ren.raiseNodeToTopById(e)}}])}(),el=ls({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),tl=U,nl=el,il=/&(?:amp|lt|gt|quot|#39);/g,ol=RegExp(il.source);var rl=function(e){return(e=tl(e))&&ol.test(e)?e.replace(il,nl):e},al=function(){return e(function e(){t(this,e)},null,[{key:"processMarkdownAction",value:function(e,t,n,i){var o=n,r=i,a=null;switch(o===r?(o=this.findFirstSpace(t,o),r=this.findLastSpace(t,r)):this.allWhiteSpace(t,o,r)?o=r:(o=this.findFirstNonSpace(t,o,r),r=this.findLastNonSpace(t,o,r)),e){case"title":case"header":case"subheader":case"body":case"increaseHashes":case"decreaseHashes":a=this.processHeaderCommand(t,o,r,e);break;case"bold":a=this.processWrapCommand(t,o,r,"**");break;case"italics":a=this.processWrapCommand(t,o,r,"_");break;case"strikethrough":a=this.processWrapCommand(t,o,r,"~~");break;case"code":a=this.processCodeCommand(t,o,r);break;case"link":a=this.processLinkCommand(t,o,r);break;case"quote":case"numberedList":case"bulletedList":a=this.processMultiLineCommand(t,o,r,e);break;case"return":a=this.processReturnCommand(t,o,r,n,i)}return a}},{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),r=this.findSucceedingNewLine(e,n),a=e.slice(0,o),s=e.slice(o,r),l=e.slice(r),c=o,u=r,d="",h=s,p=this.getHashCount(s);if(p>0){var g=s.indexOf(" ");d=a+(h=s.slice(g+1))+l,u-=g+1}var f=this.getHeaderSyntax(i,p);return f&&(d=a+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="",r=t,a=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),r=t-u,a=n-u):l.startsWith(i)&&l.endsWith(i)?(o=s+l.slice(0,l.length-u).slice(u)+c,r=t,a=n-2*u):(o=s+i+l+i+c,r=t+u,a=n+u),{newText:o,newStart:r,newEnd:a}}},{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.findSucceedingNewLine(e,n),r=e.slice(0,i),a=e.slice(i,o),s=e.slice(o),l=i,c=o,u="";return r.endsWith("```\n")&&s.startsWith("\n```")?(u=r.slice(0,i-4)+a+s.slice(4),l-=4,c-=4):(u=r+"```\n"+a+"\n```"+s,l+=4,c+=4),{newText:u,newStart:l,newEnd:c}}},{key:"processLinkCommand",value:function(e,t,n){var i="",o=t,r=n,a=e.slice(0,t),s=e.slice(t,n),l=e.slice(n);return a.endsWith("[")&&l.startsWith("](url)")?(i=a.slice(0,a.length-1)+s+l.slice(6),o=t-1,r=n-1):"[](url)"===s?(i=a+l,r=o=t):t===n?(i=a+"[](url)"+l,o=t+1,r=t+1):(i=a+"["+s+"](url)"+l,o=t+1,r=n+1),{newText:i,newStart:o,newEnd:r}}},{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,r=this.findPrecedingNewLine(e,t),a=this.findSucceedingNewLine(e,n);return e.slice(r,a).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,r=this.findPrecedingNewLine(e,t),a=this.findSucceedingNewLine(e,n),s=e.slice(0,r),l=e.slice(r,a),c=e.slice(a),u=r,d=a,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,r=this.findPrecedingNewLine(e,t),a=this.findSucceedingNewLine(e,n),s=e.slice(0,r),l=e.slice(r,a),c=e.slice(a),u=r,d=a,h=s;if(""===l){var p=this.getListPrefix(i,1);h=s+p+c,u=r+p.length,d=u}else{var g=l.split("\n");g.forEach(function(e,t){var n=o.getListPrefix(i,t+1,e);d+=n.length-e.length,h+=n,t===g.length-1&&(h.endsWith("\n")||!c||c.startsWith("\n\n"))||(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:"findSucceedingNewLine",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 r=this.findPrecedingNewLine(e,t),a=this.findSucceedingNewLine(e,n),s=e.slice(0,r),l=e.slice(r,a),c=e.slice(a);if(!this.isCursorAtBeginningOfLine(r,i,o)){if(this.isMultiLineItem(l,"quote"))return this.insertMultiLineItem(">",s,l,c,a);if(this.isMultiLineItem(l,"bulletedList"))return this.insertMultiLineItem("*",s,l,c,a);if(this.isMultiLineItem(l,"numberedList")){var u=this.getPrefixNumber(l)+1,d=this.renumberEndText(c,u);return this.insertMultiLineItem(u+".",s,l,d,a)}}return null}},{key:"isCursorAtBeginningOfLine",value:function(e,t,n){return t===n&&t===e}},{key:"insertMultiLineItem",value:function(e,t,n,i,o){var r=t+n+"\n"+e+" "+i,a=o+2+e.length;return{newText:r,newStart:a,newEnd:a}}},{key:"renumberEndText",value:function(e,t){var n=this,i=e.split("\n"),o="",r=!1;return i.forEach(function(e,i){n.isMultiLineItem(e,"numberedList")&&!1===r?o+=n.renumberLine(e,t+i):(o+=e,i>0&&(r=!0))}),o}},{key:"renumberLine",value:function(e,t){var n=e.indexOf(". ");return t+". "+e.slice(n+2)}}])}(),sl=Object.assign({},os),ll="#FFFFFF",cl="#000000",ul=function(){return e(function e(n,i,o,r,a,s,l,c,u,d,h,p){t(this,e),this.config=n,this.dispUtils=i,this.decUtils=o,this.canvasController=r,this.canvasDiv=a,this.activePipeline=s,this.removeTempCursorOverlay=l,this.displayCommentsCallback=c,this.displayLinksCallback=u,this.getCommentToolbarPosCallback=d,this.addCanvasZoomBehavior=h,this.removeCanvasZoomBehavior=p,this.logger=new gt("SvgCanvasTextArea"),this.editingText=!1,this.editingTextId="",this.addingTextToTextArea=!1,this.textAreaHeight=null},[{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,focusReturn:e,text:e.content,singleLine:!1,maxCharacters:null,allowReturnKey:!0,textCanBeEmpty:!0,xPos:0,yPos:0,width:e.width,height:e.height,autoSize:e.autoSize,contentType:e.contentType,formats:e.formats,newFormats:Et(e.formats),parentDomObj:t,keyboardInputCallback:e.contentType!==F&&this.config.enableMarkdownInComments?this.commentKeyboardHandler.bind(this):null,autoSizeCallback:this.autoSizeComment.bind(this),saveTextChangesCallback:this.saveCommentChanges.bind(this),closeTextAreaCallback:this.closeCommentTextArea.bind(this)},this.displayEditableComment(this.editingTextData),this.dispUtils.isDisplayingFullPage()){var n=this.getCommentToolbarPosCallback(e);e.contentType===F?this.canvasController.openTextToolbar(n.x,n.y,this.editingTextData.newFormats,F,this.wysiwygActionHandler.bind(this),this.blurInTextToolbar.bind(this)):this.config.enableMarkdownInComments&&this.canvasController.openTextToolbar(n.x,n.y,null,R,this.markdownActionHandler.bind(this),this.blurInTextToolbar.bind(this))}}},{key:"commentKeyboardHandler",value:function(e){var t=this.getMarkdownAction(e);t&&("return"!==t&&D.stopPropagationAndPreventDefault(e),this.markdownActionHandler(t,e))}},{key:"blurInTextToolbar",value:function(e){this.addingTextToTextArea||e.relatedTarget&&(D.getParentElementWithClass(e.relatedTarget,"d3-comment-text-entry")||D.getParentElementWithClass(e.relatedTarget,"text-toolbar")||D.getParentElementWithClass(e.relatedTarget,"cds--overflow-menu-options__btn"))||this.completeEditing(e)}},{key:"getMarkdownAction",value:function(e){return pt.boldCommand(e)?"bold":pt.italicsCommand(e)?"italics":pt.strikethroughCommand(e)?"strikethrough":pt.numberedListCommand(e)?"numberedList":pt.bulletedListCommand(e)?"bulletedList":pt.codeCommand(e)?"code":pt.linkCommand(e)?"link":pt.quoteCommand(e)?"quote":pt.incHashesCommand(e)?"increaseHashes":pt.decHashesCommand(e)?"decreaseHashes":pt.returnCommand(e)?"return":null}},{key:"markdownActionHandler",value:function(e,t){this.logger.log("markdownActionHandler - action = "+e);var n=this.canvasDiv.selectAll(".d3-comment-text-entry").node(),i=D.getSelectionPositions(n),o=n.innerText;if(o.endsWith("\n")&&(o=o.slice(0,o.length-1)),o){var r=al.processMarkdownAction(e,o,i.start,i.end);r&&(t.preventDefault(),this.addTextToTextArea(r,n))}}},{key:"wysiwygActionHandler",value:function(e,t,n){this.logger.log("wysiwygActionHandler - action = "+e+" editParam = "+n),this.editingTextData.newFormats||(this.editingTextData.newFormats=[]),"align-left"===e||"align-center"===e||"align-right"===e?this.addReplaceFormat("alignHorizontally",e):"align-top"===e||"align-middle"===e||"align-bottom"===e?this.addReplaceFormat("alignVertically",e):"underline"===e||"strikethrough"===e?this.addAdditionalFormat("textDecoration",e):"text-color"===e?this.addReplaceFormat("textColor",n):"background-color"===e?(this.addReplaceFormat("backgroundColor",n),this.setTextColorAppropriately(n)):e.startsWith("text-size")?this.addReplaceFormat("textSize",e):e.startsWith("font")?this.addReplaceFormat("fontType",e):e.startsWith("outline")?this.addReplaceFormat("outlineStyle",e):"bold"!==e&&"italics"!==e||this.toggleFormat(e),this.canvasController.updateTextToolbarFormats(this.editingTextData.newFormats)}},{key:"setTextColorAppropriately",value:function(e){var t=this.hasFormat("textColor");if(!t||t.value===ll||t.value===cl){var n=D.isDarkColor(e);this.addReplaceFormat("textColor",n?ll:cl)}}},{key:"toggleFormat",value:function(e){this.hasFormat(e)?this.removeFormat(e):this.addFormat(e)}},{key:"hasFormat",value:function(e){var t;return null===(t=this.editingTextData.newFormats)||void 0===t?void 0:t.find(function(t){return t.type===e})}},{key:"addReplaceFormat",value:function(e,t){var n=this.hasFormat(e);n?n.value=t:(n={type:e,value:t},this.editingTextData.newFormats.push(n));var i=D.convertFormat(n),o=i.field,r=i.value;o&&r&&this.setWysiwygStyle(o,r)}},{key:"addAdditionalFormat",value:function(e,t){var n=this.hasFormat(e);if(n)if(n.value.includes(t)){if(n.value=n.value.replace(t,"").trim(),!n.value)return void this.removeFormat(e)}else n.value+=" "+t;else n={type:e,value:t},this.editingTextData.newFormats.push(n);var i=D.convertFormat(n),o=i.field,r=i.value;o&&r&&this.setWysiwygStyle(o,r)}},{key:"addFormat",value:function(e){var t={type:e};this.editingTextData.newFormats.push(t);var n=D.convertFormat(t),i=n.field,o=n.value;i&&o&&this.setWysiwygStyle(i,o)}},{key:"removeFormat",value:function(e){var t;this.editingTextData.newFormats=null===(t=this.editingTextData.newFormats)||void 0===t?void 0:t.filter(function(t){return t.type!==e});var n=D.convertFormat({type:e}).field;n&&this.setWysiwygStyle(n,null)}},{key:"setWysiwygStyle",value:function(e,t){"background-color"===e&&"transparent"===t&&sl.select(this.editingTextData.parentDomObj).selectAll(".d3-comment-text").style("background-color","transparent");var n=this.foreignObjectComment.selectAll(".d3-comment-text-entry");n.style(e,t),n.node().focus()}},{key:"focusOnTextEntryElement",value:function(e){this.foreignObjectComment.selectAll(".d3-comment-text-entry").node().focus()}},{key:"addTextToTextArea",value:function(e,t){this.addingTextToTextArea=!0;var n=rl(e.newText);t.focus(),D.selectNodeContents(t),document.execCommand("insertText",!1,n),D.selectNodeRange(t,e.newStart,e.newEnd),this.addingTextToTextArea=!1}},{key:"autoSizeComment",value:function(e,t){if(this.logger.log("autoSizeComment - textAreaHt = "+this.textAreaHeight+" scroll ht = "+e.scrollHeight),t.autoSize){var n=this.foreignObjectLabel?12:2,i=e.scrollHeight+n;this.textAreaHeight<i&&(this.textAreaHeight=i,this.foreignObjectLabel?this.foreignObjectLabel.style("height",this.textAreaHeight+"px"):this.foreignObjectComment&&this.foreignObjectComment.style("height",this.textAreaHeight+"px"),this.activePipeline.getComment(t.id).height=this.textAreaHeight,this.displayCommentsCallback(),this.displayLinksCallback())}else this.commentHasScrollableText(t.parentDomObj)?this.removeCanvasZoomBehavior():this.addCanvasZoomBehavior()}},{key:"commentHasScrollableText",value:function(e){var t=e.getElementsByClassName("d3-comment-text-entry-scroll");return t[0].clientHeight<t[0].scrollHeight}},{key:"saveCommentChanges",value:function(e,t,n){var i=this.activePipeline.getComment(e.id),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,contentType:e.contentType,formats:e.newFormats,pipelineId:this.activePipeline.id};this.canvasController.editActionHandler(o)}},{key:"closeCommentTextArea",value:function(){this.canvasController.closeTextToolbar()}},{key:"displayNodeLabelTextArea",value:function(e,t){this.displayDiv=sl.select(t).selectAll(".d3-foreign-object-node-label div"),this.displayDivStyle=this.displayDiv.attr("style"),this.displayDiv.attr("style","display:none;"),this.editingTextData={id:e.id,focusReturn:e,text:e.label,singleLine:e.layout.labelSingleLine,maxCharacters:e.layout.labelMaxCharacters,allowReturnKey:e.layout.labelAllowReturnKey,textCanBeEmpty:!1,xPos:Rs.getNodeLabelTextAreaPosX(e),yPos:Rs.getNodeLabelTextAreaPosY(e),width:Rs.getNodeLabelTextAreaWidth(e),height:Rs.getNodeLabelTextAreaHeight(e),autoSize:!0,className:Rs.getNodeLabelTextAreaClass(e),parentDomObj:t,autoSizeCallback:this.autoSizeMultiLineLabel.bind(this),saveTextChangesCallback:this.saveNodeLabelChanges.bind(this),closeTextAreaCallback:this.closeEntryTextArea.bind(this)},this.displayEditableLabel(this.editingTextData)}},{key:"autoSizeMultiLineLabel",value:function(e,t){if(this.logger.log("autoSizeNodeLabel - textAreaHt = "+this.textAreaHeight+" scroll ht = "+e.scrollHeight),t.maxCharacters&&e.value.length>t.maxCharacters&&(e.value=e.value.substring(0,t.maxCharacters)),this.foreignObjectLabel){this.foreignObjectLabel.style("height",0);var n=e.scrollHeight+12;this.textAreaHeight=n,this.foreignObjectLabel.style("height",this.textAreaHeight+"px")}}},{key:"saveNodeLabelChanges",value:function(e,t){var n={editType:"setNodeLabel",editSource:"canvas",nodeId:e.id,label:t,pipelineId:this.activePipeline.id};this.canvasController.editActionHandler(n)}},{key:"closeEntryTextArea",value:function(){this.displayDiv.attr("style",this.displayDivStyle)}},{key:"displayDecLabelTextArea",value:function(e,t,n,i){this.displayDiv=sl.select(i).selectAll(".d3-foreign-object-dec-label div"),this.displayDivStyle=this.displayDiv.attr("style"),this.displayDiv.attr("style","display:none;"),this.editingTextData={id:e.id,focusReturn:t,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),autoSize:!0,className:this.decUtils.getDecLabelTextAreaClass(e),parentDomObj:i,objId:t.id,objType:n,autoSizeCallback:this.autoSizeMultiLineLabel.bind(this),saveTextChangesCallback:this.saveDecLabelChanges.bind(this),closeTextAreaCallback:this.closeEntryTextArea.bind(this)},this.displayEditableLabel(this.editingTextData)}},{key:"saveDecLabelChanges",value:function(e,t){var n={editType:"editDecorationLabel",editSource:"canvas",decId:e.id,objId:e.objId,objType:e.objType,label:t,pipelineId:this.activePipeline.id};this.canvasController.editActionHandler(n)}},{key:"displayEditableLabel",value:function(e){this.textAreaHeight=e.height,this.editingText=!0,this.editingTextId=e.id,this.foreignObjectLabel=sl.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);var t=this.foreignObjectLabel.append("xhtml:textarea").attr("class",e.className).text(rl(e.text)).call(this.attachTextEntryListeners.bind(this));t.node().focus(),t.node().setSelectionRange(e.text.length,e.text.length)}},{key:"completeEditing",value:function(e){if(this.removeTempCursorOverlay(),this.foreignObjectLabel){var t=this.foreignObjectLabel.selectAll("textarea").node();this.textContentSaved=!0,this.saveAndCloseTextArea(this.editingTextData,t,e)}else if(this.foreignObjectComment){var n=this.foreignObjectComment.selectAll(".d3-comment-text-entry").node();this.textContentSaved=!0,this.saveAndCloseTextArea(this.editingTextData,n,e)}}},{key:"saveAndCloseTextArea",value:function(e,t,n){var i=this.foreignObjectComment?t.innerText:t.value;if(!i&&!e.textCanBeEmpty)return this.closeTextArea(e),void D.stopPropagationAndPreventDefault(n);var o=i;this.closeTextArea(e),e.text===o&&this.textAreaHeight===e.height&&this.areFormatsTheSame(e.formats,e.newFormats)?(sl.select(e.parentDomObj).selectAll(".d3-comment-text").style("display","table-cell"),this.canvasController.restoreFocus()):e.saveTextChangesCallback(e,o,this.textAreaHeight)}},{key:"areFormatsTheSame",value:function(e,t){var n=this;return!e&&!t||!(e&&!t||!e&&t)&&(e.length===t.length&&e.filter(function(e){return n.formatArrayIncludes(e,t)}).length===e.length)}},{key:"formatArrayIncludes",value:function(e,t){return t.find(function(t){return f(e,t)&&f(e,e)})}},{key:"resetHeightOfTextDisplay",value:function(e){var t=this.activePipeline.getComment(e.id);t&&(t.height=e.height,this.displayCommentsCallback(),this.displayLinksCallback())}},{key:"closeTextArea",value:function(e){e.closeTextAreaCallback&&e.closeTextAreaCallback(e.id),this.foreignObjectLabel?(this.foreignObjectLabel.remove(),this.foreignObjectLabel=null):this.foreignObjectComment&&(sl.select(this.editingTextData.parentDomObj).selectAll(".d3-foreign-object-comment-text").style("display",null),this.foreignObjectComment.remove(),this.foreignObjectComment=null),this.editingText=!1,this.editingTextId="",this.canvasController.setFocusObject(e.focusReturn,null,!0)}},{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&&pt.isMetaKey(e)}},{key:"displayEditableComment",value:function(e){this.textAreaHeight=e.height,this.editingText=!0,this.editingTextId=e.id,sl.select(e.parentDomObj).selectAll(".d3-foreign-object-comment-text").style("display","none"),this.foreignObjectComment=sl.select(e.parentDomObj).append("foreignObject").attr("class","d3-foreign-object-comment-text-entry").attr("width",e.width).attr("height",e.height).attr("x",e.xPos).attr("y",e.yPos),this.foreignObjectComment.append("xhtml:div").attr("class","d3-comment-text-entry-scroll").on("mousedown",function(e){D.stopPropagationAndPreventDefault(e)}).each(function(e,t,n){var i=sl.select(n[t]);D.applyOutlineStyle(i,e.formats)}).append("xhtml:div").attr("class","d3-comment-text-entry-outer").append("xhtml:div").attr("class","d3-comment-text-entry").attr("contentEditable",this.getContentEditableValue()).each(function(e,t,n){var i=sl.select(n[t]);D.applyNonOutlineStyle(i,e.formats)}).text(rl(e.text)).call(this.attachTextEntryListeners.bind(this));var t,n=this.canvasDiv.selectAll(".d3-comment-text-entry").node();(n.focus(),n.childNodes.length>0)&&this.setCursor(n.childNodes[0],(null===(t=e.text)||void 0===t?void 0:t.length)||0);n.scrollIntoView({behavior:"instant",block:"end"})}},{key:"getContentEditableValue",value:function(){return!!navigator.userAgent.includes("Firefox")||"plaintext-only"}},{key:"setCursor",value:function(e,t,n){var i=document.createRange(),o=window.getSelection();i.setStart(e,t),n?i.setEnd(e,n):i.collapse(!0),o.removeAllRanges(),o.addRange(i)}},{key:"attachTextEntryListeners",value:function(e){var t=this,n=this.editingTextData;e.on("keydown",function(e){if(pt.returnCommand(e)){if("save"===n.allowReturnKey||pt.completeTextEntry(e))return t.textContentSaved=!0,void t.saveAndCloseTextArea(n,e.target,e);!n.singleLine&&n.allowReturnKey||D.stopPropagationAndPreventDefault(e)}pt.cancelTextEntry(e)&&(D.stopPropagationAndPreventDefault(e),t.textAreaEscKeyPressed=!0,t.closeTextArea(n),t.resetHeightOfTextDisplay(n),t.canvasController.restoreFocus()),n.maxCharacters&&e.target.value.length>=n.maxCharacters&&!t.textAreaAllowedKeys(e)&&D.stopPropagationAndPreventDefault(e),n.keyboardInputCallback&&n.keyboardInputCallback(e),e.stopPropagation()}).on("keyup",function(e){n.autoSizeCallback(e.target,n)}).on("paste",function(e){t.logger.log("Text area - Paste - Scroll Ht = "+e.target.scrollHeight),setTimeout(n.autoSizeCallback,500,e.target,n)}).on("blur",function(e,i){t.logger.log("Text area - blur"),(t.foreignObjectComment||t.foreignObjectLabel)&&(t.textAreaEscKeyPressed?t.textAreaEscKeyPressed=!1:t.textContentSaved?t.textContentSaved=!1:e.relatedTarget&&D.getParentElementWithClass(e.relatedTarget,"text-toolbar")||t.saveAndCloseTextArea(n,e.target,e))}).on("focus",function(e,i){t.logger.log("Text area - focus"),n.autoSizeCallback(e.target,n),n.height=t.textAreaHeight}).on("mousedown mouseenter mouseleave click dblclick contextmenu",function(e,t){e.stopPropagation()})}}])}(),dl={value:()=>{}};function hl(){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 pl(i)}function pl(e){this._=e}function gl(e,t){for(var n,i=0,o=e.length;i<o;++i)if((n=e[i]).name===t)return n.value}function fl(e,t,n){for(var i=0,o=e.length;i<o;++i)if(e[i].name===t){e[i]=dl,e=e.slice(0,i).concat(e.slice(i+1));break}return null!=n&&e.push({name:t,value:n}),e}pl.prototype=hl.prototype={constructor:pl,on:function(e,t){var n,i,o=this._,r=(i=o,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!i.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),a=-1,s=r.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a<s;)if(n=(e=r[a]).type)o[n]=fl(o[n],e.name,t);else if(null==t)for(n in o)o[n]=fl(o[n],e.name,null);return this}for(;++a<s;)if((n=(e=r[a]).type)&&(n=gl(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new pl(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,i,o=new Array(n),r=0;r<n;++r)o[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=0,n=(i=this._[e]).length;r<n;++r)i[r].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,r=i.length;o<r;++o)i[o].value.apply(t,n)}};const vl={passive:!1},yl={capture:!0,passive:!1};function ml(e){e.stopImmediatePropagation()}function bl(e){e.preventDefault(),e.stopImmediatePropagation()}function kl(e){var t=e.document.documentElement,n=Ja(e).on("dragstart.drag",bl,yl);"onselectstart"in t?n.on("selectstart.drag",bl,yl):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function xl(e,t){var n=e.document.documentElement,i=Ja(e).on("dragstart.drag",null);t&&(i.on("click.drag",bl,yl),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 Cl=e=>()=>e;function Pl(e,{sourceEvent:t,subject:n,target:i,identifier:o,active:r,x:a,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:r,enumerable:!0,configurable:!0},x:{value:a,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 Ll(e){return!e.ctrlKey&&!e.button}function wl(){return this.parentNode}function Sl(e,t){return null==t?{x:e.x,y:e.y}:t}function Tl(){return navigator.maxTouchPoints||"ontouchstart"in this}Pl.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var Nl=Object.freeze({__proto__:null,drag:function(){var e,t,n,i,o=Ll,r=wl,a=Sl,s=Tl,l={},c=hl("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,vl).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,s){if(!i&&o.call(this,a,s)){var l=b(this,r.call(this,a,s),a,s,"mouse");l&&(Ja(a.view).on("mousemove.drag",g,yl).on("mouseup.drag",f,yl),kl(a.view),ml(a),n=!1,e=a.clientX,t=a.clientY,l("start",a))}}function g(i){if(bl(i),!n){var o=i.clientX-e,r=i.clientY-t;n=o*o+r*r>d}l.mouse("drag",i)}function f(e){Ja(e.view).on("mousemove.drag mouseup.drag",null),xl(e.view,n),bl(e),l.mouse("end",e)}function v(e,t){if(o.call(this,e,t)){var n,i,a=e.changedTouches,s=r.call(this,e,t),l=a.length;for(n=0;n<l;++n)(i=b(this,s,e,t,a[n].identifier,a[n]))&&(ml(e),i("start",e,a[n]))}}function y(e){var t,n,i=e.changedTouches,o=i.length;for(t=0;t<o;++t)(n=l[i[t].identifier])&&(bl(e),n("drag",e,i[t]))}function m(e){var t,n,o=e.changedTouches,r=o.length;for(i&&clearTimeout(i),i=setTimeout(function(){i=null},500),t=0;t<r;++t)(n=l[o[t].identifier])&&(ml(e),n("end",e,o[t]))}function b(e,t,n,i,o,r){var s,d,p,g=c.copy(),f=is(r||n,t);if(null!=(p=a.call(e,new Pl("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(r,a,c){var v,y=f;switch(r){case"start":l[o]=n,v=u++;break;case"end":delete l[o],--u;case"drag":f=is(c||a,t),v=u}g.call(r,e,new Pl(r,{sourceEvent:a,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:Cl(!!e),h):o},h.container=function(e){return arguments.length?(r="function"==typeof e?e:Cl(e),h):r},h.subject=function(e){return arguments.length?(a="function"==typeof e?e:Cl(e),h):a},h.touchable=function(e){return arguments.length?(s="function"==typeof e?e:Cl(!!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:kl,dragEnable:xl}),Dl=Object.assign({},Nl,os),Ol=function(){return e(function e(n){t(this,e),this.ren=n,this.logger=new gt("SVGCanvasUtilsDragObjects"),this.resizeObjInitialInfo=null,this.commentSizing=!1,this.commentSizingDirection=null,this.commentSizingCursor="",this.nodeSizing=!1,this.nodeSizingDirection=null,this.nodeSizingCursor="",this.nodeSizingObjectsInfo={},this.nodeSizingDetLinksInfo={},this.notSnappedXPos=0,this.notSnappedYPos=0,this.notSnappedWidth=0,this.notSnappedHeight=0,this.movingObjectData=null,this.existingNodeInsertableIntoLink=!1,this.existingNodeAttachableToDetachedLinks=!1,this.dragObjectHandler=Dl.drag().on("start",this.dragStartObject.bind(this)).on("drag",this.dragObject.bind(this)).on("end",this.dragEndObject.bind(this))},[{key:"getDragObjectHandler",value:function(){return this.dragObjectHandler}},{key:"isSizing",value:function(){return this.nodeSizing||this.commentSizing}},{key:"isMoving",value:function(){return this.movingObjectData}},{key:"mouseEnterNodeSizingArea",value:function(e,t){if(D.isNodeResizable(t,this.ren.config)&&!this.ren.isRegionSelectOrSizingInProgress()){var n="default";this.isPointerCloseToBodyEdge(e,t)||(this.nodeSizingDirection=this.getSizingDirection(e,t,t.layout.nodeCornerResizeArea),this.nodeSizingCursor=this.getCursorBasedOnDirection(this.nodeSizingDirection),n=this.nodeSizingCursor),Dl.select(e.currentTarget).style("cursor",n)}}},{key:"mouseDownNodeSizingArea",value:function(e){D.isNodeResizable(e,this.ren.config)&&(this.nodeSizing=!0,this.ren.addTempCursorOverlay(this.nodeSizingCursor))}},{key:"mouseLeaveNodeSizingArea",value:function(e){Dl.select(e.currentTarget).style("cursor","default")}},{key:"mouseEnterCommentSizingArea",value:function(e,t){if(this.ren.config.enableEditingActions&&!this.ren.isRegionSelectOrSizingInProgress()){var n="default";this.isPointerCloseToBodyEdge(e,t)||(this.commentSizingDirection=this.getSizingDirection(e,t,this.ren.canvasLayout.commentCornerResizeArea),this.commentSizingCursor=this.getCursorBasedOnDirection(this.commentSizingDirection),n=this.commentSizingCursor),Dl.select(e.currentTarget).style("cursor",n)}}},{key:"mouseDownCommentSizingArea",value:function(){this.commentSizing=!0,this.ren.addTempCursorOverlay(this.commentSizingCursor)}},{key:"mouseLeaveCommentSizingArea",value:function(e){Dl.select(e.currentTarget).style("cursor","default")}},{key:"moveObject",value:function(e,t){var n,i,o=this,r=this.getMoveIncrements(t);n=r.xInc,i=r.yInc,this.endMove&&(clearTimeout(this.endMove),this.endMove=null),this.isMoving()||this.startObjectsMoving(e);var a=e.x_pos+e.width/2,s=e.y_pos+e.height/2,l=this.ren.convertCanvasCoordsToPageCoords(a,s);this.moveObjects(n,i,l.x,l.y),this.endMove=setTimeout(function(){o.endObjectsMoving(e,!1,!1)},500)}},{key:"sizeObject",value:function(e,t){var n,i,o=this,r=t,a=this.getMoveIncrements(r);(n=a.xInc,i=a.yInc,r===ie?r=ne:r===te&&(r=ee),this.endSize&&(clearTimeout(this.endSize),this.endSize=null),this.isSizing())||("node"===D.getObjectTypeName(e)?this.nodeSizing=!0:this.commentSizing=!0,this.initializeResizeVariables(e));this.nodeSizing?this.resizeNode(n,i,e,r):this.commentSizing&&this.resizeComment(n,i,e,r),this.endSize=setTimeout(function(){o.nodeSizing?(o.endNodeSizing(e),o.nodeSizing=!1):o.commentSizing&&(o.endCommentSizing(e),o.commentSizing=!1)},500)}},{key:"dragStartObject",value:function(e,t){this.logger.logStartTimer("dragStartObject"),this.ren.closeContextMenuIfOpen(),this.commentSizing||this.nodeSizing?this.initializeResizeVariables(t):this.startObjectsMoving(t),this.logger.logEndTimer("dragStartObject",!0)}},{key:"dragObject",value:function(e,t){this.logger.logStartTimer("dragObject"),this.commentSizing?this.resizeComment(e.dx,e.dy,t,this.commentSizingDirection):this.nodeSizing?this.resizeNode(e.dx,e.dy,t,this.nodeSizingDirection):this.moveObjects(e.dx,e.dy,e.sourceEvent.clientX,e.sourceEvent.clientY),this.logger.logEndTimer("dragObject",!0)}},{key:"dragEndObject",value:function(e,t){this.logger.logStartTimer("dragEndObject"),this.ren.removeTempCursorOverlay(),this.commentSizing?(this.endCommentSizing(t),this.commentSizing=!1):this.nodeSizing?(this.endNodeSizing(t),this.nodeSizing=!1):this.endObjectsMoving(t,e.sourceEvent.shiftKey,pt.isMetaKey(e.sourceEvent)),this.logger.logEndTimer("dragEndObject",!0)}},{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:"isPointerCloseToBodyEdge",value:function(e,t){var n=this.ren.getTransformedMousePos(e),i=t.x_pos+t.width,o=t.y_pos+t.height,r=n.x>=i&&n.x<=i+1&&n.y>=0&&n.y<=o,a=n.y>=o&&n.y<=o+1&&n.x>=0&&n.x<=i;return r||a}},{key:"getSizingDirection",value:function(e,t,n){var i="",o="",r=this.ren.getTransformedMousePos(e);return r.x<t.x_pos+n?i="w":r.x>t.x_pos+t.width-n&&(i="e"),r.y<t.y_pos+n?o="n":r.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:"resizeNode",value:function(e,t,n,i){var o=Object.assign({},n),r=this.getMinHeight(n),a=this.getMinWidth(n),s=this.resizeObject(e,t,n,i,a,r);if(s&&(0!==s.x_pos||0!==s.y_pos||0!==s.width||0!==s.height)){if(D.isExpandedSupernode(n)&&this.ren.config.enableMoveNodesOnSupernodeResize){var l=D.moveSurroundingObjects(o,this.ren.activePipeline.getNodesAndComments(),i,n.width,n.height,!0),c=D.moveSurroundingDetachedLinks(o,this.ren.activePipeline.links,i,n.width,n.height,!0);this.nodeSizingObjectsInfo=Object.assign(this.nodeSizingObjectsInfo,l),this.nodeSizingDetLinksInfo=Object.assign(this.nodeSizingDetLinksInfo,c)}this.logger.logStartTimer("displayObjects"),this.ren.displayMovedComments(),this.ren.displayMovedNodes(),this.ren.displaySingleNode(n),this.ren.displayMovedLinks(),this.ren.displayCanvasAccoutrements(),this.logger.logEndTimer("displayObjects")}}},{key:"resizeComment",value:function(e,t,n,i){this.resizeObject(e,t,n,i,20,20),this.ren.displaySingleComment(n),this.ren.displayMovedLinks(),this.ren.displayCanvasAccoutrements()}},{key:"resizeObject",value:function(e,t,n,i,o,r){var a=0,s=0,l=0,c=0;i.indexOf("e")>-1&&(l+=e),i.indexOf("s")>-1&&(c+=t),i.indexOf("n")>-1&&(s+=t,c-=t),i.indexOf("w")>-1&&(a+=e,l-=e);var u=0,d=0,h=0,p=0;if(this.ren.config.enableSnapToGridType===ge?(this.notSnappedXPos+=a,this.notSnappedYPos+=s,this.notSnappedWidth+=l,this.notSnappedHeight+=c,u=D.snapToGrid(this.notSnappedXPos,this.ren.canvasLayout.snapToGridXPx),d=D.snapToGrid(this.notSnappedYPos,this.ren.canvasLayout.snapToGridYPx),h=D.snapToGrid(this.notSnappedWidth,this.ren.canvasLayout.snapToGridXPx),p=D.snapToGrid(this.notSnappedHeight,this.ren.canvasLayout.snapToGridYPx),h=Math.max(h,o),p=Math.max(p,r)):(u=n.x_pos+a,d=n.y_pos+s,h=n.width+l,p=n.height+c),h<o||p<r)return null;var g={width:h-n.width,height:p-n.height,x_pos:u-n.x_pos,y_pos:d-n.y_pos};return n.x_pos=u,n.y_pos=d,n.width=h,n.height=p,g}},{key:"endNodeSizing",value:function(e){var t=e;this.ren.config.enableSnapToGridType===fe&&(t=this.snapToGridObject(t),t=this.restrictNodeSizingToMinimums(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.ren.canvasController.editActionHandler({editType:"resizeObjects",editSource:"canvas",objectsInfo:this.nodeSizingObjectsInfo,detachedLinksInfo:this.nodeSizingDetLinksInfo,pipelineId:this.ren.activePipeline.id}),this.nodeSizingObjectsInfo={})}},{key:"endCommentSizing",value:function(e){var t=e;if(this.ren.config.enableSnapToGridType===fe&&(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.ren.activePipeline.id};this.ren.canvasController.editActionHandler(i)}}},{key:"restrictNodeSizingToMinimums",value:function(e){var t=this.getMinHeight(e),n=this.getMinWidth(e);return e.width=Math.max(e.width,n),e.height=Math.max(e.height,t),e}},{key:"getMinHeight",value:function(e){if(D.isExpandedSupernode(e)){var t=Math.max(e.inputPortsHeight,e.outputPortsHeight)+this.ren.canvasLayout.supernodeTopAreaHeight+this.ren.canvasLayout.supernodeSVGAreaPadding;return Math.max(this.ren.canvasLayout.supernodeMinHeight,t)}return e.layout.defaultNodeHeight}},{key:"getMinWidth",value:function(e){return D.isExpandedSupernode(e)?this.ren.canvasLayout.supernodeMinWidth:e.layout.defaultNodeWidth}},{key:"startObjectsMoving",value:function(e){var t,n=this;this.existingNodeInsertableIntoLink=!1,this.existingNodeAttachableToDetachedLinks=!1,this.movingObjectData={offsetX:0,offsetY:0,runningX:0,runningY:0,objects:this.getMoveObjects(e).filter(function(e){return D.isObjectMovable(e)})},(null===(t=this.movingObjectData.objects)||void 0===t?void 0:t.length)>0&&(this.movingObjectData.startX=this.movingObjectData.objects[0].x_pos,this.movingObjectData.startY=this.movingObjectData.objects[0].y_pos,this.switchIsMovingClass(this.movingObjectData.objects,!0)),this.isExistingNodeInsertableIntoLink()&&(this.startNodeInsertingInLink=setTimeout(function(){n.existingNodeInsertableIntoLink=!0,n.setNodeTranslucentState(n.movingObjectData.objects[0].id,!0),n.ren.setDataLinkSelectionAreaWider(!0)},200)),this.isExistingNodeAttachableToDetachedLinks()&&(this.startNodeAttachingToDetachedLinks=setTimeout(function(){n.existingNodeAttachableToDetachedLinks=!0,n.setNodeTranslucentState(n.movingObjectData.objects[0].id,!0)},200))}},{key:"moveObjects",value:function(e,t,n,i){if(this.movingObjectData.offsetX+=e,this.movingObjectData.offsetY+=t,this.ren.dispUtils.isDisplayingSubFlowInPlace()&&(this.movingObjectData.offsetX>1e3||this.movingObjectData.offsetX<-1e3||this.movingObjectData.offsetY>1e3||this.movingObjectData.offsetY<-1e3))this.movingObjectData.offsetX-=e,this.movingObjectData.offsetY-=t;else{var o={x:0,y:0};if(this.ren.config.enableSnapToGridType===ge){var r=this.snapToGridMovedNode(this.movingObjectData);o={x:r.x-this.movingObjectData.objects[0].x_pos,y:r.y-this.movingObjectData.objects[0].y_pos}}else o={x:e,y:t};this.movingObjectData.runningX+=o.x,this.movingObjectData.runningY+=o.y,this.movingObjectData.objects.forEach(function(e){e.x_pos+=o.x,e.y_pos+=o.y}),this.ren.config.enableLinkSelection===ve&&this.ren.activePipeline.getSelectedLinks().forEach(function(e){e.srcPos&&(e.srcPos.x_pos+=o.x,e.srcPos.y_pos+=o.y),e.trgPos&&(e.trgPos.x_pos+=o.x,e.trgPos.y_pos+=o.y)})}if(!this.ren.config.enableDragWithoutSelect||!D.isTinyMovement({x:0,y:0},{x:this.movingObjectData.offsetX,y:this.movingObjectData.offsetY})){if(this.ren.displayMovedComments(),this.ren.displayMovedNodes(),this.ren.displayMovedLinks(),this.ren.displayCanvasAccoutrements(),this.ren.dispUtils.isDisplayingSubFlowInPlace()&&this.ren.displaySVGToFitSupernode(),this.existingNodeInsertableIntoLink){var a=this.ren.getLinkAtMousePos(n,i);(!a||this.ren.isLinkFullyAttached(a)&&this.movingObjectData.objects[0].id!==a.srcNodeId&&this.movingObjectData.objects[0].id!==a.trgNodeId)&&this.ren.setInsertNodeIntoLinkHighlighting(a)}if(this.existingNodeAttachableToDetachedLinks){var s=this.movingObjectData.objects[0],l={x1:s.x_pos,y1:s.y_pos,x2:s.x_pos+s.width,y2:s.y_pos+s.height},c=this.ren.getAttachableLinksForNodeAtPos(s,l);this.ren.setDetachedLinkHighlighting(c)}}}},{key:"endObjectsMoving",value:function(e,t,n){var i=this.movingObjectData;if(this.movingObjectData=null,clearTimeout(this.startNodeInsertingInLink),clearTimeout(this.startNodeAttachingToDetachedLinks),this.switchIsMovingClass(i.objects,!1),this.ren.config.enableDragWithoutSelect&&D.isTinyMovement({x:0,y:0},{x:i.offsetX,y:i.offsetY}))this.ren.selectObject(e,ye,t,n);else if(0!==i.runningX||0!==i.runningY){var o=null;if(this.ren.config.enableSnapToGridType===fe){var r=this.snapToGridMovedNode(i);o={x:r.x-i.startX,y:r.y-i.startY}}else o={x:i.runningX,y:i.runningY};this.existingNodeInsertableIntoLink&&this.ren.dragOverLink?this.ren.canvasController.editActionHandler({editType:"insertNodeIntoLink",editSource:"canvas",node:i.objects[0],link:this.ren.dragOverLink,offsetX:o.x,offsetY:o.y,pipelineId:this.ren.activePipeline.id}):this.existingNodeAttachableToDetachedLinks&&this.ren.dragOverDetachedLinks.length>0?this.ren.canvasController.editActionHandler({editType:"attachNodeToLinks",editSource:"canvas",node:i.objects[0],detachedLinks:this.ren.dragOverDetachedLinks,offsetX:o.x,offsetY:o.y,pipelineId:this.ren.activePipeline.id}):this.ren.canvasController.editActionHandler({editType:"moveObjects",editSource:"canvas",nodes:i.objects.map(function(e){return e.id}),links:this.ren.activePipeline.getSelectedDetachedLinks(),offsetX:o.x,offsetY:o.y,pipelineId:this.ren.activePipeline.id})}this.ren.setDataLinkSelectionAreaWider(!1),this.unsetNodeTranslucentState(i.objects),this.ren.unsetInsertNodeIntoLinkHighlighting(),this.ren.unsetDetachedLinkHighlighting()}},{key:"getMoveObjects",value:function(e){var t=this.ren.activePipeline.getSelectedNodesAndComments();if(this.ren.config.enableDragWithoutSelect&&-1===t.findIndex(function(t){return t.id===e.id}))return[e];if(this.ren.config.enableMoveNodesInComment&&D.isComment(e)){var n=this.objsInComment(e,this.ren.activePipeline.nodes);t=D.concatUniqueBasedOnId(n,t)}return t}},{key:"objsInComment",value:function(e,t){return t.filter(function(t){return t.x_pos>e.x_pos&&t.y_pos>e.y_pos&&t.x_pos+t.width<e.x_pos+e.width&&t.y_pos+t.height<e.y_pos+e.height})}},{key:"switchIsMovingClass",value:function(e,t){var n=this;e.forEach(function(e){D.isNode(e)?n.ren.getNodeGroupSelectionById(e.id).classed("d3-is-moving",t):n.ren.getCommentGroupSelectionById(e.id).classed("d3-is-moving",t)})}},{key:"isExistingNodeInsertableIntoLink",value:function(){return this.ren.config.enableInsertNodeDroppedOnLink&&1===this.movingObjectData.objects.length&&D.isNode(this.movingObjectData.objects[0])&&D.hasInputAndOutputPorts(this.movingObjectData.objects[0])&&!D.isNodeDefaultPortsCardinalityAtMax(this.movingObjectData.objects[0],this.ren.activePipeline.links)}},{key:"isExistingNodeAttachableToDetachedLinks",value:function(){return this.ren.config.enableLinkSelection===ve&&1===this.movingObjectData.objects.length&&D.isNode(this.movingObjectData.objects[0])}},{key:"setNodeTranslucentState",value:function(e,t){this.ren.getNodeGroupSelectionById(e).classed("d3-node-group-translucent",t)}},{key:"unsetNodeTranslucentState",value:function(e){(null==e?void 0:e.length)>0&&this.setNodeTranslucentState(e[0].id,!1)}},{key:"snapToGridMovedNode",value:function(e){var t=e.startX+e.offsetX,n=e.startY+e.offsetY;return this.ren.snapToGridPosition({x:t,y:n})}},{key:"snapToGridObject",value:function(e){var t=e;return t.x_pos=D.snapToGrid(t.x_pos,this.ren.canvasLayout.snapToGridXPx),t.y_pos=D.snapToGrid(t.y_pos,this.ren.canvasLayout.snapToGridYPx),t.width=D.snapToGrid(t.width,this.ren.canvasLayout.snapToGridXPx),t.height=D.snapToGrid(t.height,this.ren.canvasLayout.snapToGridYPx),t}},{key:"getMoveIncrements",value:function(e){var t=10,n=10;this.ren.config.enableSnapToGridType!==ge&&this.ren.config.enableSnapToGridType!==fe||(t=this.ren.canvasLayout.snapToGridXPx,n=this.ren.canvasLayout.snapToGridYPx);var i=0,o=0;switch(e){case ie:i=0,o=-n;break;case ne:i=0,o=n;break;case ee:i=t,o=0;break;default:i=-t,o=0}return{xInc:i,yInc:o}}}])}(),El=Object.assign({},Nl,os),Il=function(){return e(function e(n){t(this,e),this.ren=n,this.logger=new gt("SVGCanvasUtilsDragLink"),this.isDraggingLink=!1,this.dragLinkHandler=El.drag().on("start",this.dragLinkStart.bind(this)).on("drag",this.dragLink.bind(this)).on("end",this.dragLinkEnd.bind(this))},[{key:"getDragLinkHandler",value:function(){return this.dragLinkHandler}},{key:"isDragging",value:function(){return this.isDraggingLink}},{key:"dragLinkStart",value:function(e,t){this.logger.logStartTimer("dragLinkStart"),this.ren.closeContextMenuIfOpen(),this.isDraggingLink=!0,this.dragLink=this.ren.activePipeline.getLink(t.id),this.logger.logEndTimer("dragLinkStart",!0)}},{key:"dragLink",value:function(e){this.logger.logStartTimer("dragLink"),this.dragLink.centerDragPos=this.ren.getTransformedMousePos(e),this.ren.displayLinks(),this.ren.raiseLinkToTopByIdPreserveFocus(this.dragLink.id);var t=this.ren.getNodeNearMousePos(e,this.ren.canvasLayout.nodeProximity),n=this.ren.activePipeline.links,i=this.dragLink.srcObj,o=this.dragLink.trgNode;this.targetNode=t&&D.isNodeAttachableToDefaultPorts(t,n)&&!D.linkAlreadyExists(i.outputs[0].id,t.inputs[0].id,i,t,n)&&!D.linkAlreadyExists(t.outputs[0].id,o.inputs[0].id,t,o,n)?t:null;var r=!!this.targetNode;this.ren.setHighlightingOverNode(r,this.targetNode),this.logger.logEndTimer("dragLink",!0)}},{key:"dragLinkEnd",value:function(){this.logger.logStartTimer("dragLinkEnd"),this.ren.removeTempCursorOverlay(),this.isDraggingLink=!1,this.targetNode?(delete this.dragLink.centerDragPos,this.ren.setLinkOverNodeCancel(),this.ren.canvasController.editActionHandler({editType:"insertNodeIntoLink",editSource:"canvas",node:this.targetNode,srcPort:this.targetNode.outputs[0],trgPort:this.targetNode.inputs[0],link:this.dragLink,offsetX:0,offsetY:0,pipelineId:this.ren.activePipeline.id})):(this.dragLink.centerDragPos="revertLink",this.ren.displayLinks()),this.logger.logEndTimer("dragLinkEnd",!0)}}])}();function Al(e){return((e*=2)<=1?e*e:--e*(2-e)+1)/2}function jl(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var _l=function e(t){function n(e){return Math.pow(e,t)}return t=+t,n.exponent=e,n}(3),Ml=function e(t){function n(e){return 1-Math.pow(1-e,t)}return t=+t,n.exponent=e,n}(3),zl=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),Hl=Math.PI,Fl=Hl/2;function Rl(e){return(1-Math.cos(Hl*e))/2}function Bl(e){return 1.0009775171065494*(Math.pow(2,-10*e)-.0009765625)}function Gl(e){return((e*=2)<=1?Bl(1-e):2-Bl(e-1))/2}function Ul(e){return((e*=2)<=1?1-Math.sqrt(1-e*e):Math.sqrt(1-(e-=2)*e)+1)/2}var Wl=4/11,Vl=6/11,Zl=8/11,Xl=9/11,Yl=10/11,Kl=21/22,ql=7.5625;function $l(e){return(e=+e)<Wl?ql*e*e:e<Zl?ql*(e-=Vl)*e+.75:e<Yl?ql*(e-=Xl)*e+.9375:ql*(e-=Kl)*e+.984375}var Jl=1.70158,Ql=function e(t){function n(e){return(e=+e)*e*(t*(e-1)+e)}return t=+t,n.overshoot=e,n}(Jl),ec=function e(t){function n(e){return--e*e*((e+1)*t+e)+1}return t=+t,n.overshoot=e,n}(Jl),tc=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}(Jl),nc=2*Math.PI,ic=function e(t,n){var i=Math.asin(1/(t=Math.max(1,t)))*(n/=nc);function o(e){return t*Bl(- --e)*Math.sin((i-e)/n)}return o.amplitude=function(t){return e(t,n*nc)},o.period=function(n){return e(t,n)},o}(1,.3),oc=function e(t,n){var i=Math.asin(1/(t=Math.max(1,t)))*(n/=nc);function o(e){return 1-t*Bl(e=+e)*Math.sin((e+i)/n)}return o.amplitude=function(t){return e(t,n*nc)},o.period=function(n){return e(t,n)},o}(1,.3),rc=function e(t,n){var i=Math.asin(1/(t=Math.max(1,t)))*(n/=nc);function o(e){return((e=2*e-1)<0?t*Bl(-e)*Math.sin((i-e)/n):2-t*Bl(e)*Math.sin((i+e)/n))/2}return o.amplitude=function(t){return e(t,n*nc)},o.period=function(n){return e(t,n)},o}(1,.3),ac=Object.freeze({__proto__:null,easeLinear:e=>+e,easeQuad:Al,easeQuadIn:function(e){return e*e},easeQuadOut:function(e){return e*(2-e)},easeQuadInOut:Al,easeCubic:jl,easeCubicIn:function(e){return e*e*e},easeCubicOut:function(e){return--e*e*e+1},easeCubicInOut:jl,easePoly:zl,easePolyIn:_l,easePolyOut:Ml,easePolyInOut:zl,easeSin:Rl,easeSinIn:function(e){return 1===+e?1:1-Math.cos(e*Fl)},easeSinOut:function(e){return Math.sin(e*Fl)},easeSinInOut:Rl,easeExp:Gl,easeExpIn:function(e){return Bl(1-+e)},easeExpOut:function(e){return 1-Bl(e)},easeExpInOut:Gl,easeCircle:Ul,easeCircleIn:function(e){return 1-Math.sqrt(1-e*e)},easeCircleOut:function(e){return Math.sqrt(1- --e*e)},easeCircleInOut:Ul,easeBounce:$l,easeBounceIn:function(e){return 1-$l(1-e)},easeBounceOut:$l,easeBounceInOut:function(e){return((e*=2)<=1?1-$l(1-e):$l(e-1)+1)/2},easeBack:tc,easeBackIn:Ql,easeBackOut:ec,easeBackInOut:tc,easeElastic:oc,easeElasticIn:ic,easeElasticOut:oc,easeElasticInOut:rc});function sc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function lc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sc(Object(n),!0).forEach(function(t){It(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var cc=Object.assign({},Nl,ac,os),uc=function(){return e(function e(n){t(this,e),this.ren=n,this.logger=new gt("SVGCanvasUtilsDragNewLink"),this.drawingNewLinkData=null,this.dragNewLinkHandler=cc.drag().on("start",this.dragStartNewLink.bind(this)).on("drag",this.dragMoveNewLink.bind(this)).on("end",this.dragEndNewLink.bind(this))},[{key:"getDragNewLinkHandler",value:function(){return this.dragNewLinkHandler}},{key:"isDragging",value:function(){return this.drawingNewLinkData}},{key:"dragStartNewLink",value:function(e,t){if(this.isEventForOutputPort(e)){var n=this.getNodeForPort(e);this.beginNewLinkCallback(t,n),this.startOutputPortNewLink(e,t,n)}else if(this.isEventForInputPort(e)){var i=this.getNodeForPort(e);this.beginNewLinkCallback(t,i),this.startInputPortNewLink(e,t,i)}else"comment"===this.ren.activePipeline.getObjectTypeName(t)&&this.startCommentNewLink(e,t)}},{key:"dragMoveNewLink",value:function(e){this.drawNewLink(e)}},{key:"dragEndNewLink",value:function(e){this.completeNewLink(e)}},{key:"isEventForInputPort",value:function(e){return this.targetContainsClass(e,"d3-node-port-input")||this.targetContainsClass(e,"d3-node-port-input-assoc")}},{key:"isEventForOutputPort",value:function(e){return this.targetContainsClass(e,"d3-node-port-output")||this.targetContainsClass(e,"d3-node-port-output-assoc")}},{key:"targetContainsClass",value:function(e,t){var n;return null===(n=e.sourceEvent)||void 0===n||null===(n=n.currentTarget)||void 0===n||null===(n=n.classList)||void 0===n?void 0:n.contains(t)}},{key:"getNodeForPort",value:function(e){var t;return cc.select(null===(t=e.sourceEvent)||void 0===t||null===(t=t.currentTarget)||void 0===t?void 0:t.parentNode).datum()}},{key:"startCommentNewLink",value:function(e,t){var n=this.ren.activePipeline.getComment(t.id);this.drawingNewLinkData={srcObj:n,action:se,startPos:{x:t.x_pos-this.ren.canvasLayout.commentHighlightGap,y:t.y_pos-this.ren.canvasLayout.commentHighlightGap},mousePos:{x:e.x,y:e.y},linkArray:[]}}},{key:"startInputPortNewLink",value:function(e,t,n){if(this.ren.config.enableAssocLinkCreation){var i=this.ren.activePipeline.getNode(n.id),o=D.getPortIndex(n.inputs,t.id);this.drawingNewLinkData={srcObj:i,srcPort:t,action:this.ren.config.enableAssocLinkCreation?$:K,mousePos:{x:e.x,y:e.y},startPos:{x:i.x_pos+t.cx,y:i.y_pos+t.cy},portFlow:he,portDisplayInfo:this.ren.getPortDisplayInfo(i.layout.inputPortDisplayObjects,o),portGuideInfo:this.ren.getPortDisplayInfo(i.layout.inputPortGuideObjects,o),portRadius:this.ren.getPortRadius(i),minInitialLine:i.layout.minInitialLine,linkArray:[]}}}},{key:"startOutputPortNewLink",value:function(e,t,n){var i=this.ren.activePipeline.getNode(n.id);if(!D.isSrcCardinalityAtMax(t.id,i,this.ren.activePipeline.links)){var o=D.getPortIndex(n.outputs,t.id);this.drawingNewLinkData={srcObj:i,srcPort:t,action:this.ren.config.enableAssocLinkCreation?$:K,mousePos:{x:e.x,y:e.y},startPos:{x:i.x_pos+t.cx,y:i.y_pos+t.cy},portFlow:de,portDisplayInfo:this.ren.getPortDisplayInfo(i.layout.outputPortDisplayObjects,o),portGuideInfo:this.ren.getPortDisplayInfo(i.layout.outputPortGuideObjects,o),portRadius:this.ren.getPortRadius(i),minInitialLine:i.layout.minInitialLine,linkArray:[]},this.ren.config.enableHighlightUnavailableNodes&&this.ren.setUnavailableTargetNodesHighlighting(i,t.id,this.ren.activePipeline.links)}}},{key:"drawNewLink",value:function(e){if(!1!==this.ren.config.enableEditingActions&&this.drawingNewLinkData){this.ren.closeContextMenuIfOpen();var t=this.ren.getTransformedMousePos(e);this.drawingNewLinkData.action===se?this.drawNewCommentLink(t):this.drawNewNodeLink(t),this.ren.config.enableHighlightNodeOnNewLinkDrag&&this.setNewLinkOverNode(e)}}},{key:"drawNewCommentLink",value:function(e){var t=this,n=this.ren.activePipeline.getComment(this.drawingNewLinkData.srcObj.id),i=this.ren.linkUtils.getNewStraightCommentLinkStartPos(n,e),o=se;this.drawingNewLinkData.linkArray=[{x1:i.x,y1:i.y,x2:e.x,y2:e.y,type:o}];var r=this.ren.nodesLinksGrp.selectAll(".d3-new-connection-line"),a=this.ren.nodesLinksGrp.selectAll(".d3-new-connection-guide");if(r.data(this.drawingNewLinkData.linkArray).enter().append("path").attr("class","d3-new-connection-line").attr("linkType",o).merge(r).attr("d",function(e){return t.ren.linkUtils.getConnectorPathInfo(e).path}),a.data(this.drawingNewLinkData.linkArray).enter().append("circle").attr("class","d3-new-connection-guide").attr("linkType",o).merge(a).attr("cx",function(e){return e.x2}).attr("cy",function(e){return e.y2}).attr("r",this.ren.canvasLayout.commentPortRadius),this.ren.canvasLayout.commentLinkArrowHead){var s=this.ren.nodesLinksGrp.selectAll(".d3-new-connection-arrow");s.data(this.drawingNewLinkData.linkArray).enter().append("path").attr("class","d3-new-connection-arrow").attr("linkType",o).merge(s).attr("d",function(e){return t.ren.getArrowHead(e)}).attr("transform",function(e){return t.ren.getArrowHeadTransform(e)})}}},{key:"drawNewNodeLink",value:function(e){var t=this,n=this.ren.config.enableAssocLinkCreation?$:K,i={type:n,srcObj:this.drawingNewLinkData.srcObj,srcNodeId:this.drawingNewLinkData.srcObj.id,srcNodePortId:this.drawingNewLinkData.srcPort.id,trgPos:{x_pos:e.x,y_pos:e.y}},o=this.ren.getDetachedLinkObj(i);this.drawingNewLinkData.linkArray=this.ren.linkUtils.addConnectionPaths([o]),this.ren.config.enableAssocLinkCreation&&(this.drawingNewLinkData.linkArray[0].assocLinkVariation=this.ren.getNewLinkAssocVariation(this.drawingNewLinkData.linkArray[0].x1,this.drawingNewLinkData.linkArray[0].x2,this.drawingNewLinkData.portFlow));var r=this.ren.linkUtils.getConnectorPathInfo(this.drawingNewLinkData.linkArray[0],this.drawingNewLinkData.minInitialLine),a=this.ren.nodesLinksGrp.selectAll(".d3-new-connection-line"),s=this.ren.nodesLinksGrp.selectAll(".d3-new-connection-start"),l=this.ren.nodesLinksGrp.selectAll(".d3-new-connection-guide");n===K&&this.ren.canvasLayout.linkType===Q&&Rs.isPointInNodeBoundary(e,this.drawingNewLinkData.srcObj)?this.removeNewLinkLine():a.data(this.drawingNewLinkData.linkArray).enter().append("path").attr("class","d3-new-connection-line").attr("linkType",n).merge(a).attr("d",r.path).attr("transform",r.transform),this.ren.canvasLayout.linkMethod===me&&this.drawingNewLinkData.portDisplayInfo.tag===be&&s.data(this.drawingNewLinkData.linkArray).enter().append("circle").attr("class","d3-new-connection-start").attr("linkType",n).merge(s).each(function(e,n,i){cc.select(i[n]).attr("cx",e.x1).attr("cy",e.y1).attr("r",t.drawingNewLinkData.portRadius)}),l.data(this.drawingNewLinkData.linkArray).enter().append(this.drawingNewLinkData.portGuideInfo.tag).attr("class","d3-new-connection-guide").attr("linkType",n).merge(l).each(function(e,n,i){var o=cc.select(i[n]),r=t.ren.getLinkImageTransform(e),a=lc(lc({},t.drawingNewLinkData.srcPort),{},{cx:e.x2,cy:e.y2});t.ren.updatePort(o,t.drawingNewLinkData.portGuideInfo,t.drawingNewLinkData.srcObj,a,r)})}},{key:"removeNewLinkLine",value:function(){this.ren.nodesLinksGrp.selectAll(".d3-new-connection-line").remove()}},{key:"completeNewLink",value:function(e){if(!1!==this.ren.config.enableEditingActions&&this.drawingNewLinkData){var t=this.drawingNewLinkData;if(this.drawingNewLinkData=null,D.isTinyMovement(t.mousePos,{x:e.x,y:e.y}))return this.removeNewLink(),void this.ren.canvasController.clickActionHandler({clickType:ye,objectType:"port",id:t.srcPort.id,nodeId:t.srcObj.id,selectedObjectIds:this.ren.activePipeline.getSelectedObjectIds(),pipelineId:this.ren.activePipeline.id});this.ren.config.enableHighlightUnavailableNodes&&this.ren.unsetUnavailableNodesHighlighting();var n=this.ren.getMousePosFromEvent(e),i=this.ren.getNodeAtPos(n);null!==i?this.createNewLinkFromDragData(e,i,t):this.ren.config.enableLinkSelection!==ve||t.action!==K||this.ren.config.enableAssocLinkCreation?this.stopDrawingNewLink(t):this.completeNewDetachedLink(e,t)}}},{key:"createNewLinkFromDragData",value:function(e,t,n){this.removeNewLink(),this.ren.config.enableHighlightNodeOnNewLinkDrag&&this.ren.setLinkOverNodeCancel();var i=n.action;if(null!==t)if(i===K){var o=n.srcObj,r=n.srcPort.id,a=this.ren.getMousePosFromEvent(e),s=this.ren.getInputNodePortId(a,t);this.createNewNodeLink(o,r,t,s)}else if(i===$){var l=n.srcObj;this.createNewAssocLink(l,t)}else if(i===se){var c=n.srcObj;this.createNewCommentLink(c,t)}}},{key:"createNewLinkFromSelections",value:function(){var e=this.ren.activePipeline.getSelectedNodes(),t=this.ren.activePipeline.getSelectedComments();if(e.length+t.length===2)if(1===e.length&&1===t.length)this.createNewCommentLink(t[0],e[0]);else if(2===e.length)if(this.ren.config.enableAssocLinkCreation)this.createNewAssocLink(e[0],e[1]);else{var n=D.getDefaultOutputPortId(e[0]),i=D.getDefaultInputPortId(e[1]);this.createNewNodeLink(e[0],n,e[1],i),this.ren.canvasController.setSelections([e[1].id])}}},{key:"createNewNodeLink",value:function(e,t,n,i){if(D.isDataConnectionAllowed(t,i,e,n,this.ren.activePipeline.links,this.ren.config.enableSelfRefLinks))this.ren.canvasController.editActionHandler({editType:"linkNodes",editSource:"canvas",nodes:[{id:e.id,portId:t}],targetNodes:[{id:n.id,portId:i}],type:K,linkType:"data",pipelineId:this.ren.activePipeline.id}),this.ren.canvasController.clearConnectFromStatus(this.ren.activePipeline.id);else if(this.ren.config.enableLinkReplaceOnNewConnection&&D.isDataLinkReplacementAllowed(t,i,e,n,this.ren.activePipeline.links,this.ren.config.enableSelfRefLinks)){var o=D.getDataLinksConnectedTo(i,n,this.ren.activePipeline.links);1===o.length&&(this.ren.canvasController.editActionHandler({editType:"linkNodesAndReplace",editSource:"canvas",nodes:[{id:e.id,portId:t}],targetNodes:[{id:n.id,portId:i}],type:K,pipelineId:this.pipelineId,replaceLink:o[0]}),this.ren.canvasController.clearConnectFromStatus(this.ren.activePipeline.id))}}},{key:"createNewAssocLink",value:function(e,t){D.isAssocConnectionAllowed(e,t,this.ren.activePipeline.links)&&this.ren.canvasController.editActionHandler({editType:"linkNodes",editSource:"canvas",nodes:[{id:e.id}],targetNodes:[{id:t.id}],type:$,pipelineId:this.ren.activePipeline.id})}},{key:"createNewCommentLink",value:function(e,t){D.isCommentLinkConnectionAllowed(e.id,t.id,this.ren.activePipeline.links)&&this.ren.canvasController.editActionHandler({editType:"linkComment",editSource:"canvas",nodes:[e.id],targetNodes:[t.id],type:se,linkType:"comment",pipelineId:this.ren.activePipeline.id})}},{key:"completeNewDetachedLink",value:function(e,t){this.removeNewLink(),this.ren.config.enableHighlightNodeOnNewLinkDrag&&this.ren.setLinkOverNodeCancel();var n=this.ren.getTransformedMousePos(e);this.ren.canvasController.editActionHandler({editType:"createDetachedLink",editSource:"canvas",srcNodeId:t.srcObj.id,srcNodePortId:t.srcPort.id,trgPos:n,type:K,pipelineId:this.ren.activePipeline.id})}},{key:"stopDrawingNewLink",value:function(e){this.ren.config.enableHighlightNodeOnNewLinkDrag&&this.ren.setLinkOverNodeCancel(),this.stopDrawingNewLinkForPorts(e)}},{key:"stopDrawingNewLinkForPorts",value:function(e){var t,n=this;if(0!==(null===(t=e.linkArray)||void 0===t?void 0:t.length)){var i=e.linkArray[0].x1,o=e.linkArray[0].y1,r=e.linkArray[0].x2,a=e.linkArray[0].y2,s=Object.assign({},e),l="",c=350;this.ren.canvasLayout.linkType===ke?l="M "+i+" "+o+"C "+r+" "+a+" "+r+" "+a+" "+r+" "+a:this.ren.canvasLayout.linkType===Q?(i<r&&(c=0),l="M "+i+" "+o+"L "+r+" "+a+" "+r+" "+a+" "+r+" "+a):l="M "+i+" "+o+"L "+r+" "+a+"Q "+r+" "+a+" "+r+" "+a+"L "+r+" "+a+"Q "+r+" "+a+" "+r+" "+a+"L "+r+" "+a+"Q "+r+" "+a+" "+r+" "+a+"L "+r+" "+a+"Q "+r+" "+a+" "+r+" "+a+"L "+r+" "+a,this.ren.nodesLinksGrp.selectAll(".d3-new-connection-line").transition().duration(c).attr("d",l).on("end",function(){var e,t;n.ren.nodesLinksGrp.selectAll(".d3-new-connection-arrow").remove(),n.ren.nodesLinksGrp.selectAll(".d3-new-connection-guide").transition().duration(1e3).ease(cc.easeElastic).attr("x",i-(null===(e=s.portGuideInfo)||void 0===e?void 0:e.width)/2).attr("y",o-(null===(t=s.portGuideInfo)||void 0===t?void 0:t.height)/2).attr("cx",i).attr("cy",o).attr("transform",null),n.ren.nodesLinksGrp.selectAll(".d3-new-connection-line").transition().duration(1e3).ease(cc.easeElastic).attr("d","M "+i+" "+o+"L "+i+" "+o).on("end",n.removeNewLink.bind(n))})}}},{key:"removeNewLink",value:function(){var e=this;this.ren.nodesLinksGrp.selectAll("foreignObject.d3-new-connection-guide").each(function(t,n,i){return e.ren.externalUtils.removeExternalObject(t,n,i)}),this.ren.nodesLinksGrp.selectAll(".d3-new-connection-line").remove(),this.ren.nodesLinksGrp.selectAll(".d3-new-connection-start").remove(),this.ren.nodesLinksGrp.selectAll(".d3-new-connection-guide").remove(),this.ren.nodesLinksGrp.selectAll(".d3-new-connection-arrow").remove()}},{key:"setNewLinkOverNode",value:function(e){var t=this.ren.getNodeNearMousePos(e,this.ren.canvasLayout.nodeProximity),n=t&&this.isNewLinkAllowedToNode(e,t);this.ren.setHighlightingOverNode(n,t)}},{key:"isNewLinkAllowedToNode",value:function(e,t){if(this.drawingNewLinkData){if(this.drawingNewLinkData.action===K){var n=this.drawingNewLinkData.srcObj,i=t,o=this.drawingNewLinkData.srcPort.id,r=this.ren.getMousePosFromEvent(e),a=this.ren.getInputNodePortId(r,i);return D.isDataConnectionAllowed(o,a,n,i,this.ren.activePipeline.links,this.ren.config.enableSelfRefLinks)}if(this.drawingNewLinkData.action===$){var s=this.drawingNewLinkData.srcObj,l=t;return D.isAssocConnectionAllowed(s,l,this.ren.activePipeline.links)}if(this.drawingNewLinkData.action===se){var c=this.drawingNewLinkData.srcObj.id,u=t.id;return D.isCommentLinkConnectionAllowed(c,u,this.ren.activePipeline.links)}}return!1}},{key:"beginNewLinkCallback",value:function(e,t){this.ren.canvasController.editActionHandler({editType:"beginNewLink",editSource:"canvas",node:t,port:e})}}])}();function dc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function hc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dc(Object(n),!0).forEach(function(t){It(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var pc=Object.assign({},Nl,os),gc=function(){return e(function e(n){t(this,e),this.ren=n,this.logger=new gt("SVGCanvasUtilsDragDetLink"),this.draggingLinkData=null,this.dragDetLinkHandler=pc.drag().on("start",this.dragStartDetLinkHandle.bind(this)).on("drag",this.dragMoveDetLinkHandle.bind(this)).on("end",this.dragEndDetLinkHandle.bind(this))},[{key:"getDragDetachedLinkHandler",value:function(){return this.dragDetLinkHandler}},{key:"isDragging",value:function(){return this.draggingLinkData}},{key:"isLinkBeingDragged",value:function(e){return this.draggingLinkData&&this.draggingLinkData.link.id===e.id}},{key:"dragStartDetLinkHandle",value:function(e,t){this.logger.logStartTimer("dragStartDetLinkHandle"),this.startHandleMoving(t,e.sourceEvent.currentTarget),this.logger.logEndTimer("dragStartDetLinkHandle",!0)}},{key:"dragMoveDetLinkHandle",value:function(e){this.logger.logStartTimer("dragMoveDetLinkHandle");var t=this.ren.getTransformedMousePos(e);this.moveHandle(t),this.logger.logEndTimer("dragMoveDetLinkHandle",!0)}},{key:"dragEndDetLinkHandle",value:function(e){this.logger.logStartTimer("dragEndLinkHandle");var t=this.ren.getMousePosFromEvent(e);this.completeDraggedDetLink(t),this.logger.logEndTimer("dragEndLinkHandle",!0)}},{key:"startHandleMoving",value:function(e,t){this.ren.closeContextMenuIfOpen();var n=pc.select(t),i=this.ren.activePipeline.getLink(e.id),o=hc({},i),r=this.ren.getLinkGroupSelectionById(e.id);if(this.draggingLinkData={lineInfo:e,link:i,oldLink:o,linkGrpSelection:pc.select(r)},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.ren.config.enableHighlightUnavailableNodes)if("end"===this.draggingLinkData.endBeingDragged){var a=this.ren.activePipeline.links.filter(function(e){return e.id!==i.id});this.ren.setUnavailableTargetNodesHighlighting(this.ren.activePipeline.getNode(this.draggingLinkData.link.srcNodeId),this.draggingLinkData.link.srcNodePortId,a)}else if("start"===this.draggingLinkData.endBeingDragged){var s=this.ren.activePipeline.links.filter(function(e){return e.id!==i.id});this.ren.setUnavailableSourceNodesHighlighting(this.ren.activePipeline.getNode(this.draggingLinkData.oldLink.trgNodeId),this.draggingLinkData.link.trgNodePortId,s)}}},{key:"moveLinkHandle",value:function(e,t,n){var i,o,r=this,a=this.getMoveIncrements(t);i=a.xInc,o=a.yInc,this.endMove&&(clearTimeout(this.endMove),this.endMove=null),this.isDragging()||this.startHandleMoving(e,n.currentTarget);var s="start"===this.draggingLinkData.endBeingDragged?this.draggingLinkData.link.x1:this.draggingLinkData.link.x2,l="start"===this.draggingLinkData.endBeingDragged?this.draggingLinkData.link.y1:this.draggingLinkData.link.y2,c={x:s+=i,y:l+=o};this.moveHandle(c),this.ren.restoreFocusToSubObject(),this.endMove=setTimeout(function(){var e=r.ren.convertCanvasCoordsToPageCoords(c.x,c.y);r.completeDraggedDetLink(e)},500)}},{key:"moveHandle",value:function(e){var t=this.draggingLinkData.link;"start"===this.draggingLinkData.endBeingDragged?(t.srcPos={x_pos:e.x,y_pos:e.y},delete t.srcNodeId,delete t.srcNodePortId,delete t.srcObj):(t.trgPos={x_pos:e.x,y_pos:e.y},delete t.trgNodeId,delete t.trgNodePortId,delete t.trgNode),this.ren.displayMovedLinks(),this.ren.config.enableHighlightNodeOnNewLinkDrag&&this.setDetachedLinkOverNode(e)}},{key:"completeDraggedDetLink",value:function(e){var t=this.getNewLinkOnDrag(e),n=this.draggingLinkData;if(this.draggingLinkData=null,t){var i=this.getLinkEditSubType(n.oldLink,t);if(i)this.ren.canvasController.editActionHandler({editType:"updateLink",editSubType:i,editSource:"canvas",newLink:t,pipelineId:this.ren.activePipeline.id})||this.snapBackOldLink(n.oldLink);else this.snapBackOldLink(n.oldLink)}else this.snapBackOldLink(n.oldLink);this.ren.config.enableHighlightNodeOnNewLinkDrag&&this.ren.setLinkOverNodeCancel(),this.ren.unsetUnavailableNodesHighlighting()}},{key:"getLinkEditSubType",value:function(e,t){return e.srcNodeId&&!t.srcNodeId?"detachFromSrcNode":e.trgNodeId&&!t.trgNodeId?"detachFromTrgNode":!e.srcNodeId&&t.srcNodeId?"attachToSrcNode":!e.trgNodeId&&t.trgNodeId?"attachToTrgNode":e.srcNodeId||t.srcNodeId||e.srcPos.x_pos===t.srcPos.x_pos&&e.srcPos.y_pos===t.srcPos.y_pos?e.trgNodeId||t.trgNodeId||e.trgPos.x_pos===t.trgPos.x_pos&&e.trgPos.y_pos===t.trgPos.y_pos?e.srcNodeId&&t.srcNodeId&&e.srcNodeId!==t.srcNodeId?"switchSrcNode":e.trgNodeId&&t.trgNodeId&&e.trgNodeId!==t.trgNodeId?"switchTrgNode":e.srcNodeId&&t.srcNodeId&&e.srcNodeId===t.srcNodeId&&e.srcNodePortId!==t.srcNodePortId?"switchSrcNodePort":e.trgNodeId&&t.trgNodeId&&e.trgNodeId===t.trgNodeId&&e.trgNodePortId!==t.trgNodePortId?"switchTrgNodePort":null:"moveTrgPosition":"moveSrcPosition"}},{key:"snapBackOldLink",value:function(e){this.ren.activePipeline.replaceLink(e),this.ren.displayLinks()}},{key:"setDetachedLinkOverNode",value:function(e){var t=this.ren.getNodeNearPos(e,this.ren.canvasLayout.nodeProximity),n=t&&this.isDetLinkConnectionAllowedToNearbyNode(e);this.ren.setHighlightingOverNode(n,t)}},{key:"isDetLinkConnectionAllowedToNearbyNode",value:function(e){if(this.draggingLinkData&&this.getNewLinkOnDrag(e,this.ren.canvasLayout.nodeProximity))return!0;return!1}},{key:"getNewLinkOnDrag",value:function(e,t){var n=this.draggingLinkData.oldLink,i=hc({},n);if("start"===this.draggingLinkData.endBeingDragged){delete i.srcObj,delete i.srcNodeId,delete i.srcNodePortId,delete i.srcPos;var o=t?this.ren.getNodeNearPos(e,t):this.ren.getNodeAtPos(e);o?(i.srcNodeId=o.id,i.srcObj=this.ren.activePipeline.getNode(o.id),i.srcNodePortId=this.ren.getOutputNodePortId(e,o)):i.srcPos=this.draggingLinkData.link.srcPos}else{delete i.trgNode,delete i.trgNodeId,delete i.trgNodePortId,delete i.trgPos;var r=t?this.ren.getNodeNearPos(e,t):this.ren.getNodeAtPos(e);r?(i.trgNodeId=r.id,i.trgNode=this.ren.activePipeline.getNode(r.id),i.trgNodePortId=this.ren.getInputNodePortId(e,r)):i.trgPos=this.draggingLinkData.link.trgPos}return this.ren.config.enableLinkSelection!==ve&&(i.srcPos||i.trgPos)?null:this.canUpdateLink(i,n)?i:null}},{key:"getMoveIncrements",value:function(e){var t=0,n=0;switch(e){case ie:t=0,n=-10;break;case ne:t=0,n=10;break;case ee:t=10,n=0;break;default:t=-10,n=0}return{xInc:t,yInc:n}}},{key:"canUpdateLink",value:function(e,t){var n=this.ren.activePipeline.getNode(e.srcNodeId),i=this.ren.activePipeline.getNode(e.trgNodeId),o=this.hasLinkSrcChanged(e,t),r=this.hasLinkTrgChanged(e,t),a=this.ren.activePipeline.links,s=!0;return o&&n&&!D.isSrcConnectionAllowedWithDetachedLinks(e.srcNodePortId,n,a)&&(s=!1),r&&i&&!D.isTrgConnectionAllowedWithDetachedLinks(e.trgNodePortId,i,a)&&(s=!1),n&&i&&!D.isConnectionAllowedWithDetachedLinks(e.srcNodePortId,e.trgNodePortId,n,i,a,this.ren.config.enableSelfRefLinks)&&(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}}])}();function fc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vc(e,t){var n=Object.create(e.prototype);for(var i in t)n[i]=t[i];return n}function yc(){}var mc=.7,bc=1/mc,kc="\\s*([+-]?\\d+)\\s*",xc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Cc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Pc=/^#([0-9a-f]{3,8})$/,Lc=new RegExp(`^rgb\\(${kc},${kc},${kc}\\)$`),wc=new RegExp(`^rgb\\(${Cc},${Cc},${Cc}\\)$`),Sc=new RegExp(`^rgba\\(${kc},${kc},${kc},${xc}\\)$`),Tc=new RegExp(`^rgba\\(${Cc},${Cc},${Cc},${xc}\\)$`),Nc=new RegExp(`^hsl\\(${xc},${Cc},${Cc}\\)$`),Dc=new RegExp(`^hsla\\(${xc},${Cc},${Cc},${xc}\\)$`),Oc={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 Ec(){return this.rgb().formatHex()}function Ic(){return this.rgb().formatRgb()}function Ac(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Pc.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?jc(t):3===n?new zc(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?_c(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?_c(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=Lc.exec(e))?new zc(t[1],t[2],t[3],1):(t=wc.exec(e))?new zc(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Sc.exec(e))?_c(t[1],t[2],t[3],t[4]):(t=Tc.exec(e))?_c(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Nc.exec(e))?Uc(t[1],t[2]/100,t[3]/100,1):(t=Dc.exec(e))?Uc(t[1],t[2]/100,t[3]/100,t[4]):Oc.hasOwnProperty(e)?jc(Oc[e]):"transparent"===e?new zc(NaN,NaN,NaN,0):null}function jc(e){return new zc(e>>16&255,e>>8&255,255&e,1)}function _c(e,t,n,i){return i<=0&&(e=t=n=NaN),new zc(e,t,n,i)}function Mc(e,t,n,i){return 1===arguments.length?((o=e)instanceof yc||(o=Ac(o)),o?new zc((o=o.rgb()).r,o.g,o.b,o.opacity):new zc):new zc(e,t,n,null==i?1:i);var o}function zc(e,t,n,i){this.r=+e,this.g=+t,this.b=+n,this.opacity=+i}function Hc(){return`#${Gc(this.r)}${Gc(this.g)}${Gc(this.b)}`}function Fc(){const e=Rc(this.opacity);return`${1===e?"rgb(":"rgba("}${Bc(this.r)}, ${Bc(this.g)}, ${Bc(this.b)}${1===e?")":`, ${e})`}`}function Rc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Bc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Gc(e){return((e=Bc(e))<16?"0":"")+e.toString(16)}function Uc(e,t,n,i){return i<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vc(e,t,n,i)}function Wc(e){if(e instanceof Vc)return new Vc(e.h,e.s,e.l,e.opacity);if(e instanceof yc||(e=Ac(e)),!e)return new Vc;if(e instanceof Vc)return e;var t=(e=e.rgb()).r/255,n=e.g/255,i=e.b/255,o=Math.min(t,n,i),r=Math.max(t,n,i),a=NaN,s=r-o,l=(r+o)/2;return s?(a=t===r?(n-i)/s+6*(n<i):n===r?(i-t)/s+2:(t-n)/s+4,s/=l<.5?r+o:2-r-o,a*=60):s=l>0&&l<1?0:a,new Vc(a,s,l,e.opacity)}function Vc(e,t,n,i){this.h=+e,this.s=+t,this.l=+n,this.opacity=+i}function Zc(e){return(e=(e||0)%360)<0?e+360:e}function Xc(e){return Math.max(0,Math.min(1,e||0))}function Yc(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}fc(yc,Ac,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ec,formatHex:Ec,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Wc(this).formatHsl()},formatRgb:Ic,toString:Ic}),fc(zc,Mc,vc(yc,{brighter(e){return e=null==e?bc:Math.pow(bc,e),new zc(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?mc:Math.pow(mc,e),new zc(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new zc(Bc(this.r),Bc(this.g),Bc(this.b),Rc(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:Hc,formatHex:Hc,formatHex8:function(){return`#${Gc(this.r)}${Gc(this.g)}${Gc(this.b)}${Gc(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Fc,toString:Fc})),fc(Vc,function(e,t,n,i){return 1===arguments.length?Wc(e):new Vc(e,t,n,null==i?1:i)},vc(yc,{brighter(e){return e=null==e?bc:Math.pow(bc,e),new Vc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?mc:Math.pow(mc,e),new Vc(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 zc(Yc(e>=240?e-240:e+120,o,i),Yc(e,o,i),Yc(e<120?e+240:e-120,o,i),this.opacity)},clamp(){return new Vc(Zc(this.h),Xc(this.s),Xc(this.l),Rc(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=Rc(this.opacity);return`${1===e?"hsl(":"hsla("}${Zc(this.h)}, ${100*Xc(this.s)}%, ${100*Xc(this.l)}%${1===e?")":`, ${e})`}`}}));var Kc=e=>()=>e;function qc(e){return 1===(e=+e)?$c: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):Kc(isNaN(t)?n:t)}}function $c(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Kc(isNaN(e)?t:e)}var Jc=function e(t){var n=qc(t);function i(e,t){var i=n((e=Mc(e)).r,(t=Mc(t)).r),o=n(e.g,t.g),r=n(e.b,t.b),a=$c(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=o(t),e.b=r(t),e.opacity=a(t),e+""}}return i.gamma=e,i}(1);function Qc(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var eu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tu=new RegExp(eu.source,"g");function nu(e,t){var n,i,o,r=eu.lastIndex=tu.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=eu.exec(e))&&(i=tu.exec(t));)(o=i.index)>r&&(o=t.slice(r,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:Qc(n,i)})),r=tu.lastIndex;return r<t.length&&(o=t.slice(r),s[a]?s[a]+=o:s[++a]=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 iu,ou=180/Math.PI,ru={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function au(e,t,n,i,o,r){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(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,a=-a),{translateX:o,translateY:r,rotate:Math.atan2(t,e)*ou,skewX:Math.atan(l)*ou,scaleX:a,scaleY:s}}function su(e,t,n,i){function o(e){return e.length?e.pop()+" ":""}return function(r,a){var s=[],l=[];return r=e(r),a=e(a),function(e,i,o,r,a,s){if(e!==o||i!==r){var l=a.push("translate(",null,t,null,n);s.push({i:l-4,x:Qc(e,o)},{i:l-2,x:Qc(i,r)})}else(o||r)&&a.push("translate("+o+t+r+n)}(r.translateX,r.translateY,a.translateX,a.translateY,s,l),function(e,t,n,r){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),r.push({i:n.push(o(n)+"rotate(",null,i)-2,x:Qc(e,t)})):t&&n.push(o(n)+"rotate("+t+i)}(r.rotate,a.rotate,s,l),function(e,t,n,r){e!==t?r.push({i:n.push(o(n)+"skewX(",null,i)-2,x:Qc(e,t)}):t&&n.push(o(n)+"skewX("+t+i)}(r.skewX,a.skewX,s,l),function(e,t,n,i,r,a){if(e!==n||t!==i){var s=r.push(o(r)+"scale(",null,",",null,")");a.push({i:s-4,x:Qc(e,n)},{i:s-2,x:Qc(t,i)})}else 1===n&&1===i||r.push(o(r)+"scale("+n+","+i+")")}(r.scaleX,r.scaleY,a.scaleX,a.scaleY,s,l),r=a=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 lu=su(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ru:au(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),cu=su(function(e){return null==e?ru:(iu||(iu=document.createElementNS("http://www.w3.org/2000/svg","g")),iu.setAttribute("transform",e),(e=iu.transform.baseVal.consolidate())?au((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):ru)},", ",")",")");function uu(e){return((e=Math.exp(e))+1/e)/2}var du,hu,pu=function e(t,n,i){function o(e,o){var r,a,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)a=Math.log(h/c)/t,r=function(e){return[s+e*p,l+e*g,c*Math.exp(t*e*a)]};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),b=Math.log(Math.sqrt(y*y+1)-y),k=Math.log(Math.sqrt(m*m+1)-m);a=(k-b)/t,r=function(e){var i,o=e*a,r=uu(b),u=c/(n*v)*(r*(i=t*o+b,((i=Math.exp(2*i))-1)/(i+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*p,l+u*g,c*r/uu(t*o+b)]}}return r.duration=1e3*a*t/Math.SQRT2,r}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),gu=0,fu=0,vu=0,yu=0,mu=0,bu=0,ku="object"==typeof performance&&performance.now?performance:Date,xu="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Cu(){return mu||(xu(Pu),mu=ku.now()+bu)}function Pu(){mu=0}function Lu(){this._call=this._time=this._next=null}function wu(e,t,n){var i=new Lu;return i.restart(e,t,n),i}function Su(){mu=(yu=ku.now())+bu,gu=fu=0;try{!function(){Cu(),++gu;for(var e,t=du;t;)(e=mu-t._time)>=0&&t._call.call(void 0,e),t=t._next;--gu}()}finally{gu=0,function(){var e,t,n=du,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:du=t);hu=e,Nu(i)}(),mu=0}}function Tu(){var e=ku.now(),t=e-yu;t>1e3&&(bu-=t,yu=e)}function Nu(e){gu||(fu&&(fu=clearTimeout(fu)),e-mu>24?(e<1/0&&(fu=setTimeout(Su,e-ku.now()-bu)),vu&&(vu=clearInterval(vu))):(vu||(yu=ku.now(),vu=setInterval(Tu,1e3)),gu=1,xu(Su)))}function Du(e,t,n){var i=new Lu;return t=null==t?0:+t,i.restart(n=>{i.stop(),e(n+t)},t,n),i}Lu.prototype=wu.prototype={constructor:Lu,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Cu():+n)+(null==t?0:+t),this._next||hu===this||(hu?hu._next=this:du=this,hu=this),this._call=e,this._time=n,Nu()},stop:function(){this._call&&(this._call=null,this._time=1/0,Nu())}};var Ou=hl("start","end","cancel","interrupt"),Eu=[];function Iu(e,t,n,i,o,r){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var i,o=e.__transition;function r(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)}function a(r){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 Du(a);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(Du(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(r))}),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),r=-1,a=i.length;++r<a;)i[r].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=wu(r,0,n.time)}(e,n,{name:t,index:i,group:o,on:Ou,tween:Eu,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:0})}function Au(e,t){var n=_u(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function ju(e,t){var n=_u(e,t);if(n.state>3)throw new Error("too late; already running");return n}function _u(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Mu(e,t){var n,i,o,r=e.__transition,a=!0;if(r){for(o in t=null==t?null:t+"",r)(n=r[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 r[o]):a=!1;a&&delete e.__transition}}function zu(e,t){var n,i;return function(){var o=ju(this,e),r=o.tween;if(r!==n)for(var a=0,s=(i=n=r).length;a<s;++a)if(i[a].name===t){(i=i.slice()).splice(a,1);break}o.tween=i}}function Hu(e,t,n){var i,o;if("function"!=typeof n)throw new Error;return function(){var r=ju(this,e),a=r.tween;if(a!==i){o=(i=a).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)}r.tween=o}}function Fu(e,t,n){var i=e._id;return e.each(function(){var e=ju(this,i);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return _u(e,i).value[t]}}function Ru(e,t){var n;return("number"==typeof t?Qc:t instanceof Ac?Jc:(n=Ac(t))?(t=n,Jc):nu)(e,t)}function Bu(e){return function(){this.removeAttribute(e)}}function Gu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Uu(e,t,n){var i,o,r=n+"";return function(){var a=this.getAttribute(e);return a===r?null:a===i?o:o=t(i=a,n)}}function Wu(e,t,n){var i,o,r=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===r?null:a===i?o:o=t(i=a,n)}}function Vu(e,t,n){var i,o,r;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttribute(e))===(s=l+"")?null:a===i&&s===o?r:(o=s,r=t(i=a,l));this.removeAttribute(e)}}function Zu(e,t,n){var i,o,r;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:a===i&&s===o?r:(o=s,r=t(i=a,l));this.removeAttributeNS(e.space,e.local)}}function Xu(e,t){var n,i;function o(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function Yu(e,t){var n,i;function o(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function Ku(e,t){return function(){Au(this,e).delay=+t.apply(this,arguments)}}function qu(e,t){return t=+t,function(){Au(this,e).delay=t}}function $u(e,t){return function(){ju(this,e).duration=+t.apply(this,arguments)}}function Ju(e,t){return t=+t,function(){ju(this,e).duration=t}}var Qu=$a.prototype.constructor;function ed(e){return function(){this.style.removeProperty(e)}}var td=0;function nd(e,t,n,i){this._groups=e,this._parents=t,this._name=n,this._id=i}function id(){return++td}var od=$a.prototype;nd.prototype={constructor:nd,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Xr(e));for(var i=this._groups,o=i.length,r=new Array(o),a=0;a<o;++a)for(var s,l,c=i[a],u=c.length,d=r[a]=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,Iu(d[h],t,n,h,d,_u(s,n)));return new nd(r,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=qr(e));for(var i=this._groups,o=i.length,r=[],a=[],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=_u(l,n),f=0,v=p.length;f<v;++f)(h=p[f])&&Iu(h,t,n,f,p,g);r.push(p),a.push(l)}return new nd(r,a,t,n)},selectChild:od.selectChild,selectChildren:od.selectChildren,filter:function(e){"function"!=typeof e&&(e=$r(e));for(var t=this._groups,n=t.length,i=new Array(n),o=0;o<n;++o)for(var r,a=t[o],s=a.length,l=i[o]=[],c=0;c<s;++c)(r=a[c])&&e.call(r,r.__data__,c,a)&&l.push(r);return new nd(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,r=Math.min(i,o),a=new Array(i),s=0;s<r;++s)for(var l,c=t[s],u=n[s],d=c.length,h=a[s]=new Array(d),p=0;p<d;++p)(l=c[p]||u[p])&&(h[p]=l);for(;s<i;++s)a[s]=t[s];return new nd(a,this._parents,this._name,this._id)},selection:function(){return new Qu(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=id(),i=this._groups,o=i.length,r=0;r<o;++r)for(var a,s=i[r],l=s.length,c=0;c<l;++c)if(a=s[c]){var u=_u(a,t);Iu(a,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new nd(i,this._parents,e,n)},call:od.call,nodes:od.nodes,node:od.node,size:od.size,empty:od.empty,each:od.each,on:function(e,t){var n=this._id;return arguments.length<2?_u(this.node(),n).on.on(e):this.each(function(e,t,n){var i,o,r=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)?Au:ju;return function(){var a=r(this,e),s=a.on;s!==i&&(o=(i=s).copy()).on(t,n),a.on=o}}(n,e,t))},attr:function(e,t){var n=Gr(e),i="transform"===n?cu:Ru;return this.attrTween(e,"function"==typeof t?(n.local?Zu:Vu)(n,i,Fu(this,"attr."+e,t)):null==t?(n.local?Gu:Bu)(n):(n.local?Wu:Uu)(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=Gr(e);return this.tween(n,(i.local?Xu:Yu)(i,t))},style:function(e,t,n){var i="transform"==(e+="")?lu:Ru;return null==t?this.styleTween(e,function(e,t){var n,i,o;return function(){var r=ka(this,e),a=(this.style.removeProperty(e),ka(this,e));return r===a?null:r===n&&a===i?o:o=t(n=r,i=a)}}(e,i)).on("end.style."+e,ed(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var i,o,r;return function(){var a=ka(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=ka(this,e)),a===l?null:a===i&&l===o?r:(o=l,r=t(i=a,s))}}(e,i,Fu(this,"style."+e,t))).each(function(e,t){var n,i,o,r,a="style."+t,s="end."+a;return function(){var l=ju(this,e),c=l.on,u=null==l.value[a]?r||(r=ed(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,r=n+"";return function(){var a=ka(this,e);return a===r?null:a===i?o:o=t(i=a,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,function(e,t,n){var i,o;function r(){var r=t.apply(this,arguments);return r!==o&&(i=(o=r)&&function(e,t,n){return function(i){this.style.setProperty(e,t.call(this,i),n)}}(e,r,n)),i}return r._value=t,r}(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}}(Fu(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,function(e){var t,n;function i(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&function(e){return function(t){this.textContent=e.call(this,t)}}(i)),t}return i._value=e,i}(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=_u(this.node(),n).tween,r=0,a=o.length;r<a;++r)if((i=o[r]).name===e)return i.value;return null}return this.each((null==t?zu:Hu)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Ku:qu)(t,e)):_u(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?$u:Ju)(t,e)):_u(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){ju(this,e).ease=t}}(t,e)):_u(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;ju(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,i=n._id,o=n.size();return new Promise(function(r,a){var s={value:a},l={value:function(){0===--o&&r()}};n.each(function(){var n=ju(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&&r()})},[Symbol.iterator]:od[Symbol.iterator]};var rd={time:null,delay:0,duration:250,ease:jl};function ad(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}$a.prototype.interrupt=function(e){return this.each(function(){Mu(this,e)})},$a.prototype.transition=function(e){var t,n;e instanceof nd?(t=e._id,e=e._name):(t=id(),(n=rd).time=Cu(),e=null==e?null:e+"");for(var i=this._groups,o=i.length,r=0;r<o;++r)for(var a,s=i[r],l=s.length,c=0;c<l;++c)(a=s[c])&&Iu(a,e,t,c,s,n||ad(a,t));return new nd(i,this._parents,e,t)};var sd=function(e){return function(){return e}};function ld(e,t){var n=t.sourceEvent,i=t.target,o=t.transform,r=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:r}})}function cd(e,t,n){this.k=e,this.x=t,this.y=n}cd.prototype={constructor:cd,scale:function(e){return 1===e?this:new cd(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new cd(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 ud=new cd(1,0,0);function dd(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ud;return e.__zoom}function hd(e){e.stopImmediatePropagation()}function pd(e){e.preventDefault(),e.stopImmediatePropagation()}function gd(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function fd(){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 vd(){return this.__zoom||ud}function yd(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function md(){return navigator.maxTouchPoints||"ontouchstart"in this}function bd(e,t,n){var i=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],r=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a))}dd.prototype=cd.prototype;var kd=Object.freeze({__proto__:null,zoom:function(){var e,t,n,i=gd,o=fd,r=bd,a=yd,s=md,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=pu,h=hl("start","zoom","end"),p=0,g=10,f=!1,v=!1;function y(e){e.property("__zoom",vd).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",D).on("gesturestart",w).on("gesturechange",S).on("gestureend",T).filter(s).on("touchstart.zoom",O).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",I).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new cd(t,e.x,e.y)}function b(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 cd(e.k,i,o)}function k(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,t,n,i){e.on("start.zoom",function(){C(this,arguments).event(i).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(i).end()}).tween("zoom",function(){var e=this,r=arguments,a=C(e,r).event(i),s=o.apply(e,r),l=null==n?k(s):"function"==typeof n?n.apply(e,r):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,r):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 cd(n,l[0]-t[0]*n,l[1]-t[1]*n)}a.zoom(null,e)}})}function C(e,t,n){return!n&&e.__zooming||new P(e,t)}function P(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function L(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(v&&pd(e),i.apply(this,arguments)){var s=C(this,n).event(e),u=this.__zoom,d=Math.max(l[0],Math.min(l[1],u.k*Math.pow(2,a.apply(this,arguments)))),h=is(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;!f||e.ctrlKey||e.safariPinchZoom||(s.wheelTransX=-u.x,s.wheelTransY=-u.y),s.mouse=[h,u.invert(h)],Mu(this),s.start()}if(pd(e),s.wheel=setTimeout(function(){s.wheel=null,s.end()},150),!f||e.ctrlKey||e.safariPinchZoom)s.zoom("mouse",r(b(m(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",r(b(u,p,g),s.extent,c))}}}function w(e){pd(e),this.scale=e.scale}function S(e){pd(e),this.__zoom&&(e.deltaY=100*(this.scale-e.scale),this.scale=e.scale),e.safariPinchZoom=!0,L.apply(this,[e].concat(Array.prototype.slice.call(arguments)))}function T(e){pd(e)}function N(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),a=1;a<t;a++)o[a-1]=arguments[a];if(!n&&i.apply(this,arguments)){var s=e.currentTarget,l=C(this,o,!0).event(e),u=Ja(e.view).on("mousemove.zoom",function(e){if(pd(e),!l.moved){var t=e.clientX-h,n=e.clientY-g;l.moved=t*t+n*n>p}l.event(e).zoom("mouse",r(b(l.that.__zoom,l.mouse[0]=is(e,s),l.mouse[1]),l.extent,c))},!0).on("mouseup.zoom",function(e){u.on("mousemove.zoom mouseup.zoom",null),xl(e.view,l.moved),pd(e),l.event(e).end()},!0),d=is(e,s),h=e.clientX,g=e.clientY;kl(e.view),hd(e),l.mouse=[d,this.__zoom.invert(d)],Mu(this),l.start()}}function D(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];if(i.apply(this,arguments)){var s=this.__zoom,l=is(e.changedTouches?e.changedTouches[0]:e,this),d=s.invert(l),h=s.k*(e.shiftKey?.5:2),p=r(b(m(s,h),l,d),o.apply(this,n),c);pd(e),u>0?Ja(this).transition().duration(u).call(x,p,l,e):Ja(this).call(y.transform,p,l,e)}}function O(n){for(var o=arguments.length,r=new Array(o>1?o-1:0),a=1;a<o;a++)r[a-1]=arguments[a];if(i.apply(this,arguments)){var s,l,c,u,d=n.touches,h=d.length,p=C(this,r,n.changedTouches.length===h).event(n);for(hd(n),l=0;l<h;++l)u=[u=is(c=d[l],this),this.__zoom.invert(u),c.identifier],p.touch0?p.touch1||p.touch0[2]===u[2]||(p.touch1=u,p.taps=0):(p.touch0=u,s=!0,p.taps=1+!!e);e&&(e=clearTimeout(e)),s&&(p.taps<2&&(t=u[0],e=setTimeout(function(){e=null},500)),Mu(this),p.start())}}function E(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,a,s,l,u=C(this,n).event(e),d=e.changedTouches,h=d.length;for(pd(e),o=0;o<h;++o)s=is(a=d[o],this),u.touch0&&u.touch0[2]===a.identifier?u.touch0[0]=s:u.touch1&&u.touch1[2]===a.identifier&&(u.touch1[0]=s);if(a=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,k=(k=v[0]-g[0])*k+(k=v[1]-g[1])*k;a=m(a,Math.sqrt(y/k)),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",r(b(a,s,l),u.extent,c))}}function I(e){for(var i=arguments.length,o=new Array(i>1?i-1:0),r=1;r<i;r++)o[r-1]=arguments[r];if(this.__zooming){var a,s,l=C(this,o).event(e),c=e.changedTouches,u=c.length;for(hd(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),a=0;a<u;++a)s=c[a],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=is(s,this),Math.hypot(t[0]-s[0],t[1]-s[1])<g)){var d=Ja(this).on("dblclick.zoom");d&&d.apply(this,arguments)}}}return y.transform=function(e,t,n,i){var o=e.selection?e.selection():e;o.property("__zoom",vd),e!==o?x(e,t,n,i):o.interrupt().each(function(){C(this,arguments).event(i).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},y.scaleBy=function(e,t,n,i){y.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,i)},y.scaleTo=function(e,t,n,i){y.transform(e,function(){var e=o.apply(this,arguments),i=this.__zoom,a=null==n?k(e):"function"==typeof n?n.apply(this,arguments):n,s=i.invert(a),l="function"==typeof t?t.apply(this,arguments):t;return r(b(m(i,l),a,s),e,c)},n,i)},y.translateBy=function(e,t,n,i){y.transform(e,function(){return r(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)},y.translateTo=function(e,t,n,i,a){y.transform(e,function(){var e=o.apply(this,arguments),a=this.__zoom,s=null==i?k(e):"function"==typeof i?i.apply(this,arguments):i;return r(ud.translate(s[0],s[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},i,a)},P.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=Ja(this.that).datum();h.call(e,this.that,new ld(e,{sourceEvent:this.sourceEvent,target:y,type:e,transform:this.that.__zoom,dispatch:h}),t)}},y.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:sd(+e),y):a},y.filter=function(e){return arguments.length?(i="function"==typeof e?e:sd(!!e),y):i},y.touchable=function(e){return arguments.length?(s="function"==typeof e?e:sd(!!e),y):s},y.extent=function(e){return arguments.length?(o="function"==typeof e?e:sd([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),y):o},y.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],y):[l[0],l[1]]},y.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],y):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},y.constrain=function(e){return arguments.length?(r=e,y):r},y.trackpad=function(e){return arguments.length?(f=e,y):f},y.preventBackGesture=function(e){return arguments.length?(v=e,y):v},y.duration=function(e){return arguments.length?(u=+e,y):u},y.interpolate=function(e){return arguments.length?(d=e,y):d},y.on=function(){var e=h.on.apply(h,arguments);return e===h?y:e},y.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,y):Math.sqrt(p)},y.tapDistance=function(e){return arguments.length?(g=+e,y):g},y},zoomTransform:dd,zoomIdentity:ud,ZoomTransform:cd});function xd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Cd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xd(Object(n),!0).forEach(function(t){It(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Pd=Object.assign({},os,kd),Ld=function(){return e(function e(n){var i=this;t(this,e),this.ren=n,this.logger=new gt("SVGCanvasUtilsZoom"),this.minScaleExtent=.2,this.maxScaleExtent=1.8,this.contextMenuClosedOnZoom=!1,this.textEditingClosedOnZoom=!1,this.regionSelect=!1,this.zoomStartPoint={x:0,y:0,k:0,startX:0,startY:0},this.previousD3Event={},this.zoomCanvasDimensions={},this.regionStartTransformX=0,this.regionStartTransformY=0,this.zoomTransform=Pd.zoomIdentity.translate(0,0).scale(1),this.zooming=!1,this.zoomingAction=!1,this.spaceKeyPressed=!1,this.zoomHandler=Pd.zoom().trackpad(this.ren.config.enableInteractionType===Pe).preventBackGesture(!0).wheelDelta(function(e){return-e.deltaY*(i.ren.config.enableInteractionType===Pe?.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))},[{key:"setSpaceKeyPressed",value:function(e){this.spaceKeyPressed=e}},{key:"isSpaceKeyPressed",value:function(){return this.spaceKeyPressed}},{key:"getZoomHandler",value:function(){return this.zoomHandler}},{key:"getZoomTransform",value:function(){return this.zoomTransform}},{key:"getZoom",value:function(){return Cd({},this.zoomTransform)}},{key:"getZoomScale",value:function(){return this.zoomTransform.k}},{key:"resetZoomTransform",value:function(){this.zoomTransform=Pd.zoomIdentity.translate(0,0).scale(1)}},{key:"zoomTo",value:function(e,t){var n=void 0===t?500:t;this.zoomCanvasInvokeZoomBehavior(e,n)}},{key:"translateBy",value:function(e,t,n){var i=this.getZoomTransform(),o=Pd.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.ren.canvasSVG.call(this.zoomHandler.scaleTo,e)}}},{key:"zoomOut",value:function(){if(this.zoomTransform.k>this.minScaleExtent){var e=Math.max(this.zoomTransform.k/1.1,this.minScaleExtent);this.ren.canvasSVG.call(this.zoomHandler.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:"setMaxZoomExtent",value:function(e){if(!this.zooming){var t=this.maxScaleExtent*e;this.zoomHandler=this.zoomHandler.scaleExtent([this.minScaleExtent,t]),this.ren.resetCanvasSVGBehaviors()}}},{key:"transformPos",value:function(e){return{x:this.transformPosX(e.x),y:this.transformPosY(e.y)}}},{key:"transformPosX",value:function(e){return(e-this.zoomTransform.x)/this.zoomTransform.k}},{key:"transformPosY",value:function(e){return(e-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:"getTransformedElementRect",value:function(e){var t=this.ren.canvasSVG.node().getBoundingClientRect();if(!e)return null;var n=e.getBoundingClientRect(),i={x:n.x-t.x,y:n.y-t.y,left:n.left-t.x,right:n.right-t.x,top:n.top-t.y,bottom:n.bottom-t.y,width:n.width,height:n.height};return i.x=this.transformPosX(i.x),i.y=this.transformPosY(i.y),i.left=this.transformPosX(i.left),i.right=this.transformPosX(i.right),i.top=this.transformPosY(i.top),i.bottom=this.transformPosY(i.bottom),i.width/=this.zoomTransform.k,i.height/=this.zoomTransform.k,i}},{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:"zoomStart",value:function(e){var t=this;this.logger.log("zoomStart - "+JSON.stringify(e.transform)),this.ren.canvasController.closeTip(),this.zooming=!0,this.ren.canvasController.isContextMenuDisplayed()&&!this.ren.dispUtils.isDisplayingSubFlowInPlace()&&(this.ren.canvasController.closeContextMenu(),this.contextMenuClosedOnZoom=!0),this.ren.svgCanvasTextArea.isEditingText()&&(this.textEditingClosedOnZoom=!0),this.regionSelect=this.isRegionSelectActivated(e),this.regionSelect?(this.addingCursorOverlay=setTimeout(function(){return t.ren.addTempCursorOverlay("crosshair")},200),this.regionStartTransformX=e.transform.x,this.regionStartTransformY=e.transform.y):this.isDragActivated(e)?this.addingCursorOverlay=setTimeout(function(){return t.ren.addTempCursorOverlay("grabbing")},200):this.addingCursorOverlay=setTimeout(function(){return t.ren.addTempCursorOverlay("default")},200);var n=this.ren.getTransformedMousePos(e);this.zoomStartPoint={x:e.transform.x,y:e.transform.y,k:e.transform.k,startX:n.x,startY:n.y},this.previousD3Event=Cd({},e.transform),this.zoomCanvasDimensions=this.getCanvasDimensions()}},{key:"zoomAction",value:function(e){this.logger.log("zoomAction - "+JSON.stringify(e.transform)),e.transform.k===this.zoomStartPoint.k?this.regionSelect?this.drawRegionSelector(e):this.zoomCanvasBackground(e):(this.ren.addTempCursorOverlay("default"),this.zoomCanvasBackground(e),this.ren.repositionCommentToolbar())}},{key:"zoomEnd",value:function(e){this.logger.log("zoomEnd - "+JSON.stringify(e.transform)),clearTimeout(this.addingCursorOverlay);var t=this.ren.getTransformedMousePos(e);t.x!==this.zoomStartPoint.startX||t.y!==this.zoomStartPoint.startY||this.zoomChanged()?this.regionSelect?this.zoomEndRegionSelect(e):this.ren.dispUtils.isDisplayingFullPage()&&this.zoomChanged()&&this.zoomSave():this.zoomClick(e),this.ren.resetCanvasCursor(e),this.ren.removeTempCursorOverlay(),this.contextMenuClosedOnZoom=!1,this.textEditingClosedOnZoom=!1,this.regionSelect=!1,this.zooming=!1}},{key:"zoomChanged",value:function(){return this.zoomTransform.k!==this.zoomStartPoint.k||this.zoomTransform.x!==this.zoomStartPoint.x||this.zoomTransform.y!==this.zoomStartPoint.y}},{key:"isDragActivated",value:function(e){return this.ren.config.enableInteractionType===xe?this.isSpaceKeyPressed():e&&e.sourceEvent&&!e.sourceEvent.shiftKey}},{key:"isRegionSelectActivated",value:function(e){return!this.zoomingAction&&(!!(this.ren.config.enableInteractionType===Ce&&e&&e.sourceEvent&&e.sourceEvent.shiftKey)||(this.ren.config.enableInteractionType===xe&&!this.isSpaceKeyPressed()||!(this.ren.config.enableInteractionType!==Pe||!e.sourceEvent||1!==e.sourceEvent.buttons||this.isSpaceKeyPressed())))}},{key:"drawRegionSelector",value:function(e){this.removeRegionSelector();var t=this.getRegionDimensions(e),n=t.x,i=t.y,o=t.width,r=t.height,a=this.getObjectsInRegion({x:n,y:i,width:o,height:r});this.ren.setSelectionInfo({selections:a,pipelineId:this.ren.activePipeline.id}),this.ren.canvasGrp.append("rect").attr("width",o).attr("height",r).attr("x",n).attr("y",i).attr("class","d3-region-selector")}},{key:"zoomEndRegionSelect",value:function(e){this.removeRegionSelector(),e.transform.x=this.regionStartTransformX,e.transform.y=this.regionStartTransformY;var t=this.getRegionDimensions(e),n=this.getObjectsInRegion(t);this.ren.canvasController.setSelections(n,this.ren.activePipeline.id)}},{key:"removeRegionSelector",value:function(){this.ren.canvasGrp.selectAll(".d3-region-selector").remove()}},{key:"getObjectsInRegion",value:function(e){return D.getObjectsInRegion(e,this.ren.activePipeline,this.ren.config.enableLinkSelection!==Le,this.ren.canvasLayout.linkType,this.ren.canvasLayout.linkMethod,this.ren.config.enableAssocLinkType)}},{key:"getRegionDimensions",value:function(e){var t=this.ren.getTransformedMousePos(e),n=this.zoomStartPoint.startX,i=this.zoomStartPoint.startY,o=t.x-n,r=t.y-i;return o<0&&(n-=o=Math.abs(o)),r<0&&(i-=r=Math.abs(r)),{x:n,y:i,width:o,height:r}}},{key:"zoomCanvasBackground",value:function(e){if(this.regionSelect=!1,this.ren.dispUtils.isDisplayingPrimaryFlowFullPage()){var t=this.getTransformIncrement(e);this.zoomTransform=this.zoomConstrainRegular(t,this.getViewportDimensions(),this.zoomCanvasDimensions)}else this.zoomTransform=Pd.zoomIdentity.translate(e.transform.x,e.transform.y).scale(e.transform.k);this.ren.canvasGrp.attr("transform",this.zoomTransform),this.ren.canvasBackground.attr("transform",this.zoomTransform),this.ren.displayCanvasAccoutrements()}},{key:"zoomClick",value:function(e){var t;this.ren.dispUtils.isDisplayingCurrentPipeline()&&!this.contextMenuClosedOnZoom&&!this.textEditingClosedOnZoom&&(this.ren.config.enableEditingActions||null!==(t=e.sourceEvent)&&void 0!==t&&null!==(t=t.target)&&void 0!==t&&null!==(t=t.classList)&&void 0!==t&&t.contains("d3-svg-background"))&&this.ren.canvasController.clearSelections()}},{key:"zoomSave",value:function(){this.ren.canvasSVG.property("__zoom",this.zoomTransform);var e={editType:"setZoom",editSource:"canvas",zoom:this.zoomTransform,pipelineId:this.ren.activePipeline.id};this.ren.canvasController.editActionHandler(e)}},{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=Cd({},e.transform),i}},{key:"zoomConstrainRegular",value:function(e,t,n){if(!n)return this.zoomTransform;var i=e.k,o=e.x,r=e.y,a=this.convertRectAdjustedForScaleWithPadding(n,i,this.getZoomToFitPadding()),s=t.width-Math.min(.25*t.width,.25*a.width),l=-Math.max(a.width-.25*t.width,.75*a.width),c=t.height-Math.min(.25*t.height,.25*a.height),u=-Math.max(a.height-.25*t.height,.75*a.height);return o>-a.left+s?o=-a.left+s:o<-a.left+l&&(o=-a.left+l),r>-a.top+c?r=-a.top+c:r<-a.top+u&&(r=-a.top+u),Pd.zoomIdentity.translate(o,r).scale(i)}},{key:"restoreZoom",value:function(){var e=this.ren.canvasController.getSavedZoom(this.ren.activePipeline.id);if(!e&&this.ren.config.enablePanIntoViewOnOpen){var t=this.getCanvasDimensionsWithPadding();t&&(e={x:-t.left,y:-t.top,k:1})}!e&&this.ren.canvasLayout.initialPanX&&this.ren.canvasLayout.initialPanY&&(e={x:this.ren.canvasLayout.initialPanX,y:this.ren.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(e&&isFinite(e.x)&&isFinite(e.y)&&isFinite(e.k)&&this.zoomHasChanged(e)){this.zoomingAction=!0;var n=Pd.zoomIdentity.translate(e.x,e.y).scale(e.k);t?this.ren.canvasSVG.call(this.zoomHandler).transition().duration(t).call(this.zoomHandler.transform,n):this.ren.canvasSVG.call(this.zoomHandler.transform,n),this.zoomingAction=!1}}},{key:"zoomHasChanged",value:function(e){return e.k!==this.zoomTransform.k||e.x!==this.zoomTransform.x||e.y!==this.zoomTransform.y}},{key:"zoomToFit",value:function(e){var t=this.getCanvasDimensionsWithPadding(),n=this.getZoomToFit(t);n&&this.zoomCanvasInvokeZoomBehavior(n,e)}},{key:"getZoomToFit",value:function(e){var t=this.getViewportDimensions();if(e){var n=t.width/e.width,i=t.height/e.height,o=Math.min(n,i,1),r=(t.width-e.width*o)/2,a=(t.height-e.height*o)/2;return{x:r-=o*e.left,y:a-=o*e.top,k:o}}return null}},{key:"getZoomToReveal",value:function(e,t,n){var i=this.getTransformedViewportDimensions(),o=this.ren.activePipeline.getNodes(e),r=this.ren.activePipeline.getComments(e),a=this.ren.activePipeline.getLinks(e);if(o.length>0||r.length>0||a.length>0){var s=D.getCanvasDimensions(o,r,a,0,0,!0),l=this.convertRectAdjustedForScaleWithPadding(s,1,30);if(l){if(l.width>i.width||l.height>i.height)return this.getZoomToFit(l);var c,u,d=parseInt(t,10),h=void 0===n?d:parseInt(n,10);if(Number.isNaN(d)||Number.isNaN(h)?(l.right>i.x+i.width&&(c=i.x+i.width-l.right),l.left<i.x&&(c=i.x-l.left),l.bottom>i.y+i.height&&(u=i.y+i.height-l.bottom),l.top<i.y&&(u=i.y-l.top)):(c=i.x+i.width*(d/100)-(l.left+l.width/2),u=i.y+i.height*(h/100)-(l.top+l.height/2)),void 0!==c||void 0!==u)return{x:this.zoomTransform.x+(c||0)*this.zoomTransform.k||0,y:this.zoomTransform.y+(u||0)*this.zoomTransform.k||0,k:this.zoomTransform.k}}}return null}},{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.ren.activePipeline.nodes.filter(function(e){return e.isSupernodeInputBinding}).forEach(function(n){var i=D.getNodePaddingToTargetNodes(n,e.ren.activePipeline.nodes,e.ren.activePipeline.links,e.ren.canvasLayout.linkType);t=Math.max(t,i)}),t}},{key:"getMaxPaddingForConnectionsToOutputBindingNodes",value:function(){var e=this,t=0,n=this.ren.activePipeline.nodes.filter(function(e){return e.isSupernodeOutputBinding});return this.ren.activePipeline.nodes.forEach(function(i){var o=D.getNodePaddingToTargetNodes(i,n,e.ren.activePipeline.links,e.ren.canvasLayout.linkType);t=Math.max(t,o)}),t}},{key:"getTransformedViewportDimensions",value:function(){var e=this.getViewportDimensions();return this.getTransformedRect(e,0)}},{key:"getViewportDimensions",value:function(){var e={};if(this.ren.dispUtils.isDisplayingSubFlowInPlace()){var t=this.ren.getParentSupernodeSVGDimensions();e.width=t.width,e.height=t.height}else e=this.ren.canvasSVG&&this.ren.canvasSVG.node()?this.ren.canvasSVG.node().getBoundingClientRect():{x:0,y:0,width:1100,height:640};return e}},{key:"getCanvasDimensionsWithPadding",value:function(){return this.getCanvasDimensions(this.getZoomToFitPadding())}},{key:"getCanvasDimensions",value:function(e){var t=this.ren.canvasLayout.commentHighlightGap,n=this.ren.activePipeline.getCanvasDimensions(t);return this.convertRectAdjustedForScaleWithPadding(n,1,e)}},{key:"convertRectAdjustedForScaleWithPadding",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e?{left:e.left*t-n,top:e.top*t-n,right:e.right*t+n,bottom:e.bottom*t+n,width:e.width*t+2*n,height:e.height*t+2*n}:null}},{key:"getZoomToFitPadding",value:function(){var e=this.ren.canvasLayout.zoomToFitPadding;if(this.ren.dispUtils.isDisplayingSubFlow()){var t=this.getMaxZoomToFitPaddingForConnections()+2*this.ren.canvasLayout.supernodeBindingPortRadius;e=Math.max(e,t)}return e}}])}(),wd=function(){return e(function e(n){t(this,e),this.logger=new gt("SVGCanvasUtilsAccessibility"),this.logger.log("constructor - start"),this.ap=n,this.initialize(),this.logger.log("constructor - end")},[{key:"initialize",value:function(){this.logger.logStartTimer("initialize"),this.tabObjects=this.createTabObjectsArray(),this.logger.logEndTimer("initialize")}},{key:"createTabObjectsArray",value:function(){this.removeGrpProperties();var e=this.getObjectGroups(),t=this.getEntryComments(),n=this.getEntryLinks(),i=this.getEntryNodes(),o=this.getEntryNodesForLoops(e),r=[].concat(C(t),C(i),C(n),C(o));return r=r.sort(this.sortTabGroups.bind(this))}},{key:"removeGrpProperties",value:function(){this.ap.pipeline.nodes.forEach(function(e){return delete e.grp}),this.ap.pipeline.links.forEach(function(e){return delete e.grp}),this.ap.pipeline.comments.forEach(function(e){return delete e.grp})}},{key:"getEntryComments",value:function(){var e=this;if(this.ap.canvasInfo.hideComments)return[];var t=this.ap.pipeline.comments.filter(function(t){return!e.commentHasLinks(t)});return t=t.map(function(e){return{type:"comment",obj:e}})}},{key:"getEntryLinks",value:function(){var e=this.ap.pipeline.links.filter(function(e){return e.srcPos&&e.trgPos});return e=e.map(function(e){return{type:"link",obj:e}})}},{key:"getEntryNodes",value:function(){var e=this,t=this.ap.pipeline.nodes.filter(function(t){return!e.nodeHasInputLinks(t)&&!e.nodeHasAssocLinks(t)});return t=t.map(function(e){return{type:"node",obj:e}})}},{key:"getEntryNodesForLoops",value:function(e){var t=this,n=[];return e.forEach(function(e){if(0===e.filter(function(e){return!t.nodeHasInputLinks(e)&&!t.nodeHasAssocLinks(e)}).length){var i=t.getLoopEntryNode(e);n.push(i)}}),n}},{key:"getLoopEntryNode",value:function(e){var t=null,n=1/0;return e.forEach(function(e){e.x_pos<n&&(t=e,n=e.x_pos)}),{type:"node",obj:t}}},{key:"getObjectGroups",value:function(){var e=this,t=[],n=-1;return this.ap.pipeline.nodes.forEach(function(i){if(void 0===i.grp){var o=[];n++,e.getNodesInGroup(i,o,n),t.push(o)}}),this.ap.pipeline.comments.forEach(function(e){void 0===e.grp&&(n++,e.grp=n)}),this.ap.pipeline.links.forEach(function(e){void 0===e.grp&&(n++,e.grp=n)}),t}},{key:"getNodesInGroup",value:function(e,t,n){var i=this;if(void 0===e.grp){e.grp=n,t.push(e);var o=this.getInputDataLinks(e);o=o.map(function(e){return e.grp=n,e});var r=this.getOutputDataLinks(e);r=r.map(function(e){return e.grp=n,e});var a=this.getAssociationLinks(e);a=a.map(function(e){return e.grp=n,e});var s=this.getCommentLinks(e);s=s.map(function(e){return e.grp=n,e});var l=this.getSrcNodes(o),c=this.getTrgNodes(r),u=this.getAssocNodes(a,e),d=this.getConnectedComments(s);l.forEach(function(e){void 0===e.grp&&i.getNodesInGroup(e,t,n)}),c.forEach(function(e){void 0===e.grp&&i.getNodesInGroup(e,t,n)}),u.forEach(function(e){void 0===e.grp&&i.getNodesInGroup(e,t,n)}),d.forEach(function(e){void 0===e.grp&&(e.grp=n)})}}},{key:"getSrcNodes",value:function(e){var t=this,n=[];return e.forEach(function(e){var i=t.ap.getNode(e.srcNodeId);i&&n.push(i)}),n}},{key:"getTrgNodes",value:function(e){var t=this,n=[];return e.forEach(function(e){var i=t.ap.getNode(e.trgNodeId);i&&n.push(i)}),n}},{key:"getAssocNodes",value:function(e,t){var n=this,i=[];return e.forEach(function(e){var o=e.srcNodeId===t.id?e.trgNodeId:e.srcNodeId,r=n.ap.getNode(o);r&&i.push(r)}),i}},{key:"getConnectedComments",value:function(e){var t=this,n=[];return e.forEach(function(e){var i=t.ap.getComment(e.srcNodeId);i&&n.push(i)}),n}},{key:"sortTabGroups",value:function(e,t){var n=this.getTagGroupYCoord(e),i=this.getTagGroupYCoord(t);return n>i||n===i&&this.getTagGroupXCoord(e)>this.getTagGroupXCoord(t)?1:-1}},{key:"getTagGroupYCoord",value:function(e){return"link"===e.type?e.obj.srcPos.y_pos:e.obj.y_pos}},{key:"getTagGroupXCoord",value:function(e){return"link"===e.type?e.obj.srcPos.x_pos:e.obj.x_pos}},{key:"getInputDataLinks",value:function(e){return this.ap.pipeline.links.filter(function(t){return t.type===K&&t.trgNodeId===e.id})}},{key:"getOutputDataLinks",value:function(e){return this.ap.pipeline.links.filter(function(t){return t.type===K&&t.srcNodeId===e.id})}},{key:"getAssociationLinks",value:function(e){return this.ap.pipeline.links.filter(function(t){return t.type===$&&(t.srcNodeId===e.id||t.trgNodeId===e.id)})}},{key:"getCommentLinks",value:function(e){return this.ap.pipeline.links.filter(function(t){return t.type===se&&t.trgNodeId===e.id})}},{key:"nodeHasInputLinks",value:function(e){return!!(e.inputs&&e.inputs.length>0)&&this.getLinksToNode(e,K).length>0}},{key:"nodeHasAssocLinks",value:function(e){return this.getAssocLinksForNode(e).length>0}},{key:"commentHasLinks",value:function(e){return this.getLinksFromComment(e).length>0}},{key:"getNextTabGroupStartObject",value:function(e){if(0===this.tabObjects.length)return null;if(!e||e===we)return this.tabObjects[0].obj;var t=this.getLocalObject(e),n=this.tabObjects.findIndex(function(e){return e.obj.grp===(null==t?void 0:t.grp)&&e.obj.id===(null==t?void 0:t.id)});return-1===n&&(n=this.tabObjects.findIndex(function(e){return e.obj.grp===(null==t?void 0:t.grp)})),n===this.tabObjects.length-1?null:this.tabObjects[n+1].obj}},{key:"getPreviousTabGroupStartObject",value:function(e){if(0===this.tabObjects.length)return null;if(!e||e===we)return this.tabObjects[this.tabObjects.length-1].obj;var t=this.getLocalObject(e),n=this.tabObjects.findIndex(function(e){return e.obj.grp===(null==t?void 0:t.grp)&&e.obj.id===(null==t?void 0:t.id)});return-1===n&&(n=this.tabObjects.findLastIndex(function(e){return e.obj.grp===(null==t?void 0:t.grp)})),n<1?null:this.tabObjects[n-1].obj}},{key:"getLocalObject",value:function(e){return this.ap.pipeline.nodes.find(function(t){return t.id===e.id})||this.ap.pipeline.links.find(function(t){return t.id===e.id})||this.ap.pipeline.comments.find(function(t){return t.id===e.id})}},{key:"getAllLinksForNode",value:function(e){var t=this,n=[];return this.getLinksFromNode(e,K).forEach(function(e){n.push({link:e,type:"node",obj:e.srcObj})}),this.getLinksToNode(e,K).forEach(function(e){e.srcNodeId!==e.trgNodeId&&n.push({link:e,type:"node",obj:e.trgNode})}),this.getLinksFromNode(e,$).forEach(function(e){n.push({link:e,type:"node",obj:e.srcObj})}),this.getLinksToNode(e,$).forEach(function(e){n.push({link:e,type:"node",obj:e.trgNode})}),this.getLinksToNode(e,se).forEach(function(e){n.push({link:e,type:"comment",obj:t.ap.getComment(e.srcNodeId)})}),n}},{key:"getNextLinksFromNode",value:function(e){var t=this,n=[];return this.getLinksFromNode(e,K).forEach(function(e){n.push({link:e,type:"node",obj:t.ap.getNode(e.trgNodeId)})}),this.getLinksFromNode(e,$).forEach(function(i){n.push({link:i,type:"node",obj:t.ap.getNode(e.id===i.srcNodeId?i.trgNodeId:i.srcNodeId)})}),this.getLinksToNode(e,$).forEach(function(e){n.push({link:e,type:"node",obj:e.trgNode})}),this.getLinksToNode(e,se).forEach(function(e){n.push({link:e,type:"comment",obj:t.ap.getComment(e.srcNodeId)})}),n}},{key:"getNextLinksFromComment",value:function(e){var t=this,n=[];return this.getLinksFromComment(e).forEach(function(e){n.push({link:e,type:"node",obj:t.ap.getNode(e.trgNodeId)})}),n}},{key:"getNextSiblingLink",value:function(e){if(e.srcPos&&e.trgPos)return null;var t=e.navObject?e.navObject:e.srcObj,n=D.isNode(t)?this.getAllLinksForNode(t):this.getNextLinksFromComment(t),i=n.findIndex(function(t){return t.link.id===e.id});return i>-1?i===n.length-1?n[0].link:n[i+1].link:null}},{key:"getPreviousSiblingLink",value:function(e){if(e.srcPos&&e.trgPos)return null;var t=e.navObject?e.navObject:e.srcObj,n=D.isNode(t)?this.getAllLinksForNode(t):this.getNextLinksFromComment(t),i=n.findIndex(function(t){return t.link.id===e.id});return i>-1?0===i?n[n.length-1].link:n[i-1].link:null}},{key:"getNextNodeFromDataLink",value:function(e){return this.ap.getNode(e.trgNodeId)}},{key:"getNextNodeFromAssocLink",value:function(e){var t;return e.srcNodeId===(null===(t=e.navObject)||void 0===t?void 0:t.id)?e.trgNode:e.srcObj}},{key:"getNextObjectFromCommentLink",value:function(e){var t;return e.srcNodeId===(null===(t=e.navObject)||void 0===t?void 0:t.id)?e.trgNode:e.srcObj}},{key:"getPreviousLinksToNode",value:function(e){var t=this,n=[];return this.getLinksToNode(e,K).forEach(function(e){n.push({link:e,type:"node",obj:t.ap.getNode(e.trgNodeId)})}),n}},{key:"getPreviousNodeFromDataLink",value:function(e){return e.srcObj}},{key:"getPreviousNodeFromAssocLink",value:function(e){return e.srcObjId===e.navObject.id?e.srcObj:e.trgNode}},{key:"getPreviousObjectFromCommentLink",value:function(e){return e.srcObjId===e.navObject.id?e.srcObj:e.trgNode}},{key:"getLinksToNode",value:function(e,t){return this.ap.pipeline.links.filter(function(n){return n.type===t&&n.trgNodeId===e.id})}},{key:"getLinksFromNode",value:function(e,t){return this.ap.pipeline.links.filter(function(n){return n.type===t&&n.srcNodeId===e.id})}},{key:"getAssocLinksForNode",value:function(e){return this.ap.pipeline.links.filter(function(t){return t.type===$&&(t.srcNodeId===e.id||t.trgNodeId===e.id)})}},{key:"getLinksFromComment",value:function(e){return this.ap.pipeline.links.filter(function(t){return t.srcNodeId===e.id})}},{key:"getNextSubObject",value:function(e,t){var n=this.getFocusableSubObjects(e);if(!t)return n[0];var i=n.findIndex(function(e){return e.type===t.type&&e.obj.id===t.obj.id});return++i>n.length-1&&(i=0),n[i]}},{key:"getPreviousSubObject",value:function(e,t){var n=this.getFocusableSubObjects(e);if(!t)return n[n.length-1];var i=n.findIndex(function(e){return e.type===t.type&&e.obj.id===t.obj.id});return--i<0&&(i=n.length-1),n[i]}},{key:"getFocusableSubObjects",value:function(e){var t=[],n=D.getObjectTypeName(e);return"node"===n&&(e.inputs&&e.layout.inputPortDisplay&&e.layout.inputPortFocusable&&e.inputs.forEach(function(e){t.push({type:"inputPort",obj:e})}),e.outputs&&e.layout.outputPortDisplay&&e.layout.outputPortFocusable&&e.outputs.forEach(function(e){t.push({type:"outputPort",obj:e})}),e.focusFunction&&t.push({type:"reactObject",obj:e})),"link"!==n||e.type!==K||this.ap.config.enableLinkSelection!==Se&&this.ap.config.enableLinkSelection!==ve||t.push({type:"linkStart",obj:e}),e.decorations&&e.decorations.forEach(function(e){e.focusable&&t.push({type:"decoration",obj:e})}),"link"!==n||e.type!==K||this.ap.config.enableLinkSelection!==Se&&this.ap.config.enableLinkSelection!==ve||t.push({type:"linkEnd",obj:e}),t}}])}(),Sd=function(){return e(function e(n,i,o,r){t(this,e),this.logger=new gt("SVGCanvasActivePipeline"),this.logger.log("constructor - start"),this.initialize(n,i,o,r),this.logger.log("constructor - end")},[{key:"initialize",value:function(e,t,n,i){this.logger.logStartTimer("initialize"),this.config=t,this.canvasInfo=n,this.selections=i.pipelineId===e?i.selections:[],this.pipeline=this.getPipeline(e,n),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.accessibility=null,this.logger.logEndTimer("initialize")}},{key:"getAccessibility",value:function(){return this.accessibility||(this.accessibility=new wd(this)),this.accessibility}},{key:"getAllLinksForNode",value:function(e){return this.getAccessibility().getAllLinksForNode(e)}},{key:"getNextLinksFromNode",value:function(e){return this.getAccessibility().getNextLinksFromNode(e)}},{key:"getPreviousLinksToNode",value:function(e){return this.getAccessibility().getPreviousLinksToNode(e)}},{key:"getPreviousNodeFromDataLink",value:function(e){return this.getAccessibility().getPreviousNodeFromDataLink(e)}},{key:"getPreviousNodeFromAssocLink",value:function(e){return this.getAccessibility().getPreviousNodeFromAssocLink(e)}},{key:"getPreviousObjectFromCommentLink",value:function(e){return this.getAccessibility().getPreviousObjectFromCommentLink(e)}},{key:"getNextLinksFromComment",value:function(e){return this.getAccessibility().getNextLinksFromComment(e)}},{key:"getNextNodeFromDataLink",value:function(e){return this.getAccessibility().getNextNodeFromDataLink(e)}},{key:"getNextNodeFromAssocLink",value:function(e){return this.getAccessibility().getNextNodeFromAssocLink(e)}},{key:"getNextObjectFromCommentLink",value:function(e){return this.getAccessibility().getNextObjectFromCommentLink(e)}},{key:"getNextSiblingLink",value:function(e){return this.getAccessibility().getNextSiblingLink(e)}},{key:"getPreviousSiblingLink",value:function(e){return this.getAccessibility().getPreviousSiblingLink(e)}},{key:"getNextTabGroupStartObject",value:function(e){return this.getAccessibility().getNextTabGroupStartObject(e)}},{key:"getPreviousTabGroupStartObject",value:function(e){return this.getAccessibility().getPreviousTabGroupStartObject(e)}},{key:"getCanvasDimensions",value:function(e){return D.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;if(!e)return this.pipeline.nodes;var 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 D.isSupernode(e)})}},{key:"isEmptyOrBindingsOnly",value:function(){return(ft(this.pipeline.nodes)||this.containsOnlyBindingNodes())&&ft(this.pipeline.comments)&&ft(this.pipeline.links)}},{key:"containsOnlyBindingNodes",value:function(){return!this.pipeline.nodes.find(function(e){return!D.isSuperBindingNode(e)})}},{key:"getComment",value:function(e){var t=this.mappedComments[e];return void 0===t?null:t}},{key:"getComments",value:function(e){var t=this,n=[];return e.forEach(function(e){var i=t.getComment(e);i&&n.push(i)}),n}},{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:"getLinks",value:function(e){var t=this,n=[];return e.forEach(function(e){var i=t.getLink(e);i&&n.push(i)}),n}},{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===se?(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.type===K&&(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||D.getDefaultInputPortId(e);e.inputs&&e.inputs.forEach(function(e){e.id===n&&(e.isConnected=!0)})}},{key:"setOutputPortConnected",value:function(e,t){var n=t||D.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},{})}},{key:"getSelectedObjectIds",value:function(){return this.selections}},{key:"getSelectedNodesAndComments",value:function(){var e=this,t=this.getSelectedNodes();return this.comments.forEach(function(n){e.getSelectedObjectIds().includes(n.id)&&t.push(n)}),t}},{key:"getSelectedNodes",value:function(){var e=this,t=[];return this.getSelectedObjectIds().forEach(function(n){var i=e.getNode(n);i&&t.push(i)}),t}},{key:"getSelectedComments",value:function(){var e=this,t=[];return this.getSelectedObjectIds().forEach(function(n){var i=e.getComment(n);i&&t.push(i)}),t}},{key:"getSelectedNodeIds",value:function(){return this.getSelectedNodes().map(function(e){return e.id})}},{key:"getSelectedLinks",value:function(){var e=this,t=[];return this.links.forEach(function(n){e.getSelectedObjectIds().includes(n.id)&&t.push(n)}),t}},{key:"getSelectedDetachedLinks",value:function(){return this.getSelectedLinks().filter(function(e){return e.srcPos||e.trgPos})}},{key:"getSelectedLinksCount",value:function(){return this.getSelectedLinks().length}},{key:"isSelected",value:function(e){return this.getSelectedObjectIds().indexOf(e)>=0}},{key:"getNextSubObject",value:function(e,t){return this.getAccessibility().getNextSubObject(e,t)}},{key:"getPreviousSubObject",value:function(e,t){return this.getAccessibility().getPreviousSubObject(e,t)}},{key:"getFocusableSubObjects",value:function(e){return this.getAccessibility().getFocusableSubObjects(e)}}])}();function Td(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Nd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Td(Object(n),!0).forEach(function(t){It(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Td(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Dd=Object.assign({},os,_s),Od=function(){function i(e,n,o,r,a,s,l,c,u){var d=arguments.length>9&&void 0!==arguments[9]?arguments[9]:{};t(this,i),this.logger=new gt(["SVGCanvasRenderer","PipeId",e]),this.logger.logStartTimer("constructor - "+e.substring(0,5)),this.pipelineId=e,this.supernodeInfo=d,this.canvasDiv=n,this.canvasInfo=r,this.selectionInfo=a,this.breadcrumbs=s,this.nodeLayout=l,this.canvasLayout=c,this.config=u,this.canvasController=o,this.activePipeline=new Sd(e,u,r,a),this.superRenderers=[],this.instanceId=this.canvasController.getInstanceId(),this.dispUtils=new Ms(this.canvasController,this.supernodeInfo.d3Selection,this.pipelineId,s),this.linkUtils=new Ks(this.config,this.canvasLayout),this.decUtils=new qs(this.canvasLayout),this.dragObjectUtils=new Ol(this),this.dragLinkUtils=new Il(this),this.dragNewLinkUtils=new uc(this),this.dragDetLinkUtils=new gc(this),this.zoomUtils=new Ld(this),this.externalUtils=new Qs(this),this.svgCanvasTextArea=new ul(this.config,this.dispUtils,this.decUtils,this.canvasController,this.canvasDiv,this.activePipeline,this.removeTempCursorOverlay.bind(this),this.displayComments.bind(this),this.displayLinks.bind(this),this.getCommentToolbarPos.bind(this),this.addCanvasZoomBehavior.bind(this),this.removeCanvasZoomBehavior.bind(this)),this.dispUtils.setDisplayState(),this.logger.log(this.dispUtils.getDisplayStateMsg()),this.dragOverLink=null,this.dragOverDetachedLinks=[],this.dragNewLinkOverNode=null,this.subObject=null,this.subObjectParentObj=null,this.initializeGhostDiv(),this.canvasSVG=this.createCanvasSVG(),this.canvasDefs=this.createDefs(this.canvasSVG,this.canvasLayout),this.canvasBackground=this.createCanvasBackground(this.canvasSVG),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.zoomUtils.restoreZoom(),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 - "+e.substring(0,5))}return e(i,[{key:"setSpaceKeyPressed",value:function(e){this.zoomUtils.setSpaceKeyPressed(e),this.resetCanvasCursor()}},{key:"isSpaceKeyPressed",value:function(){return this.zoomUtils.isSpaceKeyPressed()}},{key:"zoomTo",value:function(e,t){this.zoomUtils.zoomTo(e,t)}},{key:"translateBy",value:function(e,t,n){this.zoomUtils.translateBy(e,t,n)}},{key:"zoomIn",value:function(){this.zoomUtils.zoomIn()}},{key:"zoomOut",value:function(){this.zoomUtils.zoomOut()}},{key:"zoomToFit",value:function(e){this.zoomUtils.zoomToFit(e)}},{key:"isZoomedToMax",value:function(){return this.zoomUtils.isZoomedToMax()}},{key:"isZoomedToMin",value:function(){return this.zoomUtils.isZoomedToMin()}},{key:"getZoomToReveal",value:function(e,t,n){return this.zoomUtils.getZoomToReveal(e,t,n)}},{key:"getZoom",value:function(){return this.zoomUtils.getZoom()}},{key:"getTransformedViewportDimensions",value:function(){return this.zoomUtils.getTransformedViewportDimensions()}},{key:"getCanvasDimensionsWithPadding",value:function(){return this.zoomUtils.getCanvasDimensionsWithPadding()}},{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 D.isSupernode(t)&&t.id===e.supernodeInfo.id})))}),t}},{key:"setCanvasInfoRenderer",value:function(e,t,n,i,o,r){this.logger.logStartTimer("setCanvasInfoRenderer"+this.pipelineId.substring(0,5)),this.config=r,this.canvasInfo=e,this.selectionInfo=t,this.breadcrumbs=n,this.nodeLayout=i,this.canvasLayout=o,this.activePipeline.initialize(this.pipelineId,r,e,t),this.linkUtils=new Ks(this.config,this.canvasLayout),this.svgCanvasTextArea=new ul(this.config,this.dispUtils,this.decUtils,this.canvasController,this.canvasDiv,this.activePipeline,this.removeTempCursorOverlay.bind(this),this.displayComments.bind(this),this.displayLinks.bind(this),this.getCommentToolbarPos.bind(this),this.addCanvasZoomBehavior.bind(this),this.removeCanvasZoomBehavior.bind(this)),this.dispUtils.setDisplayState(),this.logger.log(this.dispUtils.getDisplayStateMsg()),this.resetCanvasSVGBehaviors(),this.superRenderers=this.cleanUpSuperRenderers(),this.displayCanvas(),this.config.enableKeyboardNavigation&&(this.logger.log("setCanvasInfoRenderer - Restoring focus"),this.restoreFocus()),this.logger.logEndTimer("setCanvasInfoRenderer"+this.pipelineId.substring(0,5))}},{key:"setSelectionInfo",value:function(e){this.selectionInfo=e,this.activePipeline.initialize(this.pipelineId,this.config,this.canvasInfo,e),this.displayCommentsSelectionStatus(),this.displayNodesSelectionStatus(),this.displayLinksSelectionStatus(),this.superRenderers.forEach(function(t){t.setSelectionInfo(e)})}},{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.zoomUtils.resetZoomTransform(),this.canvasSVG.remove()}},{key:"refreshOnSizeChange",value:function(){if(this.logger.log("refreshOnSizeChange"),this.dispUtils.isDisplayingSubFlowFullPage()&&this.displayBindingNodesToFitSVG(),this.config.enableBoundingRectangles&&this.displayBoundingRectangles(),this.setCanvasBackgroundSize(),this.config.enablePositionNodeOnRightFlyoutOpen&&this.canvasController.isRightFlyoutOpen()){var e="boolean"==typeof this.config.enablePositionNodeOnRightFlyoutOpen?{x:50,y:50}:this.config.enablePositionNodeOnRightFlyoutOpen,t=e.x?e.x:50,n=e.y?e.y:50,i=this.activePipeline.getSelectedNodeIds(),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.displayCanvasAccoutrements(),this.logger.logEndTimer("displayCanvas")}},{key:"displayCanvasAccoutrements",value:function(){this.config.enableBoundingRectangles&&this.displayBoundingRectangles(),"None"!==this.config.enableCanvasUnderlay&&this.dispUtils.isDisplayingPrimaryFlowFullPage()&&this.setCanvasUnderlaySize(),this.setCanvasBackgroundSize(),this.dispUtils.isDisplayingSubFlowFullPage()&&this.displayPortsForSubFlowFullPage()}},{key:"displayPortsForSubFlowFullPage",value:function(){this.setPortPositionsAndSizesForNode(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.displayMovedNodes(),this.displayMovedLinks(),this.logger.log("displayBindingNodesToFitSVG - end")}},{key:"getParentSupernodeSVGDimensions",value:function(){var e=this.getParentSupernodeDatum();return{width:e.width-2*e.layout.supernodeSVGAreaPadding,height:e.height-e.layout.supernodeTopAreaHeight-e.layout.supernodeSVGAreaPadding,x:e.layout.supernodeSVGAreaPadding,y:e.layout.supernodeTopAreaHeight,x_pos:e.x_pos+e.layout.supernodeSVGAreaPadding,y_pos:e.y_pos+e.layout.supernodeTopAreaHeight}}},{key:"moveSuperBindingNodes",value:function(){var e=this,t=this.zoomUtils.getTransformedViewportDimensions(),n=this.getParentSupernodeDatum();if(this.canvasLayout.linkDirection===Te||this.canvasLayout.linkDirection===Ne){var i=n.width-2*n.layout.supernodeSVGAreaPadding;this.activePipeline.nodes.forEach(function(o){if(o.isSupernodeInputBinding){var r=Rs.getSupernodePortXOffset(o.id,n.inputs,n);o.x_pos=t.width*(r/i)+t.x-o.outputs[0].cx,o.y_pos=e.canvasLayout.linkDirection===Te?t.y-o.height:t.y+t.height}if(o.isSupernodeOutputBinding){var a=Rs.getSupernodePortXOffset(o.id,n.outputs,n);o.x_pos=t.width*(a/i)+t.x-o.inputs[0].cx,o.y_pos=e.canvasLayout.linkDirection===Te?o.y_pos=t.y+t.height:o.y_pos=t.y-o.height}})}else{var o,r;D.isExpanded(n)?(o=n.layout.supernodeTopAreaHeight,r=n.height-(n.layout.supernodeTopAreaHeight+n.layout.supernodeSVGAreaPadding)):(o=0,r=n.height),this.activePipeline.nodes.forEach(function(i){if(i.isSupernodeInputBinding){i.x_pos=e.canvasLayout.linkDirection===De?t.x-i.width:t.x+t.width;var a=Rs.getSupernodePortYOffset(i.id,n.inputs)-o;i.y_pos=t.height*(a/r)+t.y-i.outputs[0].cy}if(i.isSupernodeOutputBinding){i.x_pos=e.canvasLayout.linkDirection===De?t.x+t.width:t.x-i.width;var s=Rs.getSupernodePortYOffset(i.id,n.outputs)-o;i.y_pos=t.height*(s/r)+t.y-i.inputs[0].cy}})}}},{key:"displayBoundingRectangles",value:function(){if(this.activePipeline){var e=this.zoomUtils.getViewportDimensions(),t=this.zoomUtils.getTransformedRect(e,1),n=this.zoomUtils.getCanvasDimensions(),i=this.zoomUtils.getCanvasDimensionsWithPadding();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.dragObjectUtils.isMoving()||this.dragNewLinkUtils.isDragging()||this.dragDetLinkUtils.isDragging()||this.dragLinkUtils.isDragging()}},{key:"isSizing",value:function(){this.dragObjectUtils.isSizing()}},{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:"getCommentGroupSelectionById",value:function(e){var t=this.getSelectorForId("comment_grp",e);return this.commentsGrp.selectChildren(t)}},{key:"getNodeLabelSelectionById",value:function(e){var t=this.getNodeGroupSelectionById(e),n=this.getSelectorForNodeLabelId();return t.selectAll(n)}},{key:"getNodeInputPortSelectionById",value:function(e,t){var n=this.getNodeGroupSelectionById(t),i=this.getSelectorForInputPortId(e);return n.selectAll(i)}},{key:"getNodeOutputPortSelectionById",value:function(e,t){var n=this.getNodeGroupSelectionById(t),i=this.getSelectorForOutputPortId(e);return n.selectAll(i)}},{key:"getNodeDecSelectionById",value:function(e,t){var n=this.getNodeGroupSelectionById(t),i=this.getSelectorForId("node_dec_group",e);return n.selectAll(i)}},{key:"getLinkStartHandleGrpSelectionById",value:function(e){return this.getLinkGroupSelectionById(e).selectAll(".d3-link-handle-start-group")}},{key:"getLinkEndHandleGrpSelectionById",value:function(e){return this.getLinkGroupSelectionById(e).selectAll(".d3-link-handle-end-group")}},{key:"getLinkDecSelectionById",value:function(e,t){var n=this.getLinkGroupSelectionById(t),i=this.getSelectorForId("link_dec_group",e);return n.selectAll(i)}},{key:"getSelectorForNodeLabelId",value:function(){return".d3-foreign-object-node-label"}},{key:"getSelectorForInputPortId",value:function(e){return"[data-port-id='".concat(e,"'].d3-node-port-input")}},{key:"getSelectorForOutputPortId",value:function(e){return"[data-port-id='".concat(e,"'].d3-node-port-output")}},{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!==ge&&this.config.enableSnapToGridType!==fe||(t=this.snapToGridPosition(t)),t}},{key:"getTransformedMousePos",value:function(e){return this.zoomUtils.transformPos(this.getMousePos(e,this.canvasSVG))}},{key:"getMousePos",value:function(e,t){if(e.sourceEvent||e.pageX){var n=Dd.pointer(e,t.node());return{x:n[0],y:n[1]}}return{x:0,y:0}}},{key:"convertPageCoordsToSnappedCanvasCoords",value:function(e){var t=this.convertPageCoordsToCanvasCoords(e.x,e.y);return t=this.getMousePosSnapToGrid(t)}},{key:"convertPageCoordsToCanvasCoords",value:function(e,t){var n=this.canvasSVG.node().getBoundingClientRect();return this.zoomUtils.transformPos({x:e-Math.round(n.left),y:t-Math.round(n.top)})}},{key:"convertCanvasCoordsToPageCoords",value:function(e,t){var n=this.canvasSVG.node().getBoundingClientRect(),i=this.zoomUtils.unTransformPos({x:e,y:t});return{x:i.x+Math.round(n.left),y:i.y+Math.round(n.top)}}},{key:"convertCanvasCoordsToScreenCoords",value:function(e){var t=this.zoomUtils.unTransformPos(e);return this.dispUtils.isDisplayingSubFlowInPlace()&&(t=this.addParentSupernodeOffset(t)),t}},{key:"addParentSupernodeOffset",value:function(e){var t=this.getParentSupernodeSVGDimensions(),n={x:e.x+t.x_pos,y:e.y+t.y_pos},i=this.supernodeInfo.renderer.zoomUtils.unTransformPos(n);return this.supernodeInfo.renderer.dispUtils.isDisplayingSubFlowInPlace()?this.supernodeInfo.renderer.addParentSupernodeOffset(i):i}},{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.getGhostDivSel(),i=this.zoomUtils.getZoomScale(),o=Math.max(this.nodeLayout.labelWidth,e.width),r=0;n.selectAll(".d3-ghost-svg").remove();var a=n.append("svg").attr("width",o*i).attr("height",(50+e.height)*i).attr("x",0).attr("y",0).attr("aria-hidden",!0).attr("class","d3-ghost-svg").append("g").attr("class","d3-node-group");if(a.append("rect").attr("class","d3-ghost-node").attr("x",0).attr("y",0).attr("width",e.width).attr("height",e.height),!this.nodeLayout.nodeExternalObject){a.append(function(){return t.getImageElement(e)}).each(function(n,i,o){return t.setNodeImageContent(e,i,o)}).attr("x",Rs.getNodeImagePosX(e)).attr("y",Rs.getNodeImagePosY(e)).attr("width",Rs.getNodeImageWidth(e)).attr("height",Rs.getNodeImageHeight(e));var s=a.append("foreignObject").attr("x",Rs.getNodeLabelPosX(e)).attr("y",Rs.getNodeLabelPosY(e)).attr("width",Rs.getNodeLabelWidth(e)).attr("height",Rs.getNodeLabelHeight(e)).attr("class","d3-foreign-object-ghost-label"),l=s.append("xhtml:div").attr("class",Rs.getNodeLabelClass(e)),c=l.append("xhtml:span").html(e.label).node().getBoundingClientRect().width+4,u=Rs.getNodeLabelWidth(e),d=Math.min(u,c);if(r=Math.max(0,(d-e.width)/2)*i,"center"===e.layout.labelAlign){var h=Math.max(0,(u-d)/2);s.attr("width",d).attr("x",Rs.getNodeLabelPosX(e)+h),l.attr("width",d)}}a.attr("transform","translate(".concat(r,", 0) scale(").concat(i,")"));var p=this.getBrowserZoom(),g=(r+e.width/2*i)*p,f=e.height/2*i*p;return{element:n.node(),centerX:g,centerY:f,nodeTemplate:e}}},{key:"getBrowserZoom",value:function(){var e=window.devicePixelRatio;return navigator.userAgent.includes("Chrome")?e=1:navigator.userAgent.includes("Safari")?e=(window.outerWidth-8)/window.innerWidth:navigator.userAgent.includes("Firefox")&&(e=1),e}},{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),r={x1:o.x-e.width/2,y1:o.y-e.height/2,x2:o.x+e.width/2,y2:o.y+e.height/2},a=this.canvasController.convertNodeTemplate(e),s=this.getAttachableLinksForNodeAtPos(a,r);this.setDetachedLinkHighlighting(s)}"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:"setHighlightingOverNode",value:function(e,t){e?this.dragNewLinkOverNode?t.id!==this.dragNewLinkOverNode.id&&(this.setLinkOverNode(this.dragNewLinkOverNode,!1),this.dragNewLinkOverNode=t,this.setLinkOverNode(this.dragNewLinkOverNode,!0)):(this.dragNewLinkOverNode=t,this.setLinkOverNode(this.dragNewLinkOverNode,!0)):this.dragNewLinkOverNode&&(this.setLinkOverNode(this.dragNewLinkOverNode,!1),this.dragNewLinkOverNode=null)}},{key:"setLinkOverNode",value:function(e,t){e&&this.getNodeGroupSelectionById(e.id).attr("data-new-link-over",t?"yes":"no")}},{key:"setLinkOverNodeCancel",value:function(){this.setLinkOverNode(this.dragNewLinkOverNode,!1),this.dragNewLinkOverNode=null}},{key:"nodeTemplateDropped",value:function(e,t,n){if(null!==e){var i=this.transformMousePosForNode(t,n,e);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,n){var i=this.convertPageCoordsToCanvasCoords(e,t);return n&&n.width&&n.height?(i.x-=n.width/2,i.y-=n.height/2):(i.x-=this.nodeLayout.defaultNodeWidth/2,i.y-=this.nodeLayout.defaultNodeHeight/2),this.getMousePosSnapToGrid(i)}},{key:"isNodeTemplateInsertableIntoLink",value:function(e){return this.config.enableInsertNodeDroppedOnLink&&D.hasInputAndOutputPorts(e)&&!this.isPortMaxCardinalityZero(e.inputs[0])&&!this.isPortMaxCardinalityZero(e.outputs[0])}},{key:"isNodeTemplateAttachableToDetachedLinks",value:function(e){return this.config.enableLinkSelection===ve}},{key:"getAttachableLinksForNodeAtPos",value:function(e,t){var n=this,i=e.inputs&&e.inputs.length>0,o=e.outputs&&e.outputs.length>0,r=this.activePipeline.links.filter(function(e){return e.srcPos&&o&&D.isPosInArea(e.srcPos,t,n.canvasLayout.ghostAreaPadding)?(e.nodeOverSrcPos=!0,!0):e.trgPos&&i&&D.isPosInArea(e.trgPos,t,n.canvasLayout.ghostAreaPadding)?(e.nodeOverTrgPos=!0,!0):(e.nodeOverSrcPos=!1,e.nodeOverTrgPos=!1,!1)});r.length>0&&(r=D.getDetachedLinksToUpdate(e,r,this.activePipeline.links).oldLinks);return r}},{key:"isLinkFullyAttached",value:function(e){return!!e&&(void 0!==e.srcNodeId&&void 0!==e.trgNodeId)}},{key:"setMaxZoomExtent",value:function(e){if(this.dispUtils.isDisplayingFullPage())this.zoomUtils.setMaxZoomExtent(e);else{var t=1*Number(e)/this.zoomUtils.getZoomScale();this.supernodeInfo.renderer.setMaxZoomExtent(t)}}},{key:"createCanvasSVG",value:function(){var e=this;this.logger.log("Create Canvas SVG.");var t=this.dispUtils.isDisplayingSubFlowInPlace()?this.getParentSupernodeSVGDimensions():{width:"100%",height:"100%",x:0,y:0};return(this.dispUtils.isDisplayingSubFlowInPlace()?this.supernodeInfo.d3Selection:this.canvasDiv).append("svg").attr("class","svg-area").attr("data-pipeline-id",this.activePipeline.id).attr("aria-label",this.canvasController.labelUtil.getLabel("canvas.contents")).attr("width",t.width).attr("height",t.height).attr("x",t.x).attr("y",t.y).on("mouseenter",function(t,n){e.supernodeInfo.renderer&&e.config.enableZoomIntoSubFlows&&e.supernodeInfo.renderer.setMaxZoomExtent(1/e.zoomUtils.getZoomScale())}).on("mouseleave",function(t,n){e.supernodeInfo.renderer&&e.config.enableZoomIntoSubFlows&&e.supernodeInfo.renderer.setMaxZoomExtent(1)})}},{key:"createDefs",value:function(e,t){if(this.dispUtils.isDisplayingFullPage()){var n=e.append("defs");return this.createDropShadow(n),this.createGrid(n,t),e.selectChildren("defs")}return null}},{key:"createCanvasBackground",value:function(e){var t=this,n=this.zoomUtils.getTransformedViewportDimensions(),i=e.append("rect").attr("x",0).attr("y",0).attr("width",n.width).attr("height",n.height).attr("data-pipeline-id",this.activePipeline.id).attr("pointer-events","all").style("cursor","default").on("mousedown",function(){t.svgCanvasTextArea.isEditingText()||t.canvasController.setFocusOnCanvas()}),o=this.getGridId();return o?(i.attr("class","d3-svg-background-grid"),i.attr("fill","url(#".concat(o,")"))):i.attr("class","d3-svg-background"),i}},{key:"resetCanvasSVGBehaviors",value:function(){var e=this;this.removeCanvasZoomBehavior(),!this.activePipeline.isEmptyOrBindingsOnly()&&this.dispUtils.isDisplayingFullPage()&&this.canvasSVG.call(this.zoomUtils.getZoomHandler()),this.canvasSVG.on("mousedown",function(t){e.logger.log("Canvas - mousedown"),e.dispUtils.isDisplayingSubFlowInPlace()&&t.button===Oe&&t.stopPropagation()}).on("click.zoom",function(t){e.logger.log("Canvas - click-zoom"),e.canvasController.clickActionHandler({clickType:"contextmenu"===t.type?Ee:ye,objectType:"canvas",selectedObjectIds:e.activePipeline.getSelectedObjectIds()})}).on("dblclick.zoom",function(){e.logger.log("Zoom - double click"),e.canvasController.clickActionHandler({clickType:Ie,objectType:"canvas",selectedObjectIds:e.activePipeline.getSelectedObjectIds()})}).on("contextmenu.zoom",function(t,n){e.logger.log("Zoom - context menu"),e.openContextMenu(t,"canvas")})}},{key:"addCanvasZoomBehavior",value:function(){this.resetCanvasSVGBehaviors()}},{key:"removeCanvasZoomBehavior",value:function(){this.canvasSVG.on(".zoom",null)}},{key:"resetCanvasCursor",value:function(){var e=".d3-svg-background[data-pipeline-id='"+this.activePipeline.id+"']";this.canvasSVG.select(e).style("cursor",this.zoomUtils.isDragActivated()&&this.dispUtils.isDisplayingFullPage()?"grab":"default")}},{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.zoomUtils.getCanvasDimensionsWithPadding();e&&this.canvasUnderlay.attr("x",e.left-50).attr("y",e.top-50).attr("width",e.width+100).attr("height",e.height+100)}},{key:"setCanvasBackgroundSize",value:function(){var e=this.zoomUtils.getTransformedViewportDimensions();this.canvasBackground.attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height)}},{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:"createGrid",value:function(e,t){var n=t.displayGridMajorPx,i=t.displayGridMajorPy,o=t.displayGridMinorPx,r=t.displayGridMinorPy,a=this.getGridId();if(t.displayGridType===Ae)this.addDotsPattern(e,a,o,r);else if(t.displayGridType===je)this.addBoxesPattern(e,a,o,r);else if(t.displayGridType===_e){this.addBoxesPattern(e,"smallGrid",o,r);var s=e.append("pattern").attr("id",a).attr("width",n).attr("height",i).attr("x",0).attr("y",0).attr("patternUnits","userSpaceOnUse");s.append("rect").attr("width",n).attr("height",i).attr("stroke","none").attr("fill","url(#smallGrid)"),s.append("path").attr("d","M ".concat(n," 0 L 0 0 0 ").concat(i)).attr("class","d3-grid-lines")}else if(t.displayGridType===Me){this.addDotsPattern(e,"smallGrid",o,r);var l=e.append("pattern").attr("id",a).attr("width",n).attr("height",i).attr("x",0).attr("y",0).attr("patternUnits","userSpaceOnUse");l.append("rect").attr("width",n-o).attr("height",i-r).attr("x",.5*o).attr("y",.5*r).attr("stroke","none").attr("fill","url(#smallGrid)"),l.append("path").attr("d","M ".concat(n," 0 L 0 0 0 ").concat(i)).attr("class","d3-grid-lines")}}},{key:"getGridId",value:function(){return this.canvasLayout.displayGridType===Ae?"d3_grid_dots_pattern_"+this.instanceId:this.canvasLayout.displayGridType===je?"d3_grid_boxes_pattern_"+this.instanceId:this.canvasLayout.displayGridType===Me?"d3_grid_dots_lines_pattern_"+this.instanceId:this.canvasLayout.displayGridType===_e?"d3_grid_boxes_lines_pattern_"+this.instanceId:null}},{key:"addDotsPattern",value:function(e,t,n,i){var o=e.append("pattern").attr("id",t).attr("width",n).attr("height",i).attr("x",.5*n).attr("y",.5*i).attr("patternUnits","userSpaceOnUse");return o.append("circle").attr("cx",.5*n).attr("cy",.5*i).attr("class","d3-grid-dot"),o}},{key:"addBoxesPattern",value:function(e,t,n,i){e.append("pattern").attr("id",t).attr("width",n).attr("height",i).attr("x",0).attr("y",0).attr("patternUnits","userSpaceOnUse").append("path").attr("d","M ".concat(n," 0 L 0 0 0 ").concat(i)).attr("class","d3-grid-boxes")}},{key:"setCommentEditingMode",value:function(e,t){if(this.pipelineId===t){var n=this.activePipeline.getComment(e);if(n&&this.config.enableEditingActions){var i=this.getCommentGroupSelectionById(e).node();this.displayCommentTextArea(n,i)}}else this.superRenderers.forEach(function(n){n.setCommentEditingMode(e,t)})}},{key:"setNodeLabelEditingMode",value:function(e,t){if(this.pipelineId===t){var n=this.activePipeline.getNode(e);if(n&&n.layout.labelEditable&&this.config.enableEditingActions){var i=this.getNodeGroupSelectionById(e).node();this.displayNodeLabelTextArea(n,i)}}else this.superRenderers.forEach(function(n){n.setNodeLabelEditingMode(e,t)})}},{key:"setNodeDecorationLabelEditingMode",value:function(e,t,n){if(this.pipelineId===n){var i=this.activePipeline.getNode(t);if(i&&i.decorations){var o=i.decorations.find(function(t){return t.id===e});if(o&&void 0!==o.label&&o.label_editable&&this.config.enableEditingActions){var r=this.getNodeDecSelectionById(e,t).node();this.displayDecLabelTextArea(o,i,"node",r)}}}else this.superRenderers.forEach(function(i){i.setLinkDecorationLabelEditingMode(e,t,n)})}},{key:"setLinkDecorationLabelEditingMode",value:function(e,t,n){if(this.pipelineId===n){var i=this.activePipeline.getLink(t);if(i&&i.decorations){var o=i.decorations.find(function(t){return t.id===e});if(o&&void 0!==o.label&&o.label_editable&&this.config.enableEditingActions){var r=this.getLinkDecSelectionById(e,t).node();this.displayDecLabelTextArea(o,i,"link",r)}}}else this.superRenderers.forEach(function(i){i.setLinkDecorationLabelEditingMode(e,t,n)})}},{key:"repositionCommentToolbar",value:function(){if(this.dispUtils.isDisplayingFullPage()&&this.svgCanvasTextArea.isEditingText()){var e=this.activePipeline.getComment(this.svgCanvasTextArea.getEditingTextId());if(e&&(e.contentType===F||this.config.enableMarkdownInComments)){var t=this.getCommentToolbarPos(e);this.canvasController.moveTextToolbar(t.x,t.y)}}}},{key:"getCommentToolbarPos",value:function(e){var t=this.zoomUtils.unTransformPos({x:e.x_pos,y:e.y_pos});return{x:t.x+this.canvasLayout.commentToolbarPosX,y:t.y+this.canvasLayout.commentToolbarPosY}}},{key:"snapToGridPosition",value:function(e){return{x:D.snapToGrid(e.x,this.canvasLayout.snapToGridXPx),y:D.snapToGrid(e.y,this.canvasLayout.snapToGridYPx)}}},{key:"displayNodes",value:function(){this.logger.logStartTimer("displayNodes "+this.getFlags()),this.setPortPositionsAllNodes();var e=this.getAllNodeGroupsSelection();this.displayNodesSubset(e,this.activePipeline.nodes),this.logger.logEndTimer("displayNodes "+this.getFlags())}},{key:"displayMovedNodes",value:function(){var e=this;this.logger.logStartTimer("displayMovedNodes");var 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"),e.updateOutputPortArrowPath(i[n],"d3-node-port-output-arrow")),t.isSupernodeOutputBinding&&(e.updatePortRadiusAndPos(i[n],t,"d3-node-port-input-main"),e.updateInputPortArrowPath(i[n],"d3-node-port-input-arrow"))}),this.logger.logEndTimer("displayMovedNodes")}},{key:"displayNodesSelectionStatus",value:function(e){var t=this;this.logger.logStartTimer("displayNodesSelectionStatus"),this.getAllNodeGroupsSelection().selectChildren(".d3-node-selection-highlight").attr("data-selected",function(e){return t.activePipeline.isSelected(e.id)?"yes":"no"}),this.logger.logEndTimer("displayNodesSelectionStatus")}},{key:"displaySingleNode",value:function(e){this.logger.logStartTimer("displaySingleNode "+this.getFlags()),this.setPortPositionsAndSizesForNode(e);var t=this.getNodeGroupSelectionById(e.id);this.displayNodesSubset(t,[e]),this.logger.logEndTimer("displaySingleNode "+this.getFlags())}},{key:"displayNodesSubset",value:function(e,t){var n=this;this.preserveFocus(function(){e.data(t,function(e){return e.id}).join(function(e){return n.createNodes(e)},null,function(e){return n.removeNodes(e)}).attr("transform",function(e){return"translate(".concat(e.x_pos,", ").concat(e.y_pos,")")}).attr("class",function(e){return n.getNodeGroupClass(e)}).attr("style",function(e){return n.getNodeGrpStyle(e)}).attr("tabindex",-1).attr("aria-label",function(e){return e.label}).attr("aria-roledescription",n.canvasController.labelUtil.getLabel("node.ariaRoleDescription")).call(function(e){return n.updateNodes(e,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.logger.logEndTimer("createNodes"),n}},{key:"updateNodes",value:function(e,t){var n=this;this.logger.logStartTimer("updateNodes");var i=e.filter(function(e){return!D.isSuperBindingNode(e)});i.selectChildren(".d3-focus-path").data(function(e){return[e]},function(e){return e.id}).join(function(e){return null}).attr("d",function(e){return n.getNodeShapePathSizing(e)}),i.selectChildren(".d3-node-sizing").data(function(e){return D.isNodeResizable(e,n.config)?[e]:[]},function(e){return e.id}).join(function(e){return e.insert("path",function(e,t,n){return Rs.getBeforeElement(n[t]._parent,"d3-node-sizing")}).attr("class","d3-node-sizing").call(n.attachNodeSizingListeners.bind(n))}).datum(function(e){return n.activePipeline.getNode(e.id)}).attr("d",function(e){return n.getNodeShapePathSizing(e)}),i.selectChildren(".d3-node-selection-highlight").data(function(e){return[e]},function(e){return e.id}).join(function(e){return e.insert("path",function(e,t,n){return Rs.getBeforeElement(n[t]._parent,"d3-node-selection-highlight")}).attr("class","d3-node-selection-highlight")}).datum(function(e){return n.activePipeline.getNode(e.id)}).attr("d",function(e){return n.getNodeSelectionOutline(e)}).attr("data-selected",function(e){return n.activePipeline.isSelected(e.id)?"yes":"no"}).attr("style",function(e){return n.getNodeSelectionOutlineStyle(e,"default")}),i.selectChildren(".d3-node-body-outline").data(function(e){return e.layout.nodeShapeDisplay||D.isExpandedSupernode(e)?[e]:[]},function(e){return e.id}).join(function(e){return e.insert("path",function(e,t,n){return Rs.getBeforeElement(n[t]._parent,"d3-node-body-outline")}).attr("class","d3-node-body-outline")}).datum(function(e){return n.activePipeline.getNode(e.id)}).attr("d",function(e){return n.getNodeShapePath(e)}).attr("style",function(e){return n.getNodeBodyStyle(e,"default")}),i.selectChildren(".d3-foreign-object-external-node").data(function(e){return e.layout.nodeExternalObject?[e]:[]},function(e){return e.id}).join(function(e){return e.insert("foreignObject",function(e,t,n){return Rs.getBeforeElement(n[t]._parent,"d3-foreign-object-external-node")}).attr("class","d3-foreign-object-external-node")},null,function(e){e.each(function(e,t,i){return n.externalUtils.removeExternalObject(e,t,i)}),e.remove()}).datum(function(e){return n.activePipeline.getNode(e.id)}).attr("tabindex",-1).attr("width",function(e){return e.width}).attr("height",function(e){return e.height}).attr("x",0).attr("y",0).each(function(e,t,i){return n.externalUtils.addNodeExternalObject(e,t,i,n.activePipeline.pipeline)}),i.selectChildren(".d3-node-image").data(function(e){return e.layout.imageDisplay?[e]:[]},function(e){return e.id}).join(function(e){return e.insert(function(e){return n.getImageElement(e)},function(e,t,n){return Rs.getBeforeElement(n[t]._parent,"d3-node-image")})}).datum(function(e){return n.activePipeline.getNode(e.id)}).each(function(e,t,i){return n.setNodeImageContent(e,t,i)}).attr("x",function(e){return Rs.getNodeImagePosX(e)}).attr("y",function(e){return Rs.getNodeImagePosY(e)}).attr("width",function(e){return Rs.getNodeImageWidth(e)}).attr("height",function(e){return Rs.getNodeImageHeight(e)}).attr("style",function(e){return n.getNodeImageStyle(e,"default")}),i.selectChildren(".d3-foreign-object-node-label").data(function(e){return e.layout.labelDisplay?[e]:[]},function(e){return e.id}).join(function(e){var t=e.insert("foreignObject",function(e,t,n){return Rs.getBeforeElement(n[t]._parent,"d3-foreign-object-node-label")}).attr("class","d3-foreign-object-node-label").call(n.attachNodeLabelListeners.bind(n));return t.append("xhtml:div").append("xhtml:span").call(n.attachNodeLabelSpanListeners.bind(n)),t}).datum(function(e){return n.activePipeline.getNode(e.id)}).attr("x",function(e){return Rs.getNodeLabelPosX(e)}).attr("y",function(e){return Rs.getNodeLabelPosY(e)}).attr("width",function(e){return Rs.getNodeLabelWidth(e)}).attr("height",function(e){return Rs.getNodeLabelHeight(e)}).select("div").attr("class",function(e){return Rs.getNodeLabelClass(e)}).attr("style",function(e){return n.getNodeLabelStyle(e,"default")}).select("span").html(function(e){return ps(e.label)}),i.selectChildren(".d3-node-ellipsis-group").attr("transform",function(e){return Rs.getNodeEllipsisTranslate(e)}),i.selectChildren(".d3-node-super-expand-icon-group").attr("transform",function(e){return Rs.getNodeExpansionIconTranslate(e)}),e.each(function(e,t,i){var o=Dd.select(i[t]);if(n.displayPorts(o,e),D.isSupernode(e)&&n.displaySupernodeContents(e,Dd.select(i[t])),!D.isSuperBindingNode(e)){n.addErrorMarker(e,o);var r=D.getCombinedDecorations(e.layout.decorations,e.decorations);n.displayDecorations(e,ze,o,r)}});var o=this.dragObjectUtils.getDragObjectHandler();i.filter(function(e){return n.shouldAddDragHandlerToNode(e)}).call(o),i.filter(function(e){return!n.shouldAddDragHandlerToNode(e)}).on(".drag",null),this.logger.logEndTimer("updateNodes")}},{key:"shouldAddDragHandlerToNode",value:function(e){return D.isObjectMovable(e)&&this.config.enableEditingActions}},{key:"removeNodes",value:function(e){var t=this;e.selectAll(".d3-foreign-object-node-image").each(function(e,n,i){return t.externalUtils.removeExternalObject(e,n,i)}),e.selectAll(".d3-foreign-object-dec-jsx").each(function(e,n,i){return t.externalUtils.removeExternalObject(e,n,i)}),e.selectChildren(".d3-foreign-object-port-jsx").each(function(e,n,i){return t.externalUtils.removeExternalObject(e,n,i)}),e.selectChildren(".d3-foreign-object-external-node").each(function(e,n,i){return t.externalUtils.removeExternalObject(e,n,i)}),e.remove()}},{key:"displaySupernodeContents",value:function(e,t){var n=this.getRendererForSupernode(e);D.isExpanded(e)?n?n.setCanvasInfoRenderer(this.canvasInfo,this.selectionInfo,this.breadcrumbs,this.nodeLayout,this.canvasLayout,this.config):(n=this.createSupernodeRenderer(e,t),this.superRenderers.push(n)):n&&n.hideCanvas(e)}},{key:"displayPorts",value:function(e,t){this.displayInputPorts(e,t),this.displayOutputPorts(e,t)}},{key:"displayInputPorts",value:function(e,t){var n=this,i="."+this.getNodeInputPortClassName(),o=t.inputs||[];o=t.layout.inputPortDisplay?o:[],e.selectChildren(i).data(o,function(e){return e.id}).join(function(e){return n.createInputPorts(e,t)},null,function(e){return n.removePorts(e)}).attr("connected",function(e){return e.isConnected?"yes":"no"}).attr("class",function(e){return n.getNodeInputPortClassName()+(e.class_name?" "+e.class_name:"")}).attr("tabindex",-1).attr("role","button").attr("aria-label",function(e){return e.label||e.id}).attr("aria-roledescription",this.canvasController.labelUtil.getLabel("port.ariaRoleDescription")).call(function(e){return n.updateInputPorts(e,t)})}},{key:"createInputPorts",value:function(e,t){var n=this,i=e.append("g").attr("data-port-id",function(e){return e.id}).attr("isSupernodeBinding",D.isSuperBindingNode(t)?"yes":"no").each(function(e,i,o){var r=D.getPortIndex(t.inputs,e.id),a=n.getPortDisplayInfo(t.layout.inputPortDisplayObjects,r),s=Dd.select(o[i]);s.append(a.tag).attr("tabindex",-1).attr("class","d3-node-port-input-main"+("foreignObject"===a.tag?" d3-foreign-object-port-jsx":"")),s.filter(function(){return!n.config.enableAssocLinkCreation&&a.type===He&&!D.isSuperBindingNode(t)}).append("path").attr("class","d3-node-port-input-arrow")}).call(this.attachInputPortListeners.bind(this),t);return i}},{key:"updateInputPorts",value:function(e,t){var n=this;if(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 r=Dd.select(o[i]),a=D.getPortIndex(t.inputs,e.id),s=n.getPortDisplayInfo(t.layout.inputPortDisplayObjects,a),l=n.getPortImageTransform(e,he);n.updatePort(r,s,t,e,l)}),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 r=Dd.select(o[i]),a=D.getPortIndex(t.inputs,e.id);n.getPortDisplayInfo(t.layout.inputPortDisplayObjects,a).type===He&&r.attr("d",n.getPortArrowPath()).attr("transform",n.getInputPortArrowPathTransform(e))}),this.config.enableEditingActions){var i=this.dragNewLinkUtils.getDragNewLinkHandler();e.call(i)}else e.on(".drag",null)}},{key:"removePorts",value:function(e){var t=this;e.selectChildren(".d3-foreign-object-port-jsx").each(function(e,n,i){return t.externalUtils.removeExternalObject(e,n,i)}),e.remove()}},{key:"displayOutputPorts",value:function(e,t){var n=this,i="."+this.getNodeOutputPortClassName(),o=t.outputs||[];o=t.layout.outputPortDisplay?o:[],o=t.layout.singleOutputPortDisplay&&o.length>1?[o[o.length-1]]:o,e.selectChildren(i).data(o,function(e){return e.id}).join(function(e){return n.createOutputPorts(e,t)},null,function(e){return n.removePorts(e)}).attr("connected",function(e){return e.isConnected?"yes":"no"}).attr("class",function(e){return n.getNodeOutputPortClassName()+(e.class_name?" "+e.class_name:"")}).attr("tabindex",-1).attr("role","button").attr("aria-label",function(e){var t=e.label||e.id;return e.connectFrom?n.canvasController.labelUtil.getLabel("port.markedForOutput",{label:t}):t}).attr("aria-roledescription",this.canvasController.labelUtil.getLabel("port.ariaRoleDescription")).call(function(e){return n.updateOutputPorts(e,t)})}},{key:"createOutputPorts",value:function(e,t){var n=this,i=e.append("g").attr("data-port-id",function(e){return e.id}).attr("isSupernodeBinding",D.isSuperBindingNode(t)?"yes":"no").each(function(e,i,o){var r=D.getPortIndex(t.outputs,e.id),a=n.getPortDisplayInfo(t.layout.outputPortDisplayObjects,r),s=Dd.select(o[i]);s.append(a.tag).attr("tabindex",-1).attr("class","d3-node-port-output-main"+("foreignObject"===a.tag?" d3-foreign-object-port-jsx":"")),s.filter(function(){return!n.config.enableAssocLinkCreation&&a.type===He&&!D.isSuperBindingNode(t)}).append("path").attr("class","d3-node-port-output-arrow")}).call(this.attachOutputPortListeners.bind(this),t);return i}},{key:"updateOutputPorts",value:function(e,t){var n=this;if(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 r=Dd.select(o[i]),a=D.getPortIndex(t.outputs,e.id),s=n.getPortDisplayInfo(t.layout.outputPortDisplayObjects,a),l=n.getPortImageTransform(e,de);n.updatePort(r,s,t,e,l)}),e.selectChildren(".d3-node-port-output-arrow").datum(function(e){return t.outputs.find(function(t){return e.id===t.id})}).each(function(e,i,o){var r=Dd.select(o[i]),a=D.getPortIndex(t.outputs,e.id);n.getPortDisplayInfo(t.layout.outputPortDisplayObjects,a).type===He&&r.attr("d",n.getPortArrowPath()).attr("transform",n.getOutputPortArrowPathTransform(e))}),e.each(function(e,i,o){var r=Dd.select(o[i]),a=r.select(".d3-node-port-output-connect-from-arrow");if(e.connectFrom){a.empty()&&r.append("path").attr("class","d3-node-port-output-connect-from-arrow");var s=n.getConnectFromArrowInfo(e,t);r.select(".d3-node-port-output-connect-from-arrow").attr("d",s.path).attr("transform",s.transform)}else a.empty()||a.remove()}),this.config.enableEditingActions){var i=this.dragNewLinkUtils.getDragNewLinkHandler();e.call(i)}else e.on(".drag",null)}},{key:"updatePort",value:function(e,t,n,i,o){var r=this;t.type===Fe||t.type===Re?(t.type===Fe?e.each(function(e,n,i){return r.externalUtils.addJsxExternalObject(t.src,n,i)}):e.attr("xlink:href",t.src),e.attr("x",i.cx-i.width/2).attr("y",i.cy-i.height/2).attr("width",i.width).attr("height",i.height).attr("transform",o)):e.attr("r",this.getPortRadius(n)).attr("cx",i.cx).attr("cy",i.cy)}},{key:"getPortDisplayInfo",value:function(e,t){var n=Nd({},e[t<e.length?t:e.length-1]);return n.tag="jsx"===n.type?"foreignObject":n.type,n.tag="circleWithArrow"===n.type?"circle":n.tag,n}},{key:"attachNodeGroupListeners",value:function(e){var t=this;e.on("keydown",function(e,n){if(t.config.enableKeyboardNavigation)if(pt.nextObjectInGroup(e)){var i=t.activePipeline.getNextLinksFromNode(n);if(i.length>0)t.activePipeline.getAllLinksForNode(n).forEach(function(e){return e.link.navObject=n}),t.setFocusObject(i[0].link,e)}else if(pt.previousObjectInGroup(e)){var o=t.activePipeline.getPreviousLinksToNode(n);if(o.length>0)t.activePipeline.getAllLinksForNode(n).forEach(function(e){return e.link.navObject=n}),t.setFocusObject(o[0].link,e)}else if(pt.focusSubObject(e))D.stopPropagationAndPreventDefault(e),t.clearSubObject(),t.setFocusNextSubObject(n,e);else if(pt.cancelFocusOnSubObject(e))t.canvasController.restoreFocus();else if(pt.moveObjectUp(e))t.config.enableEditingActions&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.moveObject(n,ie)}),D.stopPropagationAndPreventDefault(e);else if(pt.moveObjectDown(e))t.config.enableEditingActions&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.moveObject(n,ne)}),D.stopPropagationAndPreventDefault(e);else if(pt.moveObjectRight(e))t.config.enableEditingActions&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.moveObject(n,ee)}),D.stopPropagationAndPreventDefault(e);else if(pt.moveObjectLeft(e))t.config.enableEditingActions&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.moveObject(n,te)}),D.stopPropagationAndPreventDefault(e);else if(pt.selectObject(e)){D.stopPropagationAndPreventDefault(e);var r=t.canvasController.isSelected(n.id,t.activePipeline.id)?Ie:ye;t.selectObject(n,r)}else if(pt.selectObjectAugment(e))D.stopPropagationAndPreventDefault(e),t.selectObject(n,ye,!1,!0);else if(pt.selectObjectRange(e))D.stopPropagationAndPreventDefault(e),t.selectObject(n,ye,!0,!1);else if(pt.sizeObjectUp(e))D.isNodeResizable(n,t.config)&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.sizeObject(n,ie)}),D.stopPropagationAndPreventDefault(e);else if(pt.sizeObjectDown(e))D.isNodeResizable(n,t.config)&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.sizeObject(n,ne)}),D.stopPropagationAndPreventDefault(e);else if(pt.sizeObjectRight(e))D.isNodeResizable(n,t.config)&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.sizeObject(n,ee)}),D.stopPropagationAndPreventDefault(e);else if(pt.sizeObjectLeft(e))D.isNodeResizable(n,t.config)&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.sizeObject(n,te)}),D.stopPropagationAndPreventDefault(e);else if(pt.createLink(e))t.config.enableEditingActions&&t.canvasController.autoSelectFocusObj(function(){return t.dragNewLinkUtils.createNewLinkFromSelections()},!0,!0),D.stopPropagationAndPreventDefault(e);else if(pt.displayContextOptions(e)&&(e.stopPropagation(),!D.isSuperBindingNode(n)))if(t.selectObject(n,Ee),t.config.enableContextToolbar)t.addContextToolbar(e,n,"node",H);else{var a=t.getObjectCenterPosition(e.currentTarget);t.openContextMenu(e,"node",n,null,a,H)}}).on("mouseenter",function(e,n){if(!t.isDragging()&&!t.svgCanvasTextArea.isEditingText()){var i=Dd.select(e.currentTarget);t.raiseNodeToTop(i),t.setNodeStyles(n,"hover",i),t.config.enableContextToolbar?t.addContextToolbar(e,n,"node",Be):t.addDynamicNodeIcons(e,n,i)}}).on("mouseover",function(e,n){if(e.stopPropagation(),t.canOpenTip(z)){var i=t.canvasController.getTipId(),o=t.getId("node_tip",n.id);null!==i&&i===o||(t.canvasController.closeTip(),t.canvasController.openTip({id:o,type:z,targetObj:e.currentTarget,pipelineId:t.activePipeline.id,node:n}))}}).on("mouseleave",function(e,n){var i=Dd.select(e.currentTarget);t.setNodeStyles(n,"default",i),t.config.enableContextToolbar?t.removeContextToolbar():t.removeDynamicNodeIcons(e,n,i),t.canvasController.closeTip()}).on("mousedown",function(e,n){if(t.logger.logStartTimer("Node Group - mouse down"),e.stopPropagation(),t.svgCanvasTextArea.isEditingText()&&t.svgCanvasTextArea.completeEditing(e),t.config.enableKeyboardNavigation&&t.setFocusObject(n,e,n.layout.onFocusAllowDefaultAction,!0),!t.config.enableDragWithoutSelect){var i=t.getClickType(e);t.selectObjectD3Event(e,n,i)}t.logger.logEndTimer("Node Group - mouse down")}).on("mouseup",function(e,n){t.logger.logStartTimer("Node Group - mouse up"),e.stopPropagation(),t.config.enableDragWithoutSelect&&e.button!==Oe&&t.selectObjectD3Event(e,n,ye),t.logger.logEndTimer("Node Group - mouse up")}).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"),D.stopPropagationAndPreventDefault(e),t.canvasController.clickActionHandler({clickType:Ie,objectType:"node",id:n.id,selectedObjectIds:t.activePipeline.getSelectedObjectIds(),pipelineId:t.activePipeline.id})}).on("contextmenu",function(e,n){t.logger.log("Node Group - context menu"),D.stopPropagationAndPreventDefault(e),D.isSuperBindingNode(n)||(t.config.enableDragWithoutSelect&&t.selectObjectD3Event(e,n,Ee),t.setFocusObject(n,e,!1,!0),t.config.enableContextToolbar||t.openContextMenu(e,"node",n))})}},{key:"getObjectCenterPosition",value:function(e){var t=e.getBoundingClientRect(),n=this.canvasSVG.node().getBoundingClientRect();return{x:t.left-n.left+t.width/2,y:t.top-n.top+t.height/2}}},{key:"attachNodeSizingListeners",value:function(e){var t=this;e.on("mousedown",function(e,n){t.dragObjectUtils.mouseDownNodeSizingArea(n)}).on("mousemove mouseenter",function(e,n){t.dragObjectUtils.mouseEnterNodeSizingArea(e,n)}).on("mouseleave",function(e,n){t.dragObjectUtils.mouseLeaveNodeSizingArea(e,n)})}},{key:"attachNodeLabelListeners",value:function(e){var t=this;e.on("mouseenter",function(e,n){var i=Dd.select(e.currentTarget);if(t.config.enableDisplayFullLabelOnHover&&!D.isExpandedSupernode(n)){var o=i.selectAll("span");i.attr("x",Rs.getNodeLabelHoverPosX(n)).attr("width",Rs.getNodeLabelHoverWidth(n)).attr("height",Rs.getNodeLabelHoverHeight(n,o.node(),t.zoomUtils.getZoomScale())),o.classed("d3-label-full",!0)}}).on("mouseleave",function(e,n){var i=Dd.select(e.currentTarget);t.config.enableDisplayFullLabelOnHover&&!D.isExpandedSupernode(n)&&(i.attr("x",Rs.getNodeLabelPosX(n)).attr("width",Rs.getNodeLabelWidth(n)).attr("height",Rs.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&&(D.stopPropagationAndPreventDefault(e),t.canvasController.textActionHandler("setNodeLabelEditingMode","textdoubleclick",{id:n.id,pipelineId:t.activePipeline.id}))})}},{key:"attachNodeLabelSpanListeners",value:function(e){var t=this;e.on("mouseenter",function(e,n){n.layout.labelEditable&&t.config.enableEditingActions&&(clearTimeout(t.hideEditIconPending),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("keydown",function(e,i){if(n.config.enableKeyboardNavigation)if(pt.nextSubObject(e)){var o=n.activePipeline.getNode(t.id);n.setFocusNextSubObject(o,e)}else if(pt.previousSubObject(e)){var r=n.activePipeline.getNode(t.id);n.setFocusPreviousSubObject(r,e)}else if(pt.cancelFocusOnSubObject(e))n.canvasController.restoreFocus();else if(pt.clickSubObject(e))D.stopPropagationAndPreventDefault(e),n.canvasController.clickActionHandler({clickType:ye,objectType:"port",id:i.id,nodeId:t.id,selectedObjectIds:n.activePipeline.getSelectedObjectIds(),pipelineId:n.activePipeline.id});else if(pt.createLinkFromConnectFrom(e)){D.stopPropagationAndPreventDefault(e);var a=n.canvasController.getConnectFromInfo(n.activePipeline.id);a&&n.dragNewLinkUtils.createNewNodeLink(a.node,a.portId,t,i.id)}else if(pt.displayContextOptions(e))if(e.stopPropagation(),n.selectObject(t,Ee),n.config.enableContextToolbar)n.addContextToolbar(e,t,"input_port",H,null,null,i);else{var s=n.getObjectCenterPosition(e.currentTarget);n.openContextMenu(e,"input_port",t,i,s,H)}}).on("mouseenter",function(e,i){D.stopPropagationAndPreventDefault(e),n.canOpenTip(M)&&(n.canvasController.closeTip(),n.canvasController.openTip({id:n.getId("node_port_tip",i.id),type:M,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"),D.stopPropagationAndPreventDefault(e),n.config.enableDragWithoutSelect&&n.selectObjectD3Event(e,t,Ee),n.openContextMenu(e,"input_port",t,i)})}},{key:"attachOutputPortListeners",value:function(e,t){var n=this;e.on("keydown",function(e,i){if(n.config.enableKeyboardNavigation)if(pt.nextSubObject(e)){var o=n.activePipeline.getNode(t.id);n.setFocusNextSubObject(o,e)}else if(pt.previousSubObject(e)){var r=n.activePipeline.getNode(t.id);n.setFocusPreviousSubObject(r,e)}else if(pt.cancelFocusOnSubObject(e))n.canvasController.restoreFocus();else if(pt.clickSubObject(e))D.stopPropagationAndPreventDefault(e),n.canvasController.clickActionHandler({clickType:ye,objectType:"port",id:i.id,nodeId:t.id,selectedObjectIds:n.activePipeline.getSelectedObjectIds(),pipelineId:n.activePipeline.id});else if(pt.addConnectFromStatus(e))D.stopPropagationAndPreventDefault(e),n.canvasController.setPortConnectFrom(t.id,i.id,n.activePipeline.id);else if(pt.displayContextOptions(e))if(e.stopPropagation(),n.selectObject(t,Ee),n.config.enableContextToolbar)n.addContextToolbar(e,t,"output_port",H,null,null,i);else{var a=n.getObjectCenterPosition(e.currentTarget);n.openContextMenu(e,"output_port",t,i,a,H)}}).on("mouseenter",function(e,i){D.stopPropagationAndPreventDefault(e),n.canOpenTip(M)&&(n.canvasController.closeTip(),n.canvasController.openTip({id:n.getId("node_port_tip",i.id),type:M,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"),D.stopPropagationAndPreventDefault(e),n.config.enableDragWithoutSelect&&n.selectObjectD3Event(e,t,Ee),n.openContextMenu(e,"output_port",t,i)})}},{key:"setUnavailableTargetNodesHighlighting",value:function(e,t,n){this.getAllNodeGroupsSelection().filter(function(i){return!D.isTrgNodeAvailable(i,e,t,n)}).classed("d3-node-unavailable",!0)}},{key:"setUnavailableSourceNodesHighlighting",value:function(e,t,n){this.getAllNodeGroupsSelection().filter(function(i){return!D.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=Dd.select(i),r=Rs.getNodeLabelEditIconTranslate(t,e,this.zoomUtils.getZoomScale(),this.config.enableDisplayFullLabelOnHover);this.displayEditIcon(e,o,r,function(e,t){return n.canvasController.textActionHandler("setNodeLabelEditingMode","editicon",{id:t.id,pipelineId:n.activePipeline.id})})}},{key:"displayDecLabelEditIcon",value:function(e,t,n,i){var o=this,r=e.parentElement.parentElement.parentElement,a=Dd.select(r),s=this.decUtils.getDecLabelEditIconTranslate(t,n,i,e,this.zoomUtils.getZoomScale()),l=this.getDecorationLabelEditType(i);this.displayEditIcon(e,a,s,function(e,r){return o.canvasController.textActionHandler(l,"editicon",{id:n.id,decId:t.id,objType:i,pipelineId:o.activePipeline.id})})}},{key:"getDecorationLabelEditType",value:function(e){return e===ze?"setNodeDecorationLabelEditingMode":"setLinkDecorationLabelEditingMode"}},{key:"displayEditIcon",value:function(e,t,n,i){var o=this,r=t.append("g").attr("class","d3-label-edit-icon-group").attr("transform",n).on("mouseenter",function(e,t){clearTimeout(this.hideEditIconPending),o.mouseOverLabelEditIcon=!0}).on("mouseleave",function(e,t){o.mouseOverLabelEditIcon=!1,o.hideEditIcon(this)}).on("mousedown",function(){}).on("click",function(e,t){D.stopPropagationAndPreventDefault(e),i(e,t),o.mouseOverLabelEditIcon=!1,o.hideEditIcon(this)});r.append("rect").attr("class","d3-label-edit-icon-background1").attr("width",29).attr("height",24).attr("x",0).attr("y",-4),r.append("rect").attr("class","d3-label-edit-icon-background2").attr("width",24).attr("height",24).attr("x",5).attr("y",-4),r.append("svg").attr("class","d3-node-edit-label-icon").html(Ge).attr("width",16).attr("height",16).attr("aria-label","Node edit label icon").attr("x",9).attr("y",0)}},{key:"hideEditIcon",value:function(e){if(!this.mouseOverLabelEditIcon){var t=e.parentElement;if(t){var n=t.parentElement.parentElement;Dd.select(n).selectAll(".d3-label-edit-icon-group").remove()}}}},{key:"getClickType",value:function(e){return e.button===Oe?Ee:ye}},{key:"selectObjectD3Event",value:function(e,t,n){this.selectObject(t,n,e.shiftKey,pt.isMetaKey(e))}},{key:"selectObject",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.canvasController.selectObjectWithClick(e,t,this.activePipeline.id,n,i)}},{key:"displayDecorations",value:function(e,t,n,i){var o=this,r=this,a=i||[],s="d3-".concat(t,"-dec-group"),l="."+s;n.selectChildren(l).data(a,function(e){return e.id}).join(function(n){return o.createDecorations(n,e,t,s)}).attr("tabindex",-1).attr("aria-roledescription",this.canvasController.labelUtil.getLabel("decoration.ariaRoleDescription")).attr("transform",function(n){return o.decUtils.getDecTransform(n,e,t)}).on("mousedown",function(t,n){return n.hotspot&&0===t.button?r.callDecoratorCallback(t,e,n):null}).each(function(n,i,r){return o.updateDecoration(n,Dd.select(r[i]),t,e)})}},{key:"createDecorations",value:function(e,t,n,i){var o=this;return e.append("g").attr("data-id",function(e){return o.getId("".concat(n,"_dec_group"),e.id)}).attr("class",i).call(this.attachDecGroupListeners.bind(this,t,n))}},{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),this.updateDecJsxObjs(e,t,n,i)}},{key:"updateDecOutlines",value:function(e,t,n,i){var o=t.selectChild("rect");e.label||e.path||e.jsx||!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).attr("aria-label",e.tooltip?e.tooltip:this.canvasController.labelUtil.getLabel("decoration.shapeDecoration")):i.remove()}},{key:"updateDecImages",value:function(e,t,n,i){var o=this,r=t.selectChild("g");if(e.image){var a=this.getImageType(e.image);(r=r.empty()?t.append("g").append(a):r.select(a)).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)).attr("aria-label",e.tooltip?e.tooltip:this.canvasController.labelUtil.getLabel("decoration.imageDecoration")).each(function(){return o.setDecImageContent(r,e.image)})}else r.remove()}},{key:"updateDecLabels",value:function(e,t,n,i){var o=t.selectChild(".d3-foreign-object-dec-label");void 0!==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)).attr("aria-label",ps(e.label)).select("div").attr("class",this.decUtils.getDecLabelClass(e,n)).select("span").html(ps(e.label))):o.remove()}},{key:"updateDecJsxObjs",value:function(e,t,n,i){var o=this,r=t.selectChild(".d3-foreign-object-dec-jsx");e.jsx?(r.empty()&&(r=t.append("foreignObject").attr("class","d3-foreign-object-dec-jsx").attr("tabindex",-1).attr("x",0).attr("y",0).attr("aria-label",e.tooltip?e.tooltip:this.canvasController.labelUtil.getLabel("decoration.jsxDecoration"))),r.attr("width",this.decUtils.getDecWidth(e,i,n)).attr("height",this.decUtils.getDecHeight(e,i,n)).each(function(e,t,n){return o.externalUtils.addDecExternalObject(e,t,n)})):(r.each(function(e,t,n){return o.externalUtils.removeExternalObject(e,t,n)}),r.remove())}},{key:"attachDecLabelListeners",value:function(e,t,n){var i=this;n.on("dblclick",function(n,o){if(i.logger.log("Decoration Label - double click"),o.label_editable&&i.config.enableEditingActions){D.stopPropagationAndPreventDefault(n);var r=i.getDecorationLabelEditType(t);i.canvasController.textActionHandler(r,"textdoubleclick",{id:e.id,decId:o.id,pipelineId:i.activePipeline.id})}})}},{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,t,n){var i=this;n.on("keydown",function(t,n){if(i.config.enableKeyboardNavigation)if(pt.nextSubObject(t)){var o="node"===D.getObjectTypeName(e)?i.activePipeline.getNode(e.id):i.activePipeline.getLink(e.id);i.setFocusNextSubObject(o,t)}else if(pt.previousSubObject(t)){var r="node"===D.getObjectTypeName(e)?i.activePipeline.getNode(e.id):i.activePipeline.getLink(e.id);i.setFocusPreviousSubObject(r,t)}else pt.cancelFocusOnSubObject(t)?i.canvasController.restoreFocus():pt.clickSubObject(t)&&n.hotspot&&(D.stopPropagationAndPreventDefault(t),i.callDecoratorCallback(t,e,n))}).on("focus",function(e,t){i.canOpenTip(_)&&t.tooltip&&(i.canvasController.closeTip(),i.canvasController.openTip({id:i.getId("dec_tip",t.id),type:_,targetObj:e.currentTarget,pipelineId:i.activePipeline.id,decoration:t}))}).on("blur",function(e,t){i.canOpenTip(_)&&t.tooltip&&i.canvasController.closeTip()}).on("mouseover",function(e,t){if(i.canOpenTip(_)&&t.tooltip){var n=i.canvasController.getTipId(),o=i.getId("dec_tip",t.id);null!==n&&n===o||(i.canvasController.closeTip(),i.canvasController.openTip({id:o,type:_,targetObj:e.currentTarget,pipelineId:i.activePipeline.id,decoration:t})),D.stopPropagationAndPreventDefault(e)}}).on("mouseleave",function(e,t){i.canOpenTip(_)&&t.tooltip&&i.canvasController.closeTip()})}},{key:"addErrorMarker",value:function(e,t){var n=t.selectChildren(".node-error-marker");e.messages&&e.messages.length>0?(n.empty()&&t.append("svg").attr("class","node-error-marker"),t.selectChildren(".node-error-marker").attr("class",function(){return"node-error-marker "+Rs.getErrorMarkerClass(e.messages)}).html(Rs.getErrorMarkerIcon(e)).attr("width",Rs.getNodeErrorWidth(e)).attr("height",Rs.getNodeErrorHeight(e)).attr("x",Rs.getNodeErrorPosX(e)).attr("y",Rs.getNodeErrorPosY(e))):n.empty()||n.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,n){var i=Rs.getNodeImage(e),o=this.getImageType(i);if("jsx"===o)this.externalUtils.addNodeImageExternalObject(i,t,n);else{var r=Dd.select(n[t]);this.setImageContent(r,i,o)}}},{key:"setDecImageContent",value:function(e,t){var n=this.getImageType(t);this.setImageContent(e,t,n)}},{key:"setImageContent",value:function(e,t,n){t!==e.attr("data-image")&&(e.attr("data-image",t),"svg"===n?"LoadSVGToDefs"===this.config.enableImageDisplay?this.loadSVGToDefs(e,t):(e.selectChild("svg").remove(),Dd.svg(t,{cache:"force-cache"}).then(function(t){var n=t.documentElement;n.setAttribute("aria-label","Node Image"),e.node().append(n)})):e.attr("xlink:href",t))}},{key:"loadSVGToDefs",value:function(e,t){var n=this,i="img"+t.replaceAll(/[/.]/g,"-"),o="#"+i;this.canvasDefs.selectChildren(o).empty()&&(this.canvasDefs.append("symbol").attr("id",i),Dd.svg(t,{cache:"force-cache"}).then(function(e){n.canvasDefs.selectChildren(o).node().append(e.documentElement)})),e.selectChild("use").remove(),e.append("use").attr("href",o)}},{key:"getImageType",value:function(e){return Rs.getImageType(e,this.externalUtils,this.config)}},{key:"getImageElement",value:function(e){var t=Rs.getNodeImage(e),n=this.getImageType(t),i=null==e?void 0:e.label;return"jsx"===n?Dd.create("svg:foreignObject").attr("tabindex",-1).attr("class","d3-foreign-object-node-image d3-node-image").attr("aria-label",i).node():"svg"===n?Dd.create("svg").attr("class","d3-node-image").attr("aria-label",i).node():Dd.create("svg:image").attr("class","d3-node-image").attr("aria-label",i).node()}},{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=D.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 D.getObjectStyle(e,"selection_outline",t)}},{key:"getNodeImageStyle",value:function(e,t){return D.getObjectStyle(e,"image",t)}},{key:"getNodeLabelStyle",value:function(e,t){return D.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;D.isExpandedSupernode(e)&&e.subflow_ref&&e.subflow_ref.pipeline_id_ref&&new Sd(e.subflow_ref.pipeline_id_ref,this.config,this.canvasInfo).nodes.forEach(function(e){e.style||e.style_temp?n=!0:!n&&D.isExpandedSupernode(e)&&(n=t.doesExpandedSupernodeHaveStyledNodes(e))});return n}},{key:"getPortRadius",value:function(e){return D.isSuperBindingNode(e)?this.getBindingPortRadius(e):e.layout.portRadius}},{key:"getBindingPortRadius",value:function(e){return e.layout.supernodeBindingPortRadius/this.zoomUtils.getZoomScale()}},{key:"addDynamicNodeIcons",value:function(e,t,n){this.isSizing()||D.isSuperBindingNode(t)||(t.layout.ellipsisDisplay&&this.addEllipsisIcon(t,n),D.isExpandedSupernode(t)&&this.addSuperNodeFullPageIcon(n))}},{key:"getDefaultContextToolbarPos",value:function(e,t,n){return"link"===e?Nd({},t.pathInfo.centerPoint):"input_port"===e||"output_port"===e?{x:t.x_pos+n.cx,y:t.y_pos+n.cy}:"node"!==e||"topCenter"!==t.layout.contextToolbarPosition||t.is_expanded?{x:t.x_pos+t.width,y:t.y_pos}:{x:t.x_pos+t.width/2,y:t.y_pos}}},{key:"addContextToolbar",value:function(e,t,n,i,o,r,a){if(!(this.isSizing()||this.isDragging()||this.svgCanvasTextArea.isEditingText()||D.isSuperBindingNode(t))){i===Be&&this.canvasController.setMouseInObject(t.id);var s=this.getDefaultContextToolbarPos(n,t,a);s.x=o?s.x+o:s.x,s.y=r?s.y+r:s.y,s=this.convertCanvasCoordsToScreenCoords(s),this.openContextMenu(e,n,t,a,s,i)}}},{key:"removeContextToolbar",value:function(){var e=this;this.canvasController.setMouseInObject(null),this.canvasController.isContextMenuDisplayed()&&setTimeout(function(){return e.canvasController.closeContextToolbar()},200)}},{key:"addEllipsisIcon",value:function(e,t){var n=this,i=t.append("g").attr("class","d3-node-ellipsis-group").attr("transform",function(e){return Rs.getNodeEllipsisTranslate(e)}).on("mousedown",function(t){if(D.stopPropagationAndPreventDefault(t),n.selectObjectD3Event(t,e,Ee),n.canvasController.isContextMenuDisplayed())n.canvasController.closeContextMenu();else{var o=i.node().getBoundingClientRect(),r=n.canvasSVG.node().getBoundingClientRect(),a={x:o.left-r.left,y:o.bottom-r.top};n.setFocusObject(e,t),n.openContextMenu(t,"node",e,null,a)}});i.append("rect").attr("class","d3-node-ellipsis-background").attr("width",function(e){return Rs.getNodeEllipsisWidth(e)}).attr("height",function(e){return Rs.getNodeEllipsisHeight(e)}).attr("x",0).attr("y",0),i.append("svg").attr("class","d3-node-ellipsis").html(Ue).attr("width",function(e){return Rs.getNodeEllipsisIconWidth(e)}).attr("height",function(e){return Rs.getNodeEllipsisIconHeight(e)}).attr("x",function(e){return e.layout.ellipsisHoverAreaPadding}).attr("y",function(e){return e.layout.ellipsisHoverAreaPadding})}},{key:"addSuperNodeFullPageIcon",value:function(e){var t=this,n=e.append("g").attr("transform",function(e){return Rs.getNodeExpansionIconTranslate(e)}).attr("class","d3-node-super-expand-icon-group").on("mousedown",function(e){D.stopPropagationAndPreventDefault(e);var n=t.getSupernodeBreadcrumbs(e.currentTarget);t.canvasController.displaySubPipelineForBreadcrumbs(n)}).on("mouseenter",function(){Dd.select(this).attr("data-pointer-hover","yes")}).on("mouseleave",function(){Dd.select(this).attr("data-pointer-hover","no")});n.append("rect").attr("class","d3-node-super-expand-icon-background").attr("width",function(e){return e.layout.supernodeExpansionIconWidth}).attr("height",function(e){return e.layout.supernodeExpansionIconHeight}).attr("x",0).attr("y",0),n.append("svg").attr("class","d3-node-super-expand-icon").html(We).attr("width",function(e){return e.layout.supernodeExpansionIconWidth-2*e.layout.supernodeExpansionIconHoverAreaPadding}).attr("height",function(e){return e.layout.supernodeExpansionIconHeight-2*e.layout.supernodeExpansionIconHoverAreaPadding}).attr("x",function(e){return e.layout.supernodeExpansionIconHoverAreaPadding}).attr("y",function(e){return e.layout.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),r=i.getAttribute("data-pipeline-id");t.push(this.canvasController.createBreadcrumb(o,r)),n=i.closest(".d3-node-group")}return t.reverse()}},{key:"getD3DatumFromDomEl",value:function(e){var t=Dd.select(e);return t?t.datum():null}},{key:"updatePortRadiusAndPos",value:function(e,t,n){var i=this;Dd.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:"updateInputPortArrowPath",value:function(e,t){var n=this;Dd.select(e).selectAll("."+t).attr("d",this.getPortArrowPath()).attr("transform",function(e){return n.getInputPortArrowPathTransform(e)})}},{key:"updateOutputPortArrowPath",value:function(e,t){var n=this;Dd.select(e).selectAll("."+t).attr("d",this.getPortArrowPath()).attr("transform",function(e){return n.getOutputPortArrowPathTransform(e)})}},{key:"isPortMaxCardinalityZero",value:function(e){return 0===S(e,"app_data.ui_data.cardinality.max",1)}},{key:"removeDynamicNodeIcons",value:function(e,t,n){t.layout.ellipsisDisplay&&n.selectChildren(".d3-node-ellipsis-group").remove(),n.selectChildren(".d3-node-super-expand-icon-group").remove()}},{key:"createSupernodeRenderer",value:function(e,t){return e.subflow_ref&&e.subflow_ref.pipeline_id_ref?new i(e.subflow_ref.pipeline_id_ref,this.canvasDiv,this.canvasController,this.canvasInfo,this.selectionInfo,this.breadcrumbs,this.nodeLayout,this.canvasLayout,this.config,{id:e.id,pipelineId:this.activePipeline.id,renderer:this,d3Selection:t}):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:"openCanvasContextOptions",value:function(e){this.openContextMenu(e,"canvas",null,null,{x:100,y:100},H)}},{key:"openContextMenu",value:function(e,t,n,i,o){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:Be;D.stopPropagationAndPreventDefault(e),this.canvasController.contextMenuHandler({type:t,targetObject:"canvas"===t?null:n,id:"canvas"===t?null:n.id,pipelineId:this.activePipeline.id,cmPos:o||this.getMousePos(e,this.canvasDiv.selectAll("svg")),mousePos:this.getMousePosSnapToGrid(this.getTransformedMousePos(e)),selectedObjectIds:this.canvasController.getSelectedObjectIds(),addBreadcrumbs:n&&n.type===Ve?this.getSupernodeBreadcrumbs(e.currentTarget):null,port:i,zoom:this.zoomUtils.getZoomScale(),cause:r})}},{key:"closeContextMenuIfOpen",value:function(){this.canvasController.isContextMenuDisplayed()&&this.canvasController.closeContextMenu(),this.config.enableContextToolbar&&this.removeContextToolbar()}},{key:"callDecoratorCallback",value:function(e,t,n){e.stopPropagation(),this.canvasController.decorationActionHandler&&this.canvasController.decorationActionHandler(t,n.id,this.activePipeline.id)}},{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=Dd.select(e).datum();if(t){var n=this.activePipeline.getLink(t.id);if(n&&n.type===K)return n}}return null}},{key:"setDataLinkSelectionAreaWider",value:function(e){this.nodesLinksGrp.selectAll(".d3-data-link-selection-area").classed("d3-extra-width",e)}},{key:"getNodeAtPos",value:function(e){var t=this.getElementWithClassAtPosition(e.x,e.y,"d3-node-group");return this.getNodeForElement(t)}},{key:"getInputNodePortId",value:function(e,t){var n=this.getElementWithClassAtPosition(e.x,e.y,this.getNodeInputPortClassName());return this.getNodePortIdForElement(n)||D.getDefaultInputPortId(t)}},{key:"getOutputNodePortId",value:function(e,t){var n=this.getElementWithClassAtPosition(e.x,e.y,this.getNodeOutputPortClassName());return this.getNodePortIdForElement(n)||D.getDefaultOutputPortId(t)}},{key:"getMousePosFromEvent",value:function(e){return{x:e.clientX?e.clientX:e.sourceEvent.clientX,y:e.clientY?e.clientY:e.sourceEvent.clientY}}},{key:"getElementWithClassAtPosition",value:function(e,t,n){for(var i=document.elementsFromPoint(e,t),o=null,r=0;!o&&r<i.length;)o=D.getParentElementWithClass(i[r],n),r++;return o}},{key:"getNodeForElement",value:function(e){if(e&&"g"===e.nodeName){var t=Dd.select(e).datum();if(t)return this.activePipeline.getNode(t.id)}return null}},{key:"getNodePortIdForElement",value:function(e){return e?Dd.select(e).attr("data-port-id"):null}},{key:"getNodeNearMousePos",value:function(e,t){var n=this.getTransformedMousePos(e);return this.getNodeNearPos(n,t)}},{key:"getNodeNearPos",value:function(e,t){return Rs.getNodeNearPos(e,t,this.activePipeline.nodes)}},{key:"getNodeShapePathSizing",value:function(e){return this.getRectangleNodeShapePath(e,e.layout.nodeSizingArea)}},{key:"getNodeSelectionOutline",value:function(e){return e.layout.selectionPath&&!D.isExpanded(e)?"function"==typeof e.layout.selectionPath?e.layout.selectionPath(e):e.layout.selectionPath:e.layout.nodeShape===Ze?this.getPortArcsNodeShapePath(e):e.layout.nodeShape===Xe?this.getRectRoundCornersShapePath(e,e.layout.nodeHighlightGap):this.getRectangleNodeShapePath(e,e.layout.nodeHighlightGap)}},{key:"getNodeShapePath",value:function(e){return e.layout.bodyPath&&!D.isExpanded(e)?"function"==typeof e.layout.bodyPath?e.layout.bodyPath(e):e.layout.bodyPath:e.layout.nodeShape===Ze?this.getPortArcsNodeShapePath(e):e.layout.nodeShape===Xe?this.getRectRoundCornersShapePath(e):this.getRectangleNodeShapePath(e)}},{key:"getRectangleNodeShapePath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i="object"===n(t)?t:{leftGap:t,rightGap:t,topGap:t,bottomGap:t},o=0-i.leftGap,r=0-i.topGap,a=e.width+i.rightGap,s=e.height+i.bottomGap;return"M "+o+" "+r+" L "+a+" "+r+" "+a+" "+s+" "+o+" "+s+" Z"}},{key:"getRectRoundCornersShapePath",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=0-t,i=0-t,o=e.width+t,r=e.height+t,a=n+10,s=o-10,l=i+10,c=r-10;return"M "+a+" "+i+" L "+s+" "+i+" Q "+o+" "+i+" "+o+" "+l+" L "+o+" "+c+" Q "+o+" "+r+" "+s+" "+r+" L "+a+" "+r+" Q "+n+" "+r+" "+n+" "+c+" L "+n+" "+l+" Q "+n+" "+i+" "+a+" "+i+" Z"}},{key:"getPortArcsNodeShapePath",value:function(e){return this.canvasLayout.linkDirection===Te?this.getPortArcsNodeShapePathVertical(e,e.inputs,e.inputPortsWidth,e.outputs,e.outputPortsWidth):this.canvasLayout.linkDirection===Ne?this.getPortArcsNodeShapePathVertical(e,e.outputs,e.outputPortsWidth,e.inputs,e.inputPortsWidth):this.canvasLayout.linkDirection===Ye?this.getPortArcsNodeShapePathHoriz(e,e.outputs,e.outputPortsHeight,e.inputs,e.inputPortsHeight):this.getPortArcsNodeShapePathHoriz(e,e.inputs,e.inputPortsHeight,e.outputs,e.outputPortsHeight)}},{key:"getPortArcsNodeShapePathHoriz",value:function(e,t,n,i,o){var r="M 0 0 L "+e.width+" 0 ";if(i&&i.length>0){var a=e.layout.portArcOffset;o<e.height&&(a=i[0].cy-e.layout.portArcRadius),r+=" L "+e.width+" "+a,i.forEach(function(t,n){a+=2*e.layout.portArcRadius,r+=" A "+e.layout.portArcRadius+" "+e.layout.portArcRadius+" 180 0 1 "+e.width+" "+a,n<i.length-1&&(a+=e.layout.portArcSpacing,r+=" L "+e.width+" "+a)}),r+=" L "+e.width+" "+e.height}else r+=" L "+e.width+" "+e.height;if(r+=" L 0 "+e.height,t&&t.length>0){var s=e.height-e.layout.portArcOffset;n<e.height&&(s=t[t.length-1].cy+e.layout.portArcRadius),r+=" L 0 "+s,t.forEach(function(n,i){s-=2*e.layout.portArcRadius,r+=" A "+e.layout.portArcRadius+" "+e.layout.portArcRadius+" 180 0 1 0 "+s,i<t.length-1&&(s-=e.layout.portArcSpacing,r+=" L 0 "+s)}),r+=" Z"}else r+=" Z";return r}},{key:"getPortArcsNodeShapePathVertical",value:function(e,t,n,i,o){var r="M 0 0 L 0 "+e.height;if(i&&i.length>0){var a=e.layout.portArcOffset;o<e.width&&(a=i[0].cx-e.layout.portArcRadius),r+=" L "+a+" "+e.height,i.forEach(function(t,n){a+=2*e.layout.portArcRadius,r+=" A "+e.layout.portArcRadius+" "+e.layout.portArcRadius+" 180 0 0 "+a+" "+e.height,n<i.length-1&&(a+=e.layout.portArcSpacing,r+=" L "+a+" "+e.height)}),r+=" L "+e.width+" "+e.height}else r+=" L "+e.width+" "+e.height;if(r+=" 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),r+=" L "+s+" 0 ",t.forEach(function(n,i){s-=2*e.layout.portArcRadius,r+=" A "+e.layout.portArcRadius+" "+e.layout.portArcRadius+" 180 0 0 "+s+" 0 ",i<t.length-1&&(s-=e.layout.portArcSpacing,r+=" L "+s+" 0 ")}),r+=" Z"}else r+=" Z";return r}},{key:"setPortPositionsAllNodes",value:function(){var e=this;this.activePipeline.nodes.forEach(function(t){e.setPortPositionsAndSizesForNode(t)})}},{key:"setPortPositionsAndSizesForNode",value:function(e){g.setPortPositionsAndSizesForNode(e,this.canvasLayout,this.zoomUtils.getZoomScale())}},{key:"displayComments",value:function(){this.logger.logStartTimer("displayComments "+this.getFlags());var e=this.getAllCommentGroupsSelection();this.displayCommentsSubset(e,this.activePipeline.comments),this.logger.logEndTimer("displayComments "+this.getFlags())}},{key:"displayMovedComments",value:function(){var e=this;this.logger.logStartTimer("displayMovedComments"),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)}),this.logger.logEndTimer("displayMovedComments")}},{key:"displayCommentsSelectionStatus",value:function(){var e=this;this.logger.logStartTimer("displayCommentsSelectionStatus"),this.getAllCommentGroupsSelection().selectChildren(".d3-comment-selection-highlight").attr("data-selected",function(t){return e.activePipeline.isSelected(t.id)?"yes":"no"}),this.logger.logEndTimer("displayCommentsSelectionStatus")}},{key:"displaySingleComment",value:function(e){var t=this.getCommentGroupSelectionById(e.id);this.displayCommentsSubset(t,[e])}},{key:"displayCommentsSubset",value:function(e,t){var n=this,i=this.canvasInfo.hideComments?[]:t;e.data(i,function(e){return e.id}).join(function(e){return n.createComments(e)}).attr("transform",function(e){return"translate(".concat(e.x_pos,", ").concat(e.y_pos,")")}).attr("tabindex",-1).attr("class",function(e){return n.getCommentGroupClass(e)}).attr("aria-roledescription",this.canvasController.labelUtil.getLabel("comment.ariaRoleDescription")).attr("aria-label",function(e){return n.canvasController.labelUtil.getLabel("comment.ariaLabel",{content:e.content})}).call(function(e){return n.updateComments(e)})}},{key:"createComments",value:function(e){var t=this;this.logger.logStartTimer("createComments");var n=e.append("g").attr("data-id",function(e){return t.getId("comment_grp",e.id)}).call(this.attachCommentGroupListeners.bind(this));return this.logger.logEndTimer("createComments"),n}},{key:"updateComments",value:function(e){var t=this;if(this.logger.logStartTimer("updateComments"),e.selectChildren(".d3-focus-path").data(function(e){return[e]},function(e){return e.id}).join(function(e){return null}).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}),e.selectChildren(".d3-comment-sizing").data(function(e){return[e]},function(e){return e.id}).join(function(e){return e.append("rect").attr("class","d3-comment-sizing").call(t.attachCommentSizingListeners.bind(t))}).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").data(function(e){return[e]},function(e){return e.id}).join(function(e){return e.append("rect").attr("class","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.activePipeline.isSelected(e.id)?"yes":"no"}).attr("style",function(e){return t.getNodeSelectionOutlineStyle(e,"default")}),e.selectChildren(".d3-foreign-object-comment-text").data(function(e){return[e]},function(e){return e.id}).join(function(e){var t=e.append("foreignObject").attr("class",function(e){return"d3-foreign-object-comment-text"}).attr("x",0).attr("y",0);return t.append("xhtml:div").attr("class","d3-comment-text-scroll").append("xhtml:div").attr("class","d3-comment-text-outer").append("xhtml:div").attr("class",function(e){return"d3-comment-text"+(e.contentType!==F?" markdown":"")}),t}).datum(function(e){return t.activePipeline.getComment(e.id)}).attr("width",function(e){return e.width}).attr("height",function(e){return e.height}).select(".d3-comment-text-scroll").attr("tabindex",-1).each(function(e,t,n){var i=Dd.select(n[t]);D.applyOutlineStyle(i,e.formats)}).select(".d3-comment-text-outer").select(".d3-comment-text").attr("style",null).each(function(e,t,n){var i=Dd.select(n[t]);D.applyNonOutlineStyle(i,e.formats)}).html(function(e){return t.getCommentHTMLStr(e)}),this.config.enableEditingActions){var n=this.dragObjectUtils.getDragObjectHandler();e.call(n)}else e.on(".drag",null);this.logger.logEndTimer("updateComments")}},{key:"getCommentHTMLStr",value:function(e){var t=e.contentType!==F&&this.config.enableMarkdownInComments?this.getCommentAsMarkdownHTML(e.content):ps(e.content);return e.highlightText?Us.insertCommentHighlight(t,e.highlightText):t}},{key:"getCommentAsMarkdownHTML",value:function(e){return this.markdownIt||(this.markdownIt=At({html:this.config.enableMarkdownHTML})),this.markdownIt.render(e)}},{key:"attachCommentGroupListeners",value:function(e){var t=this;e.on("keydown",function(e,n){if(t.config.enableKeyboardNavigation){if(t.svgCanvasTextArea.isEditingText())return;if(pt.nextObjectInGroup(e)){var i=t.activePipeline.getNextLinksFromComment(n);i.length>0&&(i.forEach(function(e){return e.link.navObject=n}),t.setFocusObject(i[0].link,e))}else if(pt.moveObjectUp(e))t.config.enableEditingActions&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.moveObject(n,ie)}),D.stopPropagationAndPreventDefault(e);else if(pt.moveObjectDown(e))t.config.enableEditingActions&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.moveObject(n,ne)}),D.stopPropagationAndPreventDefault(e);else if(pt.moveObjectRight(e))t.config.enableEditingActions&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.moveObject(n,ee)}),D.stopPropagationAndPreventDefault(e);else if(pt.moveObjectLeft(e))t.config.enableEditingActions&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.moveObject(n,te)}),D.stopPropagationAndPreventDefault(e);else if(pt.sizeObjectUp(e))t.config.enableEditingActions&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.sizeObject(n,ie)}),D.stopPropagationAndPreventDefault(e);else if(pt.sizeObjectDown(e))t.config.enableEditingActions&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.sizeObject(n,ne)}),D.stopPropagationAndPreventDefault(e);else if(pt.sizeObjectRight(e))t.config.enableEditingActions&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.sizeObject(n,ee)}),D.stopPropagationAndPreventDefault(e);else if(pt.sizeObjectLeft(e))t.config.enableEditingActions&&t.canvasController.autoSelectFocusObj(function(){return t.dragObjectUtils.sizeObject(n,te)}),D.stopPropagationAndPreventDefault(e);else if(pt.scrollTextUp(e))t.scrollComment(e,10),D.stopPropagationAndPreventDefault(e);else if(pt.scrollTextDown(e))t.scrollComment(e,-10),D.stopPropagationAndPreventDefault(e);else if(pt.selectObject(e)){D.stopPropagationAndPreventDefault(e);var o=t.canvasController.isSelected(n.id,t.activePipeline.id)?Ie:ye;t.selectObject(n,o)}else if(pt.selectObjectAugment(e))D.stopPropagationAndPreventDefault(e),t.selectObject(n,ye,!1,!0);else if(pt.displayContextOptions(e))if(e.stopPropagation(),t.selectObject(n,Ee),t.config.enableContextToolbar)t.addContextToolbar(e,n,"comment",H);else{var r=t.getObjectCenterPosition(e.currentTarget);t.openContextMenu(e,"comment",n,null,r,H)}}}).on("mouseenter",function(e,n){t.isDragging()||(t.config.enableEditingActions&&n.id!==t.svgCanvasTextArea.getEditingTextId()&&t.createCommentPort(e.currentTarget,n),t.config.enableContextToolbar&&t.addContextToolbar(e,n,"comment",Be),t.commentHasScrollableText(e.currentTarget)&&t.removeCanvasZoomBehavior())}).on("mouseleave",function(e,n){t.config.enableContextToolbar&&t.removeContextToolbar(),t.config.enableEditingActions&&t.deleteCommentPort(e.currentTarget),t.addCanvasZoomBehavior()}).on("mousedown",function(e,n){if(t.logger.logStartTimer("Comment Group - mouse down"),e.stopPropagation(),t.svgCanvasTextArea.isEditingText()&&t.svgCanvasTextArea.completeEditing(e),t.config.enableKeyboardNavigation&&t.setFocusObject(n,e,!1,!0),!t.config.enableDragWithoutSelect){var i=t.getClickType(e);t.selectObjectD3Event(e,n,i)}t.logger.logEndTimer("Comment Group - mouse down")}).on("mouseup",function(e,n){t.logger.logStartTimer("Comment Group - mouse up"),e.stopPropagation(),t.config.enableDragWithoutSelect&&e.button!==Oe&&t.selectObjectD3Event(e,n,ye),t.logger.logEndTimer("Comment Group - mouse up")}).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&&(D.stopPropagationAndPreventDefault(e),t.deleteCommentPort(e.currentTarget),t.canvasController.textActionHandler("setCommentEditingMode","textdoubleclick",{id:n.id,pipelineId:t.activePipeline.id}),t.canvasController.clickActionHandler({clickType:Ie,objectType:"comment",id:n.id,selectedObjectIds:t.activePipeline.getSelectedObjectIds(),pipelineId:t.activePipeline.id}))}).on("contextmenu",function(e,n){t.logger.log("Comment Group - context menu"),D.stopPropagationAndPreventDefault(e),t.config.enableDragWithoutSelect&&t.selectObjectD3Event(e,n,Ee),t.setFocusObject(n,e,!1,!0),t.config.enableContextToolbar||t.openContextMenu(e,"comment",n)})}},{key:"commentHasScrollableText",value:function(e){var t=e.getElementsByClassName("d3-comment-text-entry-scroll");return t[0]||(t=e.getElementsByClassName("d3-comment-text-scroll")),t[0].clientHeight<t[0].scrollHeight}},{key:"scrollComment",value:function(e,t){this.commentHasScrollableText(e.currentTarget)&&e.currentTarget.getElementsByClassName("d3-comment-text-scroll")[0].scrollBy(0,t)}},{key:"attachCommentSizingListeners",value:function(e){var t=this;e.on("mousedown",function(e,n){t.dragObjectUtils.mouseDownCommentSizingArea()}).on("mousemove mouseenter",function(e,n){t.dragObjectUtils.mouseEnterCommentSizingArea(e,n)}).on("mouseleave",function(e,n){t.dragObjectUtils.mouseLeaveCommentSizingArea(e,n)})}},{key:"createCommentPort",value:function(e,t){var n=this,i=Dd.select(e).append(be).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");if(this.config.enableEditingActions){var o=this.dragNewLinkUtils.getDragNewLinkHandler();i.call(o)}else i.on(".drag",null)}},{key:"deleteCommentPort",value:function(e){Dd.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-text").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 D.getObjectStyle(e,"selection_outline",t)}},{key:"getCommentBodyStyle",value:function(e,t){return D.getObjectStyle(e,"body",t)}},{key:"getCommentTextStyle",value:function(e,t){return D.getObjectStyle(e,"text",t)}},{key:"displayCommentTextArea",value:function(e,t){e.autoSize=this.canvasLayout.commentAutoSize,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.isSizing())||!(!this.supernodeInfo.renderer||!this.supernodeInfo.renderer.isRegionSelectOrSizingInProgress())}},{key:"displayLinks",value:function(){this.logger.logStartTimer("displayLinks");var e=this.buildLinksArray(),t=this.getAllLinkGroupsSelection();this.displayLinksSubset(t,e),this.logger.logEndTimer("displayLinks")}},{key:"displayLinksSelectionStatus",value:function(){var e=this;this.logger.logStartTimer("displayLinksSelectionStatus"),this.config.enableLinkSelection!==Le&&this.getAllLinkGroupsSelection().attr("data-selected",function(t){return!!e.activePipeline.isSelected(t.id)||null}),this.logger.logEndTimer("displayLinksSelectionStatus")}},{key:"displayMovedLinks",value:function(){var e=this;this.logger.logStartTimer("displayMovedLinks"),this.buildLinksArray().filter(function(e){return e.coordsUpdated}).forEach(function(t){e.displaySingleLink(t)}),this.logger.logEndTimer("displayMovedLinks")}},{key:"displaySingleLink",value:function(e){var t=this.getLinkGroupSelectionById(e.id);this.displayLinksSubset(t,[e])}},{key:"displayLinksSubset",value:function(e,t){var n=this;this.preserveFocus(function(){e.data(t,function(e){return e.id}).join(function(e){return n.createLinks(e)}).attr("class",function(e){return n.getLinkGroupClass(e)}).attr("tabindex",-1).attr("style",function(e){return n.getLinkGrpStyle(e)}).attr("data-selected",function(e){return!!n.activePipeline.isSelected(e.id)||null}).attr("aria-label",function(e){return D.getLinkAriaLabel(e,n.canvasController.labelUtil)}).attr("aria-roledescription",n.canvasController.labelUtil.getLabel("link.ariaRoleDescription")).call(function(e){n.updateLinks(e,t)})})}},{key:"createLinks",value:function(e){var t=this;this.logger.logStartTimer("createLinks");var 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===K&&t.canvasLayout.dataLinkArrowHead||e.type===se&&t.canvasLayout.commentLinkArrowHead}).append("path").attr("class","d3-link-line-arrow-head"),n.filter(function(e){return e.type===K||e.type===$}).append("g").attr("class","d3-link-decorations-group"),n.filter(function(e){return e.type===K&&(t.config.enableLinkSelection===Se||t.config.enableLinkSelection===ve)}).append("g").attr("class","d3-link-handle-start-group"),n.filter(function(e){return e.type===K&&(t.config.enableLinkSelection===Se||t.config.enableLinkSelection===ve)}).append("g").attr("class","d3-link-handle-end-group"),this.logger.logEndTimer("createLinks"),n}},{key:"updateLinks",value:function(e,t){var n=this;if(this.logger.logStartTimer("updateLinks"),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 D.getObjectStyle(e,"line","default")}),e.filter(function(e){return e.type===K&&n.canvasLayout.dataLinkArrowHead||e.type===se&&n.canvasLayout.commentLinkArrowHead}).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 D.getObjectStyle(e,"line","default")}),e.each(function(e,t,i){if(e.type===K||e.type===$){var o=Dd.select(i[t]).selectAll(".d3-link-decorations-group"),r=n.shouldDisplayAltDecorations(e)?n.canvasLayout.linkAltDecorations:e.decorations;n.displayDecorations(e,pe,o,r)}}),e.each(function(e,t,i){n.updateStartHandles(e,i[t]),n.updateEndHandles(e,i[t])}),this.config.enableEditingActions&&this.config.enableSplitLinkDroppedOnNode&&this.config.enableLinkMethod===q&&this.config.enableLinkType===Q){var i=this.dragLinkUtils.getDragLinkHandler();e.call(i)}else e.on(".drag",null);this.isDragging()||this.isSizing()||this.config.enableLinksOverNodes||this.setDisplayOrder(e),this.logger.logEndTimer("updateLinks")}},{key:"attachLinkGroupListeners",value:function(e){var t=this;e.on("keydown",function(e,n){if(t.config.enableKeyboardNavigation)if(pt.nextObjectInGroup(e)){if(n.type===K){var i=t.activePipeline.getNextNodeFromDataLink(n);t.setFocusObject(i,e),t.lowerLinkToBottom(e.currentTarget)}else if(n.type===$){var o=t.activePipeline.getNextNodeFromAssocLink(n);t.setFocusObject(o,e)}else if(n.type===se){var r=t.activePipeline.getNextObjectFromCommentLink(n);t.setFocusObject(r,e)}}else if(pt.previousObjectInGroup(e)){if(n.type===K){var a=t.activePipeline.getPreviousNodeFromDataLink(n);t.setFocusObject(a,e),t.lowerLinkToBottom(e.currentTarget)}else if(n.type===$){var s=t.activePipeline.getPreviousNodeFromAssocLink(n);t.setFocusObject(s,e)}else if(n.type===se){var l=t.activePipeline.getPreviousObjectFromCommentLink(n);t.setFocusObject(l,e)}}else if(pt.nextSiblingLink(e)){var c=t.activePipeline.getNextSiblingLink(n);c.id!==n.id&&(t.setFocusObject(c,e),t.lowerLinkToBottom(e.currentTarget))}else if(pt.previousSiblingLink(e)){var u=t.activePipeline.getPreviousSiblingLink(n);u.id!==n.id&&(t.setFocusObject(u,e),t.lowerLinkToBottom(e.currentTarget))}else if(pt.focusSubObject(e))D.stopPropagationAndPreventDefault(e),t.clearSubObject(),t.setFocusNextSubObject(n,e);else if(pt.cancelFocusOnSubObject(e))t.canvasController.restoreFocus();else if(pt.moveObjectLeft(e))D.stopPropagationAndPreventDefault(e);else if(pt.selectObject(e)&&t.config.enableLinkSelection!==Le){D.stopPropagationAndPreventDefault(e);var d=t.canvasController.isSelected(n.id,t.activePipeline.id)?Ie:ye;t.selectObject(n,d)}else if(pt.selectObjectAugment(e)&&t.config.enableLinkSelection!==Le)D.stopPropagationAndPreventDefault(e),t.selectObject(n,ye,!1,!0);else if(pt.displayContextOptions(e))if(e.stopPropagation(),t.config.enableLinkSelection!==Le&&t.selectObject(n,Ee),t.config.enableContextToolbar)t.addContextToolbar(e,n,"link",H,t.canvasLayout.linkContextToolbarPosX,t.canvasLayout.linkContextToolbarPosY);else{var h=t.getObjectCenterPosition(e.currentTarget);t.openContextMenu(e,"link",n,null,h)}}).on("mouseenter",function(e,n){if(!t.isDragging()){var i=e.currentTarget;t.config.enableLinkSelection!==Se&&t.config.enableLinkSelection!==ve&&!t.config.enableRaiseLinksToTopOnHover||n.type!==K||(t.isEditingText()||t.raiseLinkToTopPreserveFocus(i),D.stopPropagationAndPreventDefault(e)),t.setLinkLineStyles(i,n,"hover"),t.config.enableContextToolbar&&t.addContextToolbar(e,n,"link",Be,t.canvasLayout.linkContextToolbarPosX,t.canvasLayout.linkContextToolbarPosY)}}).on("mouseover",function(e,n){if(e.stopPropagation(),t.canOpenTip(j)){var i=t.canvasController.getTipId(),o=t.getId("link_tip",n.id);null!==i&&i===o||(t.canvasController.closeTip(),t.canvasController.openTip({id:o,type:j,targetObj:e.currentTarget,mousePos:{x:e.clientX,y:e.clientY},pipelineId:t.activePipeline.id,link:n}))}}).on("mouseleave",function(e,n){var i=e.currentTarget;n.type!==K||t.config.enableLinksOverNodes||t.isEditingText()||t.isDragging()||(t.lowerLinkToBottomPreserveFocus(i),D.stopPropagationAndPreventDefault(e)),t.setLinkLineStyles(i,n,"default"),t.canvasController.closeTip(),t.config.enableContextToolbar&&t.removeContextToolbar()}).on("mousedown",function(e,n,i,o){if(t.logger.log("Link Group - mouse down"),t.svgCanvasTextArea.isEditingText()&&t.svgCanvasTextArea.completeEditing(e),t.config.enableKeyboardNavigation&&t.setFocusObject(n,e,!1,!0),t.config.enableLinkSelection!==Le&&!t.config.enableDragWithoutSelect){var r=t.getClickType(e);t.selectObjectD3Event(e,n,r)}e.stopPropagation()}).on("click",function(e,n){t.logger.log("Link Group - click"),e.stopPropagation()}).on("dblclick",function(e,n){t.logger.log("Link Group - double click"),D.stopPropagationAndPreventDefault(e),t.config.enableLinkSelection!==Le&&t.canvasController.clickActionHandler({clickType:Ie,objectType:"link",id:n.id,selectedObjectIds:t.activePipeline.getSelectedObjectIds(),pipelineId:t.activePipeline.id})}).on("contextmenu",function(e,n){t.logger.log("Link Group - context menu"),D.stopPropagationAndPreventDefault(e),t.config.enableLinkSelection!==Le&&t.config.enableDragWithoutSelect&&t.selectObjectD3Event(e,n,Ee),t.setFocusObject(n,e,!1,!0),t.config.enableContextToolbar||t.openContextMenu(e,"link",n)})}},{key:"shouldDisplayAltDecorations",value:function(e){return this.canvasLayout.linkAltDecorations&&D.getLinkDistance(e)<this.canvasLayout.linkDistanceForAltDecorations}},{key:"updateStartHandles",value:function(e,t){var n=this,i=Dd.select(t).selectAll(".d3-link-handle-start-group").attr("tabindex",-1).call(this.attachLinkHandleListeners.bind(this,"start")),o=e.type!==K||this.config.enableLinkSelection!==Se&&this.config.enableLinkSelection!==ve?[]:[{id:this.canvasLayout.linkStartHandleObject}];if(i.selectChildren(".d3-link-handle-start").data(o,function(e){return e.id}).join(function(t){return n.createStartHandle(t,e)}).datum(this.activePipeline.getLink(e.id)).attr("class","d3-link-handle-start"),this.config.enableEditingActions){var r=this.dragDetLinkUtils.getDragDetachedLinkHandler();i.call(r)}else i.on(".drag",null)}},{key:"createStartHandle",value:function(e,t){var n=null,i=this.canvasController.labelUtil.getLabel("link.sourceHandle");return this.canvasLayout.linkStartHandleObject===Re?n=e.append("image").attr("xlink:href",this.canvasLayout.linkStartHandleImage).attr("x",t.x1-this.canvasLayout.linkStartHandleWidth/2).attr("y",t.y1-this.canvasLayout.linkStartHandleHeight/2).attr("width",this.canvasLayout.linkStartHandleWidth).attr("height",this.canvasLayout.linkStartHandleHeight).attr("aria-label",i):this.canvasLayout.linkStartHandleObject===be&&(n=e.append("circle").attr("r",this.canvasLayout.linkStartHandleRadius).attr("cx",t.x1).attr("cy",t.y1).attr("aria-label",i)),n}},{key:"updateEndHandles",value:function(e,t){var n=this,i=Dd.select(t).selectAll(".d3-link-handle-end-group").attr("tabindex",-1).call(this.attachLinkHandleListeners.bind(this,"end")),o=e.type!==K||this.config.enableLinkSelection!==Se&&this.config.enableLinkSelection!==ve?[]:[{id:this.canvasLayout.linkEndHandleObject}];if(i.selectChildren(".d3-link-handle-end").data(o,function(e){return e.id}).join(function(t){return n.createEndHandle(t,e)}).datum(this.activePipeline.getLink(e.id)).attr("class","d3-link-handle-end"),this.config.enableEditingActions){var r=this.dragDetLinkUtils.getDragDetachedLinkHandler();i.call(r)}else i.on(".drag",null)}},{key:"createEndHandle",value:function(e,t){var n=null,i=this.canvasController.labelUtil.getLabel("link.targetHandle");return this.canvasLayout.linkEndHandleObject===Re?n=e.append("image").attr("xlink:href",this.canvasLayout.linkEndHandleImage).attr("x",t.x2-this.canvasLayout.linkEndHandleWidth/2).attr("y",t.y2-this.canvasLayout.linkEndHandleHeight/2).attr("width",this.canvasLayout.linkEndHandleWidth).attr("height",this.canvasLayout.linkEndHandleHeight).attr("transform",this.getLinkImageTransform(t)).attr("aria-label",i):this.canvasLayout.linkStartHandleObject===be&&(n=e.append("circle").attr("r",this.canvasLayout.linkEndHandleRadius).attr("cx",t.x2).attr("cy",t.y2).attr("aria-label",i)),n}},{key:"attachLinkHandleListeners",value:function(e,t){var n=this;t.on("keydown",function(e,t){n.config.enableKeyboardNavigation&&(pt.nextSubObject(e)?n.setFocusNextSubObject(t,e):pt.previousSubObject(e)?n.setFocusPreviousSubObject(t,e):pt.cancelFocusOnSubObject(e)?n.canvasController.restoreFocus():pt.moveLinkHandleUp(e)?(n.config.enableEditingActions&&n.dragDetLinkUtils.moveLinkHandle(t,ie,e),D.stopPropagationAndPreventDefault(e)):pt.moveLinkHandleDown(e)?(n.config.enableEditingActions&&n.dragDetLinkUtils.moveLinkHandle(t,ne,e),D.stopPropagationAndPreventDefault(e)):pt.moveLinkHandleRight(e)?(n.config.enableEditingActions&&n.dragDetLinkUtils.moveLinkHandle(t,ee,e),D.stopPropagationAndPreventDefault(e)):pt.moveLinkHandleLeft(e)&&(n.config.enableEditingActions&&n.dragDetLinkUtils.moveLinkHandle(t,te,e),D.stopPropagationAndPreventDefault(e)))}).on("mousedown",function(t,i){if(n.logger.log("Link "+e+" handle - mouse down"),!n.config.enableDragWithoutSelect){n.config.enableKeyboardNavigation&&n.setFocusObject(i,t,!1,!0);var o=n.getClickType(t);n.selectObjectD3Event(t,i,o)}n.logger.log("Link "+e+" handle - finished mouse down")})}},{key:"setLinkLineStyles",value:function(e,t,n){var i=D.getObjectStyle(t,"line",n),o=Dd.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===$?"d3-association-link-selection-area":e.type===se?"d3-comment-link-selection-area":"d3-data-link-selection-area")}},{key:"getLinkGroupClass",value:function(e){return"d3-link-group "+this.getLinkTypeClass(e)+" "+this.getLinkBranchHighlightCLass(e)+" "+this.getLinkCustomClass(e)}},{key:"getLinkBranchHighlightCLass",value:function(e){return e.branchHighlight?"d3-branch-highlight":""}},{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===$?this.config.enableAssocLinkType===J?"d3-association-link":"d3-object-link":e.type===se?"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.layout.className||"";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=D.isExpandedSupernode(e)?" d3-node-supernode-expanded":"",i=this.config.enableEditingActions?" d3-draggable":" d3-non-draggable",o=e.isResized?" d3-resized":"",r=this.getNodeShapeClass(e.layout.nodeShape);return"d3-node-group"+n+o+i+(e.branchHighlight?" d3-branch-highlight":"")+r+t}},{key:"getNodeShapeClass",value:function(e){return e===Ze?" d3-node-shape-port-arcs":e===Xe?" d3-node-shape-rectangle-rounded-corners":" d3-node-shape-rectangle"}},{key:"setDisplayOrder",value:function(e){var t=this;this.preserveFocus(function(){e.filter(function(e){return t.hasOneDecorationOrMore(e)}).lower(),e.filter(function(e){return!t.hasOneDecorationOrMore(e)}).lower(),t.config.enableLinkSelection!==Se&&t.config.enableLinkSelection!==ve||t.nodesLinksGrp.selectAll(".d3-link-group[data-selected]").raise()})}},{key:"raiseNodeToTopById",value:function(e){var t=this;this.preserveFocus(function(){return t.getNodeGroupSelectionById(e).raise()})}},{key:"raiseNodeToTop",value:function(e){!this.config.enableRaiseNodesToTopOnHover||this.isDragging()||0!==this.activePipeline.getSelectedLinksCount()||this.isEditingText()||this.config.enableLinksOverNodes||this.preserveFocus(function(){return e.raise()})}},{key:"raiseLinkToTopByIdPreserveFocus",value:function(e){var t=this;this.preserveFocus(function(){return t.getLinkGroupSelectionById(e).raise()})}},{key:"raiseLinkToTopPreserveFocus",value:function(e){this.preserveFocus(function(){return Dd.select(e).raise()})}},{key:"lowerLinkToBottomPreserveFocus",value:function(e){var t=this;this.preserveFocus(function(){return t.lowerLinkToBottom(e)})}},{key:"lowerLinkToBottom",value:function(e){Dd.select(e).lower()}},{key:"preserveFocus",value:function(e){var t=this.canvasController.getFocusObject(),n=this.canvasController.isTargetInsideCanvas(document.activeElement);e(),!this.config.enableKeyboardNavigation||this.isEditingText()||this.canvasController.isContextMenuDisplayed()||(this.subObject?this.restoreFocusToSubObject():this.canvasController.setFocusObject(t,null,n))}},{key:"hasOneDecorationOrMore",value:function(e){return e.decorations&&e.decorations.length>0}},{key:"buildLinksArray",value:function(){var e=this;this.logger.logStartTimer("buildLinksArray");var t=[];return this.canvasLayout.linkMethod===q&&this.updateFreeformLinksForNodes(),this.activePipeline.links.forEach(function(n){var i=null;(i=!(e.config.enableLinkSelection===Se&&e.dragDetLinkUtils.isLinkBeingDragged(n)||e.config.enableLinkSelection===ve)||n.srcObj&&n.trgNode?e.getAttachedLinkObj(n):e.getDetachedLinkObj(n))?t.push(i):e.canvasLayout.displayLinkOnOverlap||e.getLinkGroupSelectionById(n.id).remove()}),this.canvasLayout.linkType===ue&&(t=this.addMinInitialLineForElbow(t)),t=this.linkUtils.addConnectionPaths(t),this.logger.logEndTimer("buildLinksArray"),t}},{key:"getAttachedLinkObj",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=D.getSourcePortId(e,t),o=D.getTargetPortId(e,n),r=e.type===$&&this.config.enableAssocLinkType===J?this.getAssocLinkVariation(t,n):null,a=this.linkUtils.getLinkCoords(e,t,i,n,o,r);return e.coordsUpdated=e.x1!==a.x1||e.y1!==a.y1||e.x2!==a.x2||e.y2!==a.y2||e.centerDragPos,e.assocLinkVariation=r,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.srcDir=a.srcDir,e.trgDir=a.trgDir,e}return null}},{key:"getDetachedLinkObj",value:function(e){var t=e.srcObj,n=e.trgNode,i=e.x1,o=e.y1,r=e.x2,a=e.y2;if(t||n)if(n){var s=this.getTargetEndInfo(e,n);e.x1=e.srcPos.x_pos,e.y1=e.srcPos.y_pos,e.x2=s.x2,e.y2=s.y2,e.trgDir=s.trgDir,e.originX=0,e.originY=0,e.srcDir=this.getSrcDirForDetachedLink(e,e.x1,e.y1)}else{var l=this.getSourceEndInfo(e,t);e.x1=l.x1,e.y1=l.y1,e.x2=e.trgPos.x_pos,e.y2=e.trgPos.y_pos,e.srcDir=l.srcDir,e.originX=l.originX,e.originY=l.originY,e.trgDir=this.getTrgDirForDetachedLink(e,e.x2,e.y2)}else e.x1=e.srcPos.x_pos,e.y1=e.srcPos.y_pos,e.x2=e.trgPos.x_pos,e.y2=e.trgPos.y_pos,e.originX=0,e.originY=0,this.canvasLayout.linkMethod===q?(e.srcDir=D.getPortDir(e.x2-e.x1,e.y2-e.y1,{width:10,height:10}),e.trgDir=this.reverseDir(e.srcDir)):(e.srcDir=this.getDefaultSrcDirForPorts(),e.trgDir=this.reverseDir(e.srcDir));return e.coordsUpdated=e.x1!==i||e.y1!==o||e.x2!==r||e.y2!==a,e}},{key:"getSourceEndInfo",value:function(e,t){var n={};if(this.canvasLayout.linkMethod===q){var i={x:e.trgPos.x_pos,y:e.trgPos.y_pos},o=this.linkUtils.getNewFreeformNodeLinkStartPos(t,i,e.srcFreeformInfo);n.x1=o.x,n.y1=o.y,n.originX=o.originX,n.originY=o.originY,n.srcDir=o.dir}else{var r=D.getSourcePortId(e,t),a=D.getOutputPort(r,t);a||(a=D.getInputPort(r,t)),a&&(n.x1=t.x_pos+a.cx,n.y1=t.y_pos+a.cy,n.srcDir=a.dir)}return n}},{key:"getTargetEndInfo",value:function(e,t){var n={};if(this.canvasLayout.linkMethod===q){var i={x:e.srcPos.x_pos,y:e.srcPos.y_pos},o=this.linkUtils.getNewFreeformNodeLinkStartPos(t,i,e.trgFreeformInfo);n.x2=o.x,n.y2=o.y,n.trgDir=o.dir}else{var r=D.getTargetPortId(e,t),a=D.getInputPort(r,t);a&&(n.x2=t.x_pos+a.cx,n.y2=t.y_pos+a.cy,n.trgDir=a.dir)}return n}},{key:"getDefaultSrcDirForPorts",value:function(){return this.canvasLayout.linkDirection===De?ee:this.canvasLayout.linkDirection===Ye?te:this.canvasLayout.linkDirection===Ne?ie:this.canvasLayout.linkDirection===Te?ne:ee}},{key:"getSrcDirForDetachedLink",value:function(e,t,n){if(e.trgNode){if(this.canvasLayout.linkMethod===me){if(e.trgDir===te&&this.canvasLayout.linkDirection===De)return ee;if(e.trgDir===ee&&this.canvasLayout.linkDirection===Ye)return te;if(e.trgDir===ne&&this.canvasLayout.linkDirection===Ne)return ie;if(e.trgDir===ie&&this.canvasLayout.linkDirection===Te)return ne}var i=D.getPortDir(t-e.trgNode.x_pos,n-e.trgNode.y_pos,e.trgNode);return this.reverseDir(i)}var o=D.getPortDir(t-e.trgPos.x_pos,n-e.trgPos.y_pos,{width:10,height:10});return this.reverseDir(o)}},{key:"getTrgDirForDetachedLink",value:function(e,t,n){if(e.srcObj){if(this.canvasLayout.linkMethod===me){if(e.srcDir===ee&&this.canvasLayout.linkDirection===De)return te;if(e.srcDir===te&&this.canvasLayout.linkDirection===Ye)return ee;if(e.srcDir===ie&&this.canvasLayout.linkDirection===Ne)return ne;if(e.srcDir===ne&&this.canvasLayout.linkDirection===Te)return ie}var i=D.getPortDir(t-e.srcObj.x_pos,n-e.srcObj.y_pos,e.srcObj);return this.reverseDir(i)}var o=D.getPortDir(t-e.srcPos.x_pos,n-e.srcPos.y_pos,{width:10,height:10});return this.reverseDir(o)}},{key:"reverseDir",value:function(e){switch(e){case ie:return ne;case ne:return ie;case ee:return te;default:return ee}}},{key:"shouldDisplayLink",value:function(e,t,n){return(n!==se||!this.canvasInfo.hideComments)&&(!1!==this.canvasLayout.displayLinkOnOverlap||!this.areLinkedObjectsOverlapping(e,t,n))}},{key:"areLinkedObjectsOverlapping",value:function(e,t,n){var i=n===se?this.canvasLayout.commentHighlightGap:e.layout.nodeHighlightGap,o=t.layout.nodeHighlightGap,r=e.x_pos-i,a=e.x_pos+e.width+i,s=t.x_pos-o,l=t.x_pos+t.width+o,c=e.y_pos-i,u=e.y_pos+e.height+i,d=t.y_pos-o,h=t.y_pos+t.height+o;return a>=s&&l>=r&&u>=d&&h>=c}},{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===De?(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===De?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:"updateFreeformLinksForNodes",value:function(){var e=this;this.activePipeline.nodes.forEach(function(t){return e.updateFreeformLinksForNode(t)})}},{key:"updateFreeformLinksForNode",value:function(e){var t=this,n={n:[],s:[],e:[],w:[]};this.activePipeline.links.forEach(function(i){var o,r,a;if(i.type===K)if(e.id===(null===(o=i.srcObj)||void 0===o?void 0:o.id)&&(null===(r=i.srcObj)||void 0===r?void 0:r.id)===(null===(a=i.trgNode)||void 0===a?void 0:a.id))n[ie].push({flow:he,startNode:i.srcObj,endNode:i.trgNode,link:i}),n[ee].push({flow:de,startNode:i.srcObj,endNode:i.trgNode,link:i});else if(i.trgNode&&i.trgNode.id===e.id){if(i.srcObj){var s=t.getDirToNode(i.trgNode,i.srcObj);n[s].push({flow:he,startNode:i.trgNode,endNode:i.srcObj,link:i})}else if(i.srcPos){var l=t.getDirToEndPos(i.trgNode,i.srcPos.x_pos,i.srcPos.y_pos);n[l].push({flow:he,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 c=t.getDirToNode(i.srcObj,i.trgNode);n[c].push({flow:de,startNode:i.srcObj,endNode:i.trgNode,link:i})}else if(i.trgPos){var u=t.getDirToEndPos(i.srcObj,i.trgPos.x_pos,i.trgPos.y_pos);n[u].push({flow:de,x:i.trgPos.x_pos,y:i.trgPos.y_pos,link:i})}});var i={x:e.x_pos+e.width/2,y:e.y_pos+e.height/2};n.n=this.sortLinksInfo(n.n,ie,i),n.s=this.sortLinksInfo(n.s,ne,i),n.e=this.sortLinksInfo(n.e,ee,i),n.w=this.sortLinksInfo(n.w,te,i),this.updateLinksInfo(n.n,ie),this.updateLinksInfo(n.s,ne),this.updateLinksInfo(n.e,ee),this.updateLinksInfo(n.w,te)}},{key:"getDirToNode",value:function(e,t){var n=Rs.getNodeCenterPosX(t),i=Rs.getNodeCenterPosY(t);return this.getDirToEndPos(e,n,i)}},{key:"getDirToEndPos",value:function(e,t,n){var i=Rs.getNodeCenterPosX(e),o=Rs.getNodeCenterPosY(e),r=e.x_pos,a=e.y_pos,s=e.width,l=e.height;return D.getDir(r,a,s,l,i,o,t,n)}},{key:"sortLinksInfo",value:function(e,t,n){var i=this,o=e;if(o.length>1){var r=this.getLinkInfoGroups(o);ss(r,function(e){e.forEach(function(n,o){var r=n.endNode,a=e.length+1;(t===ie||t===ne?(n.x=r.x_pos+r.width/a*(o+1),n.y=Rs.getNodeCenterPosY(r)):(n.x=Rs.getNodeCenterPosX(r),n.y=r.y_pos+r.height/a*(o+1)),t===ne)&&(i.getDirToNode(n.endNode,n.startNode)===te&&(n.x=r.x_pos+r.width/a*(e.length-o)));t===ie&&(i.getDirToNode(n.endNode,n.startNode)===ee&&(n.x=r.x_pos+r.width/a*(e.length-o)))})}),o.forEach(function(e){e.angle=D.calculateAngle(n.x,n.y,e.x,e.y),t===ee&&e.angle>=270&&(e.angle-=360),e.startNode&&e.endNode&&e.startNode===e.endNode&&(t===ee?e.angle=-90:t===ie&&(e.angle=360))}),o=t===ie||t===ee?o.sort(function(e,t){return e.angle>t.angle?1:-1}):o.sort(function(e,t){return e.angle<t.angle?1:-1})}return o}},{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){n.flow===de?n.link.srcFreeformInfo={dir:t,idx:i,len:e.length}:n.link.trgFreeformInfo={dir:t,idx:i,len:e.length}})}},{key:"getNewLinkAssocVariation",value:function(e,t,n){return n===he&&e>t?re:n===de&&e<t?oe:le}},{key:"getAssocLinkVariation",value:function(e,t){var n=e.layout.minInitialLine;return t.x_pos>=e.x_pos+e.width+n?oe:e.x_pos>=t.x_pos+t.width+n?re:le}},{key:"getPortArrowPath",value:function(){return"M -2 3 L 2 0 -2 -3"}},{key:"getInputPortArrowPathTransform",value:function(e){var t=D.getAngleForInputPorts(e.dir);return"translate(".concat(e.cx,", ").concat(e.cy,") rotate(").concat(t,")")}},{key:"getOutputPortArrowPathTransform",value:function(e){var t=D.getAngleForOutputPorts(e.dir);return"translate(".concat(e.cx,", ").concat(e.cy,") rotate(").concat(t,")")}},{key:"getConnectFromArrowInfo",value:function(e,t){var n=t.layout.portRadius+5,i=e.dir||"e",o={e:0,s:90,w:180,n:270}[i]||0,r=0,a=0;switch(i){case"n":a=-n;break;case"s":a=n;break;case"e":r=n;break;default:r=-n}return{path:"M 0 0 L 12 0 L 9 -3 M 12 0 L 9 3",transform:"translate(".concat(e.cx+r,", ").concat(e.cy+a,") rotate(").concat(o,")")}}},{key:"getArrowHead",value:function(e){return e.type===se?"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=D.getLinkEndAngle(e,he,this.canvasLayout);return"translate(".concat(e.x2,", ").concat(e.y2,") rotate(").concat(t,")")}},{key:"getPortImageTransform",value:function(e,t){var n=t===de?D.getAngleForOutputPorts(e.dir):D.getAngleForInputPorts(e.dir);return"rotate(".concat(n,",").concat(e.cx,",").concat(e.cy,")")}},{key:"getLinkImageTransform",value:function(e){var t=0;return t=this.canvasLayout.linkMethod!==q||this.canvasLayout.linkType!==Q&&this.canvasLayout.linkType!==ke?D.getAngleForInputPorts(e.trgDir):D.calculateAngle(e.originX||e.x1,e.originY||e.y1,e.x2,e.y2),"rotate(".concat(t,",").concat(e.x2,",").concat(e.y2,")")}},{key:"canOpenTip",value:function(e){return this.canvasController.isTipEnabled(e)&&!this.regionSelect&&!this.isDragging()&&!this.isSizing()}},{key:"getDefaultCommentOffset",value:function(){var e=this.canvasLayout.addCommentOffsetX,t=this.canvasLayout.addCommentOffsetY,n=this.zoomUtils.getZoomTransform();if(n){var i=n.x/n.k,o=n.y/n.k;e=-i+this.canvasLayout.addCommentOffsetX,t=-o+this.canvasLayout.addCommentOffsetY}return this.config.enableSnapToGridType===ge||this.config.enableSnapToGridType===fe?this.snapToGridPosition({x:e,y:t}):{x:e,y:t}}},{key:"getFlags",value:function(){var e="Flags:";return this.isDragging()&&(e+=" dragging = true"),this.isSizing()&&(e+=" sizing = true"),this.regionSelect&&(e+=" regionSelect = true"),"Flags:"===e&&(e+=" None"),e}},{key:"focusNextTabGroup",value:function(e){var t=this.canvasController.getFocusObject(),n=this.activePipeline.getNextTabGroupStartObject(t);return!!n&&(this.setFocusObject(n,e,!1,!0),!0)}},{key:"focusPreviousTabGroup",value:function(e){var t=this.canvasController.getFocusObject(),n=this.activePipeline.getPreviousTabGroupStartObject(t);return!!n&&(this.setFocusObject(n,e),!0)}},{key:"getActiveCanvasObject",value:function(){var e=this.getActiveCanvasElement();return e?Dd.select(e).datum():null}},{key:"getActiveCanvasElement",value:function(){var e=null;return document.activeElement&&((e=document.activeElement.closest(".d3-node-group"))||(e=document.activeElement.closest(".d3-comment-group")),e||(e=document.activeElement.closest(".d3-link-group"))),e}},{key:"setFocusObject",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.config.enableKeyboardNavigation&&(n?t.stopPropagation():D.stopPropagationAndPreventDefault(t),this.canvasController.setFocusObject(e,t,i))}},{key:"clearSubObject",value:function(){this.subObject=null,this.subObjectParentObj=null}},{key:"restoreFocus",value:function(){this.canvasController.isContextMenuDisplayed()||(this.subObject?this.restoreFocusToSubObject():this.canvasController.getFocusObject()&&this.canvasController.restoreFocus())}},{key:"focusOnTextEntryElement",value:function(e){this.svgCanvasTextArea.focusOnTextEntryElement(e)}},{key:"getNodeFocusIncrements",value:function(e,t){var n=0,i=0,o=0,r=0,a=t.select(".d3-node-label").node(),s=t.select(".d3-node-label").select("span").node();if(a&&s){var l=this.zoomUtils.getTransformedElementRect(a),c=this.zoomUtils.getTransformedElementRect(s),u=Math.min(c.right,l.right),d=Math.min(c.bottom,l.bottom);n=e.x_pos-c.x,i=u-(e.x_pos+e.width),o=e.y_pos-c.y,r=d-(e.y_pos+e.height)}return{leftGap:n=Math.max(e.layout.nodeSizingArea,n+4),rightGap:i=Math.max(e.layout.nodeSizingArea,i+4),topGap:o=Math.max(e.layout.nodeSizingArea,o+4),bottomGap:r=Math.max(e.layout.nodeSizingArea,r+4)}}},{key:"moveFocusTo",value:function(e,t){var n=this;if(this.logger.log("moveFocusTo - "+D.getFocusName(e)),e&&e!==we){this.subObject=null,this.subObjectParentObj=null;var i=D.getObjectTypeName(e);this.canvasGrp.selectAll(".d3-focus-path").remove();var o=null;if("node"===i){if(!this.activePipeline.getNode(e.id))return void this.logger.log("Node with ID "+e.id+" not found in activePipeline");(o=this.getNodeGroupSelectionById(e.id)).insert("path",":first-child").attr("class","d3-focus-path").attr("d",function(e){return n.getRectangleNodeShapePath(e,n.getNodeFocusIncrements(e,o))})}else if("comment"===i){if(!this.activePipeline.getComment(e.id))return void this.logger.log("Comment with ID "+e.id+" not found in activePipeline");(o=this.getCommentGroupSelectionById(e.id)).insert("rect",":first-child").attr("class","d3-focus-path").attr("x",-this.canvasLayout.commentSizingArea).attr("y",-this.canvasLayout.commentSizingArea).attr("height",function(e){return e.height+2*n.canvasLayout.commentSizingArea}).attr("width",function(e){return e.width+2*n.canvasLayout.commentSizingArea})}else if("link"===i){if(!this.activePipeline.getLink(e.id))return void this.logger.log("Link with ID "+e.id+" not found in activePipeline");o=this.getLinkGroupSelectionById(e.id),!D.isKeyboardEvent(t)||e.type!==K||this.config.enableLinkSelection!==Se&&this.config.enableLinkSelection!==ve||o.raise()}if(o&&!o.empty()){if(D.isKeyboardEvent(t)&&this.shouldObjectCauseZoom(e,i)){var r=this.canvasController.getZoomToReveal([e.id]);r&&this.zoomTo(r)}var a=o.node();a&&(this.logger.log("moveFocusTo - set focus on element"),a.focus())}else{var s=e?e.id:"Unknown";this.logger.error("Error applying focus to ".concat(i," object with ID: ").concat(s))}}}},{key:"shouldObjectCauseZoom",value:function(e,t){if(this.dispUtils.isDisplayingSubFlowFullPage()){if("link"===t)return!1;if("node"===t&&D.isSuperBindingNode(e))return!1}return!0}},{key:"setFocusNextSubObject",value:function(e,t){D.stopPropagationAndPreventDefault(t);var n=this.activePipeline.getNextSubObject(e,this.subObject);this.moveFocusToSubObject(n,e,t)}},{key:"setFocusPreviousSubObject",value:function(e,t){D.stopPropagationAndPreventDefault(t);var n=this.activePipeline.getPreviousSubObject(e,this.subObject);this.moveFocusToSubObject(n,e,t)}},{key:"restoreFocusToSubObject",value:function(){this.moveFocusToSubObject(this.subObject,this.subObjectParentObj,null)}},{key:"moveFocusToSubObject",value:function(e,t,n){if(e){this.subObject=e,this.subObjectParentObj=t,this.canvasGrp.selectAll(".d3-focus-path").remove();var i=null;if("reactObject"!==e.type){if("inputPort"===e.type?i=this.getNodeInputPortSelectionById(e.obj.id,t.id):"outputPort"===e.type?i=this.getNodeOutputPortSelectionById(e.obj.id,t.id):"linkStart"===e.type?i=this.getLinkStartHandleGrpSelectionById(e.obj.id):"linkEnd"===e.type?i=this.getLinkEndHandleGrpSelectionById(e.obj.id):"decoration"===e.type&&(i="node"===D.getObjectTypeName(t)?this.getNodeDecSelectionById(e.obj.id,t.id):this.getLinkDecSelectionById(e.obj.id,t.id)),i){"link"===D.getObjectTypeName(t)&&this.getLinkGroupSelectionById(t.id).raise();var o=i.node();o&&(this.logger.log("moveFocusTo - set focus on element"),this.drawFocusBox(i,o),n&&D.stopPropagationAndPreventDefault(n),o.focus())}}else t.focusFunction&&n&&t.focusFunction(n)}}},{key:"drawFocusBox",value:function(e,t){var n=t.getBBox();e.append("rect").attr("class","d3-focus-path").attr("x",n.x-2).attr("y",n.y-2).attr("height",n.height+4).attr("width",n.width+4)}}])}(),Ed=function(){return e(function e(n,i,o){t(this,e),this.logger=new gt(["SVGCanvasD3","FlowId",n]),this.logger.logStartTimer("constructor"),this.canvasController=o,this.canvasDiv=Ja(i),this.logger.logEndTimer("constructor",!0)},[{key:"setCanvasInfo",value:function(e,t,n,i,o,r){if(this.logger=new gt(["SVGCanvasD3","FlowId",e.id]),this.config&&this.renderer&&this.canvasInfo&&e.id===this.canvasInfo.id&&(!this.renderer||this.renderer.pipelineId===this.canvasController.getCurrentBreadcrumb().pipelineId)&&v.compareCanvasConfigsOmitFields(this.config,r))this.logger.logStartTimer("set canvas info"),this.canvasInfo=this.cloneCanvasInfo(e),this.config=this.cloneConfig(r),this.renderer.setCanvasInfoRenderer(this.canvasInfo,t,n,i,o,this.config),this.logger.logEndTimer("set canvas info",!0);else{this.logger.logStartTimer("initializing"),this.canvasInfo=this.cloneCanvasInfo(e),this.config=this.cloneConfig(r),this.renderer&&(this.renderer.clearCanvas(),this.renderer=null);var a=this.canvasController.getCurrentBreadcrumb();this.renderer=new Od(a.pipelineId,this.canvasDiv,this.canvasController,this.canvasInfo,t,n,i,o,r,{id:a.supernodeId,pipelineId:a.supernodeParentPipelineId}),this.logger.logEndTimer("initializing",!0)}}},{key:"setSelectionInfo",value:function(e){this.renderer&&this.renderer.setSelectionInfo(e)}},{key:"cloneConfig",value:function(e){return Object.assign({},e)}},{key:"cloneCanvasInfo",value:function(e){return Et(e)}},{key:"isEditingText",value:function(){return!!this.renderer&&this.renderer.isEditingText()}},{key:"isDragging",value:function(){return!!this.renderer&&this.renderer.isDragging()}},{key:"convertPageCoordsToSnappedCanvasCoords",value:function(e){return this.renderer.convertPageCoordsToSnappedCanvasCoords(e)}},{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,t){this.renderer.zoomTo(e,t)}},{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(e){this.renderer.zoomToFit(e)}},{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:"setCommentEditingMode",value:function(e,t){this.renderer.setCommentEditingMode(e,t)}},{key:"setNodeLabelEditingMode",value:function(e,t){this.renderer.setNodeLabelEditingMode(e,t)}},{key:"setNodeDecorationLabelEditingMode",value:function(e,t,n){this.renderer.setNodeDecorationLabelEditingMode(e,t,n)}},{key:"setLinkDecorationLabelEditingMode",value:function(e,t,n){this.renderer.setLinkDecorationLabelEditingMode(e,t,n)}},{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:"getCanvasDimensionsWithPadding",value:function(){return this.renderer.getCanvasDimensionsWithPadding()}},{key:"getGhostNode",value:function(e){return this.renderer.getGhostNode(e)}},{key:"setSpaceKeyPressed",value:function(e){this.renderer.setSpaceKeyPressed(e)}},{key:"isSpaceKeyPressed",value:function(){return this.renderer.isSpaceKeyPressed()}},{key:"focusNextTabGroup",value:function(e){return this.renderer.focusNextTabGroup(e)}},{key:"focusPreviousTabGroup",value:function(e){return this.renderer.focusPreviousTabGroup(e)}},{key:"getActiveCanvasObject",value:function(){return this.renderer.getActiveCanvasObject()}},{key:"moveFocusTo",value:function(e,t){this.renderer&&this.renderer.moveFocusTo(e,t)}},{key:"focusOnTextEntryElement",value:function(e){this.renderer.focusOnTextEntryElement(e)}},{key:"clearSubObject",value:function(){var e;null===(e=this.renderer)||void 0===e||e.clearSubObject()}},{key:"setFocusNextSubObject",value:function(e,t){this.renderer.setFocusNextSubObject(e,t)}},{key:"setFocusPreviousSubObject",value:function(e,t){this.renderer.setFocusPreviousSubObject(e,t)}},{key:"openCanvasContextOptions",value:function(e){this.renderer.openCanvasContextOptions(e)}}])}();function Id(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ad(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ad(e,t):void 0}}(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 r,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,r=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw r}}}}function Ad(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function jd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(jd=function(){return!!e})()}var _d=function(n){function s(e){var n,i,l,c;return t(this,s),i=this,c=[e],l=o(l=s),(n=r(i,jd()?Reflect.construct(l,c||[],o(i).constructor):l.apply(i,c))).state={isDropZoneDisplayed:!1},n.logger=new gt("CC-Contents"),n.mainCanvasDivId="canvas-div-"+n.props.canvasController.getInstanceId(),n.svgCanvasDivId="d3-svg-canvas-div-"+n.props.canvasController.getInstanceId(),n.svgCanvasDivSelector="#"+n.svgCanvasDivId,n.dragX=null,n.dragY=null,n.contentsRef=a.createRef(),n.eventListenersAdded=!1,n.mousePos=null,n.tabbingOut=!1,n.drop=n.drop.bind(n),n.focusOnCanvas=n.focusOnCanvas.bind(n),n.setIsDropZoneDisplayed=n.setIsDropZoneDisplayed.bind(n),n.dragOver=n.dragOver.bind(n),n.dragEnter=n.dragEnter.bind(n),n.dragLeave=n.dragLeave.bind(n),n.refreshOnSizeChange=n.refreshOnSizeChange.bind(n),n.getLabel=n.getLabel.bind(n),n.onCut=n.onCut.bind(n),n.onCopy=n.onCopy.bind(n),n.onPaste=n.onPaste.bind(n),n.onKeyDown=n.onKeyDown.bind(n),n.onKeyUp=n.onKeyUp.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onClickReturnToPrevious=n.onClickReturnToPrevious.bind(n),n.onMouseLeave=n.onMouseLeave.bind(n),n.onMouseDown=n.onMouseDown.bind(n),n.onFocus=n.onFocus.bind(n),n.first=!1,n.second=!1,n.afterUpdateCallbacks=[],e.canvasController.setCanvasContents(n),n}return i(s,n),e(s,[{key:"componentDidMount",value:function(){var e=this;this.logger.log("componentDidMount"),this.svgCanvasD3||(this.svgCanvasD3=new Ed(this.props.canvasInfo.id,this.svgCanvasDivSelector,this.props.canvasController)),this.setCanvasInfo(),this.props.canvasConfig.enableBrowserEditMenu&&this.addEventListeners(),this.props.canvasConfig.enableFocusOnMount&&this.props.canvasController.setFocusOnCanvas(),this.resizeObserver=new ResizeObserver(function(t){var n,i=Id(t);try{for(i.s();!(n=i.n()).done;){var o=n.value;e.refreshOnSizeChange(o.contentRect)}}catch(e){i.e(e)}finally{i.f()}}),this.contentsRef.current&&this.resizeObserver.observe(this.contentsRef.current)}},{key:"componentDidUpdate",value:function(e){this.logger.log("componentDidUpdate"),this.svgCanvasD3&&!this.isDropZoneDisplayed()&&(e.canvasInfo!==this.props.canvasInfo||e.canvasConfig!==this.props.canvasConfig||e.breadcrumbs!==this.props.breadcrumbs?(this.setCanvasInfo(),this.afterUpdate()):e.selectionInfo!==this.props.selectionInfo&&(this.svgCanvasD3.setSelectionInfo(this.props.selectionInfo),this.afterUpdate())),this.props.canvasConfig.enableBrowserEditMenu?this.addEventListeners():this.removeEventListeners()}},{key:"componentWillUnmount",value:function(){var e;this.removeEventListeners(),null===(e=this.resizeObserver)||void 0===e||e.disconnect()}},{key:"onCut",value:function(e){this.isFocusOnCanvasOrContents(e)&&this.props.canvasConfig.enableEditingActions&&!this.svgCanvasD3.isEditingText()&&(e.preventDefault(),this.props.canvasController.cutToClipboard())}},{key:"onCopy",value:function(e){this.isFocusOnCanvasOrContents(e)&&this.props.canvasConfig.enableEditingActions&&!this.svgCanvasD3.isEditingText()&&(e.preventDefault(),this.props.canvasController.copyToClipboard())}},{key:"onPaste",value:function(e){this.isFocusOnCanvasOrContents(e)&&this.props.canvasConfig.enableEditingActions&&!this.svgCanvasD3.isEditingText()&&(e.preventDefault(),this.props.canvasController.pasteFromClipboard())}},{key:"onKeyDown",value:function(e){var t=this;this.props.canvasController.closeTip();var n=this.props.canvasController.getKeyboardConfig().actions;if(!this.svgCanvasD3.isEditingText()&&!this.svgCanvasD3.isDragging()){if(this.props.canvasConfig.enableEditingActions)if(pt.delete(e)&&n.delete)D.stopPropagationAndPreventDefault(e),this.props.canvasController.autoSelectFocusObj(function(){return t.props.canvasController.keyboardActionHandler("deleteSelectedObjects")});else if(pt.undo(e)&&n.undo)D.stopPropagationAndPreventDefault(e),this.props.canvasController.canUndo()&&this.props.canvasController.keyboardActionHandler("undo");else if(pt.redo(e)&&n.redo)D.stopPropagationAndPreventDefault(e),this.props.canvasController.canRedo()&&this.props.canvasController.keyboardActionHandler("redo");else if(pt.copyToClipboard(e)&&n.copyToClipboard)D.stopPropagationAndPreventDefault(e),this.props.canvasController.autoSelectFocusObj(function(){return t.props.canvasController.keyboardActionHandler("copy")});else if(pt.cutToClipboard(e)&&n.cutToClipboard)D.stopPropagationAndPreventDefault(e),this.props.canvasController.autoSelectFocusObj(function(){return t.props.canvasController.keyboardActionHandler("cut")});else if(pt.pasteFromClipboard(e)&&n.pasteFromClipboard)if(D.stopPropagationAndPreventDefault(e),this.mousePos){var i=this.svgCanvasD3.convertPageCoordsToSnappedCanvasCoords(this.mousePos);this.props.canvasController.keyboardActionHandler("paste",i)}else this.props.canvasController.keyboardActionHandler("paste");pt.selectAll(e)&&n.selectAll?(D.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("selectAll")):pt.deselectAll(e)&&n.deselectAll?(D.stopPropagationAndPreventDefault(e),this.props.canvasController.keyboardActionHandler("deselectAll")):pt.spaceKey(e)?this.svgCanvasD3.isSpaceKeyPressed()||(D.stopPropagationAndPreventDefault(e),this.svgCanvasD3.setSpaceKeyPressed(!0)):pt.toggleLogging(e)?(D.stopPropagationAndPreventDefault(e),gt.switchLoggingState()):pt.zoomToFit(e)&&this.props.canvasConfig.enableKeyboardNavigation?(D.stopPropagationAndPreventDefault(e),this.svgCanvasD3.zoomToFit()):pt.zoomIn(e)&&this.props.canvasConfig.enableKeyboardNavigation?(D.stopPropagationAndPreventDefault(e),this.svgCanvasD3.zoomIn()):pt.zoomOut(e)&&this.props.canvasConfig.enableKeyboardNavigation?(D.stopPropagationAndPreventDefault(e),this.svgCanvasD3.zoomOut()):pt.panLeft(e)&&this.props.canvasConfig.enableKeyboardNavigation?(D.stopPropagationAndPreventDefault(e),this.svgCanvasD3.translateBy(-10,0)):pt.panRight(e)&&this.props.canvasConfig.enableKeyboardNavigation?(D.stopPropagationAndPreventDefault(e),this.svgCanvasD3.translateBy(10,0)):pt.panUp(e)&&this.props.canvasConfig.enableKeyboardNavigation?(D.stopPropagationAndPreventDefault(e),this.svgCanvasD3.translateBy(0,-10)):pt.panDown(e)&&this.props.canvasConfig.enableKeyboardNavigation?(D.stopPropagationAndPreventDefault(e),this.svgCanvasD3.translateBy(0,10)):pt.nextGroup(e)&&this.props.canvasConfig.enableKeyboardNavigation?this.moveFocusToNextGroup(e):pt.previousGroup(e)&&this.props.canvasConfig.enableKeyboardNavigation?this.moveFocusToPreviousGroup(e):pt.displayContextOptions(e)&&this.props.canvasConfig.enableKeyboardNavigation&&this.svgCanvasD3.openCanvasContextOptions(e),e.stopPropagation()}}},{key:"onKeyUp",value:function(){this.svgCanvasD3.setSpaceKeyPressed(!1)}},{key:"onFocus",value:function(e){if(e.target.classList.contains("d3-svg-canvas-div")&&this.props.canvasController.getFocusObject()!==we)this.props.canvasController.setFocusObject(we);else if(!this.props.canvasController.getFocusObject()){var t=this.svgCanvasD3.getActiveCanvasObject();t&&this.props.canvasController.setFocusObject(t)}}},{key:"onMouseMove",value:function(e){var t;null!=e&&null!==(t=e.target)&&void 0!==t&&t.closest(".svg-area")?this.mousePos={x:e.clientX,y:e.clientY}:this.mousePos=null}},{key:"onMouseLeave",value:function(e){this.mousePos=null}},{key:"onMouseDown",value:function(e){this.props.canvasController.setFocusOnCanvas()}},{key:"onClickReturnToPrevious",value:function(e){e.stopPropagation(),e.preventDefault(),this.props.canvasController.displayPreviousPipeline()}},{key:"setCanvasInfo",value:function(){var e=this.props.canvasController.objectModel.getNodeLayout(),t=this.props.canvasController.objectModel.getCanvasLayout();this.svgCanvasD3.setCanvasInfo(this.props.canvasInfo,this.props.selectionInfo,this.props.breadcrumbs,e,t,this.props.canvasConfig)}},{key:"getLabel",value:function(e){return this.props.intl.formatMessage({id:e,defaultMessage:d[e]})}},{key:"getDNDJson",value:function(e){try{return JSON.parse(e.dataTransfer.getData(L))}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!==G&&this.props.canvasConfig.enableStateTag!==B||(e=a.createElement(Tr,{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?a.createElement("div",{className:"empty-canvas"},this.props.canvasConfig.emptyCanvasContent):a.createElement("div",{className:"empty-canvas"},a.createElement("div",{className:"empty-canvas-image"},a.createElement(Ar,null)),a.createElement("span",{className:"empty-canvas-text1"},this.getLabel("canvas.flowIsEmpty")),a.createElement("span",{className:"empty-canvas-text2"},this.getLabel("canvas.addNodeToStart")))),e}},{key:"getReturnToPreviousBtn",value:function(){var e,t=null;if(!this.props.canvasController.isPrimaryPipelineEmpty()&&(this.props.canvasController.isDisplayingFullPageSubFlow()||null!==(e=this.props.canvasConfig)&&void 0!==e&&null!==(e=e.enableCanvasLayout)&&void 0!==e&&e.alwaysDisplayBackToParentFlow)){var n=this.getLabel("canvas.returnToPrevious");t=a.createElement("div",{className:"return-to-previous"},a.createElement(st,{kind:"tertiary",onClick:this.onClickReturnToPrevious,"aria-label":n,size:"md"},a.createElement("div",{className:"return-to-previous-content"},a.createElement(Fr,null),a.createElement("span",null,n))))}return t}},{key:"getContextMenu",value:function(){return this.props.canvasConfig.enableContextToolbar?a.createElement(fi,{canvasController:this.props.canvasController,containingDivId:this.mainCanvasDivId}):a.createElement(ai,{canvasController:this.props.canvasController,containingDivId:this.mainCanvasDivId})}},{key:"getTextToolbar",value:function(){return a.createElement(pr,{canvasController:this.props.canvasController,containingDivId:this.mainCanvasDivId})}},{key:"getDropZone",value:function(){var e=null;return this.isDropZoneDisplayed()&&(e=this.props.canvasConfig.dropZoneCanvasContent?this.props.canvasConfig.dropZoneCanvasContent:a.createElement("div",null,a.createElement("div",{className:"dropzone-canvas"}),a.createElement("div",{className:"dropzone-canvas-rect"}))),e}},{key:"getSvgCanvasDivId",value:function(){return this.svgCanvasDivId}},{key:"getSVGCanvasDiv",value:function(){return this.props.canvasConfig.enableKeyboardNavigation?a.createElement("div",{role:"application",id:this.svgCanvasDivId,tabIndex:"0",className:"d3-svg-canvas-div keyboard-navigation",onMouseDown:this.onMouseDown,onMouseLeave:this.onMouseLeave,onFocus:this.onFocus,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"aria-label":this.getLabel("canvas.label")}):a.createElement("div",{tabIndex:"-1",className:"d3-svg-canvas-div",id:this.svgCanvasDivId,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp})}},{key:"setIsDropZoneDisplayed",value:function(e){e!==this.state.isDropZoneDisplayed&&this.setState({isDropZoneDisplayed:e})}},{key:"isTargetInsideCanvas",value:function(e){return e&&e.closest(".common-canvas-drop-div")}},{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:"isFocusOnCanvasOrContents",value:function(e){var t;return!(null===(t=e.currentTarget)||void 0===t||!t.activeElement)&&(e.currentTarget.activeElement.closest(this.svgCanvasDivSelector)||e.currentTarget.activeElement.id===this.svgCanvasDivId)}},{key:"isFocusOnCanvas",value:function(){var e;return(null===(e=document.activeElement)||void 0===e?void 0:e.id)===this.getSvgCanvasDivId()}},{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:"moveFocusToNextGroup",value:function(e){this.svgCanvasD3.focusNextTabGroup(e)?D.stopPropagationAndPreventDefault(e):(this.tabbingOut=!0,this.props.canvasController.setFocusOnCanvas())}},{key:"moveFocusToPreviousGroup",value:function(e){this.svgCanvasD3.focusPreviousTabGroup(e)?D.stopPropagationAndPreventDefault(e):(this.tabbingOut=!0,this.props.canvasController.setFocusOnCanvas())}},{key:"focusOnCanvas",value:function(){document.getElementById(this.svgCanvasDivId)&&(document.getElementById(this.svgCanvasDivId).focus(),this.svgCanvasD3.clearSubObject())}},{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.getReturnToPreviousBtn(),i=this.getContextMenu(),o=this.getTextToolbar(),r=this.getDropZone(),s=this.getSVGCanvasDiv();return a.createElement("div",{id:this.mainCanvasDivId,ref:this.contentsRef,className:"common-canvas-drop-div",onDrop:this.drop,onDragOver:this.dragOver,onDragEnter:this.dragEnter,onDragLeave:this.dragLeave},s,t,n,e,i,o,r)}}])}(a.Component),Md=s(function(e,t){return{canvasInfo:e.canvasinfo,canvasConfig:e.canvasconfig,selectionInfo:e.selectioninfo,breadcrumbs:e.breadcrumbs}})(c(_d));function zd(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(zd=function(){return!!e})()}var Hd=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,zd()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).state={},n.logger=new gt("NotificationPanel"),n.keyDownOnPanel=n.keyDownOnPanel.bind(n),n}return i(s,n),e(s,[{key:"componentDidMount",value:function(){this.setFocusOnFirstItem()}},{key:"setFocusOnFirstItem",value:function(){this.allRefs.length>0&&this.allRefs[0].focus()}},{key:"getIconComponent",value:function(e){var t="notification-message-icon-".concat(e);switch(e){case"error":return a.createElement(Ct,{className:yt("canvas-state-icon-error",t)});case"warning":return a.createElement(Pt,{className:yt("canvas-state-icon-warning",t)});case"success":return a.createElement(Tt,{className:yt("canvas-state-icon-success",t)});case"info":return a.createElement(St,{className:yt("canvas-state-icon-info",t)});default:return null}}},{key:"getNotifications",value:function(){var e=this,t=[];if(!this.props.messages)return t;for(var n=0;n<this.props.messages.length;n++){var i=this.props.messages[n],o=i.callback?" clickable ":"",r=i.type,s=a.createElement("div",{className:"notification-message-type"},this.getIconComponent(r)),l=i.title?a.createElement("div",{className:"notification-message-title"},i.title):null,c=i.subtitle?a.createElement("div",{className:"notification-message-subtitle"},i.subtitle):null,u=i.closeMessage?a.createElement("div",{ref:function(t){return!t||e.allRefs.push(t)},className:"notification-message-close",onClick:this.clickOnCloseButton.bind(this,i),onKeyDown:this.keyDownOnCloseButton.bind(this,i),role:"button",tabIndex:0},i.closeMessage):null,d=i.timestamp?a.createElement("div",{className:"notification-message-timestamp"},a.createElement("div",{className:"notification-message-timestamp-icon"},a.createElement(Nt,null)),a.createElement("div",{className:"notification-message-string"},i.timestamp)):null,h=a.createElement(a.Fragment,null,s,a.createElement("div",{className:"notification-message-details"},l,c,a.createElement("div",{className:"notification-message-content"},i.content),d,u)),p=i.callback?a.createElement("button",{className:"notifications notifications-button "+o+i.type,onClick:this.notificationCallback.bind(this,i.id,i.callback),ref:function(t){return!t||e.allRefs.push(t)},type:"button"},h):a.createElement("div",{className:"notifications "+o+i.type,ref:function(t){return!t||e.allRefs.push(t)}},h);t.push(a.createElement("div",{className:"notifications-button-container",role:"listitem",key:n+"-"+i.id},p))}return t}},{key:"getAriaHeaderLabel",value:function(e,t,n,i){var o="";return"string"==typeof e&&(o=e,"string"==typeof t&&t&&(o+=" "+t),!i&&"string"==typeof n&&n&&(o+=" "+n)),o}},{key:"notificationCallback",value:function(e,t,n){t&&t(e)}},{key:"clickOnCloseButton",value:function(e){this.deleteNotification(e.id)}},{key:"keyDownOnCloseButton",value:function(e,t){pt.activateButton(t)&&this.deleteNotification(e.id)}},{key:"deleteNotification",value:function(e){this.props.subPanelData.canvasController.deleteNotificationMessages(e)}},{key:"clearNotificationMessages",value:function(){this.props.subPanelData.canvasController.clearNotificationMessages(),this.setFocusOnFirstItem(),"function"==typeof this.props.notificationConfig.clearAllCallback&&this.props.notificationConfig.clearAllCallback()}},{key:"keyDownOnPanel",value:function(e){if(pt.nextSection(e)){var t=this.allRefs[this.allRefs.length-1];e.target===t&&(e.stopPropagation(),e.preventDefault(),this.allRefs[0].focus())}else if(pt.previousSection(e)){var n=this.allRefs[this.allRefs.length-1];e.target===this.allRefs[0]&&(e.stopPropagation(),e.preventDefault(),n.focus())}}},{key:"render",value:function(){var e,t,n,i,o,r,s=this;if(this.logger.log("render"),this.allRefs=[],!this.props.notificationConfig)return null;var l=(null===(e=this.props.notificationConfig)||void 0===e?void 0:e.notificationHeader)||Ke,c=null!==(t=null===(n=this.props.notificationConfig)||void 0===n?void 0:n.notificationSubtitle)&&void 0!==t?t:"",u=null!==(i=null===(o=this.props.notificationConfig)||void 0===o?void 0:o.emptyMessage)&&void 0!==i?i:"",d=this.getAriaHeaderLabel(l,c,u,this.props.messages.length>0),h=a.createElement("div",{className:"notification-panel-header"},l),p=null!==(r=this.props.notificationConfig)&&void 0!==r&&r.notificationSubtitle?a.createElement("div",{className:"notification-panel-subtitle"},c):null,g=a.createElement("div",{className:"notification-panel-close-button"},a.createElement(st,{ref:function(e){return!e||s.allRefs.push(e)},size:"sm",kind:"ghost",renderIcon:x,hasIconOnly:!0,iconDescription:this.props.intl.formatMessage({id:"notification.panel.close.button.description",defaultMessage:y["notification.panel.close.button.description"]}),onClick:this.props.closeSubPanel,tooltipAlignment:"end",tooltipPosition:"bottom"})),f=this.props.messages.length>0?this.getNotifications():a.createElement("div",{className:"notification-panel-empty-message-container"},a.createElement("div",{className:"notification-panel-empty-message"},u||null)),v=this.props.notificationConfig&&this.props.notificationConfig.clearAllMessage?a.createElement("div",{className:"notification-panel-clear-all-container"},a.createElement(st,{ref:function(e){return!e||0===s.props.messages.length||s.allRefs.push(e)},className:"notification-panel-clear-all",onClick:this.clearNotificationMessages.bind(this),kind:"ghost",size:"sm",disabled:0===this.props.messages.length},this.props.notificationConfig.clearAllMessage)):null,m=this.props.notificationConfig&&this.props.notificationConfig.secondaryButtonLabel&&this.props.notificationConfig.secondaryButtonCallback?a.createElement("div",{className:"notification-panel-secondary-button-container"},a.createElement(st,{ref:function(e){return!e||s.props.secondaryButtonDisabled||s.allRefs.push(e)},className:"notification-panel-secondary-button",onClick:this.props.notificationConfig.secondaryButtonCallback.bind(this),kind:"ghost",size:"sm",disabled:this.props.secondaryButtonDisabled},this.props.notificationConfig.secondaryButtonLabel)):null;return a.createElement("div",{className:"notification-panel",role:"region","aria-label":d,onKeyDown:this.keyDownOnPanel},a.createElement("div",{className:"notification-panel-header-container"},h,p),g,a.createElement("div",{className:"notification-panel-messages",role:"list"},f),a.createElement("div",{className:"notification-panel-button-container"},v,m))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return e.messages!==t.messages?{messages:e.messages}:{}}}])}(a.Component),Fd=s(function(e,t){return{notificationConfig:e.notificationpanel.config,secondaryButtonDisabled:!!e.notificationpanel.config&&e.notificationpanel.config.secondaryButtonDisabled,messages:e.notifications}})(c(Hd));const Rd=ut,Bd=dt;let Gd=a;Gd=ct.__toESM(Gd);let Ud=ht.exports;const Wd=Gd.default.forwardRef(function({children:e,size:t=16,...n},i){return Gd.default.createElement(Rd,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,Ud.jsx)("path",{d:"M28,4H4C2.9,4,2,4.9,2,6v20c0,1.1,0.9,2,2,2h24c1.1,0,2-0.9,2-2V6C30,4.9,29.1,4,28,4z M28,26H12v-9h10.2l-3.6,3.6L20,22 l6-6l-6-6l-1.4,1.4l3.6,3.6H12V6h16V26z"}),e)});"production"!==process.env.NODE_ENV&&(Wd.propTypes=Bd.iconPropTypes);var Vd=Wd;const Zd=ut,Xd=dt;let Yd=a;Yd=ct.__toESM(Yd);let Kd=ht.exports;const qd=Yd.default.forwardRef(function({children:e,size:t=16,...n},i){return Yd.default.createElement(Zd,{width:t,height:t,ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor",...n},(0,Kd.jsx)("path",{d:"M28,4H4C2.9,4,2,4.9,2,6v20c0,1.1,0.9,2,2,2h24c1.1,0,2-0.9,2-2V6C30,4.9,29.1,4,28,4z M28,15H17.8l3.6-3.6L20,10l-6,6l6,6 l1.4-1.4L17.8,17H28v9H12V6h16V15z"}),e)});"production"!==process.env.NODE_ENV&&(qd.propTypes=Xd.iconPropTypes);var $d=qd;function Jd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Qd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jd(Object(n),!0).forEach(function(t){It(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eh=function(){return!!e})()}var th=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,eh()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).logger=new gt("CC-Toolbar"),n.getLabel=n.getLabel.bind(n),n.toolbarActionHandler=n.toolbarActionHandler.bind(n),n}return i(s,n),e(s,[{key:"getLabel",value:function(e,t){var n=d[e]?d[e]:h[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=Qe;return e===W?t+=" error":e===V?t+=" warning":e===et?t+=" success":e===tt&&(t+=" info"),t}},{key:"getToolIndexByAction",value:function(e,t){return null==t?void 0:t.findIndex(function(t){return t.action===e})}},{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()).size="md",e=this.optionallyAddPaletteTool(e),e=this.optionallyAddNotificationTool(e)}},{key:"copyConfig",value:function(){if(!this.props.config)return null;if(Array.isArray(this.props.config))return C(this.props.config);var e={};return this.props.config.overrideAutoEnableDisable&&(e.overrideAutoEnableDisable=!0),this.props.config&&this.props.config.leftBar&&(e.leftBar=C(this.props.config.leftBar)),this.props.config&&this.props.config.rightBar&&(e.rightBar=C(this.props.config.rightBar)),this.props.config.size&&(e.size=this.props.config.size),e}},{key:"toolbarActionHandler",value:function(e){this.props.canvasController.toolbarActionHandler(e)}},{key:"optionallyAddPaletteTool",value:function(e){var t=e.leftBar||[],n=e.rightBar||[],i=this.getLabel("toolbar.palette"),o=t;if(t&&t.length>0&&"palette"===t[0].action&&(i=t[0].label?t[0].label:i,o=t.slice(1),t.length>1&&t[1].divider&&(o=t.slice(2))),this.props.isPaletteEnabled){var r=this.props.isPaletteOpen?"closePalette-action paletteClose-action":"openPalette-action paletteOpen-action",s=this.props.isPaletteOpen?a.createElement($d,null):a.createElement(Vd,null),l={action:qe,label:i,enable:!0,iconEnabled:s,isSelected:this.props.isPaletteOpen,className:r},c=this.getToolIndexByAction(qe,t),u=this.getToolIndexByAction(qe,n);if(c>-1){var d=t[c];e.leftBar[c]=Qd(Qd({},l),{},{label:d.label?d.label:i,iconEnabled:d.iconEnabled?d.iconEnabled:null,incLabelWithIcon:d.incLabelWithIcon?d.incLabelWithIcon:null,tooltip:d.tooltip?d.tooltip:null})}else if(u>-1){var h=n[u];e.rightBar[u]=Qd(Qd({},l),{},{label:h.label?h.label:i,iconEnabled:h.iconEnabled?h.iconEnabled:null,incLabelWithIcon:h.incLabelWithIcon?h.incLabelWithIcon:null,tooltip:h.tooltip?h.tooltip:null})}else{var p=[l,{divider:!0}];e.leftBar=p.concat(o)}}return e}},{key:"optionallyAddNotificationTool",value:function(e){var t=e.leftBar||[],n=e.rightBar||[];if(this.props.notificationConfigExists){var i=this.props.notificationMessages.length,o={action:$e,label:this.props.notificationConfigLabel,enable:this.props.notificationConfigEnable,extIsSubAreaDisplayed:this.props.isNotificationOpen,setExtIsSubAreaDisplayed:this.callExtIsSubAreaDisplayed.bind(this),className:this.getNotificationClassName(),textContent:i>9?"9+":i.toString(),subPanel:Fd,subPanelData:{canvasController:this.props.canvasController},leaveSubAreaOpenOnClickOutside:this.props.notificationConfigKeepOpen},r=this.getToolIndexByAction($e,t),a=this.getToolIndexByAction($e,n);if(r>-1){var s=t[r];e.leftBar[r]=Qd(Qd({},o),{},{iconEnabled:s.iconEnabled?s.iconEnabled:null,incLabelWithIcon:s.incLabelWithIcon?s.incLabelWithIcon:null,tooltip:s.tooltip?s.tooltip:null,textContent:null})}else if(a>-1){var l=n[a];e.rightBar[a]=Qd(Qd({},o),{},{iconEnabled:l.iconEnabled?l.iconEnabled:null,incLabelWithIcon:l.incLabelWithIcon?l.incLabelWithIcon:null,tooltip:l.tooltip?l.tooltip:null,textContent:null})}else{var c=[{divider:!0},o];e.rightBar=e.rightBar.concat(c)}}return e}},{key:"callExtIsSubAreaDisplayed",value:function(e){e?this.props.canvasController.openNotificationPanel():this.props.canvasController.closeNotificationPanel()}},{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;if(this.props.enableToolbarLayout===Je){var n=e.size||"md";t=a.createElement("div",{className:"common-canvas-toolbar"},a.createElement(b,{config:e,containingDivId:this.props.containingDivId,instanceId:this.props.canvasController.getInstanceId(),toolbarActionHandler:this.toolbarActionHandler,size:n,additionalText:{overflowMenuLabel:this.getLabel("toolbar.overflowMenu"),ariaLabel:this.getLabel("toolbar.flowEditorToolbarLabel")}}))}return t}}])}(a.Component),nh=s(function(e,t){var n,i,o,r;return{enableToolbarLayout:e.canvasconfig.enableToolbarLayout,config:e.canvastoolbar.config,isPaletteEnabled:e.canvasconfig.enablePaletteLayout!==E,isPaletteOpen:e.palette.isOpen,isNotificationOpen:e.notificationpanel.isOpen,notificationConfigExists:null===(n=e.notificationpanel)||void 0===n?void 0:n.config,notificationConfigEnable:null===(i=e.notificationpanel)||void 0===i||null===(i=i.config)||void 0===i?void 0:i.enable,notificationConfigLabel:null===(o=e.notificationpanel)||void 0===o||null===(o=o.config)||void 0===o?void 0:o.label,notificationConfigKeepOpen:null===(r=e.notificationpanel)||void 0===r||null===(r=r.config)||void 0===r?void 0:r.keepOpen,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()}})(c(th));function ih(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ih=function(){return!!e})()}var oh=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,ih()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).logger=new gt("CC-LeftFlyout"),n}return i(s,n),e(s,[{key:"render",value:function(){this.logger.log("render");var e=a.createElement("div",null);if(this.props.content&&this.props.isOpen){var t=this.props.enableLeftFlyoutUnderToolbar?"left-flyout-panel under-toolbar":"left-flyout-panel";e=a.createElement("div",{className:"left-flyout"},a.createElement("div",{className:t},this.props.content))}return e}}])}(a.Component),rh=s(function(e,t){return{isOpen:e.leftflyout.isOpen,content:e.leftflyout.content,enableLeftFlyoutUnderToolbar:e.canvasconfig.enableLeftFlyoutUnderToolbar}})(oh);function ah(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ah=function(){return!!e})()}var sh=function(n){function s(e){var n,i,l,c;return t(this,s),i=this,c=[e],l=o(l=s),(n=r(i,ah()?Reflect.construct(l,c||[],o(i).constructor):l.apply(i,c))).logger=new gt("CC-RightFlyout"),n.rightFlyoutRef=a.createRef(),n.state={isBeingDragging:!1},n.initialMinWidth=null,n.onMouseUp=n.onMouseUp.bind(n),n.onMouseDown=n.onMouseDown.bind(n),n.onMouseMoveX=n.onMouseMoveX.bind(n),n.getCurrentWidth=n.getCurrentWidth.bind(n),n.getRightFlyoutResizeContent=n.getRightFlyoutResizeContent.bind(n),n}return i(s,n),e(s,[{key:"componentDidMount",value:function(){void 0!==this.props.panelMinWidth&&null!==this.props.panelMinWidth||(this.initialMinWidth=this.getCurrentWidth())}},{key:"onMouseDown",value:function(e){0===e.button&&(this.setState({isBeingDragging:!0}),document.addEventListener("mousemove",this.onMouseMoveX,!0),document.addEventListener("mouseup",this.onMouseUp,!0),this.posX=e.clientX,e.preventDefault())}},{key:"onMouseUp",value:function(){this.setState({isBeingDragging:!1}),document.removeEventListener("mousemove",this.onMouseMoveX,!0),document.removeEventListener("mouseup",this.onMouseUp,!0)}},{key:"onMouseMoveX",value:function(e){if(e.clientX){var t=(this.isPanelWidthSpecified()?this.props.panelWidth:this.getCurrentWidth())-(e.clientX-this.posX);this.props.canvasController.setRightFlyoutWidth(this.limitWidth(t)),this.posX=e.clientX}}},{key:"getRightFlyoutResizeContent",value:function(){var e=null;if(this.props.enableRightFlyoutDragToResize){var t="right-flyout-drag"+(this.state.isBeingDragging?" is-being-dragged":"");e=a.createElement("div",{className:t,onMouseDown:this.onMouseDown})}return e}},{key:"getCurrentWidth",value:function(){var e,t;return null!==(e=this.rightFlyoutRef)&&void 0!==e&&e.current?null===(t=this.rightFlyoutRef)||void 0===t?void 0:t.current.getBoundingClientRect().width:0}},{key:"getMinWidth",value:function(){return void 0===this.props.panelMinWidth||null===this.props.panelMinWidth?null===this.initialMinWidth?0:this.initialMinWidth:this.props.panelMinWidth}},{key:"isPanelWidthSpecified",value:function(){return!(void 0===this.props.panelWidth||null===this.props.panelWidth)}},{key:"limitWidth",value:function(e){var t=.7*(this.props.getCenterPanelWidth()+this.getCurrentWidth()),n=this.getMinWidth();return Math.min(Math.max(e,n),t)}},{key:"render",value:function(){this.logger.log("render");var e=null;if(this.props.content&&this.props.isOpen){var t=this.getRightFlyoutResizeContent(),n=this.isPanelWidthSpecified()?this.limitWidth(this.props.panelWidth)+"px":null,i=this.props.enableRightFlyoutUnderToolbar?"right-flyout-panel under-toolbar":"right-flyout-panel";e=a.createElement("div",{className:"right-flyout",style:{width:n}},t,a.createElement("div",{className:i,ref:this.rightFlyoutRef},this.props.content))}return e}}])}(a.Component),lh=s(function(e,t){return{isOpen:e.rightflyout.isOpen,content:e.rightflyout.content,enableRightFlyoutUnderToolbar:e.canvasconfig.enableRightFlyoutUnderToolbar,enableRightFlyoutDragToResize:e.canvasconfig.enableRightFlyoutDragToResize,panelWidth:e.rightflyout.panelWidth,panelMinWidth:e.rightflyout.panelMinWidth}})(sh);function ch(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ch=function(){return!!e})()}var uh=function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,ch()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).logger=new gt("CC-Top-Panel"),n}return i(s,n),e(s,[{key:"render",value:function(){this.logger.log("render");var e=null;return this.props.topPanelIsOpen&&(e=a.createElement("div",{className:"top-panel"},a.createElement("div",{className:"top-panel-contents"},this.props.topPanelContent))),e}}])}(a.Component),dh=s(function(e,t){return{topPanelIsOpen:e.toppanel.isOpen,topPanelContent:e.toppanel.content}})(uh);function hh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(hh=function(){return!!e})()}var ph=function(n){function s(e){var n,i,l,c;return t(this,s),i=this,c=[e],l=o(l=s),(n=r(i,hh()?Reflect.construct(l,c||[],o(i).constructor):l.apply(i,c))).divRef=a.createRef(),n.logger=new gt("CC-Center-Panel"),n}return i(s,n),e(s,[{key:"getBoundingRect",value:function(){var e;return null===(e=this.divRef)||void 0===e||null===(e=e.current)||void 0===e?void 0:e.getBoundingClientRect()}},{key:"render",value:function(){return this.logger.log("render"),a.createElement("div",{className:"center-panel",ref:this.divRef},this.props.content)}}])}(a.Component);function gh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(gh=function(){return!!e})()}var fh=function(n){function s(e){var n,i,l,c;return t(this,s),i=this,c=[e],l=o(l=s),(n=r(i,gh()?Reflect.construct(l,c||[],o(i).constructor):l.apply(i,c))).logger=new gt("CC-Bottom-Panel"),n.state={isBeingDragging:!1},n.minHeight=0,n.bottomPanelRef=a.createRef(),n.onMouseUp=n.onMouseUp.bind(n),n.onMouseDown=n.onMouseDown.bind(n),n.onMouseMoveY=n.onMouseMoveY.bind(n),n}return i(s,n),e(s,[{key:"componentDidMount",value:function(){this.minHeight=75}},{key:"onMouseDown",value:function(e){0===e.button&&(this.setState({isBeingDragging:!0}),document.addEventListener("mousemove",this.onMouseMoveY,!0),document.addEventListener("mouseup",this.onMouseUp,!0),this.posY=e.clientY,e.preventDefault())}},{key:"onMouseUp",value:function(e){this.setState({isBeingDragging:!1}),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,n=.8*(this.props.getCenterPanelHeight()+(null!==(t=this.bottomPanelRef)&&void 0!==t&&t.current?this.bottomPanelRef.current.getBoundingClientRect().height:0));return Math.min(Math.max(e,this.minHeight),n)}},{key:"render",value:function(){this.logger.log("render");var e=null;if(this.props.bottomPanelIsOpen){var t=this.limitHeight(this.props.panelHeight)+"px",n="bottom-panel-drag"+(this.state.isBeingDragging?" is-being-dragged":"");e=a.createElement("div",{ref:this.bottomPanelRef,className:"bottom-panel",style:{height:t}},a.createElement("div",{className:n,onMouseDown:this.onMouseDown}),a.createElement("div",{className:"bottom-panel-contents"},this.props.bottomPanelContent))}return e}}])}(a.Component),vh=s(function(e,t){return{bottomPanelIsOpen:e.bottompanel.isOpen,bottomPanelContent:e.bottompanel.content,panelHeight:e.bottompanel.panelHeight}})(fh);function yh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(yh=function(){return!!e})()}var mh=function(n){function s(e){var n,i,l,c;return t(this,s),i=this,c=[e],l=o(l=s),(n=r(i,yh()?Reflect.construct(l,c||[],o(i).constructor):l.apply(i,c))).logger=new gt("CC-Panels"),n.containingDivId="common-canvas-items-container-"+e.canvasController.getInstanceId(),n.centerPanelRef=a.createRef(),n.getCenterPanelWidth=n.getCenterPanelWidth.bind(n),n.getCenterPanelHeight=n.getCenterPanelHeight.bind(n),n}return i(s,n),e(s,[{key:"onDragOver",value:function(e){e.preventDefault()}},{key:"onDrop",value:function(e){e.preventDefault()}},{key:"getCenterPanelWidth",value:function(){var e,t=null===(e=this.centerPanelRef)||void 0===e||null===(e=e.current)||void 0===e?void 0:e.getBoundingRect();return t?t.width:0}},{key:"getCenterPanelHeight",value:function(){var e,t=null===(e=this.centerPanelRef)||void 0===e||null===(e=e.current)||void 0===e?void 0:e.getBoundingRect();return t?t.height:1e3}},{key:"generateClass",value:function(){var e="common-canvas";return e+=this.props.enableEditingActions?"":" config-editing-actions-false",e+=this.props.enableParentClass?" "+this.props.enableParentClass:""}},{key:"generateTopCenterBottom",value:function(){var e=a.createElement(Md,{canvasController:this.props.canvasController}),t=a.createElement(dh,{canvasController:this.props.canvasController,containingDivId:this.containingDivId}),n=a.createElement(ph,{ref:this.centerPanelRef,content:e}),i=a.createElement(vh,{canvasController:this.props.canvasController,getCenterPanelHeight:this.getCenterPanelHeight}),o=this.props.topPanelIsOpen?"auto 1fr":"1fr";return o+=this.props.bottomPanelIsOpen?" auto":"",a.createElement("div",{className:"common-canvas-grid-vertical",style:{gridTemplateRows:o}},t,n,i)}},{key:"isLeftFlyoutOpen",value:function(){return this.props.enablePaletteLayout!==nt&&(!(this.props.enablePaletteLayout!==E||!this.props.leftFlyoutIsOpen)||!(this.props.enablePaletteLayout!==I||!this.props.paletteIsOpen&&!this.props.enableNarrowPalette))}},{key:"isRightFlyoutOpen",value:function(){return this.props.rightFlyoutIsOpen}},{key:"generateLeftFlyout",value:function(){return this.props.enablePaletteLayout===E&&this.props.leftFlyoutIsOpen?a.createElement(rh,null):this.props.enablePaletteLayout===I?a.createElement(yn,{canvasController:this.props.canvasController}):null}},{key:"generateRightFlyout",value:function(){return a.createElement(lh,{getCenterPanelWidth:this.getCenterPanelWidth,canvasController:this.props.canvasController})}},{key:"render",value:function(){this.logger.log("render");var e=a.createElement(ii,{canvasController:this.props.canvasController}),t=a.createElement(nh,{canvasController:this.props.canvasController,containingDivId:this.containingDivId}),n=this.isRightFlyoutOpen()?this.generateRightFlyout():null,i=this.isLeftFlyoutOpen(),o=i?this.generateLeftFlyout():null,r=this.generateTopCenterBottom(),s=null;if(this.props.enableLeftFlyoutUnderToolbar)if(this.props.enableRightFlyoutUnderToolbar){var l=i&&o?"auto ":"";l+="1fr",l+=this.props.rightFlyoutIsOpen?" auto":"";var c=this.props.toolbarIsOpen?"auto 1fr":"1fr",u=a.createElement("div",{id:this.containingDivId,className:"common-canvas-grid-horizontal",style:{gridTemplateColumns:l}},o,r,n);s=a.createElement("div",{className:"common-canvas-grid-vertical",style:{gridTemplateRows:c}},t,u)}else{var d=this.props.rightFlyoutIsOpen?"1fr auto":"1fr",h=this.props.toolbarIsOpen?"auto 1fr":"1fr",p=i?"auto 1fr":"1fr",g=a.createElement("div",{className:"common-canvas-grid-vertical",style:{gridTemplateRows:h}},t,a.createElement("div",{id:this.containingDivId,className:"common-canvas-grid-horizontal",style:{gridTemplateColumns:p}},o,r));s=a.createElement("div",{className:"common-canvas-grid-horizontal",style:{gridTemplateColumns:d}},g,n)}else if(this.props.enableRightFlyoutUnderToolbar){var f=i?"auto 1fr":"1fr",v=this.props.toolbarIsOpen?"auto 1fr":"1fr",y=this.props.rightFlyoutIsOpen?"1fr auto":"1fr",m=a.createElement("div",{className:"common-canvas-grid-vertical",style:{gridTemplateRows:v}},t,a.createElement("div",{id:this.containingDivId,className:"common-canvas-grid-horizontal",style:{gridTemplateColumns:y}},r,n));s=a.createElement("div",{className:"common-canvas-grid-horizontal",style:{gridTemplateColumns:f}},o,m)}else{var b="";b+=this.props.toolbarIsOpen?"auto":"",b+=" 1fr";var k=i&&o?"auto ":"";k+="1fr",k+=this.props.rightFlyoutIsOpen?" auto":"";var x=a.createElement("div",{className:"common-canvas-grid-vertical",style:{gridTemplateRows:b}},t,a.createElement("div",{id:this.containingDivId},r));s=a.createElement("div",{className:"common-canvas-grid-horizontal",style:{gridTemplateColumns:k}},o,x,n)}var C=this.props.enablePaletteLayout===nt&&this.props.paletteIsOpen?a.createElement(ei,{canvasController:this.props.canvasController,containingDivId:this.containingDivId}):null,P=this.generateClass();return a.createElement("div",{className:P,onDragOver:this.onDragOver,onDrop:this.onDrop},s,C,e)}}])}(a.Component),bh=s(function(e,t){return{enableParentClass:e.canvasconfig.enableParentClass,enableEditingActions:e.canvasconfig.enableEditingActions,enablePaletteLayout:e.canvasconfig.enablePaletteLayout,enableNarrowPalette:e.canvasconfig.enableNarrowPalette,enableLeftFlyoutUnderToolbar:e.canvasconfig.enableLeftFlyoutUnderToolbar,enableRightFlyoutUnderToolbar:e.canvasconfig.enableRightFlyoutUnderToolbar,enableRightFlyoutDragToResize:e.canvasconfig.enableRightFlyoutDragToResize,toolbarIsOpen:e.canvasconfig.enableToolbarLayout!==E,paletteIsOpen:e.palette.isOpen,topPanelIsOpen:e.toppanel.isOpen,bottomPanelIsOpen:e.bottompanel.isOpen,leftFlyoutIsOpen:e.leftflyout.isOpen,rightFlyoutIsOpen:e.rightflyout.isOpen}})(mh);function kh(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(kh=function(){return!!e})()}var xh=c(function(n){function s(e){var n,i,a,l;return t(this,s),i=this,l=[e],a=o(a=s),(n=r(i,kh()?Reflect.construct(a,l||[],o(i).constructor):a.apply(i,l))).logger=new gt(["CommonCanvas"]),n.logger.log("constructor"),n.initializeController=n.initializeController.bind(n),e.canvasController.setIntl(e.intl),n.initializeController(e),n}return i(s,n),e(s,[{key:"componentDidUpdate",value:function(){this.logger.log("componentDidUpdate"),this.initializeController(this.props)}},{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.setLeftFlyoutConfig({content:e.leftFlyoutContent,isOpen:e.showLeftFlyout}),e.canvasController.setRightFlyoutConfig({content:e.rightFlyoutContent,isOpen:e.showRightFlyout}),e.canvasController.setBottomPanelConfig({content:e.bottomPanelContent,isOpen:e.showBottomPanel}),e.canvasController.setTopPanelConfig({content:e.topPanelContent,isOpen:e.showTopPanel}),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:"render",value:function(){return this.logger.log("render"),a.createElement(l,{store:this.props.canvasController.getStore()},a.createElement(bh,{canvasController:this.props.canvasController}))}}])}(a.Component));export{yn as P,xh as c};
2
- //# sourceMappingURL=common-canvas-7e31f7ac.js.map