diff --git a/ChangeLog b/ChangeLog
index 6870eb02fb..4ef10c02e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+05-MAY-2022: 18.0.1
+
+- Adds support for windows line break in CSV files
+- [conf cloud] Fixes trailing space in diagram name during page IDs import
+- FIxes timestamp check in watchFile [819] [DND-487]
+- Hides menus and dropdowns if clicked again [2745]
+- Fixes cursor handling for composite cells [2756]
+- [desktop] Adds strict CSP after loading plugins (disabling unsafe-inline scripts)
+
04-MAY-2022: 18.0.0
- Replaces sanitizer with DOMpurify
diff --git a/VERSION b/VERSION
index 03191c968c..1bb332bc46 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-18.0.0
\ No newline at end of file
+18.0.1
\ No newline at end of file
diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js
index b3c500b02e..63b3e9e728 100644
--- a/src/main/webapp/js/app.min.js
+++ b/src/main/webapp/js/app.min.js
@@ -468,7 +468,7 @@ a),DRAWIO_GITLAB_URL=a);a=urlParams["gitlab-id"];null!=a&&(DRAWIO_GITLAB_ID=a);w
if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local||"1"==urlParams.lockdown)urlParams.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0";
"se.diagrams.net"==window.location.hostname&&(urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.gl="0",urlParams.tr="0",urlParams.plugins="0",urlParams.mode="google",urlParams.lockdown="1",window.DRAWIO_GOOGLE_APP_ID=window.DRAWIO_GOOGLE_APP_ID||"184079235871",window.DRAWIO_GOOGLE_CLIENT_ID=window.DRAWIO_GOOGLE_CLIENT_ID||"184079235871-pjf5nn0lff27lk8qf0770gmffiv9gt61.apps.googleusercontent.com");"trello"==urlParams.mode&&(urlParams.tr="1");
"embed.diagrams.net"==window.location.hostname&&(urlParams.embed="1");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
-window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"18.0.0",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),
+window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"mxgraph";window.mxImageBasePath=window.mxImageBasePath||"mxgraph/images";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de","se"];var mxClient={VERSION:"18.0.1",IS_IE:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("MSIE"),IS_IE11:null!=navigator.userAgent&&!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:null!=navigator.userAgent&&!!navigator.userAgent.match(/Edge\//),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&0>navigator.userAgent.indexOf("Edge/"),
IS_OP:null!=navigator.userAgent&&(0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/")),IS_OT:null!=navigator.userAgent&&0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:/Apple Computer, Inc/.test(navigator.vendor),
IS_ANDROID:0<=navigator.appVersion.indexOf("Android"),IS_IOS:/iP(hone|od|ad)/.test(navigator.platform)||navigator.userAgent.match(/Mac/)&&navigator.maxTouchPoints&&2 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
'+mxResources.get("formatted")+"";c("","blockquote").firstChild.nextSibling.innerHTML='
'+mxResources.get("blockquote")+""})));this.put("fontSize",new Menu(mxUtils.bind(this,function(c,d){var e= [6,8,9,10,11,12,14,18,24,36,48,72];0>mxUtils.indexOf(e,this.defaultFontSize)&&(e.push(this.defaultFontSize),e.sort(function(a,b){return a-b}));for(var f=mxUtils.bind(this,function(c){if(null!=b.cellEditor.textarea){document.execCommand("fontSize",!1,"3");for(var d=b.cellEditor.textarea.getElementsByTagName("font"),e=0;e
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
","Textbox",null,null,"text textbox textarea"),this.createVertexTemplateEntry("ellipse;whiteSpace=wrap;html=1;",120,80,"","Ellipse",null,null,"oval ellipse state"),this.createVertexTemplateEntry("whiteSpace=wrap;html=1;aspect=fixed;",80,80,"","Square",null,null,"square"),this.createVertexTemplateEntry("ellipse;whiteSpace=wrap;html=1;aspect=fixed;", @@ -2753,37 +2753,37 @@ a.geometry.setTerminalPoint(new mxPoint(0,0),!0);a.geometry.setTerminalPoint(new 0,"Use","Dependency",null,"uml dependency use"),this.createEdgeTemplateEntry("endArrow=block;endSize=16;endFill=0;html=1;",160,0,"Extends","Generalization",null,"uml generalization extend"),this.createEdgeTemplateEntry("endArrow=block;startArrow=block;endFill=1;startFill=1;html=1;",160,0,"","Association 2",null,"uml association"),this.createEdgeTemplateEntry("endArrow=open;startArrow=circlePlus;endFill=0;startFill=0;endSize=8;html=1;",160,0,"","Inner Class",null,"uml inner class"),this.createEdgeTemplateEntry("endArrow=open;startArrow=cross;endFill=0;startFill=0;endSize=8;startSize=10;html=1;", 160,0,"","Terminate",null,"uml terminate"),this.createEdgeTemplateEntry("endArrow=block;dashed=1;endFill=0;endSize=12;html=1;",160,0,"","Implementation",null,"uml realization implementation"),this.createEdgeTemplateEntry("endArrow=diamondThin;endFill=0;endSize=24;html=1;",160,0,"","Aggregation 2",null,"uml aggregation"),this.createEdgeTemplateEntry("endArrow=diamondThin;endFill=1;endSize=24;html=1;",160,0,"","Composition 2",null,"uml composition"),this.createEdgeTemplateEntry("endArrow=open;endFill=1;endSize=12;html=1;", 160,0,"","Association 3",null,"uml association")];this.addPaletteFunctions("uml",mxResources.get("uml"),a||!1,f);this.setCurrentSearchEntryLibrary()};Sidebar.prototype.createTitle=function(a){var b=document.createElement("a");b.setAttribute("title",mxResources.get("sidebarTooltip"));b.className="geTitle";mxUtils.write(b,a);return b}; -Sidebar.prototype.createThumb=function(a,b,d,c,f,e,l){this.graph.labelsVisible=null==e||e;e=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject;this.graph.view.scaleAndTranslate(1,0,0);this.graph.addCells(a);a=this.graph.getGraphBounds();var k=Math.floor(100*Math.min((b-2*this.thumbBorder)/a.width,(d-2*this.thumbBorder)/a.height))/100;this.graph.view.scaleAndTranslate(k,Math.floor((b-a.width*k)/2/k-a.x),Math.floor((d-a.height*k)/2/k-a.y));this.graph.dialect!=mxConstants.DIALECT_SVG|| -mxClient.NO_FO||null==this.graph.view.getCanvas().ownerSVGElement?(k=this.graph.container.cloneNode(!1),k.innerHTML=this.graph.container.innerHTML):k=this.graph.view.getCanvas().ownerSVGElement.cloneNode(!0);this.graph.getModel().clear();mxClient.NO_FO=e;k.style.position="relative";k.style.overflow="hidden";k.style.left=this.thumbBorder+"px";k.style.top=this.thumbBorder+"px";k.style.width=b+"px";k.style.height=d+"px";k.style.visibility="";k.style.minWidth="";k.style.minHeight="";c.appendChild(k); +Sidebar.prototype.createThumb=function(a,b,d,c,f,e,l){this.graph.labelsVisible=null==e||e;e=mxClient.NO_FO;mxClient.NO_FO=Editor.prototype.originalNoForeignObject;this.graph.view.scaleAndTranslate(1,0,0);this.graph.addCells(a);a=this.graph.getGraphBounds();var g=Math.floor(100*Math.min((b-2*this.thumbBorder)/a.width,(d-2*this.thumbBorder)/a.height))/100;this.graph.view.scaleAndTranslate(g,Math.floor((b-a.width*g)/2/g-a.x),Math.floor((d-a.height*g)/2/g-a.y));this.graph.dialect!=mxConstants.DIALECT_SVG|| +mxClient.NO_FO||null==this.graph.view.getCanvas().ownerSVGElement?(g=this.graph.container.cloneNode(!1),g.innerHTML=this.graph.container.innerHTML):g=this.graph.view.getCanvas().ownerSVGElement.cloneNode(!0);this.graph.getModel().clear();mxClient.NO_FO=e;g.style.position="relative";g.style.overflow="hidden";g.style.left=this.thumbBorder+"px";g.style.top=this.thumbBorder+"px";g.style.width=b+"px";g.style.height=d+"px";g.style.visibility="";g.style.minWidth="";g.style.minHeight="";c.appendChild(g); this.sidebarTitles&&null!=f&&0!=l&&(c.style.height=this.thumbHeight+0+this.sidebarTitleSize+8+"px",b=document.createElement("div"),b.style.color=Editor.isDarkMode()?"#A0A0A0":"#303030",b.style.fontSize=this.sidebarTitleSize+"px",b.style.textAlign="center",b.style.whiteSpace="nowrap",b.style.overflow="hidden",b.style.textOverflow="ellipsis",mxClient.IS_IE&&(b.style.height=this.sidebarTitleSize+12+"px"),b.style.paddingTop="4px",mxUtils.write(b,f),c.appendChild(b));return a}; Sidebar.prototype.createSection=function(a){return mxUtils.bind(this,function(){var b=document.createElement("div");b.setAttribute("title",a);b.style.textOverflow="ellipsis";b.style.whiteSpace="nowrap";b.style.textAlign="center";b.style.overflow="hidden";b.style.width="100%";b.style.padding="14px 0";mxUtils.write(b,a);return b})}; -Sidebar.prototype.createItem=function(a,b,d,c,f,e,l,k){k=null!=k?k:!0;var h=document.createElement("a");h.className="geItem";h.style.overflow="hidden";var g=2*this.thumbBorder;h.style.width=this.thumbWidth+g+"px";h.style.height=this.thumbHeight+g+"px";h.style.padding=this.thumbPadding+"px";mxEvent.addListener(h,"click",function(a){mxEvent.consume(a)});g=a;a=this.graph.cloneCells(a);this.editorUi.insertHandler(g,null,this.graph.model,this.editorUi.editor.graph.defaultVertexStyle,this.editorUi.editor.graph.defaultEdgeStyle, -!0,!0);this.createThumb(g,this.thumbWidth,this.thumbHeight,h,b,d,c,f,e);var m=new mxRectangle(0,0,f,e);1'+mxResources.get("formatted")+"";c("","blockquote").firstChild.nextSibling.innerHTML='
'+mxResources.get("blockquote")+""})));this.put("fontSize",new Menu(mxUtils.bind(this,function(c,d){var e= [6,8,9,10,11,12,14,18,24,36,48,72];0>mxUtils.indexOf(e,this.defaultFontSize)&&(e.push(this.defaultFontSize),e.sort(function(a,b){return a-b}));for(var f=mxUtils.bind(this,function(c){if(null!=b.cellEditor.textarea){document.execCommand("fontSize",!1,"3");for(var d=b.cellEditor.textarea.getElementsByTagName("font"),e=0;e
=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale+.05)/this.view.scale:(this.cumulativeZoomFactor*=k,this.cumulativeZoomFactor= Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor*=(this.view.scale-.05)/this.view.scale:(this.cumulativeZoomFactor/=k,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*100)/100/this.view.scale);this.cumulativeZoomFactor=Math.max(.05,Math.min(this.view.scale*this.cumulativeZoomFactor,160))/this.view.scale;b.isFastZoomEnabled()&&(null==Q&&""!=C.getAttribute("filter")&& (Q=C.getAttribute("filter"),C.removeAttribute("filter")),N=new mxPoint(b.container.scrollLeft,b.container.scrollTop),d=c||null==J?b.container.scrollLeft+b.container.clientWidth/2:J.x+b.container.scrollLeft-b.container.offsetLeft,k=c||null==J?b.container.scrollTop+b.container.clientHeight/2:J.y+b.container.scrollTop-b.container.offsetTop,C.style.transformOrigin=d+"px "+k+"px",C.style.transform="scale("+this.cumulativeZoomFactor+")",A.style.transformOrigin=d+"px "+k+"px",A.style.transform="scale("+ @@ -2190,10 +2190,10 @@ this.actions.get("exitGroup").setEnabled(null!=b.view.currentRoot);this.actions. this.actions.get("selectAll").setEnabled(e);this.actions.get("selectNone").setEnabled(e);f=1==c.vertices.length&&b.isCellFoldable(c.vertices[0]);this.actions.get("expand").setEnabled(f);this.actions.get("collapse").setEnabled(f);this.menus.get("navigation").setEnabled(0e&&(c=b.substring(e,f+21).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}}catch(n){}return c}; EditorUi.prototype.readGraphModelFromClipboard=function(b){this.readGraphModelFromClipboardWithType(mxUtils.bind(this,function(c){null!=c?b(c):this.readGraphModelFromClipboardWithType(mxUtils.bind(this,function(c){if(null!=c){var e=decodeURIComponent(c);this.isCompatibleString(e)&&(c=e)}b(c)}),"text")}),"html")}; EditorUi.prototype.readGraphModelFromClipboardWithType=function(b,c){navigator.clipboard.read().then(mxUtils.bind(this,function(e){if(null!=e&&0 ':"")+this.editor.graph.sanitizeHtml(b);asHtml=!0;b=c.getElementsByTagName("style");if(null!=b)for(;0 navigator.userAgent.indexOf("Camino"))?(b=new mxMorphing(f),b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){f.getModel().endUpdate();null!=e&&e()})),b.startAnimation()):(f.getModel().endUpdate(),null!=e&&e())}}}; -EditorUi.prototype.showImageDialog=function(b,c,e,f){f=this.editor.graph.cellEditor;var n=f.saveSelection(),l=mxUtils.prompt(b,c);f.restoreSelection(n);if(null!=l&&0 m||Math.abs(t.y- -c.getGraphY())>m){var l=this.selectionCellsHandler.getHandler(e.cell);null==l&&this.model.isEdge(e.cell)&&(l=this.createHandler(e));if(null!=l&&null!=l.bends&&0 m||Math.abs(q.y- +c.getGraphY())>m){var l=this.selectionCellsHandler.getHandler(e.cell);null==l&&this.model.isEdge(e.cell)&&(l=this.createHandler(e));if(null!=l&&null!=l.bends&&0 mxUtils.indexOf(c,b)});this.updateCellStyles(b,d)};Graph.prototype.updateCellStyles= function(b,d){this.model.beginUpdate();try{for(var c=0;c p?"a":"p",tt:12>p?"am":"pm",T:12>p?"A":"P",TT:12>p?"AM":"PM",Z:e?"UTC":(String(b).match(n)||[""]).pop().replace(l,""),o:(0 p?"a":"p",tt:12>p?"am":"pm",T:12>p?"A":"P",TT:12>p?"AM":"PM",Z:e?"UTC":(String(b).match(n)||[""]).pop().replace(l,""),o:(0 n&&"%"==c.charAt(match.index-1))t=l.substring(1);else{var d=l.substring(1,l.length-1);if("id"==d)t=b.id;else if(0>d.indexOf("{"))for(var k=b;null==t&&null!=k;)null!=k.value&&"object"==typeof k.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(t=k.getAttribute(d+"_"+Graph.diagramLanguage)), -null==t&&(t=k.hasAttribute(d)?null!=k.getAttribute(d)?k.getAttribute(d):"":null)),k=this.model.getParent(k);null==t&&(t=this.getGlobalVariable(d));null==t&&null!=e&&(t=e[d])}f.push(c.substring(n,match.index)+(null!=t?t:l));n=match.index+l.length}}f.push(c.substring(n))}return f.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0 n&&"%"==c.charAt(match.index-1))q=l.substring(1);else{var d=l.substring(1,l.length-1);if("id"==d)q=b.id;else if(0>d.indexOf("{"))for(var k=b;null==q&&null!=k;)null!=k.value&&"object"==typeof k.value&&(Graph.translateDiagram&&null!=Graph.diagramLanguage&&(q=k.getAttribute(d+"_"+Graph.diagramLanguage)), +null==q&&(q=k.hasAttribute(d)?null!=k.getAttribute(d)?k.getAttribute(d):"":null)),k=this.model.getParent(k);null==q&&(q=this.getGlobalVariable(d));null==q&&null!=e&&(q=e[d])}f.push(c.substring(n,match.index)+(null!=q?q:l));n=match.index+l.length}}f.push(c.substring(n))}return f.join("")};Graph.prototype.restoreSelection=function(b){if(null!=b&&0 this.activationDelay)&&this.currentState!=b&&(f>this.updateDelay&&null!=b||null==this.bbox||null==c||null==e||!mxUtils.contains(this.bbox, c,e))&&(null!=b&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(b),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=b&&this.graph.connectionHandler.constraintHandler.reset()):this.reset())}}; -HoverIcons.prototype.setCurrentState=function(b){"eastwest"!=b.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=b};Graph.prototype.createParent=function(b,c,e,f,n){b=this.cloneCell(b);for(var l=0;l k||Math.abs(t.y-q.y)>k)&&(Math.abs(t.x-l.x)>k||Math.abs(t.y-l.y)>k)&&(Math.abs(t.x-J.x)>k||Math.abs(t.y-J.y)>k)&&(Math.abs(t.x-E.x)>k||Math.abs(t.y-E.y)>k)){E=t.x-q.x;J=t.y-q.y;t={distSq:E*E+J*J,x:t.x,y:t.y};for(E=0;E t.distSq){n.splice(E,0,t);t=null;break}null==t||0!=n.length&&n[n.length-1].x===t.x&&n[n.length-1].y===t.y||n.push(t)}}}for(A=0;A e*e&&0 e*e&&(E=new mxPoint(C.x-n.x,C.y-n.y),A=new mxPoint(C.x+n.x,C.y+n.y),p.push(E),this.addPoints(b,p,c,g,!1,null,f),p=0>Math.round(n.x)||0==Math.round(n.x)&&0>=Math.round(n.y)?1:-1,f=!1,"sharp"==k?(b.lineTo(E.x-n.y*p,E.y+n.x*p),b.lineTo(A.x-n.y*p,A.y+n.x*p),b.lineTo(A.x,A.y)):"line"==k?(b.moveTo(E.x+n.y*p,E.y-n.x*p),b.lineTo(E.x-n.y*p,E.y+n.x*p),b.moveTo(A.x-n.y*p,A.y+n.x*p),b.lineTo(A.x+n.y* -p,A.y-n.x*p),b.moveTo(A.x,A.y)):"arc"==k?(p*=1.3,b.curveTo(E.x-n.y*p,E.y+n.x*p,A.x-n.y*p,A.y+n.x*p,A.x,A.y)):(b.moveTo(A.x,A.y),f=!0),p=[A],E=!0))}else n=null;E||(p.push(C),m=C)}this.addPoints(b,p,c,g,!1,null,f);b.stroke()}};var t=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(b,d,c,g){return null!=d&&"centerPerimeter"==d.style[mxConstants.STYLE_PERIMETER]?new mxPoint(d.getCenterX(),d.getCenterY()):t.apply(this,arguments)};var d=mxGraphView.prototype.updateFloatingTerminalPoint; -mxGraphView.prototype.updateFloatingTerminalPoint=function(b,c,g,e){if(null==c||null==b||"1"!=c.style.snapToPoint&&"1"!=b.style.snapToPoint)d.apply(this,arguments);else{c=this.getTerminalPort(b,c,e);var k=this.getNextPoint(b,g,e),f=this.graph.isOrthogonal(b),m=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),l=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=m)var q=Math.cos(-m),p=Math.sin(-m),k=mxUtils.getRotatedPoint(k,q,p,l);q=parseFloat(b.style[mxConstants.STYLE_PERIMETER_SPACING]|| -0);q+=parseFloat(b.style[e?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);k=this.getPerimeterPoint(c,k,0==m&&f,q);0!=m&&(q=Math.cos(m),p=Math.sin(m),k=mxUtils.getRotatedPoint(k,q,p,l));b.setAbsoluteTerminalPoint(this.snapToAnchorPoint(b,c,g,e,k),e)}};mxGraphView.prototype.snapToAnchorPoint=function(b,d,c,g,e){if(null!=d&&null!=b){b=this.graph.getAllConnectionConstraints(d);g=c=null;if(null!=b)for(var k=0;kk||Math.abs(q.y-t.y)>k)&&(Math.abs(q.x-l.x)>k||Math.abs(q.y-l.y)>k)&&(Math.abs(q.x-J.x)>k||Math.abs(q.y-J.y)>k)&&(Math.abs(q.x-E.x)>k||Math.abs(q.y-E.y)>k)){E=q.x-t.x;J=q.y-t.y;q={distSq:E*E+J*J,x:q.x,y:q.y};for(E=0;E q.distSq){n.splice(E,0,q);q=null;break}null==q||0!=n.length&&n[n.length-1].x===q.x&&n[n.length-1].y===q.y||n.push(q)}}}for(A=0;A e*e&&0 e*e&&(E=new mxPoint(C.x-n.x,C.y-n.y),A=new mxPoint(C.x+n.x,C.y+n.y),p.push(E),this.addPoints(b,p,c,g,!1,null,f),p=0>Math.round(n.x)||0==Math.round(n.x)&&0>=Math.round(n.y)?1:-1,f=!1,"sharp"==k?(b.lineTo(E.x-n.y*p,E.y+n.x*p),b.lineTo(A.x-n.y*p,A.y+n.x*p),b.lineTo(A.x,A.y)):"line"==k?(b.moveTo(E.x+n.y*p,E.y-n.x*p),b.lineTo(E.x-n.y*p,E.y+n.x*p),b.moveTo(A.x-n.y*p,A.y+n.x*p),b.lineTo(A.x+n.y* +p,A.y-n.x*p),b.moveTo(A.x,A.y)):"arc"==k?(p*=1.3,b.curveTo(E.x-n.y*p,E.y+n.x*p,A.x-n.y*p,A.y+n.x*p,A.x,A.y)):(b.moveTo(A.x,A.y),f=!0),p=[A],E=!0))}else n=null;E||(p.push(C),m=C)}this.addPoints(b,p,c,g,!1,null,f);b.stroke()}};var q=mxGraphView.prototype.getFixedTerminalPoint;mxGraphView.prototype.getFixedTerminalPoint=function(b,d,c,g){return null!=d&&"centerPerimeter"==d.style[mxConstants.STYLE_PERIMETER]?new mxPoint(d.getCenterX(),d.getCenterY()):q.apply(this,arguments)};var d=mxGraphView.prototype.updateFloatingTerminalPoint; +mxGraphView.prototype.updateFloatingTerminalPoint=function(b,c,g,e){if(null==c||null==b||"1"!=c.style.snapToPoint&&"1"!=b.style.snapToPoint)d.apply(this,arguments);else{c=this.getTerminalPort(b,c,e);var k=this.getNextPoint(b,g,e),f=this.graph.isOrthogonal(b),m=mxUtils.toRadians(Number(c.style[mxConstants.STYLE_ROTATION]||"0")),l=new mxPoint(c.getCenterX(),c.getCenterY());if(0!=m)var t=Math.cos(-m),p=Math.sin(-m),k=mxUtils.getRotatedPoint(k,t,p,l);t=parseFloat(b.style[mxConstants.STYLE_PERIMETER_SPACING]|| +0);t+=parseFloat(b.style[e?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);k=this.getPerimeterPoint(c,k,0==m&&f,t);0!=m&&(t=Math.cos(m),p=Math.sin(m),k=mxUtils.getRotatedPoint(k,t,p,l));b.setAbsoluteTerminalPoint(this.snapToAnchorPoint(b,c,g,e,k),e)}};mxGraphView.prototype.snapToAnchorPoint=function(b,d,c,g,e){if(null!=d&&null!=b){b=this.graph.getAllConnectionConstraints(d);g=c=null;if(null!=b)for(var k=0;k =l.getStatus()&&eval.call(window,l.getText())}}catch(t){null!=window.console&&console.log("error in getStencil:",b,e,c,n,t)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);c=mxStencilRegistry.stencils[b]}}return c}; +null);else if(".js"==n.toLowerCase().substring(n.length-3,n.length))try{if(mxStencilRegistry.allowEval){var l=mxUtils.load(n);null!=l&&200<=l.getStatus()&&299>=l.getStatus()&&eval.call(window,l.getText())}}catch(q){null!=window.console&&console.log("error in getStencil:",b,e,c,n,q)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);c=mxStencilRegistry.stencils[b]}}return c}; mxStencilRegistry.getBasenameForStencil=function(b){var c=null;if(null!=b&&"string"===typeof b&&(b=b.split("."),0 =b.getStatus()?b.getXml():null)}));else return mxUtils.load(b).getXml()};mxStencilRegistry.parseStencilSets=function(b){for(var c=0;c =p.x&&this.model.remove(B[d]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,null,[c]);this.setCellStyles(mxConstants.STYLE_ENDARROW,mxConstants.NONE,[c]);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,null,[b]);this.setCellStyles(mxConstants.STYLE_STARTARROW, +m.slice();this.model.beginUpdate();try{if(1!=m.length||this.isCellLocked(this.getDefaultParent()))for(k=0;k =p.x&&this.model.remove(B[d]);this.setCellStyles(mxConstants.STYLE_TARGET_PERIMETER_SPACING,null,[c]);this.setCellStyles(mxConstants.STYLE_ENDARROW,mxConstants.NONE,[c]);this.setCellStyles(mxConstants.STYLE_SOURCE_PERIMETER_SPACING,null,[b]);this.setCellStyles(mxConstants.STYLE_STARTARROW, mxConstants.NONE,[b]);var n=this.model.getTerminal(c,!1);if(null!=n){var u=this.getCurrentCellStyle(n);null!=u&&"1"==u.snapToPoint&&(this.setCellStyles(mxConstants.STYLE_EXIT_X,null,[b]),this.setCellStyles(mxConstants.STYLE_EXIT_Y,null,[b]),this.setCellStyles(mxConstants.STYLE_ENTRY_X,null,[c]),this.setCellStyles(mxConstants.STYLE_ENTRY_Y,null,[c]))}}finally{this.model.endUpdate()}return c};var g=Graph.prototype.selectCell;Graph.prototype.selectCell=function(b,d,c){if(d||c)g.apply(this,arguments); -else{var e=this.getSelectionCell(),k=null,f=[],l=mxUtils.bind(this,function(d){if(null!=this.view.getState(d)&&(this.model.isVertex(d)||this.model.isEdge(d)))if(f.push(d),d==e)k=f.length-1;else if(b&&null==e&&0 k||!b&&0 y)for(x=0;x>y;x--)this.model.remove(v[v.length+ -x-1]);v=this.model.getChildCells(b[m],!0);for(x=0;x mxUtils.indexOf(b,k)&&0>mxUtils.indexOf(c,k)&&c.push(k):this.labelChanged(b[g],"")}else{if(this.isTableRow(b[g])&&(k=this.model.getParent(b[g]),0>mxUtils.indexOf(b,k)&&0>mxUtils.indexOf(c,k))){for(var f=this.model.getChildCells(k,!0),l=0,q=0;q< -f.length;q++)0<=mxUtils.indexOf(b,f[q])&&l++;l==f.length&&c.push(k)}c.push(b[g])}c=m.apply(this,[c,d])}finally{this.model.endUpdate()}return c};Graph.prototype.updateCustomLinks=function(b,d,c){c=null!=c?c:new Graph;for(var g=0;g k||!b&&0 y)for(x=0;x>y;x--)this.model.remove(v[v.length+ +x-1]);v=this.model.getChildCells(b[l],!0);for(x=0;x mxUtils.indexOf(b,k)&&0>mxUtils.indexOf(c,k)&&c.push(k):this.labelChanged(b[g],"")}else{if(this.isTableRow(b[g])&&(k=this.model.getParent(b[g]),0>mxUtils.indexOf(b,k)&&0>mxUtils.indexOf(c,k))){for(var f=this.model.getChildCells(k,!0),l=0,t=0;t< +f.length;t++)0<=mxUtils.indexOf(b,f[t])&&l++;l==f.length&&c.push(k)}c.push(b[g])}c=m.apply(this,[c,d])}finally{this.model.endUpdate()}return c};Graph.prototype.updateCustomLinks=function(b,d,c){c=null!=c?c:new Graph;for(var g=0;g k||g>k)&&this.clear()}}else{for(c=d.getSource();null!=c&&"a"!= e&&"a"!=e.nodeName.toLowerCase();)e=e.parentNode;null==e&&Math.abs(this.scrollLeft-f.container.scrollLeft) Ua&&z++;va++}v.length =k.length)d.remove(c);else{var f=k.length-1;this.isTableCell(b)&&(f=mxUtils.indexOf(k,b));for(g=b=0;g =e.length)d.remove(c);else{this.isTableRow(g)||(g=e[e.length-1]);d.remove(g);b=0;var k=this.getCellGeometry(g);null!=k&&(b=k.height);var f=this.getCellGeometry(c); +(b=Math.max(b,m.width))}var t=this.getCellGeometry(c);null!=t&&(t=t.clone(),t.width-=b,d.setGeometry(c,t))}}}finally{d.endUpdate()}};Graph.prototype.deleteTableRow=function(b){var d=this.getModel();d.beginUpdate();try{var c=b,g=b;this.isTableCell(b)&&(b=g=d.getParent(b));this.isTableRow(b)&&(c=d.getParent(g));var e=d.getChildCells(c,!0);if(1>=e.length)d.remove(c);else{this.isTableRow(g)||(g=e[e.length-1]);d.remove(g);b=0;var k=this.getCellGeometry(g);null!=k&&(b=k.height);var f=this.getCellGeometry(c); null!=f&&(f=f.clone(),f.height-=b,d.setGeometry(c,f))}}finally{d.endUpdate()}};Graph.prototype.insertRow=function(b,d){for(var c=b.tBodies[0],g=c.rows[0].cells,e=0,k=0;k d&&c[g].deleteCell(d)};Graph.prototype.pasteHtmlAtCaret=function(b){var d;if(window.getSelection){if(d=window.getSelection(),d.getRangeAt&&d.rangeCount){d=d.getRangeAt(0);d.deleteContents(); var c=document.createElement("div");c.innerHTML=b;b=document.createDocumentFragment();for(var g;g=c.firstChild;)lastNode=b.appendChild(g);d.insertNode(b)}}else(d=document.selection)&&"Control"!=d.type&&d.createRange().pasteHTML(b)};Graph.prototype.createLinkForHint=function(b,d){function c(b,d){b.length>d&&(b=b.substring(0,Math.round(d/2))+"..."+b.substring(b.length-Math.round(d/4)));return b}b=null!=b?b:"javascript:void(0);";if(null==d||0==d.length)d=this.isCustomLink(b)?this.getLinkTitle(b):b;var g= @@ -2588,11 +2589,11 @@ d.stroke="#C0C0C0";d.strokewidth=1;return d};mxVertexHandler.prototype.rotationH function(b,d){return mxEvent.isControlDown(d.getEvent())||mxEvent.isMetaDown(d.getEvent())};var J=mxVertexHandler.prototype.isRotationHandleVisible;mxVertexHandler.prototype.isRotationHandleVisible=function(){return J.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)&&!this.graph.isTable(this.state.cell)};mxVertexHandler.prototype.getSizerBounds=function(){return this.graph.isTableCell(this.state.cell)?this.graph.view.getState(this.graph.model.getParent(this.graph.model.getParent(this.state.cell))): this.bounds};var N=mxVertexHandler.prototype.isParentHighlightVisible;mxVertexHandler.prototype.isParentHighlightVisible=function(){return N.apply(this,arguments)&&!this.graph.isTableCell(this.state.cell)&&!this.graph.isTableRow(this.state.cell)};var M=mxVertexHandler.prototype.isCustomHandleVisible;mxVertexHandler.prototype.isCustomHandleVisible=function(b){return b.tableHandle||M.apply(this,arguments)&&(!this.graph.isTable(this.state.cell)||this.graph.isCellSelected(this.state.cell))};mxVertexHandler.prototype.getSelectionBorderInset= function(){var b=0;this.graph.isTableRow(this.state.cell)?b=1:this.graph.isTableCell(this.state.cell)&&(b=2);return b};var Q=mxVertexHandler.prototype.getSelectionBorderBounds;mxVertexHandler.prototype.getSelectionBorderBounds=function(){return Q.apply(this,arguments).grow(-this.getSelectionBorderInset())};var V=null,X=mxVertexHandler.prototype.createCustomHandles;mxVertexHandler.prototype.createCustomHandles=function(){null==V&&(V=mxCellRenderer.defaultShapes.tableLine);var b=X.apply(this,arguments); -if(this.graph.isTable(this.state.cell)){var d=function(b,d,c){for(var g=[],e=0;e f||Math.abs(k)>f)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),this.update(g,c),this.isSpaceEvent(d)?(g=this.x+this.width,c=this.y+this.height,e=this.graph.view.scale,mxEvent.isAltDown(d.getEvent())||(this.width=this.graph.snap(this.width/e)*e,this.height=this.graph.snap(this.height/e)*e,this.graph.isGridEnabled()|| (this.width =this.width?"0px 1px 0px 0px":"0px 1px 0px 1px", null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&& @@ -2627,9 +2628,9 @@ null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode W=0):W=(new Date).getTime()-K;this.currentTerminalState=c};var I=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(b){return mxEvent.isShiftDown(b.getEvent())&&mxEvent.isAltDown(b.getEvent())?!1:null!=this.currentTerminalState&&b.getState()==this.currentTerminalState&&2E3 =this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==b)?this.graph.getConnectionConstraint(this.state,g,d):null;c=null!=(null!=b?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(d),b):null)?c?this.endFixedHandleImage:this.fixedHandleImage:null!=b&&null!=g?c?this.endTerminalHandleImage:this.terminalHandleImage:c?this.endHandleImage:this.handleImage;if(null!=c)return c= new mxImageShape(new mxRectangle(0,0,c.width,c.height),c.src),c.preserveImageAspect=!1,c;c=mxConstants.HANDLE_SIZE;this.preferHtml&&--c;return new mxRectangleShape(new mxRectangle(0,0,c,c),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var la=mxVertexHandler.prototype.createSizerShape;mxVertexHandler.prototype.createSizerShape=function(b,d,c){this.handleImage=d==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:d==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage; -return la.apply(this,arguments)};var oa=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(b){if(null!=b&&1==b.length){var d=this.graph.getModel(),c=d.getParent(b[0]),g=this.graph.getCellGeometry(b[0]);if(d.isEdge(c)&&null!=g&&g.relative&&(d=this.graph.view.getState(b[0]),null!=d&&2>d.width&&2>d.height&&null!=d.text&&null!=d.text.boundingBox))return mxRectangle.fromRectangle(d.text.boundingBox)}return oa.apply(this,arguments)};var pa=mxGraphHandler.prototype.getGuideStates; -mxGraphHandler.prototype.getGuideStates=function(){for(var b=pa.apply(this,arguments),d=[],c=0;c b.width&&2>b.height&&null!=b.text&&null!=b.text.boundingBox?(d=b.text.unrotatedBoundingBox|| -b.text.boundingBox,new mxRectangle(Math.round(d.x),Math.round(d.y),Math.round(d.width),Math.round(d.height))):ka.apply(this,arguments)};var qa=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(b,d){var c=this.graph.getModel(),g=c.getParent(this.state.cell),e=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(d)==mxEvent.ROTATION_HANDLE||!c.isEdge(g)||null==e||!e.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&qa.apply(this,arguments)}; +return la.apply(this,arguments)};var pa=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(b){if(null!=b&&1==b.length){var d=this.graph.getModel(),c=d.getParent(b[0]),g=this.graph.getCellGeometry(b[0]);if(d.isEdge(c)&&null!=g&&g.relative&&(d=this.graph.view.getState(b[0]),null!=d&&2>d.width&&2>d.height&&null!=d.text&&null!=d.text.boundingBox))return mxRectangle.fromRectangle(d.text.boundingBox)}return pa.apply(this,arguments)};var qa=mxGraphHandler.prototype.getGuideStates; +mxGraphHandler.prototype.getGuideStates=function(){for(var b=qa.apply(this,arguments),d=[],c=0;c b.width&&2>b.height&&null!=b.text&&null!=b.text.boundingBox?(d=b.text.unrotatedBoundingBox|| +b.text.boundingBox,new mxRectangle(Math.round(d.x),Math.round(d.y),Math.round(d.width),Math.round(d.height))):ka.apply(this,arguments)};var oa=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(b,d){var c=this.graph.getModel(),g=c.getParent(this.state.cell),e=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(d)==mxEvent.ROTATION_HANDLE||!c.isEdge(g)||null==e||!e.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&oa.apply(this,arguments)}; mxVertexHandler.prototype.rotateClick=function(){var b=mxUtils.getValue(this.state.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(this.state.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);this.state.view.graph.model.isVertex(this.state.cell)&&b==mxConstants.NONE&&d==mxConstants.NONE?(b=mxUtils.mod(mxUtils.getValue(this.state.style,mxConstants.STYLE_ROTATION,0)+90,360),this.state.view.graph.setCellStyles(mxConstants.STYLE_ROTATION,b,[this.state.cell])):this.state.view.graph.turnShapes([this.state.cell])}; var Z=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(b,d){Z.apply(this,arguments);null!=this.graph.graphHandler.first&&(null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display="none"),null!=this.linkHint&&"none"!=this.linkHint.style.display&&(this.linkHint.style.display="none"))};var P=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(b,d){P.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&& (this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.linkHint&&"none"==this.linkHint.style.display&&(this.linkHint.style.display="");this.blockDelayedSelection=null};var sa=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){sa.apply(this,arguments);var b=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",mxResources.get("rotateTooltip"));if(this.graph.isTable(this.state.cell))this.refreshMoveHandles();else if(1== @@ -2648,14 +2649,14 @@ d=this.cornerHandles,c=d[0].bounds.height/2;d[0].bounds.x=this.state.x-d[0].boun function(){ra.apply(this,arguments);if(null!=this.moveHandles){for(var b=0;b k?"#FFFFFF":"#000000"),b.begin(),b.moveTo(0,0),b.lineTo(g-z,0),b.lineTo(g,z),b.lineTo(z,z),b.close(),b.fill()),0!=f&&(b.setFillAlpha(Math.abs(f)),b.setFillColor(0>f?"#FFFFFF":"#000000"),b.begin(),b.moveTo(0,0),b.lineTo(z, z),b.lineTo(z,e),b.lineTo(0,e-z),b.close(),b.fill()),b.begin(),b.moveTo(z,e),b.lineTo(z,z),b.lineTo(0,0),b.moveTo(z,z),b.lineTo(g,z),b.end(),b.stroke())};f.prototype.getLabelMargins=function(b){return mxUtils.getValue(this.style,"boundedLbl",!1)?(b=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(b,b,0,0)):null};mxCellRenderer.registerShape("cube",f);var Sa=Math.tan(mxUtils.toRadians(30)),Ka=(.5-Sa)/2;mxCellRenderer.registerShape("isoRectangle",l);mxUtils.extend(n, mxCylinder);n.prototype.size=6;n.prototype.paintVertexShape=function(b,d,c,g,e){b.setFillColor(this.stroke);var z=Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size))-2)+2*this.strokewidth;b.ellipse(d+.5*(g-z),c+.5*(e-z),z,z);b.fill();b.setFillColor(mxConstants.NONE);b.rect(d,c,g,e);b.fill()};mxCellRenderer.registerShape("waypoint",n);mxUtils.extend(l,mxActor);l.prototype.size=20;l.prototype.redrawPath=function(b,d,c,g,e){d=Math.min(g,e/Sa);b.translate((g-d)/2,(e-d)/2+d/4);b.moveTo(0, -.25*d);b.lineTo(.5*d,d*Ka);b.lineTo(d,.25*d);b.lineTo(.5*d,(.5-Ka)*d);b.lineTo(0,.25*d);b.close();b.end()};mxCellRenderer.registerShape("isoRectangle",l);mxUtils.extend(t,mxCylinder);t.prototype.size=20;t.prototype.redrawPath=function(b,d,c,g,e,k){d=Math.min(g,e/(.5+Sa));k?(b.moveTo(0,.25*d),b.lineTo(.5*d,(.5-Ka)*d),b.lineTo(d,.25*d),b.moveTo(.5*d,(.5-Ka)*d),b.lineTo(.5*d,(1-Ka)*d)):(b.translate((g-d)/2,(e-d)/2),b.moveTo(0,.25*d),b.lineTo(.5*d,d*Ka),b.lineTo(d,.25*d),b.lineTo(d,.75*d),b.lineTo(.5* -d,(1-Ka)*d),b.lineTo(0,.75*d),b.close());b.end()};mxCellRenderer.registerShape("isoCube",t);mxUtils.extend(d,mxCylinder);d.prototype.redrawPath=function(b,d,c,g,e,k){d=Math.min(e/2,Math.round(e/8)+this.strokewidth-1);if(k&&null!=this.fill||!k&&null==this.fill)b.moveTo(0,d),b.curveTo(0,2*d,g,2*d,g,d),k||(b.stroke(),b.begin()),b.translate(0,d/2),b.moveTo(0,d),b.curveTo(0,2*d,g,2*d,g,d),k||(b.stroke(),b.begin()),b.translate(0,d/2),b.moveTo(0,d),b.curveTo(0,2*d,g,2*d,g,d),k||(b.stroke(),b.begin()),b.translate(0, +.25*d);b.lineTo(.5*d,d*Ka);b.lineTo(d,.25*d);b.lineTo(.5*d,(.5-Ka)*d);b.lineTo(0,.25*d);b.close();b.end()};mxCellRenderer.registerShape("isoRectangle",l);mxUtils.extend(q,mxCylinder);q.prototype.size=20;q.prototype.redrawPath=function(b,d,c,g,e,k){d=Math.min(g,e/(.5+Sa));k?(b.moveTo(0,.25*d),b.lineTo(.5*d,(.5-Ka)*d),b.lineTo(d,.25*d),b.moveTo(.5*d,(.5-Ka)*d),b.lineTo(.5*d,(1-Ka)*d)):(b.translate((g-d)/2,(e-d)/2),b.moveTo(0,.25*d),b.lineTo(.5*d,d*Ka),b.lineTo(d,.25*d),b.lineTo(d,.75*d),b.lineTo(.5* +d,(1-Ka)*d),b.lineTo(0,.75*d),b.close());b.end()};mxCellRenderer.registerShape("isoCube",q);mxUtils.extend(d,mxCylinder);d.prototype.redrawPath=function(b,d,c,g,e,k){d=Math.min(e/2,Math.round(e/8)+this.strokewidth-1);if(k&&null!=this.fill||!k&&null==this.fill)b.moveTo(0,d),b.curveTo(0,2*d,g,2*d,g,d),k||(b.stroke(),b.begin()),b.translate(0,d/2),b.moveTo(0,d),b.curveTo(0,2*d,g,2*d,g,d),k||(b.stroke(),b.begin()),b.translate(0,d/2),b.moveTo(0,d),b.curveTo(0,2*d,g,2*d,g,d),k||(b.stroke(),b.begin()),b.translate(0, -d);k||(b.moveTo(0,d),b.curveTo(0,-d/3,g,-d/3,g,d),b.lineTo(g,e-d),b.curveTo(g,e+d/3,0,e+d/3,0,e-d),b.close())};d.prototype.getLabelMargins=function(b){return new mxRectangle(0,2.5*Math.min(b.height/2,Math.round(b.height/8)+this.strokewidth-1),0,0)};mxCellRenderer.registerShape("datastore",d);mxUtils.extend(k,mxCylinder);k.prototype.size=30;k.prototype.darkOpacity=0;k.prototype.paintVertexShape=function(b,d,c,g,e){var z=Math.max(0,Math.min(g,Math.min(e,parseFloat(mxUtils.getValue(this.style,"size", this.size))))),k=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));b.translate(d,c);b.begin();b.moveTo(0,0);b.lineTo(g-z,0);b.lineTo(g,z);b.lineTo(g,e);b.lineTo(0,e);b.lineTo(0,0);b.close();b.end();b.fillAndStroke();this.outline||(b.setShadow(!1),0!=k&&(b.setFillAlpha(Math.abs(k)),b.setFillColor(0>k?"#FFFFFF":"#000000"),b.begin(),b.moveTo(g-z,0),b.lineTo(g-z,z),b.lineTo(g,z),b.close(),b.fill()),b.begin(),b.moveTo(g-z,0),b.lineTo(g-z,z),b.lineTo(g,z), -b.end(),b.stroke())};mxCellRenderer.registerShape("note",k);mxUtils.extend(g,k);mxCellRenderer.registerShape("note2",g);g.prototype.getLabelMargins=function(b){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var d=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(b.height*this.scale,d*this.scale),0,0)}return null};mxUtils.extend(q,mxShape);q.prototype.isoAngle=15;q.prototype.paintVertexShape=function(b,d,c,g,e){var z=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style, -"isoAngle",this.isoAngle))))*Math.PI/200,z=Math.min(g*Math.tan(z),.5*e);b.translate(d,c);b.begin();b.moveTo(.5*g,0);b.lineTo(g,z);b.lineTo(g,e-z);b.lineTo(.5*g,e);b.lineTo(0,e-z);b.lineTo(0,z);b.close();b.fillAndStroke();b.setShadow(!1);b.begin();b.moveTo(0,z);b.lineTo(.5*g,2*z);b.lineTo(g,z);b.moveTo(.5*g,2*z);b.lineTo(.5*g,e);b.stroke()};mxCellRenderer.registerShape("isoCube2",q);mxUtils.extend(m,mxShape);m.prototype.size=15;m.prototype.paintVertexShape=function(b,d,c,g,e){var z=Math.max(0,Math.min(.5* +b.end(),b.stroke())};mxCellRenderer.registerShape("note",k);mxUtils.extend(g,k);mxCellRenderer.registerShape("note2",g);g.prototype.getLabelMargins=function(b){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var d=mxUtils.getValue(this.style,"size",15);return new mxRectangle(0,Math.min(b.height*this.scale,d*this.scale),0,0)}return null};mxUtils.extend(t,mxShape);t.prototype.isoAngle=15;t.prototype.paintVertexShape=function(b,d,c,g,e){var z=Math.max(.01,Math.min(94,parseFloat(mxUtils.getValue(this.style, +"isoAngle",this.isoAngle))))*Math.PI/200,z=Math.min(g*Math.tan(z),.5*e);b.translate(d,c);b.begin();b.moveTo(.5*g,0);b.lineTo(g,z);b.lineTo(g,e-z);b.lineTo(.5*g,e);b.lineTo(0,e-z);b.lineTo(0,z);b.close();b.fillAndStroke();b.setShadow(!1);b.begin();b.moveTo(0,z);b.lineTo(.5*g,2*z);b.lineTo(g,z);b.moveTo(.5*g,2*z);b.lineTo(.5*g,e);b.stroke()};mxCellRenderer.registerShape("isoCube2",t);mxUtils.extend(m,mxShape);m.prototype.size=15;m.prototype.paintVertexShape=function(b,d,c,g,e){var z=Math.max(0,Math.min(.5* e,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b.translate(d,c);0==z?(b.rect(0,0,g,e),b.fillAndStroke()):(b.begin(),b.moveTo(0,z),b.arcTo(.5*g,z,0,0,1,.5*g,0),b.arcTo(.5*g,z,0,0,1,g,z),b.lineTo(g,e-z),b.arcTo(.5*g,z,0,0,1,.5*g,e),b.arcTo(.5*g,z,0,0,1,0,e-z),b.close(),b.fillAndStroke(),b.setShadow(!1),b.begin(),b.moveTo(g,z),b.arcTo(.5*g,z,0,0,1,.5*g,2*z),b.arcTo(.5*g,z,0,0,1,0,z),b.stroke())};mxCellRenderer.registerShape("cylinder2",m);mxUtils.extend(p,mxCylinder);p.prototype.size= 15;p.prototype.paintVertexShape=function(b,d,c,g,e){var z=Math.max(0,Math.min(.5*e,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),k=mxUtils.getValue(this.style,"lid",!0);b.translate(d,c);0==z?(b.rect(0,0,g,e),b.fillAndStroke()):(b.begin(),k?(b.moveTo(0,z),b.arcTo(.5*g,z,0,0,1,.5*g,0),b.arcTo(.5*g,z,0,0,1,g,z)):(b.moveTo(0,0),b.arcTo(.5*g,z,0,0,0,.5*g,z),b.arcTo(.5*g,z,0,0,0,g,0)),b.lineTo(g,e-z),b.arcTo(.5*g,z,0,0,1,.5*g,e),b.arcTo(.5*g,z,0,0,1,0,e-z),b.close(),b.fillAndStroke(),b.setShadow(!1), k&&(b.begin(),b.moveTo(g,z),b.arcTo(.5*g,z,0,0,1,.5*g,2*z),b.arcTo(.5*g,z,0,0,1,0,z),b.stroke()))};mxCellRenderer.registerShape("cylinder3",p);mxUtils.extend(v,mxActor);v.prototype.redrawPath=function(b,d,c,g,e){b.moveTo(0,0);b.quadTo(g/2,.5*e,g,0);b.quadTo(.5*g,e/2,g,e);b.quadTo(g/2,.5*e,0,e);b.quadTo(.5*g,e/2,0,0);b.end()};mxCellRenderer.registerShape("switch",v);mxUtils.extend(u,mxCylinder);u.prototype.tabWidth=60;u.prototype.tabHeight=20;u.prototype.tabPosition="right";u.prototype.arcSize=.1; -u.prototype.paintVertexShape=function(b,d,c,g,e){b.translate(d,c);d=Math.max(0,Math.min(g,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));c=Math.max(0,Math.min(e,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var k=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),z=mxUtils.getValue(this.style,"rounded",!1),f=mxUtils.getValue(this.style,"absoluteArcSize",!1),l=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));f||(l*=Math.min(g,e)); -l=Math.min(l,.5*g,.5*(e-c));d=Math.max(d,l);d=Math.min(g-l,d);z||(l=0);b.begin();"left"==k?(b.moveTo(Math.max(l,0),c),b.lineTo(Math.max(l,0),0),b.lineTo(d,0),b.lineTo(d,c)):(b.moveTo(g-d,c),b.lineTo(g-d,0),b.lineTo(g-Math.max(l,0),0),b.lineTo(g-Math.max(l,0),c));z?(b.moveTo(0,l+c),b.arcTo(l,l,0,0,1,l,c),b.lineTo(g-l,c),b.arcTo(l,l,0,0,1,g,l+c),b.lineTo(g,e-l),b.arcTo(l,l,0,0,1,g-l,e),b.lineTo(l,e),b.arcTo(l,l,0,0,1,0,e-l)):(b.moveTo(0,c),b.lineTo(g,c),b.lineTo(g,e),b.lineTo(0,e));b.close();b.fillAndStroke(); +u.prototype.paintVertexShape=function(b,d,c,g,e){b.translate(d,c);d=Math.max(0,Math.min(g,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));c=Math.max(0,Math.min(e,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var z=mxUtils.getValue(this.style,"tabPosition",this.tabPosition),k=mxUtils.getValue(this.style,"rounded",!1),f=mxUtils.getValue(this.style,"absoluteArcSize",!1),l=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));f||(l*=Math.min(g,e)); +l=Math.min(l,.5*g,.5*(e-c));d=Math.max(d,l);d=Math.min(g-l,d);k||(l=0);b.begin();"left"==z?(b.moveTo(Math.max(l,0),c),b.lineTo(Math.max(l,0),0),b.lineTo(d,0),b.lineTo(d,c)):(b.moveTo(g-d,c),b.lineTo(g-d,0),b.lineTo(g-Math.max(l,0),0),b.lineTo(g-Math.max(l,0),c));k?(b.moveTo(0,l+c),b.arcTo(l,l,0,0,1,l,c),b.lineTo(g-l,c),b.arcTo(l,l,0,0,1,g,l+c),b.lineTo(g,e-l),b.arcTo(l,l,0,0,1,g-l,e),b.lineTo(l,e),b.arcTo(l,l,0,0,1,0,e-l)):(b.moveTo(0,c),b.lineTo(g,c),b.lineTo(g,e),b.lineTo(0,e));b.close();b.fillAndStroke(); b.setShadow(!1);"triangle"==mxUtils.getValue(this.style,"folderSymbol",null)&&(b.begin(),b.moveTo(g-30,c+20),b.lineTo(g-20,c+10),b.lineTo(g-10,c+20),b.close(),b.stroke())};mxCellRenderer.registerShape("folder",u);u.prototype.getLabelMargins=function(b){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var d=mxUtils.getValue(this.style,"tabHeight",15)*this.scale;if(mxUtils.getValue(this.style,"labelInHeader",!1)){var c=mxUtils.getValue(this.style,"tabWidth",15)*this.scale,d=mxUtils.getValue(this.style, "tabHeight",15)*this.scale,g=mxUtils.getValue(this.style,"rounded",!1),e=mxUtils.getValue(this.style,"absoluteArcSize",!1),k=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));e||(k*=Math.min(b.width,b.height));k=Math.min(k,.5*b.width,.5*(b.height-d));g||(k=0);return"left"==mxUtils.getValue(this.style,"tabPosition",this.tabPosition)?new mxRectangle(k,0,Math.min(b.width,b.width-c),Math.min(b.height,b.height-d)):new mxRectangle(Math.min(b.width,b.width-c),0,k,Math.min(b.height,b.height- d))}return new mxRectangle(0,Math.min(b.height,d),0,0)}return null};mxUtils.extend(x,mxCylinder);x.prototype.arcSize=.1;x.prototype.paintVertexShape=function(b,d,c,g,e){b.translate(d,c);var k=mxUtils.getValue(this.style,"rounded",!1),z=mxUtils.getValue(this.style,"absoluteArcSize",!1);d=parseFloat(mxUtils.getValue(this.style,"arcSize",this.arcSize));c=mxUtils.getValue(this.style,"umlStateConnection",null);z||(d*=Math.min(g,e));d=Math.min(d,.5*g,.5*e);k||(d=0);k=0;null!=c&&(k=10);b.begin();b.moveTo(k, @@ -2709,8 +2710,8 @@ mxUtils.extend(Q,mxHexagon);Q.prototype.size=.25;Q.prototype.fixedSize=20;Q.prot 0),new mxPoint(g-d,0),new mxPoint(g,.5*e),new mxPoint(g-d,e),new mxPoint(d,e),new mxPoint(0,.5*e)],this.isRounded,c,!0)};mxCellRenderer.registerShape("hexagon",Q);mxUtils.extend(V,mxRectangleShape);V.prototype.isHtmlAllowed=function(){return!1};V.prototype.paintForeground=function(b,d,c,g,e){var k=Math.min(g/5,e/5)+1;b.begin();b.moveTo(d+g/2,c+k);b.lineTo(d+g/2,c+e-k);b.moveTo(d+k,c+e/2);b.lineTo(d+g-k,c+e/2);b.end();b.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus", V);var $a=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(b){if(1==this.style["double"]){var d=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(b.x+d,b.y+d,b.width-2*d,b.height-2*d)}return b};mxRhombus.prototype.paintVertexShape=function(b,d,c,g,e){$a.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var k=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]|| 0);d+=k;c+=k;g-=2*k;e-=2*k;0 f+l?b.y=c.y:b.x=c.x);return mxUtils.getPerimeterPoint(z,b,c)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(b,d,c,g){var e="0"!=mxUtils.getValue(d.style, "fixedSize","0"),k=e?F.prototype.fixedSize:F.prototype.size;null!=d&&(k=mxUtils.getValue(d.style,"size",k));e&&(k*=d.view.scale);var f=b.x,z=b.y,l=b.width,m=b.height;d=null!=d?mxUtils.getValue(d.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;d==mxConstants.DIRECTION_EAST?(e=e?Math.max(0,Math.min(.5*l,k)):l*Math.max(0,Math.min(1,k)),z=[new mxPoint(f+e,z),new mxPoint(f+l-e,z),new mxPoint(f+l,z+m),new mxPoint(f,z+m),new mxPoint(f+e,z)]):d==mxConstants.DIRECTION_WEST? (e=e?Math.max(0,Math.min(l,k)):l*Math.max(0,Math.min(1,k)),z=[new mxPoint(f,z),new mxPoint(f+l,z),new mxPoint(f+l-e,z+m),new mxPoint(f+e,z+m),new mxPoint(f,z)]):d==mxConstants.DIRECTION_NORTH?(e=e?Math.max(0,Math.min(m,k)):m*Math.max(0,Math.min(1,k)),z=[new mxPoint(f,z+e),new mxPoint(f+l,z),new mxPoint(f+l,z+m),new mxPoint(f,z+m-e),new mxPoint(f,z+e)]):(e=e?Math.max(0,Math.min(m,k)):m*Math.max(0,Math.min(1,k)),z=[new mxPoint(f,z),new mxPoint(f+l,z+e),new mxPoint(f+l,z+m-e),new mxPoint(f,z+m),new mxPoint(f, -z)]);m=b.getCenterX();b=b.getCenterY();b=new mxPoint(m,b);g&&(c.x f+l?b.y=c.y:b.x=c.x);return mxUtils.getPerimeterPoint(z,b,c)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(b,d,c,g){var e="0"!=mxUtils.getValue(d.style,"fixedSize","0"),k=e?M.prototype.fixedSize:M.prototype.size;null!=d&&(k=mxUtils.getValue(d.style,"size",k));e&&(k*=d.view.scale);var f=b.x,z=b.y,l=b.width,m=b.height,q=b.getCenterX();b=b.getCenterY();d=null!= +z)]);m=b.getCenterX();b=b.getCenterY();b=new mxPoint(m,b);g&&(c.x f+l?b.y=c.y:b.x=c.x);return mxUtils.getPerimeterPoint(z,b,c)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(b,d,c,g){var e="0"!=mxUtils.getValue(d.style,"fixedSize","0"),k=e?M.prototype.fixedSize:M.prototype.size;null!=d&&(k=mxUtils.getValue(d.style,"size",k));e&&(k*=d.view.scale);var f=b.x,z=b.y,l=b.width,m=b.height,t=b.getCenterX();b=b.getCenterY();d=null!= d?mxUtils.getValue(d.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;d==mxConstants.DIRECTION_EAST?(e=e?Math.max(0,Math.min(l,k)):l*Math.max(0,Math.min(1,k)),z=[new mxPoint(f,z),new mxPoint(f+l-e,z),new mxPoint(f+l,b),new mxPoint(f+l-e,z+m),new mxPoint(f,z+m),new mxPoint(f+e,b),new mxPoint(f,z)]):d==mxConstants.DIRECTION_WEST?(e=e?Math.max(0,Math.min(l,k)):l*Math.max(0,Math.min(1,k)),z=[new mxPoint(f+e,z),new mxPoint(f+l,z),new mxPoint(f+l-e,b),new mxPoint(f+ -l,z+m),new mxPoint(f+e,z+m),new mxPoint(f,b),new mxPoint(f+e,z)]):d==mxConstants.DIRECTION_NORTH?(e=e?Math.max(0,Math.min(m,k)):m*Math.max(0,Math.min(1,k)),z=[new mxPoint(f,z+e),new mxPoint(q,z),new mxPoint(f+l,z+e),new mxPoint(f+l,z+m),new mxPoint(q,z+m-e),new mxPoint(f,z+m),new mxPoint(f,z+e)]):(e=e?Math.max(0,Math.min(m,k)):m*Math.max(0,Math.min(1,k)),z=[new mxPoint(f,z),new mxPoint(q,z+e),new mxPoint(f+l,z),new mxPoint(f+l,z+m-e),new mxPoint(q,z+m),new mxPoint(f,z+m-e),new mxPoint(f,z)]);q=new mxPoint(q, -b);g&&(c.x f+l?q.y=c.y:q.x=c.x);return mxUtils.getPerimeterPoint(z,q,c)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(b,d,c,g){var e="0"!=mxUtils.getValue(d.style,"fixedSize","0"),k=e?Q.prototype.fixedSize:Q.prototype.size;null!=d&&(k=mxUtils.getValue(d.style,"size",k));e&&(k*=d.view.scale);var f=b.x,z=b.y,l=b.width,m=b.height,q=b.getCenterX();b=b.getCenterY();d=null!=d?mxUtils.getValue(d.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST): -mxConstants.DIRECTION_EAST;d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH?(e=e?Math.max(0,Math.min(m,k)):m*Math.max(0,Math.min(1,k)),z=[new mxPoint(q,z),new mxPoint(f+l,z+e),new mxPoint(f+l,z+m-e),new mxPoint(q,z+m),new mxPoint(f,z+m-e),new mxPoint(f,z+e),new mxPoint(q,z)]):(e=e?Math.max(0,Math.min(l,k)):l*Math.max(0,Math.min(1,k)),z=[new mxPoint(f+e,z),new mxPoint(f+l-e,z),new mxPoint(f+l,b),new mxPoint(f+l-e,z+m),new mxPoint(f+e,z+m),new mxPoint(f,b),new mxPoint(f+e,z)]);q=new mxPoint(q, -b);g&&(c.x f+l?q.y=c.y:q.x=c.x);return mxUtils.getPerimeterPoint(z,q,c)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(fa,mxShape);fa.prototype.size=10;fa.prototype.paintBackground=function(b,d,c,g,e){var k=parseFloat(mxUtils.getValue(this.style,"size",this.size));b.translate(d,c);b.ellipse((g-k)/2,0,k,k);b.fillAndStroke();b.begin();b.moveTo(g/2,k);b.lineTo(g/2,e);b.end();b.stroke()};mxCellRenderer.registerShape("lollipop",fa);mxUtils.extend(I,mxShape); +l,z+m),new mxPoint(f+e,z+m),new mxPoint(f,b),new mxPoint(f+e,z)]):d==mxConstants.DIRECTION_NORTH?(e=e?Math.max(0,Math.min(m,k)):m*Math.max(0,Math.min(1,k)),z=[new mxPoint(f,z+e),new mxPoint(t,z),new mxPoint(f+l,z+e),new mxPoint(f+l,z+m),new mxPoint(t,z+m-e),new mxPoint(f,z+m),new mxPoint(f,z+e)]):(e=e?Math.max(0,Math.min(m,k)):m*Math.max(0,Math.min(1,k)),z=[new mxPoint(f,z),new mxPoint(t,z+e),new mxPoint(f+l,z),new mxPoint(f+l,z+m-e),new mxPoint(t,z+m),new mxPoint(f,z+m-e),new mxPoint(f,z)]);t=new mxPoint(t, +b);g&&(c.x f+l?t.y=c.y:t.x=c.x);return mxUtils.getPerimeterPoint(z,t,c)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(b,d,c,g){var e="0"!=mxUtils.getValue(d.style,"fixedSize","0"),k=e?Q.prototype.fixedSize:Q.prototype.size;null!=d&&(k=mxUtils.getValue(d.style,"size",k));e&&(k*=d.view.scale);var f=b.x,z=b.y,l=b.width,m=b.height,t=b.getCenterX();b=b.getCenterY();d=null!=d?mxUtils.getValue(d.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST): +mxConstants.DIRECTION_EAST;d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH?(e=e?Math.max(0,Math.min(m,k)):m*Math.max(0,Math.min(1,k)),z=[new mxPoint(t,z),new mxPoint(f+l,z+e),new mxPoint(f+l,z+m-e),new mxPoint(t,z+m),new mxPoint(f,z+m-e),new mxPoint(f,z+e),new mxPoint(t,z)]):(e=e?Math.max(0,Math.min(l,k)):l*Math.max(0,Math.min(1,k)),z=[new mxPoint(f+e,z),new mxPoint(f+l-e,z),new mxPoint(f+l,b),new mxPoint(f+l-e,z+m),new mxPoint(f+e,z+m),new mxPoint(f,b),new mxPoint(f+e,z)]);t=new mxPoint(t, +b);g&&(c.x f+l?t.y=c.y:t.x=c.x);return mxUtils.getPerimeterPoint(z,t,c)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(fa,mxShape);fa.prototype.size=10;fa.prototype.paintBackground=function(b,d,c,g,e){var k=parseFloat(mxUtils.getValue(this.style,"size",this.size));b.translate(d,c);b.ellipse((g-k)/2,0,k,k);b.fillAndStroke();b.begin();b.moveTo(g/2,k);b.lineTo(g/2,e);b.end();b.stroke()};mxCellRenderer.registerShape("lollipop",fa);mxUtils.extend(I,mxShape); I.prototype.size=10;I.prototype.inset=2;I.prototype.paintBackground=function(b,d,c,g,e){var k=parseFloat(mxUtils.getValue(this.style,"size",this.size)),f=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;b.translate(d,c);b.begin();b.moveTo(g/2,k+f);b.lineTo(g/2,e);b.end();b.stroke();b.begin();b.moveTo((g-k)/2-f,k/2);b.quadTo((g-k)/2-f,k+f,g/2,k+f);b.quadTo((g+k)/2+f,k+f,(g+k)/2+f,k/2);b.end();b.stroke()};mxCellRenderer.registerShape("requires",I);mxUtils.extend(la,mxShape); -la.prototype.paintBackground=function(b,d,c,g,e){b.translate(d,c);b.begin();b.moveTo(0,0);b.quadTo(g,0,g,e/2);b.quadTo(g,e,0,e);b.end();b.stroke()};mxCellRenderer.registerShape("requiredInterface",la);mxUtils.extend(oa,mxShape);oa.prototype.inset=2;oa.prototype.paintBackground=function(b,d,c,g,e){var k=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;b.translate(d,c);b.ellipse(0,k,g-2*k,e-2*k);b.fillAndStroke();b.begin();b.moveTo(g/2,0);b.quadTo(g,0,g,e/2);b.quadTo(g,e, -g/2,e);b.end();b.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",oa);mxUtils.extend(pa,mxCylinder);pa.prototype.jettyWidth=20;pa.prototype.jettyHeight=10;pa.prototype.redrawPath=function(b,d,c,g,e,k){var f=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));d=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));c=f/2;var f=c+f/2,z=Math.min(d,e-d),l=Math.min(z+2*d,e-d);k?(b.moveTo(c,z),b.lineTo(f,z),b.lineTo(f,z+d),b.lineTo(c,z+d),b.moveTo(c, -l),b.lineTo(f,l),b.lineTo(f,l+d),b.lineTo(c,l+d)):(b.moveTo(c,0),b.lineTo(g,0),b.lineTo(g,e),b.lineTo(c,e),b.lineTo(c,l+d),b.lineTo(0,l+d),b.lineTo(0,l),b.lineTo(c,l),b.lineTo(c,z+d),b.lineTo(0,z+d),b.lineTo(0,z),b.lineTo(c,z),b.close());b.end()};mxCellRenderer.registerShape("module",pa);mxUtils.extend(ka,mxCylinder);ka.prototype.jettyWidth=32;ka.prototype.jettyHeight=12;ka.prototype.redrawPath=function(b,d,c,g,e,k){var f=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));d=parseFloat(mxUtils.getValue(this.style, -"jettyHeight",this.jettyHeight));c=f/2;var f=c+f/2,z=.3*e-d/2,l=.7*e-d/2;k?(b.moveTo(c,z),b.lineTo(f,z),b.lineTo(f,z+d),b.lineTo(c,z+d),b.moveTo(c,l),b.lineTo(f,l),b.lineTo(f,l+d),b.lineTo(c,l+d)):(b.moveTo(c,0),b.lineTo(g,0),b.lineTo(g,e),b.lineTo(c,e),b.lineTo(c,l+d),b.lineTo(0,l+d),b.lineTo(0,l),b.lineTo(c,l),b.lineTo(c,z+d),b.lineTo(0,z+d),b.lineTo(0,z),b.lineTo(c,z),b.close());b.end()};mxCellRenderer.registerShape("component",ka);mxUtils.extend(qa,mxRectangleShape);qa.prototype.paintForeground= -function(b,d,c,g,e){var k=g/2,f=e/2,z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;b.begin();this.addPoints(b,[new mxPoint(d+k,c),new mxPoint(d+g,c+f),new mxPoint(d+k,c+e),new mxPoint(d,c+f)],this.isRounded,z,!0);b.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",qa);mxUtils.extend(Z,mxDoubleEllipse);Z.prototype.outerStroke=!0;Z.prototype.paintVertexShape=function(b,d,c,g,e){var k=Math.min(4, +la.prototype.paintBackground=function(b,d,c,g,e){b.translate(d,c);b.begin();b.moveTo(0,0);b.quadTo(g,0,g,e/2);b.quadTo(g,e,0,e);b.end();b.stroke()};mxCellRenderer.registerShape("requiredInterface",la);mxUtils.extend(pa,mxShape);pa.prototype.inset=2;pa.prototype.paintBackground=function(b,d,c,g,e){var k=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;b.translate(d,c);b.ellipse(0,k,g-2*k,e-2*k);b.fillAndStroke();b.begin();b.moveTo(g/2,0);b.quadTo(g,0,g,e/2);b.quadTo(g,e, +g/2,e);b.end();b.stroke()};mxCellRenderer.registerShape("providedRequiredInterface",pa);mxUtils.extend(qa,mxCylinder);qa.prototype.jettyWidth=20;qa.prototype.jettyHeight=10;qa.prototype.redrawPath=function(b,d,c,g,e,k){var f=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));d=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));c=f/2;var f=c+f/2,z=Math.min(d,e-d),l=Math.min(z+2*d,e-d);k?(b.moveTo(c,z),b.lineTo(f,z),b.lineTo(f,z+d),b.lineTo(c,z+d),b.moveTo(c, +l),b.lineTo(f,l),b.lineTo(f,l+d),b.lineTo(c,l+d)):(b.moveTo(c,0),b.lineTo(g,0),b.lineTo(g,e),b.lineTo(c,e),b.lineTo(c,l+d),b.lineTo(0,l+d),b.lineTo(0,l),b.lineTo(c,l),b.lineTo(c,z+d),b.lineTo(0,z+d),b.lineTo(0,z),b.lineTo(c,z),b.close());b.end()};mxCellRenderer.registerShape("module",qa);mxUtils.extend(ka,mxCylinder);ka.prototype.jettyWidth=32;ka.prototype.jettyHeight=12;ka.prototype.redrawPath=function(b,d,c,g,e,k){var f=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));d=parseFloat(mxUtils.getValue(this.style, +"jettyHeight",this.jettyHeight));c=f/2;var f=c+f/2,z=.3*e-d/2,l=.7*e-d/2;k?(b.moveTo(c,z),b.lineTo(f,z),b.lineTo(f,z+d),b.lineTo(c,z+d),b.moveTo(c,l),b.lineTo(f,l),b.lineTo(f,l+d),b.lineTo(c,l+d)):(b.moveTo(c,0),b.lineTo(g,0),b.lineTo(g,e),b.lineTo(c,e),b.lineTo(c,l+d),b.lineTo(0,l+d),b.lineTo(0,l),b.lineTo(c,l),b.lineTo(c,z+d),b.lineTo(0,z+d),b.lineTo(0,z),b.lineTo(c,z),b.close());b.end()};mxCellRenderer.registerShape("component",ka);mxUtils.extend(oa,mxRectangleShape);oa.prototype.paintForeground= +function(b,d,c,g,e){var k=g/2,f=e/2,z=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;b.begin();this.addPoints(b,[new mxPoint(d+k,c),new mxPoint(d+g,c+f),new mxPoint(d+k,c+e),new mxPoint(d,c+f)],this.isRounded,z,!0);b.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("associativeEntity",oa);mxUtils.extend(Z,mxDoubleEllipse);Z.prototype.outerStroke=!0;Z.prototype.paintVertexShape=function(b,d,c,g,e){var k=Math.min(4, Math.min(g/5,e/5));0 =2*g&&b.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return b};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(.25, @@ -2881,7 +2882,7 @@ parseFloat(mxUtils.getValue(this.style,"size",this.size))));b.push(new mxConnect 0,.25*(c-e)+e));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(c-e)+e));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.75*(c-e)+e));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,c));b.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));b.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));b.push(new mxConnectionConstraint(new mxPoint(.75,1),!1));return b};ma.prototype.constraints=mxRectangleShape.prototype.constraints;ia.prototype.constraints= mxRectangleShape.prototype.constraints;aa.prototype.constraints=mxEllipse.prototype.constraints;R.prototype.constraints=mxEllipse.prototype.constraints;Ea.prototype.constraints=mxEllipse.prototype.constraints;Ca.prototype.constraints=mxEllipse.prototype.constraints;ha.prototype.constraints=mxRectangleShape.prototype.constraints;Fa.prototype.constraints=mxRectangleShape.prototype.constraints;za.prototype.getConstraints=function(b,d,c){b=[];var g=Math.min(d,c/2),e=Math.min(d-g,Math.max(0,parseFloat(mxUtils.getValue(this.style, "size",this.size)))*d);b.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,0));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e+d-g),0));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d-g,0));b.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d-g,c));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(e+d-g),c));b.push(new mxConnectionConstraint(new mxPoint(0, -0),!1,null,e,c));return b};pa.prototype.getConstraints=function(b,d,c){d=parseFloat(mxUtils.getValue(b,"jettyWidth",pa.prototype.jettyWidth))/2;b=parseFloat(mxUtils.getValue(b,"jettyHeight",pa.prototype.jettyHeight));var g=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,d),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1, +0),!1,null,e,c));return b};qa.prototype.getConstraints=function(b,d,c){d=parseFloat(mxUtils.getValue(b,"jettyWidth",qa.prototype.jettyWidth))/2;b=parseFloat(mxUtils.getValue(b,"jettyHeight",qa.prototype.jettyHeight));var g=[new mxConnectionConstraint(new mxPoint(0,0),!1,null,d),new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(1, .25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(0,1),!1,null,d),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(c-.5*b,1.5*b)),new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,Math.min(c- .5*b,3.5*b))];c>5*b&&g.push(new mxConnectionConstraint(new mxPoint(0,.75),!1,null,d));c>8*b&&g.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null,d));c>15*b&&g.push(new mxConnectionConstraint(new mxPoint(0,.25),!1,null,d));return g};ta.prototype.constraints=mxRectangleShape.prototype.constraints;ua.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0), new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0,.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];Y.prototype.constraints= @@ -2909,14 +2910,14 @@ parseFloat(mxUtils.getValue(this.style,"arrowWidth",ca.prototype.arrowWidth)))), 0),!1,null,e,c));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,c-.5*g));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,e,k));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d+e),g));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,g));b.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,k));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d+e),k));b.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,f,k));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*f,g));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,g));b.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,k));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*f,k));b.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,g));return b};K.prototype.constraints=null;xa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0, .25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];Aa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7, -.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];la.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];oa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()} +.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];la.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];pa.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(b){this.editorUi=b;this.actions={};this.init()} Actions.prototype.init=function(){function b(b){l.escape();b=l.deleteCells(l.getDeletableCells(l.getSelectionCells()),b);null!=b&&l.setSelectionCells(b)}function c(){if(!l.isSelectionEmpty()){l.getModel().beginUpdate();try{for(var b=l.getSelectionCells(),d=0;d Math.abs(b-l.view.scale)&&d==l.view.translate.x&&c==l.view.translate.y&&f.actions.get(l.pageVisible?"fitPage":"fitWindow").funct()});this.addAction("keyPressEnter",function(){l.isEnabled()&&(l.isSelectionEmpty()?f.actions.get("smartFit").funct():l.startEditingAtCell())});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){f.hideDialog()})); -window.openFile.setConsumer(mxUtils.bind(this,function(b,d){try{var c=mxUtils.parseXml(b);n.graph.setSelectionCells(n.graph.importGraphModel(c.documentElement))}catch(p){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+p.message)}}));f.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=t;this.addAction("save",function(){f.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=t;this.addAction("saveAs...",function(){f.saveFile(!0)},null, -null,Editor.ctrlKey+"+Shift+S").isEnabled=t;this.addAction("export...",function(){f.showDialog((new ExportDialog(f)).container,300,340,!0,!0)});this.addAction("editDiagram...",function(){var b=new EditDiagramDialog(f);f.showDialog(b.container,620,420,!0,!1);b.init()});this.addAction("pageSetup...",function(){f.showDialog((new PageSetupDialog(f)).container,320,240,!0,!0)}).isEnabled=t;this.addAction("print...",function(){f.showDialog((new PrintDialog(f)).container,300,180,!0,!0)},null,"sprite-print", -Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(l,null,10,10)});this.addAction("undo",function(){f.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){f.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",function(){var b=null;try{b=f.copyXml(),null!=b&&l.removeCells(b,!1)}catch(q){}null==b&&mxClipboard.cut(l)},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{f.copyXml()}catch(g){}try{mxClipboard.copy(l)}catch(g){f.handleError(g)}}, -null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){if(l.isEnabled()&&!l.isCellLocked(l.getDefaultParent())){var b=!1;try{Editor.enableNativeCipboard&&(f.readGraphModelFromClipboard(function(b){if(null!=b){l.getModel().beginUpdate();try{f.pasteXml(b,!0)}finally{l.getModel().endUpdate()}}else mxClipboard.paste(l)}),b=!0)}catch(q){}b||mxClipboard.paste(l)}},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(b){function d(b){if(null!=b){for(var d=!0,c=0;c< +window.openFile.setConsumer(mxUtils.bind(this,function(b,d){try{var c=mxUtils.parseXml(b);n.graph.setSelectionCells(n.graph.importGraphModel(c.documentElement))}catch(p){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+p.message)}}));f.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=q;this.addAction("save",function(){f.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=q;this.addAction("saveAs...",function(){f.saveFile(!0)},null, +null,Editor.ctrlKey+"+Shift+S").isEnabled=q;this.addAction("export...",function(){f.showDialog((new ExportDialog(f)).container,300,340,!0,!0)});this.addAction("editDiagram...",function(){var b=new EditDiagramDialog(f);f.showDialog(b.container,620,420,!0,!1);b.init()});this.addAction("pageSetup...",function(){f.showDialog((new PageSetupDialog(f)).container,320,240,!0,!0)}).isEnabled=q;this.addAction("print...",function(){f.showDialog((new PrintDialog(f)).container,300,180,!0,!0)},null,"sprite-print", +Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(l,null,10,10)});this.addAction("undo",function(){f.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){f.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",function(){var b=null;try{b=f.copyXml(),null!=b&&l.removeCells(b,!1)}catch(t){}null==b&&mxClipboard.cut(l)},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){try{f.copyXml()}catch(g){}try{mxClipboard.copy(l)}catch(g){f.handleError(g)}}, +null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){if(l.isEnabled()&&!l.isCellLocked(l.getDefaultParent())){var b=!1;try{Editor.enableNativeCipboard&&(f.readGraphModelFromClipboard(function(b){if(null!=b){l.getModel().beginUpdate();try{f.pasteXml(b,!0)}finally{l.getModel().endUpdate()}}else mxClipboard.paste(l)}),b=!0)}catch(t){}b||mxClipboard.paste(l)}},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(b){function d(b){if(null!=b){for(var d=!0,c=0;c< b.length&&d;c++)d=d&&l.model.isEdge(b[c]);var g=l.view.translate,c=l.view.scale,e=g.x,k=g.y,g=null;if(1==b.length&&d){var f=l.getCellGeometry(b[0]);null!=f&&(g=f.getTerminalPoint(!0))}g=null!=g?g:l.getBoundingBoxFromGeometry(b,d);null!=g&&(d=Math.round(l.snap(l.popupMenuHandler.triggerX/c-e)),c=Math.round(l.snap(l.popupMenuHandler.triggerY/c-k)),l.cellsMoved(b,d-g.x,c-g.y))}}function c(){l.getModel().beginUpdate();try{d(mxClipboard.paste(l))}finally{l.getModel().endUpdate()}}if(l.isEnabled()&&!l.isCellLocked(l.getDefaultParent())){b= !1;try{Editor.enableNativeCipboard&&(f.readGraphModelFromClipboard(function(b){if(null!=b){l.getModel().beginUpdate();try{d(f.pasteXml(b,!0))}finally{l.getModel().endUpdate()}}else c()}),b=!0)}catch(p){}b||c()}});this.addAction("copySize",function(){var b=l.getSelectionCell();l.isEnabled()&&null!=b&&l.getModel().isVertex(b)&&(b=l.getCellGeometry(b),null!=b&&(f.copiedSize=new mxRectangle(b.x,b.y,b.width,b.height)))},null,null,"Alt+Shift+X");this.addAction("pasteSize",function(){if(l.isEnabled()&&!l.isSelectionEmpty()&& null!=f.copiedSize){l.getModel().beginUpdate();try{for(var b=l.getResizableCells(l.getSelectionCells()),d=0;d /g,"\n"));var n=document.createElement("div");n.innerHTML=l.sanitizeHtml(k);k=mxUtils.extractTextWithWhitespace(n.childNodes);l.cellLabelChanged(state.cell,k);l.setCellStyles("html",b,[d[c]])}else"0"==e&&"1"==b&&(k=mxUtils.htmlEntities(l.convertValueToString(state.cell),!1),"0"!=mxUtils.getValue(state.style,"nl2Br","1")&&(k=k.replace(/\n/g,"
")),l.cellLabelChanged(state.cell,l.sanitizeHtml(k)),l.setCellStyles("html",b,[d[c]]))}f.fireEvent(new mxEventObject("styleChanged", "keys",["html"],"values",[null!=b?b:"0"],"cells",d))}finally{l.getModel().endUpdate()}});this.addAction("wordWrap",function(){var b=l.getView().getState(l.getSelectionCell()),d="wrap";l.stopEditing();null!=b&&"wrap"==b.style[mxConstants.STYLE_WHITE_SPACE]&&(d=null);l.setCellStyles(mxConstants.STYLE_WHITE_SPACE,d)});this.addAction("rotation",function(){var b="0",d=l.getView().getState(l.getSelectionCell());null!=d&&(b=d.style[mxConstants.STYLE_ROTATION]||b);b=new FilenameDialog(f,b,mxResources.get("apply"), @@ -2947,10 +2948,10 @@ l.container.clientHeight)/2),l.container.scrollLeft=Math.min(b.x,(l.container.sc 2)}}));this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var b=new FilenameDialog(this.editorUi,parseInt(100*l.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(b){b=parseInt(b);!isNaN(b)&&0e?b=b.substring(0,e)+"[...]":null!=b&&b.length>c&&(b=Graph.compress(b)+"\n");return b}; DrawioFile.prototype.checksumError=function(b,c,e,f,n){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=b&&b();try{if(this.errorReportsEnabled){if(null!=c)for(b=0;bmxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{t.container.style.visibility="";t.model.endUpdate();t.cellRenderer.redraw=q;this.changeListenerEnabled=d;e||(f.history=n,f.indexOfNextAdd=l,f.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)g!=t.mathEnabled? -(this.ui.editor.updateGraphComponents(),t.refresh()):(k!=t.foldingEnabled?t.view.revalidate():t.view.validate(),t.sizeDidChange());null!=this.sync&&this.isRealtime()&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.updateTabContainer();this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",c,"undoable",e)}return b}; +DrawioFile.prototype.patch=function(b,c,e){if(null!=b){var f=this.ui.editor.undoManager,n=f.history.slice(),l=f.indexOfNextAdd,q=this.ui.editor.graph;q.container.style.visibility="hidden";var d=this.changeListenerEnabled;this.changeListenerEnabled=e;var k=q.foldingEnabled,g=q.mathEnabled,t=q.cellRenderer.redraw;q.cellRenderer.redraw=function(b){b.view.graph.isEditing(b.cell)&&(b.view.graph.scrollCellToVisible(b.cell),b.view.graph.cellEditor.resize());t.apply(this,arguments)};q.model.beginUpdate(); +try{this.ui.pages=this.ui.applyPatches(this.ui.pages,b,!0,c,this.isModified()),0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage()),0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{q.container.style.visibility="";q.model.endUpdate();q.cellRenderer.redraw=t;this.changeListenerEnabled=d;e||(f.history=n,f.indexOfNextAdd=l,f.fireEvent(new mxEventObject(mxEvent.CLEAR)));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)g!=q.mathEnabled? +(this.ui.editor.updateGraphComponents(),q.refresh()):(k!=q.foldingEnabled?q.view.revalidate():q.view.validate(),q.sizeDidChange());null!=this.sync&&this.isRealtime()&&(this.sync.snapshot=this.ui.clonePages(this.ui.pages));this.ui.updateTabContainer();this.ui.editor.fireEvent(new mxEventObject("pagesPatched","patches",b))}EditorUi.debug("DrawioFile.patch",[this],"patches",b,"resolver",c,"undoable",e)}return b}; DrawioFile.prototype.save=function(b,c,e,f,n,l){try{if(EditorUi.debug("DrawioFile.save",[this],"revision",b,"unloading",f,"overwrite",n,"manual",l,"saving",this.savingFile,"editable",this.isEditable(),"invalidChecksum",this.invalidChecksum),this.isEditable())if(!n&&this.invalidChecksum)if(null!=e)e({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave(),null!=c&&c();else if(null!=e)e({message:mxResources.get("readOnly")}); -else throw Error(mxResources.get("readOnly"));}catch(t){if(null!=e)e(t);else throw t;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var c=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=c&&(c.viewState=this.ui.editor.graph.getViewState(),c.needsUpdate=!0)}c=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return c}; +else throw Error(mxResources.get("readOnly"));}catch(q){if(null!=e)e(q);else throw q;}};DrawioFile.prototype.createData=function(){var b=this.ui.pages;if(this.isRealtime()&&(this.ui.pages=this.ownPages,null!=this.ui.currentPage)){var c=this.ui.getPageById(this.ui.currentPage.getId(),this.ownPages);null!=c&&(c.viewState=this.ui.editor.graph.getViewState(),c.needsUpdate=!0)}c=this.ui.getFileData(null,null,null,null,null,null,null,null,this,!this.isCompressed());this.ui.pages=b;return c}; DrawioFile.prototype.updateFileData=function(){this.setData(this.createData());null!=this.sync&&this.sync.fileDataUpdated()};DrawioFile.prototype.isCompressedStorage=function(){return!0};DrawioFile.prototype.isCompressed=function(){var b=null!=this.ui.fileNode?this.ui.fileNode.getAttribute("compressed"):null;return null!=b?"false"!=b:this.isCompressedStorage()&&Editor.compressXml};DrawioFile.prototype.saveAs=function(b,c,e){};DrawioFile.prototype.saveFile=function(b,c,e,f){}; DrawioFile.prototype.getPublicUrl=function(b){b(null)};DrawioFile.prototype.isRestricted=function(){return!1};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.getShadowModified=function(){return this.shadowModified};DrawioFile.prototype.setShadowModified=function(b){this.shadowModified=b};DrawioFile.prototype.setModified=function(b){this.shadowModified=this.modified=b};DrawioFile.prototype.isAutosaveOptional=function(){return!1}; DrawioFile.prototype.isAutosave=function(){return!this.inConflictState&&this.ui.editor.autosave};DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(b,c,e){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.isTrashed=function(){return!1};DrawioFile.prototype.move=function(b,c,e){};DrawioFile.prototype.share=function(){this.ui.alert(mxResources.get("sharingAvailable"),null,380)};DrawioFile.prototype.getHash=function(){return""}; @@ -3042,7 +3043,7 @@ DrawioFile.prototype.fileChanged=function(b){b=null!=b?b:!0;this.lastChanged=new null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=this.lastChanged)}),mxUtils.bind(this,function(b){this.handleFileError(b)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus());null!=this.sync&&b&&this.sync.localFileChanged()}; DrawioFile.prototype.createSecret=function(b){var c=Editor.guid(32);null==this.sync||this.isOptimisticSync()?b(c):this.sync.createToken(c,mxUtils.bind(this,function(e){b(c,e)}),mxUtils.bind(this,function(){b(c)}))};DrawioFile.prototype.fileSaving=function(){null!=this.sync&&this.sync.fileSaving()}; DrawioFile.prototype.fileSaved=function(b,c,e,f,n){this.lastSaved=new Date;this.ageStart=null;try{this.stats.saved++;this.invalidChecksum=this.inConflictState=!1;var l=this.ui.getPagesForXml(b);null==this.sync||this.isOptimisticSync()?(this.setShadowPages(l),null!=this.sync&&(this.sync.lastModified=this.getLastModifiedDate(),this.sync.resetUpdateStatusThread(),this.isRealtime()&&this.sync.scheduleCleanup()),null!=e&&e()):this.sync.fileSaved(l,c,e,f,n)}catch(k){this.invalidChecksum=this.inConflictState= -!0;this.descriptorChanged();null!=f&&f(k);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,k);else{var t=this.getCurrentUser(),d=null!=t?t.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),d,k)}}catch(g){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}; +!0;this.descriptorChanged();null!=f&&f(k);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,k);else{var q=this.getCurrentUser(),d=null!=q?q.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),d,k)}}catch(g){}}EditorUi.debug("DrawioFile.fileSaved",[this],"savedData",[b],"inConflictState",this.inConflictState,"invalidChecksum",this.invalidChecksum)}; DrawioFile.prototype.autosave=function(b,c,e,f){null==this.lastAutosave&&(this.lastAutosave=Date.now());b=Date.now()-this.lastAutosave this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))}; @@ -3051,10 +3052,10 @@ DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(this DrawioFile.prototype.commentsRefreshNeeded=function(){return!0};DrawioFile.prototype.commentsSaveNeeded=function(){return!1};DrawioFile.prototype.getComments=function(b,c){b([])};DrawioFile.prototype.addComment=function(b,c,e){c(Date.now())};DrawioFile.prototype.canReplyToReplies=function(){return!0};DrawioFile.prototype.canComment=function(){return!0};DrawioFile.prototype.newComment=function(b,c){return new DrawioComment(this,null,b,Date.now(),Date.now(),!1,c)};LocalFile=function(b,c,e,f,n,l){DrawioFile.call(this,b,c);this.title=e;this.mode=f?null:App.MODE_DEVICE;this.fileHandle=n;this.desc=l};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return null!=this.fileHandle&&!this.invalidFileHandle&&DrawioFile.prototype.isAutosave.apply(this,arguments)};LocalFile.prototype.isAutosaveOptional=function(){return null!=this.fileHandle};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title}; LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.save=function(b,c,e){this.saveAs(this.title,c,e)};LocalFile.prototype.saveAs=function(b,c,e){this.saveFile(b,!1,c,e)};LocalFile.prototype.saveAs=function(b,c,e){this.saveFile(b,!1,c,e)};LocalFile.prototype.getDescriptor=function(){return this.desc};LocalFile.prototype.setDescriptor=function(b){this.desc=b}; LocalFile.prototype.getLatestVersion=function(b,c){null==this.fileHandle?b(null):this.ui.loadFileSystemEntry(this.fileHandle,b,c)}; -LocalFile.prototype.saveFile=function(b,c,e,f,n){b!=this.title&&(this.desc=this.fileHandle=null);this.title=b;n||this.updateFileData();var l=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var t=this.getData(),d=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=e&&e()}),k=mxUtils.bind(this,function(c){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=!0;var g=mxUtils.bind(this, +LocalFile.prototype.saveFile=function(b,c,e,f,n){b!=this.title&&(this.desc=this.fileHandle=null);this.title=b;n||this.updateFileData();var l=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle());this.setShadowModified(!1);var q=this.getData(),d=mxUtils.bind(this,function(){this.setModified(this.getShadowModified());this.contentChanged();null!=e&&e()}),k=mxUtils.bind(this,function(c){if(null!=this.fileHandle){if(!this.savingFile){this.savingFileTime=new Date;this.savingFile=!0;var g=mxUtils.bind(this, function(b){this.savingFile=!1;null!=f&&f({error:b})});this.saveDraft();this.fileHandle.createWritable().then(mxUtils.bind(this,function(b){this.fileHandle.getFile().then(mxUtils.bind(this,function(e){this.invalidFileHandle=null;EditorUi.debug("LocalFile.saveFile",[this],"desc",[this.desc],"newDesc",[e],"conflict",this.desc.lastModified!=e.lastModified);this.desc.lastModified==e.lastModified?b.write(l?this.ui.base64ToBlob(c,"image/png"):c).then(mxUtils.bind(this,function(){b.close().then(mxUtils.bind(this, -function(){this.fileHandle.getFile().then(mxUtils.bind(this,function(b){try{var c=this.desc;this.savingFile=!1;this.desc=b;this.fileSaved(t,c,d,g);this.removeDraft()}catch(y){g(y)}}),g)}),g)}),g):(this.inConflictState=!0,g())}),mxUtils.bind(this,function(b){this.invalidFileHandle=!0;g(b)}))}),g)}}else{if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(c,b,l?"image/png":"text/xml",l);else if(c.length >2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);d+="==";break}k=b.charCodeAt(c++);if(c==g){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<< 4|(k&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2);d+="=";break}f=b.charCodeAt(c++);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(k&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2|(f&192)>>6);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f&63)}return d}; Editor.prototype.loadUrl=function(b,d,c,g,e,k,f,m){try{var l=!f&&(g||/(\.png)($|\?)/i.test(b)||/(\.jpe?g)($|\?)/i.test(b)||/(\.gif)($|\?)/i.test(b)||/(\.pdf)($|\?)/i.test(b));e=null!=e?e:!0;var p=mxUtils.bind(this,function(){mxUtils.get(b,mxUtils.bind(this,function(b){if(200<=b.getStatus()&&299>=b.getStatus()){if(null!=d){var g=b.getText();if(l){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){b=mxUtilsBinaryToArray(b.request.responseBody).toArray(); -for(var g=Array(b.length),e=0;e g.indexOf("mxPageSelector")&&0 n;n++)for(var l=n,t=0;8>t;t++)l=1==(l&1)?3988292384^l>>>1:l>>>1,Editor.crcTable[n]=l;Editor.updateCRC=function(b,d,c,g){for(var e=0;e >>8;return b};Editor.crc32=function(b){for(var d=-1,c=0;c >>8^Editor.crcTable[(d^b.charCodeAt(c))&255];return(d^-1)>>>0};Editor.writeGraphModelToPng=function(b,d,c,g,e){function k(b,d){var c= +e&&e(xa)}}))}catch(ia){null!=e&&e(ia)}}),c,t)}catch(na){null!=e&&e(na)}};Editor.crcTable=[];for(var n=0;256>n;n++)for(var l=n,q=0;8>q;q++)l=1==(l&1)?3988292384^l>>>1:l>>>1,Editor.crcTable[n]=l;Editor.updateCRC=function(b,d,c,g){for(var e=0;e >>8;return b};Editor.crc32=function(b){for(var d=-1,c=0;c >>8^Editor.crcTable[(d^b.charCodeAt(c))&255];return(d^-1)>>>0};Editor.writeGraphModelToPng=function(b,d,c,g,e){function k(b,d){var c= l;l+=d;return b.substring(c,l)}function f(b){b=k(b,4);return b.charCodeAt(3)+(b.charCodeAt(2)<<8)+(b.charCodeAt(1)<<16)+(b.charCodeAt(0)<<24)}function m(b){return String.fromCharCode(b>>24&255,b>>16&255,b>>8&255,b&255)}b=b.substring(b.indexOf(",")+1);b=window.atob?atob(b):Base64.decode(b,!0);var l=0;if(k(b,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(k(b,4),"IHDR"!=k(b,4))null!=e&&e();else{k(b,17);e=b.substring(0,l);do{var p=f(b);if("IDAT"==k(b,4)){e=b.substring(0, l-8);"pHYs"==d&&"dpi"==c?(c=Math.round(g/.0254),c=m(c)+m(c)+String.fromCharCode(1)):c=c+String.fromCharCode(0)+("zTXt"==d?String.fromCharCode(0):"")+g;g=4294967295;g=Editor.updateCRC(g,d,0,4);g=Editor.updateCRC(g,c,0,c.length);e+=m(c.length)+d+c+m(g^4294967295);e+=b.substring(l-8,b.length);break}e+=b.substring(l-8,l-4+p);k(b,p);k(b,4)}while(p);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://www.diagrams.net/doc/faq/save-file-formats"; var d=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(b,c){d.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var k=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){k.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(b,d){var c=null;null!=b.editor.graph.getModel().getParent(d)?c=d.getId():null!=b.currentPage&& -(c=b.currentPage.getId());return c});if(null!=window.StyleFormatPanel){var g=Format.prototype.init;Format.prototype.init=function(){g.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var q=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?q.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isShadowOptionVisible=function(){var b=this.editorUi.getCurrentFile(); +(c=b.currentPage.getId());return c});if(null!=window.StyleFormatPanel){var g=Format.prototype.init;Format.prototype.init=function(){g.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var t=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?t.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isShadowOptionVisible=function(){var b=this.editorUi.getCurrentFile(); return"1"==urlParams.embed||null!=b&&b.isEditable()};DiagramFormatPanel.prototype.isMathOptionVisible=function(b){return!1};var m=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(b){b=m.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var d=this.editorUi,c=d.editor.graph,g=this.createOption(mxResources.get("shadow"),function(){return c.shadowVisible},function(b){var g=new ChangePageSetup(d);g.ignoreColor=!0;g.ignoreImage= !0;g.shadowVisible=b;c.model.execute(g)},{install:function(b){this.listener=function(){b(c.shadowVisible)};d.addListener("shadowVisibleChanged",this.listener)},destroy:function(){d.removeListener(this.listener)}});Editor.enableShadowOption||(g.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(g,60));b.appendChild(g)}return b};var p=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(b){b=p.apply(this,arguments);var d=this.editorUi, c=d.editor.graph;if(c.isEnabled()){var g=d.getCurrentFile();if(null!=g&&g.isAutosaveOptional()){var e=this.createOption(mxResources.get("autosave"),function(){return d.editor.autosave},function(b){d.editor.setAutosave(b);d.editor.autosave&&g.isModified()&&g.fileChanged()},{install:function(b){this.listener=function(){b(d.editor.autosave)};d.editor.addListener("autosaveChanged",this.listener)},destroy:function(){d.editor.removeListener(this.listener)}});b.appendChild(e)}}if(this.isMathOptionVisible()&& @@ -3212,32 +3213,32 @@ null!=e&&null!=e.shape&&(e.shape.commonCustomPropAdded||(e.shape.commonCustomPro function(){var b=this.editorUi.getSelectionState();"image"!=b.style.shape&&!b.containsLabel&&0 c.size&&(f=f.slice(0,c.size));d=f.join(",");null!=c.countProperty&&(n.setCellStyles(c.countProperty,f.length,n.getSelectionCells()),e.push(c.countProperty),k.push(f.length))}n.setCellStyles(b,d,n.getSelectionCells());e.push(b);k.push(d);if(null!=c.dependentProps)for(b=0;b d)p=p.slice(0,d);else for(var u=p.length;u p.max&&(b=p.max);b=encodeURIComponent(("int"==y?parseInt(b):b)+"");g(d,b,p)}var f=document.createElement("input"); -e(t,f,!0);f.value=decodeURIComponent(c);f.className="gePropEditor";"int"!=y&&"float"!=y||p.allowAuto||(f.type="number",f.step="int"==y?"1":"any",null!=p.min&&(f.min=parseFloat(p.min)),null!=p.max&&(f.max=parseFloat(p.max)));b.appendChild(f);mxEvent.addListener(f,"keypress",function(b){13==b.keyCode&&k()});f.focus();mxEvent.addListener(f,"blur",function(){k()})})));p.isDeletable&&(u=mxUtils.button("-",mxUtils.bind(q,function(b){g(d,"",p,p.index);mxEvent.consume(b)})),u.style.height="16px",u.style.width= -"25px",u.style["float"]="right",u.className="geColorBtn",t.appendChild(u));x.appendChild(t);return x}var q=this,n=this.editorUi.editor.graph,u=[];b.style.position="relative";b.style.padding="0";var v=document.createElement("table");v.className="geProperties";v.style.whiteSpace="nowrap";v.style.width="100%";var y=document.createElement("tr");y.className="gePropHeader";var x=document.createElement("th");x.className="gePropHeaderCell";var t=document.createElement("img");t.src=Sidebar.prototype.expandedImage; -t.style.verticalAlign="middle";x.appendChild(t);mxUtils.write(x,mxResources.get("property"));y.style.cursor="pointer";var B=function(){var d=v.querySelectorAll(".gePropNonHeaderRow"),c;if(q.editorUi.propertiesCollapsed){t.src=Sidebar.prototype.collapsedImage;c="none";for(var g=b.childNodes.length-1;0<=g;g--)try{var e=b.childNodes[g],k=e.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||b.removeChild(e)}catch(wa){}}else t.src=Sidebar.prototype.expandedImage,c="";for(g=0;g p.max&&(b=p.max);b=encodeURIComponent(("int"==y?parseInt(b):b)+"");g(d,b,p)}var f=document.createElement("input"); +e(q,f,!0);f.value=decodeURIComponent(c);f.className="gePropEditor";"int"!=y&&"float"!=y||p.allowAuto||(f.type="number",f.step="int"==y?"1":"any",null!=p.min&&(f.min=parseFloat(p.min)),null!=p.max&&(f.max=parseFloat(p.max)));b.appendChild(f);mxEvent.addListener(f,"keypress",function(b){13==b.keyCode&&k()});f.focus();mxEvent.addListener(f,"blur",function(){k()})})));p.isDeletable&&(u=mxUtils.button("-",mxUtils.bind(t,function(b){g(d,"",p,p.index);mxEvent.consume(b)})),u.style.height="16px",u.style.width= +"25px",u.style["float"]="right",u.className="geColorBtn",q.appendChild(u));x.appendChild(q);return x}var t=this,n=this.editorUi.editor.graph,u=[];b.style.position="relative";b.style.padding="0";var v=document.createElement("table");v.className="geProperties";v.style.whiteSpace="nowrap";v.style.width="100%";var y=document.createElement("tr");y.className="gePropHeader";var x=document.createElement("th");x.className="gePropHeaderCell";var q=document.createElement("img");q.src=Sidebar.prototype.expandedImage; +q.style.verticalAlign="middle";x.appendChild(q);mxUtils.write(x,mxResources.get("property"));y.style.cursor="pointer";var B=function(){var d=v.querySelectorAll(".gePropNonHeaderRow"),c;if(t.editorUi.propertiesCollapsed){q.src=Sidebar.prototype.collapsedImage;c="none";for(var g=b.childNodes.length-1;0<=g;g--)try{var e=b.childNodes[g],k=e.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||b.removeChild(e)}catch(wa){}}else q.src=Sidebar.prototype.expandedImage,c="";for(g=0;g =this.defaultColorSchemes.length?"24px":"30px";d.style.margin="0px 6px 6px 0px";if(null!=b){var f="1"==urlParams.sketch?"2px solid":"1px solid";null!=b.gradient?mxClient.IS_IE&&10>document.documentMode?d.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+b.fill+"', EndColorStr='"+b.gradient+"', GradientType=0)":d.style.backgroundImage="linear-gradient("+b.fill+" 0px,"+b.gradient+" 100%)":b.fill==mxConstants.NONE?d.style.background="url('"+ Dialog.prototype.noColorImage+"')":d.style.backgroundColor=""==b.fill?mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,Editor.isDarkMode()?Editor.darkColor:"#ffffff"):b.fill||mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,Editor.isDarkMode()?Editor.darkColor:"#ffffff");d.style.border=b.stroke==mxConstants.NONE?f+" transparent":""==b.stroke?f+" "+mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,Editor.isDarkMode()?"#ffffff":Editor.darkColor):f+ " "+(b.stroke||mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,Editor.isDarkMode()?"#ffffff":Editor.darkColor));null!=b.title&&d.setAttribute("title",b.title)}else{var f=mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"#ffffff"),m=mxUtils.getValue(g.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"#000000");d.style.backgroundColor=f;d.style.border="1px solid "+m}d.style.borderRadius="0";e.appendChild(d)});e.innerHTML="";for(var f=0;f =this.defaultColorSchemes.length?28:8,u=document.createElement("div");u.style.cssText="position:absolute;left:10px;top:8px;bottom:"+l+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);"; -mxEvent.addListener(u,"click",mxUtils.bind(this,function(){q(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var v=document.createElement("div");v.style.cssText="position:absolute;left:202px;top:8px;bottom:"+l+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);"; -1 =this.defaultColorSchemes.length&&b.appendChild(f);return b};StyleFormatPanel.prototype.addEditOps=function(b){var d=this.editorUi.getSelectionState(),c=this.editorUi.editor.graph,g=null;1==d.cells.length&&(g=mxUtils.button(mxResources.get("editStyle"), +4)&&mxUtils.br(e),d(b[f])});null==this.format.currentScheme?t(Editor.isDarkMode()?1:"1"==urlParams.sketch?5:0):t(this.format.currentScheme);var l=10>=this.defaultColorSchemes.length?28:8,u=document.createElement("div");u.style.cssText="position:absolute;left:10px;top:8px;bottom:"+l+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);"; +mxEvent.addListener(u,"click",mxUtils.bind(this,function(){t(mxUtils.mod(this.format.currentScheme-1,this.defaultColorSchemes.length))}));var v=document.createElement("div");v.style.cssText="position:absolute;left:202px;top:8px;bottom:"+l+"px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);"; +1 =this.defaultColorSchemes.length&&b.appendChild(f);return b};StyleFormatPanel.prototype.addEditOps=function(b){var d=this.editorUi.getSelectionState(),c=this.editorUi.editor.graph,g=null;1==d.cells.length&&(g=mxUtils.button(mxResources.get("editStyle"), mxUtils.bind(this,function(b){this.editorUi.actions.get("editStyle").funct()})),g.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),g.style.width="210px",g.style.marginBottom="2px",b.appendChild(g));c=1==d.cells.length?c.view.getState(d.cells[0]):null;null!=c&&null!=c.shape&&null!=c.shape.stencil?(d=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,function(b){this.editorUi.actions.get("editShape").funct()})),d.setAttribute("title", mxResources.get("editShape")),d.style.marginBottom="2px",null==g?d.style.width="210px":(g.style.width="104px",d.style.width="104px",d.style.marginLeft="2px"),b.appendChild(d)):d.image&&0 mxUtils.indexOf(f.hiddenTags,b),p=document.createElement("tr"),q=document.createElement("td");q.style.align="center";q.style.width="16px";var n=document.createElement("img");n.setAttribute("src",k?Editor.visibleImage:Editor.hiddenImage); -n.setAttribute("title",mxResources.get(k?"hideIt":"show",[b]));mxUtils.setOpacity(n,k?75:25);n.style.verticalAlign="middle";n.style.cursor="pointer";n.style.width="16px";if(d||Editor.isDarkMode())n.style.filter="invert(100%)";q.appendChild(n);mxEvent.addListener(n,"click",function(d){var c=mxUtils.indexOf(f.hiddenTags,b);mxEvent.isShiftDown(d)?e(0<=mxUtils.indexOf(f.hiddenTags,b)):(0>c?f.hiddenTags.push(b):0<=c&&f.hiddenTags.splice(c,1),g(),f.refresh());mxEvent.consume(d)});p.appendChild(q);q=document.createElement("td"); -q.style.overflow="hidden";q.style.whiteSpace="nowrap";q.style.textOverflow="ellipsis";q.style.verticalAlign="middle";q.style.cursor="pointer";q.setAttribute("title",b);a=document.createElement("a");mxUtils.write(a,b);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,k?100:40);q.appendChild(a);mxEvent.addListener(q,"click",function(d){if(mxEvent.isShiftDown(d)){e(!0);var c=f.getCellsForTags([b],null,null,!0);f.isEnabled()?f.setSelectionCells(c):f.highlightCells(c)}else if(k&& -0 mxUtils.indexOf(m,g[e])&&m.push(g[e]);m.sort();f.isSelectionEmpty()?k(m):k(m,f.getCommonTagsForCells(f.getSelectionCells()))}}); -f.selectionModel.addListener(mxEvent.CHANGE,u);f.model.addListener(mxEvent.CHANGE,u);f.addListener(mxEvent.REFRESH,u);var v=document.createElement("div");v.style.boxSizing="border-box";v.style.whiteSpace="nowrap";v.style.position="absolute";v.style.overflow="hidden";v.style.bottom="0px";v.style.height="42px";v.style.right="10px";v.style.left="10px";f.isEnabled()&&(v.appendChild(q),v.appendChild(n),l.appendChild(v));return{div:l,refresh:u}};Graph.prototype.getCustomFonts=function(){var b=this.extFonts, +t){G.apply(this,arguments);Graph.processFontAttributes(t)};var H=mxText.prototype.redraw;mxText.prototype.redraw=function(){H.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(b,d,c){function g(){for(var b=f.getSelectionCells(),d=[],c=0;c mxUtils.indexOf(f.hiddenTags,b),p=document.createElement("tr"),t=document.createElement("td");t.style.align="center";t.style.width="16px";var n=document.createElement("img");n.setAttribute("src",k?Editor.visibleImage:Editor.hiddenImage); +n.setAttribute("title",mxResources.get(k?"hideIt":"show",[b]));mxUtils.setOpacity(n,k?75:25);n.style.verticalAlign="middle";n.style.cursor="pointer";n.style.width="16px";if(d||Editor.isDarkMode())n.style.filter="invert(100%)";t.appendChild(n);mxEvent.addListener(n,"click",function(d){var c=mxUtils.indexOf(f.hiddenTags,b);mxEvent.isShiftDown(d)?e(0<=mxUtils.indexOf(f.hiddenTags,b)):(0>c?f.hiddenTags.push(b):0<=c&&f.hiddenTags.splice(c,1),g(),f.refresh());mxEvent.consume(d)});p.appendChild(t);t=document.createElement("td"); +t.style.overflow="hidden";t.style.whiteSpace="nowrap";t.style.textOverflow="ellipsis";t.style.verticalAlign="middle";t.style.cursor="pointer";t.setAttribute("title",b);a=document.createElement("a");mxUtils.write(a,b);a.style.textOverflow="ellipsis";a.style.position="relative";mxUtils.setOpacity(a,k?100:40);t.appendChild(a);mxEvent.addListener(t,"click",function(d){if(mxEvent.isShiftDown(d)){e(!0);var c=f.getCellsForTags([b],null,null,!0);f.isEnabled()?f.setSelectionCells(c):f.highlightCells(c)}else if(k&& +0 mxUtils.indexOf(m,g[e])&&m.push(g[e]);m.sort();f.isSelectionEmpty()?k(m):k(m,f.getCommonTagsForCells(f.getSelectionCells()))}}); +f.selectionModel.addListener(mxEvent.CHANGE,u);f.model.addListener(mxEvent.CHANGE,u);f.addListener(mxEvent.REFRESH,u);var v=document.createElement("div");v.style.boxSizing="border-box";v.style.whiteSpace="nowrap";v.style.position="absolute";v.style.overflow="hidden";v.style.bottom="0px";v.style.height="42px";v.style.right="10px";v.style.left="10px";f.isEnabled()&&(v.appendChild(t),v.appendChild(n),l.appendChild(v));return{div:l,refresh:u}};Graph.prototype.getCustomFonts=function(){var b=this.extFonts, b=null!=b?b.slice():[],d;for(d in Graph.customFontElements){var c=Graph.customFontElements[d];b.push({name:c.name,url:c.url})}return b};Graph.prototype.setFont=function(b,d){Graph.addFont(b,d);document.execCommand("fontname",!1,b);if(null!=d){var c=this.cellEditor.textarea.getElementsByTagName("font");d=Graph.getFontUrl(b,d);for(var g=0;g '+mxUtils.htmlEntities(b)+""};mxGraphView.prototype.redrawEnumerationState=function(b){var d="1"==mxUtils.getValue(b.style,"enumerate",0);d&&null==b.secondLabel?(b.secondLabel=new mxText("",new mxRectangle,mxConstants.ALIGN_LEFT,mxConstants.ALIGN_BOTTOM),b.secondLabel.size=12,b.secondLabel.state=b,b.secondLabel.dialect=mxConstants.DIALECT_STRICTHTML,this.graph.cellRenderer.initializeLabel(b,b.secondLabel)): @@ -3271,17 +3272,17 @@ d||null==b.secondLabel||(b.secondLabel.destroy(),b.secondLabel=null);d=b.secondL null!=this.getDrawPane()){var b=this.getDrawPane().parentNode;!this.graph.mathEnabled||mxClient.NO_FO||null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode||"svg"!=this.graph.container.firstChild.nodeName?null==this.webKitForceRepaintNode||this.graph.mathEnabled&&("svg"==this.graph.container.firstChild.nodeName||this.graph.container.firstChild==this.webKitForceRepaintNode)||(null!=this.webKitForceRepaintNode.parentNode&&this.webKitForceRepaintNode.parentNode.removeChild(this.webKitForceRepaintNode), this.webKitForceRepaintNode=null):(this.webKitForceRepaintNode=document.createElement("div"),this.webKitForceRepaintNode.style.cssText="position:absolute;",b.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode,b.ownerSVGElement))}};var M=Graph.prototype.refresh;Graph.prototype.refresh=function(){M.apply(this,arguments);this.refreshBackgroundImage()};Graph.prototype.refreshBackgroundImage=function(){null!=this.backgroundImage&&null!=this.backgroundImage.originalSrc&&(this.setBackgroundImage(this.backgroundImage), this.view.validateBackgroundImage())};var Q=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){Q.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(b){"data:action/json,"==b.substring(0,17)&&(b=JSON.parse(b.substring(17)),null!=b.actions&&this.executeCustomActions(b.actions))};Graph.prototype.executeCustomActions=function(b,d){if(this.executingCustomActions)this.stoppingCustomActions=!0,null!=this.pendingWaitThread&&window.clearTimeout(this.pendingWaitThread), -null!=this.pendingExecuteNextAction&&this.pendingExecuteNextAction(),this.fireEvent(new mxEventObject("stopExecutingCustomActions"));else{this.executingCustomActions=!0;var c=!1,g=0,e=0,k=mxUtils.bind(this,function(){c||(c=!0,this.model.beginUpdate())}),f=mxUtils.bind(this,function(){c&&(c=!1,this.model.endUpdate())}),m=mxUtils.bind(this,function(){0 mxUtils.indexOf(p.tags.visible,u[v])&&0>mxUtils.indexOf(n,u[v])&&n.push(u[v]);this.hiddenTags=n;this.refresh()}0 mxUtils.indexOf(p.tags.visible,u[v])&&0>mxUtils.indexOf(n,u[v])&&n.push(u[v]);this.hiddenTags=n;this.refresh()}0 b.excludeCells.indexOf(c[e].id)&&g.push(c[e]);c=g}return c};Graph.prototype.getCellsById=function(b){var d=[];if(null!=b)for(var c=0;c this.hiddenTags.length)return!1;for(var d=0;d mxUtils.indexOf(this.hiddenTags,b[d]))return!1;return!0};Graph.prototype.getCellsForTags=function(b,d,c,g){var e=[];if(null!=b){d=null!=d?d:this.model.getDescendants(this.model.getRoot()); -for(var k=0,f={},m=0;m =b.length)){for(var q=p=0;q =b.length)){for(var t=p=0;t mxUtils.indexOf(e,m)&&(g=0 '),c.writeln(Editor.mathJaxWebkitCss), +t=d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var n=d.getGraphBounds(),u=0,v=0,x=V.get(),q=1/d.pageScale,C=M.checked;if(C)var q=parseInt(B.value),Q=parseInt(F.value),q=Math.min(x.height*Q/(n.height/d.view.scale),x.width*q/(n.width/d.view.scale));else q=parseInt(A.value)/(100*d.pageScale),isNaN(q)&&(g=1/d.pageScale,A.value="100 %");x=mxRectangle.fromRectangle(x);x.width=Math.ceil(x.width* +g);x.height=Math.ceil(x.height*g);q*=g;!C&&d.pageVisible?(n=d.getPageLayout(),u-=n.x*x.width,v-=n.y*x.height):C=!0;if(null==c){c=PrintDialog.createPrintPreview(d,q,x,0,u,v,C);c.pageSelector=!1;c.mathEnabled=!1;y.checked&&(c.isCellVisible=function(b){return d.isCellSelected(b)});u=b.getCurrentFile();null!=u&&(c.title=u.getTitle());var E=c.writeHead;c.writeHead=function(c){E.apply(this,arguments);if(mxClient.IS_GC||mxClient.IS_SF)c.writeln('");mxClient.IS_GC&&(c.writeln('"));null!=b.editor.fontCss&&(c.writeln('"));for(var g=d.getCustomFonts(),e=0;e '): (c.writeln('"))}};if("undefined"!==typeof MathJax){var N=c.renderPage;c.renderPage=function(d,c,g,e,k,f){var m=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!b.editor.useForeignObjectForMath?!0:b.editor.originalNoForeignObject;var l=N.apply(this,arguments);mxClient.NO_FO=m;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled|| !0:l.className="geDisableMathJax";return l}}u=null;v=e.shapeForegroundColor;C=e.shapeBackgroundColor;x=e.enableFlowAnimation;e.enableFlowAnimation=!1;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(u=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.shapeForegroundColor="#000000",e.shapeBackgroundColor="#ffffff",e.refresh());c.open(null,null,k,!0);e.enableFlowAnimation=x;null!=u&&(e.shapeForegroundColor=v,e.shapeBackgroundColor=C,e.stylesheet=u,e.refresh())}else{x=d.background;if(null==x||""== -x||x==mxConstants.NONE)x="#ffffff";c.backgroundColor=x;c.autoOrigin=C;c.appendGraph(d,t,u,v,k,!0);k=d.getCustomFonts();if(null!=c.wnd)for(u=0;u '):(c.wnd.document.writeln('"))}f&& -(d.useCssTransforms=f,d.currentTranslate=m,d.currentScale=l,d.view.translate=p,d.view.scale=q);return c}var g=parseInt(Y.value)/100;isNaN(g)&&(g=1,Y.value="100 %");var g=.75*g,k=null,f=e.shapeForegroundColor,m=e.shapeBackgroundColor;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(k=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.shapeForegroundColor="#000000",e.shapeBackgroundColor="#ffffff",e.refresh());var p=u.value,n=v.value,x=!q.checked,t=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(b, -q.checked,p,n,M.checked,B.value,F.value,parseInt(A.value)/100,parseInt(Y.value)/100,V.get());else{x&&(x=y.checked||p==l&&n==l);if(!x&&null!=b.pages&&b.pages.length){var C=0,x=b.pages.length-1;q.checked||(C=parseInt(p)-1,x=parseInt(n)-1);for(var Q=C;Q<=x;Q++){var E=b.pages[Q],p=E==b.currentPage?e:null;if(null==p){p=b.createTemporaryGraph(e.stylesheet);p.shapeForegroundColor=e.shapeForegroundColor;p.shapeBackgroundColor=e.shapeBackgroundColor;var n=!0,C=!1,N=null,J=null;null==E.viewState&&null==E.root&& +x||x==mxConstants.NONE)x="#ffffff";c.backgroundColor=x;c.autoOrigin=C;c.appendGraph(d,q,u,v,k,!0);k=d.getCustomFonts();if(null!=c.wnd)for(u=0;u '):(c.wnd.document.writeln('"))}f&& +(d.useCssTransforms=f,d.currentTranslate=m,d.currentScale=l,d.view.translate=p,d.view.scale=t);return c}var g=parseInt(Y.value)/100;isNaN(g)&&(g=1,Y.value="100 %");var g=.75*g,k=null,f=e.shapeForegroundColor,m=e.shapeBackgroundColor;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(k=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.shapeForegroundColor="#000000",e.shapeBackgroundColor="#ffffff",e.refresh());var p=u.value,n=v.value,x=!t.checked,q=null;if(EditorUi.isElectronApp)PrintDialog.electronPrint(b, +t.checked,p,n,M.checked,B.value,F.value,parseInt(A.value)/100,parseInt(Y.value)/100,V.get());else{x&&(x=y.checked||p==l&&n==l);if(!x&&null!=b.pages&&b.pages.length){var C=0,x=b.pages.length-1;t.checked||(C=parseInt(p)-1,x=parseInt(n)-1);for(var Q=C;Q<=x;Q++){var E=b.pages[Q],p=E==b.currentPage?e:null;if(null==p){p=b.createTemporaryGraph(e.stylesheet);p.shapeForegroundColor=e.shapeForegroundColor;p.shapeBackgroundColor=e.shapeBackgroundColor;var n=!0,C=!1,N=null,J=null;null==E.viewState&&null==E.root&& b.updatePageRoot(E);null!=E.viewState&&(n=E.viewState.pageVisible,C=E.viewState.mathEnabled,N=E.viewState.background,J=E.viewState.backgroundImage,p.extFonts=E.viewState.extFonts);null!=J&&null!=J.originalSrc&&(J=b.createImageForPageLink(J.originalSrc,E));p.background=N;p.backgroundImage=null!=J?new mxImage(J.src,J.width,J.height,J.x,J.y):null;p.pageVisible=n;p.mathEnabled=C;var G=p.getGraphBounds;p.getGraphBounds=function(){var b=G.apply(this,arguments),d=this.backgroundImage;if(null!=d&&null!=d.width&& -null!=d.height){var c=this.view.translate,g=this.view.scale,b=mxRectangle.fromRectangle(b);b.add(new mxRectangle((c.x+d.x)*g,(c.y+d.y)*g,d.width*g,d.height*g))}return b};var D=p.getGlobalVariable;p.getGlobalVariable=function(d){return"page"==d?E.getName():"pagenumber"==d?Q+1:"pagecount"==d?null!=b.pages?b.pages.length:1:D.apply(this,arguments)};document.body.appendChild(p.container);b.updatePageRoot(E);p.model.setRoot(E.root)}t=c(p,t,Q!=x);p!=e&&p.container.parentNode.removeChild(p.container)}}else t= -c(e);null==t?b.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(x=t.wnd.document,d&&(t.wnd.IMMEDIATE_PRINT=!0),x.writeln('