@zklogic/draw.io
Version:
Draw.IO - Graph Editor integration in Angular-cli
1 lines • 133 kB
JavaScript
Format=function(e,t){this.editorUi=e,this.container=t},Format.inactiveTabBackgroundColor="#f1f3f4",Format.classicFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 10 2 L 5 8 L 10 14 Z M 0 8 L 24 8" stroke="#404040" fill="#404040"/>',32,20),Format.classicThinFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 8 4 L 3 8 L 8 12 Z M 0 8 L 24 8" stroke="#404040" fill="#404040"/>',32,20),Format.openFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 8 0 L 0 8 L 8 16 M 0 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.openThinFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 8 4 L 0 8 L 8 12 M 0 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.openAsyncFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 8 4 L 0 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.blockFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 8 2 L 8 14 Z M 0 8 L 24 8" stroke="#404040" fill="#404040"/>',32,20),Format.blockThinFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 8 4 L 8 12 Z M 0 8 L 24 8" stroke="#404040" fill="#404040"/>',32,20),Format.asyncFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 6 8 L 6 4 L 0 8 L 24 8" stroke="#404040" fill="#404040"/>',32,20),Format.ovalFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 A 5 5 0 0 1 5 3 A 5 5 0 0 1 11 8 A 5 5 0 0 1 5 13 A 5 5 0 0 1 0 8 Z M 10 8 L 24 8" stroke="#404040" fill="#404040"/>',32,20),Format.diamondFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 6 2 L 12 8 L 6 14 Z M 0 8 L 24 8" stroke="#404040" fill="#404040"/>',32,20),Format.diamondThinFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 8 3 L 16 8 L 8 13 Z M 0 8 L 24 8" stroke="#404040" fill="#404040"/>',32,20),Format.classicMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 10 2 L 5 8 L 10 14 Z M 5 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.classicThinMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 8 4 L 5 8 L 8 12 Z M 5 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.blockMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 8 2 L 8 14 Z M 8 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.blockThinMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 8 4 L 8 12 Z M 8 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.asyncMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 6 8 L 6 4 L 0 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.ovalMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 A 5 5 0 0 1 5 3 A 5 5 0 0 1 11 8 A 5 5 0 0 1 5 13 A 5 5 0 0 1 0 8 Z M 10 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.diamondMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 6 2 L 12 8 L 6 14 Z M 12 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.diamondThinMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 8 3 L 16 8 L 8 13 Z M 16 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.boxMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 3 L 10 3 L 10 13 L 0 13 Z M 10 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.halfCircleMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 3 A 5 5 0 0 1 5 8 A 5 5 0 0 1 0 13 M 5 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.dashMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 2 L 12 14 M 0 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.crossMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 2 L 12 14 M 12 2 L 0 14 M 0 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.circlePlusMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 A 6 6 0 0 1 6 2 A 6 6 0 0 1 12 8 A 6 6 0 0 1 6 14 A 6 6 0 0 1 0 8 Z M 6 2 L 6 14 M 0 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.circleMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 A 6 6 0 0 1 6 2 A 6 6 0 0 1 12 8 A 6 6 0 0 1 6 14 A 6 6 0 0 1 0 8 Z M 12 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.ERmandOneMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 6 2 L 6 14 M 9 2 L 9 14 M 0 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.ERmanyMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 2 L 12 8 L 0 14 M 0 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.ERoneToManyMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 2 L 12 8 L 0 14 M 15 2 L 15 14 M 0 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.ERzeroToOneMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 8 8 A 5 5 0 0 1 13 3 A 5 5 0 0 1 18 8 A 5 5 0 0 1 13 13 A 5 5 0 0 1 8 8 Z M 0 8 L 8 8 M 18 8 L 24 8 M 4 3 L 4 13" stroke="#404040" fill="transparent"/>',32,20),Format.ERzeroToManyMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 8 8 A 5 5 0 0 1 13 3 A 5 5 0 0 1 18 8 A 5 5 0 0 1 13 13 A 5 5 0 0 1 8 8 Z M 0 8 L 8 8 M 18 8 L 24 8 M 0 3 L 8 8 L 0 13" stroke="#404040" fill="transparent"/>',32,20),Format.EROneMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 5 2 L 5 14 M 0 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.baseDashMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 2 L 0 14 M 0 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.doubleBlockMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 8 2 L 8 14 Z M 8 8 L 16 2 L 16 14 Z M 16 8 L 24 8" stroke="#404040" fill="transparent"/>',32,20),Format.doubleBlockFilledMarkerImage=Graph.createSvgImage(20,22,'<path transform="translate(4,2)" stroke-width="2" d="M 0 8 L 8 2 L 8 14 Z M 8 8 L 16 2 L 16 14 Z M 16 8 L 24 8" stroke="#404040" fill="#404040"/>',32,20),Format.processMenuIcon=function(e,t){var n=e.getElementsByTagName("img");return n.length>0&&(Editor.isDarkMode()&&(n[0].style.filter="invert(100%)"),n[0].className="geIcon",n[0].style.padding="0px",n[0].style.margin="0 0 0 2px",null!=t&&mxUtils.setPrefixedStyle(n[0].style,"transform",t)),e},Format.prototype.labelIndex=0,Format.prototype.diagramIndex=0,Format.prototype.currentIndex=0,Format.prototype.showCloseButton=!0,Format.prototype.init=function(){var e=this.editorUi,t=e.editor,n=t.graph;this.update=mxUtils.bind(this,(function(e,t){this.refresh()})),n.getSelectionModel().addListener(mxEvent.CHANGE,this.update),n.getModel().addListener(mxEvent.CHANGE,this.update),n.addListener(mxEvent.EDITING_STARTED,this.update),n.addListener(mxEvent.EDITING_STOPPED,this.update),n.getView().addListener("unitChanged",this.update),t.addListener("autosaveChanged",this.update),n.addListener(mxEvent.ROOT,this.update),e.addListener("styleChanged",this.update),this.refresh()},Format.prototype.clear=function(){if(this.container.innerHTML="",null!=this.panels)for(var e=0;e<this.panels.length;e++)this.panels[e].destroy();this.panels=[]},Format.prototype.refresh=function(){null!=this.pendingRefresh&&(window.clearTimeout(this.pendingRefresh),this.pendingRefresh=null),this.pendingRefresh=window.setTimeout(mxUtils.bind(this,(function(){this.immediateRefresh()})))},Format.prototype.immediateRefresh=function(){if("0px"!=this.container.style.width){this.clear();var e=this.editorUi,t=e.editor.graph,n=document.createElement("div");n.style.whiteSpace="nowrap",n.style.color="rgb(112, 112, 112)",n.style.textAlign="left",n.style.cursor="default";var l=document.createElement("div");l.className="geFormatSection",l.style.textAlign="center",l.style.fontWeight="bold",l.style.paddingTop="8px",l.style.fontSize="13px",l.style.borderWidth="0px 0px 1px 1px",l.style.borderStyle="solid",l.style.display="inline-block",l.style.height="25px",l.style.overflow="hidden",l.style.width="100%",this.container.appendChild(n),mxEvent.addListener(l,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,(function(e){e.preventDefault()})));var s=e.getSelectionState(),i=s.containsLabel,a=null,o=null,r=mxUtils.bind(this,(function(e,n,l,s){var r=mxUtils.bind(this,(function(s){a!=e&&(i?this.labelIndex=l:t.isSelectionEmpty()?this.diagramIndex=l:this.currentIndex=l,null!=a&&(a.style.backgroundColor=Format.inactiveTabBackgroundColor,a.style.borderBottomWidth="1px"),(a=e).style.backgroundColor="",a.style.borderBottomWidth="0px",o!=n&&(null!=o&&(o.style.display="none"),(o=n).style.display=""))}));mxEvent.addListener(e,"click",r),mxEvent.addListener(e,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,(function(e){e.preventDefault()}))),(s&&null==a||l==(i?this.labelIndex:t.isSelectionEmpty()?this.diagramIndex:this.currentIndex))&&r()})),d=0;if(t.isSelectionEmpty()){mxUtils.write(l,mxResources.get("diagram")),l.style.borderLeftWidth="0px",n.appendChild(l);var u=n.cloneNode(!1);if(this.panels.push(new DiagramFormatPanel(this,e,u)),this.container.appendChild(u),null!=Editor.styles&&(u.style.display="none",l.style.width=this.showCloseButton?"106px":"50%",l.style.cursor="pointer",l.style.backgroundColor=Format.inactiveTabBackgroundColor,(c=l.cloneNode(!1)).style.borderLeftWidth="1px",c.style.borderRightWidth="1px",c.style.backgroundColor=Format.inactiveTabBackgroundColor,r(l,u,d++),(p=n.cloneNode(!1)).style.display="none",mxUtils.write(c,mxResources.get("style")),n.appendChild(c),this.panels.push(new DiagramStylePanel(this,e,p)),this.container.appendChild(p),r(c,p,d++)),this.showCloseButton){(c=l.cloneNode(!1)).style.borderLeftWidth="1px",c.style.borderRightWidth="1px",c.style.borderBottomWidth="1px",c.style.backgroundColor=Format.inactiveTabBackgroundColor,c.style.position="absolute",c.style.right="0px",c.style.top="0px",c.style.width="25px";var m=document.createElement("img");m.setAttribute("border","0"),m.setAttribute("src",Dialog.prototype.closeImage),m.setAttribute("title",mxResources.get("hide")),m.style.position="absolute",m.style.display="block",m.style.right="0px",m.style.top="8px",m.style.cursor="pointer",m.style.marginTop="1px",m.style.marginRight="6px",m.style.border="1px solid transparent",m.style.padding="1px",m.style.opacity=.5,c.appendChild(m),mxEvent.addListener(m,"click",(function(){e.actions.get("formatPanel").funct()})),n.appendChild(c)}}else if(t.isEditing())mxUtils.write(l,mxResources.get("text")),n.appendChild(l),this.panels.push(new TextFormatPanel(this,e,n));else{l.style.backgroundColor=Format.inactiveTabBackgroundColor,l.style.borderLeftWidth="1px",l.style.cursor="pointer",l.style.width=i||0==s.cells.length?"50%":"33.3%";var c,p,g=(c=l.cloneNode(!1)).cloneNode(!1);c.style.backgroundColor=Format.inactiveTabBackgroundColor,g.style.backgroundColor=Format.inactiveTabBackgroundColor,i?c.style.borderLeftWidth="0px":(l.style.borderLeftWidth="0px",mxUtils.write(l,mxResources.get("style")),n.appendChild(l),(p=n.cloneNode(!1)).style.display="none",this.panels.push(new StyleFormatPanel(this,e,p)),this.container.appendChild(p),r(l,p,d++)),mxUtils.write(c,mxResources.get("text")),n.appendChild(c);var h=n.cloneNode(!1);h.style.display="none",this.panels.push(new TextFormatPanel(this,e,h)),this.container.appendChild(h),mxUtils.write(g,mxResources.get("arrange")),n.appendChild(g);var x=n.cloneNode(!1);x.style.display="none",this.panels.push(new ArrangePanel(this,e,x)),this.container.appendChild(x),s.cells.length>0?r(c,h,d++):c.style.display="none",r(g,x,d++,!0)}}},BaseFormatPanel=function(e,t,n){this.format=e,this.editorUi=t,this.container=n,this.listeners=[]},BaseFormatPanel.prototype.buttonBackgroundColor="white",BaseFormatPanel.prototype.installInputHandler=function(e,t,n,l,s,i,a,o){i=null!=i?i:"",o=null!=o&&o;var r=this.editorUi,d=r.editor.graph;l=null!=l?l:1,s=null!=s?s:999;var u=null,m=!1,c=mxUtils.bind(this,(function(c){var p=o?parseFloat(e.value):parseInt(e.value);if(isNaN(p)||t!=mxConstants.STYLE_ROTATION||(p=mxUtils.mod(Math.round(100*p),36e3)/100),p=Math.min(s,Math.max(l,isNaN(p)?n:p)),d.cellEditor.isContentEditing()&&a)m||(m=!0,null!=u&&(d.cellEditor.restoreSelection(u),u=null),a(p),e.value=p+i,m=!1);else if(p!=mxUtils.getValue(r.getSelectionState().style,t,n)){d.isEditing()&&d.stopEditing(!0),d.getModel().beginUpdate();try{var g=r.getSelectionState().cells;d.setCellStyles(t,p,g),t==mxConstants.STYLE_FONTSIZE&&d.updateLabelElements(g,(function(e){e.style.fontSize=p+"px",e.removeAttribute("size")}));for(var h=0;h<g.length;h++)0==d.model.getChildCount(g[h])&&d.autoSizeCell(g[h],!1);r.fireEvent(new mxEventObject("styleChanged","keys",[t],"values",[p],"cells",g))}finally{d.getModel().endUpdate()}}e.value=p+i,mxEvent.consume(c)}));return a&&d.cellEditor.isContentEditing()&&(mxEvent.addListener(e,"mousedown",(function(){document.activeElement==d.cellEditor.textarea&&(u=d.cellEditor.saveSelection())})),mxEvent.addListener(e,"touchstart",(function(){document.activeElement==d.cellEditor.textarea&&(u=d.cellEditor.saveSelection())}))),mxEvent.addListener(e,"change",c),mxEvent.addListener(e,"blur",c),c},BaseFormatPanel.prototype.createPanel=function(){var e=document.createElement("div");return e.className="geFormatSection",e.style.padding="12px 0px 12px 14px",e},BaseFormatPanel.prototype.createTitle=function(e){var t=document.createElement("div");return t.style.padding="0px 0px 6px 0px",t.style.whiteSpace="nowrap",t.style.overflow="hidden",t.style.width="200px",t.style.fontWeight="bold",mxUtils.write(t,e),t},BaseFormatPanel.prototype.addAction=function(e,t){var n=this.editorUi.actions.get(t),l=null;if(null!=n&&n.isEnabled()){l=mxUtils.button(n.label,(function(e){n.funct(e,e)}));var s=null!=n.shortcut?" ("+n.shortcut+")":"";l.setAttribute("title",n.label+s),l.style.marginBottom="2px",l.style.width="210px",e.appendChild(l),result=!0}return l},BaseFormatPanel.prototype.addActions=function(e,t){for(var n=null,l=0,s=0;s<t.length;s++){var i=this.addAction(e,t[s]);null!=i&&(l++,0==mxUtils.mod(l,2)&&(n.style.marginRight="2px",n.style.width="104px",i.style.width="104px"),n=i)}return l>0&&mxUtils.br(e),l},BaseFormatPanel.prototype.createStepper=function(e,t,n,l,s,i,a){l=null!=l?l:9;var o=10*(n=null!=n?n:1),r=document.createElement("div");mxUtils.setPrefixedStyle(r.style,"borderRadius","3px"),r.style.border="1px solid rgb(192, 192, 192)",r.style.position="absolute";var d=document.createElement("div");d.style.borderBottom="1px solid rgb(192, 192, 192)",d.style.position="relative",d.style.height=l+"px",d.style.width="10px",d.className="geBtnUp",r.appendChild(d);var u=d.cloneNode(!1);if(u.style.border="none",u.style.height=l+"px",u.className="geBtnDown",r.appendChild(u),mxEvent.addGestureListeners(u,(function(e){mxEvent.consume(e)}),null,(function(l){""==e.value&&(e.value=i||"2");var s=a?parseFloat(e.value):parseInt(e.value);isNaN(s)||(e.value=s-(mxEvent.isShiftDown(l)?o:n),null!=t&&t(l)),mxEvent.consume(l)})),mxEvent.addGestureListeners(d,(function(e){mxEvent.consume(e)}),null,(function(l){""==e.value&&(e.value=i||"0");var s=a?parseFloat(e.value):parseInt(e.value);isNaN(s)||(e.value=s+(mxEvent.isShiftDown(l)?o:n),null!=t&&t(l)),mxEvent.consume(l)})),s){var m=null;mxEvent.addGestureListeners(r,(function(e){mxEvent.consume(e)}),null,(function(e){if(null!=m){try{m.select()}catch(e){}m=null,mxEvent.consume(e)}}))}else mxEvent.addListener(r,"click",(function(e){mxEvent.consume(e)}));return r},BaseFormatPanel.prototype.createOption=function(e,t,n,l,s){var i=document.createElement("div");i.style.padding="3px 0px 3px 0px",i.style.whiteSpace="nowrap",i.style.textOverflow="ellipsis",i.style.overflow="hidden",i.style.width="200px",i.style.height="18px";var a=document.createElement("input");a.setAttribute("type","checkbox"),a.style.margin="1px 6px 0px 0px",a.style.verticalAlign="top",i.appendChild(a);var o=document.createElement("span");o.style.verticalAlign="top",mxUtils.write(o,e),i.appendChild(o);var r=!1,d=t(),u=function(e){r||(r=!0,e?(a.setAttribute("checked","checked"),a.defaultChecked=!0,a.checked=!0):(a.removeAttribute("checked"),a.defaultChecked=!1,a.checked=!1),d!=e&&(d=e,t()!=d&&n(d)),r=!1)};return mxEvent.addListener(i,"click",(function(e){if("disabled"!=a.getAttribute("disabled")){var t=mxEvent.getSource(e);t!=i&&t!=o||(a.checked=!a.checked),u(a.checked)}})),u(d),null!=l&&(l.install(u),this.listeners.push(l)),null!=s&&s(i),i},BaseFormatPanel.prototype.createCellOption=function(e,t,n,l,s,i,a,o,r){var d=this.editorUi,u=d.editor.graph;l=null!=l?"null"==l?null:l:1,s=null!=s?"null"==s?null:s:0;var m=null!=r?u.getCommonStyle(r):d.getSelectionState().style;return this.createOption(e,(function(){return mxUtils.getValue(m,t,n)!=s}),(function(e){if(o&&u.stopEditing(),null!=a)a.funct();else{u.getModel().beginUpdate();try{var n=null!=r?r:d.getSelectionState().cells,m=e?l:s;u.setCellStyles(t,m,n),null!=i&&i(n,m),d.fireEvent(new mxEventObject("styleChanged","keys",[t],"values",[m],"cells",n))}finally{u.getModel().endUpdate()}}}),{install:function(e){this.listener=function(){e(mxUtils.getValue(m,t,n)!=s)},u.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){u.getModel().removeListener(this.listener)}})},BaseFormatPanel.prototype.createColorOption=function(e,t,n,l,s,i,a,o){var r=document.createElement("div");r.style.padding="3px 0px 3px 0px",r.style.whiteSpace="nowrap",r.style.overflow="hidden",r.style.width="200px",r.style.height="18px";var d=document.createElement("input");d.setAttribute("type","checkbox"),d.style.margin="1px 6px 0px 0px",d.style.verticalAlign="top",a||r.appendChild(d);var u=document.createElement("span");u.style.verticalAlign="top",mxUtils.write(u,e),r.appendChild(u);var m="Shift+Click for Color Dropper",c=t(),p=!1,g=null,h=function(e,s,r){if(!p){var u="null"==l?null:l;p=!0;var h=null!=(e=/(^#?[a-zA-Z0-9]*$)/.test(e)?e:u)&&e!=mxConstants.NONE?e:u,x=document.createElement("div");if(x.style.width="36px",x.style.height="12px",x.style.margin="3px",x.style.border="1px solid black",x.style.backgroundColor="default"==h?o:h,g.innerHTML="",g.appendChild(x),null!=e&&e!=mxConstants.NONE&&e.length>1&&"string"==typeof e){var y="#"==e.charAt(0)?e.substring(1).toUpperCase():e,C=ColorDialog.prototype.colorNames[y];g.setAttribute("title",null!=C?C+" ("+m+")":m)}null!=e&&e!=mxConstants.NONE?(d.setAttribute("checked","checked"),d.defaultChecked=!0,d.checked=!0):(d.removeAttribute("checked"),d.defaultChecked=!1,d.checked=!1),g.style.display=d.checked||a?"":"none",null!=i&&i("null"==e?null:e),c=e,s||(r||a||t()!=c)&&n("null"==c?null:c,c),p=!1}},x=document.createElement("input");x.setAttribute("type","color"),x.style.visibility="hidden",x.style.width="0px",x.style.height="0px",x.style.border="none",r.appendChild(x),(g=mxUtils.button("",mxUtils.bind(this,(function(e){var t=c;"default"==t&&(t=o),!mxEvent.isShiftDown(e)||mxClient.IS_IE||mxClient.IS_IE11?this.editorUi.pickColor(t,(function(e){h(e,null,!0)}),o):(x.value=t,x.click(),mxEvent.addListener(x,"input",(function(){h(x.value,null,!0)}))),mxEvent.consume(e)})))).style.position="absolute",g.style.marginTop="-3px",g.style.left="178px",g.style.height="22px",g.className="geColorBtn",g.style.display=d.checked||a?"":"none",r.appendChild(g);var y=null!=c&&"string"==typeof c&&"#"==c.charAt(0)?c.substring(1).toUpperCase():c,C=ColorDialog.prototype.colorNames[y];return g.setAttribute("title",null!=C?C+" ("+m+")":m),mxEvent.addListener(r,"click",(function(e){var t=mxEvent.getSource(e);t!=d&&"INPUT"==t.nodeName||(t!=d&&(d.checked=!d.checked),d.checked||null==c||c==mxConstants.NONE||l==mxConstants.NONE||(l=c),h(d.checked?l:mxConstants.NONE))})),h(c,!0),null!=s&&(s.install(h),this.listeners.push(s)),r},BaseFormatPanel.prototype.createCellColorOption=function(e,t,n,l,s,i){var a=this.editorUi,o=a.editor.graph;return this.createColorOption(e,(function(){var e=o.view.getState(a.getSelectionState().cells[0]);return null!=e?mxUtils.getValue(e.style,t,null):null}),(function(e,n){o.getModel().beginUpdate();try{var l=a.getSelectionState().cells;o.setCellStyles(t,e,l),null!=s&&s(e),a.fireEvent(new mxEventObject("styleChanged","keys",[t],"values",[e],"cells",l))}finally{o.getModel().endUpdate()}}),n||mxConstants.NONE,{install:function(e){this.listener=function(){var n=o.view.getState(a.getSelectionState().cells[0]);null!=n&&e(mxUtils.getValue(n.style,t,null),!0)},o.getModel().addListener(mxEvent.CHANGE,this.listener)},destroy:function(){o.getModel().removeListener(this.listener)}},l,null,i)},BaseFormatPanel.prototype.addArrow=function(e,t){t=null!=t?t:10;var n=document.createElement("div");n.style.display="inline-block",n.style.paddingRight="4px",n.style.padding="6px";var l,s=10-t;2==s?n.style.paddingTop="6px":s>0?n.style.paddingTop=6-s+"px":n.style.marginTop="-2px",n.style.height=t+"px",n.style.borderLeft="1px solid #a0a0a0",(l=document.createElement("img")).setAttribute("border","0"),l.setAttribute("valign","middle"),l.setAttribute("src",Toolbar.prototype.dropDownImage),n.appendChild(l),(l=n.getElementsByTagName("img")[0]).style.position="relative",l.style.left="1px",l.style.top=mxClient.IS_FF?"0px":"-4px",mxUtils.setOpacity(n,70);var i=e.getElementsByTagName("div")[0];return null!=i&&(i.style.paddingRight="6px",i.style.marginLeft="4px",i.style.marginTop="-1px",i.style.display="inline-block",mxUtils.setOpacity(i,60)),mxUtils.setOpacity(e,100),e.style.border="1px solid #a0a0a0",e.style.backgroundColor=this.buttonBackgroundColor,e.style.backgroundImage="none",e.style.width="auto",e.className+=" geColorBtn",mxUtils.setPrefixedStyle(e.style,"borderRadius","3px"),e.appendChild(n),i},BaseFormatPanel.prototype.addUnitInput=function(e,t,n,l,s,i,a,o,r){a=null!=a?a:0;var d=document.createElement("input");d.style.position="absolute",d.style.textAlign="right",d.style.marginTop="-2px",d.style.left=228-n-l+"px",d.style.width=l+"px",d.style.height="21px",d.style.border="1px solid rgb(160, 160, 160)",d.style.borderRadius="4px",d.style.boxSizing="border-box",e.appendChild(d);var u=this.createStepper(d,s,i,null,o,null,r);return u.style.marginTop=a-2+"px",u.style.left=228-n+"px",e.appendChild(u),d},BaseFormatPanel.prototype.createRelativeOption=function(e,t,n,l,s){n=null!=n?n:52;var i=this.editorUi,a=i.editor.graph,o=this.createPanel();o.style.paddingTop="10px",o.style.paddingBottom="10px",mxUtils.write(o,e),o.style.fontWeight="bold";var r=mxUtils.bind(this,(function(e){if(null!=l)l(d);else{var n=parseInt(d.value);n=Math.min(100,Math.max(0,isNaN(n)?100:n));var s=a.view.getState(i.getSelectionState().cells[0]);if(null!=s&&n!=mxUtils.getValue(s.style,t,100)){100==n&&(n=null);var o=i.getSelectionState().cells;a.setCellStyles(t,n,o),this.editorUi.fireEvent(new mxEventObject("styleChanged","keys",[t],"values",[n],"cells",o))}d.value=(null!=n?n:"100")+" %"}mxEvent.consume(e)})),d=this.addUnitInput(o,"%",16,n,r,10,-15,null!=l);if(null!=t){var u=mxUtils.bind(this,(function(e,n,l){if(l||d!=document.activeElement){var s=i.getSelectionState(),a=parseInt(mxUtils.getValue(s.style,t,100));d.value=isNaN(a)?"":a+" %"}}));mxEvent.addListener(d,"keydown",(function(e){13==e.keyCode?(a.container.focus(),mxEvent.consume(e)):27==e.keyCode&&(u(null,null,!0),a.container.focus(),mxEvent.consume(e))})),a.getModel().addListener(mxEvent.CHANGE,u),this.listeners.push({destroy:function(){a.getModel().removeListener(u)}}),u()}return mxEvent.addListener(d,"blur",r),mxEvent.addListener(d,"change",r),null!=s&&s(d),o},BaseFormatPanel.prototype.addLabel=function(e,t,n,l){l=null!=l?l:61;var s=document.createElement("div");mxUtils.write(s,t),s.style.position="absolute",s.style.left=240-n-l+"px",s.style.width=l+"px",s.style.marginTop="6px",s.style.textAlign="center",e.appendChild(s)},BaseFormatPanel.prototype.addKeyHandler=function(e,t){mxEvent.addListener(e,"keydown",mxUtils.bind(this,(function(e){13==e.keyCode?(this.editorUi.editor.graph.container.focus(),mxEvent.consume(e)):27==e.keyCode&&(null!=t&&t(null,null,!0),this.editorUi.editor.graph.container.focus(),mxEvent.consume(e))})))},BaseFormatPanel.prototype.styleButtons=function(e){for(var t=0;t<e.length;t++)mxUtils.setPrefixedStyle(e[t].style,"borderRadius","3px"),mxUtils.setOpacity(e[t],100),e[t].style.border="1px solid #a0a0a0",e[t].style.padding="4px",e[t].style.paddingTop="3px",e[t].style.paddingRight="1px",e[t].style.margin="1px",e[t].style.marginRight="2px",e[t].style.width="24px",e[t].style.height="20px",e[t].className+=" geColorBtn"},BaseFormatPanel.prototype.destroy=function(){if(null!=this.listeners){for(var e=0;e<this.listeners.length;e++)this.listeners[e].destroy();this.listeners=null}},ArrangePanel=function(e,t,n){BaseFormatPanel.call(this,e,t,n),this.init()},mxUtils.extend(ArrangePanel,BaseFormatPanel),ArrangePanel.prototype.init=function(){var e=this.editorUi.getSelectionState();if(e.cells.length>0&&(this.container.appendChild(this.addLayerOps(this.createPanel())),this.addGeometry(this.container),this.addEdgeGeometry(this.container),e.containsLabel&&0!=e.edges.length||this.container.appendChild(this.addAngle(this.createPanel())),e.containsLabel||0!=e.edges.length||"rectangle"==e.style.shape||"label"==e.style.shape||this.container.appendChild(this.addFlip(this.createPanel())),e.vertices.length>1&&(this.container.appendChild(this.addAlign(this.createPanel())),this.container.appendChild(this.addDistribute(this.createPanel()))),this.container.appendChild(this.addTable(this.createPanel()))),this.container.appendChild(this.addGroupOps(this.createPanel())),e.containsLabel){var t=document.createElement("div");t.style.width="100%",t.style.marginTop="0px",t.style.fontWeight="bold",t.style.padding="10px 0 0 14px",mxUtils.write(t,mxResources.get("style")),this.container.appendChild(t),new StyleFormatPanel(this.format,this.editorUi,this.container)}},ArrangePanel.prototype.addTable=function(e){var t=this.editorUi,n=t.editor.graph,l=t.getSelectionState();e.style.paddingTop="6px",e.style.paddingBottom="10px";var s=document.createElement("div");s.style.marginTop="2px",s.style.marginBottom="8px",s.style.fontWeight="bold",mxUtils.write(s,mxResources.get("table")),e.appendChild(s);var i=document.createElement("div");i.style.position="relative",i.style.paddingLeft="0px",i.style.borderWidth="0px",i.style.width="220px",i.className="geToolbarContainer";var a=n.isTable(l.vertices[0])||n.isTableRow(l.vertices[0])||n.isTableCell(l.vertices[0]),o=n.isStack(l.vertices[0])||n.isStackChild(l.vertices[0]),r=a,d=a;o&&(r=!(d="0"==(n.isStack(l.vertices[0])?l.style:n.getCellStyle(n.model.getParent(l.vertices[0]))).horizontalStack));var u=[];return r&&(u=u.concat([t.toolbar.addButton("geSprite-insertcolumnbefore",mxResources.get("insertColumnBefore"),mxUtils.bind(this,(function(){try{o?n.insertLane(l.vertices[0],!0):n.insertTableColumn(l.vertices[0],!0)}catch(e){t.handleError(e)}})),i),t.toolbar.addButton("geSprite-insertcolumnafter",mxResources.get("insertColumnAfter"),mxUtils.bind(this,(function(){try{o?n.insertLane(l.vertices[0],!1):n.insertTableColumn(l.vertices[0],!1)}catch(e){t.handleError(e)}})),i),t.toolbar.addButton("geSprite-deletecolumn",mxResources.get("deleteColumn"),mxUtils.bind(this,(function(){try{o?n.deleteLane(l.vertices[0]):n.deleteTableColumn(l.vertices[0])}catch(e){t.handleError(e)}})),i)])),d&&(u=u.concat([t.toolbar.addButton("geSprite-insertrowbefore",mxResources.get("insertRowBefore"),mxUtils.bind(this,(function(){try{o?n.insertLane(l.vertices[0],!0):n.insertTableRow(l.vertices[0],!0)}catch(e){t.handleError(e)}})),i),t.toolbar.addButton("geSprite-insertrowafter",mxResources.get("insertRowAfter"),mxUtils.bind(this,(function(){try{o?n.insertLane(l.vertices[0],!1):n.insertTableRow(l.vertices[0],!1)}catch(e){t.handleError(e)}})),i),t.toolbar.addButton("geSprite-deleterow",mxResources.get("deleteRow"),mxUtils.bind(this,(function(){try{o?n.deleteLane(l.vertices[0]):n.deleteTableRow(l.vertices[0])}catch(e){t.handleError(e)}})),i)])),u.length>0?(this.styleButtons(u),e.appendChild(i),u.length>3&&(u[2].style.marginRight="10px")):e.style.display="none",e},ArrangePanel.prototype.addLayerOps=function(e){return this.addActions(e,["toFront","toBack"]),this.addActions(e,["bringForward","sendBackward"]),e},ArrangePanel.prototype.addGroupOps=function(e){var t=this.editorUi,n=t.editor.graph,l=t.getSelectionState(),s=(l.cells[0],null);e.style.paddingTop="8px",e.style.paddingBottom="6px";var i=this.addActions(e,["group","ungroup"]);if(i+=this.addActions(e,["removeFromGroup"]),i+=this.addActions(e,["copySize","pasteSize"]),n.getSelectionCount()>0){if((s=mxUtils.button(mxResources.get("copyData"),(function(e){if(mxEvent.isShiftDown(e)){var l=n.getDataForCells(n.getSelectionCells()),s=new EmbedDialog(t,JSON.stringify(l,null,2),null,null,(function(){console.log(l),t.alert("Written to Console (Dev Tools)")}),mxResources.get("copyData"),null,"Console","data.json");t.showDialog(s.container,450,240,!0,!0),s.init()}else t.actions.get("copyData").funct(e)}))).setAttribute("title",mxResources.get("copyData")+" ("+this.editorUi.actions.get("copyData").shortcut+") Shift+Click to Extract Data"),s.style.width="210px",s.style.marginBottom="2px",e.appendChild(s),i++,null!=t.copiedValue&&l.cells.length>0){var a=mxUtils.button(mxResources.get("pasteData"),(function(e){t.actions.get("pasteData").funct(e)}));a.setAttribute("title",mxResources.get("pasteData")+" ("+this.editorUi.actions.get("pasteData").shortcut+")"),e.appendChild(a),i++,s.style.width="104px",s.style.marginBottom="2px",s.style.marginRight="2px",a.style.width="104px",a.style.marginBottom="2px"}mxUtils.br(e)}var o=this.addAction(e,"clearWaypoints");return null!=o&&(mxUtils.br(e),o.setAttribute("title",mxResources.get("clearWaypoints")+" ("+this.editorUi.actions.get("clearWaypoints").shortcut+") Shift+Click to Clear Anchor Points"),i++),0==(i+=this.addActions(e,["editData","editLink"]))&&(e.style.display="none"),e},ArrangePanel.prototype.addAlign=function(e){var t=this.editorUi.editor.graph;e.style.paddingTop="6px",e.style.paddingBottom="12px",e.appendChild(this.createTitle(mxResources.get("align")));var n=document.createElement("div");n.style.position="relative",n.style.whiteSpace="nowrap",n.style.paddingLeft="0px",n.style.borderWidth="0px",n.style.width="220px",n.className="geToolbarContainer";var l=this.editorUi.toolbar.addButton("geSprite-alignleft",mxResources.get("left"),(function(){t.alignCells(mxConstants.ALIGN_LEFT)}),n),s=this.editorUi.toolbar.addButton("geSprite-aligncenter",mxResources.get("center"),(function(){t.alignCells(mxConstants.ALIGN_CENTER)}),n),i=this.editorUi.toolbar.addButton("geSprite-alignright",mxResources.get("right"),(function(){t.alignCells(mxConstants.ALIGN_RIGHT)}),n),a=this.editorUi.toolbar.addButton("geSprite-aligntop",mxResources.get("top"),(function(){t.alignCells(mxConstants.ALIGN_TOP)}),n),o=this.editorUi.toolbar.addButton("geSprite-alignmiddle",mxResources.get("middle"),(function(){t.alignCells(mxConstants.ALIGN_MIDDLE)}),n),r=this.editorUi.toolbar.addButton("geSprite-alignbottom",mxResources.get("bottom"),(function(){t.alignCells(mxConstants.ALIGN_BOTTOM)}),n);return this.styleButtons([l,s,i,a,o,r]),i.style.marginRight="10px",e.appendChild(n),e},ArrangePanel.prototype.addFlip=function(e){var t=this.editorUi.editor.graph;e.style.paddingTop="6px",e.style.paddingBottom="10px";var n,l=document.createElement("div");return l.style.marginTop="2px",l.style.marginBottom="8px",l.style.fontWeight="bold",mxUtils.write(l,mxResources.get("flip")),e.appendChild(l),(n=mxUtils.button(mxResources.get("horizontal"),(function(e){t.toggleCellStyles(mxConstants.STYLE_FLIPH,!1)}))).setAttribute("title",mxResources.get("horizontal")),n.style.width="104px",n.style.marginRight="2px",e.appendChild(n),(n=mxUtils.button(mxResources.get("vertical"),(function(e){t.toggleCellStyles(mxConstants.STYLE_FLIPV,!1)}))).setAttribute("title",mxResources.get("vertical")),n.style.width="104px",e.appendChild(n),e},ArrangePanel.prototype.addDistribute=function(e){var t,n=this.editorUi.editor.graph;return e.style.paddingTop="6px",e.style.paddingBottom="12px",e.appendChild(this.createTitle(mxResources.get("distribute"))),(t=mxUtils.button(mxResources.get("horizontal"),(function(e){n.distributeCells(!0)}))).setAttribute("title",mxResources.get("horizontal")),t.style.width="104px",t.style.marginRight="2px",e.appendChild(t),(t=mxUtils.button(mxResources.get("vertical"),(function(e){n.distributeCells(!1)}))).setAttribute("title",mxResources.get("vertical")),t.style.width="104px",e.appendChild(t),e},ArrangePanel.prototype.addAngle=function(e){var t=this.editorUi,n=t.editor.graph,l=t.getSelectionState();e.style.paddingBottom="8px";var s=document.createElement("div");s.style.position="absolute",s.style.width="70px",s.style.marginTop="0px",s.style.fontWeight="bold";var i=null,a=null,o=null;if(!l.rotatable||l.table||l.row||l.cell?e.style.paddingTop="8px":(mxUtils.write(s,mxResources.get("angle")),e.appendChild(s),i=this.addUnitInput(e,"°",16,52,(function(){a.apply(this,arguments)})),mxUtils.br(e),e.style.paddingTop="10px"),!l.containsLabel){var r=mxResources.get("reverse");l.vertices.length>0&&l.edges.length>0?r=mxResources.get("turn")+" / "+r:l.vertices.length>0&&(r=mxResources.get("turn")),(o=mxUtils.button(r,(function(e){t.actions.get("turn").funct(e)}))).setAttribute("title",r+" ("+this.editorUi.actions.get("turn").shortcut+")"),o.style.width="210px",e.appendChild(o),null!=i&&(o.style.marginTop="8px")}if(null!=i){var d=mxUtils.bind(this,(function(e,n,s){if(s||document.activeElement!=i){l=t.getSelectionState();var a=parseFloat(mxUtils.getValue(l.style,mxConstants.STYLE_ROTATION,0));i.value=isNaN(a)?"":a+"°"}}));a=this.installInputHandler(i,mxConstants.STYLE_ROTATION,0,0,360,"°",null,!0),this.addKeyHandler(i,d),n.getModel().addListener(mxEvent.CHANGE,d),this.listeners.push({destroy:function(){n.getModel().removeListener(d)}}),d()}return e},BaseFormatPanel.prototype.getUnit=function(){switch(this.editorUi.editor.graph.view.unit){case mxConstants.POINTS:return"pt";case mxConstants.INCHES:return'"';case mxConstants.MILLIMETERS:return"mm";case mxConstants.METERS:return"m"}},BaseFormatPanel.prototype.inUnit=function(e){return this.editorUi.editor.graph.view.formatUnitText(e)},BaseFormatPanel.prototype.fromUnit=function(e){switch(this.editorUi.editor.graph.view.unit){case mxConstants.POINTS:return e;case mxConstants.INCHES:return e*mxConstants.PIXELS_PER_INCH;case mxConstants.MILLIMETERS:return e*mxConstants.PIXELS_PER_MM;case mxConstants.METERS:return e*mxConstants.PIXELS_PER_MM*1e3}},BaseFormatPanel.prototype.isFloatUnit=function(){return this.editorUi.editor.graph.view.unit!=mxConstants.POINTS},BaseFormatPanel.prototype.getUnitStep=function(){switch(this.editorUi.editor.graph.view.unit){case mxConstants.POINTS:return 1;case mxConstants.INCHES:return.1;case mxConstants.MILLIMETERS:return.5;case mxConstants.METERS:return.001}},ArrangePanel.prototype.addGeometry=function(e){var t,n,l,s,i=this,a=this.editorUi,o=a.editor.graph,r=o.getModel(),d=a.getSelectionState(),u=this.createPanel();u.style.paddingBottom="8px",(y=document.createElement("div")).style.position="absolute",y.style.width="50px",y.style.marginTop="0px",y.style.fontWeight="bold",mxUtils.write(y,mxResources.get("size")),u.appendChild(y);var m=this.addUnitInput(u,this.getUnit(),87,52,(function(){t.apply(this,arguments)}),this.getUnitStep(),null,null,this.isFloatUnit()),c=this.addUnitInput(u,this.getUnit(),16,52,(function(){n.apply(this,arguments)}),this.getUnitStep(),null,null,this.isFloatUnit()),p=document.createElement("div");p.className="geSprite geSprite-fit",p.setAttribute("title",mxResources.get("autosize")+" ("+this.editorUi.actions.get("autosize").shortcut+")"),p.style.position="relative",p.style.cursor="pointer",p.style.marginTop="-3px",p.style.border="0px",p.style.left="42px",mxUtils.setOpacity(p,50),mxEvent.addListener(p,"mouseenter",(function(){mxUtils.setOpacity(p,100)})),mxEvent.addListener(p,"mouseleave",(function(){mxUtils.setOpacity(p,50)})),mxEvent.addListener(p,"click",(function(){a.actions.get("autosize").funct()})),u.appendChild(p),d.row?(m.style.visibility="hidden",m.nextSibling.style.visibility="hidden"):this.addLabel(u,mxResources.get("width"),87),this.addLabel(u,mxResources.get("height"),16),mxUtils.br(u);var g=document.createElement("div");g.style.paddingTop="8px",g.style.paddingRight="20px",g.style.whiteSpace="nowrap",g.style.textAlign="right";var h=this.createCellOption(mxResources.get("constrainProportions"),mxConstants.STYLE_ASPECT,null,"fixed","null");h.style.width="210px",g.appendChild(h),d.cell||d.row?p.style.visibility="hidden":u.appendChild(g);var x=h.getElementsByTagName("input")[0];this.addKeyHandler(m,f),this.addKeyHandler(c,f),t=this.addGeometryHandler(m,(function(e,t,n){if(o.isTableCell(n))return o.setTableColumnWidth(n,t-e.width,!0),!0;e.width>0&&(t=Math.max(1,i.fromUnit(t)),x.checked&&(e.height=Math.round(e.height*t*100/e.width)/100),e.width=t)})),n=this.addGeometryHandler(c,(function(e,t,n){if(o.isTableCell(n)&&(n=o.model.getParent(n)),o.isTableRow(n))return o.setTableRowHeight(n,t-e.height),!0;e.height>0&&(t=Math.max(1,i.fromUnit(t)),x.checked&&(e.width=Math.round(e.width*t*100/e.height)/100),e.height=t)})),(d.resizable||d.row||d.cell)&&e.appendChild(u);var y,C=this.createPanel();C.style.paddingBottom="30px",(y=document.createElement("div")).style.position="absolute",y.style.width="70px",y.style.marginTop="0px",y.style.fontWeight="bold",mxUtils.write(y,mxResources.get("position")),C.appendChild(y);var E=this.addUnitInput(C,this.getUnit(),87,52,(function(){l.apply(this,arguments)}),this.getUnitStep(),null,null,this.isFloatUnit()),S=this.addUnitInput(C,this.getUnit(),16,52,(function(){s.apply(this,arguments)}),this.getUnitStep(),null,null,this.isFloatUnit());mxUtils.br(C),this.addLabel(C,mxResources.get("left"),87),this.addLabel(C,mxResources.get("top"),16);var f=mxUtils.bind(this,(function(e,t,n){(d=a.getSelectionState()).containsLabel||d.vertices.length!=o.getSelectionCount()||null==d.width||null==d.height?u.style.display="none":(u.style.display="",(n||document.activeElement!=m)&&(m.value=this.inUnit(d.width)+(""==d.width?"":" "+this.getUnit())),(n||document.activeElement!=c)&&(c.value=this.inUnit(d.height)+(""==d.height?"":" "+this.getUnit()))),d.vertices.length==o.getSelectionCount()&&null!=d.x&&null!=d.y?(C.style.display="",(n||document.activeElement!=E)&&(E.value=this.inUnit(d.x)+(""==d.x?"":" "+this.getUnit())),(n||document.activeElement!=S)&&(S.value=this.inUnit(d.y)+(""==d.y?"":" "+this.getUnit()))):C.style.display="none"}));if(this.addKeyHandler(E,f),this.addKeyHandler(S,f),r.addListener(mxEvent.CHANGE,f),this.listeners.push({destroy:function(){r.removeListener(f)}}),f(),l=this.addGeometryHandler(E,(function(e,t){t=i.fromUnit(t),e.relative?e.offset.x=t:e.x=t})),s=this.addGeometryHandler(S,(function(e,t){t=i.fromUnit(t),e.relative?e.offset.y=t:e.y=t})),d.movable){if(0==d.edges.length&&1==d.vertices.length&&r.isEdge(r.getParent(d.vertices[0]))){var v=o.getCellGeometry(d.vertices[0]);if(null!=v&&v.relative){var L=mxUtils.button(mxResources.get("center"),mxUtils.bind(this,(function(e){r.beginUpdate();try{(v=v.clone()).x=0,v.y=0,v.offset=new mxPoint,r.setGeometry(d.vertices[0],v)}finally{r.endUpdate()}})));L.setAttribute("title",mxResources.get("center")),L.style.width="210px",L.style.position="absolute",mxUtils.br(C),mxUtils.br(C),C.appendChild(L)}}e.appendChild(C)}},ArrangePanel.prototype.addGeometryHandler=function(e,t){var n=this.editorUi,l=n.editor.graph,s=null,i=this;function a(a){if(""!=e.value){var o=parseFloat(e.value);if(isNaN(o))e.value=s+" "+i.getUnit();else if(o!=s){l.getModel().beginUpdate();try{for(var r=n.getSelectionState().cells,d=0;d<r.length;d++)if(l.getModel().isVertex(r[d])){var u=l.getCellGeometry(r[d]);if(null!=u&&(u=u.clone(),!t(u,o,r[d]))){var m=l.view.getState(r[d]);null!=m&&l.isRecursiveVertexResize(m)&&l.resizeChildCells(r[d],u),l.getModel().setGeometry(r[d],u),l.constrainChildCells(r[d])}}}finally{l.getModel().endUpdate()}s=o,e.value=o+" "+i.getUnit()}}mxEvent.consume(a)}return mxEvent.addListener(e,"blur",a),mxEvent.addListener(e,"change",a),mxEvent.addListener(e,"focus",(function(){s=e.value})),a},ArrangePanel.prototype.addEdgeGeometryHandler=function(e,t){var n=this.editorUi,l=n.editor.graph,s=null;function i(i){if(""!=e.value){var a=parseFloat(e.value);if(isNaN(a))e.value=s+" pt";else if(a!=s){l.getModel().beginUpdate();try{for(var o=n.getSelectionState().cells,r=0;r<o.length;r++)if(l.getModel().isEdge(o[r])){var d=l.getCellGeometry(o[r]);null!=d&&(d=d.clone(),t(d,a),l.getModel().setGeometry(o[r],d))}}finally{l.getModel().endUpdate()}s=a,e.value=a+" pt"}}mxEvent.consume(i)}return mxEvent.addListener(e,"blur",i),mxEvent.addListener(e,"change",i),mxEvent.addListener(e,"focus",(function(){s=e.value})),i},ArrangePanel.prototype.addEdgeGeometry=function(e){var t,n,l,s,i=this.editorUi,a=i.editor.graph,o=i.getSelectionState(),r=this.createPanel();(g=document.createElement("div")).style.position="absolute",g.style.width="70px",g.style.marginTop="0px",g.style.fontWeight="bold",mxUtils.write(g,mxResources.get("width")),r.appendChild(g);var d=this.addUnitInput(r,"pt",12,44,(function(){u.apply(this,arguments)}));mxUtils.br(r),this.addKeyHandler(d,C);var u=mxUtils.bind(this,(function(e){var t=parseInt(d.value);if((t=Math.min(999,Math.max(1,isNaN(t)?1:t)))!=mxUtils.getValue(o.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth)){var n=i.getSelectionState().cells;a.setCellStyles("width",t,n),i.fireEvent(new mxEventObject("styleChanged","keys",["width"],"values",[t],"cells",n))}d.value=t+" pt",mxEvent.consume(e)}));mxEvent.addListener(d,"blur",u),mxEvent.addListener(d,"change",u),e.appendChild(r);var m=this.createPanel();m.style.paddingBottom="30px",(g=document.createElement("div")).style.position="absolute",g.style.width="70px",g.style.marginTop="0px",mxUtils.write(g,mxResources.get("linestart")),m.appendChild(g);var c=this.addUnitInput(m,"pt",87,52,(function(){l.apply(this,arguments)})),p=this.addUnitInput(m,"pt",16,52,(function(){s.apply(this,arguments)}));mxUtils.br(m),this.addLabel(m,mxResources.get("left"),87),this.addLabel(m,mxResources.get("top"),16),e.appendChild(m),this.addKeyHandler(c,C),this.addKeyHandler(p,C);var g,h=this.createPanel();h.style.paddingBottom="30px",(g=document.createElement("div")).style.position="absolute",g.style.width="70px",g.style.marginTop="0px",mxUtils.write(g,mxResources.get("lineend")),h.appendChild(g);var x=this.addUnitInput(h,"pt",87,52,(function(){t.apply(this,arguments)})),y=this.addUnitInput(h,"pt",16,52,(function(){n.apply(this,arguments)}));mxUtils.br(h),this.addLabel(h,mxResources.get("left"),87),this.addLabel(h,mxResources.get("top"),16),e.appendChild(h),this.addKeyHandler(x,C),this.addKeyHandler(y,C);var C=mxUtils.bind(this,(function(e,t,n){var l=(o=i.getSelectionState()).cells[0];if("link"==o.style.shape||"flexArrow"==o.style.shape){if(r.style.display="",n||document.activeElement!=d){var s=mxUtils.getValue(o.style,"width",mxCellRenderer.defaultShapes.flexArrow.prototype.defaultWidth);d.value=s+" pt"}}else r.style.display="none";if(1==o.cells.length&&a.model.isEdge(l)){var u=a.model.getGeometry(l);null!=u.sourcePoint&&null==a.model.getTerminal(l,!0)?(c.value=u.sourcePoint.x,p.value=u.sourcePoint.y):m.style.display="none",null!=u.targetPoint&&null==a.model.getTerminal(l,!1)?(x.value=u.targetPoint.x,y.value=u.targetPoint.y):h.style.display="none"}else m.style.display="none",h.style.display="none"}));l=this.addEdgeGeometryHandler(c,(function(e,t){e.sourcePoint.x=t})),s=this.addEdgeGeometryHandler(p,(function(e,t){e.sourcePoint.y=t})),t=this.addEdgeGeometryHandler(x,(function(e,t){e.targetPoint.x=t})),n=this.addEdgeGeometryHandler(y,(function(e,t){e.targetPoint.y=t})),a.getModel().addListener(mxEvent.CHANGE,C),this.listeners.push({destroy:function(){a.getModel().removeListener(C)}}),C()},TextFormatPanel=function(e,t,n){BaseFormatPanel.call(this,e,t,n),this.init()},mxUtils.extend(TextFormatPanel,BaseFormatPanel),TextFormatPanel.prototype.init=function(){this.container.style.borderBottom="none",this.addFont(this.container)},TextFormatPanel.prototype.addFont=function(e){var t=this.editorUi,n=t.editor.graph,l=t.getSelectionState(),s=this.createTitle(mxResources.get("font"));s.style.paddingLeft="14px",s.style.paddingTop="10px",s.style.paddingBottom="6px",e.appendChild(s);var i=this.createPanel();if(i.style.paddingTop="2px",i.style.paddingBottom="2px",i.style.position="relative",i.style.marginLeft="-2px",i.style.borderWidth="0px",i.className="geToolbarContainer",n.cellEditor.isContentEditing()){var a=i.cloneNode(),o=this.editorUi.toolbar.addMenu(mxResources.get("style"),mxResources.get("style"),!0,"formatBlock",a,null,!0);o.style.color="rgb(112, 112, 112)",o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.margin="0px",this.addArrow(o),o.style.width="200px",o.style.height="15px",o.getElementsByTagName("div")[0].style.cssFloat="right",e.appendChild(a)}e.appendChild(i);var r=this.createPanel();r.style.marginTop="8px",r.style.borderTop="1px solid #c0c0c0",r.style.paddingTop="6px",r.style.paddingBottom="6px";var d=this.editorUi.toolbar.addMenu("Helvetica",mxResources.get("fontFamily"),!0,"fontFamily",i,null,!0);d.style.color="rgb(112, 112, 112)",d.style.whiteSpace="nowrap",d.style.overflow="hidden",d.style.margin="0px",this.addArrow(d),d.style.width="200px",d.style.height="15px";var u=i.cloneNode(!1);u.style.marginLeft="-3px";var m=this.editorUi.toolbar.addItems(["bold","italic","underline"],u,!0);m[0].setAttribute("title",mxResources.get("bold")+" ("+this.editorUi.actions.get("bold").shortcut+")"),m[1].setAttribute("title",mxResources.get("italic")+" ("+this.editorUi.actions.get("italic").shortcut+")"),m[2].setAttribute("title",mxResources.get("underline")+" ("+this.editorUi.actions.get("underline").shortcut+")");var c=this.editorUi.toolbar.addItems(["vertical"],u,!0)[0];e.appendChild(u),this.styleButtons(m),this.styleButtons([c]);var p=i.cloneNode(!1);p.style.marginLeft="-3px",p.style.paddingBottom="0px";var g=function(e){return function(){return e()}},h=this.editorUi.toolbar.addButton("geSprite-left",mxResources.get("left"),n.cellEditor.isContentEditing()?function(e){n.cellEditor.alignText(mxConstants.ALIGN_LEFT,e),t.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_LEFT],"cells",l.cells))}:g(this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_LEFT])),p),x=this.editorUi.toolbar.addButton("geSprite-center",mxResources.get("center"),n.cellEditor.isContentEditing()?function(e){n.cellEditor.alignText(mxConstants.ALIGN_CENTER,e),t.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_CENTER],"cells",l.cells))}:g(this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_CENTER])),p),y=this.editorUi.toolbar.addButton("geSprite-right",mxResources.get("right"),n.cellEditor.isContentEditing()?function(e){n.cellEditor.alignText(mxConstants.ALIGN_RIGHT,e),t.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ALIGN],"values",[mxConstants.ALIGN_RIGHT],"cells",l.cells))}:g(this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_ALIGN],[mxConstants.ALIGN_RIGHT])),p);if(this.styleButtons([h,x,y]),n.cellEditor.isContentEditing()){var C=this.editorUi.toolbar.addButton("geSprite-removeformat",mxResources.get("strikethrough"),(function(){document.execCommand("strikeThrough",!1,null)}),u);this.styleButtons([C]),C.firstChild.style.background="url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIDBoMjR2MjRIMFYweiIvPjwvZGVmcz48Y2xpcFBhdGggaWQ9ImIiPjx1c2UgeGxpbms6aHJlZj0iI2EiIG92ZXJmbG93PSJ2aXNpYmxlIi8+PC9jbGlwUGF0aD48cGF0aCBjbGlwLXBhdGg9InVybCgjYikiIGZpbGw9IiMwMTAxMDEiIGQ9Ik03LjI0IDguNzVjLS4yNi0uNDgtLjM5LTEuMDMtLjM5LTEuNjcgMC0uNjEuMTMtMS4xNi40LTEuNjcuMjYtLjUuNjMtLjkzIDEuMTEtMS4yOS40OC0uMzUgMS4wNS0uNjMgMS43LS44My42Ni0uMTkgMS4zOS0uMjkgMi4xOC0uMjkuODEgMCAxLjU0LjExIDIuMjEuMzQuNjYuMjIgMS4yMy41NCAxLjY5Ljk0LjQ3LjQuODMuODggMS4wOCAxLjQzLjI1LjU1LjM4IDEuMTUuMzggMS44MWgtMy4wMWMwLS4zMS0uMDUtLjU5LS4xNS0uODUtLjA5LS4yNy0uMjQtLjQ5LS40NC0uNjgtLjItLjE5LS40NS0uMzMtLjc1LS40NC0uMy0uMS0uNjYtLjE2LTEuMDYtLjE2LS4zOSAwLS43NC4wNC0xLjAzLjEzLS4yOS4wOS0uNTMuMjEtLjcyLjM2LS4xOS4xNi0uMzQuMzQtLjQ0LjU1LS4xLjIxLS4xNS40My0uMTUuNjYgMCAuNDguMjUuODguNzQgMS4yMS4zOC4yNS43Ny40OCAxLjQxLjdINy4zOWMtLjA1LS4wOC0uMTEtLjE3LS4xNS0uMjV6TTIxIDEydi0ySDN2Mmg5LjYyYy4xOC4wNy40LjE0LjU1LjIuMzcuMTcuNjYuMzQuODcuNTEuMjEuMTcuMzUuMzYuNDMuNTcuMDcuMi4xMS40My4xMS42OSAwIC4yMy0uMDUuNDUtLjE0LjY2LS4wOS4yLS4yMy4zOC0uNDIuNTMtLjE5LjE1LS40Mi4yNi0uNzEuMzUtLjI5LjA4LS42My4xMy0xLjAxLjEzLS40MyAwLS44My0uMDQtMS4xOC0uMTNzLS42Ni0uMjMtLjkxLS40MmMtLjI1LS4xOS0uNDUtLjQ0LS41OS0uNzUtLjE0LS4zMS0uMjUtLjc2LS4yNS0xLjIxSDYuNGMwIC41NS4wOCAxLjEzLjI0IDEuNTguMTYuNDUuMzcuODUuNjUgMS4yMS4yOC4zNS42LjY2Ljk4LjkyLjM3LjI2Ljc4LjQ4IDEuMjIuNjUuNDQuMTcuOS4zIDEuMzguMzkuNDguMDguOTYuMTMgMS40NC4xMy44IDAgMS41My0uMDkgMi4xOC0uMjhzMS4yMS0uNDUgMS42Ny0uNzljLjQ2LS4zNC44Mi0uNzcgMS4wNy0xLjI3cy4zOC0xLjA3LjM4LTEuNzFjMC0uNi0uMS0xLjE0LS4zMS0xLjYxLS4wNS0uMTEtLjExLS4yMy0uMTctLjMzSDIxeiIvPjwvc3ZnPg==)",C.firstChild.style.backgroundPosition="2px 2px",C.firstChild.style.backgroundSize="18px 18px",this.styleButtons([C])}var E,S,f,v,L,T,b,R=this.editorUi.toolbar.addButton("geSprite-top",mxResources.get("top"),g(this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_TOP])),p),I=this.editorUi.toolbar.addButton("geSprite-middle",mxResources.get("middle"),g(this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_MIDDLE])),p),A=this.editorUi.toolbar.addButton("geSprite-bottom",mxResources.get("bottom"),g(this.editorUi.menus.createStyleChangeFunction([mxConstants.STYLE_VERTICAL_ALIGN],[mxConstants.ALIGN_BOTTOM])),p);if(this.styleButtons([R,I,A]),e.appendChild(p),n.cellEditor.isContentEditing()){R.style.display="none",I.style.display="none",A.style.display="none",c.style.display="none",(f=this.editorUi.toolbar.addButton("geSprite-justifyfull",mxResources.get("block"),(function(){1==f.style.opacity&&document.execCommand("justifyfull",!1,null)}),p)).style.marginRight="9px",f.style.opacity=1,this.styleButtons([f,E=this.editorUi.toolbar.addButton("geSprite-subscript",mxResources.get("subscript")+" ("+Editor.ctrlKey+"+,)",(function(){document.execCommand("subscript",!1,null)}),p),S=this.editorUi.toolbar.addButton("geSprite-superscript",mxResources.get("superscript")+" ("+Editor.ctrlKey+"+.)",(function(){document.execCommand("superscript",!1,null)}),p)]),E.style.marginLeft="10px";var N=p.cloneNode(!1);N.style.paddingTop="4px";var U=[this.editorUi.toolbar.addButton("geSprite-orderedlist",mxResources.get("numberedList"),(function(){document.execCommand("insertorderedlist",!1,null)}),N),this.editorUi.toolbar.addButton("geSprite-unorderedlist",mxResources.get("bulletedList"),(function(){document.execCommand("insertunorderedlist",!1,null)}),N),this.editorUi.toolbar.addButton("geSprite-outdent",mxResources.get("decreaseIndent"),(function(){document.execCommand("outdent",!1,null)}),N),this.editorUi.toolbar.addButton("geSprite-indent",mxResources.get("increaseIndent"),(function(){document.execCommand("indent",!1,null)}),N),this.editorUi.toolbar.addButton("geSprite-removeformat",mxResources.get("removeFormat"),(function(){document.execCommand("removeformat",!1,null)}),N),this.editorUi.toolbar.addButton("geSprite-code",mxResources.get("html"),(function(){n.cellEditor.toggleViewMode()}),N)];this.styleButtons(U),U[U.length-2].style.marginLeft="10px",e.appendChild(N)}else m[2].style.marginRight="12px",y.style.marginRight="12px";var M=i.cloneNode(!1);M.style.marginLeft="0px",M.style.paddingTop="8px",M.style.paddingBottom="4px",M.style.fontWeight="normal",mxUtils.write(M,mxResources.get("position"));var F=document.createElement("select");F.style.position="absolute",F.style.left="126px",F.style.width="98px",F.style.border="1px solid rgb(160, 160, 160)",F.style.borderRadius="4px",F.style.marginTop="-2px";for(var O=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],_={topLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM],top:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM],topRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM],left:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_MIDDLE],center:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_MIDDLE],right:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_MIDDLE,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_MIDDLE],bottomLeft:[mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_TOP],bottom:[mxConstants.ALIGN_CENTER,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_CENTER,mxConstants.ALIGN_TOP],bottomRight:[mxConstants.ALIGN_RIGHT,mxConstants.ALIGN_BOTTOM,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_TOP]},w=0;w<O.length;w++){var k=document.createElement("option");k.setAttribute("value",O[w]),mxUtils.write(k,mxResources.get(O[w])),F.appendChild(k)}M.appendChild(F);var D=i.cloneNode(!1);D.style.marginLeft="0px",D.style.paddingTop="4px",D.style.paddingBottom="4px",D.style.fontWeight="normal",mxUtils.write(D,mxResources.get("writingDirection"));var G=document.createElement("select");G.style.position="absolute",G.style.border="1px solid rgb(160, 160, 160)",G.style.left="126px",G.style.width="98px",G.style.borderRadius="4px",G.style.marginTop="-2px";var P=["automatic","leftToRight","rightToLeft"],B={automatic:null,leftToRight:mxConstants.TEXT_DIRECTION_LTR,rightToLeft:mxConstants.TEXT_DIRECTION_RTL};for(w=0;w<P.length;w++){var Y=document.createElement("option");Y.setAttribute("value",P[w]),mxUtils.write(Y,mxResources.get(P[w])),G.appendChild(Y)}D.appendChild(G),n.isEditing()||(e.appendChild(M),mxEvent.addListener(F,"change",(function(e){n.getModel().beginUpdate();try{var t=_[F.value];null!=t&&(n.setCellStyles(mxConstants.STYLE_LABEL_POSITION,t[0],l.cells),n.setCellStyles(mxConstants.STYLE_VERTICAL_LABEL_POSITION,t[1],l.cells),n.setCellStyles(mxConstants.STYLE_ALIGN,t[2],l.cells),n.setCellStyles(mxConstants.STYLE_VERTICAL_ALIGN,t[3],l.cells))}finally{n.getModel().endUpdate()}mxEvent.consume(e)})),e.appendChild(D),mxEvent.addListener(G,"change",(function(e){n.setCellStyles(mxConstants.STYLE_TEXT_DIRECTION,B[G.value],l.cells),mxEvent.consume(e)})));var W=document.createElement("input");W.style.position="absolute",W.style.border="1px solid rgb(160, 160, 160)",W.style.textAlign="right",W.style.marginTop="4px",W.style.left="161px",W.style.width="53px",W.style.borderRadius="4px",W.style.height="23px",W.style.boxSizing="border-box",u.appendChild(W);var H=null,j=this.installInputHandler(W,mxConstants.STYLE_FONTSIZE,Menus.prototype.defaultFontSize,1,999," pt",(function(e){if(!window.getSelection||mxClient.IS_IE||mxClient.IS_IE11){if(window.getSelection||document.selection){var s=null;if(document.selection?s=document.selection.createRange().parentElement():(i=window.getSelection()).rangeCount>0&&(s=i.getRangeAt(0).commonAncestorContainer),null!=s&&function(e,t){for(;null!=t;){if(t===e)return!0;t=t.parentNode}return!1}(n.cellEditor.textarea,s))for(H=e,document.execCommand("fontSize",!1,"4"),r=n.cellEditor.textarea.getElementsByTagName("font"),d=0;d<r.length;d++)if("4"==r[d].getAttribute("size")){r[d].removeAttribute("size"),r[d].style.fontSize=H+"px",window.setTimeout((function(){W.value=H+" pt",H=null}),0);break}}}else{var i,a=(i=window.getSelection()).rangeCount>0?i.getRangeAt(0).commonAncestorContainer:n.cellEditor.textarea;function o(s,a){null!=n.cellEditor.textarea&&s!=n.cellEditor.textarea&&n.cellEditor.textarea.contains(s)&&(a||i.containsNode(s,!0))&&("FONT"==s.nodeName?(s.removeAttribute("size"),s.style.fontSize=e+"px"):mxUtils.getCurrentStyle(s).fontSize!=e+"px"&&(mxUtils.getCurrentStyle(s.parentNode).fontSize!=e+"px"?s.style.fontSize=e+"px":s.style.fontSize="")),t.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTSIZE],"values",[e],"cells",l.cells))}if(a!=n.cellEditor.textarea&&a.nodeType==mxConstants.NODETYPE_ELEMENT||document.execCommand("fontSize",!1,"1"),a!=n.cellEditor.textarea&&(a=a.parentNode),null!=a&&a.nodeType==mxConstants.NODETYPE_ELEMENT){var r=a.getElementsByTagName("*");o(a);for(var d=0;d<r.length;d++)o(r[d])}W.value=e+" pt"}}),!0),z=this.createStepper(W,j,1,10,!0,Menus.prototype.defaultFontSize);z.style.display=W.style.display,z.style.marginTop="4px",z.style.left="214px",u.appendChild(z),d.getElementsByTagName("div")[0].style.cssFloat="right";var V=null,K=n.shapeBackgroundColor,Z=null,X=n.shapeForegroundColor,Q=n.cellEditor.isContentEditing()?this.createColorOption(mxResources.get("backgroundColor"),(function(){return K}),(function(e){document.execCommand("backcolor",!1,e!=mxConstants.NONE?e:"transparent"),t.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR],"values",[e],"cells",l.cells))}),n.shapeBackgroundColor,{install:function(e){V=e},destroy:function(){V=null}},null,!0):this.createCellColorOption(mxResources.get("backgroundColor"),mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"default",null,(function(e){n.updateLabelElements(l.cells,(function(e){e.style.backgroundColor=null}))}),n.shapeBackgroundColor);Q.style.fontWeight="bold";var J=this.createCellColorOption(mxResources.get("borderColor"),mxConstants.STYLE_LABEL_BORDERCOLOR,"default",null,null,n.shapeForegroundColor);J.style.fontWeight="bold";var $=l.vertices.length>=1?n.stylesheet.getDefaultVertexStyle():n.stylesheet.getDefaultEdgeStyle(),q=n.cellEditor.isContentEditing()?this.createColorOption(mxResources.get("fontColor"),(function(){return X}),(function(e){if(mxClient.IS_FF){for(var s=n.cellEditor.textarea.getElementsByTagName("font"),i=[],a=0;a<s.length;a++)i.push({node:s[a],color:s[a].getAttribute("color")});document.execCommand("forecolor",!1,e!=mxConstants.NONE?e:"transparent"),t.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTCOLOR],"values",[e],"cells",l.cells));var o=n.cellEditor.textarea.getElementsByTagName("font");for(a=0;a<o.length;a++)if(a>=i.length||o[a]!=i[a].node||o[a]==i[a].node&&o[a].getAttribute("color")!=i[a].color){var r=o[a].firstChild;if(null!=r&&"A"==r.nodeName&&null==r.nextSibling&&null!=r.firstChild){for(o[a].parentNode.insertBefore(r,o[a]),s=r.firstChild;null!=s;){var d=s.nextSibling;o[a].appendChild(s),s=d}r.appendChild(o[a])}break}}else document.execCommand("forecolor",!1,e!=mxConstants.NONE?e:"transparent"),t.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_FONTCOLOR],"values",[e],"cells",l.cells))}),null!=$[mxConstants.STYLE_FONTCOLOR]?$[mxConstants.STYLE_FONTCOLOR]:n.shapeForegroundColor,{install:function(e){Z=e},destroy:function(){Z=null}},null,!0):this.createCellColorOption(mxResources.get("fontColor"),mxConstants.STYLE_FONTCOLOR,"default",(function(e){e==mxConstants.NONE?Q.style.display="none":Q.style.display="",J.style.display=Q.style.display}),(function(e){e==mxConstants.NONE?n.setCellStyles(mxConstants.STYLE_NOLABEL,"1",l.cells):n.setCellStyles(mxConstants.STYLE_NOLABEL,null,l.cells),n.setCellStyles(mxConstants.STYLE_FONTCOLOR,e,l.cells),n.updateLabelElements(l.cells,(function(e){e.removeAttribute("color"),e.style.color=null}))}),n.shapeForegroundColor);q.style.fontWeight="bold",r.appendChild(q),r.appendChild(Q),n.cellEditor.isContentEditing()||r.appendChild(J),e.appendChild(r);var ee=this.createPanel();ee.style.paddingTop="2px",ee.style.paddingBottom="4px";var te=n.filterSelectionCells(mxUtils.bind(this,(function(e){var t=n.view.getState(e);return null==t||n.isAutoSizeState(t)||n.getModel().isEdge(e)||!n.isTableRow(e)&&!n.isTableCell(e)&&!n.isCellResizable(e)}))),ne=this.createCellOption(mxResources.get("wordWrap"),mxConstants.STYLE_WHITE_SPACE,null,"wrap","null",null,null,!0,te);ne.style.fontWeight="bold",te.length>0&&ee.appendChild(ne);var le=this.createCellOption(mxResources.get("formattedText"),"html",0,null,null,null,t.actions.get("formattedText"));le.style.fontWeight="bold",ee.appendChild(le);var se=this.createPanel();se.style.paddingTop="10px",se.style.paddingBottom="28px",se.style.fontWeight="normal";var ie,ae,oe,re,de,ue=document.createElement("div");ue.style.position="absolute",ue.style.width="70px",ue.style.marginTop="0px",ue.style.fontWeight="bold",mxUtils.write(ue,mxResources.get("spacing")),se.appendChild(ue);var me=this.addUnitInput(se,"pt",87,52,(function(){ie.apply(this,arguments)})),ce=this.addUnitInput(se,"pt",16,52,(function(){ae.apply(this,arguments)}));mxUtils.br(se),this.addLabel(se,mxResources.get("top"),87),this.addLabel(se,mxResources.get("global"),16),mxUtils.br(se),mxUtils.br(se);var pe=this.addUnitInput(se,"pt",158,52,(function(){oe.apply(this,arguments)})),ge=this.addUnitInput(se,"pt",87,52,(function(){re.apply(this,arguments)})),he=this.addUnitInput(se,"pt",16,52,(function(){de.apply(this,arguments)}));if(mxUtils.br(se),this.addLabel(se,mxResources.get("left"),158),this.addLabel(se,mxResources.get("bottom"),87),this.addLabel(se,mxResources.get("right"),16),n.cellEditor.isContentEditing()){var xe=null,ye=null;e.appendChild(this.createRelativeOption(mxResources.get("lineheight"),null,null,(function(e){var t=""==e.value?120:parseInt(e.value);t=Math.max(0,isNaN(t)?120:t),null!=xe&&(n.cellEditor.restoreSelection(xe),xe=null);for(var l=n.getSelectedElement();null!=l&&l.nodeType!=mxConstants.NODETYPE_ELEMENT;)l=l.parentNode;null!=l&&l==n.cellEditor.textarea&&null!=n.cellEditor.textarea.firstChild&&("P"!=n.cellEditor.textarea.firstChild.nodeName&&(n.cellEditor.textarea.innerHTML="<p>"+n.cellEditor.textarea.innerHTML+"</p>"),l=n.cellEditor.textarea.firstChild),null!=l&&null!=n.cellEditor.textarea&&l!=n.cellEditor.textarea&&n.cellEditor.textarea.contains(l)&&(l.style.lineHeight=t/100),e.value=t+" %"}),(function(e){ye=e,mxEvent.addListener(e,"mousedown",(function(){document.activeElement==n.cellEditor.textarea&&(xe=n.cellEditor.saveSelection())})),mxEvent.addListener(e,"touchstart",(function(){document.activeElement==n.cellEditor.textarea&&(xe=n.cellEditor.saveSelection())})),e.value="120 %"})));var Ce=i.cloneNode(!1);Ce.style.paddingLeft="0px";var Ee=this.editorUi.toolbar.addItems(["link","image"],Ce,!0);U=[this.editorUi.toolbar.addButton("geSprite-horizontalrule",mxResources.get("insertHorizontalRule"),(function(){document.execCommand("inserthorizontalrule",!1)}),Ce),this.editorUi.toolbar.addMenuFunctionInContainer(Ce,"geSprite-table",mxResources.get("table"),!1,mxUtils.bind(this,(function(e){this.editorUi.menus.addInsertTableItem(e,null,null,!1)})))],this.styleButtons(Ee),this.styleButtons(U);var Se=this.createPanel();Se.style.paddingTop="10px",Se.style.paddingBottom="10px",Se.appendChild(this.createTitle(mxResources.get("insert"))),Se.appendChild(Ce),e.appendChild(Se);var fe=i.cloneNode(!1);fe.style.paddingLeft="0px",U=[this.editorUi.toolbar.addButton("geSprite-insertcolumnbefore",mxResources.get("insertColumnBefore"),mxUtils.bind(this,(function(){try{null!=L&&n.insertColumn(L,null!=T?T.cellIndex:0)}catch(e){this.editorUi.handleError(e)}})),fe),this.editorUi.toolbar.addButton("geSprite-insertcolumnafter",mxResources.get("insertColumnAfter"),mxUtils.bind(this,(function(){try{null!=L&&n.insertColumn(L,null!=T?T.cellIndex+1:-1)}catch(e){this.editorUi.handleError(e)}})),fe),this.editorUi.toolbar.addButton("geSprite-deletecolumn",mxResources.get("deleteColumn"),mxUtils.bind(this,(function(){try{null!=L&&null!=T&&n.deleteColumn(L,T.cellIndex)}catch(e){this.editorUi.handleError(e)}})),fe),this.editorUi.toolbar.addButton("geSprite-insertrowbefore",mxResources.get("insertRowBefore"),mxUtils.bind(this,(function(){try{null!=L&&null!=b&&n.insertRow(L,b.sectionRowIndex)}catch(e){this.editorUi.handleError(e)}})),fe),this.editorUi.toolbar.addButton("geSprite-insertrowafter",mxResources.get("insertRowAfter"),mxUtils.bind(this,(function(){try{null!=L&&null!=b&&n.insertRow(L,b.sectionRowIndex+1)}catch(e){this.editorUi.handleError(e)}})),fe),this.editorUi.toolbar.addButton("geSprite-deleterow",mxResources.get("deleteRow"),mxUtils.bind(this,(function(){try{null!=L&&null!=b&&n.deleteRow(L,b.sectionRowIndex)}catch(e){this.editorUi.handleError(e)}})),fe)],this.styleButtons(U),U[2].style.marginRight="10px";var ve=this.createPanel();ve.style.paddingTop="10px",ve.style.paddingBottom="10px",ve.appendChild(this.createTitle(mxResources.get("table"))),ve.appendChild(fe);var Le=i.cloneNode(!1);Le.style.paddingLeft="0px",U=[this.editorUi.toolbar.addButton("geSprite-strokecolor",mxResources.get("borderColor"),mxUtils.bind(this,(function(e){if(null!=L){var t=L.style.borderColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,(function(e,t,n,l){return"#"+("0"+Number(t).toString(16)).substr(-2)+("0"+Number(n).toString(16)).substr(-2)+("0"+Number(l).toString(16)).substr(-2)}));this.editorUi.pickColor(t,(function(t){var l=null==T||null!=e&&mxEvent.isShiftDown(e)?L:T;n.processElements(l,(function(e){e.style.border=null})),null==t||t==mxConstants.NONE?(l.removeAttribute("border"),l.style.border="",l.style.borderCollapse=""):(l.setAttribute("border","1"),l.style.border="1px solid "+t,l.style.borderCollapse="collapse")}))}})),Le),this.editorUi.toolbar.addButton("geSprite-fillcolor",mxResources.get("backgroundColor"),mxUtils.bind(this,(function(e){if(null!=L){var t=L.style.backgroundColor.replace(/\brgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/g,(function(e,t,n,l){return"#"+("0"+Number(t).toString(16)).substr(-2)+("0"+Number(n).toString(16)).substr(-2)+("0"+Number(l).toString(16)).substr(-2)}));this.editorUi.pickColor(t,(function(t){var l=null==T||null!=e&&mxEvent.isShiftDown(e)?L:T;n.processElements(l,(function(e){e.style.backgroundColor=null})),null==t||t==mxConstants.NONE?l.style.backgroundColor="":l.style.backgroundColor=t}))}})),Le),this.editorUi.toolbar.addButton("geSprite-fit",mxResources.get("spacing"),(function(){if(null!=L){var e=L.getAttribute("cellPadding")||0,n=new FilenameDialog(t,e,mxResources.get("apply"),mxUtils.bind(this,(function(e){null!=e&&e.length>0?L.setAttribute("cellPadding",e):L.removeAttribute("cellPadding")})),mxResources.get("spacing"));t.showDialog(n.container,300,80,!0,!0),n.init()}}),Le),this.editorUi.toolbar.addButton("geSprite-left",mxResources.get("left"),(function(){null!=L&&L.setAttribute("align","left")}),Le),this.editorUi.toolbar.addButton("geSprite-center",mxResources.get("center"),(function(){null!=L&&L.setAttribute("align","center")}),Le),this.editorUi.toolbar.addButton("geSprite-right",mxResources.get("right"),(function(){null!=L&&L.setAttribute("align","right")}),Le)],this.styleButtons(U),U[2].style.marginRight="10px",ve.appendChild(Le),e.appendChild(ve),v=ve}else e.appendChild(ee),e.appendChild(this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_TEXT_OPACITY)),e.appendChild(se);function Te(e,t){e.style.backgroundImage=t?Editor.isDarkMode()?"linear-gradient(rgb(0 161 241) 0px, rgb(0, 97, 146) 100%)":"linear-gradient(#c5ecff 0px,#87d4fb 100%)":""}var be=mxUtils.bind(this,(function(e,n,s){l=t.getSelectionState();var i=mxUtils.getValue(l.style,mxConstants.STYLE_FONTSTYLE,0);if(Te(m[0],(i&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD),Te(m[1],(i&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC),Te(m[2],(i&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE),d.firstChild.nodeValue=mxUtils.getValue(l.style,mxConstants.STYLE_FONTFAMILY,Menus.prototype.defaultFont),Te(c,"0"==mxUtils.getValue(l.style,mxConstants.STYLE_HORIZONTAL,"1")),s||document.activeElement!=W){var a=parseFloat(mxUtils.getValue(l.style,mxConstants.STYLE_FONTSIZE,Menus.prototype.defaultFontSize));W.value=isNaN(a)?"":a+" pt"}var o=mxUtils.getValue(l.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);Te(h,o==mxConstants.ALIGN_LEFT),Te(x,o==mxConstants.ALIGN_CENTER),Te(y,o==mxConstants.ALIGN_RIGHT);var r=mxUtils.getValue(l.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE);Te(R,r==mxConstants.ALIGN_TOP),Te(I,r==mxConstants.ALIGN_MIDDLE),Te(A,r==mxConstants.ALIGN_BOTTOM);var u=mxUtils.getValue(l.style,mxConstants.STYLE_LABEL_POSITION,mxConstants.ALIGN_CENTER),p=mxUtils.getValue(l.style,mxConstants.STYLE_VERTICAL_LABEL_POSITION,mxConstants.ALIGN_MIDDLE);u==mxConstants.ALIGN_LEFT&&p==mxConstants.ALIGN_TOP?F.value="topLeft":u==mxConstants.ALIGN_CENTER&&p==mxConstants.ALIGN_TOP?F.value="top":u==mxConstants.ALIGN_RIGHT&&p==mxConstants.ALIGN_TOP?F.value="topRight":u==mxConstants.ALIGN_LEFT&&p==mxConstants.ALIGN_BOTTOM?F.value="bottomLeft":u==mxConstants.ALIGN_CENTER&&p==mxConstants.ALIGN_BOTTOM?F.value="bottom":u==mxConstants.ALIGN_RIGHT&&p==mxConstants.ALIGN_BOTTOM?F.value="bottomRight":u==mxConstants.ALIGN_LEFT?F.value="left":u==mxConstants.ALIGN_RIGHT?F.value="right":F.value="center";var g=mxUtils.getValue(l.style,mxConstants.STYLE_TEXT_DIRECTION,mxConstants.DEFAULT_TEXT_DIRECTION);g==mxConstants.TEXT_DIRECTION_RTL?G.value="rightToLeft":g==mxConstants.TEXT_DIRECTION_LTR?G.value="leftToRight":g==mxConstants.TEXT_DIRECTION_AUTO&&(G.value="automatic"),(s||document.activeElement!=ce)&&(a=parseFloat(mxUtils.getValue(l.style,mxConstants.STYLE_SPACING,2)),ce.value=isNaN(a)?"":a+" pt"),(s||document.activeElement!=me)&&(a=parseFloat(mxUtils.getValue(l.style,mxConstants.STYLE_SPACING_TOP,0)),me.value=isNaN(a)?"":a+" pt"),(s||document.activeElement!=he)&&(a=parseFloat(mxUtils.getValue(l.style,mxConstants.STYLE_SPACING_RIGHT,0)),he.value=isNaN(a)?"":a+" pt"),(s||document.activeElement!=ge)&&(a=parseFloat(mxUtils.getValue(l.style,mxConstants.STYLE_SPACING_BOTTOM,0)),ge.value=isNaN(a)?"":a+" pt"),(s||document.activeElement!=pe)&&(a=parseFloat(mxUtils.getValue(l.style,mxConstants.STYLE_SPACING_LEFT,0)),pe.value=isNaN(a)?"":a+" pt")}));if(ae=this.installInputHandler(ce,mxConstants.STYLE_SPACING,2,-999,999," pt"),ie=this.installInputHandler(me,mxConstants.STYLE_SPACING_TOP,0,-999,999," pt"),de=this.installInputHandler(he,mxConstants.STYLE_SPACING_RIGHT,0,-999,999," pt"),re=this.installInputHandler(ge,mxConstants.STYLE_SPACING_BOTTOM,0,-999,999," pt"),oe=this.installInputHandler(pe,mxConstants.STYLE_SPACING_LEFT,0,-999,999," pt"),this.addKeyHandler(W,be),this.addKeyHandler(ce,be),this.addKeyHandler(me,be),this.addKeyHandler(he,be),this.addKeyHandler(ge,be),this.addKeyHandler(pe,be),n.getModel().addListener(mxEvent.CHANGE,be),this.listeners.push({destroy:function(){n.getModel().removeListener(be)}}),be(),n.cellEditor.isContentEditing()){var Re=!1,Ie=function(){Re||(Re=!0,window.setTimeout((function(){var e=n.getSelectedEditingElement();if(null!=e){function t(e,t,n){if(null!=n.style&&null!=t){var l=t.lineHeight;return null!=n.style.lineHeight&&"%"==n.style.lineHeight.substring(n.style.lineHeight.length-1)?parseInt(n.style.lineHeight)/100:"px"==l.substring(l.length-2)?parseFloat(l)/e:parseInt(l)}return""}function s(e){var t=null!=e?e.fontSize:null;return null!=t&&"px"==t.substring(t.length-2)?parseFloat(t):mxConstants.DEFAULT_FONTSIZE}var i=mxUtils.getCurrentStyle(e),a=s(i),o=t(a,i,e),r=e.getElementsByTagName("*");if(r.length>0&&window.getSelection&&!mxClient.IS_IE&&!mxClient.IS_IE11)for(var u=window.getSelection(),c=0;c<r.length;c++)u.containsNode(r[c],!0)&&(temp=mxUtils.getCurrentStyle(r[c]),((R=t(a=Math.max(s(temp),a),temp,r[c]))!=o||isNaN(R))&&(o=""));function p(t){if(null!=n.getParentByName(e,t,n.cellEditor.textarea))return!0;for(var l=e;null!=l&&1==l.childNodes.length;)if((l=l.childNodes[0]).nodeName==t)return!0;return!1}function g(e,t){if(null!=e&&null!=t){if(e==t)return!0;if(e.length>t.length+1)return e.substring(e.length-t.length-1,e.length)=="-"+t}return!1}if(null!=i){if(Te(m[0],"bold"==i.fontWeight||i.fontWeight>400||p("B")||p("STRONG")),Te(m[1],"italic"==i.fontStyle||p("I")||p("EM")),Te(m[2],p("U")),Te(S,p("SUP")),Te(E,p("SUB")),n.cellEditor.isTableSelected())Te(f,g(i.textAlign,"justify")),Te(h,g(i.textAlign,"left")),Te(x,g(i.textAlign,"center")),Te(y,g(i.textAlign,"right"));else{var C=n.cellEditor.align||mxUtils.getValue(l.style,mxConstants.STYLE_ALIGN,mxConstants.ALIGN_CENTER);g(i.textAlign,"justify")?(Te(f,g(i.textAlign,"justify")),Te(h,!1),Te(x,!1),Te(y,!1)):(Te(f,!1),Te(h,C==mxConstants.ALIGN_LEFT),Te(x,C==mxConstants.ALIGN_CENTER),Te(y,C==mxConstants.ALIGN_RIGHT))}if(L=n.getParentByName(e,"TABLE",n.cellEditor.textarea),b=null==L?null:n.getParentByName(e,"TR",L),T=null==L?null:n.getParentByNames(e,["TD","TH"],L),v.style.display=null!=L?"":"none",document.activeElement!=W){"FONT"==e.nodeName&&"4"==e.getAttribute("size")&&null!=H?(e.removeAttribute("size"),e.style.fontSize=H+" pt",H=null):W.value=isNaN(a)?"":a+" pt";var R=parseFloat(o);isNaN(R)?ye.value="100 %":ye.value=Math.round(100*R)+" %"}null!=Z&&(X="rgba(0, 0, 0, 0)"==i.color||"transparent"==i.color?mxConstants.NONE:mxUtils.rgba2hex(i.color),Z(X,!0)),null!=V&&(K="rgba(0, 0, 0, 0)"==i.backgroundColor||"transparent"==i.backgroundColor?mxConstants.NONE:mxUtils.rgba2hex(i.backgroundColor),V(K,!0)),null!=d.firstChild&&(d.firstChild.nodeValue=Graph.stripQuotes(i.fontFamily))}}Re=!1}),0))};(mxClient.IS_FF||mxClient.IS_EDGE||mxClient.IS_IE||mxClient.IS_IE11)&&mxEvent.addListener(n.cellEditor.textarea,"DOMSubtreeModified",Ie),mxEvent.addListener(n.cellEditor.textarea,"input",Ie),mxEvent.addListener(n.cellEditor.textarea,"touchend",Ie),mxEvent.addListener(n.cellEditor.textarea,"mouseup",Ie),mxEvent.addListener(n.cellEditor.textarea,"keyup",Ie),this.listeners.push({destroy:function(){}}),Ie()}return e},StyleFormatPanel=function(e,t,n){BaseFormatPanel.call(this,e,t,n),this.init()},mxUtils.extend(StyleFormatPanel,BaseFormatPanel),StyleFormatPanel.prototype.defaultStrokeColor="black",StyleFormatPanel.prototype.init=function(){var e=this.editorUi,t=(e.editor.graph,e.getSelectionState());if(!t.containsLabel&&t.cells.length>0){t.containsImage&&1==t.vertices.length&&"image"==t.style.shape&&null!=t.style.image&&"data:image/svg+xml;"==t.style.image.substring(0,19)&&this.container.appendChild(this.addSvgStyles(this.createPanel())),t.containsImage&&"image"!=t.style.shape||this.container.appendChild(this.addFill(this.createPanel())),this.container.appendChild(this.addStroke(this.createPanel())),this.container.appendChild(this.addLineJumps(this.createPanel()));var n=this.createRelativeOption(mxResources.get("opacity"),mxConstants.STYLE_OPACITY);n.style.paddingTop="8px",n.style.paddingBottom="8px",this.container.appendChild(n),this.container.appendChild(this.addEffects(this.createPanel()))}var l=this.addEditOps(this.createPanel());null!=l.firstChild&&mxUtils.br(l),this.container.appendChild(this.addStyleOps(l))},StyleFormatPanel.prototype.getCssRules=function(e){var t=document.implementation.createHTMLDocument(""),n=document.createElement("style");return mxUtils.setTextContent(n,e),t.body.appendChild(n),n.sheet.cssRules},StyleFormatPanel.prototype.addSvgStyles=function(e){var t=this.editorUi,n=(t.editor.graph,t.getSelectionState());e.style.paddingTop="6px",e.style.paddingBottom="6px",e.style.fontWeight="bold",e.style.display="none";try{var l=n.style.editableCssRules;if(null!=l){var s=new RegExp(l),i=n.style.image.substring(n.style.image.indexOf(",")+1),a=window.atob?atob(i):Base64.decode(i,!0),o=mxUtils.parseXml(a);if(null!=o)for(var r=o.getElementsByTagName("style"),d=0;d<r.length;d++)for(var u=this.getCssRules(mxUtils.getTextContent(r[d])),m=0;m<u.length;m++)this.addSvgRule(e,u[m],o,r[d],u,m,s)}}catch(e){}return e},StyleFormatPanel.prototype.addSvgRule=function(e,t,n,l,s,i,a){var o=this.editorUi,r=o.editor.graph;if(a.test(t.selectorText)){var d=mxUtils.bind(this,(function(t,a,d){var u=mxUtils.trim(t.style[a]);if(""!=u&&"url("!=u.substring(0,4)){var m=this.createColorOption(d+" "+t.selectorText,(function(){return(e=(e=u).match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i))&&4===e.length?"#"+("0"+parseInt(e[1],10).toString(16)).slice(-2)+("0"+parseInt(e[2],10).toString(16)).slice(-2)+("0"+parseInt(e[3],10).toString(16)).slice(-2):"";var e}),mxUtils.bind(this,(function(e){s[i].style[a]=e;for(var t="",d=0;d<s.length;d++)t+=s[d].cssText+" ";l.textContent=t;var u=mxUtils.getXml(n.documentElement);r.setCellStyles(mxConstants.STYLE_IMAGE,"data:image/svg+xml,"+(window.btoa?btoa(u):Base64.encode(u,!0)),o.getSelectionState().cells)})),"#ffffff",{install:function(e){},destroy:function(){}});e.appendChild(m),e.style.display=""}}));d(t,"fill",mxResources.get("fill")),d(t,"stroke",mxResources.get("line")),d(t,"stop-color",mxResources.get("gradient"))}},StyleFormatPanel.prototype.addEditOps=function(e){var t=this.editorUi.getSelectionState(),n=null;if(1==t.cells.length&&((n=mxUtils.button(mxResources.get("editStyle"),mxUtils.bind(this,(function(e){this.editorUi.actions.get("editStyle").funct()})))).setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),n.style.width="210px",n.style.marginBottom="2px",e.appendChild(n)),t.image&&t.cells.length>0){var l=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,(function(e){this.editorUi.actions.get("image").funct()})));l.setAttribute("title",mxResources.get("editImage")),l.style.marginBottom="2px",null==n?l.style.width="210px":(n.style.width="104px",l.style.width="104px",l.style.marginLeft="2px"),e.appendChild(l)}return e},StyleFormatPanel.prototype.addFill=function(e){var t=this.editorUi,n=t.editor.graph,l=t.getSelectionState();e.style.paddingTop="6px",e.style.paddingBottom="6px";var s=document.createElement("select");s.style.position="absolute",s.style.left="104px",s.style.width="70px",s.style.height="22px",s.style.padding="0px",s.style.marginTop="-3px",s.style.borderRadius="4px",s.style.border="1px solid rgb(160, 160, 160)",s.style.boxSizing="border-box";var i=s.cloneNode(!1);mxEvent.addListener(s,"click",(function(e){mxEvent.consume(e)})),mxEvent.addListener(i,"click",(function(e){mxEvent.consume(e)}));var a=l.vertices.length>=1?n.stylesheet.getDefaultVertexStyle():n.stylesheet.getDefaultEdgeStyle(),o=this.createCellColorOption(mxResources.get("gradient"),mxConstants.STYLE_GRADIENTCOLOR,null!=a[mxConstants.STYLE_GRADIENTCOLOR]?a[mxConstants.STYLE_GRADIENTCOLOR]:"#ffffff",(function(e){null==e||e==mxConstants.NONE?s.style.display="none":s.style.display=""}),(function(e){n.updateCellStyles({gradientColor:e},n.getSelectionCells())})),r="image"==l.style.shape?mxConstants.STYLE_IMAGE_BACKGROUND:mxConstants.STYLE_FILLCOLOR,d="image"==l.style.shape?mxResources.get("background"):mxResources.get("fill"),u=this.createCellColorOption(d,r,"default",null,mxUtils.bind(this,(function(e){n.setCellStyles(r,e,l.cells)})),n.shapeBackgroundColor);u.style.fontWeight="bold";var m=mxUtils.getValue(l.style,r,null);o.style.display=null!=m&&m!=mxConstants.NONE&&l.fill&&"image"!=l.style.shape?"":"none";for(var c=[mxConstants.DIRECTION_NORTH,mxConstants.DIRECTION_EAST,mxConstants.DIRECTION_SOUTH,mxConstants.DIRECTION_WEST,mxConstants.DIRECTION_RADIAL],p=0;p<c.length;p++){var g=document.createElement("option");g.setAttribute("value",c[p]),mxUtils.write(g,mxResources.get(c[p])),s.appendChild(g)}for(o.appendChild(s),p=0;p<Editor.roughFillStyles.length;p++){var h=document.createElement("option");h.setAttribute("value",Editor.roughFillStyles[p].val),mxUtils.write(h,Editor.roughFillStyles[p].dispName),i.appendChild(h)}u.appendChild(i);var x=mxUtils.bind(this,(function(){l=t.getSelectionState();var n=mxUtils.getValue(l.style,mxConstants.STYLE_GRADIENT_DIRECTION,mxConstants.DIRECTION_SOUTH),a=mxUtils.getValue(l.style,"fillStyle","auto");""==n&&(n=mxConstants.DIRECTION_SOUTH),s.value=n,i.value=a,e.style.display=l.fill?"":"none";var r=mxUtils.getValue(l.style,mxConstants.STYLE_FILLCOLOR,null);!l.fill||l.containsImage||null==r||r==mxConstants.NONE||"filledEdge"==l.style.shape?(i.style.display="none",o.style.display="none"):(i.style.display="1"==l.style.sketch?"":"none",o.style.display="1"!=l.style.sketch||"solid"==a||"auto"==a?"":"none")}));n.getModel().addListener(mxEvent.CHANGE,x),this.listeners.push({destroy:function(){n.getModel().removeListener(x)}}),x(),mxEvent.addListener(s,"change",(function(e){n.setCellStyles(mxConstants.STYLE_GRADIENT_DIRECTION,s.value,l.cells),t.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_GRADIENT_DIRECTION],"values",[s.value],"cells",l.cells)),mxEvent.consume(e)})),mxEvent.addListener(i,"change",(function(e){n.setCellStyles("fillStyle",i.value,l.cells),t.fireEvent(new mxEventObject("styleChanged","keys",["fillStyle"],"values",[i.value],"cells",l.cells)),mxEvent.consume(e)})),e.appendChild(u),e.appendChild(o);var y=this.getCustomColors();for(p=0;p<y.length;p++)e.appendChild(this.createCellColorOption(y[p].title,y[p].key,y[p].defaultValue));return e},StyleFormatPanel.prototype.getCustomColors=function(){var e=[];return this.editorUi.getSelectionState().swimlane&&e.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"}),e},StyleFormatPanel.prototype.addStroke=function(e){var t=this.editorUi,n=t.editor.graph,l=t.getSelectionState();e.style.paddingTop="6px",e.style.paddingBottom="4px",e.style.whiteSpace="normal";var s=document.createElement("div");s.style.fontWeight="bold",l.stroke||(s.style.display="none");var i=document.createElement("select");i.style.position="absolute",i.style.height="22px",i.style.padding="0px",i.style.marginTop="-3px",i.style.boxSizing="border-box",i.style.left="94px",i.style.width="80px",i.style.border="1px solid rgb(160, 160, 160)",i.style.borderRadius="4px";for(var a=["sharp","rounded","curved"],o=0;o<a.length;o++){var r=document.createElement("option");r.setAttribute("value",a[o]),mxUtils.write(r,mxResources.get(a[o])),i.appendChild(r)}mxEvent.addListener(i,"change",(function(e){n.getModel().beginUpdate();try{var s=[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],a=["0",null];"rounded"==i.value?a=["1",null]:"curved"==i.value&&(a=[null,"1"]);for(var o=0;o<s.length;o++)n.setCellStyles(s[o],a[o],l.cells);t.fireEvent(new mxEventObject("styleChanged","keys",s,"values",a,"cells",l.cells))}finally{n.getModel().endUpdate()}mxEvent.consume(e)})),mxEvent.addListener(i,"click",(function(e){mxEvent.consume(e)}));var d="image"==l.style.shape?mxConstants.STYLE_IMAGE_BORDER:mxConstants.STYLE_STROKECOLOR,u="image"==l.style.shape?mxResources.get("border"):mxResources.get("line"),m=this.createCellColorOption(u,d,"default",null,mxUtils.bind(this,(function(e){n.setCellStyles(d,e,l.cells)})),n.shapeForegroundColor);m.appendChild(i),s.appendChild(m);var c=s.cloneNode(!1);c.style.fontWeight="normal",c.style.whiteSpace="nowrap",c.style.position="relative",c.style.paddingLeft="0px",c.style.marginBottom="2px",c.style.overflow="hidden",c.style.marginTop="2px",c.style.width="220px",c.className="geToolbarContainer";var p=mxUtils.bind(this,(function(e,t,n,l,s){var i=this.editorUi.menus.styleChange(e,"",l,s,"geIcon",null),a=document.createElement("div");return a.style.width=t+"px",a.style.height="1px",a.style.borderBottom="1px "+n+" "+this.defaultStrokeColor,a.style.paddingTop="6px",i.firstChild.firstChild.style.padding="0px 4px 0px 4px",i.firstChild.firstChild.style.width=t+"px",i.firstChild.firstChild.appendChild(a),i})),g=this.editorUi.toolbar.addMenuFunctionInContainer(c,"geSprite-orthogonal",mxResources.get("pattern"),!1,mxUtils.bind(this,(function(e){p(e,75,"solid",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],[null,null]).setAttribute("title",mxResources.get("solid")),p(e,75,"dashed",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1",null]).setAttribute("title",mxResources.get("dashed")),p(e,75,"dotted",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1","1 1"]).setAttribute("title",mxResources.get("dotted")+" (1)"),p(e,75,"dotted",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)"),p(e,75,"dotted",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)")}))),h=c.cloneNode(!1),x=this.editorUi.toolbar.addMenuFunctionInContainer(h,"geSprite-connection",mxResources.get("connection"),!1,mxUtils.bind(this,(function(e){this.editorUi.menus.styleChange(e,"",[mxConstants.STYLE_SHAPE,mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE,"width"],[null,null,null,null],"geIcon geSprite geSprite-connection",null,!0).setAttribute("title",mxResources.get("line")),this.editorUi.menus.styleChange(e,"",[mxConstants.STYLE_SHAPE,mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE,"width"],["link",null,null,null],"geIcon geSprite geSprite-linkedge",null,!0).setAttribute("title",mxResources.get("link")),this.editorUi.menus.styleChange(e,"",[mxConstants.STYLE_SHAPE,mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE,"width"],["flexArrow",null,null,null],"geIcon geSprite geSprite-arrow",null,!0).setAttribute("title",mxResources.get("arrow")),this.editorUi.menus.styleChange(e,"",[mxConstants.STYLE_SHAPE,mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE,"width"],["arrow",null,null,null],"geIcon geSprite geSprite-simplearrow",null,!0).setAttribute("title",mxResources.get("simpleArrow"))}))),y=this.editorUi.toolbar.addMenuFunctionInContainer(h,"geSprite-orthogonal",mxResources.get("pattern"),!1,mxUtils.bind(this,(function(e){p(e,33,"solid",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],[null,null]).setAttribute("title",mxResources.get("solid")),p(e,33,"dashed",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1",null]).setAttribute("title",mxResources.get("dashed")),p(e,33,"dotted",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1","1 1"]).setAttribute("title",mxResources.get("dotted")+" (1)"),p(e,33,"dotted",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1","1 2"]).setAttribute("title",mxResources.get("dotted")+" (2)"),p(e,33,"dotted",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],["1","1 4"]).setAttribute("title",mxResources.get("dotted")+" (3)")}))),C=c.cloneNode(!1),E=document.createElement("input");E.style.position="absolute",E.style.textAlign="right",E.style.marginTop="2px",E.style.width="52px",E.style.height="21px",E.style.left="146px",E.style.border="1px solid rgb(160, 160, 160)",E.style.borderRadius="4px",E.style.boxSizing="border-box",E.setAttribute("title",mxResources.get("linewidth")),c.appendChild(E);var S=E.cloneNode(!0);function f(e){var s=parseFloat(E.value);(s=Math.min(999,Math.max(0,isNaN(s)?1:s)))!=mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)&&(n.setCellStyles(mxConstants.STYLE_STROKEWIDTH,s,l.cells),t.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_STROKEWIDTH],"values",[s],"cells",l.cells))),E.value=s+" pt",mxEvent.consume(e)}function v(e){var s=parseFloat(S.value);(s=Math.min(999,Math.max(0,isNaN(s)?1:s)))!=mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)&&(n.setCellStyles(mxConstants.STYLE_STROKEWIDTH,s,l.cells),t.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_STROKEWIDTH],"values",[s],"cells",l.cells))),S.value=s+" pt",mxEvent.consume(e)}h.appendChild(S);var L=this.createStepper(E,f,1,9);L.style.display=E.style.display,L.style.marginTop="2px",L.style.left="198px",c.appendChild(L);var T=this.createStepper(S,v,1,9);T.style.display=S.style.display,T.style.marginTop="2px",S.style.position="absolute",T.style.left="198px",h.appendChild(T),mxEvent.addListener(E,"blur",f),mxEvent.addListener(E,"change",f),mxEvent.addListener(S,"blur",v),mxEvent.addListener(S,"change",v);var b=this.editorUi.toolbar.addMenuFunctionInContainer(C,"geSprite-orthogonal",mxResources.get("waypoints"),!1,mxUtils.bind(this,(function(e){"arrow"!=l.style.shape&&(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],[null,null,null],"geIcon geSprite geSprite-straight",null,!0).setAttribute("title",mxResources.get("straight")),this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["orthogonalEdgeStyle",null,null],"geIcon geSprite geSprite-orthogonal",null,!0).setAttribute("title",mxResources.get("orthogonal")),this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["elbowEdgeStyle",null,null,null],"geIcon geSprite geSprite-horizontalelbow",null,!0).setAttribute("title",mxResources.get("simple")),this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["elbowEdgeStyle","vertical",null,null],"geIcon geSprite geSprite-verticalelbow",null,!0).setAttribute("title",mxResources.get("simple")),this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["isometricEdgeStyle",null,null,null],"geIcon geSprite geSprite-horizontalisometric",null,!0).setAttribute("title",mxResources.get("isometric")),this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_ELBOW,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["isometricEdgeStyle","vertical",null,null],"geIcon geSprite geSprite-verticalisometric",null,!0).setAttribute("title",mxResources.get("isometric")),"connector"==l.style.shape&&this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["orthogonalEdgeStyle","1",null],"geIcon geSprite geSprite-curved",null,!0).setAttribute("title",mxResources.get("curved")),this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_EDGE,mxConstants.STYLE_CURVED,mxConstants.STYLE_NOEDGESTYLE],["entityRelationEdgeStyle",null,null],"geIcon geSprite geSprite-entity",null,!0).setAttribute("title",mxResources.get("entityRelation")))}))),R=this.editorUi.toolbar.addMenuFunctionInContainer(C,"geSprite-startclassic",mxResources.get("linestart"),!1,mxUtils.bind(this,(function(e){if("connector"==l.style.shape||"flexArrow"==l.style.shape||"filledEdge"==l.style.shape){var t=this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.NONE,0],"geIcon",null,!1);t.setAttribute("title",mxResources.get("none"));var n=document.createElement("font");n.style.fontSize="10px",mxUtils.write(n,mxResources.get("none")),t.firstChild.firstChild.appendChild(n),"connector"==l.style.shape||"filledEdge"==l.style.shape?(Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_CLASSIC,1],null,null,!1,Format.classicFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_CLASSIC_THIN,1],null,null,!1,Format.classicThinFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_OPEN,0],null,null,!1,Format.openFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_OPEN_THIN,0],null,null,!1,Format.openThinFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["openAsync",0],null,null,!1,Format.openAsyncFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_BLOCK,1],null,null,!1,Format.blockFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_BLOCK_THIN,1],null,null,!1,Format.blockThinFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["async",1],null,null,!1,Format.asyncFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_OVAL,1],null,null,!1,Format.ovalFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_DIAMOND,1],null,null,!1,Format.diamondFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_DIAMOND_THIN,1],null,null,!1,Format.diamondThinFilledMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_CLASSIC,0],null,null,!1,Format.classicMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_CLASSIC_THIN,0],null,null,!1,Format.classicThinMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_BLOCK,0],null,null,!1,Format.blockMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_BLOCK_THIN,0],null,null,!1,Format.blockThinMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["async",0],null,null,!1,Format.asyncMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_OVAL,0],null,null,!1,Format.ovalMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_DIAMOND,0],null,null,!1,Format.diamondMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],[mxConstants.ARROW_DIAMOND_THIN,0],null,null,!1,Format.diamondThinMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["box",0],null,null,!1,Format.boxMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["halfCircle",0],null,null,!1,Format.halfCircleMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["dash",0],null,null,!1,Format.dashMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["cross",0],null,null,!1,Format.crossMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["circlePlus",0],null,null,!1,Format.circlePlusMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["circle",1],null,null,!1,Format.circleMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["baseDash",0],null,null,!1,Format.baseDashMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERone",0],null,null,!1,Format.EROneMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERmandOne",0],null,null,!1,Format.ERmandOneMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERmany",0],null,null,!1,Format.ERmanyMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERoneToMany",0],null,null,!1,Format.ERoneToManyMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERzeroToOne",0],null,null,!1,Format.ERzeroToOneMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["ERzeroToMany",0],null,null,!1,Format.ERzeroToManyMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["doubleBlock",0],null,null,!1,Format.doubleBlockMarkerImage.src)),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW,"startFill"],["doubleBlock",1],null,null,!1,Format.doubleBlockFilledMarkerImage.src))):this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_STARTARROW],[mxConstants.ARROW_BLOCK],"geIcon geSprite geSprite-startblocktrans",null,!1).setAttribute("title",mxResources.get("block")),e.div.style.width="40px",window.setTimeout(mxUtils.bind(this,(function(){null!=e.div&&mxUtils.fit(e.div)})),0)}}))),I=this.editorUi.toolbar.addMenuFunctionInContainer(C,"geSprite-endclassic",mxResources.get("lineend"),!1,mxUtils.bind(this,(function(e){if("connector"==l.style.shape||"flexArrow"==l.style.shape||"filledEdge"==l.style.shape){var t=this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.NONE,0],"geIcon",null,!1);t.setAttribute("title",mxResources.get("none"));var n=document.createElement("font");n.style.fontSize="10px",mxUtils.write(n,mxResources.get("none")),t.firstChild.firstChild.appendChild(n),"connector"==l.style.shape||"filledEdge"==l.style.shape?(Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_CLASSIC,1],null,null,!1,Format.classicFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_CLASSIC_THIN,1],null,null,!1,Format.classicThinFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_OPEN,0],null,null,!1,Format.openFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_OPEN_THIN,0],null,null,!1,Format.openThinFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["openAsync",0],null,null,!1,Format.openAsyncFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_BLOCK,1],null,null,!1,Format.blockFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_BLOCK_THIN,1],null,null,!1,Format.blockThinFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["async",1],null,null,!1,Format.asyncFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_OVAL,1],null,null,!1,Format.ovalFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_DIAMOND,1],null,null,!1,Format.diamondFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_DIAMOND_THIN,1],null,null,!1,Format.diamondThinFilledMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_CLASSIC,0],null,null,!1,Format.classicMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_CLASSIC_THIN,0],null,null,!1,Format.classicThinMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_BLOCK,0],null,null,!1,Format.blockMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_BLOCK_THIN,0],null,null,!1,Format.blockThinMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["async",0],null,null,!1,Format.asyncMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_OVAL,0],null,null,!1,Format.ovalMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_DIAMOND,0],null,null,!1,Format.diamondMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],[mxConstants.ARROW_DIAMOND_THIN,0],null,null,!1,Format.diamondThinMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["box",0],null,null,!1,Format.boxMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["halfCircle",0],null,null,!1,Format.halfCircleMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["dash",0],null,null,!1,Format.dashMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["cross",0],null,null,!1,Format.crossMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["circlePlus",0],null,null,!1,Format.circlePlusMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["circle",0],null,null,!1,Format.circleMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["baseDash",0],null,null,!1,Format.baseDashMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERone",0],null,null,!1,Format.EROneMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERmandOne",0],null,null,!1,Format.ERmandOneMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERmany",0],null,null,!1,Format.ERmanyMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERoneToMany",0],null,null,!1,Format.ERoneToManyMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERzeroToOne",0],null,null,!1,Format.ERzeroToOneMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["ERzeroToMany",0],null,null,!1,Format.ERzeroToManyMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["doubleBlock",0],null,null,!1,Format.doubleBlockMarkerImage.src),"scaleX(-1)"),Format.processMenuIcon(this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW,"endFill"],["doubleBlock",1],null,null,!1,Format.doubleBlockFilledMarkerImage.src),"scaleX(-1)")):this.editorUi.menus.edgeStyleChange(e,"",[mxConstants.STYLE_ENDARROW],[mxConstants.ARROW_BLOCK],"geIcon geSprite geSprite-endblocktrans",null,!1).setAttribute("title",mxResources.get("block")),e.div.style.width="40px",window.setTimeout(mxUtils.bind(this,(function(){null!=e.div&&mxUtils.fit(e.div)})),0)}}))),A=this.addArrow(x,8);A.nextSibling.style.position="relative",A.nextSibling.style.top="-2px",(A=this.addArrow(b,10)).nextSibling.style.position="relative",A.nextSibling.style.top="-3px",b.getElementsByTagName("img")[0].style.top="-1px",this.addArrow(R),this.addArrow(I);var N=this.addArrow(g,9);N.className="geIcon",N.style.width="auto";var U=this.addArrow(y,9);U.className="geIcon",U.style.width="22px";var M=document.createElement("div");M.style.width="84px",M.style.height="1px",M.style.borderBottom="1px solid "+this.defaultStrokeColor,M.style.marginBottom="7px",N.appendChild(M);var F=document.createElement("div");F.style.width="23px",F.style.height="1px",F.style.borderBottom="1px solid "+this.defaultStrokeColor,F.style.marginBottom="7px",U.appendChild(F),g.style.height="15px",g.style.marginLeft="16px",y.style.height="15px",y.style.marginLeft="3px",x.style.marginLeft="10px",x.style.height="15px",b.style.marginLeft="10px",b.style.height="17px",R.style.marginLeft="3px",R.style.height="17px",I.style.marginLeft="3px",I.style.height="17px",e.appendChild(s),e.appendChild(h),e.appendChild(c);var O,_,w=c.cloneNode(!1);w.style.padding="5px 4px 6px 0px",w.style.fontWeight="normal",(H=document.createElement("div")).style.position="absolute",H.style.marginLeft="0px",H.style.marginBottom="12px",H.style.marginTop="2px",H.style.fontWeight="normal",H.style.width="76px",mxUtils.write(H,mxResources.get("lineend")),w.appendChild(H);var k=this.addUnitInput(w,"pt",98,52,(function(){O.apply(this,arguments)})),D=this.addUnitInput(w,"pt",30,52,(function(){_.apply(this,arguments)}));mxUtils.br(w);var G,P,B=document.createElement("div");B.style.height="8px",w.appendChild(B),H=H.cloneNode(!1),mxUtils.write(H,mxResources.get("linestart")),w.appendChild(H);var Y=this.addUnitInput(w,"pt",98,52,(function(){G.apply(this,arguments)})),W=this.addUnitInput(w,"pt",30,52,(function(){P.apply(this,arguments)}));mxUtils.br(w),this.addLabel(w,mxResources.get("spacing"),98,52),this.addLabel(w,mxResources.get("size"),30,52),mxUtils.br(w);var H,j,z=s.cloneNode(!1);z.style.fontWeight="normal",z.style.position="relative",z.style.paddingLeft="16px",z.style.marginBottom="2px",z.style.marginTop="6px",z.style.borderWidth="0px",z.style.paddingBottom="18px",(H=document.createElement("div")).style.position="absolute",H.style.marginLeft="3px",H.style.marginBottom="12px",H.style.marginTop="1px",H.style.fontWeight="normal",H.style.width="120px",mxUtils.write(H,mxResources.get("perimeter")),z.appendChild(H);var V=this.addUnitInput(z,"pt",30,52,(function(){j.apply(this,arguments)}));l.edges.length==l.cells.length?(e.appendChild(C),e.appendChild(w)):l.vertices.length==l.cells.length&&e.appendChild(z);var K=mxUtils.bind(this,(function(n,s,a){if(l=t.getSelectionState(),a||document.activeElement!=E){var o=parseFloat(mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1));E.value=isNaN(o)?"":o+" pt"}(a||document.activeElement!=S)&&(o=parseFloat(mxUtils.getValue(l.style,mxConstants.STYLE_STROKEWIDTH,1)),S.value=isNaN(o)?"":o+" pt"),i.style.visibility="connector"==l.style.shape||"filledEdge"==l.style.shape?"":"hidden","1"==mxUtils.getValue(l.style,mxConstants.STYLE_CURVED,null)?i.value="curved":"1"==mxUtils.getValue(l.style,mxConstants.STYLE_ROUNDED,null)&&(i.value="rounded"),"1"==mxUtils.getValue(l.style,mxConstants.STYLE_DASHED,null)?null==mxUtils.getValue(l.style,mxConstants.STYLE_DASH_PATTERN,null)?M.style.borderBottom="1px dashed "+this.defaultStrokeColor:M.style.borderBottom="1px dotted "+this.defaultStrokeColor:M.style.borderBottom="1px solid "+this.defaultStrokeColor,F.style.borderBottom=M.style.borderBottom;var r=b.getElementsByTagName("div")[0];if(null!=r){var d=mxUtils.getValue(l.style,mxConstants.STYLE_EDGE,null);"1"==mxUtils.getValue(l.style,mxConstants.STYLE_NOEDGESTYLE,null)&&(d=null),"orthogonalEdgeStyle"==d&&"1"==mxUtils.getValue(l.style,mxConstants.STYLE_CURVED,null)?r.className="geSprite geSprite-curved":r.className="straight"==d||"none"==d||null==d?"geSprite geSprite-straight":"entityRelationEdgeStyle"==d?"geSprite geSprite-entity":"elbowEdgeStyle"==d?"geSprite "+("vertical"==mxUtils.getValue(l.style,mxConstants.STYLE_ELBOW,null)?"geSprite-verticalelbow":"geSprite-horizontalelbow"):"isometricEdgeStyle"==d?"geSprite "+("vertical"==mxUtils.getValue(l.style,mxConstants.STYLE_ELBOW,null)?"geSprite-verticalisometric":"geSprite-horizontalisometric"):"geSprite geSprite-orthogonal"}var u=x.getElementsByTagName("div")[0];function m(e,n,s,i){var a=s.getElementsByTagName("div")[0];return null!=a&&(a.className=t.getCssClassForMarker(i,l.style.shape,e,n),a.nextSibling.style.marginLeft="1px",a.nextSibling.style.paddingRight="5px","geSprite geSprite-noarrow"==a.className?(a.innerHTML=mxUtils.htmlEntities(mxResources.get("none")),a.style.backgroundImage="none",a.style.verticalAlign="top",a.style.marginTop="4px",a.style.fontSize="10px",a.style.filter="none",a.style.color=this.defaultStrokeColor,a.nextSibling.style.marginTop="0px"):(a.nextSibling.style.position="relative",a.nextSibling.style.top="-2px")),a}null!=u&&("link"==l.style.shape?u.className="geSprite geSprite-linkedge":"flexArrow"==l.style.shape?u.className="geSprite geSprite-arrow":"arrow"==l.style.shape?u.className="geSprite geSprite-simplearrow":u.className="geSprite geSprite-connection"),l.edges.length==l.cells.length?(h.style.display="",c.style.display="none"):(h.style.display="none",c.style.display=""),Graph.lineJumpsEnabled&&l.edges.length>0&&0==l.vertices.length&&l.lineJumps&&(e.style.borderBottomStyle="none");var p=m(mxUtils.getValue(l.style,mxConstants.STYLE_STARTARROW,null),mxUtils.getValue(l.style,"startFill","1"),R,"start"),g=m(mxUtils.getValue(l.style,mxConstants.STYLE_ENDARROW,null),mxUtils.getValue(l.style,"endFill","1"),I,"end");null!=p&&null!=g&&("arrow"==l.style.shape?(p.className="geSprite geSprite-noarrow",g.className="geSprite geSprite-endblocktrans"):"link"==l.style.shape&&(p.className="geSprite geSprite-noarrow",g.className="geSprite geSprite-noarrow")),mxUtils.setOpacity(b,"arrow"==l.style.shape?30:100),"connector"!=l.style.shape&&"flexArrow"!=l.style.shape&&"filledEdge"!=l.style.shape?(mxUtils.setOpacity(R,30),mxUtils.setOpacity(I,30)):(mxUtils.setOpacity(R,100),mxUtils.setOpacity(I,100)),(a||document.activeElement!=W)&&(o=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE)),W.value=isNaN(o)?"":o+" pt"),(a||document.activeElement!=Y)&&(o=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_SOURCE_PERIMETER_SPACING,0)),Y.value=isNaN(o)?"":o+" pt"),(a||document.activeElement!=D)&&(o=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE)),D.value=isNaN(o)?"":o+" pt"),(a||document.activeElement!=Y)&&(o=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_TARGET_PERIMETER_SPACING,0)),k.value=isNaN(o)?"":o+" pt"),(a||document.activeElement!=V)&&(o=parseInt(mxUtils.getValue(l.style,mxConstants.STYLE_PERIMETER_SPACING,0)),V.value=isNaN(o)?"":o+" pt")}));return P=this.installInputHandler(W,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_MARKERSIZE,0,999," pt"),G=this.installInputHandler(Y,mxConstants.STYLE_SOURCE_PERIMETER_SPACING,0,-999,999," pt"),_=this.installInputHandler(D,mxConstants.STYLE_ENDSIZE,mxConstants.DEFAULT_MARKERSIZE,0,999," pt"),O=this.installInputHandler(k,mxConstants.STYLE_TARGET_PERIMETER_SPACING,0,-999,999," pt"),j=this.installInputHandler(V,mxConstants.STYLE_PERIMETER_SPACING,0,0,999," pt"),this.addKeyHandler(E,K),this.addKeyHandler(W,K),this.addKeyHandler(Y,K),this.addKeyHandler(D,K),this.addKeyHandler(k,K),this.addKeyHandler(V,K),n.getModel().addListener(mxEvent.CHANGE,K),this.listeners.push({destroy:function(){n.getModel().removeListener(K)}}),K(),e},StyleFormatPanel.prototype.addLineJumps=function(e){var t=this.editorUi,n=t.editor.graph,l=t.getSelectionState();if(Graph.lineJumpsEnabled&&l.edges.length>0&&0==l.vertices.length&&l.lineJumps){e.style.padding="2px 0px 24px 14px";var s=document.createElement("div");s.style.position="absolute",s.style.maxWidth="82px",s.style.overflow="hidden",s.style.textOverflow="ellipsis",mxUtils.write(s,mxResources.get("lineJumps")),e.appendChild(s);var i=document.createElement("select");i.style.position="absolute",i.style.height="21px",i.style.padding="0px",i.style.marginTop="-2px",i.style.boxSizing="border-box",i.style.right="76px",i.style.width="54px",i.style.border="1px solid rgb(160, 160, 160)",i.style.borderRadius="4px";for(var a,o=["none","arc","gap","sharp","line"],r=0;r<o.length;r++){var d=document.createElement("option");d.setAttribute("value",o[r]),mxUtils.write(d,mxResources.get(o[r])),i.appendChild(d)}mxEvent.addListener(i,"change",(function(e){n.getModel().beginUpdate();try{n.setCellStyles("jumpStyle",i.value,l.cells),t.fireEvent(new mxEventObject("styleChanged","keys",["jumpStyle"],"values",[i.value],"cells",l.cells))}finally{n.getModel().endUpdate()}mxEvent.consume(e)})),mxEvent.addListener(i,"click",(function(e){mxEvent.consume(e)})),e.appendChild(i);var u=this.addUnitInput(e,"pt",16,42,(function(){a.apply(this,arguments)}));a=this.installInputHandler(u,"jumpSize",Graph.defaultJumpSize,0,999," pt");var m=mxUtils.bind(this,(function(e,n,s){if(l=t.getSelectionState(),i.value=mxUtils.getValue(l.style,"jumpStyle","none"),s||document.activeElement!=u){var a=parseInt(mxUtils.getValue(l.style,"jumpSize",Graph.defaultJumpSize));u.value=isNaN(a)?"":a+" pt"}}));this.addKeyHandler(u,m),n.getModel().addListener(mxEvent.CHANGE,m),this.listeners.push({destroy:function(){n.getModel().removeListener(m)}}),m()}else e.style.display="none";return e},StyleFormatPanel.prototype.addEffects=function(e){var t=this.editorUi,n=t.editor.graph,l=t.getSelectionState();e.style.paddingTop="4px",e.style.paddingBottom="0px";var s=document.createElement("table");s.style.width="210px",s.style.fontWeight="bold",s.style.tableLayout="fixed";var i=document.createElement("tbody"),a=document.createElement("tr");a.style.padding="0px";var o=document.createElement("td");o.style.padding="0px",o.style.width="50%",o.setAttribute("valign","top");var r=o.cloneNode(!0);r.style.paddingLeft="8px",a.appendChild(o),a.appendChild(r),i.appendChild(a),s.appendChild(i),e.appendChild(s);var d=o,u=mxUtils.bind(this,(function(e,t,n){var l=this.createCellOption(e,t,n);l.style.width="100%",d.appendChild(l),d=d==o?r:o})),m=mxUtils.bind(this,(function(e,n,s){l=t.getSelectionState(),o.innerHTML="",r.innerHTML="",d=o,l.rounded&&u(mxResources.get("rounded"),mxConstants.STYLE_ROUNDED,0),l.swimlane&&u(mxResources.get("divider"),"swimlaneLine",1),l.containsImage||u(mxResources.get("shadow"),mxConstants.STYLE_SHADOW,0),l.glass&&u(mxResources.get("glass"),mxConstants.STYLE_GLASS,0),u(mxResources.get("sketch"),"sketch",0)}));return n.getModel().addListener(mxEvent.CHANGE,m),this.listeners.push({destroy:function(){n.getModel().removeListener(m)}}),m(),e},StyleFormatPanel.prototype.addStyleOps=function(e){return e.style.paddingTop="10px",e.style.paddingBottom="10px",this.addActions(e,["setAsDefaultStyle"]),e},DiagramStylePanel=function(e,t,n){BaseFormatPanel.call(this,e,t,n),this.init()},mxUtils.extend(DiagramStylePanel,BaseFormatPanel),DiagramStylePanel.prototype.init=function(){var e=this.editorUi;e.editor.graph,this.darkModeChangedListener=mxUtils.bind(this,(function(){this.format.cachedStyleEntries=[]})),e.addListener("darkModeChanged",this.darkModeChangedListener),this.container.appendChild(this.addView(this.createPanel()))},DiagramStylePanel.prototype.addView=function(e){var t=this.editorUi,n=t.editor.graph,l=n.getModel();e.style.whiteSpace="normal";var s="1"==n.currentVertexStyle.sketch&&"1"==n.currentEdgeStyle.sketch,i="1"==n.currentVertexStyle.rounded,a="1"==n.currentEdgeStyle.curved,o=document.createElement("div");o.style.paddingBottom="12px",o.style.marginRight="16px",e.style.paddingTop="8px";var r=document.createElement("table");r.style.width="210px",r.style.fontWeight="bold";var d=document.createElement("tbody"),u=document.createElement("tr");u.style.padding="0px",(R=document.createElement("td")).style.padding="0px",R.style.width="50%",R.setAttribute("valign","middle"),(I=R.cloneNode(!0)).style.paddingLeft="8px",u.appendChild(R),u.appendChild(I),d.appendChild(u),r.appendChild(d),R.appendChild(this.createOption(mxResources.get("sketch"),(function(){return s}),(function(e){s=e,e?(n.currentEdgeStyle.sketch="1",n.currentVertexStyle.sketch="1"):(delete n.currentEdgeStyle.sketch,delete n.currentVertexStyle.sketch),n.updateCellStyles({sketch:e?"1":null},n.getVerticesAndEdges())}),null,(function(e){e.style.width="auto"}))),I.appendChild(this.createOption(mxResources.get("rounded"),(function(){return i}),(function(e){i=e,e?(n.currentEdgeStyle.rounded="1",n.currentVertexStyle.rounded="1"):(delete n.currentEdgeStyle.rounded,delete n.currentVertexStyle.rounded),n.updateCellStyles({rounded:e?"1":"0"},n.getVerticesAndEdges())}),null,(function(e){e.style.width="auto"}))),R=R.cloneNode(!1),I=I.cloneNode(!1),(u=u.cloneNode(!1)).appendChild(R),u.appendChild(I),d.appendChild(u),R.appendChild(this.createOption(mxResources.get("curved"),(function(){return a}),(function(e){a=e,e?n.currentEdgeStyle.curved="1":delete n.currentEdgeStyle.curved,n.updateCellStyles({curved:e?"1":null},n.getVerticesAndEdges(!1,!0))}),null,(function(e){e.style.width="auto"}))),o.appendChild(r),e.appendChild(o);var m=["fillColor","strokeColor","fontColor","gradientColor"],c=mxUtils.bind(this,(function(e,t){var s=n.getVerticesAndEdges();l.beginUpdate();try{for(var i=0;i<s.length;i++){var a=n.getCellStyle(s[i]);null!=a.labelBackgroundColor&&n.updateCellStyles({labelBackgroundColor:null!=t?t.background:null},[s[i]]);for(var o=l.isEdge(s[i]),r=l.getStyle(s[i]),d=o?n.currentEdgeStyle:n.currentVertexStyle,u=0;u<e.length;u++)(null!=a[e[u]]&&a[e[u]]!=mxConstants.NONE||e[u]!=mxConstants.STYLE_FILLCOLOR&&e[u]!=mxConstants.STYLE_STROKECOLOR)&&(r=mxUtils.setStyle(r,e[u],d[e[u]]));l.setStyle(s[i],r)}}finally{l.endUpdate()}})),p=mxUtils.bind(this,(function(e,t,n){if(null!=e)for(var l=0;l<t.length;l++)(null!=e[t[l]]&&e[t[l]]!=mxConstants.NONE||t[l]!=mxConstants.STYLE_FILLCOLOR&&t[l]!=mxConstants.STYLE_STROKECOLOR)&&(e[t[l]]=n[t[l]])})),g=mxUtils.bind(this,(function(e,t,l,s,i){if(null!=e){if(null!=l&&null!=t.labelBackgroundColor){var a=null!=s?s.background:null;i=null!=i?i:n,null==a&&(a=i.background),null==a&&(a=i.defaultPageBackgroundColor),t.labelBackgroundColor=a}for(var o in e)(null==l||null!=t[o]&&t[o]!=mxConstants.NONE||o!=mxConstants.STYLE_FILLCOLOR&&o!=mxConstants.STYLE_STROKECOLOR)&&(t[o]=e[o])}})),h=mxUtils.button(mxResources.get("reset"),mxUtils.bind(this,(function(e){var s=n.getVerticesAndEdges(!0,!0);if(s.length>0){l.beginUpdate();try{n.updateCellStyles({sketch:null,rounded:null},s),n.updateCellStyles({curved:null},n.getVerticesAndEdges(!1,!0))}finally{l.endUpdate()}}t.clearDefaultStyle()})));h.setAttribute("title",mxResources.get("reset")),h.style.textOverflow="ellipsis",h.style.maxWidth="90px",I.appendChild(h);var x=mxUtils.bind(this,(function(e,t,s,i,a){var o=document.createElement("div");o.style.position="absolute",o.style.display="inline-block",o.style.overflow="hidden",o.style.pointerEvents="none",o.style.width="100%",o.style.height="100%",a.appendChild(o);var r=new Graph(o,null,null,n.getStylesheet());r.resetViewOnRootChange=!1,r.foldingEnabled=!1,r.gridEnabled=!1,r.autoScroll=!1,r.setTooltips(!1),r.setConnectable(!1),r.setPanning(!1),r.setEnabled(!1),r.getCellStyle=function(a,o){o=null==o||o;var d=mxUtils.clone(n.getCellStyle.apply(this,arguments)),u=n.stylesheet.getDefaultVertexStyle(),c=t;return l.isEdge(a)&&(u=n.stylesheet.getDefaultEdgeStyle(),c=s),p(d,m,u),g(e,d,a,i,r),g(c,d,a,i,r),o&&(d=n.postProcessCellStyle(a,d)),d},r.model.beginUpdate();try{var d=r.insertVertex(r.getDefaultParent(),null,"Shape",14,8,70,40,"strokeWidth=2;"),u=r.insertEdge(r.getDefaultParent(),null,"Connector",d,d,"edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;endSize=5;strokeWidth=2;");u.geometry.points=[new mxPoint(32,70)],u.geometry.offset=new mxPoint(0,8)}finally{r.model.endUpdate()}})),y=document.createElement("div");y.style.position="relative",e.appendChild(y),null==this.format.cachedStyleEntries&&(this.format.cachedStyleEntries=[]);var C=mxUtils.bind(this,(function(e,o,r,d,u){var h=this.format.cachedStyleEntries[u];null==h&&((h=document.createElement("div")).style.display="inline-block",h.style.position="relative",h.style.width="96px",h.style.height="90px",h.style.cursor="pointer",h.style.border="1px solid gray",h.style.borderRadius="8px",h.style.margin="2px",h.style.overflow="hidden",null!=d&&null!=d.background&&(h.style.backgroundColor=d.background),x(e,o,r,d,h),mxEvent.addGestureListeners(h,mxUtils.bind(this,(function(e){h.style.opacity=.5})),null,mxUtils.bind(this,(function(u){h.style.opacity=1,n.currentVertexStyle=mxUtils.clone(n.defaultVertexStyle),n.currentEdgeStyle=mxUtils.clone(n.defaultEdgeStyle),g(e,n.currentVertexStyle),g(e,n.currentEdgeStyle),g(o,n.currentVertexStyle),g(r,n.currentEdgeStyle),s?(n.currentEdgeStyle.sketch="1",n.currentVertexStyle.sketch="1"):(n.currentEdgeStyle.sketch="0",n.currentVertexStyle.sketch="0"),i?(n.currentVertexStyle.rounded="1",n.currentEdgeStyle.rounded="1"):(n.currentVertexStyle.rounded="0",n.currentEdgeStyle.rounded="1"),n.currentEdgeStyle.curved=a?"1":"0",l.beginUpdate();try{c(function(e,t){for(var n in e)t.push(n);return t}(e,m.slice()),d);var p=new ChangePageSetup(t,null!=d?d.background:null);p.ignoreImage=!0,l.execute(p),l.execute(new ChangeGridColor(t,null!=d&&null!=d.gridColor?d.gridColor:n.view.defaultGridColor))}finally{l.endUpdate()}}))),mxEvent.addListener(h,"mouseenter",mxUtils.bind(this,(function(t){var s=n.getCellStyle,i=n.background,a=n.view.gridColor;n.background=null!=d?d.background:null,n.view.gridColor=null!=d&&null!=d.gridColor?d.gridColor:n.view.defaultGridColor,n.getCellStyle=function(t,i){i=null==i||i;var a=mxUtils.clone(s.apply(this,arguments)),u=n.stylesheet.getDefaultVertexStyle(),c=o;return l.isEdge(t)&&(u=n.stylesheet.getDefaultEdgeStyle(),c=r),p(a,m,u),g(e,a,t,d),g(c,a,t,d),i&&(a=this.postProcessCellStyle(t,a)),a},n.refresh(),n.getCellStyle=s,n.background=i,n.view.gridColor=a}))),mxEvent.addListener(h,"mouseleave",mxUtils.bind(this,(function(e){n.refresh()}))),mxClient.IS_IE||mxClient.IS_IE11||(this.format.cachedStyleEntries[u]=h)),y.appendChild(h)})),E=Math.ceil(Editor.styles.length/10);this.format.currentStylePage=null!=this.format.currentStylePage?this.format.currentStylePage:0;var S=[],f=mxUtils.bind(this,(function(){S.length>0&&(S[this.format.currentStylePage].style.background="#84d7ff");for(var e=10*this.format.currentStylePage;e<Math.min(10*(this.format.currentStylePage+1),Editor.styles.length);e++){var t=Editor.styles[e];C(t.commonStyle,t.vertexStyle,t.edgeStyle,t.graph,e)}})),v=mxUtils.bind(this,(function(e){e>=0&&e<E&&(S[this.format.currentStylePage].style.background="transparent",y.innerHTML="",this.format.currentStylePage=e,f())}));if(E>1){var L=document.createElement("div");L.style.whiteSpace="nowrap",L.style.position="relative",L.style.textAlign="center",L.style.paddingTop="4px",L.style.width="210px",e.style.paddingBottom="8px";for(var T=0;T<E;T++){var b=document.createElement("div");b.style.display="inline-block",b.style.width="6px",b.style.height="6px",b.style.marginLeft="4px",b.style.marginRight="3px",b.style.borderRadius="3px",b.style.cursor="pointer",b.style.background="transparent",b.style.border="1px solid #b5b6b7",mxUtils.bind(this,(function(e,t){mxEvent.addListener(b,"click",mxUtils.bind(this,(function(){v(e)})))}))(T,b),L.appendChild(b),S.push(b)}if(e.appendChild(L),f(),E<15){var R,I;function A(e){mxEvent.addListener(e,"mouseenter",(function(){e.style.opacity="1"})),mxEvent.addListener(e,"mouseleave",(function(){e.style.opacity="0.5"}))}(R=document.createElement("div")).style.position="absolute",R.style.left="0px",R.style.top="0px",R.style.bottom="0px",R.style.width="24px",R.style.height="24px",R.style.margin="0px",R.style.cursor="pointer",R.style.opacity="0.5",R.style.backgroundRepeat="no-repeat",R.style.backgroundPosition="center center",R.style.backgroundSize="24px 24px",R.style.backgroundImage="url("+Editor.previousImage+")",Editor.isDarkMode()&&(R.style.filter="invert(100%)"),(I=R.cloneNode(!1)).style.backgroundImage="url("+Editor.nextImage+")",I.style.left="",I.style.right="2px",L.appendChild(R),L.appendChild(I),mxEvent.addListener(R,"click",mxUtils.bind(this,(function(){v(mxUtils.mod(this.format.currentStylePage-1,E))}))),mxEvent.addListener(I,"click",mxUtils.bind(this,(function(){v(mxUtils.mod(this.format.currentStylePage+1,E))}))),A(R),A(I)}}else f();return e},DiagramStylePanel.prototype.destroy=function(){BaseFormatPanel.prototype.destroy.apply(this,arguments),this.darkModeChangedListener&&(this.editorUi.removeListener(this.darkModeChangedListener),this.darkModeChangedListener=null)},DiagramFormatPanel=function(e,t,n){BaseFormatPanel.call(this,e,t,n),this.init()},mxUtils.extend(DiagramFormatPanel,BaseFormatPanel),DiagramFormatPanel.showPageView=!0,DiagramFormatPanel.prototype.showBackgroundImageOption=!0,DiagramFormatPanel.prototype.init=function(){var e=this.editorUi.editor.graph;this.container.appendChild(this.addView(this.createPanel())),e.isEnabled()&&(this.container.appendChild(this.addOptions(this.createPanel())),this.container.appendChild(this.addPaperSize(this.createPanel())),this.container.appendChild(this.addStyleOps(this.createPanel())))},DiagramFormatPanel.prototype.addView=function(e){var t=this.editorUi,n=t.editor.graph;if(e.appendChild(this.createTitle(mxResources.get("view"))),this.addGridOption(e),DiagramFormatPanel.showPageView&&e.appendChild(this.createOption(mxResources.get("pageView"),(function(){return n.pageVisible}),(function(e){t.actions.get("pageView").funct()}),{install:function(e){this.listener=function(){e(n.pageVisible)},t.addListener("pageViewChanged",this.listener)},destroy:function(){t.removeListener(this.listener)}})),n.isEnabled()){var l=this.createColorOption(mxResources.get("background"),(function(){return n.background}),(function(e){var l=new ChangePageSetup(t,e);l.ignoreImage=!0,n.model.execute(l)}),"#ffffff",{install:function(e){this.listener=function(){e(n.background)},t.addListener("backgroundColorChanged",this.listener)},destroy:function(){t.removeListener(this.listener)}});if(this.showBackgroundImageOption){var s=l.getElementsByTagName("span")[0];s.style.display="inline-block",s.style.textOverflow="ellipsis",s.style.overflow="hidden",s.style.maxWidth="68px",mxClient.IS_FF&&(s.style.marginTop="1px");var i=mxUtils.button(mxResources.get("change"),(function(e){t.showBackgroundImageDialog(null,t.editor.graph.backgroundImage),mxEvent.consume(e)}));i.className="geColorBtn",i.style.position="absolute",i.style.marginTop="-3px",i.style.height="22px",i.style.left="118px",i.style.width="56px",l.appendChild(i)}e.appendChild(l)}return e},DiagramFormatPanel.prototype.addOptions=function(e){var t=this.editorUi,n=t.editor.graph;return e.appendChild(this.createTitle(mxResources.get("options"))),n.isEnabled()&&(e.appendChild(this.createOption(mxResources.get("connectionArrows"),(function(){return n.connectionArrowsEnabled}),(function(e){t.actions.get("connectionArrows").funct()}),{install:function(e){this.listener=function(){e(n.connectionArrowsEnabled)},t.addListener("connectionArrowsChanged",this.listener)},destroy:function(){t.removeListener(this.listener)}})),e.appendChild(this.createOption(mxResources.get("connectionPoints"),(function(){return n.connectionHandler.isEnabled()}),(function(e){t.actions.get("connectionPoints").funct()}),{install:function(e){this.listener=function(){e(n.connectionHandler.isEnabled())},t.addListener("connectionPointsChanged",this.listener)},destroy:function(){t.removeListener(this.listener)}})),e.appendChild(this.createOption(mxResources.get("guides"),(function(){return n.graphHandler.guidesEnabled}),(function(e){t.actions.get("guides").funct()}),{install:function(e){this.listener=function(){e(n.graphHandler.guidesEnabled)},t.addListener("guidesEnabledChanged",this.listener)},destroy:function(){t.removeListener(this.listener)}}))),e},DiagramFormatPanel.prototype.addGridOption=function(e){var t=this,n=this.editorUi,l=n.editor.graph,s=document.createElement("input");s.style.position="absolute",s.style.textAlign="right",s.style.width="48px",s.style.marginTop="-2px",s.style.height="21px",s.style.border="1px solid rgb(160, 160, 160)",s.style.borderRadius="4px",s.style.boxSizing="border-box",s.value=this.inUnit(l.getGridSize())+" "+this.getUnit();var i=this.createStepper(s,a,this.getUnitStep(),null,null,null,this.isFloatUnit());function a(e){var n=t.isFloatUnit()?parseFloat(s.value):parseInt(s.value);(n=t.fromUnit(Math.max(t.inUnit(1),isNaN(n)?t.inUnit(10):n)))!=l.getGridSize()&&(mxGraph.prototype.gridSize=n,l.setGridSize(n)),s.value=t.inUnit(n)+" "+t.getUnit(),mxEvent.consume(e)}s.style.display=l.isGridEnabled()?"":"none",i.style.display=s.style.display,mxEvent.addListener(s,"keydown",(function(e){13==e.keyCode?(l.container.focus(),mxEvent.consume(e)):27==e.keyCode&&(s.value=l.getGridSize(),l.container.focus(),mxEvent.consume(e))})),mxEvent.addListener(s,"blur",a),mxEvent.addListener(s,"change",a),s.style.right="78px",i.style.marginTop="-17px",i.style.right="66px";var o=this.createColorOption(mxResources.get("grid"),(function(){var e=l.view.gridColor;return l.isGridEnabled()?e:null}),(function(e){var t=l.isGridEnabled();e==mxConstants.NONE?l.setGridEnabled(!1):(l.setGridEnabled(!0),n.setGridColor(e)),s.style.display=l.isGridEnabled()?"":"none",i.style.display=s.style.display,t!=l.isGridEnabled()&&(l.defaultGridEnabled=l.isGridEnabled(),n.fireEvent(new mxEventObject("gridEnabledChanged")))}),Editor.isDarkMode()?l.view.defaultDarkGridColor:l.view.defaultGridColor,{install:function(e){this.listener=function(){e(l.isGridEnabled()?l.view.gridColor:null)},n.addListener("gridColorChanged",this.listener),n.addListener("gridEnabledChanged",this.listener)},destroy:function(){n.removeListener(this.listener)}});o.appendChild(s),o.appendChild(i),e.appendChild(o)},DiagramFormatPanel.prototype.addDocumentProperties=function(e){return this.editorUi.editor.graph,e.appendChild(this.createTitle(mxResources.get("options"))),e},DiagramFormatPanel.prototype.addPaperSize=function(e){var t=this.editorUi,n=t.editor.graph;e.appendChild(this.createTitle(mxResources.get("paperSize")));var l=PageSetupDialog.addPageFormatPanel(e,"formatpanel",n.pageFormat,(function(e){if(null==n.pageFormat||n.pageFormat.width!=e.width||n.pageFormat.height!=e.height){var l=new ChangePageSetup(t,null,null,e);l.ignoreColor=!0,l.ignoreImage=!0,n.model.execute(l)}}));this.addKeyHandler(l.widthInput,(function(){l.set(n.pageFormat)})),this.addKeyHandler(l.heightInput,(function(){l.set(n.pageFormat)}));var s=function(){l.set(n.pageFormat)};return t.addListener("pageFormatChanged",s),this.listeners.push({destroy:function(){t.removeListener(s)}}),n.getModel().addListener(mxEvent.CHANGE,s),this.listeners.push({destroy:function(){n.getModel().removeListener(s)}}),e},DiagramFormatPanel.prototype.addStyleOps=function(e){return this.addActions(e,["editData"]),this.addActions(e,["clearDefaultStyle"]),e},DiagramFormatPanel.prototype.destroy=function(){BaseFormatPanel.prototype.destroy.apply(this,arguments),this.gridEnabledListener&&(this.editorUi.removeListener(this.gridEnabledListener),this.gridEnabledListener=null)};