diff --git a/ChangeLog b/ChangeLog index 7e533231758bcc032356fa3977a45d16183d8392..5b1367d21db8acd3b0e376998642dba41a8d935a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +06-NOV-2019: 12.2.2 + +- Fixes NPE in pasteCells + 06-NOV-2019: 12.2.1 - Fixes slow paste from clipboard in modern browsers diff --git a/VERSION b/VERSION index e597143d87cd0e53882d23cc4d7e49854c5f0816..c4891d644a53fed0c72fa38435a6b31dd2664846 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -12.2.1 \ No newline at end of file +12.2.2 \ No newline at end of file diff --git a/src/main/webapp/cache.manifest b/src/main/webapp/cache.manifest index 3af01f7b3a28d3b88eecefa1b9f00be1587a947b..c60ec76da773b36eb0d26aff372b59de5998fa7e 100644 --- a/src/main/webapp/cache.manifest +++ b/src/main/webapp/cache.manifest @@ -1,7 +1,7 @@ CACHE MANIFEST # THIS FILE WAS GENERATED. DO NOT MODIFY! -# 11/06/2019 04:08 PM +# 11/06/2019 04:59 PM app.html index.html?offline=1 diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js index ea6b8aecb89aea6a260970e67521c86ccf1f24f4..1a77b1523eecc13512d40b2ba8dd5a7697508e83 100644 --- a/src/main/webapp/js/app.min.js +++ b/src/main/webapp/js/app.min.js @@ -7829,10 +7829,10 @@ RemoteLibrary.prototype.saveAs=function(a,c,b){};RemoteLibrary.prototype.updateF mxClient.IS_IOS || */ var StorageDialog=function(a,c,b){function d(p,d,t,e,A,k){function g(){mxEvent.addListener(x,"click",null!=k?k:function(){t!=App.MODE_GOOGLE||a.isDriveDomain()?t==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(t,n.checked);c()})):t==App.MODE_ONEDRIVE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.oneDrive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(t,n.checked); c()})):(a.setMode(t,n.checked),c()):window.location.hostname=DriveClient.prototype.newAppHostname})}++q>b&&(mxUtils.br(f),q=0);var x=document.createElement("a");x.style.overflow="hidden";x.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";x.className="geBaseButton";x.style.boxSizing="border-box";x.style.fontSize="11px";x.style.position="relative";x.style.margin="4px";x.style.marginTop="2px";x.style.padding="8px 10px 12px 10px";x.style.width="88px";x.style.height=StorageDialog.extended?"50px": -"100px";x.style.whiteSpace="nowrap";x.setAttribute("title",d);mxClient.IS_QUIRKS&&(x.style.cssFloat="left",x.style.zoom="1");var B=document.createElement("div");B.style.textOverflow="ellipsis";B.style.overflow="hidden";if(null!=p){var u=document.createElement("img");u.setAttribute("src",p);u.setAttribute("border","0");u.setAttribute("align","absmiddle");u.style.width=StorageDialog.extended?"24px":"60px";u.style.height=StorageDialog.extended?"24px":"60px";u.style.paddingBottom=StorageDialog.extended? -"4px":"6px";x.appendChild(u)}else B.style.paddingTop="5px",B.style.whiteSpace="normal",mxClient.IS_IOS?(x.style.padding="0px 10px 20px 10px",x.style.top="6px"):mxClient.IS_FF&&(B.style.paddingTop="0px",B.style.marginTop="-2px");StorageDialog.extended&&(x.style.paddingTop="4px",x.style.marginBottom="0px",B.display="inline-block",2==b&&(u.style.width="38px",u.style.height="38px",x.style.width="80px",x.style.height="68px"));x.appendChild(B);mxUtils.write(B,d);if(null!=A)for(p=0;p<A.length;p++)mxUtils.br(B), -mxUtils.write(B,A[p]);if(null!=e&&null==a[e]){u.style.visibility="hidden";mxUtils.setOpacity(B,10);var v=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});v.spin(x);var E=window.setTimeout(function(){null==a[e]&&(v.stop(),x.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(b,c){null!=a[e]&&c.getProperty("client")==a[e]&&(window.clearTimeout(E),mxUtils.setOpacity(B, -100),u.style.visibility="",v.stop(),g(),"drive"==e&&null!=l.parentNode&&l.parentNode.removeChild(l))}))}else g();f.appendChild(x)}b=null!=b?b:2;var g=document.createElement("div");g.style.textAlign="center";g.style.whiteSpace="nowrap";g.style.paddingTop="0px";g.style.paddingBottom="20px";var e=a.addLanguageMenu(g,!0);null!=e&&(e.style.bottom=parseInt("28px")-3+"px");if(!a.isOffline()&&1<a.getServiceCount()){e=document.createElement("a");e.setAttribute("href","https://about.draw.io/support/");e.setAttribute("title", +"100px";x.style.whiteSpace="nowrap";x.setAttribute("title",d);mxClient.IS_QUIRKS&&(x.style.cssFloat="left",x.style.zoom="1");var u=document.createElement("div");u.style.textOverflow="ellipsis";u.style.overflow="hidden";if(null!=p){var B=document.createElement("img");B.setAttribute("src",p);B.setAttribute("border","0");B.setAttribute("align","absmiddle");B.style.width=StorageDialog.extended?"24px":"60px";B.style.height=StorageDialog.extended?"24px":"60px";B.style.paddingBottom=StorageDialog.extended? +"4px":"6px";x.appendChild(B)}else u.style.paddingTop="5px",u.style.whiteSpace="normal",mxClient.IS_IOS?(x.style.padding="0px 10px 20px 10px",x.style.top="6px"):mxClient.IS_FF&&(u.style.paddingTop="0px",u.style.marginTop="-2px");StorageDialog.extended&&(x.style.paddingTop="4px",x.style.marginBottom="0px",u.display="inline-block",2==b&&(B.style.width="38px",B.style.height="38px",x.style.width="80px",x.style.height="68px"));x.appendChild(u);mxUtils.write(u,d);if(null!=A)for(p=0;p<A.length;p++)mxUtils.br(u), +mxUtils.write(u,A[p]);if(null!=e&&null==a[e]){B.style.visibility="hidden";mxUtils.setOpacity(u,10);var v=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});v.spin(x);var F=window.setTimeout(function(){null==a[e]&&(v.stop(),x.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(b,c){null!=a[e]&&c.getProperty("client")==a[e]&&(window.clearTimeout(F),mxUtils.setOpacity(u, +100),B.style.visibility="",v.stop(),g(),"drive"==e&&null!=l.parentNode&&l.parentNode.removeChild(l))}))}else g();f.appendChild(x)}b=null!=b?b:2;var g=document.createElement("div");g.style.textAlign="center";g.style.whiteSpace="nowrap";g.style.paddingTop="0px";g.style.paddingBottom="20px";var e=a.addLanguageMenu(g,!0);null!=e&&(e.style.bottom=parseInt("28px")-3+"px");if(!a.isOffline()&&1<a.getServiceCount()){e=document.createElement("a");e.setAttribute("href","https://about.draw.io/support/");e.setAttribute("title", mxResources.get("help"));e.setAttribute("target","_blank");e.style.position="absolute";e.style.userSelect="none";e.style.textDecoration="none";e.style.cursor="pointer";e.style.fontSize="12px";e.style.bottom="28px";e.style.left="26px";e.style.color="gray";var k=document.createElement("img");mxUtils.setOpacity(k,50);k.style.height="16px";k.style.width="16px";k.setAttribute("border","0");k.setAttribute("valign","bottom");k.setAttribute("src",Editor.helpImage);k.style.marginRight="2px";e.appendChild(k); mxUtils.write(e,mxResources.get("help"));g.appendChild(e)}var m=document.createElement("div");m.style.position="absolute";m.style.cursor="pointer";m.style.fontSize="12px";m.style.bottom="28px";m.style.color="gray";m.style.userSelect="none";mxUtils.write(m,mxResources.get("decideLater"));mxUtils.setPrefixedStyle(m.style,"transform","translate(-50%,0)");m.style.left="50%";a.isOfflineApp()&&(m.style.bottom="28px");this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)m.style.marginLeft= -Math.round(m.clientWidth/2)+"px"};g.appendChild(m);mxEvent.addListener(m,"click",function(){a.hideDialog();var b=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=b});e=document.createElement("div");mxClient.IS_QUIRKS&&(e.style.whiteSpace="nowrap",e.style.cssFloat="left");e.style.border="1px solid #d3d3d3";e.style.borderWidth="1px 0px 1px 0px";e.style.padding="12px 0px 12px 0px";var n=document.createElement("input");n.setAttribute("type", @@ -7866,7 +7866,7 @@ mxClient.IS_CHROMEAPP)){if(51200>c.length){var f=mxUtils.button("",function(){tr " max)");f.style.verticalAlign="bottom";f.style.paddingTop="4px";f.style.minWidth="46px";f.className="geBtn";e.appendChild(f)}7168>c.length&&(f=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(m.value);a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawingTooLarge")})}}),q=document.createElement("img"),q.setAttribute("src",Editor.tweetImage),q.setAttribute("width", "18"),q.setAttribute("height","18"),q.setAttribute("border","0"),q.style.marginBottom="5px",f.appendChild(q),f.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),f.style.verticalAlign="bottom",f.style.paddingTop="4px",f.style.minWidth="46px",f.className="geBtn",e.appendChild(f))}q=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});e.appendChild(q);f=mxUtils.button(mxResources.get("copy"),function(){m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode|| mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>c.length?mxClient.IS_SF||null!=document.documentMode?q.className="geBtn gePrimaryBtn":(e.appendChild(f),f.className="geBtn gePrimaryBtn",q.className="geBtn"):(e.appendChild(n),q.className="geBtn",n.className="geBtn gePrimaryBtn");d.appendChild(e);this.container=d};EmbedDialog.showPreviewOption=!0; -var GoogleSitesDialog=function(a,c){function b(){var a=null!=A&&null!=A.getTitle()?A.getTitle():this.defaultFilename;if(B.checked&&""!=p.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(p.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<F.length&&(b+="&s="+F);""!=u.value&&"0"!=u.value&&(b+="&border="+u.value);""!=l.value&&(b+="&height="+l.value);b+="&pan="+(v.checked?"1":"0");b+="&zoom="+(t.checked?"1":"0");b+="&fit="+(x.checked?"1":"0"); +var GoogleSitesDialog=function(a,c){function b(){var a=null!=A&&null!=A.getTitle()?A.getTitle():this.defaultFilename;if(B.checked&&""!=p.value){var b="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(p.value));null!=a&&(b+="&title="+encodeURIComponent(a));0<E.length&&(b+="&s="+E);""!=u.value&&"0"!=u.value&&(b+="&border="+u.value);""!=l.value&&(b+="&height="+l.value);b+="&pan="+(v.checked?"1":"0");b+="&zoom="+(t.checked?"1":"0");b+="&fit="+(x.checked?"1":"0"); b+="&resize="+(C.checked?"1":"0");b+="&x0="+Number(f.value);b+="&y0="+n;g.mathEnabled&&(b+="&math=1");y.checked?b+="&edit=_blank":z.checked&&(b+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));q.value=b}else A.constructor==DriveFile||A.constructor==DropboxFile?(b="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=p.value?b+=encodeURIComponent(mxUtils.htmlEntities(p.value))+"&type=3":(b+=A.getHash().substring(1),b=A.constructor==DropboxFile?b+"&type=2":b+"&type=1"),null!= a&&(b+="&title="+encodeURIComponent(a)),""!=l.value&&(a=parseInt(l.value)+parseInt(f.value),b+="&height="+a),q.value=b):q.value=""}var d=document.createElement("div"),g=a.editor.graph,e=g.getGraphBounds(),k=g.view.scale,m=Math.floor(e.x/k-g.view.translate.x),n=Math.floor(e.y/k-g.view.translate.y);mxUtils.write(d,mxResources.get("googleGadget")+":");mxUtils.br(d);var q=document.createElement("input");q.setAttribute("type","text");q.style.marginBottom="8px";q.style.marginTop="2px";q.style.width="410px"; d.appendChild(q);mxUtils.br(d);this.init=function(){q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)};mxUtils.write(d,mxResources.get("top")+":");var f=document.createElement("input");f.setAttribute("type","text");f.setAttribute("size","4");f.style.marginRight="16px";f.style.marginLeft="4px";f.value=m;d.appendChild(f);mxUtils.write(d,mxResources.get("height")+":");var l=document.createElement("input");l.setAttribute("type", @@ -7874,7 +7874,7 @@ d.appendChild(q);mxUtils.br(d);this.init=function(){q.focus();mxClient.IS_GC||mx d.appendChild(p);mxUtils.br(d);mxUtils.write(d,mxResources.get("borderWidth")+":");var u=document.createElement("input");u.setAttribute("type","text");u.setAttribute("size","3");u.style.marginBottom="8px";u.style.marginLeft="4px";u.value="0";d.appendChild(u);mxUtils.br(d);var v=document.createElement("input");v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft="16px";d.appendChild(v);mxUtils.write(d,mxResources.get("pan")+" ");var t=document.createElement("input"); t.setAttribute("type","checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="8px";d.appendChild(t);mxUtils.write(d,mxResources.get("zoom")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";z.setAttribute("title",window.location.href);d.appendChild(z);mxUtils.write(d,mxResources.get("edit")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";d.appendChild(y);mxUtils.write(d, mxResources.get("asNew")+" ");mxUtils.br(d);var C=document.createElement("input");C.setAttribute("type","checkbox");C.setAttribute("checked","checked");C.defaultChecked=!0;C.style.marginLeft="16px";d.appendChild(C);mxUtils.write(d,mxResources.get("resize")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";d.appendChild(x);mxUtils.write(d,mxResources.get("fit")+" ");var B=document.createElement("input");B.setAttribute("type","checkbox");B.style.marginLeft= -"8px";d.appendChild(B);mxUtils.write(d,mxResources.get("embed")+" ");var F=a.getBasenames().join(";"),A=a.getCurrentFile();mxEvent.addListener(v,"change",b);mxEvent.addListener(t,"change",b);mxEvent.addListener(C,"change",b);mxEvent.addListener(x,"change",b);mxEvent.addListener(z,"change",b);mxEvent.addListener(y,"change",b);mxEvent.addListener(B,"change",b);mxEvent.addListener(l,"change",b);mxEvent.addListener(f,"change",b);mxEvent.addListener(u,"change",b);mxEvent.addListener(p,"change",b);b(); +"8px";d.appendChild(B);mxUtils.write(d,mxResources.get("embed")+" ");var E=a.getBasenames().join(";"),A=a.getCurrentFile();mxEvent.addListener(v,"change",b);mxEvent.addListener(t,"change",b);mxEvent.addListener(C,"change",b);mxEvent.addListener(x,"change",b);mxEvent.addListener(z,"change",b);mxEvent.addListener(y,"change",b);mxEvent.addListener(B,"change",b);mxEvent.addListener(l,"change",b);mxEvent.addListener(f,"change",b);mxEvent.addListener(u,"change",b);mxEvent.addListener(p,"change",b);b(); mxEvent.addListener(q,"click",function(){q.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null)});e=document.createElement("div");e.style.paddingTop="12px";e.style.textAlign="right";k=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});k.className="geBtn gePrimaryBtn";e.appendChild(k);d.appendChild(e);this.container=d},CreateGraphDialog=function(a,c,b){var d=document.createElement("div");d.style.textAlign= "right";this.init=function(){var c=document.createElement("div");c.style.position="relative";c.style.border="1px solid gray";c.style.width="100%";c.style.height="360px";c.style.overflow="hidden";c.style.marginBottom="16px";mxEvent.disableContextMenu(c);d.appendChild(c);var e=new Graph(c);e.setCellsCloneable(!0);e.setPanning(!0);e.setAllowDanglingEdges(!1);e.connectionHandler.select=!1;e.view.setTranslate(20,20);e.border=20;e.panningHandler.useLeftButtonForPanning=!0;var k="curved=1;";e.cellRenderer.installCellOverlayListeners= function(a,b,c){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(c.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(c.node,"touchstart",function(c){b.fireEvent(new mxEventObject("pointerdown","event",c,"state",a))})};e.getAllConnectionConstraints=function(){return null};e.connectionHandler.marker.highlight.keepOnTop= @@ -7897,12 +7897,12 @@ f.className="geBtn";d.appendChild(f);null!=a.drive&&"1"==urlParams.photos&&(f=mx f.className="geBtn",d.appendChild(f))}f=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();c(""!=g.value?new mxImage(mxUtils.trim(g.value),m.value,n.value):null)});f.className="geBtn gePrimaryBtn";d.appendChild(f);a.editor.cancelFirst||d.appendChild(q);b.appendChild(d);this.container=b},ParseDialog=function(a,c,b){function d(b,c){var f=b.split("\n");if("plantUmlPng"==c||"plantUmlSvg"==c||"plantUmlTxt"==c){if(a.spinner.spin(document.body,mxResources.get("inserting"))){var l=a.editor.graph, p="plantUmlTxt"==c?"txt":"plantUmlPng"==c?"png":"svg";a.generatePlantUmlImage(b,p,function(c,f,d){a.spinner.stop();var t=null;l.getModel().beginUpdate();try{t="txt"==p?a.insertAsPreText(c,e.x,e.y):l.insertVertex(null,null,null,e.x,e.y,f,d,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(c)+";"),l.setAttributeForCell(t,"plantUmlData",JSON.stringify({data:b,format:p}))}finally{l.getModel().endUpdate()}null!=t&&(l.setSelectionCell(t),l.scrollCellToVisible(t))}, function(b){a.handleError(b)})}}else if("table"==c){for(var d=null,k=[],x=0,g=0;g<f.length;g++){var u=mxUtils.trim(f[g]);if("create table"==u.substring(0,12).toLowerCase())u=mxUtils.trim(u.substring(12)),"("==u.charAt(u.length-1)&&(u=u.substring(0,u.lastIndexOf(" "))),d=new mxCell(u,new mxGeometry(x,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=#e0e0e0;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;swimlaneFillColor=#ffffff;align=center;"), -d.vertex=!0,k.push(d),u=a.editor.graph.getPreferredSizeForCell(E),null!=u&&(d.geometry.width=u.width+10);else if(null!=d&&")"==u.charAt(0))x+=d.geometry.width+40,d=null;else if("("!=u&&null!=d&&(u=u.substring(0,","==u.charAt(u.length-1)?u.length-1:u.length),"primary key"!=u.substring(0,11).toLowerCase())){var A=u.toLowerCase().indexOf("primary key"),u=u.replace(/primary key/i,""),E=new mxCell(u,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;"); -E.vertex=!0;u=sb.cloneCell(E,0<A?"PK":"");u.connectable=!1;u.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";u.geometry.width=30;u.geometry.height=26;E.insert(u);u=a.editor.graph.getPreferredSizeForCell(E);null!=u&&d.geometry.width<u.width+10&&(d.geometry.width=Math.min(220,u.width+10));d.insert(E);d.geometry.height+=26}}0<k.length&&(l=a.editor.graph, -g=l.view,f=l.getGraphBounds(),l.setSelectionCells(l.importCells(k,Math.ceil(Math.max(0,f.x/g.scale-g.translate.x)+4*l.gridSize),Math.ceil(Math.max(0,(f.y+f.height)/g.scale-g.translate.y)+4*l.gridSize))),l.scrollCellToVisible(l.getSelectionCell()))}else if("list"==c){if(0<f.length){l=a.editor.graph;E=null;k=[];for(g=d=0;g<f.length;g++)";"!=f[g].charAt(0)&&(0==f[g].length?E=null:null==E?(E=new mxCell(f[g],new mxGeometry(d,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"), -E.vertex=!0,k.push(E),u=l.getPreferredSizeForCell(E),null!=u&&E.geometry.width<u.width+10&&(E.geometry.width=u.width+10),d+=E.geometry.width+40):"--"==f[g]?(u=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),u.vertex=!0,E.geometry.height+=u.geometry.height,E.insert(u)):0<f[g].length&&(x=new mxCell(f[g],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"), -x.vertex=!0,u=l.getPreferredSizeForCell(x),null!=u&&x.geometry.width<u.width&&(x.geometry.width=u.width),E.geometry.width=Math.max(E.geometry.width,x.geometry.width),E.geometry.height+=x.geometry.height,E.insert(x)));if(0<k.length){l.getModel().beginUpdate();try{k=l.importCells(k,e.x,e.y);u=[];for(g=0;g<k.length;g++)u.push(k[g]),u=u.concat(k[g].children);l.fireEvent(new mxEventObject("cellsInserted","cells",u))}finally{l.getModel().endUpdate()}l.setSelectionCells(k);l.scrollCellToVisible(l.getSelectionCell())}}}else{for(var E= -function(a){var b=n[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,n[a]=b,k.push(b));return b},n={},k=[],g=0;g<f.length;g++)if(";"!=f[g].charAt(0)){var m=f[g].split("->");if(2<=m.length){var A=E(m[0]),q=E(m[m.length-1]),m=new mxCell(2<m.length?m[1]:"",new mxGeometry);m.edge=!0;A.insertEdge(m,!0);q.insertEdge(m,!1);k.push(m)}}if(0<k.length){f=document.createElement("div");f.style.visibility="hidden";document.body.appendChild(f);l=new Graph(f);l.getModel().beginUpdate(); +d.vertex=!0,k.push(d),u=a.editor.graph.getPreferredSizeForCell(F),null!=u&&(d.geometry.width=u.width+10);else if(null!=d&&")"==u.charAt(0))x+=d.geometry.width+40,d=null;else if("("!=u&&null!=d&&(u=u.substring(0,","==u.charAt(u.length-1)?u.length-1:u.length),"primary key"!=u.substring(0,11).toLowerCase())){var A=u.toLowerCase().indexOf("primary key"),u=u.replace(/primary key/i,""),F=new mxCell(u,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;"); +F.vertex=!0;u=sb.cloneCell(F,0<A?"PK":"");u.connectable=!1;u.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";u.geometry.width=30;u.geometry.height=26;F.insert(u);u=a.editor.graph.getPreferredSizeForCell(F);null!=u&&d.geometry.width<u.width+10&&(d.geometry.width=Math.min(220,u.width+10));d.insert(F);d.geometry.height+=26}}0<k.length&&(l=a.editor.graph, +g=l.view,f=l.getGraphBounds(),l.setSelectionCells(l.importCells(k,Math.ceil(Math.max(0,f.x/g.scale-g.translate.x)+4*l.gridSize),Math.ceil(Math.max(0,(f.y+f.height)/g.scale-g.translate.y)+4*l.gridSize))),l.scrollCellToVisible(l.getSelectionCell()))}else if("list"==c){if(0<f.length){l=a.editor.graph;F=null;k=[];for(g=d=0;g<f.length;g++)";"!=f[g].charAt(0)&&(0==f[g].length?F=null:null==F?(F=new mxCell(f[g],new mxGeometry(d,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"), +F.vertex=!0,k.push(F),u=l.getPreferredSizeForCell(F),null!=u&&F.geometry.width<u.width+10&&(F.geometry.width=u.width+10),d+=F.geometry.width+40):"--"==f[g]?(u=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),u.vertex=!0,F.geometry.height+=u.geometry.height,F.insert(u)):0<f[g].length&&(x=new mxCell(f[g],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"), +x.vertex=!0,u=l.getPreferredSizeForCell(x),null!=u&&x.geometry.width<u.width&&(x.geometry.width=u.width),F.geometry.width=Math.max(F.geometry.width,x.geometry.width),F.geometry.height+=x.geometry.height,F.insert(x)));if(0<k.length){l.getModel().beginUpdate();try{k=l.importCells(k,e.x,e.y);u=[];for(g=0;g<k.length;g++)u.push(k[g]),u=u.concat(k[g].children);l.fireEvent(new mxEventObject("cellsInserted","cells",u))}finally{l.getModel().endUpdate()}l.setSelectionCells(k);l.scrollCellToVisible(l.getSelectionCell())}}}else{for(var F= +function(a){var b=n[a];null==b&&(b=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),b.vertex=!0,n[a]=b,k.push(b));return b},n={},k=[],g=0;g<f.length;g++)if(";"!=f[g].charAt(0)){var m=f[g].split("->");if(2<=m.length){var A=F(m[0]),q=F(m[m.length-1]),m=new mxCell(2<m.length?m[1]:"",new mxGeometry);m.edge=!0;A.insertEdge(m,!0);q.insertEdge(m,!1);k.push(m)}}if(0<k.length){f=document.createElement("div");f.style.visibility="hidden";document.body.appendChild(f);l=new Graph(f);l.getModel().beginUpdate(); try{k=l.importCells(k);for(g=0;g<k.length;g++)l.getModel().isVertex(k[g])&&(u=l.getPreferredSizeForCell(k[g]),k[g].geometry.width=Math.max(k[g].geometry.width,u.width),k[g].geometry.height=Math.max(k[g].geometry.height,u.height));d=new mxFastOrganicLayout(l);d.disableEdgeStyle=!1;d.forceConstant=120;d.execute(l.getDefaultParent());x=new mxParallelEdgeLayout(l);x.spacing=20;x.execute(l.getDefaultParent())}finally{l.getModel().endUpdate()}l.clearCellOverlays();u=[];a.editor.graph.getModel().beginUpdate(); try{u=a.editor.graph.importCells(l.getModel().getChildren(l.getDefaultParent()),e.x,e.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",u))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(u);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());l.destroy();f.parentNode.removeChild(f)}}}function g(){return"list"==m.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String": "table"==m.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":"plantUmlPng"==m.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml": @@ -7916,30 +7916,30 @@ else{var c=H.value;null!=c&&0<c.length&&a.pickFolder(a.mode,function(b){a.create f,l,d,p,e,t,k,A,g){var u=document.createElement("div");u.className="geTemplate";u.style.height=X+"px";u.style.width=ea+"px";null!=l&&0<l.length&&u.setAttribute("title",l);if(null!=p)u.style.backgroundImage="url("+p+")",u.style.backgroundSize="contain",u.style.backgroundPosition="center center",u.style.backgroundRepeat="no-repeat",mxEvent.addListener(u,"click",function(a){x(u,null,null,b,e,g)}),mxEvent.addListener(u,"dblclick",function(a){C()});else if(!A&&null!=b&&0<b.length){f=k||TEMPLATE_PATH+"/"+ b.substring(0,b.length-4)+".png";u.style.backgroundImage="url("+f+")";u.style.backgroundPosition="center center";u.style.backgroundRepeat="no-repeat";var B=!1;mxEvent.addListener(u,"click",function(f){G.setAttribute("disabled","disabled");u.style.backgroundColor="transparent";u.style.border="1px solid transparent";f=b;f=/^https?:\/\//.test(f)&&!a.editor.isCorsEnabledForUrl(f)?PROXY_URL+"?url="+encodeURIComponent(f):TEMPLATE_PATH+"/"+f;I.spin(R);mxUtils.get(f,mxUtils.bind(this,function(a){I.stop(); 200<=a.getStatus()&&299>=a.getStatus()&&(x(u,a.getText(),c,null,null,g),B&&C())}))});mxEvent.addListener(u,"dblclick",function(a){B=!0})}else u.innerHTML='<table width="100%" height="100%" style="line-height:1em;word-break: break-all;"><tr><td align="center" valign="middle">'+mxResources.get(f,null,f)+"</td></tr></table>",d&&x(u),null!=t?mxEvent.addListener(u,"click",t):(mxEvent.addListener(u,"click",function(a){x(u,null,null,b,e)}),mxEvent.addListener(u,"dblclick",function(a){C()}));R.appendChild(u)} -function F(){S&&(S=!1,mxEvent.addListener(R,"scroll",function(a){R.scrollTop+R.clientHeight>=R.scrollHeight&&(y(),mxEvent.consume(a))}));var a=null;if(0<da){var b=document.createElement("div");b.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(b,mxResources.get("custom"));Z.appendChild(b);for(var c in M){var f=document.createElement("div"),b=c,l=M[c];18<b.length&&(b=b.substring(0,18)+"…");f.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;"; +function E(){S&&(S=!1,mxEvent.addListener(R,"scroll",function(a){R.scrollTop+R.clientHeight>=R.scrollHeight&&(y(),mxEvent.consume(a))}));var a=null;if(0<da){var b=document.createElement("div");b.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(b,mxResources.get("custom"));Z.appendChild(b);for(var c in M){var f=document.createElement("div"),b=c,l=M[c];18<b.length&&(b=b.substring(0,18)+"…");f.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;"; f.setAttribute("title",b+" ("+l.length+")");mxUtils.write(f,f.getAttribute("title"));null!=q&&(f.style.padding=q);Z.appendChild(f);(function(b,c){mxEvent.addListener(f,"click",function(){a!=c&&(a.style.backgroundColor="",a=c,a.style.backgroundColor=k,R.scrollTop=0,R.innerHTML="",J=0,U=M[b],Q=null,y())})})(c,f)}b=document.createElement("div");b.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(b,"draw.io");Z.appendChild(b)}for(c in P)f=document.createElement("div"), b=mxResources.get(c),l=P[c],null==b&&(b=c.substring(0,1).toUpperCase()+c.substring(1)),18<b.length&&(b=b.substring(0,18)+"…"),f.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;",f.setAttribute("title",b+" ("+l.length+")"),mxUtils.write(f,f.getAttribute("title")),null!=q&&(f.style.padding=q),Z.appendChild(f),null==a&&0<l.length&&(a=f,a.style.backgroundColor=k,U=l),function(b,c){mxEvent.addListener(f,"click", -function(){a!=c&&(a.style.backgroundColor="",a=c,a.style.backgroundColor=k,R.scrollTop=0,R.innerHTML="",J=0,U=P[b],Q=null,y())})}(c,f);y()}b=null!=b?b:!0;g=null!=g?g:!1;k=null!=k?k:"#ebf2f9";m=null!=m?m:"#e6eff8";n=null!=n?n:"1px solid #ccd9ea";f=null!=f?f:EditorUi.templateFile;var A=document.createElement("div");A.style.height="100%";var E=document.createElement("div");E.style.whiteSpace="nowrap";E.style.height="46px";b&&A.appendChild(E);var D=document.createElement("img");D.setAttribute("border", +function(){a!=c&&(a.style.backgroundColor="",a=c,a.style.backgroundColor=k,R.scrollTop=0,R.innerHTML="",J=0,U=P[b],Q=null,y())})}(c,f);y()}b=null!=b?b:!0;g=null!=g?g:!1;k=null!=k?k:"#ebf2f9";m=null!=m?m:"#e6eff8";n=null!=n?n:"1px solid #ccd9ea";f=null!=f?f:EditorUi.templateFile;var A=document.createElement("div");A.style.height="100%";var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.height="46px";b&&A.appendChild(F);var D=document.createElement("img");D.setAttribute("border", "0");D.setAttribute("align","absmiddle");D.style.width="40px";D.style.height="40px";D.style.marginRight="10px";D.style.paddingBottom="4px";D.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER? -IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!c&&b&&E.appendChild(D);b&&mxUtils.write(E,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");D=".drawio";a.mode==App.MODE_GOOGLE&&null!=a.drive?D=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?D=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?D=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?D=a.gitHub.extension: -a.mode==App.MODE_GITLAB&&null!=a.gitLab?D=a.gitLab.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(D=a.trello.extension);var H=document.createElement("input");H.setAttribute("value",a.defaultFilename+D);H.style.marginLeft="10px";H.style.width=c?"220px":"430px";this.init=function(){b&&(H.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?H.select():document.execCommand("selectAll",!1,null))};b&&(E.appendChild(H),null!=a.editor.fileExtensions&&(D=FilenameDialog.createTypeHint(a, -H,a.editor.fileExtensions),D.style.marginTop="12px",E.appendChild(D)));var E=!1,J=0,I=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),G=mxUtils.button(t||mxResources.get("create"),function(){G.setAttribute("disabled","disabled");C();G.removeAttribute("disabled")});G.className="geBtn gePrimaryBtn";if(l||p){var K=[],Q=null,N=null,Y=null,T=function(a){G.setAttribute("disabled","disabled");for(var b=0;b<K.length;b++)K[b].className= -b==a?"geBtn gePrimaryBtn":"geBtn"},E=!0;t=document.createElement("div");t.style.whiteSpace="nowrap";t.style.height="30px";A.appendChild(t);D=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Z.style.display="";R.style.left="160px";T(0);R.scrollTop=0;R.innerHTML="";J=0;Q!=U&&(U=Q,P=N,da=Y,Z.innerHTML="",F(),Q=null)});K.push(D);t.appendChild(D);var L=function(a){Z.style.display="none";R.style.left="30px";T(a?-1:1);null==Q&&(Q=U);R.scrollTop=0;R.innerHTML="";I.spin(R);var b=function(a, -b,c){J=0;I.stop();U=a;c=c||{};var f=0,l;for(l in c)f+=c[l].length;if(b)R.innerHTML=b;else if(0==a.length&&0==f)R.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found"));else if(R.innerHTML="",0<f){Z.style.display="";R.style.left="160px";Z.innerHTML="";da=0;P={"draw.io":a};for(l in c)P[l]=c[l];F()}else y()};a?p(W.value,b):l(b)};l&&(D=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){L()}),t.appendChild(D),K.push(D));if(p){D=document.createElement("span"); +IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!c&&b&&F.appendChild(D);b&&mxUtils.write(F,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):mxResources.get("filename"))+":");D=".drawio";a.mode==App.MODE_GOOGLE&&null!=a.drive?D=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?D=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?D=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?D=a.gitHub.extension: +a.mode==App.MODE_GITLAB&&null!=a.gitLab?D=a.gitLab.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(D=a.trello.extension);var H=document.createElement("input");H.setAttribute("value",a.defaultFilename+D);H.style.marginLeft="10px";H.style.width=c?"220px":"430px";this.init=function(){b&&(H.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?H.select():document.execCommand("selectAll",!1,null))};b&&(F.appendChild(H),null!=a.editor.fileExtensions&&(D=FilenameDialog.createTypeHint(a, +H,a.editor.fileExtensions),D.style.marginTop="12px",F.appendChild(D)));var F=!1,J=0,I=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),G=mxUtils.button(t||mxResources.get("create"),function(){G.setAttribute("disabled","disabled");C();G.removeAttribute("disabled")});G.className="geBtn gePrimaryBtn";if(l||p){var K=[],Q=null,N=null,Y=null,T=function(a){G.setAttribute("disabled","disabled");for(var b=0;b<K.length;b++)K[b].className= +b==a?"geBtn gePrimaryBtn":"geBtn"},F=!0;t=document.createElement("div");t.style.whiteSpace="nowrap";t.style.height="30px";A.appendChild(t);D=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Z.style.display="";R.style.left="160px";T(0);R.scrollTop=0;R.innerHTML="";J=0;Q!=U&&(U=Q,P=N,da=Y,Z.innerHTML="",E(),Q=null)});K.push(D);t.appendChild(D);var L=function(a){Z.style.display="none";R.style.left="30px";T(a?-1:1);null==Q&&(Q=U);R.scrollTop=0;R.innerHTML="";I.spin(R);var b=function(a, +b,c){J=0;I.stop();U=a;c=c||{};var f=0,l;for(l in c)f+=c[l].length;if(b)R.innerHTML=b;else if(0==a.length&&0==f)R.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found"));else if(R.innerHTML="",0<f){Z.style.display="";R.style.left="160px";Z.innerHTML="";da=0;P={"draw.io":a};for(l in c)P[l]=c[l];E()}else y()};a?p(W.value,b):l(b)};l&&(D=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){L()}),t.appendChild(D),K.push(D));if(p){D=document.createElement("span"); D.style.marginLeft="10px";D.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");t.appendChild(D);var W=document.createElement("input");W.style.marginRight="10px";W.style.marginLeft="10px";W.style.width="220px";mxEvent.addListener(W,"keypress",function(a){13==a.keyCode&&L(!0)});t.appendChild(W);D=mxUtils.button(mxResources.get("search"),function(){L(!0)});D.className="geBtn";t.appendChild(D)}T(0)}var aa=null,ga=null,ha=null,ca=null,V=null,ba=null,R=document.createElement("div");R.style.border= -"1px solid #d3d3d3";R.style.position="absolute";R.style.left="160px";R.style.right="34px";E=(b?72:40)+(E?30:0);R.style.top=E+"px";R.style.bottom="68px";R.style.margin="6px 0 0 -1px";R.style.padding="6px";R.style.overflow="auto";var Z=document.createElement("div");Z.style.cssText="position:absolute;left:30px;width:128px;top:"+E+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var X=140,ea=140,P={},M={},da=0,S=!0;P.basic=[{title:"blankDiagram",select:!0}];var U=P.basic;if(!c){var ja= +"1px solid #d3d3d3";R.style.position="absolute";R.style.left="160px";R.style.right="34px";F=(b?72:40)+(F?30:0);R.style.top=F+"px";R.style.bottom="68px";R.style.margin="6px 0 0 -1px";R.style.padding="6px";R.style.overflow="auto";var Z=document.createElement("div");Z.style.cssText="position:absolute;left:30px;width:128px;top:"+F+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var X=140,ea=140,P={},M={},da=0,S=!0;P.basic=[{title:"blankDiagram",select:!0}];var U=P.basic;if(!c){var ja= function(){mxUtils.get(O,function(a){if(!ka){ka=!0;a=a.getXml().documentElement.firstChild;for(var b={};null!=a;){if("undefined"!==typeof a.getAttribute)if("clibs"==a.nodeName){for(var c=a.getAttribute("name"),f=a.getElementsByTagName("add"),l=[],d=0;d<f.length;d++)l.push(encodeURIComponent(mxUtils.getTextContent(f[d])));null!=c&&0<l.length&&(b[c]=l.join(";"))}else c=a.getAttribute("url"),null!=c&&(f=a.getAttribute("section"),null==f&&(f=c.indexOf("/"),f=c.substring(0,f)),c=P[f],null==c&&(c=[],P[f]= -c),f=a.getAttribute("clibs"),null!=b[f]&&(f=b[f]),c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview"),clibs:f}));a=a.nextSibling}I.stop();F()}})};A.appendChild(Z);A.appendChild(R);var ka=!1,O=f;/^https?:\/\//.test(O)&&!a.editor.isCorsEnabledForUrl(O)&&(O=PROXY_URL+"?url="+encodeURIComponent(O));I.spin(R);null!=z?z(function(a,b){M=a;Y=da=b;ja()},ja):ja();N=P}mxEvent.addListener(H,"keypress",function(b){a.dialog.container.firstChild== +c),f=a.getAttribute("clibs"),null!=b[f]&&(f=b[f]),c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview"),clibs:f}));a=a.nextSibling}I.stop();E()}})};A.appendChild(Z);A.appendChild(R);var ka=!1,O=f;/^https?:\/\//.test(O)&&!a.editor.isCorsEnabledForUrl(O)&&(O=PROXY_URL+"?url="+encodeURIComponent(O));I.spin(R);null!=z?z(function(a,b){M=a;Y=da=b;ja()},ja):ja();N=P}mxEvent.addListener(H,"keypress",function(b){a.dialog.container.firstChild== A&&13==b.keyCode&&C()});f=document.createElement("div");f.style.marginTop=c?"4px":"16px";f.style.textAlign="right";f.style.position="absolute";f.style.left="40px";f.style.bottom="24px";f.style.right="40px";c||a.isOffline()||!b||null!=d||g||(z=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),z.className="geBtn",f.appendChild(z));z=mxUtils.button(mxResources.get("cancel"),function(){null!=e&&e();a.hideDialog(!0)});z.className= "geBtn";!a.editor.cancelFirst||g&&null==e||f.appendChild(z);c||"1"==urlParams.embed||g||(c=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var b=new FilenameDialog(a,"",mxResources.get("create"),function(b){null!=b&&0<b.length&&(b=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(H.value)+"&create="+encodeURIComponent(b)),null==a.getCurrentFile()?window.location.href=b:window.openWindow(b))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()}), c.className="geBtn",f.appendChild(c));Graph.fileSupport&&v&&(v=mxUtils.button(mxResources.get("import"),function(){if(null==a.newDlgFileInputElt){var b=document.createElement("input");b.setAttribute("multiple","multiple");b.setAttribute("type","file");mxEvent.addListener(b,"change",function(c){a.openFiles(b.files,!0);b.value=""});b.style.display="none";document.body.appendChild(b);a.newDlgFileInputElt=b}a.newDlgFileInputElt.click()}),v.className="geBtn",f.appendChild(v));f.appendChild(G);a.editor.cancelFirst|| null!=d||g&&null==e||f.appendChild(z);A.appendChild(f);this.container=A},CreateDialog=function(a,c,b,d,g,e,k,m,n,q,f,l,p,u,v,t){function z(b,f,d,p){function e(){mxEvent.addListener(t,"click",function(){var b=d;if(k){var f=x.value,l=f.lastIndexOf(".");if(0>c.lastIndexOf(".")&&0>l){var b=null!=b?b:A.value,p="";b==App.MODE_GOOGLE?p=a.drive.extension:b==App.MODE_GITHUB?p=a.gitHub.extension:b==App.MODE_GITLAB?p=a.gitLab.extension:b==App.MODE_TRELLO?p=a.trello.extension:b==App.MODE_DROPBOX?p=a.dropbox.extension: b==App.MODE_ONEDRIVE?p=a.oneDrive.extension:b==App.MODE_DEVICE&&(p=".drawio");0<=l&&(f=f.substring(0,l));x.value=f+p}}y(d)})}var t=document.createElement("a");t.style.overflow="hidden";var g=document.createElement("img");g.src=b;g.setAttribute("border","0");g.setAttribute("align","absmiddle");g.style.width="60px";g.style.height="60px";g.style.paddingBottom="6px";t.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";t.className="geBaseButton";t.style.position="relative";t.style.margin="4px";t.style.padding= -"8px 8px 10px 8px";t.style.whiteSpace="nowrap";t.appendChild(g);mxClient.IS_QUIRKS&&(t.style.cssFloat="left",t.style.zoom="1");t.style.color="gray";t.style.fontSize="11px";var u=document.createElement("div");t.appendChild(u);mxUtils.write(u,f);if(null!=p&&null==a[p]){g.style.visibility="hidden";mxUtils.setOpacity(u,10);var v=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});v.spin(t);var E=window.setTimeout(function(){null== -a[p]&&(v.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(E),mxUtils.setOpacity(u,100),g.style.visibility="",v.stop(),e())}))}else e();B.appendChild(t);++F==l&&(mxUtils.br(B),F=0)}function y(c){var f=x.value;if(null==c||null!=f&&0<f.length)a.hideDialog(),b(f,c)}k=null!=k?k:!0;m=null!=m?m:!0;l=null!=l?l:4;e=document.createElement("div");e.style.whiteSpace="nowrap";null==d&&a.addLanguageMenu(e);var C=document.createElement("h2"); +"8px 8px 10px 8px";t.style.whiteSpace="nowrap";t.appendChild(g);mxClient.IS_QUIRKS&&(t.style.cssFloat="left",t.style.zoom="1");t.style.color="gray";t.style.fontSize="11px";var u=document.createElement("div");t.appendChild(u);mxUtils.write(u,f);if(null!=p&&null==a[p]){g.style.visibility="hidden";mxUtils.setOpacity(u,10);var v=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});v.spin(t);var F=window.setTimeout(function(){null== +a[p]&&(v.stop(),t.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(F),mxUtils.setOpacity(u,100),g.style.visibility="",v.stop(),e())}))}else e();B.appendChild(t);++E==l&&(mxUtils.br(B),E=0)}function y(c){var f=x.value;if(null==c||null!=f&&0<f.length)a.hideDialog(),b(f,c)}k=null!=k?k:!0;m=null!=m?m:!0;l=null!=l?l:4;e=document.createElement("div");e.style.whiteSpace="nowrap";null==d&&a.addLanguageMenu(e);var C=document.createElement("h2"); mxUtils.write(C,g||mxResources.get("create"));C.style.marginTop="0px";C.style.marginBottom="24px";e.appendChild(C);mxUtils.write(e,mxResources.get("filename")+":");var x=document.createElement("input");x.setAttribute("value",c);x.style.width="280px";x.style.marginLeft="10px";x.style.marginBottom="20px";x.style.maxWidth="70%";this.init=function(){x.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?x.select():document.execCommand("selectAll",!1,null)};e.appendChild(x); null!=t&&e.appendChild(FilenameDialog.createTypeHint(a,x,t));null!=p&&null!=u&&"image/"==u.substring(0,6)&&(x.style.width="160px",g=null,"image/svg+xml"==u&&mxClient.IS_SVG?(g=document.createElement("div"),g.innerHTML=mxUtils.trim(p),p=g.getElementsByTagName("svg")[0],u=parseInt(p.getAttribute("width")),v=parseInt(p.getAttribute("height")),p.setAttribute("viewBox","0 0 "+u+" "+v),p.setAttribute("width","120px"),p.setAttribute("height","80px")):(g=document.createElement("img"),g.setAttribute("src", -"data:"+u+(v?";base64,":";utf8,")+p)),g.style.position="absolute",g.style.top="70px",g.style.right="100px",g.style.maxWidth="120px",g.style.maxHeight="80px",mxUtils.setPrefixedStyle(g.style,"transform","translate(50%,-50%)"),e.appendChild(g),n&&Editor.popupsAllowed&&(g.style.cursor="pointer",mxEvent.addListener(g,"click",function(){y("_blank")})));mxUtils.br(e);var B=document.createElement("div");B.style.textAlign="center";var F=0;B.style.marginTop="6px";e.appendChild(B);var A=document.createElement("select"); +"data:"+u+(v?";base64,":";utf8,")+p)),g.style.position="absolute",g.style.top="70px",g.style.right="100px",g.style.maxWidth="120px",g.style.maxHeight="80px",mxUtils.setPrefixedStyle(g.style,"transform","translate(50%,-50%)"),e.appendChild(g),n&&Editor.popupsAllowed&&(g.style.cursor="pointer",mxEvent.addListener(g,"click",function(){y("_blank")})));mxUtils.br(e);var B=document.createElement("div");B.style.textAlign="center";var E=0;B.style.marginTop="6px";e.appendChild(B);var A=document.createElement("select"); A.style.marginLeft="10px";a.isOfflineApp()||a.isOffline()||("function"===typeof window.DriveClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(p,mxResources.get("googleDrive")),A.appendChild(p),z(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(p,mxResources.get("oneDrive")), A.appendChild(p),a.mode==App.MODE_ONEDRIVE&&p.setAttribute("selected","selected"),z(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(p,mxResources.get("dropbox")),A.appendChild(p),a.mode==App.MODE_DROPBOX&&p.setAttribute("selected","selected"),z(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")), null!=a.gitHub&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_GITHUB),mxUtils.write(p,mxResources.get("github")),A.appendChild(p),z(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.gitLab&&(p=document.createElement("option"),p.setAttribute("value",App.MODE_GITLAB),mxUtils.write(p,mxResources.get("gitlab")),A.appendChild(p),z(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&& @@ -7987,22 +7987,22 @@ var RevisionDialog=function(a,c,b){var d=document.createElement("div"),g=documen "376px";k.style.overflow="hidden";mxEvent.disableContextMenu(k);d.appendChild(k);var m=new Graph(k);m.setTooltips(!1);m.setEnabled(!1);m.setPanning(!0);m.panningHandler.ignoreCell=!0;m.panningHandler.useLeftButtonForPanning=!0;m.minFitScale=null;m.maxFitScale=null;m.centerZoom=!0;var n=0,q=null,f=0,l=m.getGlobalVariable;m.getGlobalVariable=function(a){return"page"==a&&null!=q&&null!=q[f]?q[f].getAttribute("name"):"pagenumber"==a?f+1:"pagecount"==a?null!=q?q.length:1:l.apply(this,arguments)};m.getLinkForCell= function(){return null};Editor.MathJaxRender&&m.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(m.container)}));var p=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),u=a.getCurrentFile(),v=null,t=null,z=null,y=null,C=mxUtils.button("",function(){null!=z&&m.zoomIn()});C.className="geSprite geSprite-zoomin"; C.setAttribute("title",mxResources.get("zoomIn"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled","disabled");mxUtils.setOpacity(C,20);var x=mxUtils.button("",function(){null!=z&&m.zoomOut()});x.className="geSprite geSprite-zoomout";x.setAttribute("title",mxResources.get("zoomOut"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var B=mxUtils.button("",function(){null!=z&& -(m.maxFitScale=8,m.fit(8),m.center())});B.className="geSprite geSprite-fit";B.setAttribute("title",mxResources.get("fit"));B.style.outline="none";B.style.border="none";B.style.margin="2px";B.setAttribute("disabled","disabled");mxUtils.setOpacity(B,20);var F=mxUtils.button("",function(){null!=z&&(m.zoomActual(),m.center())});F.className="geSprite geSprite-actualsize";F.setAttribute("title",mxResources.get("actualSize"));F.style.outline="none";F.style.border="none";F.style.margin="2px";F.setAttribute("disabled", -"disabled");mxUtils.setOpacity(F,20);var A=document.createElement("div");A.style.position="absolute";A.style.textAlign="right";A.style.color="gray";A.style.marginTop="10px";A.style.backgroundColor="transparent";A.style.top="440px";A.style.right="32px";A.style.maxWidth="380px";A.style.cursor="default";var E=mxUtils.button(mxResources.get("download"),function(){if(null!=z){var b=mxUtils.getXml(z.documentElement),c=a.getBaseFilename()+".drawio";a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml"):(b= -"undefined"===typeof pako?"&xml="+encodeURIComponent(b):"&data="+encodeURIComponent(Graph.compress(b)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml"+b)).simulate(document,"_blank"))}});E.className="geBtn";E.setAttribute("disabled","disabled");var D=mxUtils.button(mxResources.get("restore"),function(){null!=z&&null!=y&&a.confirm(mxResources.get("areYouSure"),function(){null!=b?b(y):a.spinner.spin(document.body,mxResources.get("restoring"))&&u.save(!0,function(b){a.spinner.stop(); +(m.maxFitScale=8,m.fit(8),m.center())});B.className="geSprite geSprite-fit";B.setAttribute("title",mxResources.get("fit"));B.style.outline="none";B.style.border="none";B.style.margin="2px";B.setAttribute("disabled","disabled");mxUtils.setOpacity(B,20);var E=mxUtils.button("",function(){null!=z&&(m.zoomActual(),m.center())});E.className="geSprite geSprite-actualsize";E.setAttribute("title",mxResources.get("actualSize"));E.style.outline="none";E.style.border="none";E.style.margin="2px";E.setAttribute("disabled", +"disabled");mxUtils.setOpacity(E,20);var A=document.createElement("div");A.style.position="absolute";A.style.textAlign="right";A.style.color="gray";A.style.marginTop="10px";A.style.backgroundColor="transparent";A.style.top="440px";A.style.right="32px";A.style.maxWidth="380px";A.style.cursor="default";var F=mxUtils.button(mxResources.get("download"),function(){if(null!=z){var b=mxUtils.getXml(z.documentElement),c=a.getBaseFilename()+".drawio";a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml"):(b= +"undefined"===typeof pako?"&xml="+encodeURIComponent(b):"&data="+encodeURIComponent(Graph.compress(b)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml"+b)).simulate(document,"_blank"))}});F.className="geBtn";F.setAttribute("disabled","disabled");var D=mxUtils.button(mxResources.get("restore"),function(){null!=z&&null!=y&&a.confirm(mxResources.get("areYouSure"),function(){null!=b?b(y):a.spinner.spin(document.body,mxResources.get("restoring"))&&u.save(!0,function(b){a.spinner.stop(); a.replaceFileData(y);a.hideDialog()},function(b){a.spinner.stop();a.editor.setStatus("");a.handleError(b,null!=b?mxResources.get("errorSavingFile"):null)})})});D.className="geBtn";D.setAttribute("disabled","disabled");var H=document.createElement("select");H.setAttribute("disabled","disabled");H.style.maxWidth="80px";H.style.position="relative";H.style.top="-2px";H.style.verticalAlign="bottom";H.style.marginRight="6px";H.style.display="none";var J=null;mxEvent.addListener(H,"change",function(a){null!= J&&(J(a),mxEvent.consume(a))});var I=mxUtils.button(mxResources.get("edit"),function(){null!=z&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(z.documentElement)),a.openLink(a.getUrl(),null,!0))});I.className="geBtn";I.setAttribute("disabled","disabled");null!=b&&(I.style.display="none");var G=mxUtils.button(mxResources.get("show"),function(){null!=t&&a.openLink(t.getUrl(H.selectedIndex))});G.className="geBtn gePrimaryBtn";G.setAttribute("disabled", "disabled");null!=b&&(G.style.display="none",D.className="geBtn gePrimaryBtn");g=document.createElement("div");g.style.position="absolute";g.style.top="482px";g.style.width="640px";g.style.textAlign="right";var K=document.createElement("div");K.className="geToolbarContainer";K.style.backgroundColor="transparent";K.style.padding="2px";K.style.border="none";K.style.left="199px";K.style.top="442px";var Q=null;if(null!=c&&0<c.length){k.style.cursor="move";var N=document.createElement("table");N.style.border= "1px solid lightGray";N.style.borderCollapse="collapse";N.style.borderSpacing="0px";N.style.width="100%";var Y=document.createElement("tbody"),T=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(n=mxUtils.indexOf(a.pages,a.currentPage));for(var L=c.length-1;0<=L;L--){var W=function(b){var l=new Date(b.modifiedDate),d=null;if(0<=l.getTime()){var e=function(c){p.stop();var e=mxUtils.parseXml(c),t=a.editor.extractGraphModel(e.documentElement,!0);if(null!=t){var g=function(a){null!=a&&(a= v(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(a))).documentElement));return a},v=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";k.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,m.getModel());m.maxFitScale=1;m.fit(8);m.center();return a};H.style.display="none";H.innerHTML="";z=e;y=c;q=parseSelectFunction=null;f=0;if("mxfile"==t.nodeName){e=t.getElementsByTagName("diagram");q=[];for(c=0;c<e.length;c++)q.push(e[c]);f=Math.min(n, q.length-1);0<q.length&&g(q[f]);if(1<q.length)for(H.removeAttribute("disabled"),H.style.display="",c=0;c<q.length;c++)e=document.createElement("option"),mxUtils.write(e,q[c].getAttribute("name")||mxResources.get("pageWithNumber",[c+1])),e.setAttribute("value",c),c==f&&e.setAttribute("selected","selected"),H.appendChild(e);J=function(){try{var b=parseInt(H.value);f=n=b;g(q[b])}catch(M){H.value=n,a.handleError(M)}}}else v(t);c=b.lastModifyingUserName;null!=c&&20<c.length&&(c=c.substring(0,20)+"..."); -A.innerHTML="";mxUtils.write(A,(null!=c?c+" ":"")+l.toLocaleDateString()+" "+l.toLocaleTimeString());A.setAttribute("title",d.getAttribute("title"));C.removeAttribute("disabled");x.removeAttribute("disabled");B.removeAttribute("disabled");F.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&D.removeAttribute("disabled"),E.removeAttribute("disabled"),G.removeAttribute("disabled"),I.removeAttribute("disabled"));mxUtils.setOpacity(C,60);mxUtils.setOpacity(x,60);mxUtils.setOpacity(B, -60);mxUtils.setOpacity(F,60)}else H.style.display="none",H.innerHTML="",A.innerHTML="",mxUtils.write(A,mxResources.get("errorLoadingFile"))},d=document.createElement("tr");d.style.borderBottom="1px solid lightGray";d.style.fontSize="12px";d.style.cursor="pointer";var g=document.createElement("td");g.style.padding="6px";g.style.whiteSpace="nowrap";b==c[c.length-1]?mxUtils.write(g,mxResources.get("current")):l.toDateString()===T?mxUtils.write(g,l.toLocaleTimeString()):mxUtils.write(g,l.toLocaleDateString()+ +A.innerHTML="";mxUtils.write(A,(null!=c?c+" ":"")+l.toLocaleDateString()+" "+l.toLocaleTimeString());A.setAttribute("title",d.getAttribute("title"));C.removeAttribute("disabled");x.removeAttribute("disabled");B.removeAttribute("disabled");E.removeAttribute("disabled");null!=u&&u.isRestricted()||(a.editor.graph.isEnabled()&&D.removeAttribute("disabled"),F.removeAttribute("disabled"),G.removeAttribute("disabled"),I.removeAttribute("disabled"));mxUtils.setOpacity(C,60);mxUtils.setOpacity(x,60);mxUtils.setOpacity(B, +60);mxUtils.setOpacity(E,60)}else H.style.display="none",H.innerHTML="",A.innerHTML="",mxUtils.write(A,mxResources.get("errorLoadingFile"))},d=document.createElement("tr");d.style.borderBottom="1px solid lightGray";d.style.fontSize="12px";d.style.cursor="pointer";var g=document.createElement("td");g.style.padding="6px";g.style.whiteSpace="nowrap";b==c[c.length-1]?mxUtils.write(g,mxResources.get("current")):l.toDateString()===T?mxUtils.write(g,l.toLocaleTimeString()):mxUtils.write(g,l.toLocaleDateString()+ " "+l.toLocaleTimeString());d.appendChild(g);d.setAttribute("title",l.toLocaleDateString()+" "+l.toLocaleTimeString()+(null!=b.fileSize?" "+a.formatFileSize(parseInt(b.fileSize)):"")+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(d,"click",function(a){t!=b&&(p.stop(),null!=v&&(v.style.backgroundColor=""),t=b,v=d,v.style.backgroundColor="#ebf2f9",y=z=null,A.removeAttribute("title"),A.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+"..."),k.style.backgroundColor= -"#ffffff",m.getModel().clear(),D.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),x.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),mxUtils.setOpacity(C,20),mxUtils.setOpacity(x,20),mxUtils.setOpacity(B,20),mxUtils.setOpacity(F,20),p.spin(k),b.getXml(function(a){if(t== +"#ffffff",m.getModel().clear(),D.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),x.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),I.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),mxUtils.setOpacity(C,20),mxUtils.setOpacity(x,20),mxUtils.setOpacity(B,20),mxUtils.setOpacity(E,20),p.spin(k),b.getXml(function(a){if(t== b)try{e(a)}catch(Z){A.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+": "+Z.message)}},function(a){p.stop();H.style.display="none";H.innerHTML="";A.innerHTML="";mxUtils.write(A,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(d,"dblclick",function(a){G.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);Y.appendChild(d)}return d}(c[L]);null!=W&&L==c.length-1&&(Q=W)}N.appendChild(Y); e.appendChild(N)}else null==u||null==a.drive&&u.constructor==window.DriveFile||null==a.dropbox&&u.constructor==window.DropboxFile?(k.style.display="none",K.style.display="none",mxUtils.write(e,mxResources.get("notAvailable"))):(k.style.display="none",K.style.display="none",mxUtils.write(e,mxResources.get("noRevisions")));this.init=function(){null!=Q&&Q.click()};e=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});e.className="geBtn";K.appendChild(H);K.appendChild(C);K.appendChild(x); -K.appendChild(F);K.appendChild(B);a.editor.cancelFirst?(g.appendChild(e),g.appendChild(E),g.appendChild(I),g.appendChild(D),g.appendChild(G)):(g.appendChild(E),g.appendChild(I),g.appendChild(D),g.appendChild(G),g.appendChild(e));d.appendChild(g);d.appendChild(K);d.appendChild(A);this.container=d},DraftDialog=function(a,c,b,d,g,e,k,m){var n=document.createElement("div"),q=document.createElement("div");q.style.marginTop="0px";q.style.whiteSpace="nowrap";q.style.overflow="auto";mxUtils.write(q,c);n.appendChild(q); +K.appendChild(E);K.appendChild(B);a.editor.cancelFirst?(g.appendChild(e),g.appendChild(F),g.appendChild(I),g.appendChild(D),g.appendChild(G)):(g.appendChild(F),g.appendChild(I),g.appendChild(D),g.appendChild(G),g.appendChild(e));d.appendChild(g);d.appendChild(K);d.appendChild(A);this.container=d},DraftDialog=function(a,c,b,d,g,e,k,m){var n=document.createElement("div"),q=document.createElement("div");q.style.marginTop="0px";q.style.whiteSpace="nowrap";q.style.overflow="auto";mxUtils.write(q,c);n.appendChild(q); var f=document.createElement("div");f.style.position="absolute";f.style.border="1px solid lightGray";f.style.marginTop="10px";f.style.width="640px";f.style.top="46px";f.style.bottom="74px";f.style.overflow="hidden";mxEvent.disableContextMenu(f);n.appendChild(f);var l=new Graph(f);l.setEnabled(!1);l.setPanning(!0);l.panningHandler.ignoreCell=!0;l.panningHandler.useLeftButtonForPanning=!0;l.minFitScale=null;l.maxFitScale=null;l.centerZoom=!0;c=mxUtils.parseXml(b);var p=a.editor.extractGraphModel(c.documentElement, !0),u=0,v=null,t=l.getGlobalVariable;l.getGlobalVariable=function(a){return"page"==a&&null!=v&&null!=v[u]?v[u].getAttribute("name"):"pagenumber"==a?u+1:"pagecount"==a?null!=v?v.length:1:t.apply(this,arguments)};l.getLinkForCell=function(){return null};c=mxUtils.button("",function(){l.zoomIn()});c.className="geSprite geSprite-zoomin";c.setAttribute("title",mxResources.get("zoomIn"));c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);b=mxUtils.button("",function(){l.zoomOut()}); b.className="geSprite geSprite-zoomout";b.setAttribute("title",mxResources.get("zoomOut"));b.style.outline="none";b.style.border="none";b.style.margin="2px";mxUtils.setOpacity(b,60);q=mxUtils.button("",function(){l.maxFitScale=8;l.fit(8);l.center()});q.className="geSprite geSprite-fit";q.setAttribute("title",mxResources.get("fit"));q.style.outline="none";q.style.border="none";q.style.margin="2px";mxUtils.setOpacity(q,60);var z=mxUtils.button("",function(){l.zoomActual();l.center()});z.className="geSprite geSprite-actualsize"; @@ -8064,25 +8064,25 @@ m=document.createElement("tr");n=document.createElement("td");q=document.createE "geBtn";var C=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();b.getModel().beginUpdate();try{for(var d=0;d<c.length;d++){var e=b.getCellGeometry(c[d]);null!=e&&(e=e.clone(),b.isCellMovable(c[d])&&(e.relative=f.checked,0<mxUtils.trim(l.value).length&&(e.x=Number(l.value)),0<mxUtils.trim(p.value).length&&(e.y=Number(p.value)),0<mxUtils.trim(u.value).length&&(null==e.offset&&(e.offset=new mxPoint),e.offset.x=Number(u.value)),0<mxUtils.trim(v.value).length&&(null==e.offset&&(e.offset= new mxPoint),e.offset.y=Number(v.value))),b.isCellResizable(c[d])&&(0<mxUtils.trim(t.value).length&&(e.width=Number(t.value)),0<mxUtils.trim(z.value).length&&(e.height=Number(z.value))),b.getModel().setGeometry(c[d],e));0<mxUtils.trim(y.value).length&&b.setCellStyles(mxConstants.STYLE_ROTATION,Number(y.value),[c[d]])}}finally{b.getModel().endUpdate()}});C.className="geBtn gePrimaryBtn";mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&C.click()});e=document.createElement("div");e.style.marginTop= "20px";e.style.textAlign="right";a.editor.cancelFirst?(e.appendChild(d),e.appendChild(C)):(e.appendChild(C),e.appendChild(d));g.appendChild(e);this.container=g},LibraryDialog=function(a,c,b,d,g,e){function k(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=u;)a=a.parentNode;var b=null;if(null!=a)for(var c=u.firstChild,b=0;null!=c&&c!=a;)c=c.nextSibling,b++;return b}function m(b,c,l,d,p,e,g,A,n){try{if(a.spinner.stop(),null==c||"image/"==c.substring(0,6))if(null==b&&null!= -g||null==t[b]){var E=function(){I.innerHTML="";I.style.cursor="pointer";I.style.whiteSpace="nowrap";I.style.textOverflow="ellipsis";mxUtils.write(I,null!=N.title&&0<N.title.length?N.title:mxResources.get("untitled"));I.style.color=null==N.title||0==N.title.length?"#d0d0d0":""};u.style.backgroundImage="";v.style.display="none";var y=p,q=e;if(p>a.maxImageSize||e>a.maxImageSize){var F=Math.min(1,Math.min(a.maxImageSize/Math.max(1,p)),a.maxImageSize/Math.max(1,e));p*=F;e*=F}y>q?(q=Math.round(100*q/y), +g||null==t[b]){var F=function(){I.innerHTML="";I.style.cursor="pointer";I.style.whiteSpace="nowrap";I.style.textOverflow="ellipsis";mxUtils.write(I,null!=N.title&&0<N.title.length?N.title:mxResources.get("untitled"));I.style.color=null==N.title||0==N.title.length?"#d0d0d0":""};u.style.backgroundImage="";v.style.display="none";var y=p,q=e;if(p>a.maxImageSize||e>a.maxImageSize){var E=Math.min(1,Math.min(a.maxImageSize/Math.max(1,p)),a.maxImageSize/Math.max(1,e));p*=E;e*=E}y>q?(q=Math.round(100*q/y), y=100):(y=Math.round(100*y/q),q=100);var D=document.createElement("div");D.setAttribute("draggable","true");D.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";D.style.position="relative";D.style.cursor="move";mxUtils.setPrefixedStyle(D.style,"transition","transform .1s ease-in-out");if(null!=b){var G=document.createElement("img");G.setAttribute("src",x.convert(b));G.style.width=y+"px";G.style.height=q+"px";G.style.margin="10px";G.style.paddingBottom=Math.floor((100-q)/2)+"px";G.style.paddingLeft= Math.floor((100-y)/2)+"px";D.appendChild(G)}else if(null!=g){var J=a.stringToCells(Graph.decompress(g.xml));0<J.length&&(a.sidebar.createThumb(J,100,100,D,null,!0,!1),D.firstChild.style.display=mxClient.IS_QUIRKS?"inline":"inline-block",D.firstChild.style.cursor="")}var H=document.createElement("img");H.setAttribute("src",Editor.closeImage);H.setAttribute("border","0");H.setAttribute("title",mxResources.get("delete"));H.setAttribute("align","top");H.style.paddingTop="4px";H.style.position="absolute"; H.style.marginLeft="-12px";H.style.zIndex="1";H.style.cursor="pointer";mxEvent.addListener(H,"dragstart",function(a){mxEvent.consume(a)});(function(a,b,c){mxEvent.addListener(H,"click",function(l){t[b]=null;for(var d=0;d<f.length;d++)if(null!=f[d].data&&f[d].data==b||null!=f[d].xml&&null!=c&&f[d].xml==c.xml){f.splice(d,1);break}D.parentNode.removeChild(a);0==f.length&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",v.style.display="");mxEvent.consume(l)});mxEvent.addListener(H,"dblclick", function(a){mxEvent.consume(a)})})(D,b,g);D.appendChild(H);D.style.marginBottom="30px";var I=document.createElement("div");I.style.position="absolute";I.style.boxSizing="border-box";I.style.bottom="-18px";I.style.left="10px";I.style.right="10px";I.style.backgroundColor="#ffffff";I.style.overflow="hidden";I.style.textAlign="center";var N=null;null!=b?(N={data:b,w:p,h:e,title:n},null!=A&&(N.aspect=A),t[b]=G,f.push(N)):null!=g&&(g.aspect="fixed",f.push(g),N=g);mxEvent.addListener(I,"keydown",function(a){13== -a.keyCode&&null!=C&&(C(),C=null,mxEvent.consume(a))});E();D.appendChild(I);mxEvent.addListener(I,"mousedown",function(a){"true"!=I.getAttribute("contentEditable")&&mxEvent.consume(a)});J=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,N.title||"",mxResources.get("ok"),function(a){null!=a&&(N.title=a,E())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!= -I.getAttribute("contentEditable")){null!=C&&(C(),C=null);if(null==N.title||0==N.title.length)I.innerHTML="";I.style.textOverflow="";I.style.whiteSpace="";I.style.cursor="text";I.style.color="";I.setAttribute("contentEditable","true");I.focus();document.execCommand("selectAll",!1,null);C=function(){I.removeAttribute("contentEditable");I.style.cursor="pointer";N.title=I.innerHTML;E()};mxEvent.consume(b)}};mxEvent.addListener(I,"click",J);mxEvent.addListener(D,"dblclick",J);u.appendChild(D);mxEvent.addListener(D, +a.keyCode&&null!=C&&(C(),C=null,mxEvent.consume(a))});F();D.appendChild(I);mxEvent.addListener(I,"mousedown",function(a){"true"!=I.getAttribute("contentEditable")&&mxEvent.consume(a)});J=function(b){if(mxClient.IS_IOS||mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var c=new FilenameDialog(a,N.title||"",mxResources.get("ok"),function(a){null!=a&&(N.title=a,F())},mxResources.get("enterValue"));a.showDialog(c.container,300,80,!0,!0);c.init();mxEvent.consume(b)}else if("true"!= +I.getAttribute("contentEditable")){null!=C&&(C(),C=null);if(null==N.title||0==N.title.length)I.innerHTML="";I.style.textOverflow="";I.style.whiteSpace="";I.style.cursor="text";I.style.color="";I.setAttribute("contentEditable","true");I.focus();document.execCommand("selectAll",!1,null);C=function(){I.removeAttribute("contentEditable");I.style.cursor="pointer";N.title=I.innerHTML;F()};mxEvent.consume(b)}};mxEvent.addListener(I,"click",J);mxEvent.addListener(D,"dblclick",J);u.appendChild(D);mxEvent.addListener(D, "dragstart",function(a){null==b&&null!=g&&(H.style.visibility="hidden",I.style.visibility="hidden");mxClient.IS_FF&&null!=g.xml&&a.dataTransfer.setData("Text",g.xml);z=k(a);mxClient.IS_GC&&(D.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(D.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(D,30);H.style.visibility="";I.style.visibility=""},0)});mxEvent.addListener(D,"dragend",function(a){"hidden"==H.style.visibility&&(H.style.visibility="",I.style.visibility="");z= null;mxUtils.setOpacity(D,100);mxUtils.setPrefixedStyle(D.style,"transform",null)})}else B||(B=!0,a.handleError({message:mxResources.get("fileExists")}));else{p=!1;try{if(y=mxUtils.parseXml(b),"mxlibrary"==y.documentElement.nodeName){q=JSON.parse(mxUtils.getTextContent(y.documentElement));if(null!=q&&0<q.length)for(var K=0;K<q.length;K++)null!=q[K].xml?m(null,null,0,0,0,0,q[K]):m(q[K].data,null,0,0,q[K].w,q[K].h,null,"fixed",q[K].title);p=!0}else if("mxfile"==y.documentElement.nodeName){for(var Q= y.documentElement.getElementsByTagName("diagram"),K=0;K<Q.length;K++){var q=mxUtils.getTextContent(Q[K]),J=a.stringToCells(Graph.decompress(q)),X=a.editor.graph.getBoundingBoxFromGeometry(J);m(null,null,0,0,0,0,{xml:q,w:X.width,h:X.height})}p=!0}}catch(ea){}p||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ea){}return null}function n(a){a.dataTransfer.dropEffect=null!=z?"move":"copy";a.stopPropagation();a.preventDefault()}function q(b){b.stopPropagation();b.preventDefault(); -B=!1;y=k(b);if(null!=z)null!=y&&y<u.children.length?(f.splice(y>z?y-1:y,0,f.splice(z,1)[0]),u.insertBefore(u.children[z],u.children[y])):(f.push(f.splice(z,1)[0]),u.appendChild(u.children[z]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,F(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)|| +B=!1;y=k(b);if(null!=z)null!=y&&y<u.children.length?(f.splice(y>z?y-1:y,0,f.splice(z,1)[0]),u.insertBefore(u.children[z],u.children[y])):(f.push(f.splice(z,1)[0]),u.appendChild(u.children[z]));else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,E(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)|| /(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){m(c,null,0,0,a.width,a.height);u.scrollTop=u.scrollHeight})}b.stopPropagation();b.preventDefault()}var f=[];b=document.createElement("div");b.style.height="100%";var l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.height="40px";b.appendChild(l);mxUtils.write(l,mxResources.get("filename")+":");null==c&&(c=a.defaultLibraryName+".xml");var p=document.createElement("input");p.setAttribute("value",c);p.style.marginRight="20px";p.style.marginLeft= "10px";p.style.width="500px";null==g||g.isRenamable()||p.setAttribute("disabled","true");this.init=function(){if(null==g||g.isRenamable())p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)};l.appendChild(p);var u=document.createElement("div");u.style.borderWidth="1px 0px 1px 0px";u.style.borderColor="#d3d3d3";u.style.borderStyle="solid";u.style.marginTop="6px";u.style.overflow="auto";u.style.height="340px";u.style.backgroundPosition= "center center";u.style.backgroundRepeat="no-repeat";0==f.length&&Graph.fileSupport&&(u.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var v=document.createElement("div");v.style.position="absolute";v.style.width="640px";v.style.top="260px";v.style.textAlign="center";v.style.fontSize="22px";v.style.color="#a0c3ff";mxUtils.write(v,mxResources.get("dragImagesHere"));b.appendChild(v);var t={},z=null,y=null,C=null;c=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&& -null!=C&&(C(),C=null,mxEvent.consume(a))};mxEvent.addListener(u,"mousedown",c);mxEvent.addListener(u,"pointerdown",c);mxEvent.addListener(u,"touchstart",c);var x=new mxUrlConverter,B=!1;if(null!=d)for(c=0;c<d.length;c++)l=d[c],m(l.data,null,0,0,l.w,l.h,l,l.aspect,l.title);mxEvent.addListener(u,"dragleave",function(a){v.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==u||b==v){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var F=function(b){return function(c,f,l,d,p,e, +null!=C&&(C(),C=null,mxEvent.consume(a))};mxEvent.addListener(u,"mousedown",c);mxEvent.addListener(u,"pointerdown",c);mxEvent.addListener(u,"touchstart",c);var x=new mxUrlConverter,B=!1;if(null!=d)for(c=0;c<d.length;c++)l=d[c],m(l.data,null,0,0,l.w,l.h,l,l.aspect,l.title);mxEvent.addListener(u,"dragleave",function(a){v.style.cursor="";for(var b=mxEvent.getSource(a);null!=b;){if(b==u||b==v){a.stopPropagation();a.preventDefault();break}b=b.parentNode}});var E=function(b){return function(c,f,l,d,p,e, k,g,t){null!=t&&(/(\.vsdx)($|\?)/i.test(t.name)||/(\.vssx)($|\?)/i.test(t.name))?a.importVisio(t,mxUtils.bind(this,function(a){m(a,f,l,d,p,e,k,"fixed",mxEvent.isAltDown(b)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g," "))})):null!=t&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,t.name)?a.parseFile(t,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=c.status&&(m(c.responseText,f,l,d,p,e,k,"fixed",mxEvent.isAltDown(b)?null:k.substring(0, k.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight))})):(m(c,f,l,d,p,e,k,"fixed",mxEvent.isAltDown(b)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g," ")),u.scrollTop=u.scrollHeight)}};mxEvent.addListener(u,"dragover",n);mxEvent.addListener(u,"drop",q);mxEvent.addListener(v,"dragover",n);mxEvent.addListener(v,"drop",q);b.appendChild(u);d=document.createElement("div");d.style.textAlign="right";d.style.marginTop="20px";c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)}); c.setAttribute("id","btnCancel");c.className="geBtn";a.editor.cancelFirst&&d.appendChild(c);l=mxUtils.button(mxResources.get("export"),function(){var b=a.createLibraryDataFromImages(f),c=p.value;/(\.xml)$/i.test(c)||(c+=".xml");a.isLocalFileSave()?a.saveLocalFile(b,c,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(c)+"&format=xml&xml="+encodeURIComponent(b))).simulate(document,"_blank")});l.setAttribute("id","btnDownload");l.className="geBtn";d.appendChild(l);if(Graph.fileSupport){if(null== -a.libDlgFileInputElt){var A=document.createElement("input");A.setAttribute("multiple","multiple");A.setAttribute("type","file");mxEvent.addListener(A,"change",function(b){B=!1;a.importFiles(A.files,0,0,a.maxImageSize,function(a,c,f,l,d,p,e,k,t){null!=A.files&&(F(b)(a,c,f,l,d,p,e,k,t),A.type="",A.type="file",A.value="")});u.scrollTop=u.scrollHeight});A.style.display="none";document.body.appendChild(A);a.libDlgFileInputElt=A}l=mxUtils.button(mxResources.get("import"),function(){null!=C&&(C(),C=null); +a.libDlgFileInputElt){var A=document.createElement("input");A.setAttribute("multiple","multiple");A.setAttribute("type","file");mxEvent.addListener(A,"change",function(b){B=!1;a.importFiles(A.files,0,0,a.maxImageSize,function(a,c,f,l,d,p,e,k,t){null!=A.files&&(E(b)(a,c,f,l,d,p,e,k,t),A.type="",A.type="file",A.value="")});u.scrollTop=u.scrollHeight});A.style.display="none";document.body.appendChild(A);a.libDlgFileInputElt=A}l=mxUtils.button(mxResources.get("import"),function(){null!=C&&(C(),C=null); a.libDlgFileInputElt.click()});l.setAttribute("id","btnAddImage");l.className="geBtn";d.appendChild(l)}l=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=C&&(C(),C=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){B=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var f=a.indexOf(",");0<f&&(a=a.substring(0,f)+";base64,"+a.substring(f+1))}m(a,null,0,0,b,c);u.scrollTop=u.scrollHeight}})});l.setAttribute("id","btnAddImageUrl");l.className="geBtn";d.appendChild(l); this.saveBtnClickHandler=function(b,c,f,l){a.saveLibrary(b,c,f,l)};l=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=C&&(C(),C=null);this.saveBtnClickHandler(p.value,f,g,e)}));l.setAttribute("id","btnSave");l.className="geBtn gePrimaryBtn";d.appendChild(l);a.editor.cancelFirst||d.appendChild(c);b.appendChild(d);this.container=b},EditShapeDialog=function(a,c,b,d,g){d=null!=d?d:300;g=null!=g?g:120;var e,k,m=document.createElement("table"),n=document.createElement("tbody"); m.style.cellPadding="4px";e=document.createElement("tr");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";mxUtils.write(k,b);e.appendChild(k);n.appendChild(e);e=document.createElement("tr");k=document.createElement("td");var q=document.createElement("textarea");q.style.outline="none";q.style.resize="none";q.style.width=d-200+"px";q.style.height=g+"px";this.textarea=q;this.init=function(){q.focus();q.scrollTop=0};k.appendChild(q);e.appendChild(k);k=document.createElement("td"); @@ -8097,27 +8097,27 @@ mxResources.get("showAll",null,"+ Show all")+'</div></div></div><div class="geTe mxResources.get("allDiagrams",null,"All diagrams")+'</span></div><div class="geTempDlgSpacer"> </div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall geTempDlgRadioBtnActive" data-id="tilesBtn"><img src="/images/tiles-sel.svg" class="geTempDlgTilesBtnImg"></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall" data-id="listBtn"><img src="/images/list.svg" class="geTempDlgListBtnImg"></div></div></div><div class="geTempDlgDiagramsTiles"></div></div></div><br style="clear:both;"/><div class="geTempDlgFooter"><span class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramHint">🛈 '+ mxResources.get("linkToDiagramHint",null,"Add a link to this diagram. The diagram can only be edited from the page that owns it.")+'</span><button class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramBtn">'+mxResources.get("linkToDiagram",null,"Link to Diagram")+'</button><div class="geTempDlgCreateBtn">'+mxResources.get("create",null,"Create")+'</div><div class="geTempDlgCancelBtn">'+mxResources.get("cancel",null,"Cancel")+"</div></div>",c=document.createElement("div");c.innerHTML=a;c.className="geTemplateDlg"; var a=window.innerWidth,b=window.innerHeight,d=987,g=712;.9*a<d&&(d=Math.max(.9*a,600),c.style.width=d+"px");.9*b<g&&(g=Math.max(.9*b,300),c.style.height=g+"px");this.width=d;this.height=g;this.container=c}; -TemplatesDialog.prototype.init=function(a,c,b,d,g,e,k,m,n,q){function f(){null!=D&&(D.style.fontWeight="normal",D.style.textDecoration="none",D=null)}function l(a,b,c,f,l,d,p){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";F.querySelector(".geTempDlgRadioBtn[data-id="+f+"]").className="geTempDlgRadioBtn "+(p?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");F.querySelector("."+b).src="/images/"+c+"-sel.svg";F.querySelector("."+l).src="/images/"+ -d+".svg";return!0}function p(a){function b(a){aa.removeChild(f);F.removeChild(c);aa.scrollTop=d}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var c=document.createElement("div");c.className="geTempDlgDialogMask";F.appendChild(c);var f=document.createElement("div");f.className="geTempDlgDiagramPreviewBox";var l=document.createElement("img");l.src=a;f.appendChild(l);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn"; +TemplatesDialog.prototype.init=function(a,c,b,d,g,e,k,m,n,q){function f(){null!=D&&(D.style.fontWeight="normal",D.style.textDecoration="none",D=null)}function l(a,b,c,f,l,d,p){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";E.querySelector(".geTempDlgRadioBtn[data-id="+f+"]").className="geTempDlgRadioBtn "+(p?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");E.querySelector("."+b).src="/images/"+c+"-sel.svg";E.querySelector("."+l).src="/images/"+ +d+".svg";return!0}function p(a){function b(a){aa.removeChild(f);E.removeChild(c);aa.scrollTop=d}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var c=document.createElement("div");c.className="geTempDlgDialogMask";E.appendChild(c);var f=document.createElement("div");f.className="geTempDlgDiagramPreviewBox";var l=document.createElement("img");l.src=a;f.appendChild(l);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn"; a.setAttribute("title",mxResources.get("close"));f.appendChild(a);var d=aa.scrollTop;mxEvent.addListener(a,"click",b);mxEvent.addListener(c,"click",b);aa.appendChild(f);aa.scrollTop=0;f.style.lineHeight=f.clientHeight+"px"}function u(a,b,c){if(null!=H){for(var f=H.className.split(" "),l=0;l<f.length;l++)if(-1<f[l].indexOf("Active")){f.splice(l,1);break}H.className=f.join(" ")}null!=a?(H=a,H.className+=" "+b,J=c,V.className="geTempDlgCreateBtn"):(J=H=null,V.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")} -function v(b){if(null!=J){var f=J;J=null;V.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";f.isExternal?(1==b?q(f.url,f,"nameInput.value"):n(f.url,f,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+f.url,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(c(b.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function t(a){a=a?"":"none";for(var b=F.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;c<b.length;c++)b[c].style.display= +function v(b){if(null!=J){var f=J;J=null;V.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";f.isExternal?(1==b?q(f.url,f,"nameInput.value"):n(f.url,f,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+f.url,mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()&&(c(b.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function t(a){a=a?"":"none";for(var b=E.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;c<b.length;c++)b[c].style.display= a}function z(a,b,c){function f(){V.innerHTML=b?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));t(!b)}T.innerHTML="";u();Q=a;var l=null;if(c){l=document.createElement("table");l.className="geTempDlgDiagramsListGrid";var d=document.createElement("tr"),e=document.createElement("th");e.style.width="50%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));d.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML= mxUtils.htmlEntities(mxResources.get("changedBy",null,"Changed By"));d.appendChild(e);e=document.createElement("th");e.style.width="25%";e.innerHTML=mxUtils.htmlEntities(mxResources.get("lastModifiedOn",null,"Last modified on"));d.appendChild(e);l.appendChild(d);T.appendChild(l)}for(d=0;d<a.length;d++){a[d].isExternal=!b;var k=a[d].url,e=mxUtils.htmlEntities(a[d].title),g=a[d].tooltip||a[d].title,A=a[d].imgUrl,x=mxUtils.htmlEntities(a[d].changedBy||""),B=mxUtils.htmlEntities(a[d].lastModifiedOn|| "");A||(A=TEMPLATE_PATH+"/"+k.substring(0,k.length-4)+".png");k=c?50:15;null!=e&&e.length>k&&(e=e.substring(0,k)+"…");if(c){var n=document.createElement("tr"),A=document.createElement("td"),m=document.createElement("img");m.src="/images/icon-search.svg";m.className="geTempDlgDiagramListPreviewBtn";m.setAttribute("title",mxResources.get("preview"));A.appendChild(m);g=document.createElement("span");g.className="geTempDlgDiagramTitle";g.innerHTML=e;A.appendChild(g);n.appendChild(A);A=document.createElement("td"); -A.innerHTML=x;n.appendChild(A);A=document.createElement("td");A.innerHTML=B;n.appendChild(A);l.appendChild(n);null==H&&(f(),u(n,"geTempDlgDiagramsListGridActive",a[d]));(function(a,b){mxEvent.addListener(n,"click",function(){H!=b&&(f(),u(b,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(n,"dblclick",v);mxEvent.addListener(m,"click",function(){p(a)})})(a[d],n)}else{var E=document.createElement("div");E.className="geTempDlgDiagramTile";E.setAttribute("title",g);null==H&&(f(),u(E,"geTempDlgDiagramTileActive", -a[d]));x=document.createElement("div");x.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var y=document.createElement("img");y.style.display="none";(function(a,b){y.onload=function(){b.className="geTempDlgDiagramTileImg";a.style.display=""};y.onerror=function(){b.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(y,x);y.src=A;x.appendChild(y);E.appendChild(x);x=document.createElement("div");x.className="geTempDlgDiagramTileLbl";x.innerHTML=null!=e?e:"";E.appendChild(x); -m=document.createElement("img");m.src="/images/icon-search.svg";m.className="geTempDlgDiagramPreviewBtn";m.setAttribute("title",mxResources.get("preview"));E.appendChild(m);(function(a,b){mxEvent.addListener(E,"click",function(){H!=b&&(f(),u(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(E,"dblclick",v);mxEvent.addListener(m,"click",function(){p(a)})})(a[d],E);T.appendChild(E)}}}function y(a,b){ca.innerHTML="";u();for(var c=!b&&5<a.length?5:a.length,f=0;f<c;f++){var l=a[f];l.isCategory= +A.innerHTML=x;n.appendChild(A);A=document.createElement("td");A.innerHTML=B;n.appendChild(A);l.appendChild(n);null==H&&(f(),u(n,"geTempDlgDiagramsListGridActive",a[d]));(function(a,b){mxEvent.addListener(n,"click",function(){H!=b&&(f(),u(b,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(n,"dblclick",v);mxEvent.addListener(m,"click",function(){p(a)})})(a[d],n)}else{var F=document.createElement("div");F.className="geTempDlgDiagramTile";F.setAttribute("title",g);null==H&&(f(),u(F,"geTempDlgDiagramTileActive", +a[d]));x=document.createElement("div");x.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var y=document.createElement("img");y.style.display="none";(function(a,b){y.onload=function(){b.className="geTempDlgDiagramTileImg";a.style.display=""};y.onerror=function(){b.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(y,x);y.src=A;x.appendChild(y);F.appendChild(x);x=document.createElement("div");x.className="geTempDlgDiagramTileLbl";x.innerHTML=null!=e?e:"";F.appendChild(x); +m=document.createElement("img");m.src="/images/icon-search.svg";m.className="geTempDlgDiagramPreviewBtn";m.setAttribute("title",mxResources.get("preview"));F.appendChild(m);(function(a,b){mxEvent.addListener(F,"click",function(){H!=b&&(f(),u(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(F,"dblclick",v);mxEvent.addListener(m,"click",function(){p(a)})})(a[d],F);T.appendChild(F)}}}function y(a,b){ca.innerHTML="";u();for(var c=!b&&5<a.length?5:a.length,f=0;f<c;f++){var l=a[f];l.isCategory= !0;var d=document.createElement("div"),p=mxResources.get(l.title);null==p&&(p=l.title.substring(0,1).toUpperCase()+l.title.substring(1));d.className="geTempDlgNewDiagramCatItem";d.setAttribute("title",p);p=mxUtils.htmlEntities(p);15<p.length&&(p=p.substring(0,15)+"…");null==H&&(V.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),t(),u(d,"geTempDlgNewDiagramCatItemActive",l));var e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemImg";var k=document.createElement("img"); -k.src=NEW_DIAGRAM_CATS_PATH+"/"+l.img;e.appendChild(k);d.appendChild(e);e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemLbl";e.innerHTML=p;d.appendChild(e);ca.appendChild(d);(function(a,b){mxEvent.addListener(d,"click",function(){H!=b&&(V.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),t(),u(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(d,"dblclick",v)})(l,d)}Y.style.display=5>a.length?"none":""}function C(a){var b=F.querySelector(".geTemplatesList"), +k.src=NEW_DIAGRAM_CATS_PATH+"/"+l.img;e.appendChild(k);d.appendChild(e);e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemLbl";e.innerHTML=p;d.appendChild(e);ca.appendChild(d);(function(a,b){mxEvent.addListener(d,"click",function(){H!=b&&(V.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),t(),u(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(d,"dblclick",v)})(l,d)}Y.style.display=5>a.length?"none":""}function C(a){var b=E.querySelector(".geTemplatesList"), c;for(c in a){var f=document.createElement("div"),l=mxResources.get(c),d=a[c];null==l&&(l=c.substring(0,1).toUpperCase()+c.substring(1));f.className="geTemplateCatLink";f.setAttribute("title",l+" ("+d.length+")");l=mxUtils.htmlEntities(l);15<l.length&&(l=l.substring(0,15)+"…");f.innerHTML=l+" ("+d.length+")";b.appendChild(f);(function(b,c,l){mxEvent.addListener(f,"click",function(){D!=l&&(null!=D?(D.style.fontWeight="normal",D.style.textDecoration="none"):(ha.style.display="none",ga.style.minHeight= -"100%"),D=l,D.style.fontWeight="bold",D.style.textDecoration="underline",aa.scrollTop=0,A&&(E=!0),L.innerHTML=c,W.style.display="none",z(a[b],!0))})})(c,l,f)}}function x(a){k&&(aa.scrollTop=0,T.innerHTML="",ba.spin(T),E=!1,A=!0,L.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),N=null,k(M,a?null:e))}function B(a){f();aa.scrollTop=0;T.innerHTML="";ba.spin(T);E=!1;A=!0;da=null;L.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+ -' "'+mxUtils.htmlEntities(a)+'"';m(a,M,G?null:e);N=a}d=null!=d?d:TEMPLATE_PATH+"/index.xml";g=null!=g?g:NEW_DIAGRAM_CATS_PATH+"/index.xml";var F=this.container,A=!1,E=!1,D=null,H=null,J=null,I=!1,G=!0,K=!1,Q=[],N,Y=F.querySelector(".geTempDlgShowAllBtn"),T=F.querySelector(".geTempDlgDiagramsTiles"),L=F.querySelector(".geTempDlgDiagramsListTitle"),W=F.querySelector(".geTempDlgDiagramsListBtns"),aa=F.querySelector(".geTempDlgContent"),ga=F.querySelector(".geTempDlgDiagramsList"),ha=F.querySelector(".geTempDlgNewDiagramCat"), -ca=F.querySelector(".geTempDlgNewDiagramCatList"),V=F.querySelector(".geTempDlgCreateBtn"),ba=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(F.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){f();ha.style.display="";ga.style.minHeight="calc(100% - 280px)";x(G)});mxEvent.addListener(F.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){l(this,"geTempDlgAllDiagramsBtnImg", -"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(G=!0,null==N?x(G):B(N))});mxEvent.addListener(F.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){l(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(G=!1,null==N?x(G):B(N))});mxEvent.addListener(F.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){l(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg", -"tiles",!1)&&(K=!0,z(Q,!1,K))});mxEvent.addListener(F.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){l(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(K=!1,z(Q,!1,K))});mxEvent.addListener(Y,"click",function(){I?(ha.style.height="280px",ca.style.height="190px",Y.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),y(ea)):(ha.style.height="440px",ca.style.height="355px",Y.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess", +"100%"),D=l,D.style.fontWeight="bold",D.style.textDecoration="underline",aa.scrollTop=0,A&&(F=!0),L.innerHTML=c,W.style.display="none",z(a[b],!0))})})(c,l,f)}}function x(a){k&&(aa.scrollTop=0,T.innerHTML="",ba.spin(T),F=!1,A=!0,L.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),N=null,k(M,a?null:e))}function B(a){f();aa.scrollTop=0;T.innerHTML="";ba.spin(T);F=!1;A=!0;da=null;L.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+ +' "'+mxUtils.htmlEntities(a)+'"';m(a,M,G?null:e);N=a}d=null!=d?d:TEMPLATE_PATH+"/index.xml";g=null!=g?g:NEW_DIAGRAM_CATS_PATH+"/index.xml";var E=this.container,A=!1,F=!1,D=null,H=null,J=null,I=!1,G=!0,K=!1,Q=[],N,Y=E.querySelector(".geTempDlgShowAllBtn"),T=E.querySelector(".geTempDlgDiagramsTiles"),L=E.querySelector(".geTempDlgDiagramsListTitle"),W=E.querySelector(".geTempDlgDiagramsListBtns"),aa=E.querySelector(".geTempDlgContent"),ga=E.querySelector(".geTempDlgDiagramsList"),ha=E.querySelector(".geTempDlgNewDiagramCat"), +ca=E.querySelector(".geTempDlgNewDiagramCatList"),V=E.querySelector(".geTempDlgCreateBtn"),ba=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(E.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){f();ha.style.display="";ga.style.minHeight="calc(100% - 280px)";x(G)});mxEvent.addListener(E.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){l(this,"geTempDlgAllDiagramsBtnImg", +"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(G=!0,null==N?x(G):B(N))});mxEvent.addListener(E.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){l(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(G=!1,null==N?x(G):B(N))});mxEvent.addListener(E.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){l(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg", +"tiles",!1)&&(K=!0,z(Q,!1,K))});mxEvent.addListener(E.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){l(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(K=!1,z(Q,!1,K))});mxEvent.addListener(Y,"click",function(){I?(ha.style.height="280px",ca.style.height="190px",Y.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),y(ea)):(ha.style.height="440px",ca.style.height="355px",Y.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess", null,"- Show less")),y(ea,!0));I=!I});var R=!1,Z=!1,X={},ea=[],P=1;mxUtils.get(d,function(a){if(!R){R=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var b=a.getAttribute("url");if(null!=b){var c=b.indexOf("/"),b=b.substring(0,c),c=X[b];null==c&&(P++,c=[],X[b]=c);c.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),imgUrl:a.getAttribute("imgUrl")})}}a= -a.nextSibling}C(X)}});mxUtils.get(g,function(a){if(!Z){Z=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&ea.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title")}),a=a.nextSibling;y(ea)}});var M=function(a,b){W.style.display="";ba.stop();A=!1;E?E=!1:b?T.innerHTML=b:0==a.length?T.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")): -z(a,!1,K)};x(G);var da=null;m&&mxEvent.addListener(F.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var b=this;null!=da&&clearTimeout(da);13==a.keyCode?B(b.value):da=setTimeout(function(){B(b.value)},500)});mxEvent.addListener(V,"click",v);mxEvent.addListener(F.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){v(!0)});mxEvent.addListener(F.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=b&&b();a.hideDialog(!0)})}; +a.nextSibling}C(X)}});mxUtils.get(g,function(a){if(!Z){Z=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&ea.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title")}),a=a.nextSibling;y(ea)}});var M=function(a,b){W.style.display="";ba.stop();A=!1;F?F=!1:b?T.innerHTML=b:0==a.length?T.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")): +z(a,!1,K)};x(G);var da=null;m&&mxEvent.addListener(E.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var b=this;null!=da&&clearTimeout(da);13==a.keyCode?B(b.value):da=setTimeout(function(){B(b.value)},500)});mxEvent.addListener(V,"click",v);mxEvent.addListener(E.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){v(!0)});mxEvent.addListener(E.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=b&&b();a.hideDialog(!0)})}; var BtnDialog=function(a,c,b,d){var g=document.createElement("div");g.style.textAlign="center";var e=document.createElement("p");e.style.fontSize="16pt";e.style.padding="0px";e.style.margin="0px";e.style.color="gray";mxUtils.write(e,mxResources.get("done"));var k="Unknown",m=document.createElement("img");m.setAttribute("border","0");m.setAttribute("align","absmiddle");m.style.marginRight="10px";c==a.drive?(k=mxResources.get("googleDrive"),m.src=IMAGE_PATH+"/google-drive-logo-white.svg"):c==a.dropbox? (k=mxResources.get("dropbox"),m.src=IMAGE_PATH+"/dropbox-logo-white.svg"):c==a.oneDrive?(k=mxResources.get("oneDrive"),m.src=IMAGE_PATH+"/onedrive-logo-white.svg"):c==a.gitHub?(k=mxResources.get("github"),m.src=IMAGE_PATH+"/github-logo-white.svg"):c==a.gitLab?(k=mxResources.get("gitlab"),m.src=IMAGE_PATH+"/gitlab-logo.svg"):c==a.trello&&(k=mxResources.get("trello"),m.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizedIn",[k],"You are now authorized in {1}")); b=mxUtils.button(b,d);b.insertBefore(m,b.firstChild);b.style.marginTop="6px";b.className="geBigButton";b.style.fontSize="18px";b.style.padding="14px";g.appendChild(e);g.appendChild(a);g.appendChild(b);this.container=g}; @@ -8235,7 +8235,7 @@ function(){var a=mxUtils.htmlEntities(d.value);f(b,a,g)});d.focus();mxEvent.addL g.isDeletable&&(u=mxUtils.button("-",mxUtils.bind(t,function(a){f(b,"",g,g.index);mxEvent.consume(a)})),u.style.height="16px",u.style.width="25px",u.style["float"]="right",u.className="geColorBtn",A.appendChild(u));v.appendChild(A);return v}var t=this,x=this.editorUi.editor.graph,u=[];a.style.position="relative";a.style.padding="0";var B=document.createElement("table");B.style.whiteSpace="nowrap";B.style.width="100%";var n=document.createElement("tr");n.className="gePropHeader";var v=document.createElement("th"); v.className="gePropHeaderCell";var A=document.createElement("img");A.src=Sidebar.prototype.expandedImage;v.appendChild(A);mxUtils.write(v,mxResources.get("property"));n.style.cursor="pointer";var m=function(){var b=B.querySelectorAll(".gePropNonHeaderRow"),c;if(t.editorUi.propertiesCollapsed){A.src=Sidebar.prototype.collapsedImage;c="none";for(var f=a.childNodes.length-1;0<=f;f--)try{var l=a.childNodes[f],d=l.nodeName.toUpperCase();"INPUT"!=d&&"SELECT"!=d||a.removeChild(l)}catch(O){}}else A.src=Sidebar.prototype.expandedImage, c="";for(f=0;f<b.length;f++)b[f].style.display=c};mxEvent.addListener(n,"click",function(){t.editorUi.propertiesCollapsed=!t.editorUi.propertiesCollapsed;m()});n.appendChild(v);v=document.createElement("th");v.className="gePropHeaderCell";v.innerHTML=mxResources.get("value");n.appendChild(v);B.appendChild(n);var y=!1,z=!1,q;for(q in b)if(n=b[q],"function"!=typeof n.isVisible||n.isVisible(c,this)){var C=null!=c.style[q]?mxUtils.htmlEntities(c.style[q]+""):n.defVal;if("separator"==n.type)z=!z;else{if("staticArr"== -n.type)n.size=parseInt(c.style[n.sizeProperty]||b[n.sizeProperty].defVal)||0;else if(null!=n.dependentProps){for(var F=n.dependentProps,E=[],D=[],v=0;v<F.length;v++){var M=c.style[F[v]];D.push(b[F[v]].subDefVal);E.push(null!=M?M.split(","):[])}n.dependentPropsDefVal=D;n.dependentPropsVals=E}B.appendChild(g(q,C,n,y,z));y=!y}}for(v=0;v<u.length;v++)for(n=u[v],b=n.parentRow,c=0;c<n.values.length;c++)q=g(n.name,n.values[c],{type:n.type,parentRow:n.parentRow,isDeletable:n.isDeletable,index:c,defVal:n.defVal, +n.type)n.size=parseInt(c.style[n.sizeProperty]||b[n.sizeProperty].defVal)||0;else if(null!=n.dependentProps){for(var E=n.dependentProps,F=[],D=[],v=0;v<E.length;v++){var M=c.style[E[v]];D.push(b[E[v]].subDefVal);F.push(null!=M?M.split(","):[])}n.dependentPropsDefVal=D;n.dependentPropsVals=F}B.appendChild(g(q,C,n,y,z));y=!y}}for(v=0;v<u.length;v++)for(n=u[v],b=n.parentRow,c=0;c<n.values.length;c++)q=g(n.name,n.values[c],{type:n.type,parentRow:n.parentRow,isDeletable:n.isDeletable,index:c,defVal:n.defVal, countProperty:n.countProperty,size:n.size},0==c%2,n.flipBkg),b.parentNode.insertBefore(q,b.nextSibling),b=q;a.appendChild(B);m();return a};StyleFormatPanel.prototype.addStyles=function(a){function b(a){function b(a){var b=mxUtils.button("",function(b){f.getModel().beginUpdate();try{var c=f.getSelectionCells();for(b=0;b<c.length;b++){for(var l=f.getModel().getStyle(c[b]),p=0;p<d.length;p++)l=mxUtils.removeStylename(l,d[p]);var e=f.getModel().isVertex(c[b])?f.defaultVertexStyle:f.defaultEdgeStyle;null!= a?(l=mxUtils.setStyle(l,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),l=""==a.fill?mxUtils.setStyle(l,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(l,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,null)),l=""==a.stroke?mxUtils.setStyle(l,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(l,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,null)),f.getModel().isVertex(c[b])&& (l=mxUtils.setStyle(l,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,null)))):(l=mxUtils.setStyle(l,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,"#ffffff")),l=mxUtils.setStyle(l,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,"#000000")),l=mxUtils.setStyle(l,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),f.getModel().isVertex(c[b])&&(l=mxUtils.setStyle(l,mxConstants.STYLE_FONTCOLOR, @@ -8294,15 +8294,15 @@ t.setAttribute("value","all");t.setAttribute("type","radio");t.setAttribute("nam u.setAttribute("value","1");u.setAttribute("type","number");u.setAttribute("min","1");u.style.width="50px";g.appendChild(u);p=document.createElement("span");mxUtils.write(p,mxResources.get("to"));g.appendChild(p);var n=u.cloneNode(!0);g.appendChild(n);mxEvent.addListener(u,"focus",function(){x.checked=!0});mxEvent.addListener(n,"focus",function(){x.checked=!0});mxEvent.addListener(u,"change",c);mxEvent.addListener(n,"change",c);if(null!=a.pages&&(e=a.pages.length,null!=a.currentPage))for(p=0;p<a.pages.length;p++)if(a.currentPage== a.pages[p]){k=p+1;u.value=k;n.value=k;break}u.setAttribute("max",e);n.setAttribute("max",e);1<e&&d.appendChild(g);var B=document.createElement("div");B.style.marginBottom="10px";var v=document.createElement("input");v.style.marginRight="8px";v.setAttribute("value","adjust");v.setAttribute("type","radio");v.setAttribute("name","printZoom");B.appendChild(v);p=document.createElement("span");mxUtils.write(p,mxResources.get("adjustTo"));B.appendChild(p);var m=document.createElement("input");m.style.cssText= "margin:0 8px 0 8px;";m.setAttribute("value","100 %");m.style.width="50px";B.appendChild(m);mxEvent.addListener(m,"focus",function(){v.checked=!0});d.appendChild(B);var g=g.cloneNode(!1),y=v.cloneNode(!0);y.setAttribute("value","fit");v.setAttribute("checked","checked");p=document.createElement("div");p.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";p.appendChild(y);g.appendChild(p);B=document.createElement("table");B.style.display="inline-block";var A=document.createElement("tbody"), -z=document.createElement("tr"),q=z.cloneNode(!0),C=document.createElement("td"),F=C.cloneNode(!0),E=C.cloneNode(!0),P=C.cloneNode(!0),M=C.cloneNode(!0),da=C.cloneNode(!0);C.style.textAlign="right";P.style.textAlign="right";mxUtils.write(C,mxResources.get("fitTo"));var S=document.createElement("input");S.style.cssText="margin:0 8px 0 8px;";S.setAttribute("value","1");S.setAttribute("min","1");S.setAttribute("type","number");S.style.width="40px";F.appendChild(S);p=document.createElement("span");mxUtils.write(p, -mxResources.get("fitToSheetsAcross"));E.appendChild(p);mxUtils.write(P,mxResources.get("fitToBy"));var U=S.cloneNode(!0);M.appendChild(U);mxEvent.addListener(S,"focus",function(){y.checked=!0});mxEvent.addListener(U,"focus",function(){y.checked=!0});p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsDown"));da.appendChild(p);z.appendChild(C);z.appendChild(F);z.appendChild(E);q.appendChild(P);q.appendChild(M);q.appendChild(da);A.appendChild(z);A.appendChild(q);B.appendChild(A); +z=document.createElement("tr"),q=z.cloneNode(!0),C=document.createElement("td"),E=C.cloneNode(!0),F=C.cloneNode(!0),P=C.cloneNode(!0),M=C.cloneNode(!0),da=C.cloneNode(!0);C.style.textAlign="right";P.style.textAlign="right";mxUtils.write(C,mxResources.get("fitTo"));var S=document.createElement("input");S.style.cssText="margin:0 8px 0 8px;";S.setAttribute("value","1");S.setAttribute("min","1");S.setAttribute("type","number");S.style.width="40px";E.appendChild(S);p=document.createElement("span");mxUtils.write(p, +mxResources.get("fitToSheetsAcross"));F.appendChild(p);mxUtils.write(P,mxResources.get("fitToBy"));var U=S.cloneNode(!0);M.appendChild(U);mxEvent.addListener(S,"focus",function(){y.checked=!0});mxEvent.addListener(U,"focus",function(){y.checked=!0});p=document.createElement("span");mxUtils.write(p,mxResources.get("fitToSheetsDown"));da.appendChild(p);z.appendChild(C);z.appendChild(E);z.appendChild(F);q.appendChild(P);q.appendChild(M);q.appendChild(da);A.appendChild(z);A.appendChild(q);B.appendChild(A); g.appendChild(B);d.appendChild(g);g=document.createElement("div");p=document.createElement("div");p.style.fontWeight="bold";p.style.marginBottom="12px";mxUtils.write(p,mxResources.get("paperSize"));g.appendChild(p);p=document.createElement("div");p.style.marginBottom="12px";var ja=PageSetupDialog.addPageFormatPanel(p,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);g.appendChild(p);p=document.createElement("span");mxUtils.write(p,mxResources.get("pageScale"));g.appendChild(p); var ka=document.createElement("input");ka.style.cssText="margin:0 8px 0 8px;";ka.setAttribute("value","100 %");ka.style.width="60px";g.appendChild(ka);d.appendChild(g);p=document.createElement("div");p.style.cssText="text-align:right;margin:48px 0 0 0;";g=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});g.className="geBtn";a.editor.cancelFirst&&p.appendChild(g);a.isOffline()||(B=mxUtils.button(mxResources.get("help"),function(){l.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}), B.className="geBtn",p.appendChild(B));PrintDialog.previewEnabled&&(B=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();f(!1)}),B.className="geBtn",p.appendChild(B));B=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});B.className="geBtn gePrimaryBtn";p.appendChild(B);a.editor.cancelFirst||p.appendChild(g);d.appendChild(p);this.container=d};var x=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null== this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(x.apply(this,arguments),null!=this.mathEnabled&& -this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))};Editor.prototype.useCanvasForExport=!1;try{var B=document.createElement("canvas"),F=new Image;F.onload=function(){try{B.getContext("2d").drawImage(F,0,0);var a=B.toDataURL("image/png");Editor.prototype.useCanvasForExport= -null!=a&&6<a.length}catch(E){}};F.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(A){}})(); -(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="12.2.1";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t"; +this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))};Editor.prototype.useCanvasForExport=!1;try{var B=document.createElement("canvas"),E=new Image;E.onload=function(){try{B.getContext("2d").drawImage(E,0,0);var a=B.toDataURL("image/png");Editor.prototype.useCanvasForExport= +null!=a&&6<a.length}catch(F){}};E.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(A){}})(); +(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,b,d){d.ui=a.ui;return b};a.afterDecode=function(a,b,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="12.2.2";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t"; EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":"https://rt.draw.io/cache";Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.logError=function(a,b,c,d,e){if("1"==urlParams.dev)EditorUi.debug("logError",a,b, c,d,e);else if(EditorUi.enableLogging)try{if(a!=EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage=a;var f=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",l=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";e=null!=e?e:Error(a);(new Image).src=l+"/log?severity="+f+"&v="+encodeURIComponent(EditorUi.VERSION)+ "&msg=clientError:"+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(c)+(null!=d?":colno:"+encodeURIComponent(d):"")+(null!=e&&null!=e.stack?"&stack="+encodeURIComponent(e.stack):"")}}catch(y){}};EditorUi.logEvent=function(a){if("1"==urlParams.dev)EditorUi.debug("logEvent",a);else if(EditorUi.enableLogging)try{var b=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=b+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!= @@ -8381,10 +8381,10 @@ g.translate(-c.x,-c.y)}e.appendChild(this.sidebar.createVertexTemplateFromCells( mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=m.getSelectionCells(),c=m.view.getBounds(b),f=m.view.scale;c.x/=f;c.y/=f;c.width/=f;c.height/=f;c.x-=m.view.translate.x;c.y-=m.view.translate.y;H(b,c)}mxEvent.consume(a)});mxEvent.addGestureListeners(e,function(){},mxUtils.bind(this,function(a){m.isMouseDown&&null!=m.panningManager&&null!=m.graphHandler.shape&&(m.graphHandler.shape.node.style.visibility="hidden",e.style.backgroundColor="#f1f3f4",e.style.cursor="copy",m.panningManager.stop(), m.autoScroll=!1,null!=m.graphHandler.guide&&m.graphHandler.guide.setVisible(!1),null!=m.graphHandler.hint&&(m.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){m.isMouseDown&&null!=m.panningManager&&null!=m.graphHandler&&(e.style.backgroundColor="",e.style.cursor="default",this.sidebar.showTooltips=!0,m.panningManager.stop(),m.graphHandler.reset(),m.isMouseDown=!1,m.autoScroll=!0,J(a),mxEvent.consume(a))}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this, function(a){m.isMouseDown&&null!=m.graphHandler.shape&&(m.graphHandler.shape.node.style.visibility="visible",e.style.backgroundColor="",e.style.cursor="",m.autoScroll=!0,null!=m.graphHandler.guide&&m.graphHandler.guide.setVisible(!0),null!=m.graphHandler.hint&&(m.graphHandler.hint.style.visibility="visible"))}));Graph.fileSupport&&(mxEvent.addListener(e,"dragover",mxUtils.bind(this,function(a){e.style.backgroundColor="#f1f3f4";a.dataTransfer.dropEffect="copy";e.style.cursor="copy";this.sidebar.hideTooltip(); -a.stopPropagation();a.preventDefault()})),mxEvent.addListener(e,"drop",mxUtils.bind(this,function(a){e.style.cursor="";e.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,f,p,g,k,t,x,n,m){if(null!=c&&"image/"==f.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,k,t),c)],c[0].vertex=!0,H(c,new mxRectangle(0, -0,k,t),a,mxEvent.isAltDown(a)?null:x.substring(0,x.lastIndexOf(".")).replace(/_/g," ")),null!=d&&null!=d.parentNode&&0<b.length&&(d.parentNode.removeChild(d),d=null);else{var u=!1,B=mxUtils.bind(this,function(c,f){if(null!=c&&"text/xml"==f){var p=mxUtils.parseXml(c);if("mxlibrary"==p.documentElement.nodeName)try{var g=JSON.parse(mxUtils.getTextContent(p.documentElement));l(g,e);b=b.concat(g);D(a);this.spinner.stop();u=!0}catch(P){}else if("mxfile"==p.documentElement.nodeName)try{for(var k=p.documentElement.getElementsByTagName("diagram"), -p=0;p<k.length;p++){var t=this.stringToCells(Editor.getDiagramNodeXml(k[p])),x=this.editor.graph.getBoundingBoxFromGeometry(t);H(t,new mxRectangle(0,0,x.width,x.height),a)}u=!0}catch(P){null!=window.console&&console.log("error in drop handler:",P)}}u||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=d&&null!=d.parentNode&&0<b.length&&(d.parentNode.removeChild(d),d=null)});null!=m&&null!=x&&(/(\.v(dx|sdx?))($|\?)/i.test(x)||/(\.vs(x|sx?))($|\?)/i.test(x))? -this.importVisio(m,function(a){B(a,"text/xml")},null,x):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,x)&&null!=m?this.parseFile(m,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?B(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):B(c,f)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(e,"dragleave", +a.stopPropagation();a.preventDefault()})),mxEvent.addListener(e,"drop",mxUtils.bind(this,function(a){e.style.cursor="";e.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,f,p,g,k,t,x,n,u){if(null!=c&&"image/"==f.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,k,t),c)],c[0].vertex=!0,H(c,new mxRectangle(0, +0,k,t),a,mxEvent.isAltDown(a)?null:x.substring(0,x.lastIndexOf(".")).replace(/_/g," ")),null!=d&&null!=d.parentNode&&0<b.length&&(d.parentNode.removeChild(d),d=null);else{var m=!1,B=mxUtils.bind(this,function(c,f){if(null!=c&&"text/xml"==f){var p=mxUtils.parseXml(c);if("mxlibrary"==p.documentElement.nodeName)try{var g=JSON.parse(mxUtils.getTextContent(p.documentElement));l(g,e);b=b.concat(g);D(a);this.spinner.stop();m=!0}catch(P){}else if("mxfile"==p.documentElement.nodeName)try{for(var k=p.documentElement.getElementsByTagName("diagram"), +p=0;p<k.length;p++){var t=this.stringToCells(Editor.getDiagramNodeXml(k[p])),x=this.editor.graph.getBoundingBoxFromGeometry(t);H(t,new mxRectangle(0,0,x.width,x.height),a)}m=!0}catch(P){null!=window.console&&console.log("error in drop handler:",P)}}m||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=d&&null!=d.parentNode&&0<b.length&&(d.parentNode.removeChild(d),d=null)});null!=u&&null!=x&&(/(\.v(dx|sdx?))($|\?)/i.test(x)||/(\.vs(x|sx?))($|\?)/i.test(x))? +this.importVisio(u,function(a){B(a,"text/xml")},null,x):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,x)&&null!=u?this.parseFile(u,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?B(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):B(c,f)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(e,"dragleave", function(a){e.style.cursor="";e.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));k=k.cloneNode(!1);k.setAttribute("src",Editor.editImage);k.setAttribute("title",mxResources.get("edit"));g.insertBefore(k,g.firstChild);mxEvent.addListener(k,"click",q);mxEvent.addListener(e,"dblclick",function(a){mxEvent.getSource(a)==e&&q(a)});c=k.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));g.insertBefore(c,g.firstChild);mxEvent.addListener(c, "click",J);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(c=document.createElement("span"),c.setAttribute("title",mxResources.get("help")),c.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(c,"?"),mxEvent.addGestureListeners(c,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),g.insertBefore(c,g.firstChild))}p.appendChild(g);p.style.paddingRight=18*g.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries= function(a,b){for(var c=0;c<a.length;c++){var f=a[c],d=f.data;if(null!=d){var d=this.convertDataUri(d),l="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==f.aspect&&(l+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(l+"image="+d,f.w,f.h,"",f.title||"",!1,!1,!0))}else null!=f.xml&&(d=this.stringToCells(Graph.decompress(f.xml)),0<d.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(d,f.w,f.h,f.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource= @@ -8410,7 +8410,7 @@ urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!= if(mxClient.IS_GC)var p=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),l=65==(p?parseInt(p[2],10):!1)?!1:l;if(l||this.isOffline()){f.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));l?f.download=b:f.setAttribute("target","_blank");document.body.appendChild(f);try{window.setTimeout(function(){URL.revokeObjectURL(f.href)},0),f.click(),f.parentNode.removeChild(f)}catch(C){}}else this.createEchoRequest(a,b,c,d,e).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest= function(a,b,c,d,e,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=c?"&mime="+c:"")+(null!=e?"&format="+e:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(d?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,f=Math.ceil(d/1024),l=Array(f),e=0;e<f;++e){for(var g=1024*e,k=Math.min(g+1024,d),x=Array(k-g),n=0;g<k;++n,++g)x[n]=c[g].charCodeAt(0);l[e]=new Uint8Array(x)}return new Blob(l,{type:b})}; EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,g,k){g=null!=g?g:!1;k=null!=k?k:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(g);isLocalStorage&&e++;var f=4>=e?2:6<e?4:3;b=new CreateDialog(this,b,mxUtils.bind(this,function(b,f){try{if("_blank"==f)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var l=window.open("about:blank");null==l?mxUtils.popup(a,!0):(l.document.write("<pre>"+mxUtils.htmlEntities(a,!1)+"<pre>"),l.document.close())}else this.openInNewWindow(a, -c,d);else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(f,mxUtils.bind(this,function(l){try{this.exportFile(a,b,c,d,f,l)}catch(A){this.handleError(A)}}))}catch(F){this.handleError(F)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,k,null,1<e,f,a,c,d);g=this.isServices(e)?e>f?390:270:160;this.showDialog(b.container,400,g,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a, +c,d);else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(f,mxUtils.bind(this,function(l){try{this.exportFile(a,b,c,d,f,l)}catch(A){this.handleError(A)}}))}catch(E){this.handleError(E)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,k,null,1<e,f,a,c,d);g=this.isServices(e)?e>f?390:270:160;this.showDialog(b.container,400,g,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a, b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d||null==d.document?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null!=d&&null!=d.document||mxUtils.popup(a,!0)}; var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d= c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left= @@ -8418,7 +8418,7 @@ d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style "auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.style.backgroundColor="white";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0); b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,d,e){this.isLocalFileSave()?this.saveLocalFile(c,a,d,e,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,f){return this.createEchoRequest(c, a,d,e,b,f)}),c,e,d)};EditorUi.prototype.saveRequest=function(a,b,c,d,e,g,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var f=this.getServiceCount(!1);isLocalStorage&&f++;var l=4>=f?2:6<f?4:3;a=new CreateDialog(this,a,mxUtils.bind(this,function(a,f){if("_blank"==f||null!=a&&0<a.length){var l=c("_blank"==f?null:a,f==App.MODE_DEVICE||"download"==f||null==f||"_blank"==f?"0":"1");null!=l&&(f==App.MODE_DEVICE||"download"==f||"_blank"==f?l.simulate(document,"_blank"):this.pickFolder(f,mxUtils.bind(this, -function(c){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,a,g,!0,f,c)}catch(E){this.handleError(E)}else this.spinner.spin(document.body,mxResources.get("saving"))&&l.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=l.getStatus()&&299>=l.getStatus())try{this.exportFile(l.getText(),a,g,!0,f,c)}catch(E){this.handleError(E)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}), +function(c){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,a,g,!0,f,c)}catch(F){this.handleError(F)}else this.spinner.spin(document.body,mxResources.get("saving"))&&l.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=l.getStatus()&&299>=l.getStatus())try{this.exportFile(l.getText(),a,g,!0,f,c)}catch(F){this.handleError(F)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}), mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,k,null,1<f,l,d,g,e);f=this.isServices(f)?4<f?390:270:160;this.showDialog(a.container,380,f,!0,!0);a.init()};EditorUi.prototype.isServices=function(a){return 1!=a};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,e,g){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d, e,g,k,n,m,x){if(this.spinner.spin(document.body,mxResources.get("export"))){var f=this.editor.graph.isSelectionEmpty();c=null!=c?c:f;f=b?null:this.editor.graph.background;f==mxConstants.NONE&&(f=null);null==f&&0==b&&(f="#ffffff");var l=this.editor.graph.getSvg(f,a,k,n,null,c,null,null,"blank"==x?"_blank":"self"==x?"_top":null);d&&this.editor.graph.addSvgShadow(l);var p=this.getBaseFilename()+".svg",t=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0, null,null,null,c,m,null,null,null,!1));if(null!=this.editor.fontCss){var b=a.ownerDocument,b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var d='<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()|| @@ -8469,16 +8469,16 @@ d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,c){try{var d=this.edi a?e.getName():"pagenumber"==a?1:l.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(e.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==f&&(f=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var l=c.toDataURL("image/png"),l=this.writeGraphModelToPng(l,"tEXt","mxfile",encodeURIComponent(f));a(l.substring(l.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(x){null!=b&&b(x)}}),null,null,null,mxUtils.bind(this, function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)}catch(y){null!=b&&b(y)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,d,e,g,k){k=b.background;k==mxConstants.NONE&&(k=null);g=b.getSvg(k,null,null,null,null,g);b.shadowVisible&&b.addSvgShadow(g);null!=a&&g.setAttribute("content",a);null!=c&&g.setAttribute("resource",c);if(null!=e)this.convertImages(g,mxUtils.bind(this,function(a){e((d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+ mxUtils.getXml(a))}));else return(d?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(g)};EditorUi.prototype.exportImage=function(a,b,c,d,e,g,k,n,m,x,B){m=null!=m?m:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var f=this.editor.graph.isSelectionEmpty();c=null!=c?c:f;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this, -function(a){this.spinner.stop();try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,n):null,m,null==this.pages||0==this.pages.length,B)}catch(E){"Invalid image"==E.message?this.downloadFile(m):this.handleError(E)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,g,k,x)}catch(A){this.spinner.stop(),this.handleError(A)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b= -function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,f={},e=mxUtils.bind(this,function(){if(0==d){for(var l=[c[0]],e=1;e<c.length;e++){var g=c[e].indexOf(")");l.push('url("');l.push(f[b(c[e].substring(0,g))]);l.push('"'+c[e].substring(g))}this.editor.resolvedFontCss=l.join("");a()}});if(0<c.length)for(var g=1;g<c.length;g++){var k=c[g].indexOf(")"),n=null,x=c[g].indexOf("format(",k);0<x&&(n=b(c[g].substring(x+7,c[g].indexOf(")", -x))));mxUtils.bind(this,function(a){if(null==f[a]){f[a]=a;d++;var b="application/x-font-ttf";if("svg"==n||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==n||"embedded-opentype"==n||/(\.otf)($|\?)/i.test(a))b="application/x-font-opentype";else if("woff"==n||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==n||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==n||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==n||/(\.sfnt)($|\?)/i.test(a))b= -"application/font-sfnt";var c=a;/^https?:\/\//.test(c)&&!this.editor.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){f[a]=b;d--;e()}),mxUtils.bind(this,function(a){d--;e()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[g].substring(0,k)),n)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,k,n,m,x,B,q,A,E,D){try{g=null!=g?g:!0;k=null!=k?k:!0;q=null!=q?q:this.editor.graph;A=null!=A?A:0;var f=m?null:q.background; -f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==f&&0==m&&(f="#ffffff");this.convertImages(q.getSvg(null,null,null,E,null,k,null,null,null,x),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var l=function(){mxClient.IS_SF?window.setTimeout(function(){x.drawImage(d,A/n,A/n);a(k)},0):(x.drawImage(d,A/n,A/n),a(k))},k=document.createElement("canvas"),p=parseInt(c.getAttribute("width")),t=parseInt(c.getAttribute("height"));n=null!=n?n:1;null!=b&&(n=g?Math.min(1, -Math.min(3*b/(4*t),b/p)):b/p);p=Math.ceil(n*p)+2*A;t=Math.ceil(n*t)+2*A;k.setAttribute("width",p);k.setAttribute("height",t);var x=k.getContext("2d");null!=f&&(x.beginPath(),x.rect(0,0,p,t),x.fillStyle=f,x.fill());x.scale(n,n);if(D){var m=q.view,B=btoa(unescape(encodeURIComponent(m.createSvgGrid(m.gridColor)))),B="data:image/svg+xml;base64,"+B,u=q.gridSize*m.gridSteps*n,v=q.getGraphBounds(),y=v.x*n,F=v.y*n,z=new Image;z.src=B;z.onload=function(){for(var a=-Math.round(u-mxUtils.mod(m.translate.x*n- -y,u)),b=-Math.round(u-mxUtils.mod(m.translate.y*n-F,u));a<p;a+=u)for(var c=b;c<t;c+=u)x.drawImage(z,a/n,c/n);l()}}else l()}catch(ba){null!=e&&e(ba)}});d.onerror=function(a){null!=e&&e(a)};try{x&&this.editor.graph.addSvgShadow(c);var l=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(q,c,!0,mxUtils.bind(this, +function(a){this.spinner.stop();try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,n):null,m,null==this.pages||0==this.pages.length,B)}catch(F){"Invalid image"==F.message?this.downloadFile(m):this.handleError(F)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,d,null,null,g,k,x)}catch(A){this.spinner.stop(),this.handleError(A)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b= +function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},c=this.editor.fontCss.split("url("),d=0,f={},e=mxUtils.bind(this,function(){if(0==d){for(var l=[c[0]],e=1;e<c.length;e++){var g=c[e].indexOf(")");l.push('url("');l.push(f[b(c[e].substring(0,g))]);l.push('"'+c[e].substring(g))}this.editor.resolvedFontCss=l.join("");a()}});if(0<c.length)for(var g=1;g<c.length;g++){var k=c[g].indexOf(")"),n=null,m=c[g].indexOf("format(",k);0<m&&(n=b(c[g].substring(m+7,c[g].indexOf(")", +m))));mxUtils.bind(this,function(a){if(null==f[a]){f[a]=a;d++;var b="application/x-font-ttf";if("svg"==n||/(\.svg)($|\?)/i.test(a))b="image/svg+xml";else if("otf"==n||"embedded-opentype"==n||/(\.otf)($|\?)/i.test(a))b="application/x-font-opentype";else if("woff"==n||/(\.woff)($|\?)/i.test(a))b="application/font-woff";else if("woff2"==n||/(\.woff2)($|\?)/i.test(a))b="application/font-woff2";else if("eot"==n||/(\.eot)($|\?)/i.test(a))b="application/vnd.ms-fontobject";else if("sfnt"==n||/(\.sfnt)($|\?)/i.test(a))b= +"application/font-sfnt";var c=a;/^https?:\/\//.test(c)&&!this.editor.isCorsEnabledForUrl(c)&&(c=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(c,mxUtils.bind(this,function(b){f[a]=b;d--;e()}),mxUtils.bind(this,function(a){d--;e()}),!0,null,"data:"+b+";charset=utf-8;base64,")}})(b(c[g].substring(0,k)),n)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,d,e,g,k,n,m,x,B,q,A,F,D){try{g=null!=g?g:!0;k=null!=k?k:!0;q=null!=q?q:this.editor.graph;A=null!=A?A:0;var f=m?null:q.background; +f==mxConstants.NONE&&(f=null);null==f&&(f=d);null==f&&0==m&&(f="#ffffff");this.convertImages(q.getSvg(null,null,null,F,null,k,null,null,null,x),mxUtils.bind(this,function(c){var d=new Image;d.onload=mxUtils.bind(this,function(){try{var l=function(){mxClient.IS_SF?window.setTimeout(function(){m.drawImage(d,A/n,A/n);a(k)},0):(m.drawImage(d,A/n,A/n),a(k))},k=document.createElement("canvas"),p=parseInt(c.getAttribute("width")),t=parseInt(c.getAttribute("height"));n=null!=n?n:1;null!=b&&(n=g?Math.min(1, +Math.min(3*b/(4*t),b/p)):b/p);p=Math.ceil(n*p)+2*A;t=Math.ceil(n*t)+2*A;k.setAttribute("width",p);k.setAttribute("height",t);var m=k.getContext("2d");null!=f&&(m.beginPath(),m.rect(0,0,p,t),m.fillStyle=f,m.fill());m.scale(n,n);if(D){var x=q.view,B=btoa(unescape(encodeURIComponent(x.createSvgGrid(x.gridColor)))),B="data:image/svg+xml;base64,"+B,u=q.gridSize*x.gridSteps*n,v=q.getGraphBounds(),y=v.x*n,z=v.y*n,E=new Image;E.src=B;E.onload=function(){for(var a=-Math.round(u-mxUtils.mod(x.translate.x*n- +y,u)),b=-Math.round(u-mxUtils.mod(x.translate.y*n-z,u));a<p;a+=u)for(var c=b;c<t;c+=u)m.drawImage(E,a/n,c/n);l()}}else l()}catch(ba){null!=e&&e(ba)}});d.onerror=function(a){null!=e&&e(a)};try{x&&this.editor.graph.addSvgShadow(c);var l=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(q,c,!0,mxUtils.bind(this, function(){d.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(l)}catch(K){null!=e&&e(K)}}),c,B)}catch(J){null!=e&&e(J)}};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(d){if(null!=d){var f="http://"==d.substring(0,7)||"https://"==d.substring(0,8);f&&!navigator.onLine?d=c.svgBrokenImage.src:!f||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.editor.isCorsEnabledForUrl(d)?"chrome-extension://"== d.substring(0,19)||mxClient.IS_CHROMEAPP||(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,d){null==d&&(d=this.createImageUrlConverter());var f=0,l=c||{};c=mxUtils.bind(this,function(c,e){for(var g=a.getElementsByTagName(c),k=0;k<g.length;k++)mxUtils.bind(this,function(c){try{if(null!=c){var g=d.convert(c.getAttribute(e));if(null!=g&&"data:"!=g.substring(0,5)){var k=l[g];null==k?(f++,this.convertImageToDataUri(g, -function(d){null!=d&&(l[g]=d,c.setAttribute(e,d));f--;0==f&&b(a)})):c.setAttribute(e,k)}else null!=g&&c.setAttribute(e,g)}}catch(E){}})(g[k])});c("image","xlink:href");c("img","src");0==f&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,g,k){try{var f=!k&&(d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a));e=null!=e?e:!0;var l=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var d=a.getText(); +function(d){null!=d&&(l[g]=d,c.setAttribute(e,d));f--;0==f&&b(a)})):c.setAttribute(e,k)}else null!=g&&c.setAttribute(e,g)}}catch(F){}})(g[k])});c("image","xlink:href");c("img","src");0==f&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,d,e,g,k){try{var f=!k&&(d||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a));e=null!=e?e:!0;var l=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var d=a.getText(); if(f){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var d=Array(a.length),l=0;l<a.length;l++)d[l]=String.fromCharCode(a[l]);d=d.join("")}g=null!=g?g:"data:image/png;base64,";d=g+this.base64Encode(d)}b(d)}}else null!=c&&c({message:mxResources.get("error")+" "+a.getStatus()},a)}),function(a){null!=c&&c({message:mxResources.get("error")+" "+a.getStatus()})},f,this.timeout,function(){e&& null!=c&&c({code:App.ERROR_TIMEOUT,retry:l})})});l()}catch(x){null!=c&&c(x)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){try{var c=!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b(this.svgBrokenImage.src)}),this.timeout);if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){window.clearTimeout(d);c&&b(this.createSvgDataUri(a.getText()))}),function(){window.clearTimeout(d); c&&b(this.svgBrokenImage.src)});else{var f=new Image,e=this;this.crossOriginImages&&(f.crossOrigin="anonymous");f.onload=function(){window.clearTimeout(d);if(c)try{var a=document.createElement("canvas"),l=a.getContext("2d");a.height=f.height;a.width=f.width;l.drawImage(f,0,0);b(a.toDataURL())}catch(C){b(e.svgBrokenImage.src)}};f.onerror=function(){window.clearTimeout(d);c&&b(e.svgBrokenImage.src)};f.src=a}}catch(z){b(this.svgBrokenImage.src)}};EditorUi.prototype.importXml=function(a,b,c,d,e){b=null!= @@ -8488,7 +8488,7 @@ b){for(var c=0;c<b.length;c++)this.updatePageLinksForCell(a,b[c].root)};EditorUi 0;g<d.model.getChildCount(b);g++)this.updatePageLinksForCell(a,d.model.getChildAt(b,g))};EditorUi.prototype.updatePageLink=function(a,b){if("data:page/id,"==b.substring(0,13)){var c=a[b.substring(b.indexOf(",")+1)];b=null!=c?"data:page/id,"+c:null}else if("data:action/json,"==b.substring(0,17))try{var d=JSON.parse(b.substring(17));if(null!=d.actions){for(var f=0;f<d.actions.length;f++){var e=d.actions[f];null!=e.open&&"data:page/id,"==e.open.substring(0,13)&&(c=a[e.open.substring(e.open.indexOf(",")+ 1)],null!=c?e.open="data:page/id,"+c:delete e.open)}b="data:action/json,"+JSON.stringify(d)}}catch(z){}return b};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};EditorUi.prototype.importVisio=function(a,b,c,d){d=null!=d?d:a.name;c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var f=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var f=this.isRemoteVisioFormat(d);try{var e="UNKNOWN-VISIO", l=d.lastIndexOf(".");0<=l&&l<d.length&&(e=d.substring(l+1).toUpperCase());EditorUi.logEvent({category:e+"-MS-IMPORT-FILE",action:"filename_"+d,label:f?"remote":"local"})}catch(x){}if(f)if(null!=VSD_CONVERT_URL){f=new FormData;f.append("file1",a,d);var g=new XMLHttpRequest;g.open("POST",VSD_CONVERT_URL);g.responseType="blob";this.addRemoteServiceSecurityCheck(g);g.onreadystatechange=mxUtils.bind(this,function(){if(4==g.readyState)if(200<=g.status&&299>=g.status)try{var a=g.response;if("text/xml"== -a.type){var f=new FileReader;f.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(A){c({message:mxResources.get("errorLoadingFile")})}});f.readAsText(a)}else this.doImportVisio(a,b,c,d)}catch(F){c(F)}else c({})});g.send(f)}else c({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else try{this.doImportVisio(a,b,c,d)}catch(x){c(x)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}); +a.type){var f=new FileReader;f.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(A){c({message:mxResources.get("errorLoadingFile")})}});f.readAsText(a)}else this.doImportVisio(a,b,c,d)}catch(E){c(E)}else c({})});g.send(f)}else c({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else try{this.doImportVisio(a,b,c,d)}catch(x){c(x)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}); this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?f():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",f))};EditorUi.prototype.importGraphML=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(a,b,c)}catch(v){c(v)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions|| this.isOffline(!0)?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()||this.handleError({message:mxResources.get("unknownError")})}catch(l){this.handleError(l)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport|| this.loadingExtensions||this.isOffline(!0)?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,b,c){var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter){try{EditorUi.logEvent({category:"LUCIDCHART-IMPORT-FILE",action:"size_"+a.length})}catch(v){}try{b(LucidImporter.importState(JSON.parse(a)))}catch(v){c(v)}}else c({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!== @@ -8513,17 +8513,17 @@ p,mxUtils.bind(this,function(){l=this.insertTextAt(this.validateFileData(a),c,d, 3)<<4);b+="==";break}e=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(e&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2);b+="=";break}g=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f& 3)<<4|(e&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2|(g&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,d,e,g,k,n,m,x,B,q){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;x=null!=x?x:this.maxImageBytes;var f=null!=b&&null!=c,l=!0,p=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var t=B||this.resampleThreshold,u=0;u<a.length;u++)if("image/"==a[u].type.substring(0, 6)&&a[u].size>t){p=!0;break}var v=mxUtils.bind(this,function(){var p=this.editor.graph,m=p.gridSize;e=null!=e?e:mxUtils.bind(this,function(a,b,c,d,e,l,g,k,p){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,g)),null):this.importFile(a,b,c,d,e,l,g,k,p,f,q)});g=null!=g?g:mxUtils.bind(this,function(a){p.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var t=a.length,u=t,A=[],v=mxUtils.bind(this,function(a, -b){A[a]=b;if(0==--u){this.spinner.stop();if(null!=n)n(A);else{var c=[];p.getModel().beginUpdate();try{for(var d=0;d<A.length;d++){var f=A[d]();null!=f&&(c=c.concat(f))}}finally{p.getModel().endUpdate()}}g(c)}}),F=0;F<t;F++)mxUtils.bind(this,function(f){var g=a[f];if(null!=g){var n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==k||k(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var n=a.target.result,t=n.indexOf(","),u=decodeURIComponent(escape(atob(n.substring(t+ -1)))),A=mxUtils.parseXml(u),u=A.getElementsByTagName("svg");if(0<u.length){var u=u[0],F=q?null:u.getAttribute("content");null!=F&&"<"!=F.charAt(0)&&"%"!=F.charAt(0)&&(F=unescape(window.atob?atob(F):Base64.decode(F,!0)));null!=F&&"%"==F.charAt(0)&&(F=decodeURIComponent(F));null==F||"<mxfile "!==F.substring(0,8)&&"<mxGraphModel "!==F.substring(0,14)?v(f,mxUtils.bind(this,function(){try{if(n.substring(0,t+1),null!=A){var a=A.getElementsByTagName("svg");if(0<a.length){var l=a[0],k=l.getAttribute("width"), -x=l.getAttribute("height"),k=null!=k&&"%"!=k.charAt(k.length-1)?parseFloat(k):NaN,x=null!=x&&"%"!=x.charAt(x.length-1)?parseFloat(x):NaN,B=l.getAttribute("viewBox");if(null==B||0==B.length)l.setAttribute("viewBox","0 0 "+k+" "+x);else if(isNaN(k)||isNaN(x)){var q=B.split(" ");3<q.length&&(k=parseFloat(q[2]),x=parseFloat(q[3]))}n=this.createSvgDataUri(mxUtils.getXml(l));var u=Math.min(1,Math.min(d/Math.max(1,k)),d/Math.max(1,x)),v=e(n,g.type,b+f*m,c+f*m,Math.max(1,Math.round(k*u)),Math.max(1,Math.round(x* -u)),g.name);if(isNaN(k)||isNaN(x)){var F=new Image;F.onload=mxUtils.bind(this,function(){k=Math.max(1,F.width);x=Math.max(1,F.height);v[0].geometry.width=k;v[0].geometry.height=x;l.setAttribute("viewBox","0 0 "+k+" "+x);n=this.createSvgDataUri(mxUtils.getXml(l));var a=n.indexOf(";");0<a&&(n=n.substring(0,a)+n.substring(n.indexOf(",",a+1)));p.setCellStyles("image",n,[v[0]])});F.src=this.createSvgDataUri(mxUtils.getXml(l))}return v}}}catch(fa){}return null})):v(f,mxUtils.bind(this,function(){return e(F, +b){A[a]=b;if(0==--u){this.spinner.stop();if(null!=n)n(A);else{var c=[];p.getModel().beginUpdate();try{for(var d=0;d<A.length;d++){var f=A[d]();null!=f&&(c=c.concat(f))}}finally{p.getModel().endUpdate()}}g(c)}}),E=0;E<t;E++)mxUtils.bind(this,function(f){var g=a[f];if(null!=g){var n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==k||k(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var n=a.target.result,t=n.indexOf(","),u=decodeURIComponent(escape(atob(n.substring(t+ +1)))),A=mxUtils.parseXml(u),u=A.getElementsByTagName("svg");if(0<u.length){var u=u[0],E=q?null:u.getAttribute("content");null!=E&&"<"!=E.charAt(0)&&"%"!=E.charAt(0)&&(E=unescape(window.atob?atob(E):Base64.decode(E,!0)));null!=E&&"%"==E.charAt(0)&&(E=decodeURIComponent(E));null==E||"<mxfile "!==E.substring(0,8)&&"<mxGraphModel "!==E.substring(0,14)?v(f,mxUtils.bind(this,function(){try{if(n.substring(0,t+1),null!=A){var a=A.getElementsByTagName("svg");if(0<a.length){var l=a[0],k=l.getAttribute("width"), +x=l.getAttribute("height"),k=null!=k&&"%"!=k.charAt(k.length-1)?parseFloat(k):NaN,x=null!=x&&"%"!=x.charAt(x.length-1)?parseFloat(x):NaN,B=l.getAttribute("viewBox");if(null==B||0==B.length)l.setAttribute("viewBox","0 0 "+k+" "+x);else if(isNaN(k)||isNaN(x)){var u=B.split(" ");3<u.length&&(k=parseFloat(u[2]),x=parseFloat(u[3]))}n=this.createSvgDataUri(mxUtils.getXml(l));var q=Math.min(1,Math.min(d/Math.max(1,k)),d/Math.max(1,x)),v=e(n,g.type,b+f*m,c+f*m,Math.max(1,Math.round(k*q)),Math.max(1,Math.round(x* +q)),g.name);if(isNaN(k)||isNaN(x)){var E=new Image;E.onload=mxUtils.bind(this,function(){k=Math.max(1,E.width);x=Math.max(1,E.height);v[0].geometry.width=k;v[0].geometry.height=x;l.setAttribute("viewBox","0 0 "+k+" "+x);n=this.createSvgDataUri(mxUtils.getXml(l));var a=n.indexOf(";");0<a&&(n=n.substring(0,a)+n.substring(n.indexOf(",",a+1)));p.setCellStyles("image",n,[v[0]])});E.src=this.createSvgDataUri(mxUtils.getXml(l))}return v}}}catch(fa){}return null})):v(f,mxUtils.bind(this,function(){return e(E, "text/xml",b+f*m,c+f*m,0,0,g.name)}))}else v(f,mxUtils.bind(this,function(){return null}))}else{u=!1;if("image/png"==g.type){var z=q?null:this.extractGraphModelFromPng(a.target.result);if(null!=z&&0<z.length){var y=new Image;y.src=a.target.result;v(f,mxUtils.bind(this,function(){return e(z,"text/xml",b+f*m,c+f*m,y.width,y.height,g.name)}));u=!0}}u||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"), mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(k){this.resizeImage(k,a.target.result,mxUtils.bind(this,function(k,p,n){v(f,mxUtils.bind(this,function(){if(null!=k&&k.length<x){var t=l&&this.isResampleImage(a.target.result,B)?Math.min(1,Math.min(d/p,d/n)):1;return e(k,g.type,b+f*m,c+f*m,Math.round(p*t),Math.round(n*t),g.name)}this.handleError({message:mxResources.get("imageTooBig")}); -return null}))}),l,d,B)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,g.type,b+f*m,c+f*m,240,160,g.name,function(a){v(f,function(){return a})},g)});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||/(\.vs(x|sx?))($|\?)/i.test(g.name)?e(null,g.type,b+f*m,c+f*m,240,160,g.name,function(a){v(f,function(){return a})},g):"image"==g.type.substring(0,5)?n.readAsDataURL(g):n.readAsText(g)}})(F)});if(p){p=[];for(u=0;u<a.length;u++)p.push(a[u]); +return null}))}),l,d,B)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else e(a.target.result,g.type,b+f*m,c+f*m,240,160,g.name,function(a){v(f,function(){return a})},g)});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||/(\.vs(x|sx?))($|\?)/i.test(g.name)?e(null,g.type,b+f*m,c+f*m,240,160,g.name,function(a){v(f,function(){return a})},g):"image"==g.type.substring(0,5)?n.readAsDataURL(g):n.readAsText(g)}})(E)});if(p){p=[];for(u=0;u<a.length;u++)p.push(a[u]); a=p;this.confirmImageResize(function(a){l=a;v()},m)}else v()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,f=function(d,f){if(d||b)mxSettings.setResizeImages(d?f:null),mxSettings.save();c();a(f)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){f(a,!0)},function(a){f(a, !1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):f(!1,d)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var f=new XMLHttpRequest;f.open("POST",OPEN_URL);f.onreadystatechange=function(){b(f)}; f.send(d);try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+a.size})}catch(t){}};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,d,e,g){e=null!=e?e:this.maxImageSize;var f=Math.max(1,a.width),l=Math.max(1,a.height);if(d&&this.isResampleImage(b,g))try{var k=Math.max(f/e,l/e);if(1<k){var p=Math.round(f/k),n=Math.round(l/k),m=document.createElement("canvas");m.width=p;m.height=n;m.getContext("2d").drawImage(a, -0,0,p,n);var t=m.toDataURL();if(t.length<b.length){var q=document.createElement("canvas");q.width=p;q.height=n;var u=q.toDataURL();t!==u&&(b=t,f=p,l=n)}}}catch(H){}c(b,f,l)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var g=d,e=0;8>e;e++)g=1==(g&1)?3988292384^g>>>1:g>>>1,EditorUi.prototype.crcTable[d]=g;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var f=0;f<d;f++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(c+f))&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable= +0,0,p,n);var t=m.toDataURL();if(t.length<b.length){var u=document.createElement("canvas");u.width=p;u.height=n;var q=u.toDataURL();t!==q&&(b=t,f=p,l=n)}}}catch(H){}c(b,f,l)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var g=d,e=0;8>e;e++)g=1==(g&1)?3988292384^g>>>1:g>>>1,EditorUi.prototype.crcTable[d]=g;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var f=0;f<d;f++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(c+f))&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable= this.crcTable||this.createCrcTable();for(var b=-1,c=0;c<a.length;c++)b=b>>>8^this.crcTable[(b^a.charCodeAt(c))&255];return(b^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function f(a,b){var c=k;k+=b;return a.substring(c,k)}function l(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a, !0);var k=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(f(a,4),"IHDR"!=f(a,4))null!=e&&e();else{f(a,17);e=a.substring(0,k);do{var p=l(a);if("IDAT"==f(a,4)){e=a.substring(0,k-8);"pHYs"==b&&"dpi"==c?(c=Math.round(d/.0254),c=g(c)+g(c)+String.fromCharCode(1)):c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d;d=4294967295;d=this.updateCRC(d,b,0,4);d=this.updateCRC(d,c,0,c.length);e+=g(c.length)+b+c+g(d^4294967295);e+=a.substring(k-8, a.length);break}e+=a.substring(k-8,k-4+p);f(a,p);f(a,4)}while(p);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){return Editor.extractGraphModelFromPng(a)};EditorUi.prototype.loadImage=function(a,b,c){try{var d=new Image;d.onload=function(){b(d)};null!=c&&(d.onerror=c);d.src=a}catch(v){if(null!=c)c(v);else throw v;}};var k=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&& @@ -8541,8 +8541,8 @@ mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getD "text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));"undefined"!==typeof window.mxSettings&&(x=this.editor.graph.view,x.setUnit(mxSettings.getUnit()),x.addListener("unitChanged",function(a,b){mxSettings.setUnit(b.getProperty("unit"));mxSettings.save()}),this.ruler=!this.canvasSupported||9== document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,x.unit),this.refresh());if("1"==urlParams.styledev){x=document.getElementById("geFooter");null!=x&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility= "hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),x.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c|| -"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var B=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:B.apply(this,arguments)}}x=document.getElementById("geInfo");null!=x&&x.parentNode.removeChild(x);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var F=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=F&&(F.parentNode.removeChild(F), -F=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==F&&(!mxClient.IS_IE||10<document.documentMode)&&(F=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=F&&(F.parentNode.removeChild(F),F=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)), +"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var B=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:B.apply(this,arguments)}}x=document.getElementById("geInfo");null!=x&&x.parentNode.removeChild(x);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var E=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=E&&(E.parentNode.removeChild(E), +E=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==E&&(!mxClient.IS_IE||10<document.documentMode)&&(E=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=E&&(E.parentNode.removeChild(E),E=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)), d=b.view.translate,f=b.view.scale,e=c.x/f-d.x,g=c.y/f-d.y;mxEvent.isAltDown(a)&&(g=e=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,e,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var l=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=c)b.setSelectionCells(this.importXml(c,e,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types, "text/html")){var k=a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=k;var p=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?(k=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(p=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(k=c[0].getAttribute("href")));var n=!0,m=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(k,e,g,!0,p,null,n))});p&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){n= a;m()},mxEvent.isControlDown(a)):m()}else null!=l&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)?this.loadImage(decodeURIComponent(l),mxUtils.bind(this,function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",e,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+l+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(l, @@ -8559,11 +8559,11 @@ function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClie "keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(a,b){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget()); mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor("dark"==uiTheme);this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){console.log("gridColorChanged",this.editor.graph.view.gridColor);mxSettings.setGridColor(this.editor.graph.view.gridColor,"dark"==uiTheme); mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(), -mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),f=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(f));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=f,c.pasteCounter=0);a.focus(); -document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b,c){if(!mxEvent.isConsumed(a)){var d=b;c&&null!=a.clipboardData&&(d=document.createElement("div"),d.innerHTML=a.clipboardData.getData("text/html"));var f=d.getElementsByTagName("span");if(null!=f&&0<f.length&&"application/vnd.lucid.chart.objects"===f[0].getAttribute("data-lucid-type")){var e=f[0].getAttribute("data-lucid-content");null!=e&&0<e.length&&(this.convertLucidChart(e,mxUtils.bind(this,function(a){var b= -this.editor.graph;b.lastPasteXml==a?b.pasteCounter++:(b.lastPasteXml=a,b.pasteCounter=0);var c=b.pasteCounter*b.gridSize;b.setSelectionCells(this.importXml(a,c,c));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,function(a){this.handleError(a)})),mxEvent.consume(a))}else{var e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(d):d.textContent),g=!1;try{var l=e.lastIndexOf("%3E");0<=l&&l<e.length-3&&(e=e.substring(0,l+3))}catch(B){}try{var f=d.getElementsByTagName("span"), -k=null!=f&&0<f.length?mxUtils.trim(decodeURIComponent(f[0].textContent)):decodeURIComponent(e);this.isCompatibleString(k)&&(g=!0,e=k)}catch(B){}if(null!=e&&0<e.length){var p=this.editor.graph;p.lastPasteXml==e?p.pasteCounter++:(p.lastPasteXml=e,p.pasteCounter=0);c=p.pasteCounter*p.gridSize;g||this.isCompatibleString(e)?p.setSelectionCells(this.importXml(e,c,c)):(g=p.getInsertPoint(),p.isMouseInsertPoint()&&(c=0,p.lastPasteXml==e&&0<p.pasteCounter&&p.pasteCounter--),p.setSelectionCells(this.insertTextAt(e, -g.x+c,g.y+c,!0)));if(!p.isSelectionEmpty()){p.scrollCellToVisible(p.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(p.view.getState(p.getSelectionCell()));try{mxEvent.consume(a)}catch(B){}}}else c||(p.lastPasteXml=null,p.pasteCounter=0)}}b.innerHTML=" "};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}), +mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),f=mxUtils.getXml(c.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(f));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=f,c.pasteCounter=0);a.focus();document.execCommand("selectAll", +!1,null)}};EditorUi.prototype.pasteCells=function(a,b,c){if(!mxEvent.isConsumed(a)){var d=b;c&&null!=a.clipboardData&&(d=document.createElement("div"),d.innerHTML=a.clipboardData.getData("text/html"));var f=d.getElementsByTagName("span");if(null!=f&&0<f.length&&"application/vnd.lucid.chart.objects"===f[0].getAttribute("data-lucid-type")){var e=f[0].getAttribute("data-lucid-content");null!=e&&0<e.length&&(this.convertLucidChart(e,mxUtils.bind(this,function(a){var b=this.editor.graph;b.lastPasteXml== +a?b.pasteCounter++:(b.lastPasteXml=a,b.pasteCounter=0);var c=b.pasteCounter*b.gridSize;b.setSelectionCells(this.importXml(a,c,c));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,function(a){this.handleError(a)})),mxEvent.consume(a))}else{var e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(d):d.textContent),g=!1;try{var l=e.lastIndexOf("%3E");0<=l&&l<e.length-3&&(e=e.substring(0,l+3))}catch(x){}try{var f=d.getElementsByTagName("span"),k=null!=f&&0< +f.length?mxUtils.trim(decodeURIComponent(f[0].textContent)):decodeURIComponent(e);this.isCompatibleString(k)&&(g=!0,e=k)}catch(x){}d=this.editor.graph;if(null!=e&&0<e.length){if(d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0),c=d.pasteCounter*d.gridSize,g||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(g=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,g.x+c, +g.y+c,!0))),!d.isSelectionEmpty()){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(x){}}}else c||(d.lastPasteXml=null,d.pasteCounter=0)}}b.innerHTML=" "};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}), mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed? this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")? d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this, @@ -8608,13 +8608,13 @@ a.style.paddingTop="atlas"==uiTheme?"2px":"0px";a.style.paddingLeft="8px";a.styl " ("+Editor.ctrlKey+"+S)"),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()})),a.appendChild(b),"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b)));b=document.createElement("a"); mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.className="geBigButton geBigStandardButton";b.style.marginLeft="6px";b.style.marginRight="20px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog= new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://about.draw.io/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.executeLayoutList=function(a,b){for(var c=this.editor.graph,d=c.getSelectionCells(),f=0;f<a.length;f++){var e=new window[a[f].layout](c); -if(null!=a[f].config)for(var g in a[f].config)e[g]=a[f].config[g];this.executeLayout(function(){e.execute(c.getDefaultParent(),0==d.length?null:d)},f==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],f=[],e={};if(0<c.length){var g={},k=null,l=null,n=null,m=null,q=null,A=null,E=null,D=null,H="",J="auto",I="auto",G=null,K=null,Q=40,N=40,Y=100,T=0,L=this.editor.graph;L.getGraphBounds();for(var W=function(){null!=b?b(la):(L.setSelectionCells(la),L.scrollCellToVisible(L.getSelectionCell()))}, +if(null!=a[f].config)for(var g in a[f].config)e[g]=a[f].config[g];this.executeLayout(function(){e.execute(c.getDefaultParent(),0==d.length?null:d)},f==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],f=[],e={};if(0<c.length){var g={},k=null,l=null,n=null,m=null,q=null,A=null,F=null,D=null,H="",J="auto",I="auto",G=null,K=null,Q=40,N=40,Y=100,T=0,L=this.editor.graph;L.getGraphBounds();for(var W=function(){null!=b?b(la):(L.setSelectionCells(la),L.scrollCellToVisible(L.getSelectionCell()))}, aa=L.getFreeInsertPoint(),ga=aa.x,ha=aa.y,aa=ha,ca=null,V="auto",D=null,ba=[],R=null,Z=null,X=0;X<c.length&&"#"==c[X].charAt(0);){a=c[X];for(X++;X<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[X].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[X].substring(1)),X++;if("#"!=a.charAt(1)){var ea=a.indexOf(":");if(0<ea){var P=mxUtils.trim(a.substring(1,ea)),M=mxUtils.trim(a.substring(ea+1));"label"==P?ca=L.sanitizeHtml(M):"labelname"==P&&0<M.length&&"-"!=M?m=M:"labels"==P&&0<M.length&&"-"!=M?q=JSON.parse(M): -"style"==P?k=M:"parentstyle"==P?A=M:"stylename"==P&&0<M.length&&"-"!=M?n=M:"styles"==P&&0<M.length&&"-"!=M?l=JSON.parse(M):"identity"==P&&0<M.length&&"-"!=M?E=M:"parent"==P&&0<M.length&&"-"!=M?D=M:"namespace"==P&&0<M.length&&"-"!=M?H=M:"width"==P?J=M:"height"==P?I=M:"left"==P&&0<M.length?G=M:"top"==P&&0<M.length?K=M:"ignore"==P?Z=M.split(","):"connect"==P?ba.push(JSON.parse(M)):"link"==P?R=M:"padding"==P?T=parseFloat(M):"edgespacing"==P?Q=parseFloat(M):"nodespacing"==P?N=parseFloat(M):"levelspacing"== -P?Y=parseFloat(M):"layout"==P&&(V=M)}}}if(null==c[X])throw Error(mxResources.get("invalidOrMissingFile"));var da=this.editor.csvToArray(c[X]),P=ea=null;if(null!=E||null!=D)for(var S=0;S<da.length;S++)E==da[S]&&(ea=S),D==da[S]&&(P=S);null==ca&&(ca="%"+da[0]+"%");if(null!=ba)for(var U=0;U<ba.length;U++)null==g[ba[U].to]&&(g[ba[U].to]={});L.model.beginUpdate();try{for(S=X+1;S<c.length;S++){var ja=this.editor.csvToArray(c[S]);if(null==ja){var ka=40<c[S].length?c[S].substring(0,40)+"...":c[S];throw Error(S+ -" ("+ka+") "+mxResources.get("containsValidationErrors"));}if(ja.length==da.length){var O=null,ma=null!=ea?H+ja[ea]:null;null!=ma&&(O=L.model.getCell(ma));var E=null!=O,fa=new mxCell(ca,new mxGeometry(ga,aa,0,0),k||"whiteSpace=wrap;html=1;");fa.vertex=!0;fa.id=ma;for(var ia=0;ia<ja.length;ia++)L.setAttributeForCell(fa,da[ia],ja[ia]);if(null!=m&&null!=q){var ua=q[fa.getAttribute(m)];null!=ua&&L.labelChanged(fa,ua)}if(null!=n&&null!=l){var va=l[fa.getAttribute(n)];null!=va&&(fa.style=va)}L.setAttributeForCell(fa, -"placeholders","1");fa.style=L.replacePlaceholders(fa,fa.style);E&&(L.model.setGeometry(O,fa.geometry),L.model.setStyle(O,fa.style),0>mxUtils.indexOf(f,O)&&f.push(O));O=fa;if(!E)for(U=0;U<ba.length;U++)g[ba[U].to][O.getAttribute(ba[U].to)]=O;null!=R&&"link"!=R&&(L.setLinkForCell(O,O.getAttribute(R)),L.setAttributeForCell(O,R,null));L.fireEvent(new mxEventObject("cellsInserted","cells",[O]));var wa=this.editor.graph.getPreferredSizeForCell(O);O.vertex&&(null!=G&&null!=O.getAttribute(G)&&(O.geometry.x= -ga+parseFloat(O.getAttribute(G))),null!=K&&null!=O.getAttribute(K)&&(O.geometry.y=ha+parseFloat(O.getAttribute(K))),"@"==J.charAt(0)&&null!=O.getAttribute(J.substring(1))?O.geometry.width=parseFloat(O.getAttribute(J.substring(1))):O.geometry.width="auto"==J?wa.width+T:parseFloat(J),"@"==I.charAt(0)&&null!=O.getAttribute(I.substring(1))?O.geometry.height=parseFloat(O.getAttribute(I.substring(1))):O.geometry.height="auto"==I?wa.height+T:parseFloat(I),aa+=O.geometry.height+N);E?(null==e[ma]&&(e[ma]= +"style"==P?k=M:"parentstyle"==P?A=M:"stylename"==P&&0<M.length&&"-"!=M?n=M:"styles"==P&&0<M.length&&"-"!=M?l=JSON.parse(M):"identity"==P&&0<M.length&&"-"!=M?F=M:"parent"==P&&0<M.length&&"-"!=M?D=M:"namespace"==P&&0<M.length&&"-"!=M?H=M:"width"==P?J=M:"height"==P?I=M:"left"==P&&0<M.length?G=M:"top"==P&&0<M.length?K=M:"ignore"==P?Z=M.split(","):"connect"==P?ba.push(JSON.parse(M)):"link"==P?R=M:"padding"==P?T=parseFloat(M):"edgespacing"==P?Q=parseFloat(M):"nodespacing"==P?N=parseFloat(M):"levelspacing"== +P?Y=parseFloat(M):"layout"==P&&(V=M)}}}if(null==c[X])throw Error(mxResources.get("invalidOrMissingFile"));var da=this.editor.csvToArray(c[X]),P=ea=null;if(null!=F||null!=D)for(var S=0;S<da.length;S++)F==da[S]&&(ea=S),D==da[S]&&(P=S);null==ca&&(ca="%"+da[0]+"%");if(null!=ba)for(var U=0;U<ba.length;U++)null==g[ba[U].to]&&(g[ba[U].to]={});L.model.beginUpdate();try{for(S=X+1;S<c.length;S++){var ja=this.editor.csvToArray(c[S]);if(null==ja){var ka=40<c[S].length?c[S].substring(0,40)+"...":c[S];throw Error(S+ +" ("+ka+") "+mxResources.get("containsValidationErrors"));}if(ja.length==da.length){var O=null,ma=null!=ea?H+ja[ea]:null;null!=ma&&(O=L.model.getCell(ma));var F=null!=O,fa=new mxCell(ca,new mxGeometry(ga,aa,0,0),k||"whiteSpace=wrap;html=1;");fa.vertex=!0;fa.id=ma;for(var ia=0;ia<ja.length;ia++)L.setAttributeForCell(fa,da[ia],ja[ia]);if(null!=m&&null!=q){var ua=q[fa.getAttribute(m)];null!=ua&&L.labelChanged(fa,ua)}if(null!=n&&null!=l){var va=l[fa.getAttribute(n)];null!=va&&(fa.style=va)}L.setAttributeForCell(fa, +"placeholders","1");fa.style=L.replacePlaceholders(fa,fa.style);F&&(L.model.setGeometry(O,fa.geometry),L.model.setStyle(O,fa.style),0>mxUtils.indexOf(f,O)&&f.push(O));O=fa;if(!F)for(U=0;U<ba.length;U++)g[ba[U].to][O.getAttribute(ba[U].to)]=O;null!=R&&"link"!=R&&(L.setLinkForCell(O,O.getAttribute(R)),L.setAttributeForCell(O,R,null));L.fireEvent(new mxEventObject("cellsInserted","cells",[O]));var wa=this.editor.graph.getPreferredSizeForCell(O);O.vertex&&(null!=G&&null!=O.getAttribute(G)&&(O.geometry.x= +ga+parseFloat(O.getAttribute(G))),null!=K&&null!=O.getAttribute(K)&&(O.geometry.y=ha+parseFloat(O.getAttribute(K))),"@"==J.charAt(0)&&null!=O.getAttribute(J.substring(1))?O.geometry.width=parseFloat(O.getAttribute(J.substring(1))):O.geometry.width="auto"==J?wa.width+T:parseFloat(J),"@"==I.charAt(0)&&null!=O.getAttribute(I.substring(1))?O.geometry.height=parseFloat(O.getAttribute(I.substring(1))):O.geometry.height="auto"==I?wa.height+T:parseFloat(I),aa+=O.geometry.height+N);F?(null==e[ma]&&(e[ma]= []),e[ma].push(O)):(D=null!=P?L.model.getCell(H+ja[P]):null,d.push(O),null!=D?(D.style=L.replacePlaceholders(D,A),L.addCell(O,D)):f.push(L.addCell(O)))}}for(var na=f.slice(),la=f.slice(),U=0;U<ba.length;U++)for(var xa=ba[U],S=0;S<f.length;S++){var O=f[S],ya=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d){L.setAttributeForCell(b,c.from,null);for(var d=d.split(","),f=0;f<d.length;f++){var e=g[c.to][d[f]];if(null!=e){var k=c.label;null!=c.fromlabel&&(k=(b.getAttribute(c.fromlabel)|| "")+(k||""));null!=c.tolabel&&(k=(k||"")+(e.getAttribute(c.tolabel)||""));la.push(L.insertEdge(null,null,k||"",c.invert?e:a,c.invert?a:e,c.style||L.createCurrentEdgeStyle()));mxUtils.remove(c.invert?a:e,na)}}}});ya(O,O,xa);if(null!=e[O.id])for(ia=0;ia<e[O.id].length;ia++)ya(O,e[O.id][ia],xa)}if(null!=Z)for(S=0;S<d.length;S++)for(O=d[S],ia=0;ia<Z.length;ia++)L.setAttributeForCell(O,mxUtils.trim(Z[ia]),null);if(0<f.length){var oa=new mxParallelEdgeLayout(L);oa.spacing=Q;var ta=function(){0<oa.spacing&& oa.execute(L.getDefaultParent());for(var a=0;a<f.length;a++){var b=L.getCellGeometry(f[a]);b.x=Math.round(L.snap(b.x));b.y=Math.round(L.snap(b.y));"auto"==J&&(b.width=Math.round(L.snap(b.width)));"auto"==I&&(b.height=Math.round(L.snap(b.height)))}};if("["==V.charAt(0)){var za=W;L.view.validate();this.executeLayoutList(JSON.parse(V),function(){ta();za()});W=null}else if("circle"==V){var ra=new mxCircleLayout(L);ra.resetEdges=!1;var Aa=ra.isVertexIgnored;ra.isVertexIgnored=function(a){return Aa.apply(this, @@ -8646,7 +8646,7 @@ var a=this.editor.graph,b="";if(null!=this.pages)for(var c=0;c<this.pages.length mxUtils.htmlEntities(a));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(d);var e=document.createElement("div");e.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";e.innerHTML='<div style="text-align:center;padding:8px;"><img src="/images/spin.gif"></div>';var f={};try{var g=mxSettings.getCustomLibraries();for(a=0;a<g.length;a++){var k=g[a];if("R"==k.substring(0,1)){var n=JSON.parse(decodeURIComponent(k.substring(1)));f[n[0]]={id:n[0], title:n[1],downloadUrl:n[2]}}}}catch(x){}this.remoteInvoke("getCustomLibraries",null,null,function(a){e.innerHTML="";if(0==a.length)e.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var c=0;c<a.length;c++){var d=a[c];f[d.id]&&(b[d.id]=d);var g=this.addCheckbox(e,d.title,f[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked?b[a.id]=a:delete b[a.id]})})(d,g)}},mxUtils.bind(this,function(a){e.innerHTML= "";var b=document.createElement("div");b.style.padding="8px";b.style.textAlign="center";mxUtils.write(b,mxResources.get("error")+": ");mxUtils.write(b,null!=a&&null!=a.message?a.message:mxResources.get("unknownError"));e.appendChild(b)}));c.appendChild(e);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==f[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this, -function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(E){this.handleError(E,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(b[c]));for(c in f)b[c]||this.closeLibrary(new RemoteLibrary(this,null,f[c]));0==a&&this.spinner.stop()}),null,null,"https://desk.draw.io/support/solutions/articles/16000092763");this.showDialog(c.container,340,375,!0,!0, +function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(F){this.handleError(F,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(b[c]));for(c in f)b[c]||this.closeLibrary(new RemoteLibrary(this,null,f[c]));0==a&&this.spinner.stop()}),null,null,"https://desk.draw.io/support/solutions/articles/16000092763");this.showDialog(c.container,340,375,!0,!0, null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(a){this.remoteWin=a;for(var b=0;b<this.remoteInvokeQueue.length;b++)a.postMessage(this.remoteInvokeQueue[b],"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(a){var b=a.msgMarkers,c=this.remoteInvokeCallbacks[b.callbackId];a.error? c.error&&c.error(a.error.errResp):c.callback&&c.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=function(a,b,c,d,e){var f=!0,g=window.setTimeout(mxUtils.bind(this,function(){f=!1;e({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),k=mxUtils.bind(this,function(){window.clearTimeout(g);f&&d.apply(this,arguments)});c=c||{};c.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:k,error:e}); a=JSON.stringify({event:"remoteInvoke",funtionName:a,functionArgs:b,msgMarkers:c});null!=this.remoteWin?this.remoteWin.postMessage(a,"*"):this.remoteInvokeQueue.push(a)};EditorUi.prototype.handleRemoteInvoke=function(a){var b=mxUtils.bind(this,function(b,c){var d={event:"remoteInvokeResponse",msgMarkers:a.msgMarkers};null!=c?d.error={errResp:c}:null!=b&&(d.resp=b);this.remoteWin.postMessage(JSON.stringify(d),"*")});try{var c=a.funtionName,d=this.remoteInvokableFns[c];if(null!=d&&"function"===typeof this[c]){var e= @@ -8655,25 +8655,25 @@ this.getCurrentFile();return null!=a?a.commentsRefreshNeeded():!0};EditorUi.prot a.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var a=this.getCurrentFile();return null!=a?a.canComment():!0};EditorUi.prototype.newComment=function(a,b){var c=this.getCurrentFile();return null!=c?c.newComment(a,b):new DrawioComment(this,null,a,Date.now(),Date.now(),!1,b)};EditorUi.prototype.isRevisionHistorySupported=function(){var a=this.getCurrentFile();return null!=a&&a.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(a,b){var c=this.getCurrentFile();null!= c&&c.getRevisions?c.getRevisions(a,b):b({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var a=this.getCurrentFile();return null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(a){a.setRequestHeader("Content-Language","da, mi, en, de-DE")}})(); var CommentsWindow=function(a,c,b,d,g,e){function k(){for(var a=C.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==C&&b++;x.style.display=0==b?"block":"none"}function m(a,b,c,d){function e(){b.removeChild(l);b.removeChild(n);g.style.display="block";f.style.display="block"}t={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),g=b.querySelector(".geCommentActionsList"),l=document.createElement("textarea");l.className= -"geCommentEditTxtArea";l.style.minHeight=f.offsetHeight+"px";l.value=a.content;b.insertBefore(l,f);var n=document.createElement("div");n.className="geCommentEditBtns";var p=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),k()):e();t=null});p.className="geCommentEditBtn";n.appendChild(p);var m=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=l.value;mxUtils.write(f,a.content);e();c(a);t=null});mxEvent.addListener(l,"keydown",mxUtils.bind(this, -function(a){mxEvent.isConsumed(a)||((mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a))&&13==a.keyCode?(m.click(),mxEvent.consume(a)):27==a.keyCode&&(p.click(),mxEvent.consume(a)))}));m.focus();m.className="geCommentEditBtn gePrimaryBtn";n.appendChild(m);b.insertBefore(n,f);g.style.display="none";f.style.display="none";l.focus()}function n(b,c){c.innerHTML="";var d=new Date(b.modifiedDate),e=a.timeSince(d);null==e&&(e=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo", +"geCommentEditTxtArea";l.style.minHeight=f.offsetHeight+"px";l.value=a.content;b.insertBefore(l,f);var n=document.createElement("div");n.className="geCommentEditBtns";var m=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),k()):e();t=null});m.className="geCommentEditBtn";n.appendChild(m);var p=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=l.value;mxUtils.write(f,a.content);e();c(a);t=null});mxEvent.addListener(l,"keydown",mxUtils.bind(this, +function(a){mxEvent.isConsumed(a)||((mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a))&&13==a.keyCode?(p.click(),mxEvent.consume(a)):27==a.keyCode&&(m.click(),mxEvent.consume(a)))}));p.focus();p.className="geCommentEditBtn gePrimaryBtn";n.appendChild(p);b.insertBefore(n,f);g.style.display="none";f.style.display="none";l.focus()}function n(b,c){c.innerHTML="";var d=new Date(b.modifiedDate),e=a.timeSince(d);null==e&&(e=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo", [e],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function q(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function f(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function l(a){a.style.border="";a.removeChild(a.busyImg)}function p(b,c,d,e,g){function B(a,c,d){var e=document.createElement("li");e.className="geCommentAction";var f=document.createElement("a");f.className= -"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});J.appendChild(e);d&&(e.style.display="none")}function F(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=y;a(b);return{pdiv:d,replies:c}}function G(c,d,g,k,n){function x(){q(A);b.addReply(u,function(a){u.id=a;b.replies.push(u);l(A);g&&g()},function(b){t();f(A);a.handleError(b,null, -null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},k,n)}function t(){m(u,A,function(a){x()},!0)}var B=F().pdiv,u=a.newComment(c,a.getCurrentUser());u.pCommentId=b.id;null==b.replies&&(b.replies=[]);var A=p(u,b.replies,B,e+1);d?t():x()}if(g||!b.isResolved){x.style.display="none";var y=document.createElement("div");y.className="geCommentContainer";y.setAttribute("data-commentId",b.id);y.style.marginLeft=20*e+5+"px";b.isResolved&&"dark"!=uiTheme&&(y.style.backgroundColor="ghostWhite"); -var z=document.createElement("div");z.className="geCommentHeader";var E=document.createElement("img");E.className="geCommentUserImg";E.src=b.user.pictureUrl||Editor.userImage;z.appendChild(E);E=document.createElement("div");E.className="geCommentHeaderTxt";z.appendChild(E);var D=document.createElement("div");D.className="geCommentUsername";mxUtils.write(D,b.user.displayName||"");E.appendChild(D);D=document.createElement("div");D.className="geCommentDate";D.setAttribute("data-commentId",b.id);n(b, -D);E.appendChild(D);y.appendChild(z);z=document.createElement("div");z.className="geCommentTxt";mxUtils.write(z,b.content||"");y.appendChild(z);z=document.createElement("div");z.className="geCommentActions";var J=document.createElement("ul");J.className="geCommentActionsList";z.appendChild(J);u||0!=e&&!v||B(mxResources.get("reply"),function(){G("",!0)},b.isResolved);E=a.getCurrentUser();null==E||E.id!=b.user.id||u||(B(mxResources.get("edit"),function(){function c(){m(b,y,function(){q(y);b.editComment(b.content, -function(){l(y)},function(b){f(y);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}c()},b.isResolved),B(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){q(y);b.deleteComment(function(){for(var a=F(b).replies,d=0;d<a.length;d++)C.removeChild(a[d]);for(d=0;d<c.length;d++)if(c[d]==b){c.splice(d,1);break}x.style.display=0==C.getElementsByTagName("div").length?"block":"none"},function(b){f(y);a.handleError(b,null,null, -null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));u||0!=e||B(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=a.target;c.innerHTML="";b.isResolved=!b.isResolved;mxUtils.write(c,b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var d=b.isResolved?"none":"",e=F(b).replies,f="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",g=0;g<e.length;g++){e[g].style.backgroundColor=f;for(var l=e[g].querySelectorAll(".geCommentAction"), +"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});J.appendChild(e);d&&(e.style.display="none")}function E(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=y;a(b);return{pdiv:d,replies:c}}function G(c,d,g,k,n){function x(){q(A);b.addReply(u,function(a){u.id=a;b.replies.push(u);l(A);g&&g()},function(b){t();f(A);a.handleError(b,null, +null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},k,n)}function t(){m(u,A,function(a){x()},!0)}var B=E().pdiv,u=a.newComment(c,a.getCurrentUser());u.pCommentId=b.id;null==b.replies&&(b.replies=[]);var A=p(u,b.replies,B,e+1);d?t():x()}if(g||!b.isResolved){x.style.display="none";var y=document.createElement("div");y.className="geCommentContainer";y.setAttribute("data-commentId",b.id);y.style.marginLeft=20*e+5+"px";b.isResolved&&"dark"!=uiTheme&&(y.style.backgroundColor="ghostWhite"); +var z=document.createElement("div");z.className="geCommentHeader";var F=document.createElement("img");F.className="geCommentUserImg";F.src=b.user.pictureUrl||Editor.userImage;z.appendChild(F);F=document.createElement("div");F.className="geCommentHeaderTxt";z.appendChild(F);var D=document.createElement("div");D.className="geCommentUsername";mxUtils.write(D,b.user.displayName||"");F.appendChild(D);D=document.createElement("div");D.className="geCommentDate";D.setAttribute("data-commentId",b.id);n(b, +D);F.appendChild(D);y.appendChild(z);z=document.createElement("div");z.className="geCommentTxt";mxUtils.write(z,b.content||"");y.appendChild(z);z=document.createElement("div");z.className="geCommentActions";var J=document.createElement("ul");J.className="geCommentActionsList";z.appendChild(J);u||0!=e&&!v||B(mxResources.get("reply"),function(){G("",!0)},b.isResolved);F=a.getCurrentUser();null==F||F.id!=b.user.id||u||(B(mxResources.get("edit"),function(){function c(){m(b,y,function(){q(y);b.editComment(b.content, +function(){l(y)},function(b){f(y);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}c()},b.isResolved),B(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){q(y);b.deleteComment(function(){for(var a=E(b).replies,d=0;d<a.length;d++)C.removeChild(a[d]);for(d=0;d<c.length;d++)if(c[d]==b){c.splice(d,1);break}x.style.display=0==C.getElementsByTagName("div").length?"block":"none"},function(b){f(y);a.handleError(b,null,null, +null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));u||0!=e||B(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=a.target;c.innerHTML="";b.isResolved=!b.isResolved;mxUtils.write(c,b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var d=b.isResolved?"none":"",e=E(b).replies,f="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",g=0;g<e.length;g++){e[g].style.backgroundColor=f;for(var l=e[g].querySelectorAll(".geCommentAction"), n=0;n<l.length;n++)l[n]!=c.parentNode&&(l[n].style.display=d);A||(e[g].style.display="none")}k()}b.isResolved?G(mxResources.get("reOpened")+": ",!0,c,!1,!0):G(mxResources.get("markedAsResolved"),!1,c,!0)});y.appendChild(z);null!=d?C.insertBefore(y,d.nextSibling):C.appendChild(y);for(d=0;null!=b.replies&&d<b.replies.length;d++)z=b.replies[d],z.isResolved=b.isResolved,p(z,b.replies,null,e+1,g);null!=t&&(t.comment.id==b.id?(g=b.content,b.content=t.comment.content,m(b,y,t.saveCallback,t.deleteOnCancel), b.content=g):null==t.comment.id&&t.comment.pCommentId==b.id&&(C.appendChild(t.div),m(t.comment,t.div,t.saveCallback,t.deleteOnCancel)));return y}}var u=!a.canComment(),v=a.canReplyToReplies(),t=null,z=document.createElement("div");z.className="geCommentsWin";z.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;var y=EditorUi.compactUi?"26px":"30px",C=document.createElement("div");C.className="geCommentsList";C.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke": Dialog.backdropColor;C.style.bottom=parseInt(y)+7+"px";z.appendChild(C);var x=document.createElement("span");x.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(x,mxResources.get("noCommentsFound"));var B=document.createElement("div");B.className="geToolbarContainer geCommentsToolbar";B.style.height=y;B.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";B.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;mxClient.IS_QUIRKS&&(B.style.filter= -"none");y=document.createElement("a");y.className="geButton";mxClient.IS_QUIRKS&&(y.style.filter="none");if(!u){var F=y.cloneNode();F.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';F.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(F,"click",function(b){function c(){m(d,e,function(b){q(e);a.addComment(b,function(a){b.id=a;E.push(b);l(e)},function(b){f(e);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})}, -!0)}var d=a.newComment("",a.getCurrentUser()),e=p(d,E,null,0);c();b.preventDefault();mxEvent.consume(b)});B.appendChild(F)}F=y.cloneNode();F.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';F.setAttribute("title",mxResources.get("showResolved"));var A=!1;"dark"==uiTheme&&(F.style.filter="invert(100%)");mxEvent.addListener(F,"click",function(a){this.className=(A=!A)?"geButton geCheckedBtn":"geButton";D();a.preventDefault();mxEvent.consume(a)});B.appendChild(F);a.commentsRefreshNeeded()&& -(F=y.cloneNode(),F.innerHTML='<img src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',F.setAttribute("title",mxResources.get("refresh")),"dark"==uiTheme&&(F.style.filter="invert(100%)"),mxEvent.addListener(F,"click",function(a){D();a.preventDefault();mxEvent.consume(a)}),B.appendChild(F));a.commentsSaveNeeded()&&(y=y.cloneNode(),y.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',y.setAttribute("title",mxResources.get("save")),"dark"==uiTheme&& -(y.style.filter="invert(100%)"),mxEvent.addListener(y,"click",function(a){e();a.preventDefault();mxEvent.consume(a)}),B.appendChild(y));z.appendChild(B);var E=[],D=mxUtils.bind(this,function(){this.hasError=!1;if(null!=t){t.div=t.div.cloneNode(!0);var b=t.div.querySelector(".geCommentEditTxtArea"),c=t.div.querySelector(".geCommentEditBtns");t.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}C.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+ -'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";v=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});C.innerHTML="";C.appendChild(x);x.style.display="block";E=a;for(a=0;a<E.length;a++)b(E[a].replies),p(E[a],E, +"none");y=document.createElement("a");y.className="geButton";mxClient.IS_QUIRKS&&(y.style.filter="none");if(!u){var E=y.cloneNode();E.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';E.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(E,"click",function(b){function c(){m(d,e,function(b){q(e);a.addComment(b,function(a){b.id=a;F.push(b);l(e)},function(b){f(e);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})}, +!0)}var d=a.newComment("",a.getCurrentUser()),e=p(d,F,null,0);c();b.preventDefault();mxEvent.consume(b)});B.appendChild(E)}E=y.cloneNode();E.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';E.setAttribute("title",mxResources.get("showResolved"));var A=!1;"dark"==uiTheme&&(E.style.filter="invert(100%)");mxEvent.addListener(E,"click",function(a){this.className=(A=!A)?"geButton geCheckedBtn":"geButton";D();a.preventDefault();mxEvent.consume(a)});B.appendChild(E);a.commentsRefreshNeeded()&& +(E=y.cloneNode(),E.innerHTML='<img src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',E.setAttribute("title",mxResources.get("refresh")),"dark"==uiTheme&&(E.style.filter="invert(100%)"),mxEvent.addListener(E,"click",function(a){D();a.preventDefault();mxEvent.consume(a)}),B.appendChild(E));a.commentsSaveNeeded()&&(y=y.cloneNode(),y.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',y.setAttribute("title",mxResources.get("save")),"dark"==uiTheme&& +(y.style.filter="invert(100%)"),mxEvent.addListener(y,"click",function(a){e();a.preventDefault();mxEvent.consume(a)}),B.appendChild(y));z.appendChild(B);var F=[],D=mxUtils.bind(this,function(){this.hasError=!1;if(null!=t){t.div=t.div.cloneNode(!0);var b=t.div.querySelector(".geCommentEditTxtArea"),c=t.div.querySelector(".geCommentEditBtns");t.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}C.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+ +'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";v=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});C.innerHTML="";C.appendChild(x);x.style.display="block";F=a;for(a=0;a<F.length;a++)b(F[a].replies),p(F[a],F, null,0,A);null!=t&&null==t.comment.id&&null==t.comment.pCommentId&&(C.appendChild(t.div),m(t.comment,t.div,t.saveCallback,t.deleteOnCancel))},mxUtils.bind(this,function(a){C.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(a&&a.message?": "+a.message:""));this.hasError=!0})):C.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});D();this.refreshComments=D;B=mxUtils.bind(this,function(){function a(b){var d=c[b.id];if(null!=d)for(n(b,d),d=0;null!=b.replies&&d<b.replies.length;d++)a(b.replies[d])} -if(this.window.isVisible()){for(var b=C.querySelectorAll(".geCommentDate"),c={},d=0;d<b.length;d++){var e=b[d];c[e.getAttribute("data-commentId")]=e}for(d=0;d<E.length;d++)a(E[d])}});setInterval(B,6E4);this.refreshCommentsTime=B;this.window=new mxWindow(mxResources.get("comments"),z,c,b,d,g,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW, +if(this.window.isVisible()){for(var b=C.querySelectorAll(".geCommentDate"),c={},d=0;d<b.length;d++){var e=b[d];c[e.getAttribute("data-commentId")]=e}for(d=0;d<F.length;d++)a(F[d])}});setInterval(B,6E4);this.refreshCommentsTime=B;this.window=new mxWindow(mxResources.get("comments"),z,c,b,d,g,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW, mxUtils.bind(this,function(){this.window.fit()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)};var H=mxUtils.bind(this,function(){var a=this.window.getX(), b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",H);this.destroy=function(){mxEvent.removeListener(window,"resize",H);this.window.destroy()}},ConfirmDialog=function(a,c,b,d,g,e,k,m,n,q,f){var l=document.createElement("div");l.style.textAlign="center";f=null!=f?f:44;var p=document.createElement("div");p.style.padding="6px";p.style.overflow="auto";p.style.maxHeight=f+"px";p.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(p.style.height="60px");mxUtils.write(p,c); l.appendChild(p);null!=q&&(p=document.createElement("div"),p.style.padding="6px 0 6px 0",c=document.createElement("img"),c.setAttribute("src",q),p.appendChild(c),l.appendChild(p));q=document.createElement("div");q.style.textAlign="center";q.style.whiteSpace="nowrap";var u=document.createElement("input");u.setAttribute("type","checkbox");e=mxUtils.button(e||mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d(u.checked)});e.className="geBtn";null!=m&&(e.innerHTML=m+"<br>"+e.innerHTML,e.style.paddingBottom= @@ -8841,13 +8841,13 @@ a.mimeType.substring(0,9)||/\.png$/i.test(a.title)||/\.jpe?g$/i.test(a.title))}c DriveClient.prototype.saveFile=function(a,c,b,d,g,e,k,m){try{a.saveLevel=1;var n=mxUtils.bind(this,function(b){a.saveLevel=11;if(null!=d)d(b);else throw b;try{if(!a.isConflict(b)){var c="error_"+(a.getErrorMessage(b)||"unknown");null!=b&&null!=b.error&&null!=b.error.code&&(c+="-code_"+b.error.code);EditorUi.logEvent({category:"ERROR-SAVE-FILE-"+a.getHash()+"-rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+ (a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),action:c,label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}}catch(x){}}),q=mxUtils.bind(this,function(b){n(b);a.saveLevel=12;try{EditorUi.logError(b.message,null,null,b),EditorUi.sendReport("Critical error in DriveClient.saveFile "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+ a.desc.id+"."+a.desc.headRevisionId+"\nUser="+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")+"\nMessage="+b.message+"\n\nStack:\n"+b.stack)}catch(C){}});if(a.isEditable()&&null!=a.desc){var f=(new Date).getTime(),l=a.desc.etag,p=a.desc.modifiedDate,u=a.desc.headRevisionId,v=this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());g=null!=g?g:"1"==urlParams.ignoremime;e=null!=e?e:!1;var t=mxUtils.bind(this,function(d,g,x){try{a.saveLevel=3;var t=null, -F=!1,A={mimeType:a.desc.mimeType,title:a.getTitle()};this.isGoogleRealtimeMimeType(a.desc.mimeType)?(A.mimeType=this.xmlMimeType,t=a.desc,F=c=!0):"application/octet-stream"==A.mimeType&&(A.mimeType=this.xmlMimeType);a.constructor==DriveFile&&(null==m&&(m=[]),null==a.getChannelId()&&m.push({key:"channel",value:Editor.guid(32)}),null==a.getChannelKey()&&m.push({key:"key",value:Editor.guid(32)}),m.push({key:"secret",value:Editor.guid(32)}));x||(null!=d||e||(d=this.placeholderThumbnail,g=this.placeholderMimeType), +E=!1,A={mimeType:a.desc.mimeType,title:a.getTitle()};this.isGoogleRealtimeMimeType(a.desc.mimeType)?(A.mimeType=this.xmlMimeType,t=a.desc,E=c=!0):"application/octet-stream"==A.mimeType&&(A.mimeType=this.xmlMimeType);a.constructor==DriveFile&&(null==m&&(m=[]),null==a.getChannelId()&&m.push({key:"channel",value:Editor.guid(32)}),null==a.getChannelKey()&&m.push({key:"key",value:Editor.guid(32)}),m.push({key:"secret",value:Editor.guid(32)}));x||(null!=d||e||(d=this.placeholderThumbnail,g=this.placeholderMimeType), null!=d&&null!=g&&(A.thumbnail={image:d,mimeType:g}));var z=a.getData(),y=mxUtils.bind(this,function(d){try{a.saveDelay=(new Date).getTime()-f;var e=(new Date(d.modifiedDate)).getTime()-(new Date(p)).getTime();if(0>=e||l==d.etag||c&&u==d.headRevisionId){var g=[];0>=e&&g.push("invalid modified time");l==d.etag&&g.push("stale etag");c&&u==d.headRevisionId&&g.push("stale revision");var k=g.join(", ");n({message:mxResources.get("errorSavingFile")+": "+k},d);try{EditorUi.sendReport("Critical: Error saving to Google Drive "+ (new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+" "+a.desc.mimeType+"\nUser="+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")+"\nErrors="+k+"\nOld="+u+" "+p+" etag-hash="+this.ui.hashValue(l)+"\nNew="+d.headRevisionId+" "+d.modifiedDate+" etag-hash="+this.ui.hashValue(d.etag)),EditorUi.logError("Critical: Error saving to Google Drive "+a.desc.id,null,"from-"+u+"."+p+"-"+this.ui.hashValue(l)+"-to-"+d.headRevisionId+"."+d.modifiedDate+ "-"+this.ui.hashValue(d.etag)+(0<k.length?"-errors-"+k:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync"))}catch(Q){}}else{a.saveLevel=null;b(d,z);if(null!=t){this.executeRequest({url:"/files/"+t.id+"/revisions/"+t.headRevisionId+"?supportsTeamDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest({url:"/files/"+t.id+"/revisions/"+t.headRevisionId,method:"PUT",params:a})})));try{EditorUi.logEvent({category:a.convertedFrom+ "-CONVERT-FILE-"+a.getHash(),action:"from_"+t.id+"."+t.headRevisionId+"-to_"+a.desc.id+"."+a.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=a.sync?"-client_"+a.sync.clientId:"nosync")})}catch(Q){}}try{EditorUi.logEvent({category:"SUCCESS-SAVE-FILE-"+a.getHash()+"-rev0_"+u+"-mod0_"+p,action:"rev-"+d.headRevisionId+"-mod_"+d.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled? "":"-nolisten")+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}catch(Q){}}}catch(Q){q(Q)}}),C=mxUtils.bind(this,function(b,e){a.saveLevel=4;try{null!=m&&(A.properties=m);var f=k||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),g=0,l=mxUtils.bind(this,function(d){a.saveLevel=5;try{var k=a.desc.mimeType!=this.xmlMimeType&& -a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType,l=!0,m=window.setTimeout(mxUtils.bind(this,function(){l=!1;n({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),3*this.ui.timeout);this.executeRequest(this.createUploadRequest(a.getId(),A,b,c||d||k,e,d?null:f,F),mxUtils.bind(this,function(a){window.clearTimeout(m);l&&y(a)}),mxUtils.bind(this,function(b){window.clearTimeout(m);if(l){a.saveLevel=6;try{a.isConflict(b)?this.executeRequest({url:"/files/"+a.getId()+"?supportsTeamDrives=true&fields="+ +a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType,l=!0,m=window.setTimeout(mxUtils.bind(this,function(){l=!1;n({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),3*this.ui.timeout);this.executeRequest(this.createUploadRequest(a.getId(),A,b,c||d||k,e,d?null:f,E),mxUtils.bind(this,function(a){window.clearTimeout(m);l&&y(a)}),mxUtils.bind(this,function(b){window.clearTimeout(m);if(l){a.saveLevel=6;try{a.isConflict(b)?this.executeRequest({url:"/files/"+a.getId()+"?supportsTeamDrives=true&fields="+ this.catchupFields},mxUtils.bind(this,function(c){a.saveLevel=7;try{if(null!=c&&c.etag==f)if(g<this.maxRetries)g++,window.setTimeout(p,2*g*this.coolOff*(1+.1*(Math.random()-.5)));else{p(!0);try{EditorUi.logError("Warning: Stale Etag Overwrite "+a.getHash(),null,a.desc.id+"."+a.desc.headRevisionId,(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync"))}catch(ca){}}else"1"==urlParams.test&&c.headRevisionId==u&&EditorUi.debug("DriveClient: Remote Etag Changed", "local",f,"remote",c.etag,"rev",a.desc.headRevisionId,"response",[c],"file",[a]),n(b,c)}catch(ca){q(ca)}}),mxUtils.bind(this,function(){n(b)})):n(b)}catch(ha){q(ha)}}}))}catch(ga){q(ga)}}),p=mxUtils.bind(this,function(b){a.saveLevel=9;if(b)l(b);else{var c=!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;n({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),3*this.ui.timeout);this.executeRequest({url:"/files/"+a.getId()+"?supportsTeamDrives=true&fields="+this.catchupFields},mxUtils.bind(this, function(e){window.clearTimeout(d);if(c){a.saveLevel=13;try{null!=e&&e.headRevisionId==u?("1"==urlParams.test&&f!=e.etag&&EditorUi.debug("DriveClient: Preflight Etag Update","from",f,"to",e.etag,"rev",a.desc.headRevisionId,"response",[e],"file",[a]),f=e.etag,l(b)):n({error:{code:412}},e)}catch(ga){q(ga)}}}),mxUtils.bind(this,function(a){window.clearTimeout(d);c&&n(a)}))}});if(v&&null==d){a.saveLevel=8;var t=new Image;t.onload=mxUtils.bind(this,function(){try{var a=this.thumbnailWidth/t.width,b=document.createElement("canvas"); @@ -9118,7 +9118,7 @@ App.prototype.getRecent=function(){if(isLocalStorage&&null!=localStorage){try{va App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.modified)return mxResources.get("allChangesLost");var a=this.getCurrentFile();if(null!=a)if(a.constructor!=LocalFile||""!=a.getHash()||a.isModified()||"1"==urlParams.nowarn||this.isDiagramEmpty()||null!=urlParams.url||this.editor.isChromelessView()){if(a.isModified())return mxResources.get("allChangesLost");a.close(!0)}else return mxResources.get("ensureDataSaved")}; App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.isLightboxView()){var a=this.editor.appName,c=this.getCurrentFile();this.isOfflineApp()&&(a+=" app");null!=c&&(a=(null!=c.getTitle()?c.getTitle():this.defaultFilename)+" - "+a);document.title=a}};App.prototype.createCrcTable=function(){for(var a=[],c,b=0;256>b;b++){c=b;for(var d=0;8>d;d++)c=c&1?3988292384^c>>>1:c>>>1;a[b]=c}return a}; App.prototype.getThumbnail=function(a,c){var b=!1;try{var d=!0,g=window.setTimeout(mxUtils.bind(this,function(){d=!1;c(null)}),this.timeout),e=mxUtils.bind(this,function(a){window.clearTimeout(g);d&&c(a)});null==this.thumbImageCache&&(this.thumbImageCache={});var k=this.editor.graph,m=null!=k.themes&&"darkTheme"==k.defaultThemeName;if(null!=this.pages&&(this.currentPage!=this.pages[0]||m)){var n=k.getGlobalVariable,k=this.createTemporaryGraph(m?k.getDefaultStylesheet():k.getStylesheet()),q=this.pages[0]; -m&&(k.defaultThemeName="default");k.getGlobalVariable=function(a){return"page"==a?q.getName():"pagenumber"==a?1:n.apply(this,arguments)};k.getGlobalVariable=n;document.body.appendChild(k.container);k.model.setRoot(q.root)}if(mxClient.IS_CHROMEAPP||!k.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,function(a){try{k!=this.editor.graph&&null!=k.container.parentNode&&k.container.parentNode.removeChild(k.container)}catch(F){a=null}e(a)}),a,this.thumbImageCache,"#ffffff",function(){e()}, +m&&(k.defaultThemeName="default");k.getGlobalVariable=function(a){return"page"==a?q.getName():"pagenumber"==a?1:n.apply(this,arguments)};k.getGlobalVariable=n;document.body.appendChild(k.container);k.model.setRoot(q.root)}if(mxClient.IS_CHROMEAPP||!k.mathEnabled&&this.useCanvasForExport)this.exportToCanvas(mxUtils.bind(this,function(a){try{k!=this.editor.graph&&null!=k.container.parentNode&&k.container.parentNode.removeChild(k.container)}catch(E){a=null}e(a)}),a,this.thumbImageCache,"#ffffff",function(){e()}, null,null,null,null,null,null,k),b=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var f=document.createElement("canvas"),l=k.getGraphBounds(),p=a/l.width,p=Math.min(1,Math.min(3*a/(4*l.height),p)),u=Math.floor(l.x),v=Math.floor(l.y);f.setAttribute("width",Math.ceil(p*(l.width+4)));f.setAttribute("height",Math.ceil(p*(l.height+4)));var t=f.getContext("2d");t.scale(p,p);t.translate(-u,-v);var z=k.background;if(null==z||""==z||z==mxConstants.NONE)z="#ffffff";t.save();t.fillStyle=z;t.fillRect(u, v,Math.ceil(l.width+4),Math.ceil(l.height+4));t.restore();var y=new mxJsCanvas(f),C=new mxAsyncCanvas(this.thumbImageCache);y.images=this.thumbImageCache.images;var x=new mxImageExport;x.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};x.drawText=function(a,b){};x.drawState(k.getView().getState(k.model.root),C);C.finish(mxUtils.bind(this,function(){try{x.drawState(k.getView().getState(k.model.root), y),k!=this.editor.graph&&null!=k.container.parentNode&&k.container.parentNode.removeChild(k.container)}catch(B){f=null}e(f)}));b=!0}}catch(B){b=!1,null!=k&&k!=this.editor.graph&&null!=k.container.parentNode&&k.container.parentNode.removeChild(k.container)}return b}; @@ -9299,7 +9299,7 @@ d.insertVertex(d.getDefaultParent(),null,"",a.x/c-b.x,a.y/c-b.y,a.width/c,a.heig ": Visited: "+a)}var c=a.parentNode.id,d=a.childNodes;a={};for(var e={},f=null,g={},k=0;k<d.length;k++){var l=d[k];if(null!=l.id&&0<l.id.length)if(null==a[l.id]){a[l.id]=l.id;var m=l.getAttribute("parent");null==m?null!=f?mxLog.debug(c+": Multiple roots: "+l.id):f=l.id:(null==e[m]&&(e[m]=[]),e[m].push(l.id))}else g[l.id]=l.id}0<Object.keys(g).length?(d=c+": "+Object.keys(g).length+" Duplicates: "+Object.keys(g).join(", "),mxLog.debug(d+" (see console)")):mxLog.debug(c+": Checked");var n={};null== f?mxLog.debug(c+": No root"):(b(f),Object.keys(n).length!=Object.keys(a).length&&(mxLog.debug(c+": Invalid tree: (see console)"),console.log(c+": Invalid tree",e)))};"<"!=b.charAt(0)&&(b=Graph.decompress(b),mxLog.debug("See console for uncompressed XML"),console.log("xml",b));var d=mxUtils.parseXml(b),e=a.getPagesForNode(d.documentElement,"mxGraphModel");if(null!=e&&0<e.length)try{var f=a.getHashValueForPages(e);mxLog.debug("Checksum: ",f)}catch(J){mxLog.debug("Error: ",J.message)}else mxLog.debug("No pages found for checksum"); var g=d.getElementsByTagName("root");for(b=0;b<g.length;b++)c(g[b]);mxLog.show()}catch(J){a.handleError(J),console.error(J)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()})),a.actions.addAction("testDiff",mxUtils.bind(this,function(){if(null!=a.pages){var b=new TextareaDialog(a,"Paste Data:","",function(b){if(0<b.length)try{console.log(JSON.stringify(a.diffPages(a.pages,a.getPagesForNode(mxUtils.parseXml(b).documentElement)),null, -2))}catch(F){a.handleError(F),console.error(F)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()}else a.alert("No pages")})),a.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(a,d.getModel())})),a.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=d.getGraphBounds(),c=d.view.scale,e=mxUtils.createXmlDocument(),f=e.createElement("output");e.appendChild(f);e=new mxXmlCanvas2D(f); +2))}catch(E){a.handleError(E),console.error(E)}});b.textarea.style.width="600px";b.textarea.style.height="380px";a.showDialog(b.container,620,460,!0,!0);b.init()}else a.alert("No pages")})),a.actions.addAction("testInspect",mxUtils.bind(this,function(){console.log(a,d.getModel())})),a.actions.addAction("testXmlImageExport",mxUtils.bind(this,function(){var a=new mxImageExport,b=d.getGraphBounds(),c=d.view.scale,e=mxUtils.createXmlDocument(),f=e.createElement("output");e.appendChild(f);e=new mxXmlCanvas2D(f); e.translate(Math.floor((1-b.x)/c),Math.floor((1-b.y)/c));e.scale(1/c);var g=0,k=e.save;e.save=function(){g++;k.apply(this,arguments)};var l=e.restore;e.restore=function(){g--;l.apply(this,arguments)};var m=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,g);m.apply(this,arguments);mxLog.debug("leaving shape",a,g)};a.drawState(d.getView().getState(d.model.root),e);mxLog.show();mxLog.debug(mxUtils.getXml(f));mxLog.debug("stateCounter",g)})),a.actions.addAction("testDownloadRtModel...", mxUtils.bind(this,function(){null==a.drive?a.handleError({message:mxResources.get("serviceUnavailableOrBlocked")}):a.drive.execute(mxUtils.bind(this,function(){var b=prompt("File ID","");if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("export"))){var c=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+b+"/realtime?supportsTeamDrives=true",null,"GET");c.setRequestHeaders=function(b){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);b.setRequestHeader("authorization", "Bearer "+a.drive.token)};c.send(function(c){a.spinner.stop();200<=c.getStatus()&&299>=c.getStatus()?a.saveLocalFile(c.getText(),"json-"+b+".txt","text/plain"):a.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))})}}))})),a.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.put("testDevelop",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b, @@ -9431,7 +9431,7 @@ return b}function d(a){var b=!1;null!=a&&(a=z.getParent(a),b=t.view.getState(a), a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function q(a,b){b=null!=b?b:!0;t.model.beginUpdate();try{var c=t.model.getParent(a),d=t.getIncomingEdges(a),e=t.cloneCells([d[0],a]);t.model.setTerminal(e[0],t.model.getTerminal(d[0],!0),!0);var f=n(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH|| f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+10:-e[1].geometry.height-10;t.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=t.view.getState(a),l=t.view.scale;if(null!=k){var m=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?m.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*l:m.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*l;var p=t.getOutgoingEdges(t.model.getTerminal(d[0], !0));if(null!=p){for(var q=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,u=g=d=0;u<p.length;u++){var v=t.model.getTerminal(p[u],!1);if(f==n(v)){var x=t.view.getState(v);v!=a&&null!=x&&(q&&b!=x.getCenterX()<k.getCenterX()||!q&&b!=x.getCenterY()<k.getCenterY())&&mxUtils.intersects(m,x)&&(d=10+Math.max(d,(Math.min(m.x+m.width,x.x+x.width)-Math.max(m.x,x.x))/l),g=10+Math.max(g,(Math.min(m.y+m.height,x.y+x.height)-Math.max(m.y,x.y))/l))}}q?g=0:d=0;for(u=0;u<p.length;u++)if(v=t.model.getTerminal(p[u], -!1),f==n(v)&&(x=t.view.getState(v),v!=a&&null!=x&&(q&&b!=x.getCenterX()<k.getCenterX()||!q&&b!=x.getCenterY()<k.getCenterY()))){var B=[];t.traverse(x.cell,!0,function(a,b){null!=b&&B.push(b);B.push(a);return!0});t.moveCells(B,(b?1:-1)*d,(b?1:-1)*g)}}}return t.addCells(e,c)}finally{t.model.endUpdate()}}function f(a){t.model.beginUpdate();try{var b=n(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],a]);t.model.setTerminal(c[0],d[1],!1);t.model.setTerminal(d[0],d[1],!0);t.model.setTerminal(d[0],a,!1); +!1),f==n(v)&&(x=t.view.getState(v),v!=a&&null!=x&&(q&&b!=x.getCenterX()<k.getCenterX()||!q&&b!=x.getCenterY()<k.getCenterY()))){var A=[];t.traverse(x.cell,!0,function(a,b){null!=b&&A.push(b);A.push(a);return!0});t.moveCells(A,(b?1:-1)*d,(b?1:-1)*g)}}}return t.addCells(e,c)}finally{t.model.endUpdate()}}function f(a){t.model.beginUpdate();try{var b=n(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],a]);t.model.setTerminal(c[0],d[1],!1);t.model.setTerminal(d[0],d[1],!0);t.model.setTerminal(d[0],a,!1); var e=t.model.getParent(a),f=e.geometry,g=[];t.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);t.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,l=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,l=-l):b==mxConstants.DIRECTION_WEST?(k=-k,l=0):b==mxConstants.DIRECTION_EAST&&(l=0);t.moveCells(g,k,l);return t.addCells(d,e)}finally{t.model.endUpdate()}}function l(a){t.model.beginUpdate();try{var b= t.model.getParent(a),c=t.getIncomingEdges(a),d=t.cloneCells([c[0],a]);t.model.setTerminal(d[0],a,!0);var c=t.getOutgoingEdges(a),e=b.geometry,f=[];t.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var k=t.model.getTerminal(c[g],!1);null!=k&&f.push(k)}var l=t.view.getBounds(f),m=n(a),p=t.view.translate,q=t.view.scale;m==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(l.x+l.width)/q-p.x-e.x+10,d[1].geometry.y+=d[1].geometry.height- e.y+40):m==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==l?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(l.x+l.width)/q-p.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height+e.y+40):(d[1].geometry.x=m==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width+e.x+40):d[1].geometry.x+(d[1].geometry.width-e.x+40),d[1].geometry.y=null==l?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(l.y+l.height)/q-p.y+-e.y+10);return t.addCells(d,b)}finally{t.model.endUpdate()}}function p(a, @@ -9443,12 +9443,12 @@ v.menus.createPopupMenu=function(a,c,d){y.apply(this,arguments);if(1==t.getSelec null,null,"Alt+Shift+D");var C=t.removeCells;t.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];z.isEdge(g)&&d(g)&&(e.push(g),g=z.getTerminal(g,!1));b(g)?(t.traverse(g,!0,function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=t.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return C.apply(this,arguments)};v.hoverIcons.getStateAt=function(a,c, d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var x=t.duplicateCells;t.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=t.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=t.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],a)}this.model.beginUpdate();try{var k=x.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var l=t.getIncomingEdges(k[e]),g=t.getIncomingEdges(a[e]); if(0==l.length&&0<g.length){var m=this.cloneCell(g[0]);this.addEdge(m,t.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var B=t.moveCells;t.moveCells=function(a,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.view.getState(f),p=null!=n?n.style:this.getCellStyle(f);if(null!=a&&b(f)&&"1"==mxUtils.getValue(p,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||t.model.isEdge(a[q])&&null==t.model.getTerminal(a[q],!0)){f=t.model.getParent(a[q]); -break}if(null!=m&&f!=m&&null!=this.view.getState(a[0])){var u=t.getIncomingEdges(a[0]);if(0<u.length){var x=t.view.getState(t.model.getTerminal(u[0],!0));if(null!=x){var v=t.view.getState(m);null!=v&&(c=(v.getCenterX()-x.getCenterX())/t.view.scale,d=(v.getCenterY()-x.getCenterY())/t.view.scale)}}}}l=B.apply(this,arguments);if(null!=l&&null!=a&&l.length==a.length)for(q=0;q<l.length;q++)if(this.model.isEdge(l[q]))b(m)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[q],!0))&&this.model.setTerminal(l[q], -m,!0);else if(b(a[q])&&(u=t.getIncomingEdges(a[q]),0<u.length))if(!e)b(m)&&0>mxUtils.indexOf(a,this.model.getTerminal(u[0],!0))&&this.model.setTerminal(u[0],m,!0);else if(0==t.getIncomingEdges(l[q]).length){n=m;if(null==n||n==t.model.getParent(a[q]))n=t.model.getTerminal(u[0],!0);e=this.cloneCell(u[0]);this.addEdge(e,t.getDefaultParent(),n,l[q])}}finally{this.model.endUpdate()}return l};if(null!=v.sidebar){var F=v.sidebar.dropAndConnect;v.sidebar.dropAndConnect=function(a,c,d,e){var f=t.model,g=null; -f.beginUpdate();try{if(g=F.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var l=t.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var A={88:v.actions.get("selectChildren"),84:v.actions.get("selectSubtree"),80:v.actions.get("selectParent"),83:v.actions.get("selectSiblings")},E=v.onKeyDown;v.onKeyDown=function(a){try{if(t.isEnabled()&&!t.isEditing()&& +break}if(null!=m&&f!=m&&null!=this.view.getState(a[0])){var u=t.getIncomingEdges(a[0]);if(0<u.length){var v=t.view.getState(t.model.getTerminal(u[0],!0));if(null!=v){var x=t.view.getState(m);null!=x&&(c=(x.getCenterX()-v.getCenterX())/t.view.scale,d=(x.getCenterY()-v.getCenterY())/t.view.scale)}}}}l=B.apply(this,arguments);if(null!=l&&null!=a&&l.length==a.length)for(q=0;q<l.length;q++)if(this.model.isEdge(l[q]))b(m)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[q],!0))&&this.model.setTerminal(l[q], +m,!0);else if(b(a[q])&&(u=t.getIncomingEdges(a[q]),0<u.length))if(!e)b(m)&&0>mxUtils.indexOf(a,this.model.getTerminal(u[0],!0))&&this.model.setTerminal(u[0],m,!0);else if(0==t.getIncomingEdges(l[q]).length){n=m;if(null==n||n==t.model.getParent(a[q]))n=t.model.getTerminal(u[0],!0);e=this.cloneCell(u[0]);this.addEdge(e,t.getDefaultParent(),n,l[q])}}finally{this.model.endUpdate()}return l};if(null!=v.sidebar){var E=v.sidebar.dropAndConnect;v.sidebar.dropAndConnect=function(a,c,d,e){var f=t.model,g=null; +f.beginUpdate();try{if(g=E.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var l=t.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var A={88:v.actions.get("selectChildren"),84:v.actions.get("selectSubtree"),80:v.actions.get("selectParent"),83:v.actions.get("selectSiblings")},F=v.onKeyDown;v.onKeyDown=function(a){try{if(t.isEnabled()&&!t.isEditing()&& b(t.getSelectionCell())&&1==t.getSelectionCount()){var c=null;0<t.getIncomingEdges(t.getSelectionCell()).length&&(9==a.which?c=mxEvent.isShiftDown(a)?f(t.getSelectionCell()):l(t.getSelectionCell()):13==a.which&&(c=q(t.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&t.model.isEdge(c[0])?t.setSelectionCell(t.model.getTerminal(c[0],!1)):t.setSelectionCell(c[c.length-1]),null!=v.hoverIcons&&v.hoverIcons.update(t.view.getState(t.getSelectionCell())),t.startEditingAtCell(t.getSelectionCell()), mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var d=A[a.keyCode];null!=d&&(d.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(u(t.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(u(t.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(u(t.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(u(t.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(N){console.log("error", -N)}mxEvent.isConsumed(a)||E.apply(this,arguments)};var D=t.connectVertex;t.connectVertex=function(a,c,d,e,g,k){var m=t.getIncomingEdges(a);return b(a)&&0<m.length?(d=n(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,g=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?l(a):e==g?f(a):q(a,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):D.call(this,a,c,d,e,g,k)};t.getSubtree=function(a){var d=[a];!c(a)&&!b(a)||m(a)||t.traverse(a,!0,function(a,b){null!= +N)}mxEvent.isConsumed(a)||F.apply(this,arguments)};var D=t.connectVertex;t.connectVertex=function(a,c,d,e,g,k){var m=t.getIncomingEdges(a);return b(a)&&0<m.length?(d=n(a),e=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,g=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,d==c?l(a):e==g?f(a):q(a,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):D.call(this,a,c,d,e,g,k)};t.getSubtree=function(a){var d=[a];!c(a)&&!b(a)||m(a)||t.traverse(a,!0,function(a,b){null!= b&&0>mxUtils.indexOf(d,b)&&d.push(b);0>mxUtils.indexOf(d,a)&&d.push(a);return!0});return d};var H=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){H.apply(this,arguments);(c(this.state.cell)||b(this.state.cell))&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="18px", this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells);this.graph.graphHandler.pBounds=this.graph.graphHandler.getPreviewBounds(this.graph.graphHandler.cells); this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};var J=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){J.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var I=mxVertexHandler.prototype.destroy; @@ -9527,20 +9527,20 @@ G.style.right="0px";G.style.bottom="0px";G.style.overflow="hidden";G.style.visib k.editor.graph.view.scale)+"%"});k.editor.graph.view.addListener(mxEvent.EVENT_SCALE,I);k.editor.addListener("resetGraphView",I);k.editor.addListener("pageSelected",I);var K=k.setGraphEnabled;k.setGraphEnabled=function(){K.apply(this,arguments);null!=this.tabContainer&&(G.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}u.appendChild(k.tabContainer);u.appendChild(m);u.appendChild(k.diagramContainer); g.appendChild(u);k.updateTabContainer();var Q=null;f();mxEvent.addListener(window,"resize",function(){f();null!=k.sidebarWindow&&k.sidebarWindow.window.fit();null!=k.formatWindow&&k.formatWindow.window.fit();null!=k.actions.outlineWindow&&k.actions.outlineWindow.window.fit();null!=k.actions.layersWindow&&k.actions.layersWindow.window.fit();null!=k.menus.tagsWindow&&k.menus.tagsWindow.window.fit();null!=k.menus.findWindow&&k.menus.findWindow.window.fit()})}}}; (function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var c=EditorUi.initTheme;EditorUi.initTheme=function(){c.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();(function(){var a=mxGuide.prototype.move;mxGuide.prototype.move=function(b,c,e,k){var d=c.y,g=c.x,q=!1,f=!1;if(null!=this.states&&null!=b&&null!=c){var l=this,p=new mxCellState,u=this.graph.getView().scale,v=Math.max(2,this.getGuideTolerance()/2);p.x=b.x+g;p.y=b.y+d;p.width=b.width;p.height=b.height;for(var t=[],z=[],y=0;y<this.states.length;y++){var C=this.states[y];C instanceof mxCellState&&(k||!this.graph.isCellSelected(C.cell))&&((p.x>=C.x&&p.x<=C.x+C.width||C.x>=p.x&&C.x<=p.x+p.width)&&(p.y> -C.y+C.height+4||p.y+p.height+4<C.y)?t.push(C):(p.y>=C.y&&p.y<=C.y+C.height||C.y>=p.y&&C.y<=p.y+p.height)&&(p.x>C.x+C.width+4||p.x+p.width+4<C.x)&&z.push(C))}var x=0,B=0,F=C=0,A=0,E=0,D=0,H=0,J=5*u;if(1<t.length){t.push(p);t.sort(function(a,b){return a.y-b.y});var I=!1,y=p==t[0],u=p==t[t.length-1];if(!y&&!u)for(y=1;y<t.length-1;y++)if(p==t[y]){u=t[y-1];y=t[y+1];C=B=F=(y.y-u.y-u.height-p.height)/2;break}for(y=0;y<t.length-1;y++){var u=t[y],G=t[y+1],K=p==u||p==G,G=G.y-u.y-u.height,I=I|p==u;if(0==B&& -0==x)B=G,x=1;else if(Math.abs(B-G)<=(K||1==y&&I?v:0))x+=1;else if(1<x&&I){t=t.slice(0,y+1);break}else if(3<=t.length-y&&!I)x=0,C=B=0!=F?F:0,t.splice(0,0==y?1:y),y=-1;else break;0!=C||K||(B=C=G)}3==t.length&&t[1]==p&&(C=0)}if(1<z.length){z.push(p);z.sort(function(a,b){return a.x-b.x});I=!1;y=p==z[0];u=p==z[z.length-1];if(!y&&!u)for(y=1;y<z.length-1;y++)if(p==z[y]){u=z[y-1];y=z[y+1];D=E=H=(y.x-u.x-u.width-p.width)/2;break}for(y=0;y<z.length-1;y++){u=z[y];G=z[y+1];K=p==u||p==G;G=G.x-u.x-u.width;I|=p== -u;if(0==E&&0==A)E=G,A=1;else if(Math.abs(E-G)<=(K||1==y&&I?v:0))A+=1;else if(1<A&&I){z=z.slice(0,y+1);break}else if(3<=z.length-y&&!I)A=0,D=E=0!=H?H:0,z.splice(0,0==y?1:y),y=-1;else break;0!=D||K||(E=D=G)}3==z.length&&z[1]==p&&(D=0)}v=function(a,b,c,d){var e=[],f;d?(d=J,f=0):(d=0,f=J);e.push(new mxPoint(a.x-d,a.y-f));e.push(new mxPoint(a.x+d,a.y+f));e.push(a);e.push(b);e.push(new mxPoint(b.x-d,b.y-f));e.push(new mxPoint(b.x+d,b.y+f));if(null!=c)return c.points=e,c;a=new mxPolyline(e,mxConstants.GUIDE_COLOR, -mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents=!1;a.init(l.graph.getView().getOverlayPane());return a};E=function(a,b){if(a&&null!=l.guidesArrHor)for(var c=0;c<l.guidesArrHor.length;c++)l.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=l.guidesArrVer)for(c=0;c<l.guidesArrVer.length;c++)l.guidesArrVer[c].node.style.visibility="hidden"};if(1<A&&A==z.length-1){A=[];H=l.guidesArrHor;q=[];g=0;y=z[0]==p?1:0;I=z[y].y+z[y].height;if(0<D)for(y=0;y<z.length-1;y++)u= +C.y+C.height+4||p.y+p.height+4<C.y)?t.push(C):(p.y>=C.y&&p.y<=C.y+C.height||C.y>=p.y&&C.y<=p.y+p.height)&&(p.x>C.x+C.width+4||p.x+p.width+4<C.x)&&z.push(C))}var x=0,B=0,E=C=0,A=0,F=0,D=0,H=0,J=5*u;if(1<t.length){t.push(p);t.sort(function(a,b){return a.y-b.y});var I=!1,y=p==t[0],u=p==t[t.length-1];if(!y&&!u)for(y=1;y<t.length-1;y++)if(p==t[y]){u=t[y-1];y=t[y+1];C=B=E=(y.y-u.y-u.height-p.height)/2;break}for(y=0;y<t.length-1;y++){var u=t[y],G=t[y+1],K=p==u||p==G,G=G.y-u.y-u.height,I=I|p==u;if(0==B&& +0==x)B=G,x=1;else if(Math.abs(B-G)<=(K||1==y&&I?v:0))x+=1;else if(1<x&&I){t=t.slice(0,y+1);break}else if(3<=t.length-y&&!I)x=0,C=B=0!=E?E:0,t.splice(0,0==y?1:y),y=-1;else break;0!=C||K||(B=C=G)}3==t.length&&t[1]==p&&(C=0)}if(1<z.length){z.push(p);z.sort(function(a,b){return a.x-b.x});I=!1;y=p==z[0];u=p==z[z.length-1];if(!y&&!u)for(y=1;y<z.length-1;y++)if(p==z[y]){u=z[y-1];y=z[y+1];D=F=H=(y.x-u.x-u.width-p.width)/2;break}for(y=0;y<z.length-1;y++){u=z[y];G=z[y+1];K=p==u||p==G;G=G.x-u.x-u.width;I|=p== +u;if(0==F&&0==A)F=G,A=1;else if(Math.abs(F-G)<=(K||1==y&&I?v:0))A+=1;else if(1<A&&I){z=z.slice(0,y+1);break}else if(3<=z.length-y&&!I)A=0,D=F=0!=H?H:0,z.splice(0,0==y?1:y),y=-1;else break;0!=D||K||(F=D=G)}3==z.length&&z[1]==p&&(D=0)}v=function(a,b,c,d){var e=[],f;d?(d=J,f=0):(d=0,f=J);e.push(new mxPoint(a.x-d,a.y-f));e.push(new mxPoint(a.x+d,a.y+f));e.push(a);e.push(b);e.push(new mxPoint(b.x-d,b.y-f));e.push(new mxPoint(b.x+d,b.y+f));if(null!=c)return c.points=e,c;a=new mxPolyline(e,mxConstants.GUIDE_COLOR, +mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents=!1;a.init(l.graph.getView().getOverlayPane());return a};F=function(a,b){if(a&&null!=l.guidesArrHor)for(var c=0;c<l.guidesArrHor.length;c++)l.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=l.guidesArrVer)for(c=0;c<l.guidesArrVer.length;c++)l.guidesArrVer[c].node.style.visibility="hidden"};if(1<A&&A==z.length-1){A=[];H=l.guidesArrHor;q=[];g=0;y=z[0]==p?1:0;I=z[y].y+z[y].height;if(0<D)for(y=0;y<z.length-1;y++)u= z[y],G=z[y+1],p==u?(g=G.x-u.width-D,q.push(new mxPoint(g+u.width+J,I)),q.push(new mxPoint(G.x-J,I))):p==G?(q.push(new mxPoint(u.x+u.width+J,I)),g=u.x+u.width+D,q.push(new mxPoint(g-J,I))):(q.push(new mxPoint(u.x+u.width+J,I)),q.push(new mxPoint(G.x-J,I)));else u=z[0],y=z[2],g=u.x+u.width+(y.x-u.x-u.width-p.width)/2,q.push(new mxPoint(u.x+u.width+J,I)),q.push(new mxPoint(g-J,I)),q.push(new mxPoint(g+p.width+J,I)),q.push(new mxPoint(y.x-J,I));for(y=0;y<q.length;y+=2)z=q[y],D=q[y+1],z=v(z,D,null!=H? -H[y/2]:null),z.node.style.visibility="visible",z.redraw(),A.push(z);for(y=q.length/2;null!=H&&y<H.length;y++)H[y].destroy();l.guidesArrHor=A;g-=b.x;q=!0}else E(!0);if(1<x&&x==t.length-1){A=[];H=l.guidesArrVer;f=[];d=0;y=t[0]==p?1:0;x=t[y].x+t[y].width;if(0<C)for(y=0;y<t.length-1;y++)u=t[y],G=t[y+1],p==u?(d=G.y-u.height-C,f.push(new mxPoint(x,d+u.height+J)),f.push(new mxPoint(x,G.y-J))):p==G?(f.push(new mxPoint(x,u.y+u.height+J)),d=u.y+u.height+C,f.push(new mxPoint(x,d-J))):(f.push(new mxPoint(x,u.y+ -u.height+J)),f.push(new mxPoint(x,G.y-J)));else u=t[0],y=t[2],d=u.y+u.height+(y.y-u.y-u.height-p.height)/2,f.push(new mxPoint(x,u.y+u.height+J)),f.push(new mxPoint(x,d-J)),f.push(new mxPoint(x,d+p.height+J)),f.push(new mxPoint(x,y.y-J));for(y=0;y<f.length;y+=2)z=f[y],D=f[y+1],z=v(z,D,null!=H?H[y/2]:null,!0),z.node.style.visibility="visible",z.redraw(),A.push(z);for(y=f.length/2;null!=H&&y<H.length;y++)H[y].destroy();l.guidesArrVer=A;d-=b.y;f=!0}else E(!1,!0)}if(q||f)return p=new mxPoint(g,d),t=a.call(this, -b,p,e,k),q&&!f?p.y=t.y:f&&!q&&(p.x=t.x),t.y!=p.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),t.x!=p.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),p;E(!0,!0);return a.apply(this,arguments)};var c=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){c.call(this,a);var b=this.guidesArrVer,d=this.guidesArrHor;if(null!=b)for(var k=0;k<b.length;k++)b[k].node.style.visibility=a?"visible":"hidden";if(null!= +H[y/2]:null),z.node.style.visibility="visible",z.redraw(),A.push(z);for(y=q.length/2;null!=H&&y<H.length;y++)H[y].destroy();l.guidesArrHor=A;g-=b.x;q=!0}else F(!0);if(1<x&&x==t.length-1){A=[];H=l.guidesArrVer;f=[];d=0;y=t[0]==p?1:0;x=t[y].x+t[y].width;if(0<C)for(y=0;y<t.length-1;y++)u=t[y],G=t[y+1],p==u?(d=G.y-u.height-C,f.push(new mxPoint(x,d+u.height+J)),f.push(new mxPoint(x,G.y-J))):p==G?(f.push(new mxPoint(x,u.y+u.height+J)),d=u.y+u.height+C,f.push(new mxPoint(x,d-J))):(f.push(new mxPoint(x,u.y+ +u.height+J)),f.push(new mxPoint(x,G.y-J)));else u=t[0],y=t[2],d=u.y+u.height+(y.y-u.y-u.height-p.height)/2,f.push(new mxPoint(x,u.y+u.height+J)),f.push(new mxPoint(x,d-J)),f.push(new mxPoint(x,d+p.height+J)),f.push(new mxPoint(x,y.y-J));for(y=0;y<f.length;y+=2)z=f[y],D=f[y+1],z=v(z,D,null!=H?H[y/2]:null,!0),z.node.style.visibility="visible",z.redraw(),A.push(z);for(y=f.length/2;null!=H&&y<H.length;y++)H[y].destroy();l.guidesArrVer=A;d-=b.y;f=!0}else F(!1,!0)}if(q||f)return p=new mxPoint(g,d),t=a.call(this, +b,p,e,k),q&&!f?p.y=t.y:f&&!q&&(p.x=t.x),t.y!=p.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),t.x!=p.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),p;F(!0,!0);return a.apply(this,arguments)};var c=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){c.call(this,a);var b=this.guidesArrVer,d=this.guidesArrHor;if(null!=b)for(var k=0;k<b.length;k++)b[k].node.style.visibility=a?"visible":"hidden";if(null!= d)for(k=0;k<d.length;k++)d[k].node.style.visibility=a?"visible":"hidden"};var b=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){b.call(this);var a=this.guidesArrVer,c=this.guidesArrHor;if(null!=a){for(var e=0;e<a.length;e++)a[e].destroy();this.guidesArrVer=null}if(null!=c){for(e=0;e<c.length;e++)c[e].destroy();this.guidesArrHor=null}}})();function mxRuler(a,c,b,d){function g(){var c=a.diagramContainer;q.style.top=c.offsetTop-k+"px";q.style.left=c.offsetLeft-k+"px";q.style.width=(b?0:c.offsetWidth)+k+"px";q.style.height=(b?c.offsetHeight:0)+k+"px"}function e(a,b,c){var d;return function(){var e=this,f=arguments,g=c&&!d;clearTimeout(d);d=setTimeout(function(){d=null;c||a.apply(e,f)},b);g&&a.apply(e,f)}}var k=this.RULER_THICKNESS,m=this;this.unit=c;var n="dark"!=window.uiTheme?{bkgClr:"#ffffff",outBkgClr:"#e8e9ed",cornerClr:"#fbfbfb", strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"}:{bkgClr:"#202020",outBkgClr:"#2a2a2a",cornerClr:"#2a2a2a",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"},q=document.createElement("div");q.style.position="absolute";q.style.background=n.bkgClr;q.style[b?"borderRight":"borderBottom"]="0.5px solid "+n.strokeClr;q.style.borderLeft="0.5px solid "+n.strokeClr;document.body.appendChild(q);mxEvent.disableContextMenu(q);this.editorUiRefresh=a.refresh;a.refresh=function(b){m.editorUiRefresh.apply(a, arguments);g()};g();var f=document.createElement("canvas");f.width=q.offsetWidth;f.height=q.offsetHeight;q.style.overflow="hidden";f.style.position="relative";q.appendChild(f);var l=f.getContext("2d");this.ui=a;var p=a.editor.graph;this.graph=p;this.container=q;this.canvas=f;var u=function(a,c,d,e,f){a=Math.round(a);c=Math.round(c);d=Math.round(d);e=Math.round(e);l.beginPath();l.moveTo(a+.5,c+.5);l.lineTo(d+.5,e+.5);l.stroke();f&&(b?(l.save(),l.translate(a,c),l.rotate(-Math.PI/2),l.fillText(f,0,0), l.restore()):l.fillText(f,a,c))},v=function(){l.clearRect(0,0,f.width,f.height);l.beginPath();l.lineWidth=.7;l.strokeStyle=n.strokeClr;l.setLineDash([]);l.font="9px Arial";l.textAlign="center";var a=p.view.scale,c=p.view.getBackgroundPageBounds(),d=p.view.translate,e=p.view.getGraphBounds(),g=p.pageVisible,q=g?k+(b?c.y-p.container.scrollTop:c.x-p.container.scrollLeft):k+(b?d.y-p.container.scrollTop:d.x-p.container.scrollLeft),v=0;g&&(v=b?Math.floor(((e.y+1)/a-d.y)/p.pageFormat.height)*p.pageFormat.height* -a:Math.floor(((e.x+1)/a-d.x)/p.pageFormat.width)*p.pageFormat.width*a);var A,E,D;switch(m.unit){case mxConstants.POINTS:A=D=10;E=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:D=10;A=mxConstants.PIXELS_PER_MM;E=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:D=.5>=a||4<=a?8:16,A=mxConstants.PIXELS_PER_INCH/D,E=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}d=A;2<=a?d=A/(2*Math.floor(a/2)):.5>=a&&(d=A*Math.floor(1/a/2)*(m.unit==mxConstants.MILLIMETERS?2:1));A=null;c=g?Math.min(q+(b?c.height:c.width), -b?f.height:f.width):b?f.height:f.width;g&&(l.fillStyle=n.outBkgClr,b?(l.fillRect(0,k,k,q-k),l.fillRect(0,c,k,f.height)):(l.fillRect(k,0,q-k,k),l.fillRect(c,0,f.width,k)));l.fillStyle=n.fontClr;for(g=g?q:q%(d*a);g<=c;g+=d*a)if(e=Math.round((g-q)/a/d),!(g<k||e==A)){A=e;var H=null;0==e%D&&(H=m.formatText(v+e*d)+"");b?u(k-E[Math.abs(e)%D],g,k,g,H):u(g,k-E[Math.abs(e)%D],g,k,H)}l.lineWidth=1;u(b?0:k,b?k:0,k,k);l.fillStyle=n.cornerClr;l.fillRect(0,0,k,k)};this.drawRuler=v;this.sizeListener=c=e(function(){var a= +a:Math.floor(((e.x+1)/a-d.x)/p.pageFormat.width)*p.pageFormat.width*a);var A,F,D;switch(m.unit){case mxConstants.POINTS:A=D=10;F=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:D=10;A=mxConstants.PIXELS_PER_MM;F=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:D=.5>=a||4<=a?8:16,A=mxConstants.PIXELS_PER_INCH/D,F=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}d=A;2<=a?d=A/(2*Math.floor(a/2)):.5>=a&&(d=A*Math.floor(1/a/2)*(m.unit==mxConstants.MILLIMETERS?2:1));A=null;c=g?Math.min(q+(b?c.height:c.width), +b?f.height:f.width):b?f.height:f.width;g&&(l.fillStyle=n.outBkgClr,b?(l.fillRect(0,k,k,q-k),l.fillRect(0,c,k,f.height)):(l.fillRect(k,0,q-k,k),l.fillRect(c,0,f.width,k)));l.fillStyle=n.fontClr;for(g=g?q:q%(d*a);g<=c;g+=d*a)if(e=Math.round((g-q)/a/d),!(g<k||e==A)){A=e;var H=null;0==e%D&&(H=m.formatText(v+e*d)+"");b?u(k-F[Math.abs(e)%D],g,k,g,H):u(g,k-F[Math.abs(e)%D],g,k,H)}l.lineWidth=1;u(b?0:k,b?k:0,k,k);l.fillStyle=n.cornerClr;l.fillRect(0,0,k,k)};this.drawRuler=v;this.sizeListener=c=e(function(){var a= p.container;b?(a=a.offsetHeight+k,f.height!=a&&(f.height=a,q.style.height=a+"px",v())):(a=a.offsetWidth+k,f.width!=a&&(f.width=a,q.style.width=a+"px",v()))},10);this.pageListener=function(){v()};this.scrollListener=d=e(function(){var a=b?p.container.scrollTop:p.container.scrollLeft;m.lastScroll!=a&&(m.lastScroll=a,v())},10);this.unitListener=function(a,b){m.setUnit(b.getProperty("unit"))};p.addListener(mxEvent.SIZE,c);p.container.addEventListener("scroll",d);p.view.addListener("unitChanged",this.unitListener); a.addListener("pageViewChanged",this.pageListener);a.addListener("pageScaleChanged",this.pageListener);a.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(a){n=a;q.style.background=n.bkgClr;v()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(a,c,d,e){var f;if(b&&4<a.height||!b&&4<a.width){if(null!=m.guidePart)try{l.putImageData(m.guidePart.imgData1,m.guidePart.x1,m.guidePart.y1),l.putImageData(m.guidePart.imgData2,m.guidePart.x2,m.guidePart.y2),l.putImageData(m.guidePart.imgData3, m.guidePart.x3,m.guidePart.y3)}catch(K){}f=m.origGuideMove.apply(this,arguments);try{var g,p,q,t,v,y,z,C,G;l.lineWidth=.5;l.strokeStyle=n.guideClr;l.setLineDash([2]);b?(p=a.y+f.y+k-this.graph.container.scrollTop,g=0,v=p+a.height/2,t=k/2,C=p+a.height,z=0,q=l.getImageData(g,p-1,k,3),u(g,p,k,p),p--,y=l.getImageData(t,v-1,k,3),u(t,v,k,v),v--,G=l.getImageData(z,C-1,k,3),u(z,C,k,C),C--):(p=0,g=a.x+f.x+k-this.graph.container.scrollLeft,v=k/2,t=g+a.width/2,C=0,z=g+a.width,q=l.getImageData(g-1,p,3,k),u(g, diff --git a/src/main/webapp/js/diagramly/EditorUi.js b/src/main/webapp/js/diagramly/EditorUi.js index bffdfe83881240a232fa398c7fd16ea34a79fb02..8a79e66c998c0fb50455eb873e593b6265a0d4c7 100644 --- a/src/main/webapp/js/diagramly/EditorUi.js +++ b/src/main/webapp/js/diagramly/EditorUi.js @@ -9974,7 +9974,7 @@ { // Fixes cross-platform clipboard UTF8 issues by encoding as URI var cells = mxUtils.sortCells(graph.model.getTopmostCells(graph.getSelectionCells())); - var xml = mxUtils.getXml(this.editor.graph.encodeCells(cells)); + var xml = mxUtils.getXml(graph.encodeCells(cells)); mxUtils.setTextContent(elt, encodeURIComponent(xml)); if (removeCells) @@ -10089,10 +10089,10 @@ // ignore } + var graph = this.editor.graph; + if (xml != null && xml.length > 0) { - var graph = this.editor.graph; - if (graph.lastPasteXml == xml) { graph.pasteCounter++; diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.js index 9c416de967db177c43cb537893e61ff0d1237f39..eaab91fe9ff0e42851137d496a6912fc925d9c00 100644 --- a/src/main/webapp/js/viewer.min.js +++ b/src/main/webapp/js/viewer.min.js @@ -2024,10 +2024,10 @@ Editor.prototype.setFilename=function(a){this.filename=a}; Editor.prototype.createUndoManager=function(){var a=this.graph,b=new mxUndoManager;this.undoListener=function(a,f){b.undoableEditHappened(f.getProperty("edit"))};var f=mxUtils.bind(this,function(a,b){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,f);a.getView().addListener(mxEvent.UNDO,f);f=function(b,f){var d=a.getSelectionCellsForChanges(f.getProperty("edit").changes);a.getModel();for(var l=[],v=0;v<d.length;v++)null!=a.view.getState(d[v])&&l.push(d[v]);a.setSelectionCells(l)}; b.addListener(mxEvent.UNDO,f);b.addListener(mxEvent.REDO,f);return b};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(a){this.consumer=this.producer=null;this.done=a;this.args=null};OpenFile.prototype.setConsumer=function(a){this.consumer=a;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};OpenFile.prototype.error=function(a){this.cancel(!0);mxUtils.alert(a)}; OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(a){null!=this.done&&this.done(null!=a?a:!0)}; -function Dialog(a,b,f,d,l,m,p,v,y,B,c){var e=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(e=80);f+=e;d+=e;var k=f,t=d,n=mxUtils.getDocumentSize(),g=n.height,z=Math.max(1,Math.round((n.width-f-64)/2)),A=Math.max(1,Math.round((g-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(b.style.maxHeight="100%");f=null!=document.body?Math.min(f,document.body.scrollWidth-64):f;d=Math.min(d,g-64);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&&(this.bg=a.createDiv("background"), +function Dialog(a,b,f,d,l,m,p,v,y,B,c){var e=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(e=80);f+=e;d+=e;var k=f,u=d,n=mxUtils.getDocumentSize(),g=n.height,z=Math.max(1,Math.round((n.width-f-64)/2)),A=Math.max(1,Math.round((g-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(b.style.maxHeight="100%");f=null!=document.body?Math.min(f,document.body.scrollWidth-64):f;d=Math.min(d,g-64);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&&(this.bg=a.createDiv("background"), this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=g+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));n=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=n.x+"px";this.bg.style.top=n.y+"px";z+=n.x;A+=n.y;l&&document.body.appendChild(this.bg);var q=a.createDiv(y?"geTransDialog":"geDialog");l=this.getPosition(z,A,f,d);z=l.x;A=l.y;q.style.width= f+"px";q.style.height=d+"px";q.style.left=z+"px";q.style.top=A+"px";q.style.zIndex=this.zIndex;q.appendChild(b);document.body.appendChild(q);!v&&b.clientHeight>q.clientHeight-64&&(b.style.overflowY="auto");m&&(m=document.createElement("img"),m.setAttribute("src",Dialog.prototype.closeImage),m.setAttribute("title",mxResources.get("close")),m.className="geDialogClose",m.style.top=A+14+"px",m.style.left=z+f+38-e+"px",m.style.zIndex=this.zIndex,mxEvent.addListener(m,"click",mxUtils.bind(this,function(){a.hideDialog(!0)})), -document.body.appendChild(m),this.dialogImg=m,c||mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){if(null!=B){var c=B();null!=c&&(k=f=c.w,t=d=c.h)}c=mxUtils.getDocumentSize();g=c.height;this.bg.style.height=g+"px";z=Math.max(1,Math.round((c.width-f-64)/2));A=Math.max(1,Math.round((g-d-a.footerHeight)/3));f=null!=document.body?Math.min(k,document.body.scrollWidth-64):k;d=Math.min(t,g-64);c=this.getPosition(z, +document.body.appendChild(m),this.dialogImg=m,c||mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){if(null!=B){var c=B();null!=c&&(k=f=c.w,u=d=c.h)}c=mxUtils.getDocumentSize();g=c.height;this.bg.style.height=g+"px";z=Math.max(1,Math.round((c.width-f-64)/2));A=Math.max(1,Math.round((g-d-a.footerHeight)/3));f=null!=document.body?Math.min(k,document.body.scrollWidth-64):k;d=Math.min(u,g-64);c=this.getPosition(z, A,f,d);z=c.x;A=c.y;q.style.left=z+"px";q.style.top=A+"px";q.style.width=f+"px";q.style.height=d+"px";!v&&b.clientHeight>q.clientHeight-64&&(b.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=A+14+"px",this.dialogImg.style.left=z+f+38-e+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=p;this.container=q;a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white";Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-1; Dialog.prototype.noColorImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkEzRDlBMUUwODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkEzRDlBMUUxODYxMTExRTFCMzA4RDdDMjJBMEMxRDM3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTNEOUExREU4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTNEOUExREY4NjExMTFFMUIzMDhEN0MyMkEwQzFEMzciLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5xh3fmAAAABlBMVEX////MzMw46qqDAAAAGElEQVR42mJggAJGKGAYIIGBth8KAAIMAEUQAIElnLuQAAAAAElFTkSuQmCC": IMAGE_PATH+"/nocolor.png";Dialog.prototype.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJAQMAAADaX5RTAAAABlBMVEV7mr3///+wksspAAAAAnRSTlP/AOW3MEoAAAAdSURBVAgdY9jXwCDDwNDRwHCwgeExmASygSL7GgB12QiqNHZZIwAAAABJRU5ErkJggg==":IMAGE_PATH+"/close.png"; @@ -2038,10 +2038,10 @@ Dialog.prototype.lockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoA Dialog.prototype.unlockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzdDMDZCN0QxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzdDMDZCN0UxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozN0MwNkI3QjE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozN0MwNkI3QzE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkKMpVwAAAAYUExURZmZmbKysr+/v6ysrOXl5czMzLGxsf///zHN5lwAAAAIdFJOU/////////8A3oO9WQAAADxJREFUeNpUzFESACAEBNBVsfe/cZJU+8Mzs8CIABCidtfGOndnYsT40HDSiCcbPdoJo10o9aI677cpwACRoAF3dFNlswAAAABJRU5ErkJggg==":IMAGE_PATH+ "/unlocked.png";Dialog.prototype.bgOpacity=80;Dialog.prototype.getPosition=function(a,b){return new mxPoint(a,b)};Dialog.prototype.close=function(a,b){if(null!=this.onDialogClose){if(0==this.onDialogClose(a,b))return!1;this.onDialogClose=null}null!=this.dialogImg&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);mxEvent.removeListener(window,"resize",this.resizeListener);this.container.parentNode.removeChild(this.container)}; var ErrorDialog=function(a,b,f,d,l,m,p,v,y,B,c){y=null!=y?y:!0;var e=document.createElement("div");e.style.textAlign="center";if(null!=b){var k=document.createElement("div");k.style.padding="0px";k.style.margin="0px";k.style.fontSize="18px";k.style.paddingBottom="16px";k.style.marginBottom="10px";k.style.borderBottom="1px solid #c0c0c0";k.style.color="gray";k.style.whiteSpace="nowrap";k.style.textOverflow="ellipsis";k.style.overflow="hidden";mxUtils.write(k,b);k.setAttribute("title",b);e.appendChild(k)}b= -document.createElement("div");b.style.lineHeight="1.2em";b.style.padding="6px";b.innerHTML=f;e.appendChild(b);f=document.createElement("div");f.style.marginTop="12px";f.style.textAlign="center";null!=m&&(b=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();m()}),b.className="geBtn",f.appendChild(b),f.style.textAlign="center");null!=B&&(B=mxUtils.button(B,function(){null!=c&&c()}),B.className="geBtn",f.appendChild(B));var t=mxUtils.button(d,function(){y&&a.hideDialog();null!=l&&l()}); -t.className="geBtn";f.appendChild(t);null!=p&&(d=mxUtils.button(p,function(){y&&a.hideDialog();null!=v&&v()}),d.className="geBtn gePrimaryBtn",f.appendChild(d));this.init=function(){t.focus()};e.appendChild(f);this.container=e},PrintDialog=function(a,b){this.create(a,b)}; -PrintDialog.prototype.create=function(a){function b(a){var b=v.checked||B.checked,d=parseInt(e.value)/100;isNaN(d)&&(d=1,e.value="100%");var d=.75*d,k=f.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,t=1/f.pageScale;if(b){var q=v.checked?1:parseInt(c.value);isNaN(q)||(t=mxUtils.getScaleForPageCount(q,f,k))}f.getGraphBounds();var l=q=0,k=mxRectangle.fromRectangle(k);k.width=Math.ceil(k.width*d);k.height=Math.ceil(k.height*d);t*=d;!b&&f.pageVisible?(d=f.getPageLayout(),q-=d.x*k.width,l-=d.y*k.height): -b=!0;b=PrintDialog.createPrintPreview(f,t,k,0,q,l,b);b.open();a&&PrintDialog.printPreview(b)}var f=a.editor.graph,d,l,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var p=document.createElement("tbody");d=document.createElement("tr");var v=document.createElement("input");v.setAttribute("type","checkbox");l=document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";l.appendChild(v);var y=document.createElement("span");mxUtils.write(y," "+mxResources.get("fitPage")); +document.createElement("div");b.style.lineHeight="1.2em";b.style.padding="6px";b.innerHTML=f;e.appendChild(b);f=document.createElement("div");f.style.marginTop="12px";f.style.textAlign="center";null!=m&&(b=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();m()}),b.className="geBtn",f.appendChild(b),f.style.textAlign="center");null!=B&&(B=mxUtils.button(B,function(){null!=c&&c()}),B.className="geBtn",f.appendChild(B));var u=mxUtils.button(d,function(){y&&a.hideDialog();null!=l&&l()}); +u.className="geBtn";f.appendChild(u);null!=p&&(d=mxUtils.button(p,function(){y&&a.hideDialog();null!=v&&v()}),d.className="geBtn gePrimaryBtn",f.appendChild(d));this.init=function(){u.focus()};e.appendChild(f);this.container=e},PrintDialog=function(a,b){this.create(a,b)}; +PrintDialog.prototype.create=function(a){function b(a){var b=v.checked||B.checked,d=parseInt(e.value)/100;isNaN(d)&&(d=1,e.value="100%");var d=.75*d,k=f.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,u=1/f.pageScale;if(b){var q=v.checked?1:parseInt(c.value);isNaN(q)||(u=mxUtils.getScaleForPageCount(q,f,k))}f.getGraphBounds();var l=q=0,k=mxRectangle.fromRectangle(k);k.width=Math.ceil(k.width*d);k.height=Math.ceil(k.height*d);u*=d;!b&&f.pageVisible?(d=f.getPageLayout(),q-=d.x*k.width,l-=d.y*k.height): +b=!0;b=PrintDialog.createPrintPreview(f,u,k,0,q,l,b);b.open();a&&PrintDialog.printPreview(b)}var f=a.editor.graph,d,l,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var p=document.createElement("tbody");d=document.createElement("tr");var v=document.createElement("input");v.setAttribute("type","checkbox");l=document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";l.appendChild(v);var y=document.createElement("span");mxUtils.write(y," "+mxResources.get("fitPage")); l.appendChild(y);mxEvent.addListener(y,"click",function(a){v.checked=!v.checked;B.checked=!v.checked;mxEvent.consume(a)});mxEvent.addListener(v,"change",function(){B.checked=!v.checked});d.appendChild(l);p.appendChild(d);d=d.cloneNode(!1);var B=document.createElement("input");B.setAttribute("type","checkbox");l=document.createElement("td");l.style.fontSize="10pt";l.appendChild(B);y=document.createElement("span");mxUtils.write(y," "+mxResources.get("posterPrint")+":");l.appendChild(y);mxEvent.addListener(y, "click",function(a){B.checked=!B.checked;v.checked=!B.checked;mxEvent.consume(a)});d.appendChild(l);var c=document.createElement("input");c.setAttribute("value","1");c.setAttribute("type","number");c.setAttribute("min","1");c.setAttribute("size","4");c.setAttribute("disabled","disabled");c.style.width="50px";l=document.createElement("td");l.style.fontSize="10pt";l.appendChild(c);mxUtils.write(l," "+mxResources.get("pages")+" (max)");d.appendChild(l);p.appendChild(d);mxEvent.addListener(B,"change", function(){B.checked?c.removeAttribute("disabled"):c.setAttribute("disabled","disabled");v.checked=!B.checked});d=d.cloneNode(!1);l=document.createElement("td");mxUtils.write(l,mxResources.get("pageScale")+":");d.appendChild(l);l=document.createElement("td");var e=document.createElement("input");e.setAttribute("value","100 %");e.setAttribute("size","5");e.style.width="50px";l.appendChild(e);d.appendChild(l);p.appendChild(d);d=document.createElement("tr");l=document.createElement("td");l.colSpan=2; @@ -2049,19 +2049,19 @@ l.style.paddingTop="20px";l.setAttribute("align","right");y=mxUtils.button(mxRes l.appendChild(y);d.appendChild(l);p.appendChild(d);m.appendChild(p);this.container=m};PrintDialog.printPreview=function(a){try{if(null!=a.wnd){var b=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(b,500):b()}}catch(f){}}; PrintDialog.createPrintPreview=function(a,b,f,d,l,m,p){b=new mxPrintPreview(a,b,f,d,l,m);b.title=mxResources.get("preview");b.printBackgroundImage=!0;b.autoOrigin=p;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";b.backgroundColor=a;var v=b.writeHead;b.writeHead=function(a){v.apply(this,arguments);a.writeln('<style type="text/css">');a.writeln("@media screen {");a.writeln(" body > div { padding:30px;box-sizing:content-box; }");a.writeln("}");a.writeln("</style>")};return b}; PrintDialog.previewEnabled=!0; -var PageSetupDialog=function(a){function b(){null==c||c==mxConstants.NONE?(B.style.backgroundColor="",B.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(B.style.backgroundColor=c,B.style.backgroundImage="")}function f(){null==t?(k.removeAttribute("title"),k.style.fontSize="",k.innerHTML=mxResources.get("change")+"..."):(k.setAttribute("title",t.src),k.style.fontSize="11px",k.innerHTML=t.src.substring(0,42)+"...")}var d=a.editor.graph,l,m,p=document.createElement("table");p.style.width= +var PageSetupDialog=function(a){function b(){null==c||c==mxConstants.NONE?(B.style.backgroundColor="",B.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(B.style.backgroundColor=c,B.style.backgroundImage="")}function f(){null==u?(k.removeAttribute("title"),k.style.fontSize="",k.innerHTML=mxResources.get("change")+"..."):(k.setAttribute("title",u.src),k.style.fontSize="11px",k.innerHTML=u.src.substring(0,42)+"...")}var d=a.editor.graph,l,m,p=document.createElement("table");p.style.width= "100%";p.style.height="100%";var v=document.createElement("tbody");l=document.createElement("tr");m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";mxUtils.write(m,mxResources.get("paperSize")+":");l.appendChild(m);m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";var y=PageSetupDialog.addPageFormatPanel(m,"pagesetupdialog",d.pageFormat);l.appendChild(m);v.appendChild(l);l=document.createElement("tr");m=document.createElement("td"); mxUtils.write(m,mxResources.get("background")+":");l.appendChild(m);m=document.createElement("td");m.style.whiteSpace="nowrap";document.createElement("input").setAttribute("type","text");var B=document.createElement("button");B.style.width="18px";B.style.height="18px";B.style.marginRight="20px";B.style.backgroundPosition="center center";B.style.backgroundRepeat="no-repeat";var c=d.background;b();mxEvent.addListener(B,"click",function(e){a.pickColor(c||"none",function(a){c=a;b()});mxEvent.consume(e)}); m.appendChild(B);mxUtils.write(m,mxResources.get("gridSize")+":");var e=document.createElement("input");e.setAttribute("type","number");e.setAttribute("min","0");e.style.width="40px";e.style.marginLeft="6px";e.value=d.getGridSize();m.appendChild(e);mxEvent.addListener(e,"change",function(){var a=parseInt(e.value);e.value=Math.max(1,isNaN(a)?d.getGridSize():a)});l.appendChild(m);v.appendChild(l);l=document.createElement("tr");m=document.createElement("td");mxUtils.write(m,mxResources.get("image")+ -":");l.appendChild(m);m=document.createElement("td");var k=document.createElement("a");k.style.textDecoration="underline";k.style.cursor="pointer";k.style.color="#a0a0a0";var t=d.backgroundImage;mxEvent.addListener(k,"click",function(c){a.showBackgroundImageDialog(function(a){t=a;f()});mxEvent.consume(c)});f();m.appendChild(k);l.appendChild(m);v.appendChild(l);l=document.createElement("tr");m=document.createElement("td");m.colSpan=2;m.style.paddingTop="16px";m.setAttribute("align","right");var n= -mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst&&m.appendChild(n);var g=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.gridSize!==e.value&&d.setGridSize(parseInt(e.value));var b=new ChangePageSetup(a,c,t,y.get());b.ignoreColor=d.background==c;b.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=t?t.src:null);d.pageFormat.width==b.previousFormat.width&&d.pageFormat.height==b.previousFormat.height&& +":");l.appendChild(m);m=document.createElement("td");var k=document.createElement("a");k.style.textDecoration="underline";k.style.cursor="pointer";k.style.color="#a0a0a0";var u=d.backgroundImage;mxEvent.addListener(k,"click",function(c){a.showBackgroundImageDialog(function(a){u=a;f()});mxEvent.consume(c)});f();m.appendChild(k);l.appendChild(m);v.appendChild(l);l=document.createElement("tr");m=document.createElement("td");m.colSpan=2;m.style.paddingTop="16px";m.setAttribute("align","right");var n= +mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst&&m.appendChild(n);var g=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.gridSize!==e.value&&d.setGridSize(parseInt(e.value));var b=new ChangePageSetup(a,c,u,y.get());b.ignoreColor=d.background==c;b.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=u?u.src:null);d.pageFormat.width==b.previousFormat.width&&d.pageFormat.height==b.previousFormat.height&& b.ignoreColor&&b.ignoreImage||d.model.execute(b)});g.className="geBtn gePrimaryBtn";m.appendChild(g);a.editor.cancelFirst||m.appendChild(n);l.appendChild(m);v.appendChild(l);p.appendChild(v);this.container=p}; PageSetupDialog.addPageFormatPanel=function(a,b,f,d){function l(a,b,d){if(d||e!=document.activeElement&&k!=document.activeElement){a=!1;for(b=0;b<n.length;b++)d=n[b],q?"custom"==d.key&&(v.value=d.key,q=!1):null!=d.format&&("a4"==d.key?826==f.width?(f=mxRectangle.fromRectangle(f),f.width=827):826==f.height&&(f=mxRectangle.fromRectangle(f),f.height=827):"a5"==d.key&&(584==f.width?(f=mxRectangle.fromRectangle(f),f.width=583):584==f.height&&(f=mxRectangle.fromRectangle(f),f.height=583)),f.width==d.format.width&& f.height==d.format.height?(v.value=d.key,m.setAttribute("checked","checked"),m.defaultChecked=!0,m.checked=!0,p.removeAttribute("checked"),p.defaultChecked=!1,p.checked=!1,a=!0):f.width==d.format.height&&f.height==d.format.width&&(v.value=d.key,m.removeAttribute("checked"),m.defaultChecked=!1,m.checked=!1,p.setAttribute("checked","checked"),p.defaultChecked=!0,a=p.checked=!0));a?(y.style.display="",c.style.display="none"):(e.value=f.width/100,k.value=f.height/100,m.setAttribute("checked","checked"), v.value="custom",y.style.display="none",c.style.display="")}}b="format-"+b;var m=document.createElement("input");m.setAttribute("name",b);m.setAttribute("type","radio");m.setAttribute("value","portrait");var p=document.createElement("input");p.setAttribute("name",b);p.setAttribute("type","radio");p.setAttribute("value","landscape");var v=document.createElement("select");v.style.marginBottom="8px";v.style.width="202px";var y=document.createElement("div");y.style.marginLeft="4px";y.style.width="210px"; y.style.height="24px";m.style.marginRight="6px";y.appendChild(m);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));y.appendChild(b);p.style.marginLeft="10px";p.style.marginRight="6px";y.appendChild(p);var B=document.createElement("span");B.style.width="100px";mxUtils.write(B,mxResources.get("landscape"));y.appendChild(B);var c=document.createElement("div");c.style.marginLeft="4px";c.style.width="210px";c.style.height="24px";var e=document.createElement("input"); -e.setAttribute("size","7");e.style.textAlign="right";c.appendChild(e);mxUtils.write(c," in x ");var k=document.createElement("input");k.setAttribute("size","7");k.style.textAlign="right";c.appendChild(k);mxUtils.write(c," in");y.style.display="none";c.style.display="none";for(var t={},n=PageSetupDialog.getFormats(),g=0;g<n.length;g++){var z=n[g];t[z.key]=z;var A=document.createElement("option");A.setAttribute("value",z.key);mxUtils.write(A,z.title);v.appendChild(A)}var q=!1;l();a.appendChild(v);mxUtils.br(a); -a.appendChild(y);a.appendChild(c);var F=f,x=function(a,b){var g=t[v.value];null!=g.format?(e.value=g.format.width/100,k.value=g.format.height/100,c.style.display="none",y.style.display=""):(y.style.display="none",c.style.display="");g=parseFloat(e.value);if(isNaN(g)||0>=g)e.value=f.width/100;g=parseFloat(k.value);if(isNaN(g)||0>=g)k.value=f.height/100;g=new mxRectangle(0,0,Math.floor(100*parseFloat(e.value)),Math.floor(100*parseFloat(k.value)));"custom"!=v.value&&p.checked&&(g=new mxRectangle(0,0, +e.setAttribute("size","7");e.style.textAlign="right";c.appendChild(e);mxUtils.write(c," in x ");var k=document.createElement("input");k.setAttribute("size","7");k.style.textAlign="right";c.appendChild(k);mxUtils.write(c," in");y.style.display="none";c.style.display="none";for(var u={},n=PageSetupDialog.getFormats(),g=0;g<n.length;g++){var z=n[g];u[z.key]=z;var A=document.createElement("option");A.setAttribute("value",z.key);mxUtils.write(A,z.title);v.appendChild(A)}var q=!1;l();a.appendChild(v);mxUtils.br(a); +a.appendChild(y);a.appendChild(c);var F=f,x=function(a,b){var g=u[v.value];null!=g.format?(e.value=g.format.width/100,k.value=g.format.height/100,c.style.display="none",y.style.display=""):(y.style.display="none",c.style.display="");g=parseFloat(e.value);if(isNaN(g)||0>=g)e.value=f.width/100;g=parseFloat(k.value);if(isNaN(g)||0>=g)k.value=f.height/100;g=new mxRectangle(0,0,Math.floor(100*parseFloat(e.value)),Math.floor(100*parseFloat(k.value)));"custom"!=v.value&&p.checked&&(g=new mxRectangle(0,0, g.height,g.width));b&&q||g.width==F.width&&g.height==F.height||(F=g,null!=d&&d(F))};mxEvent.addListener(b,"click",function(a){m.checked=!0;x(a);mxEvent.consume(a)});mxEvent.addListener(B,"click",function(a){p.checked=!0;x(a);mxEvent.consume(a)});mxEvent.addListener(e,"blur",x);mxEvent.addListener(e,"click",x);mxEvent.addListener(k,"blur",x);mxEvent.addListener(k,"click",x);mxEvent.addListener(p,"change",x);mxEvent.addListener(m,"change",x);mxEvent.addListener(v,"change",function(a){q="custom"==v.value; x(a,!0)});x();return{set:function(a){f=a;l(null,null,!0)},get:function(){return F},widthInput:e,heightInput:k}}; PageSetupDialog.getFormats=function(){return[{key:"letter",title:'US-Letter (8,5" x 11")',format:mxConstants.PAGE_FORMAT_LETTER_PORTRAIT},{key:"legal",title:'US-Legal (8,5" x 14")',format:new mxRectangle(0,0,850,1400)},{key:"tabloid",title:'US-Tabloid (11" x 17")',format:new mxRectangle(0,0,1100,1700)},{key:"executive",title:'US-Executive (7" x 10")',format:new mxRectangle(0,0,700,1E3)},{key:"a0",title:"A0 (841 mm x 1189 mm)",format:new mxRectangle(0,0,3300,4681)},{key:"a1",title:"A1 (594 mm x 841 mm)", @@ -2090,17 +2090,17 @@ l,this.menubarContainer.onmousedown=l,this.toolbarContainer.onselectstart=l,this "absolute"));this.hoverIcons=this.createHoverIcons();mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(a){var c=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(a)-c.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(a)-c.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var m=!1,p=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent= function(a,c){return m||p.apply(this,arguments)};this.keydownHandler=mxUtils.bind(this,function(a){32!=a.which||d.isEditing()?mxEvent.isConsumed(a)||27!=a.keyCode||this.hideDialog(null,!0):(m=!0,this.hoverIcons.reset(),d.container.style.cursor="move",d.isEditing()||mxEvent.getSource(a)!=d.container||mxEvent.consume(a))});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(a){d.container.style.cursor="";m=!1});mxEvent.addListener(document,"keyup", this.keyupHandler);var v=d.panningHandler.isForcePanningEvent;d.panningHandler.isForcePanningEvent=function(a){return v.apply(this,arguments)||m||mxEvent.isMouseEvent(a.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(a.getEvent()))&&(!mxEvent.isControlDown(a.getEvent())&&mxEvent.isRightMouseButton(a.getEvent())||mxEvent.isMiddleMouseButton(a.getEvent()))};var y=d.cellEditor.isStopEditingEvent;d.cellEditor.isStopEditingEvent=function(a){return y.apply(this,arguments)||13==a.keyCode&&(!mxClient.IS_SF&& -mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxClient.IS_SF&&mxEvent.isShiftDown(a))};var B=!1,c=null,e=null,k=null,t=mxUtils.bind(this,function(){if(null!=this.toolbar&&B!=d.cellEditor.isContentEditing()){for(var a=this.toolbar.container.firstChild,b=[];null!=a;){var g=a.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=g}a=this.toolbar.fontMenu;g=this.toolbar.sizeMenu;if(null==k)this.toolbar.createTextToolbar();else{for(var f= -0;f<k.length;f++)this.toolbar.container.appendChild(k[f]);this.toolbar.fontMenu=c;this.toolbar.sizeMenu=e}B=d.cellEditor.isContentEditing();c=a;e=g;k=b}}),n=this,g=d.cellEditor.startEditing;d.cellEditor.startEditing=function(){g.apply(this,arguments);t();if(d.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=d.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&& +mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxClient.IS_SF&&mxEvent.isShiftDown(a))};var B=!1,c=null,e=null,k=null,u=mxUtils.bind(this,function(){if(null!=this.toolbar&&B!=d.cellEditor.isContentEditing()){for(var a=this.toolbar.container.firstChild,b=[];null!=a;){var g=a.nextSibling;0>mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=g}a=this.toolbar.fontMenu;g=this.toolbar.sizeMenu;if(null==k)this.toolbar.createTextToolbar();else{for(var f= +0;f<k.length;f++)this.toolbar.container.appendChild(k[f]);this.toolbar.fontMenu=c;this.toolbar.sizeMenu=e}B=d.cellEditor.isContentEditing();c=a;e=g;k=b}}),n=this,g=d.cellEditor.startEditing;d.cellEditor.startEditing=function(){g.apply(this,arguments);u();if(d.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=d.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&& null!=n.toolbar)){var e=c.fontFamily;"'"==e.charAt(0)&&(e=e.substring(1));"'"==e.charAt(e.length-1)&&(e=e.substring(0,e.length-1));n.toolbar.setFontName(e);n.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(d.cellEditor.textarea,"input",c);mxEvent.addListener(d.cellEditor.textarea,"touchend",c);mxEvent.addListener(d.cellEditor.textarea,"mouseup",c);mxEvent.addListener(d.cellEditor.textarea,"keyup",c);c()}};var z=d.cellEditor.stopEditing;d.cellEditor.stopEditing=function(a, -c){z.apply(this,arguments);t()};d.container.setAttribute("tabindex","0");d.container.style.cursor="default";if(window.self===window.top&&null!=d.container.parentNode)try{d.container.focus()}catch(K){}var A=d.fireMouseEvent;d.fireMouseEvent=function(a,c,e){a==mxEvent.MOUSE_DOWN&&this.container.focus();A.apply(this,arguments)};d.popupMenuHandler.autoExpand=!0;null!=this.menus&&(d.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,c,e){this.menus.createPopupMenu(a,c,e)}));mxEvent.addGestureListeners(document, +c){z.apply(this,arguments);u()};d.container.setAttribute("tabindex","0");d.container.style.cursor="default";if(window.self===window.top&&null!=d.container.parentNode)try{d.container.focus()}catch(K){}var A=d.fireMouseEvent;d.fireMouseEvent=function(a,c,e){a==mxEvent.MOUSE_DOWN&&this.container.focus();A.apply(this,arguments)};d.popupMenuHandler.autoExpand=!0;null!=this.menus&&(d.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,c,e){this.menus.createPopupMenu(a,c,e)}));mxEvent.addGestureListeners(document, mxUtils.bind(this,function(a){d.popupMenuHandler.hideMenu()}));this.keyHandler=this.createKeyHandler(a);this.getKeyHandler=function(){return keyHandler};var q="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),F="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){try{var c=d.view.getState(a);if(null!=c){var e=a.clone();e.style="";var b=d.getCellStyle(e);a=[];var e=[],k;for(k in c.style)b[k]!=c.style[k]&&(a.push(c.style[k]), -e.push(k));for(var g=d.getModel().getStyle(c.cell),f=null!=g?g.split(";"):[],g=0;g<f.length;g++){var u=f[g],n=u.indexOf("=");if(0<=n){k=u.substring(0,n);var C=u.substring(n+1);null!=b[k]&&"none"==C&&(a.push(C),e.push(k))}}d.getModel().isEdge(c.cell)?d.currentEdgeStyle={}:d.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",e,"values",a,"cells",[c.cell]))}}catch(G){this.handleError(G)}};this.clearDefaultStyle=function(){d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle); -d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var x=["fontFamily","fontSize","fontColor"],E="edgeStyle startArrow startFill startSize endArrow endFill endSize".split(" "),u=["startArrow startFill startSize sourcePerimeterSpacing endArrow endFill endSize targetPerimeterSpacing".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],x,["opacity"],["align"],["html"]];for(a=0;a<u.length;a++)for(b= -0;b<u[a].length;b++)q.push(u[a][b]);for(a=0;a<F.length;a++)0>mxUtils.indexOf(q,F[a])&&q.push(F[a]);var C=function(a,c){var e=d.getModel();e.beginUpdate();try{if(c)for(var b=e.isEdge(n),k=b?d.currentEdgeStyle:d.currentVertexStyle,b=["fontSize","fontFamily","fontColor"],g=0;g<b.length;g++){var f=k[b[g]];null!=f&&d.setCellStyles(b[g],f,a)}else for(f=0;f<a.length;f++){for(var n=a[f],C=e.getStyle(n),t=null!=C?C.split(";"):[],z=q.slice(),g=0;g<t.length;g++){var l=t[g],A=l.indexOf("=");if(0<=A){var x=l.substring(0, -A),ca=mxUtils.indexOf(z,x);0<=ca&&z.splice(ca,1);for(var K=0;K<u.length;K++){var m=u[K];if(0<=mxUtils.indexOf(m,x))for(var v=0;v<m.length;v++){var Y=mxUtils.indexOf(z,m[v]);0<=Y&&z.splice(Y,1)}}}}for(var k=(b=e.isEdge(n))?d.currentEdgeStyle:d.currentVertexStyle,p=e.getStyle(n),g=0;g<z.length;g++){var x=z[g],E=k[x];null==E||"shape"==x&&!b||b&&!(0>mxUtils.indexOf(F,x))||(p=mxUtils.setStyle(p,x,E))}e.setStyle(n,p)}}finally{e.endUpdate()}};d.addListener("cellsInserted",function(a,c){C(c.getProperty("cells"))}); +e.push(k));for(var g=d.getModel().getStyle(c.cell),f=null!=g?g.split(";"):[],g=0;g<f.length;g++){var t=f[g],n=t.indexOf("=");if(0<=n){k=t.substring(0,n);var u=t.substring(n+1);null!=b[k]&&"none"==u&&(a.push(u),e.push(k))}}d.getModel().isEdge(c.cell)?d.currentEdgeStyle={}:d.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",e,"values",a,"cells",[c.cell]))}}catch(G){this.handleError(G)}};this.clearDefaultStyle=function(){d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle); +d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var x=["fontFamily","fontSize","fontColor"],E="edgeStyle startArrow startFill startSize endArrow endFill endSize".split(" "),t=["startArrow startFill startSize sourcePerimeterSpacing endArrow endFill endSize targetPerimeterSpacing".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],x,["opacity"],["align"],["html"]];for(a=0;a<t.length;a++)for(b= +0;b<t[a].length;b++)q.push(t[a][b]);for(a=0;a<F.length;a++)0>mxUtils.indexOf(q,F[a])&&q.push(F[a]);var C=function(a,c){var e=d.getModel();e.beginUpdate();try{if(c)for(var b=e.isEdge(n),k=b?d.currentEdgeStyle:d.currentVertexStyle,b=["fontSize","fontFamily","fontColor"],g=0;g<b.length;g++){var f=k[b[g]];null!=f&&d.setCellStyles(b[g],f,a)}else for(f=0;f<a.length;f++){for(var n=a[f],u=e.getStyle(n),C=null!=u?u.split(";"):[],z=q.slice(),g=0;g<C.length;g++){var l=C[g],A=l.indexOf("=");if(0<=A){var x=l.substring(0, +A),ca=mxUtils.indexOf(z,x);0<=ca&&z.splice(ca,1);for(var K=0;K<t.length;K++){var m=t[K];if(0<=mxUtils.indexOf(m,x))for(var v=0;v<m.length;v++){var Y=mxUtils.indexOf(z,m[v]);0<=Y&&z.splice(Y,1)}}}}for(var k=(b=e.isEdge(n))?d.currentEdgeStyle:d.currentVertexStyle,p=e.getStyle(n),g=0;g<z.length;g++){var x=z[g],E=k[x];null==E||"shape"==x&&!b||b&&!(0>mxUtils.indexOf(F,x))||(p=mxUtils.setStyle(p,x,E))}e.setStyle(n,p)}}finally{e.endUpdate()}};d.addListener("cellsInserted",function(a,c){C(c.getProperty("cells"))}); d.addListener("textInserted",function(a,c){C(c.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(a,c){var e=[c.getProperty("cell")];c.getProperty("terminalInserted")&&e.push(c.getProperty("terminal"));C(e)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var e=c.getProperty("cells"),b=!1,k=!1;if(0<e.length)for(var g=0;g<e.length&&(b=d.getModel().isVertex(e[g])||b,!(k=d.getModel().isEdge(e[g])||k)||!b);g++);else k=b=!0;for(var e=c.getProperty("keys"), -f=c.getProperty("values"),g=0;g<e.length;g++){var u=0<=mxUtils.indexOf(x,e[g]);if("strokeColor"!=e[g]||null!=f[g]&&"none"!=f[g])if(0<=mxUtils.indexOf(F,e[g]))k||0<=mxUtils.indexOf(E,e[g])?null==f[g]?delete d.currentEdgeStyle[e[g]]:d.currentEdgeStyle[e[g]]=f[g]:b&&0<=mxUtils.indexOf(q,e[g])&&(null==f[g]?delete d.currentVertexStyle[e[g]]:d.currentVertexStyle[e[g]]=f[g]);else if(0<=mxUtils.indexOf(q,e[g])){if(b||u)null==f[g]?delete d.currentVertexStyle[e[g]]:d.currentVertexStyle[e[g]]=f[g];if(k||u|| +f=c.getProperty("values"),g=0;g<e.length;g++){var t=0<=mxUtils.indexOf(x,e[g]);if("strokeColor"!=e[g]||null!=f[g]&&"none"!=f[g])if(0<=mxUtils.indexOf(F,e[g]))k||0<=mxUtils.indexOf(E,e[g])?null==f[g]?delete d.currentEdgeStyle[e[g]]:d.currentEdgeStyle[e[g]]=f[g]:b&&0<=mxUtils.indexOf(q,e[g])&&(null==f[g]?delete d.currentVertexStyle[e[g]]:d.currentVertexStyle[e[g]]=f[g]);else if(0<=mxUtils.indexOf(q,e[g])){if(b||t)null==f[g]?delete d.currentVertexStyle[e[g]]:d.currentVertexStyle[e[g]]=f[g];if(k||t|| 0<=mxUtils.indexOf(E,e[g]))null==f[g]?delete d.currentEdgeStyle[e[g]]:d.currentEdgeStyle[e[g]]=f[g]}}null!=this.toolbar&&(this.toolbar.setFontName(d.currentVertexStyle.fontFamily||Menus.prototype.defaultFont),this.toolbar.setFontSize(d.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==d.currentEdgeStyle.edgeStyle&&"1"==d.currentEdgeStyle.curved?"geSprite geSprite-curved": "straight"==d.currentEdgeStyle.edgeStyle||"none"==d.currentEdgeStyle.edgeStyle||null==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==d.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==d.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"): "geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==d.currentEdgeStyle.shape?"geSprite geSprite-linkedge":"flexArrow"==d.currentEdgeStyle.shape?"geSprite geSprite-arrow":"arrow"==d.currentEdgeStyle.shape?"geSprite geSprite-simplearrow":"geSprite geSprite-connection"),null!=this.toolbar.lineStartMenu&&(this.toolbar.lineStartMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("start",d.currentEdgeStyle.shape, @@ -2123,9 +2123,9 @@ EditorUi.prototype.initClipboard=function(){var a=this,b=mxClipboard.cut;mxClipb 0),k=0;k<m.length;k++)c.add(e,m[k]);b.updateCustomLinks(b.createCellMapping(f,l),m);mxClipboard.insertCount=1;mxClipboard.setCells(m)}a.updatePasteActionStates();return d};var f=mxClipboard.paste;mxClipboard.paste=function(b){var d=null;b.cellEditor.isContentEditing()?document.execCommand("paste",!1,null):d=f.apply(this,arguments);a.updatePasteActionStates();return d};var d=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){d.apply(this,arguments);a.updatePasteActionStates()}; var l=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(b,d){l.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20; EditorUi.prototype.initCanvas=function(){var a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var a=this.graph.getPageLayout(),c=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*c.width),this.scale*(this.translate.y+a.y*c.height),this.scale*a.width*c.width, -this.scale*a.height*c.height)};a.getPreferredPageSize=function(a,c,e){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var b=null,f=this;if(this.editor.isChromelessView()){this.chromelessResize=b=mxUtils.bind(this,function(c,e,b,d){if(null!=a.container&&!a.isViewer()){b=null!=b?b:0;d=null!=d?d:0;var k=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),g=mxUtils.hasScrollbars(a.container),f=a.view.translate,u=a.view.scale,n=mxRectangle.fromRectangle(k); -n.x=n.x/u-f.x;n.y=n.y/u-f.y;n.width/=u;n.height/=u;var f=a.container.scrollTop,C=a.container.scrollLeft,t=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)t+=3;var q=a.container.offsetWidth-t,t=a.container.offsetHeight-t;c=c?Math.max(.3,Math.min(e||1,q/n.width)):u;e=(q-c*n.width)/2/c;var z=0==this.lightboxVerticalDivider?0:(t-c*n.height)/this.lightboxVerticalDivider/c;g&&(e=Math.max(e,0),z=Math.max(z,0));if(g||k.width<q||k.height<t)a.view.scaleAndTranslate(c, -Math.floor(e-n.x),Math.floor(z-n.y)),a.container.scrollTop=f*c/u,a.container.scrollLeft=C*c/u;else if(0!=b||0!=d)k=a.view.translate,a.view.setTranslate(Math.floor(k.x+b/u),Math.floor(k.y+d/u))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var d=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",d);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",d)});this.editor.addListener("resetGraphView", +this.scale*a.height*c.height)};a.getPreferredPageSize=function(a,c,e){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var b=null,f=this;if(this.editor.isChromelessView()){this.chromelessResize=b=mxUtils.bind(this,function(c,e,b,d){if(null!=a.container&&!a.isViewer()){b=null!=b?b:0;d=null!=d?d:0;var k=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),g=mxUtils.hasScrollbars(a.container),f=a.view.translate,t=a.view.scale,n=mxRectangle.fromRectangle(k); +n.x=n.x/t-f.x;n.y=n.y/t-f.y;n.width/=t;n.height/=t;var f=a.container.scrollTop,u=a.container.scrollLeft,C=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)C+=3;var q=a.container.offsetWidth-C,C=a.container.offsetHeight-C;c=c?Math.max(.3,Math.min(e||1,q/n.width)):t;e=(q-c*n.width)/2/c;var z=0==this.lightboxVerticalDivider?0:(C-c*n.height)/this.lightboxVerticalDivider/c;g&&(e=Math.max(e,0),z=Math.max(z,0));if(g||k.width<q||k.height<C)a.view.scaleAndTranslate(c, +Math.floor(e-n.x),Math.floor(z-n.y)),a.container.scrollTop=f*c/t,a.container.scrollLeft=u*c/t;else if(0!=b||0!=d)k=a.view.translate,a.view.setTranslate(Math.floor(k.x+b/t),Math.floor(k.y+d/t))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var d=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",d);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",d)});this.editor.addListener("resetGraphView", mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(c){a.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(c){a.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var l=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden"; this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left=a.isViewer()?"0":"50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var m=mxUtils.bind(this,function(){var c= mxUtils.getCurrentStyle(a.container);a.isViewer()?this.chromelessToolbar.style.top="0":this.chromelessToolbar.style.bottom=(null!=c?parseInt(c["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",m);m();var p=0,m=mxUtils.bind(this,function(a,c,e){p++;var b=document.createElement("span");b.style.paddingLeft="8px";b.style.paddingRight="8px";b.style.cursor="pointer";mxEvent.addListener(b,"click",a);null!=e&&b.setAttribute("title", @@ -2133,7 +2133,7 @@ e);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute(" y.style.display="inline-block";y.style.verticalAlign="top";y.style.fontFamily="Helvetica,Arial";y.style.marginTop="8px";y.style.fontSize="14px";y.style.color="#ffffff";this.chromelessToolbar.appendChild(y);var B=m(mxUtils.bind(this,function(a){this.actions.get("nextPage").funct();mxEvent.consume(a)}),Editor.nextLargeImage,mxResources.get("nextPage")),c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&(y.innerHTML="",mxUtils.write(y,mxUtils.indexOf(this.pages, this.currentPage)+1+" / "+this.pages.length))});v.style.paddingLeft="0px";v.style.paddingRight="4px";B.style.paddingLeft="4px";B.style.paddingRight="0px";var e=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(B.style.display="",v.style.display="",y.style.display="inline-block"):(B.style.display="none",v.style.display="none",y.style.display="none");c()});this.editor.addListener("resetGraphView",e);this.editor.addListener("pageSelected",c);m(mxUtils.bind(this, function(a){this.actions.get("zoomOut").funct();mxEvent.consume(a)}),Editor.zoomOutLargeImage,mxResources.get("zoomOut")+" (Alt+Mousewheel)");m(mxUtils.bind(this,function(a){this.actions.get("zoomIn").funct();mxEvent.consume(a)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");m(mxUtils.bind(this,function(c){a.isLightboxView()?(1==a.view.scale?this.lightboxFit():a.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(c)}),Editor.actualSizeLargeImage, -mxResources.get("fit"));var k=null,t=null,n=mxUtils.bind(this,function(a){null!=k&&(window.clearTimeout(k),fadeThead=null);null!=t&&(window.clearTimeout(t),fadeThead2=null);k=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);k=null;t=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";t=null}),600)}),a||200)}),g=mxUtils.bind(this,function(a){null!=k&&(window.clearTimeout(k),fadeThead=null);null!=t&&(window.clearTimeout(t), +mxResources.get("fit"));var k=null,u=null,n=mxUtils.bind(this,function(a){null!=k&&(window.clearTimeout(k),fadeThead=null);null!=u&&(window.clearTimeout(u),fadeThead2=null);k=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);k=null;u=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";u=null}),600)}),a||200)}),g=mxUtils.bind(this,function(a){null!=k&&(window.clearTimeout(k),fadeThead=null);null!=u&&(window.clearTimeout(u), fadeThead2=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,a||30)});if("1"==urlParams.layers){this.layersDialog=null;var z=m(mxUtils.bind(this,function(c){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog();mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog= null}));var e=z.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius","5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily="Helvetica,Arial";this.layersDialog.style.backgroundColor="#000000";this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.color="#ffffff";mxUtils.setOpacity(this.layersDialog,70);this.layersDialog.style.left=e.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+ this.chromelessToolbar.offsetHeight+4+"px";e=mxUtils.getCurrentStyle(this.editor.graph.container);this.layersDialog.style.zIndex=e.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(c)}),Editor.layersLargeImage,mxResources.get("layers")),A=a.getModel();A.addListener(mxEvent.CHANGE,function(){z.style.display=1<A.getChildCount(A.root)?"":"none"})}this.addChromelessToolbarItems(m);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||m(mxUtils.bind(this,function(c){null!= @@ -2144,10 +2144,10 @@ g(30),n())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"po g(30)}));var F=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(c,e){this.startX=e.getGraphX();this.startY=e.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,e){mxEvent.isTouchEvent(e.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<F&&Math.abs(this.scrollTop-a.container.scrollTop)<F&&Math.abs(this.startX-e.getGraphX())<F&&Math.abs(this.startY-e.getGraphY())< F&&(0<parseFloat(f.chromelessToolbar.style.opacity||0)?n():g(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var x=a.view.validate;a.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var a=this.graph.getPagePadding(),c=this.graph.getPageSize();this.translate.x=a.x-(this.x0||0)*c.width;this.translate.y=a.y-(this.y0||0)*c.height}x.apply(this,arguments)};if(!a.isViewer()){var E=a.sizeDidChange;a.sizeDidChange= function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var c=this.getPageLayout(),e=this.getPagePadding(),b=this.getPageSize(),d=Math.ceil(2*e.x+c.width*b.width),k=Math.ceil(2*e.y+c.height*b.height),g=a.minimumGraphSize;if(null==g||g.width!=d||g.height!=k)a.minimumGraphSize=new mxRectangle(0,0,d,k);d=e.x-c.x*b.width;e=e.y-c.y*b.height;this.autoTranslate||this.view.translate.x==d&&this.view.translate.y==e?E.apply(this,arguments):(this.autoTranslate=!0,this.view.x0=c.x,this.view.y0= -c.y,c=a.view.translate.x,b=a.view.translate.y,a.view.setTranslate(d,e),a.container.scrollLeft+=Math.round((d-c)*a.view.scale),a.container.scrollTop+=Math.round((e-b)*a.view.scale),this.autoTranslate=!1)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}a.updateZoomTimeout=null;a.cumulativeZoomFactor=1;var u=null;a.lazyZoom=function(c){null!=this.updateZoomTimeout&&window.clearTimeout(this.updateZoomTimeout);c?.15>this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor= +c.y,c=a.view.translate.x,b=a.view.translate.y,a.view.setTranslate(d,e),a.container.scrollLeft+=Math.round((d-c)*a.view.scale),a.container.scrollTop+=Math.round((e-b)*a.view.scale),this.autoTranslate=!1)}else this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",this.getGraphBounds()))}}}a.updateZoomTimeout=null;a.cumulativeZoomFactor=1;var t=null;a.lazyZoom=function(c){null!=this.updateZoomTimeout&&window.clearTimeout(this.updateZoomTimeout);c?.15>this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor= (this.view.scale+.01)/this.view.scale:(this.cumulativeZoomFactor*=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale):.15>=this.view.scale*this.cumulativeZoomFactor?this.cumulativeZoomFactor=(this.view.scale-.01)/this.view.scale:(this.cumulativeZoomFactor/=this.zoomFactor,this.cumulativeZoomFactor=Math.round(this.view.scale*this.cumulativeZoomFactor*20)/20/this.view.scale);this.cumulativeZoomFactor=Math.max(.01,Math.min(this.view.scale* -this.cumulativeZoomFactor,160)/this.view.scale);this.updateZoomTimeout=window.setTimeout(mxUtils.bind(this,function(){var c=mxUtils.getOffset(a.container),e=0,d=0;null!=u&&(e=a.container.offsetWidth/2-u.x+c.x,d=a.container.offsetHeight/2-u.y+c.y);c=this.view.scale;this.zoom(this.cumulativeZoomFactor);this.view.scale!=c&&(null!=b&&f.chromelessResize(!1,null,e*(this.cumulativeZoomFactor-1),d*(this.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(a.container)||0==e&&0==d||(a.container.scrollLeft-=e*(this.cumulativeZoomFactor- -1),a.container.scrollTop-=d*(this.cumulativeZoomFactor-1)));this.cumulativeZoomFactor=1;this.updateZoomTimeout=null}),this.lazyZoomDelay)};mxEvent.addMouseWheelListener(mxUtils.bind(this,function(c,e){if((null==this.dialogs||0==this.dialogs.length)&&a.isZoomWheelEvent(c))for(var b=mxEvent.getSource(c);null!=b;){if(b==a.container)return u=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c)),a.lazyZoom(e),mxEvent.consume(c),!1;b=b.parentNode}}),a.container)}; +this.cumulativeZoomFactor,160)/this.view.scale);this.updateZoomTimeout=window.setTimeout(mxUtils.bind(this,function(){var c=mxUtils.getOffset(a.container),e=0,d=0;null!=t&&(e=a.container.offsetWidth/2-t.x+c.x,d=a.container.offsetHeight/2-t.y+c.y);c=this.view.scale;this.zoom(this.cumulativeZoomFactor);this.view.scale!=c&&(null!=b&&f.chromelessResize(!1,null,e*(this.cumulativeZoomFactor-1),d*(this.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(a.container)||0==e&&0==d||(a.container.scrollLeft-=e*(this.cumulativeZoomFactor- +1),a.container.scrollTop-=d*(this.cumulativeZoomFactor-1)));this.cumulativeZoomFactor=1;this.updateZoomTimeout=null}),this.lazyZoomDelay)};mxEvent.addMouseWheelListener(mxUtils.bind(this,function(c,e){if((null==this.dialogs||0==this.dialogs.length)&&a.isZoomWheelEvent(c))for(var b=mxEvent.getSource(c);null!=b;){if(b==a.container)return t=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c)),a.lazyZoom(e),mxEvent.consume(c),!1;b=b.parentNode}}),a.container)}; EditorUi.prototype.addChromelessToolbarItems=function(a){a(mxUtils.bind(this,function(a){this.actions.get("print").funct();mxEvent.consume(a)}),Editor.printLargeImage,mxResources.get("print"))}; EditorUi.prototype.createTemporaryGraph=function(a){a=new Graph(document.createElement("div"),null,null,a);a.resetViewOnRootChange=!1;a.setConnectable(!1);a.gridEnabled=!1;a.autoScroll=!1;a.setTooltips(!1);a.setEnabled(!1);a.container.style.visibility="hidden";a.container.style.position="absolute";a.container.style.overflow="hidden";a.container.style.height="1px";a.container.style.width="1px";return a}; EditorUi.prototype.addChromelessClickHandler=function(){var a=urlParams.highlight;null!=a&&0<a.length&&(a="#"+a);this.editor.graph.addClickHandler(a)};EditorUi.prototype.toggleFormatPanel=function(a){null!=this.format&&(this.formatWidth=a||0<this.formatWidth?0:240,this.formatContainer.style.display=a||0<this.formatWidth?"":"none",this.refresh(),this.format.refresh(),this.fireEvent(new mxEventObject("formatWidthChanged")))}; @@ -2239,16 +2239,16 @@ g=0:mxUtils.contains(g,d[d.length-1].x,d[d.length-1].y)?g=k.bends.length-1:null! null;d=b.absolutePoints;if(null!=d)if(g=new mxRectangle(e.getGraphX(),e.getGraphY()),g.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=b.text&&null!=b.text.boundingBox&&mxUtils.contains(b.text.boundingBox,e.getGraphX(),e.getGraphY()))k="move";else if(mxUtils.contains(g,d[0].x,d[0].y)||mxUtils.contains(g,d[d.length-1].x,d[d.length-1].y))k="pointer";else if(null!=b.visibleSourceState||null!=b.visibleTargetState)f=this.view.getEdgeStyle(b),k="crosshair",f!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(b)&& (f=mxUtils.findNearestSegment(b,e.getGraphX(),e.getGraphY()),f<d.length-1&&0<=f&&(k=0==Math.round(d[f].x-d[f+1].x)?"col-resize":"row-resize"));null!=k&&b.setCursor(k)}}),mouseUp:mxUtils.bind(this,function(a,c){B=p=v=y=null})})}this.cellRenderer.getLabelValue=function(a){var c=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);a.view.graph.isHtmlLabel(a.cell)&&(c=1!=a.style.html?mxUtils.htmlEntities(c,!1):a.view.graph.sanitizeHtml(c));return c};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0); this.setDropEnabled(!0);this.setPanning(!0);this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(a,c){return!1};this.alternateEdgeStyle="vertical";null==d&&this.loadStylesheet();var e=this.graphHandler.getGuideStates; -this.graphHandler.getGuideStates=function(){var a=e.apply(this,arguments);if(this.graph.pageVisible){for(var c=[],b=this.graph.pageFormat,d=this.graph.pageScale,k=b.width*d,b=b.height*d,d=this.graph.view.translate,g=this.graph.view.scale,f=this.graph.getPageLayout(),u=0;u<f.width;u++)c.push(new mxRectangle(((f.x+u)*k+d.x)*g,(f.y*b+d.y)*g,k*g,b*g));for(u=0;u<f.height;u++)c.push(new mxRectangle((f.x*k+d.x)*g,((f.y+u)*b+d.y)*g,k*g,b*g));a=c.concat(a)}return a};mxDragSource.prototype.dragElementZIndex= +this.graphHandler.getGuideStates=function(){var a=e.apply(this,arguments);if(this.graph.pageVisible){for(var c=[],b=this.graph.pageFormat,d=this.graph.pageScale,k=b.width*d,b=b.height*d,d=this.graph.view.translate,g=this.graph.view.scale,f=this.graph.getPageLayout(),t=0;t<f.width;t++)c.push(new mxRectangle(((f.x+t)*k+d.x)*g,(f.y*b+d.y)*g,k*g,b*g));for(t=0;t<f.height;t++)c.push(new mxRectangle((f.x*k+d.x)*g,((f.y+t)*b+d.y)*g,k*g,b*g));a=c.concat(a)}return a};mxDragSource.prototype.dragElementZIndex= mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=function(a,c){return null==a.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(a){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};this.graphHandler.getCells=function(a){for(var c=mxGraphHandler.prototype.getCells.apply(this,arguments),b=[],e=0;e<c.length;e++){var d=this.graph.view.getState(c[e]), d=null!=d?d.style:this.graph.getCellStyle(c[e]);"1"==mxUtils.getValue(d,"part","0")?(d=this.graph.model.getParent(c[e]),this.graph.model.isVertex(d)&&0>mxUtils.indexOf(c,d)&&b.push(d)):b.push(c[e])}return b};this.connectionHandler.createTargetVertex=function(a,c){var b=this.graph.view.getState(c),b=null!=b?b.style:this.graph.getCellStyle(c);mxUtils.getValue(b,"part",!1)&&(b=this.graph.model.getParent(c),this.graph.model.isVertex(b)&&(c=b));return mxConnectionHandler.prototype.createTargetVertex.apply(this, -arguments)};var k=new mxRubberband(this);this.getRubberband=function(){return k};var t=(new Date).getTime(),n=0,g=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;g.apply(this,arguments);a!=this.currentState?(t=(new Date).getTime(),n=0):n=(new Date).getTime()-t};var z=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<n||(null== +arguments)};var k=new mxRubberband(this);this.getRubberband=function(){return k};var u=(new Date).getTime(),n=0,g=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;g.apply(this,arguments);a!=this.currentState?(u=(new Date).getTime(),n=0):n=(new Date).getTime()-u};var z=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3<n||(null== this.currentState||"0"!=mxUtils.getValue(this.currentState.style,"outlineConnect","1"))&&z.apply(this,arguments)};var A=this.isToggleEvent;this.isToggleEvent=function(a){return A.apply(this,arguments)||!mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(a)};var q=k.isForceRubberbandEvent;k.isForceRubberbandEvent=function(a){return q.apply(this,arguments)||mxClient.IS_CHROMEOS&&mxEvent.isShiftDown(a.getEvent())||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&& mxEvent.isTouchEvent(a.getEvent())};var F=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&(F=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=F)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var x=this.click;this.click= function(a){var c=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);if(this.isEnabled()&&!c||a.isConsumed())return x.apply(this,arguments);var b=c?a.sourceState.cell:a.getCell();null!=b&&(b=this.getLinkForCell(b),null!=b&&(this.isCustomLink(b)?this.customLinkClicked(b):this.openLink(b)));this.isEnabled()&&c&&this.clearSelection()};this.tooltipHandler.getStateForEvent=function(a){return a.sourceState};this.getCursorForMouseEvent=function(a){var c=null==a.state&&null!=a.sourceState&& this.isCellLocked(a.sourceState.cell);return this.getCursorForCell(c?a.sourceState.cell:a.getCell())};var E=this.getCursorForCell;this.getCursorForCell=function(a){if(!this.isEnabled()||this.isCellLocked(a)){if(null!=this.getLinkForCell(a))return"pointer";if(this.isCellLocked(a))return"default"}return E.apply(this,arguments)};this.selectRegion=function(a,c){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,c);return b};this.getAllCells=function(a,c,b,e,d,k){k=null!=k?k:[]; -if(0<b||0<e){var g=this.getModel(),f=a+b,u=c+e;null==d&&(d=this.getCurrentRoot(),null==d&&(d=g.getRoot()));if(null!=d)for(var n=g.getChildCount(d),t=0;t<n;t++){var q=g.getChildAt(d,t),C=this.view.getState(q);if(null!=C&&this.isCellVisible(q)&&"1"!=mxUtils.getValue(C.style,"locked","0")){var ca=mxUtils.getValue(C.style,mxConstants.STYLE_ROTATION)||0;0!=ca&&(C=mxUtils.getBoundingBox(C,ca));(g.isEdge(q)||g.isVertex(q))&&C.x>=a&&C.y+C.height<=u&&C.y>=c&&C.x+C.width<=f&&k.push(q);this.getAllCells(a,c, -b,e,q,k)}}}return k};var u=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?!1:u.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var C=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b= +if(0<b||0<e){var g=this.getModel(),f=a+b,t=c+e;null==d&&(d=this.getCurrentRoot(),null==d&&(d=g.getRoot()));if(null!=d)for(var n=g.getChildCount(d),u=0;u<n;u++){var q=g.getChildAt(d,u),C=this.view.getState(q);if(null!=C&&this.isCellVisible(q)&&"1"!=mxUtils.getValue(C.style,"locked","0")){var ca=mxUtils.getValue(C.style,mxConstants.STYLE_ROTATION)||0;0!=ca&&(C=mxUtils.getBoundingBox(C,ca));(g.isEdge(q)||g.isVertex(q))&&C.x>=a&&C.y+C.height<=t&&C.y>=c&&C.x+C.width<=f&&k.push(q);this.getAllCells(a,c, +b,e,q,k)}}}return k};var t=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?!1:t.apply(this,arguments)};this.isCellLocked=function(a){for(a=this.view.getState(a);null!=a;){if("1"==mxUtils.getValue(a.style,"locked","0"))return!0;a=this.view.getState(this.model.getParent(a.cell))}return!1};var C=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b= c.getProperty("event").getState();C=null==b||this.isSelectionEmpty()||this.isCellSelected(b.cell)?null:this.getSelectionCells()}}));this.addListener(mxEvent.TAP_AND_HOLD,mxUtils.bind(this,function(a,c){if(!mxEvent.isMultiTouchEvent(c)){var b=c.getProperty("event"),e=c.getProperty("cell");null==e?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),k.start(b.x,b.y)):null!=C?this.addSelectionCells(C):1<this.getSelectionCount()&&this.isCellSelected(e)&&this.removeSelectionCell(e); C=null;c.consume()}}));this.connectionHandler.selectCells=function(a,c){this.graph.setSelectionCell(c||a)};this.connectionHandler.constraintHandler.isStateIgnored=function(a,c){return c&&a.view.graph.isCellSelected(a.cell)};this.selectionModel.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){var a=this.connectionHandler.constraintHandler;null!=a.currentFocus&&a.isStateIgnored(a.currentFocus,!0)&&(a.currentFocus=null,a.constraints=null,a.destroyIcons());a.destroyFocusHighlight()}));Graph.touchStyle&& this.initTouch();var K=this.updateMouseEvent;this.updateMouseEvent=function(a){a=K.apply(this,arguments);null!=a.state&&this.isCellLocked(a.getCell())&&(a.state=null);return a}}this.currentTranslate=new mxPoint(0,0)};Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch; @@ -2285,8 +2285,8 @@ Graph.prototype.isLabelMovable=function(a){var b=this.view.getState(a),b=null!=b Graph.prototype.getGlobalVariable=function(a){var b=null;"date"==a?b=(new Date).toLocaleDateString():"time"==a?b=(new Date).toLocaleTimeString():"timestamp"==a?b=(new Date).toLocaleString():"date{"==a.substring(0,5)&&(a=a.substring(5,a.length-1),b=this.formatDate(new Date,a));return b}; Graph.prototype.formatDate=function(a,b,f){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy", shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var d=this.dateFormatCache,l=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,m=/[^-+\dA-Z]/g,p=function(a,c){a=String(a);for(c=c||2;a.length<c;)a="0"+a;return a};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)|| -/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(d.masks[b]||b||d.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),f=!0);var v=f?"getUTC":"get",y=a[v+"Date"](),B=a[v+"Day"](),c=a[v+"Month"](),e=a[v+"FullYear"](),k=a[v+"Hours"](),t=a[v+"Minutes"](),n=a[v+"Seconds"](),v=a[v+"Milliseconds"](),g=f?0:a.getTimezoneOffset(),z={d:y,dd:p(y),ddd:d.i18n.dayNames[B],dddd:d.i18n.dayNames[B+7],m:c+1,mm:p(c+1),mmm:d.i18n.monthNames[c],mmmm:d.i18n.monthNames[c+ -12],yy:String(e).slice(2),yyyy:e,h:k%12||12,hh:p(k%12||12),H:k,HH:p(k),M:t,MM:p(t),s:n,ss:p(n),l:p(v,3),L:p(99<v?Math.round(v/10):v),t:12>k?"a":"p",tt:12>k?"am":"pm",T:12>k?"A":"P",TT:12>k?"AM":"PM",Z:f?"UTC":(String(a).match(l)||[""]).pop().replace(m,""),o:(0<g?"-":"+")+p(100*Math.floor(Math.abs(g)/60)+Math.abs(g)%60,4),S:["th","st","nd","rd"][3<y%10?0:(10!=y%100-y%10)*y%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in z?z[a]:a.slice(1, +/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(d.masks[b]||b||d.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),f=!0);var v=f?"getUTC":"get",y=a[v+"Date"](),B=a[v+"Day"](),c=a[v+"Month"](),e=a[v+"FullYear"](),k=a[v+"Hours"](),u=a[v+"Minutes"](),n=a[v+"Seconds"](),v=a[v+"Milliseconds"](),g=f?0:a.getTimezoneOffset(),z={d:y,dd:p(y),ddd:d.i18n.dayNames[B],dddd:d.i18n.dayNames[B+7],m:c+1,mm:p(c+1),mmm:d.i18n.monthNames[c],mmmm:d.i18n.monthNames[c+ +12],yy:String(e).slice(2),yyyy:e,h:k%12||12,hh:p(k%12||12),H:k,HH:p(k),M:u,MM:p(u),s:n,ss:p(n),l:p(v,3),L:p(99<v?Math.round(v/10):v),t:12>k?"a":"p",tt:12>k?"am":"pm",T:12>k?"A":"P",TT:12>k?"AM":"PM",Z:f?"UTC":(String(a).match(l)||[""]).pop().replace(m,""),o:(0<g?"-":"+")+p(100*Math.floor(Math.abs(g)/60)+Math.abs(g)%60,4),S:["th","st","nd","rd"][3<y%10?0:(10!=y%100-y%10)*y%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in z?z[a]:a.slice(1, a.length-1)})}; Graph.prototype.createLayersDialog=function(){var a=document.createElement("div");a.style.position="absolute";for(var b=this.getModel(),f=b.getChildCount(b.root),d=0;d<f;d++)mxUtils.bind(this,function(d){var f=document.createElement("div");f.style.overflow="hidden";f.style.textOverflow="ellipsis";f.style.padding="2px";f.style.whiteSpace="nowrap";var l=document.createElement("input");l.style.display="inline-block";l.setAttribute("type","checkbox");b.isVisible(d)&&(l.setAttribute("checked","checked"), l.defaultChecked=!0);f.appendChild(l);var v=this.convertValueToString(d)||mxResources.get("background")||"Background";f.setAttribute("title",v);mxUtils.write(f,v);a.appendChild(f);mxEvent.addListener(l,"click",function(){null!=l.getAttribute("checked")?l.removeAttribute("checked"):l.setAttribute("checked","checked");b.setVisible(d,l.checked)})})(b.getChildAt(b.root,d));return a}; @@ -2296,7 +2296,7 @@ Graph.prototype.selectCellsForConnectVertex=function(a,b,f){2==a.length&&this.mo Graph.prototype.connectVertex=function(a,b,f,d,l,m){if(a.geometry.relative&&this.model.isEdge(a.parent))return[];m=m?m:!1;var p=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(a.geometry.x,a.geometry.y);b==mxConstants.DIRECTION_NORTH?(p.x+=a.geometry.width/2,p.y-=f):b==mxConstants.DIRECTION_SOUTH?(p.x+=a.geometry.width/2,p.y+=a.geometry.height+f):(p.x=b==mxConstants.DIRECTION_WEST?p.x-f:p.x+(a.geometry.width+ f),p.y+=a.geometry.height/2);f=this.view.getState(this.model.getParent(a));var v=this.view.scale,y=this.view.translate,B=y.x*v,y=y.y*v;null!=f&&this.model.isVertex(f.cell)&&(B=f.x,y=f.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(p.x+=a.parent.geometry.x,p.y+=a.parent.geometry.y);m=m||mxEvent.isControlDown(d)&&!l?null:this.getCellAt(B+p.x*v,y+p.y*v);this.model.isAncestor(m,a)&&(m=null);for(f=m;null!=f;){if(this.isCellLocked(f)){m=null;break}f=this.model.getParent(f)}null!=m&&(f=this.view.getState(a), v=this.view.getState(m),null!=f&&null!=v&&mxUtils.intersects(f,v)&&(m=null));if(l=!mxEvent.isShiftDown(d)||l)b==mxConstants.DIRECTION_NORTH?p.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?p.y+=a.geometry.height/2:p.x=b==mxConstants.DIRECTION_WEST?p.x-a.geometry.width/2:p.x+a.geometry.width/2;null==m||this.isCellConnectable(m)||(f=this.getModel().getParent(m),this.getModel().isVertex(f)&&this.isCellConnectable(f)&&(m=f));if(m==a||this.model.isEdge(m)||!this.isCellConnectable(m))m=null;f=[]; -this.model.beginUpdate();try{v=m;if(null==v&&l){for(var B=a,c=this.getCellGeometry(a);null!=c&&c.relative;)B=this.getModel().getParent(B),c=this.getCellGeometry(B);var e=this.view.getState(B),k=null!=e?e.style:this.getCellStyle(B);if(mxUtils.getValue(k,"part",!1)){var t=this.model.getParent(B);this.model.isVertex(t)&&(B=t)}v=this.duplicateCells([B],!1)[0];c=this.getCellGeometry(v);null!=c&&(c.x=p.x-c.width/2,c.y=p.y-c.height/2)}c=null;null!=this.layoutManager&&(c=this.layoutManager.getLayout(this.model.getParent(a))); +this.model.beginUpdate();try{v=m;if(null==v&&l){for(var B=a,c=this.getCellGeometry(a);null!=c&&c.relative;)B=this.getModel().getParent(B),c=this.getCellGeometry(B);var e=this.view.getState(B),k=null!=e?e.style:this.getCellStyle(B);if(mxUtils.getValue(k,"part",!1)){var u=this.model.getParent(B);this.model.isVertex(u)&&(B=u)}v=this.duplicateCells([B],!1)[0];c=this.getCellGeometry(v);null!=c&&(c.x=p.x-c.width/2,c.y=p.y-c.height/2)}c=null;null!=this.layoutManager&&(c=this.layoutManager.getLayout(this.model.getParent(a))); var n=mxEvent.isControlDown(d)&&l||null==m&&null!=c&&c.constructor==mxStackLayout?null:this.insertEdge(this.model.getParent(a),null,"",a,v,this.createCurrentEdgeStyle());if(null!=n&&this.connectionHandler.insertBeforeSource){var g=null;for(d=a;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=n.parent;)d=this.model.getParent(d);null!=d&&null!=d.parent&&d.parent==n.parent&&(g=d.parent.getIndex(d),this.model.add(d.parent,n,g))}null==m&&null!=v&&null!=c&&null!=a.parent&&c.constructor== mxStackLayout&&b==mxConstants.DIRECTION_WEST&&(g=a.parent.getIndex(a),this.model.add(a.parent,v,g));null!=n&&f.push(n);null==m&&null!=v&&f.push(v);null==v&&null!=n&&n.geometry.setTerminalPoint(p,!1);null!=n&&this.fireEvent(new mxEventObject("cellsInserted","cells",[n]))}finally{this.model.endUpdate()}return f}; Graph.prototype.getIndexableText=function(){var a=document.createElement("div"),b=[],f,d;for(d in this.model.cells)if(f=this.model.cells[d],this.model.isVertex(f)||this.model.isEdge(f))this.isHtmlLabel(f)?(a.innerHTML=this.getLabel(f),f=mxUtils.extractTextWithWhitespace([a])):f=this.getLabel(f),f=mxUtils.trim(f.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<f.length&&b.push(f);return b.join(" ")}; @@ -2351,11 +2351,11 @@ HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.style.portConstra (function(){var a=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){a.apply(this,arguments);this.validEdges=[]};var b=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(a,d){d=null!=d?d:!0;var c=this.getState(a);null!=c&&d&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&!c.invalid&&this.updateLineJumps(c)&&this.graph.cellRenderer.redraw(c,!1,this.isRendering());c=b.apply(this, arguments);null!=c&&d&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(c);return c};var f=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(a,b){return f.apply(this,arguments)||null!=a.routedPoints&&null!=b.routedPoints&&!mxUtils.equalPoints(b.routedPoints,a.routedPoints)};var d=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(a){d.apply(this,arguments);this.graph.model.isEdge(a.cell)&& 1!=a.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var b=a.absolutePoints;if(Graph.lineJumpsEnabled){var c=null!=a.routedPoints,e=null;if(null!=b&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var d=function(c,b,d){var k=new mxPoint(b,d);k.type=c;e.push(k);k=null!=a.routedPoints?a.routedPoints[e.length-1]:null;return null==k||k.type!=c||k.x!=b||k.y!=d},f=.5*this.scale,c=!1,e=[],n=0;n<b.length-1;n++){for(var g= -b[n+1],z=b[n],A=[],q=b[n+2];n<b.length-2&&mxUtils.ptSegDistSq(z.x,z.y,q.x,q.y,g.x,g.y)<1*this.scale*this.scale;)g=q,n++,q=b[n+2];for(var c=d(0,z.x,z.y)||c,l=0;l<this.validEdges.length;l++){var x=this.validEdges[l],v=x.absolutePoints;if(null!=v&&mxUtils.intersects(a,x)&&"1"!=x.style.noJump)for(x=0;x<v.length-1;x++){for(var u=v[x+1],C=v[x],q=v[x+2];x<v.length-2&&mxUtils.ptSegDistSq(C.x,C.y,q.x,q.y,u.x,u.y)<1*this.scale*this.scale;)u=q,x++,q=v[x+2];q=mxUtils.intersection(z.x,z.y,g.x,g.y,C.x,C.y,u.x, -u.y);if(null!=q&&(Math.abs(q.x-z.x)>f||Math.abs(q.y-z.y)>f)&&(Math.abs(q.x-g.x)>f||Math.abs(q.y-g.y)>f)&&(Math.abs(q.x-C.x)>f||Math.abs(q.y-C.y)>f)&&(Math.abs(q.x-u.x)>f||Math.abs(q.y-u.y)>f)){u=q.x-z.x;C=q.y-z.y;q={distSq:u*u+C*C,x:q.x,y:q.y};for(u=0;u<A.length;u++)if(A[u].distSq>q.distSq){A.splice(u,0,q);q=null;break}null==q||0!=A.length&&A[A.length-1].x===q.x&&A[A.length-1].y===q.y||A.push(q)}}}for(x=0;x<A.length;x++)c=d(1,A[x].x,A[x].y)||c}q=b[b.length-1];c=d(0,q.x,q.y)||c}a.routedPoints=e;return c}return!1}; +b[n+1],z=b[n],A=[],q=b[n+2];n<b.length-2&&mxUtils.ptSegDistSq(z.x,z.y,q.x,q.y,g.x,g.y)<1*this.scale*this.scale;)g=q,n++,q=b[n+2];for(var c=d(0,z.x,z.y)||c,l=0;l<this.validEdges.length;l++){var x=this.validEdges[l],v=x.absolutePoints;if(null!=v&&mxUtils.intersects(a,x)&&"1"!=x.style.noJump)for(x=0;x<v.length-1;x++){for(var t=v[x+1],C=v[x],q=v[x+2];x<v.length-2&&mxUtils.ptSegDistSq(C.x,C.y,q.x,q.y,t.x,t.y)<1*this.scale*this.scale;)t=q,x++,q=v[x+2];q=mxUtils.intersection(z.x,z.y,g.x,g.y,C.x,C.y,t.x, +t.y);if(null!=q&&(Math.abs(q.x-z.x)>f||Math.abs(q.y-z.y)>f)&&(Math.abs(q.x-g.x)>f||Math.abs(q.y-g.y)>f)&&(Math.abs(q.x-C.x)>f||Math.abs(q.y-C.y)>f)&&(Math.abs(q.x-t.x)>f||Math.abs(q.y-t.y)>f)){t=q.x-z.x;C=q.y-z.y;q={distSq:t*t+C*C,x:q.x,y:q.y};for(t=0;t<A.length;t++)if(A[t].distSq>q.distSq){A.splice(t,0,q);q=null;break}null==q||0!=A.length&&A[A.length-1].x===q.x&&A[A.length-1].y===q.y||A.push(q)}}}for(x=0;x<A.length;x++)c=d(1,A[x].x,A[x].y)||c}q=b[b.length-1];c=d(0,q.x,q.y)||c}a.routedPoints=e;return c}return!1}; var l=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,b,c){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)l.apply(this,arguments);else{var e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,d=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,f=mxUtils.getValue(this.style, -"jumpStyle","none"),n,g=!0,z=null,A=null;n=[];var q=null;a.begin();for(var v=0;v<this.state.routedPoints.length;v++){var x=this.state.routedPoints[v],m=new mxPoint(x.x/this.scale,x.y/this.scale);0==v?m=b[0]:v==this.state.routedPoints.length-1&&(m=b[b.length-1]);var u=!1;if(null!=z&&1==x.type){var C=this.state.routedPoints[v+1],x=C.x/this.scale-m.x,C=C.y/this.scale-m.y,x=x*x+C*C;null==q&&(q=new mxPoint(m.x-z.x,m.y-z.y),A=Math.sqrt(q.x*q.x+q.y*q.y),0<A?(q.x=q.x*d/A,q.y=q.y*d/A):q=null);x>d*d&&0<A&& -(x=z.x-m.x,C=z.y-m.y,x=x*x+C*C,x>d*d&&(u=new mxPoint(m.x-q.x,m.y-q.y),x=new mxPoint(m.x+q.x,m.y+q.y),n.push(u),this.addPoints(a,n,c,e,!1,null,g),n=0>Math.round(q.x)||0==Math.round(q.x)&&0>=Math.round(q.y)?1:-1,g=!1,"sharp"==f?(a.lineTo(u.x-q.y*n,u.y+q.x*n),a.lineTo(x.x-q.y*n,x.y+q.x*n),a.lineTo(x.x,x.y)):"arc"==f?(n*=1.3,a.curveTo(u.x-q.y*n,u.y+q.x*n,x.x-q.y*n,x.y+q.x*n,x.x,x.y)):(a.moveTo(x.x,x.y),g=!0),n=[x],u=!0))}else q=null;u||(n.push(m),z=m)}this.addPoints(a,n,c,e,!1,null,g);a.stroke()}};var m= +"jumpStyle","none"),n,g=!0,z=null,A=null;n=[];var q=null;a.begin();for(var v=0;v<this.state.routedPoints.length;v++){var x=this.state.routedPoints[v],m=new mxPoint(x.x/this.scale,x.y/this.scale);0==v?m=b[0]:v==this.state.routedPoints.length-1&&(m=b[b.length-1]);var t=!1;if(null!=z&&1==x.type){var C=this.state.routedPoints[v+1],x=C.x/this.scale-m.x,C=C.y/this.scale-m.y,x=x*x+C*C;null==q&&(q=new mxPoint(m.x-z.x,m.y-z.y),A=Math.sqrt(q.x*q.x+q.y*q.y),0<A?(q.x=q.x*d/A,q.y=q.y*d/A):q=null);x>d*d&&0<A&& +(x=z.x-m.x,C=z.y-m.y,x=x*x+C*C,x>d*d&&(t=new mxPoint(m.x-q.x,m.y-q.y),x=new mxPoint(m.x+q.x,m.y+q.y),n.push(t),this.addPoints(a,n,c,e,!1,null,g),n=0>Math.round(q.x)||0==Math.round(q.x)&&0>=Math.round(q.y)?1:-1,g=!1,"sharp"==f?(a.lineTo(t.x-q.y*n,t.y+q.x*n),a.lineTo(x.x-q.y*n,x.y+q.x*n),a.lineTo(x.x,x.y)):"arc"==f?(n*=1.3,a.curveTo(t.x-q.y*n,t.y+q.x*n,x.x-q.y*n,x.y+q.x*n,x.x,x.y)):(a.moveTo(x.x,x.y),g=!0),n=[x],t=!0))}else q=null;t||(n.push(m),z=m)}this.addPoints(a,n,c,e,!1,null,g);a.stroke()}};var m= mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=function(a,b,c,e){if(null==b||null==a||"1"!=b.style.snapToPoint&&"1"!=a.style.snapToPoint)m.apply(this,arguments);else{b=this.getTerminalPort(a,b,e);var d=this.getNextPoint(a,c,e),f=this.graph.isOrthogonal(a),n=mxUtils.toRadians(Number(b.style[mxConstants.STYLE_ROTATION]||"0")),g=new mxPoint(b.getCenterX(),b.getCenterY());if(0!=n)var z=Math.cos(-n),l=Math.sin(-n),d=mxUtils.getRotatedPoint(d,z,l,g); z=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);z+=parseFloat(a.style[e?mxConstants.STYLE_SOURCE_PERIMETER_SPACING:mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);d=this.getPerimeterPoint(b,d,0==n&&f,z);0!=n&&(z=Math.cos(n),l=Math.sin(n),d=mxUtils.getRotatedPoint(d,z,l,g));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,b,c,e,d),e)}};mxGraphView.prototype.snapToAnchorPoint=function(a,b,c,e,d){if(null!=b&&null!=a){a=this.graph.getAllConnectionConstraints(b);e=c=null;if(null!=a)for(var k= 0;k<a.length;k++){var f=this.graph.getConnectionPoint(b,a[k]);if(null!=f){var g=(f.x-d.x)*(f.x-d.x)+(f.y-d.y)*(f.y-d.y);if(null==e||g<e)c=f,e=g}}null!=c&&(d=c)}return d};var p=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(a,b,c){var e=p.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=c.state&&(e=c.state.view.graph.replacePlaceholders(c.state.cell,e));return e};var v=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape= @@ -2377,16 +2377,16 @@ Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",je (a+="comic="+this.currentEdgeStyle.comic+";");null!=this.currentEdgeStyle.jumpStyle&&(a+="jumpStyle="+this.currentEdgeStyle.jumpStyle+";");null!=this.currentEdgeStyle.jumpSize&&(a+="jumpSize="+this.currentEdgeStyle.jumpSize+";");null!=this.currentEdgeStyle.orthogonalLoop?a+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(a+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize? a+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(a+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(a+="elbow="+this.currentEdgeStyle.elbow+";");return a=null!=this.currentEdgeStyle.html?a+("html="+this.currentEdgeStyle.html+";"):a+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var a= null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=a&&(new mxCodec(a.ownerDocument)).decode(a,this.getStylesheet())};Graph.prototype.createCellLookup=function(a,c){c=null!=c?c:{};for(var b=0;b<a.length;b++){var e=a[b];c[mxObjectIdentity.get(e)]=e.getId();for(var d=this.model.getChildCount(e),k=0;k<d;k++)this.createCellLookup([this.model.getChildAt(e,k)],c)}return c};Graph.prototype.createCellMapping= -function(a,c,b){b=null!=b?b:{};for(var e in a){var d=c[e];null==b[d]&&(b[d]=a[e].getId()||"")}return b};Graph.prototype.importGraphModel=function(a,c,b,e){c=null!=c?c:0;b=null!=b?b:0;var d=new mxCodec(a.ownerDocument),k=new mxGraphModel;d.decode(a,k);a=[];var d={},f={},g=k.getChildren(this.cloneCell(k.root,this.isCloneInvalidEdges(),d));if(null!=g){var u=this.createCellLookup([k.root]),g=g.slice();this.model.beginUpdate();try{if(1!=g.length||this.isCellLocked(this.getDefaultParent()))for(k=0;k<g.length;k++)a= -a.concat(this.model.getChildren(this.moveCells([g[k]],c,b,!1,this.model.getRoot())[0]));else a=this.moveCells(k.getChildren(g[0]),c,b,!1,this.getDefaultParent()),f[k.getChildAt(k.root,0).getId()]=this.getDefaultParent().getId();this.createCellMapping(d,u,f);this.updateCustomLinks(f,a);if(e){this.isGridEnabled()&&(c=this.snap(c),b=this.snap(b));var n=this.getBoundingBoxFromGeometry(a,!0);null!=n&&this.moveCells(a,c-n.x,b-n.y)}}finally{this.model.endUpdate()}}return a};Graph.prototype.encodeCells=function(a){for(var c= +function(a,c,b){b=null!=b?b:{};for(var e in a){var d=c[e];null==b[d]&&(b[d]=a[e].getId()||"")}return b};Graph.prototype.importGraphModel=function(a,c,b,e){c=null!=c?c:0;b=null!=b?b:0;var d=new mxCodec(a.ownerDocument),k=new mxGraphModel;d.decode(a,k);a=[];var d={},f={},g=k.getChildren(this.cloneCell(k.root,this.isCloneInvalidEdges(),d));if(null!=g){var t=this.createCellLookup([k.root]),g=g.slice();this.model.beginUpdate();try{if(1!=g.length||this.isCellLocked(this.getDefaultParent()))for(k=0;k<g.length;k++)a= +a.concat(this.model.getChildren(this.moveCells([g[k]],c,b,!1,this.model.getRoot())[0]));else a=this.moveCells(k.getChildren(g[0]),c,b,!1,this.getDefaultParent()),f[k.getChildAt(k.root,0).getId()]=this.getDefaultParent().getId();this.createCellMapping(d,t,f);this.updateCustomLinks(f,a);if(e){this.isGridEnabled()&&(c=this.snap(c),b=this.snap(b));var n=this.getBoundingBoxFromGeometry(a,!0);null!=n&&this.moveCells(a,c-n.x,b-n.y)}}finally{this.model.endUpdate()}}return a};Graph.prototype.encodeCells=function(a){for(var c= {},b=this.cloneCells(a,null,c),e=new mxDictionary,d=0;d<a.length;d++)e.put(a[d],!0);for(d=0;d<b.length;d++){var k=this.view.getState(a[d]);if(null!=k){var f=this.getCellGeometry(b[d]);null==f||!f.relative||this.model.isEdge(a[d])||e.get(this.model.getParent(a[d]))||(f.relative=!1,f.x=k.x/k.view.scale-k.view.translate.x,f.y=k.y/k.view.scale-k.view.translate.y)}}e=new mxCodec;k=new mxGraphModel;f=k.getChildAt(k.getRoot(),0);for(d=0;d<b.length;d++)k.add(f,b[d]);this.updateCustomLinks(this.createCellMapping(c, this.createCellLookup(a)),b);return e.encode(k)};var m=Graph.prototype.moveCells;Graph.prototype.moveCells=function(a,c,b,e,d,k,f){f=null!=f?f:{};var g=m.apply(this,arguments);e&&this.updateCustomLinks(this.createCellMapping(f,this.createCellLookup(a)),g);return g};Graph.prototype.updateCustomLinks=function(a,c){for(var b=0;b<c.length;b++)null!=c[b]&&this.updateCustomLinksForCell(a,c[b])};Graph.prototype.updateCustomLinksForCell=function(a,c){};Graph.prototype.getAllConnectionConstraints=function(a, c){if(null!=a){var b=mxUtils.getValue(a.style,"points",null);if(null!=b){var e=[];try{for(var d=JSON.parse(b),b=0;b<d.length;b++){var k=d[b];e.push(new mxConnectionConstraint(new mxPoint(k[0],k[1]),2<k.length?"0"!=k[2]:!0,null,3<k.length?k[3]:0,4<k.length?k[4]:0))}}catch(R){}return e}if(null!=a.shape&&null!=a.shape.bounds){k=a.shape.direction;d=a.shape.bounds;b=a.shape.scale;e=d.width/b;d=d.height/b;if(k==mxConstants.DIRECTION_NORTH||k==mxConstants.DIRECTION_SOUTH)k=e,e=d,d=k;b=a.shape.getConstraints(a.style, e,d);if(null!=b)return b;if(null!=a.shape.stencil&&null!=a.shape.stencil.constraints)return a.shape.stencil.constraints;if(null!=a.shape.constraints)return a.shape.constraints}}return null};Graph.prototype.flipEdge=function(a){if(null!=a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);null!=c&&(c=mxUtils.getValue(c,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL,this.setCellStyles(mxConstants.STYLE_ELBOW, c,[a]))}};Graph.prototype.isValidRoot=function(a){for(var c=this.model.getChildCount(a),b=0,e=0;e<c;e++){var d=this.model.getChildAt(a,e);this.model.isVertex(d)&&(d=this.getCellGeometry(d),null==d||d.relative||b++)}return 0<b||this.isContainer(a)};Graph.prototype.isValidDropTarget=function(a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);return"1"!=mxUtils.getValue(c,"part","0")&&(this.isContainer(a)||mxGraph.prototype.isValidDropTarget.apply(this,arguments)&&"0"!=mxUtils.getValue(c, "dropTarget","1"))};Graph.prototype.createGroupCell=function(){var a=mxGraph.prototype.createGroupCell.apply(this,arguments);a.setStyle("group");return a};Graph.prototype.isExtendParentsOnAdd=function(a){var c=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(c&&null!=a&&null!=this.layoutManager){var b=this.model.getParent(a);null!=b&&(b=this.layoutManager.getLayout(b),null!=b&&b.constructor==mxStackLayout&&(c=!1))}return c};Graph.prototype.getPreferredSizeForCell=function(a){var c= -mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),b=[];c.beginUpdate();try{for(var e=0;e<a.length;e++){var d=a[e];if(c.isEdge(d)){var k=c.getTerminal(d,!0),f=c.getTerminal(d,!1);c.setTerminal(d,f,!0);c.setTerminal(d,k,!1);var g=c.getGeometry(d);if(null!=g){g=g.clone();null!=g.points&&g.points.reverse();var u= -g.getTerminalPoint(!0),n=g.getTerminalPoint(!1);g.setTerminalPoint(u,!1);g.setTerminalPoint(n,!0);c.setGeometry(d,g);var t=this.view.getState(d),C=this.view.getState(k),q=this.view.getState(f);if(null!=t){var z=null!=C?this.getConnectionConstraint(t,C,!0):null,l=null!=q?this.getConnectionConstraint(t,q,!1):null;this.setConnectionConstraint(d,k,!0,l);this.setConnectionConstraint(d,f,!1,z)}b.push(d)}}else if(c.isVertex(d)&&(g=this.getCellGeometry(d),null!=g)){g=g.clone();g.x+=g.width/2-g.height/2;g.y+= +mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),b=[];c.beginUpdate();try{for(var e=0;e<a.length;e++){var d=a[e];if(c.isEdge(d)){var k=c.getTerminal(d,!0),f=c.getTerminal(d,!1);c.setTerminal(d,f,!0);c.setTerminal(d,k,!1);var g=c.getGeometry(d);if(null!=g){g=g.clone();null!=g.points&&g.points.reverse();var t= +g.getTerminalPoint(!0),n=g.getTerminalPoint(!1);g.setTerminalPoint(t,!1);g.setTerminalPoint(n,!0);c.setGeometry(d,g);var u=this.view.getState(d),C=this.view.getState(k),q=this.view.getState(f);if(null!=u){var z=null!=C?this.getConnectionConstraint(u,C,!0):null,l=null!=q?this.getConnectionConstraint(u,q,!1):null;this.setConnectionConstraint(d,k,!0,l);this.setConnectionConstraint(d,f,!1,z)}b.push(d)}}else if(c.isVertex(d)&&(g=this.getCellGeometry(d),null!=g)){g=g.clone();g.x+=g.width/2-g.height/2;g.y+= g.height/2-g.width/2;var x=g.width;g.width=g.height;g.height=x;c.setGeometry(d,g);var A=this.view.getState(d);if(null!=A){var D=A.style[mxConstants.STYLE_DIRECTION]||"east";"east"==D?D="south":"south"==D?D="west":"west"==D?D="north":"north"==D&&(D="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,D,[d])}b.push(d)}}}finally{c.endUpdate()}return b};Graph.prototype.stencilHasPlaceholders=function(a){if(null!=a&&null!=a.fgNode)for(a=a.fgNode.firstChild;null!=a;){if("text"==a.nodeName&&"1"==a.getAttribute("placeholders"))return!0; a=a.nextSibling}return!1};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var c=this.model.getDescendants(a.cell);if(0<c.length)for(var b=0;b<c.length;b++){var e=this.view.getState(c[b]);null!=e&&null!=e.shape&&null!=e.shape.stencil&&this.stencilHasPlaceholders(e.shape.stencil)?this.removeStateForCell(c[b]):this.isReplacePlaceholders(c[b])&&this.view.invalidate(c[b], !1,!1)}}};Graph.prototype.replaceElement=function(a,c){for(var b=a.ownerDocument.createElement(null!=c?c:"span"),e=Array.prototype.slice.call(a.attributes);attr=e.pop();)b.setAttribute(attr.nodeName,attr.nodeValue);b.innerHTML=a.innerHTML;a.parentNode.replaceChild(b,a)};Graph.prototype.processElements=function(a,c){for(var b=a.getElementsByTagName("*"),e=0;e<b.length;e++)c(b[e])};Graph.prototype.updateLabelElements=function(a,c,b){a=null!=a?a:this.getSelectionCells();for(var e=document.createElement("div"), @@ -2407,18 +2407,18 @@ a.sourceState;if(null==c||null==g.getLinkForCell(c.cell))a=g.getCellAt(a.getGrap this.currentState||c.getState()!=this.currentState&&null!=c.sourceState||!g.intersects(this.currentState,c.getGraphX(),c.getGraphY()))&&this.updateCurrentState(c))}},mouseUp:function(a,e){for(var d=e.getSource(),f=e.getEvent();null!=d&&"a"!=d.nodeName.toLowerCase();)d=d.parentNode;null==d&&Math.abs(this.scrollLeft-g.container.scrollLeft)<k&&Math.abs(this.scrollTop-g.container.scrollTop)<k&&(null==e.sourceState||!e.isSource(e.sourceState.control))&&((mxEvent.isLeftMouseButton(f)||mxEvent.isMiddleMouseButton(f))&& !mxEvent.isPopupTrigger(f)||mxEvent.isTouchEvent(f))&&(null!=this.currentLink?(d=g.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&d||null==c||c(f,this.currentLink),mxEvent.isConsumed(f)||(f=mxEvent.isMiddleMouseButton(f)?"_blank":d?g.linkTarget:"_top",g.openLink(this.currentLink,f),e.consume())):null!=b&&!e.isConsumed()&&Math.abs(this.scrollLeft-g.container.scrollLeft)<k&&Math.abs(this.scrollTop-g.container.scrollTop)<k&&Math.abs(this.startX-e.getGraphX())<k&&Math.abs(this.startY- e.getGraphY())<k&&b(e.getEvent()));this.clear()},activate:function(a){this.currentLink=g.getAbsoluteUrl(g.getLinkForCell(a.cell));null!=this.currentLink&&(g.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(a))},clear:function(){null!=g.container&&(g.container.style.cursor=d);this.currentLink=this.currentState=null;null!=this.highlight&&this.highlight.hide();null!=g.tooltipHandler&&g.tooltipHandler.hide()}};g.click=function(a){};g.addMouseListener(f);mxEvent.addListener(document, -"mouseleave",function(a){f.clear()})};Graph.prototype.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();c=null!=c?c:!0;a=this.model.getTopmostCells(a);var b=this.getModel(),e=this.gridSize,d=[];b.beginUpdate();try{for(var k=this.cloneCells(a,!1,null,!0),g=0;g<a.length;g++){var f=b.getParent(a[g]),u=this.moveCells([k[g]],e,e,!1)[0];d.push(u);if(c)b.add(f,k[g]);else{var n=f.getIndex(a[g]);b.add(f,k[g],n+1)}}}finally{b.endUpdate()}return d};Graph.prototype.insertImage=function(a,c,b){if(null!= +"mouseleave",function(a){f.clear()})};Graph.prototype.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();c=null!=c?c:!0;a=this.model.getTopmostCells(a);var b=this.getModel(),e=this.gridSize,d=[];b.beginUpdate();try{for(var k=this.cloneCells(a,!1,null,!0),g=0;g<a.length;g++){var f=b.getParent(a[g]),t=this.moveCells([k[g]],e,e,!1)[0];d.push(t);if(c)b.add(f,k[g]);else{var n=f.getIndex(a[g]);b.add(f,k[g],n+1)}}}finally{b.endUpdate()}return d};Graph.prototype.insertImage=function(a,c,b){if(null!= a&&null!=this.cellEditor.textarea){for(var e=this.cellEditor.textarea.getElementsByTagName("img"),d=[],k=0;k<e.length;k++)d.push(e[k]);document.execCommand("insertimage",!1,a);a=this.cellEditor.textarea.getElementsByTagName("img");if(a.length==d.length+1)for(k=a.length-1;0<=k;k--)if(0==k||a[k]!=d[k-1]){a[k].setAttribute("width",c);a[k].setAttribute("height",b);break}}};Graph.prototype.insertLink=function(a){if(null!=this.cellEditor.textarea)if(0==a.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var c= this.cellEditor.textarea.getElementsByTagName("a"),b=[],e=0;e<c.length;e++)b.push(c[e]);document.execCommand("createlink",!1,mxUtils.trim(a));c=this.cellEditor.textarea.getElementsByTagName("a");if(c.length==b.length+1)for(e=c.length-1;0<=e;e--)if(c[e]!=b[e-1]){for(c=c[e].getElementsByTagName("a");0<c.length;){for(b=c[0].parentNode;null!=c[0].firstChild;)b.insertBefore(c[0].firstChild,c[0]);b.removeChild(c[0])}break}}else document.execCommand("createlink",!1,mxUtils.trim(a))};Graph.prototype.isCellResizable= function(a){var c=mxGraph.prototype.isCellResizable.apply(this,arguments),b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return c||"0"!=mxUtils.getValue(b,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==b[mxConstants.STYLE_WHITE_SPACE]};Graph.prototype.distributeCells=function(a,c){null==c&&(c=this.getSelectionCells());if(null!=c&&1<c.length){for(var b=[],e=null,d=null,k=0;k<c.length;k++)if(this.getModel().isVertex(c[k])){var g=this.view.getState(c[k]);if(null!=g){var f=a?g.getCenterX(): -g.getCenterY(),e=null!=e?Math.max(e,f):f,d=null!=d?Math.min(d,f):f;b.push(g)}}if(2<b.length){b.sort(function(c,b){return a?c.x-b.x:c.y-b.y});g=this.view.translate;f=this.view.scale;d=d/f-(a?g.x:g.y);e=e/f-(a?g.x:g.y);this.getModel().beginUpdate();try{for(var u=(e-d)/(b.length-1),e=d,k=1;k<b.length-1;k++){var n=this.view.getState(this.model.getParent(b[k].cell)),t=this.getCellGeometry(b[k].cell),e=e+u;null!=t&&null!=n&&(t=t.clone(),a?t.x=Math.round(e-t.width/2)-n.origin.x:t.y=Math.round(e-t.height/ -2)-n.origin.y,this.getModel().setGeometry(b[k].cell,t))}}finally{this.getModel().endUpdate()}}}return c};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,c){return this.getLinkForCell(a.cell)});return a};Graph.prototype.getSvg=function(a,c,b,e,d,k,g,f,u,n){var t=this.useCssTransforms;t&&(this.useCssTransforms=!1, +g.getCenterY(),e=null!=e?Math.max(e,f):f,d=null!=d?Math.min(d,f):f;b.push(g)}}if(2<b.length){b.sort(function(c,b){return a?c.x-b.x:c.y-b.y});g=this.view.translate;f=this.view.scale;d=d/f-(a?g.x:g.y);e=e/f-(a?g.x:g.y);this.getModel().beginUpdate();try{for(var t=(e-d)/(b.length-1),e=d,k=1;k<b.length-1;k++){var n=this.view.getState(this.model.getParent(b[k].cell)),u=this.getCellGeometry(b[k].cell),e=e+t;null!=u&&null!=n&&(u=u.clone(),a?u.x=Math.round(e-u.width/2)-n.origin.x:u.y=Math.round(e-u.height/ +2)-n.origin.y,this.getModel().setGeometry(b[k].cell,u))}}finally{this.getModel().endUpdate()}}}return c};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,c){return this.getLinkForCell(a.cell)});return a};Graph.prototype.getSvg=function(a,c,b,e,d,k,g,f,t,n){var u=this.useCssTransforms;u&&(this.useCssTransforms=!1, this.view.revalidate(),this.sizeDidChange());try{c=null!=c?c:1;b=null!=b?b:0;d=null!=d?d:!0;k=null!=k?k:!0;g=null!=g?g:!0;var C=k||e?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==C)throw Error(mxResources.get("drawingEmpty"));var q=this.view.scale,z=mxUtils.createXmlDocument(),l=null!=z.createElementNS?z.createElementNS(mxConstants.NS_SVG,"svg"):z.createElement("svg");null!=a&&(null!=l.style?l.style.backgroundColor=a:l.setAttribute("style","background-color:"+a));null== z.createElementNS?(l.setAttribute("xmlns",mxConstants.NS_SVG),l.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):l.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/q;var x=Math.max(1,Math.ceil(C.width*a)+2*b)+(n?5:0),A=Math.max(1,Math.ceil(C.height*a)+2*b)+(n?5:0);l.setAttribute("version","1.1");l.setAttribute("width",x+"px");l.setAttribute("height",A+"px");l.setAttribute("viewBox",(d?"-0.5 -0.5":"0 0")+" "+x+" "+A);z.appendChild(l);var D=null!=z.createElementNS? -z.createElementNS(mxConstants.NS_SVG,"g"):z.createElement("g");l.appendChild(D);var v=this.createSvgCanvas(D);v.foOffset=d?-.5:0;v.textOffset=d?-.5:0;v.imageOffset=d?-.5:0;v.translate(Math.floor((b/c-C.x)/q),Math.floor((b/c-C.y)/q));var m=document.createElement("textarea"),K=v.createAlternateContent;v.createAlternateContent=function(a,c,b,e,d,k,g,f,u,n,t,C,q){var z=this.state;if(null!=this.foAltText&&(0==e||0!=z.fontSize&&k.length<5*e/z.fontSize)){var l=this.createElement("text");l.setAttribute("x", +z.createElementNS(mxConstants.NS_SVG,"g"):z.createElement("g");l.appendChild(D);var v=this.createSvgCanvas(D);v.foOffset=d?-.5:0;v.textOffset=d?-.5:0;v.imageOffset=d?-.5:0;v.translate(Math.floor((b/c-C.x)/q),Math.floor((b/c-C.y)/q));var m=document.createElement("textarea"),K=v.createAlternateContent;v.createAlternateContent=function(a,c,b,e,d,k,g,f,t,n,u,C,q){var z=this.state;if(null!=this.foAltText&&(0==e||0!=z.fontSize&&k.length<5*e/z.fontSize)){var l=this.createElement("text");l.setAttribute("x", Math.round(e/2));l.setAttribute("y",Math.round((d+z.fontSize)/2));l.setAttribute("fill",z.fontColor||"black");l.setAttribute("text-anchor","middle");l.setAttribute("font-size",Math.round(z.fontSize)+"px");l.setAttribute("font-family",z.fontFamily);(z.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&l.setAttribute("font-weight","bold");(z.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&l.setAttribute("font-style","italic");(z.fontStyle&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&& -l.setAttribute("text-decoration","underline");try{return m.innerHTML=k,l.textContent=m.value,l}catch(ra){return K.apply(this,arguments)}}else return K.apply(this,arguments)};var E=this.backgroundImage;if(null!=E){c=q/c;var H=this.view.translate,p=new mxRectangle(H.x*c,H.y*c,E.width*c,E.height*c);mxUtils.intersects(C,p)&&v.image(H.x,H.y,E.width,E.height,E.src,!0)}v.scale(a);v.textEnabled=g;f=null!=f?f:this.createSvgImageExport();var F=f.drawCellState,P=f.getLinkForCellState;f.getLinkForCellState=function(a, -c){var b=P.apply(this,arguments);return null==b||a.view.graph.isCustomLink(b)?null:b};f.drawCellState=function(a,c){for(var b=a.view.graph,e=b.isCellSelected(a.cell),d=b.model.getParent(a.cell);!k&&!e&&null!=d;)e=b.isCellSelected(d),d=b.model.getParent(d);(k||e)&&F.apply(this,arguments)};f.drawState(this.getView().getState(this.model.root),v);this.updateSvgLinks(l,u,!0);return l}finally{t&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.updateSvgLinks=function(a, +l.setAttribute("text-decoration","underline");try{return m.innerHTML=k,l.textContent=m.value,l}catch(ra){return K.apply(this,arguments)}}else return K.apply(this,arguments)};var H=this.backgroundImage;if(null!=H){c=q/c;var E=this.view.translate,p=new mxRectangle(E.x*c,E.y*c,H.width*c,H.height*c);mxUtils.intersects(C,p)&&v.image(E.x,E.y,H.width,H.height,H.src,!0)}v.scale(a);v.textEnabled=g;f=null!=f?f:this.createSvgImageExport();var F=f.drawCellState,P=f.getLinkForCellState;f.getLinkForCellState=function(a, +c){var b=P.apply(this,arguments);return null==b||a.view.graph.isCustomLink(b)?null:b};f.drawCellState=function(a,c){for(var b=a.view.graph,e=b.isCellSelected(a.cell),d=b.model.getParent(a.cell);!k&&!e&&null!=d;)e=b.isCellSelected(d),d=b.model.getParent(d);(k||e)&&F.apply(this,arguments)};f.drawState(this.getView().getState(this.model.root),v);this.updateSvgLinks(l,t,!0);return l}finally{u&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.updateSvgLinks=function(a, c,b){a=a.getElementsByTagName("a");for(var e=0;e<a.length;e++){var d=a[e].getAttribute("href");null==d&&(d=a[e].getAttribute("xlink:href"));null!=d&&(null!=c&&/^https?:\/\//.test(d)?a[e].setAttribute("target",c):b&&this.isCustomLink(d)&&a[e].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(a){a=new mxSvgCanvas2D(a);a.pointerEvents=!0;return a};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var c=window.getSelection();c.getRangeAt&& c.rangeCount&&(a=c.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());return a};Graph.prototype.getParentByName=function(a,c,b){for(;null!=a&&a.nodeName!=c;){if(a==b)return null;a=a.parentNode}return a};Graph.prototype.getParentByNames=function(a,c,b){for(;null!=a&&!(0<=mxUtils.indexOf(c,a.nodeName));){if(a==b)return null;a=a.parentNode}return a};Graph.prototype.selectNode=function(a){var c=null;if(window.getSelection){if(c=window.getSelection(), c.getRangeAt&&c.rangeCount){var b=document.createRange();b.selectNode(a);c.removeAllRanges();c.addRange(b)}}else(c=document.selection)&&"Control"!=c.type&&(a=c.createRange(),a.collapse(!0),b=c.createRange(),b.setEndPoint("StartToStart",a),b.select())};Graph.prototype.insertRow=function(a,c){for(var b=a.tBodies[0],e=b.rows[0].cells,d=0,k=0;k<e.length;k++)var g=e[k].getAttribute("colspan"),d=d+(null!=g?parseInt(g):1);b=b.insertRow(c);for(k=0;k<d;k++)mxUtils.br(b.insertCell(-1));return b.cells[0]};Graph.prototype.deleteRow= @@ -2447,8 +2447,8 @@ this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.w function(a,c){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var b=this.graph.getEditingValue(a.cell,c);"1"==mxUtils.getValue(a.style,"nl2Br","1")&&(b=b.replace(/\n/g,"<br/>"));return b=this.graph.sanitizeHtml(b,!0)};mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(a){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);var c=this.graph.sanitizeHtml(this.textarea.innerHTML, !0);return c="1"==mxUtils.getValue(a.style,"nl2Br","1")?c.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"):c.replace(/\r\n/g,"").replace(/\n/g,"")};var e=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(a){this.codeViewMode&&this.toggleViewMode();e.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(ca){}};var k=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(a, c){this.graph.getModel().beginUpdate();try{if(k.apply(this,arguments),this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)){var b=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),e=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);""==c&&b==mxConstants.NONE&&e==mxConstants.NONE&&this.graph.removeCells([a.cell],!1)}}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(a){var c=mxUtils.getValue(a.style, -mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);null!=c&&c!=mxConstants.NONE||!(null!=a.cell.geometry&&0<a.cell.geometry.width)||0==mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0)&&0!=mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,1)||(c=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,null));c==mxConstants.NONE&&(c=null);return c};mxCellEditor.prototype.getMinimumSize=function(a){var c=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*c+20,30)};var t= -mxGraphHandler.prototype.moveCells;mxGraphHandler.prototype.moveCells=function(a,c,b,e,d,k){mxEvent.isAltDown(k)&&(d=null);t.apply(this,arguments)};mxGraphView.prototype.formatUnitText=function(a){return a?b(a,this.unit):a};mxGraphHandler.prototype.updateHint=function(c){if(null!=this.shape){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var e=this.graph.view.translate,d=this.graph.view.scale;c=this.roundLength((this.bounds.x+this.currentDx)/d-e.x);e=this.roundLength((this.bounds.y+ +mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null);null!=c&&c!=mxConstants.NONE||!(null!=a.cell.geometry&&0<a.cell.geometry.width)||0==mxUtils.getValue(a.style,mxConstants.STYLE_ROTATION,0)&&0!=mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,1)||(c=mxUtils.getValue(a.style,mxConstants.STYLE_FILLCOLOR,null));c==mxConstants.NONE&&(c=null);return c};mxCellEditor.prototype.getMinimumSize=function(a){var c=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*c+20,30)};var u= +mxGraphHandler.prototype.moveCells;mxGraphHandler.prototype.moveCells=function(a,c,b,e,d,k){mxEvent.isAltDown(k)&&(d=null);u.apply(this,arguments)};mxGraphView.prototype.formatUnitText=function(a){return a?b(a,this.unit):a};mxGraphHandler.prototype.updateHint=function(c){if(null!=this.shape){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var e=this.graph.view.translate,d=this.graph.view.scale;c=this.roundLength((this.bounds.x+this.currentDx)/d-e.x);e=this.roundLength((this.bounds.y+ this.currentDy)/d-e.y);d=this.graph.view.unit;this.hint.innerHTML=b(c,d)+", "+b(e,d);this.hint.style.left=this.shape.bounds.x+Math.round((this.shape.bounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.shape.bounds.y+this.shape.bounds.height+12+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(this.hint.parentNode.removeChild(this.hint),this.hint=null)};mxVertexHandler.prototype.isRecursiveResize=function(a,c){return!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&& !mxEvent.isControlDown(c.getEvent())&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null)};mxVertexHandler.prototype.isCenteredEvent=function(a,c){return!(!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null))&&mxEvent.isControlDown(c.getEvent())||mxEvent.isMetaDown(c.getEvent())}; var n=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var a=new mxPoint(0,0),c=this.tolerance;this.graph.cellEditor.getEditingCell()==this.state.cell&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(c/=2,a.x=this.sizers[0].bounds.width+c,a.y=this.sizers[0].bounds.height+c):a=n.apply(this,arguments);return a};mxVertexHandler.prototype.updateHint=function(c){if(this.index!=mxEvent.LABEL_HANDLE){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint)); @@ -2468,13 +2468,13 @@ function(a){return!mxEvent.isShiftDown(a.getEvent())};if(Graph.touchStyle){if(mx function(a){var c=a.getEvent();return null==a.getState()&&!mxEvent.isMouseEvent(c)||mxEvent.isPopupTrigger(c)&&(null==a.getState()||mxEvent.isControlDown(c)||mxEvent.isShiftDown(c))};var A=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(a,c){A.apply(this,arguments);mxEvent.isTouchEvent(c.getEvent())&&this.graph.isCellSelected(c.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)}}else mxPanningHandler.prototype.isPanningTrigger=function(a){var c= a.getEvent();return mxEvent.isLeftMouseButton(c)&&(this.useLeftButtonForPanning&&null==a.getState()||mxEvent.isControlDown(c)&&!mxEvent.isShiftDown(c))||this.usePopupTrigger&&mxEvent.isPopupTrigger(c)};mxRubberband.prototype.isSpaceEvent=function(a){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&mxEvent.isControlDown(a.getEvent())&&mxEvent.isShiftDown(a.getEvent())};mxRubberband.prototype.mouseUp=function(a,c){var b=null!=this.div&&"none"!=this.div.style.display, e=null,d=null,k=null,g=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(e=this.first.x,d=this.first.y,k=(this.currentX-e)/this.graph.view.scale,g=(this.currentY-d)/this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(k=this.graph.snap(k),g=this.graph.snap(g),this.graph.isGridEnabled()||(Math.abs(k)<this.graph.tolerance&&(k=0),Math.abs(g)<this.graph.tolerance&&(g=0))));this.reset();if(b){if(mxEvent.isAltDown(c.getEvent())&&this.graph.isToggleEvent(c.getEvent())){var k=new mxRectangle(this.x, -this.y,this.width,this.height),f=this.graph.getCells(k.x,k.y,k.width,k.height);this.graph.removeSelectionCells(f)}else if(this.isSpaceEvent(c)){this.graph.model.beginUpdate();try{for(f=this.graph.getCellsBeyond(e,d,this.graph.getDefaultParent(),!0,!0),b=0;b<f.length;b++)if(this.graph.isCellMovable(f[b])){var u=this.graph.view.getState(f[b]),n=this.graph.getCellGeometry(f[b]);null!=u&&null!=n&&(n=n.clone(),n.translate(k,g),this.graph.model.setGeometry(f[b],n))}}finally{this.graph.model.endUpdate()}}else k= +this.y,this.width,this.height),f=this.graph.getCells(k.x,k.y,k.width,k.height);this.graph.removeSelectionCells(f)}else if(this.isSpaceEvent(c)){this.graph.model.beginUpdate();try{for(f=this.graph.getCellsBeyond(e,d,this.graph.getDefaultParent(),!0,!0),b=0;b<f.length;b++)if(this.graph.isCellMovable(f[b])){var t=this.graph.view.getState(f[b]),n=this.graph.getCellGeometry(f[b]);null!=t&&null!=n&&(n=n.clone(),n.translate(k,g),this.graph.model.setGeometry(f[b],n))}}finally{this.graph.model.endUpdate()}}else k= new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(k,c.getEvent());c.consume()}};mxRubberband.prototype.mouseMove=function(a,c){if(!c.isConsumed()&&null!=this.first){var b=mxUtils.getScrollOrigin(this.graph.container),e=mxUtils.getOffset(this.graph.container);b.x-=e.x;b.y-=e.y;var e=c.getX()+b.x,b=c.getY()+b.y,d=this.first.x-e,k=this.first.y-b,g=this.graph.tolerance;if(null!=this.div||Math.abs(d)>g||Math.abs(k)>g)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(), this.update(e,b),this.isSpaceEvent(c)?(e=this.x+this.width,b=this.y+this.height,d=this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(this.width=this.graph.snap(this.width/d)*d,this.height=this.graph.snap(this.height/d)*d,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=e-this.width),this.y<this.first.y&&(this.y=b-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor= "white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=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&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),c.consume()}};var q=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv), -this.secondDiv=null);q.apply(this,arguments)};var F=(new Date).getTime(),x=0,E=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,b,e){E.apply(this,arguments);b!=this.currentTerminalState?(F=(new Date).getTime(),x=0):x=(new Date).getTime()-F;this.currentTerminalState=b};var u=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&& -2E3<x||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&u.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,c){var b=null!=a&&0==a,e=this.state.getVisibleTerminalState(b),d=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state, +this.secondDiv=null);q.apply(this,arguments)};var F=(new Date).getTime(),x=0,E=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,b,e){E.apply(this,arguments);b!=this.currentTerminalState?(F=(new Date).getTime(),x=0):x=(new Date).getTime()-F;this.currentTerminalState=b};var t=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&& +2E3<x||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&t.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,c){var b=null!=a&&0==a,e=this.state.getVisibleTerminalState(b),d=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state, e,b):null,b=null!=(null!=d?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b),d):null)?this.fixedHandleImage:null!=d&&null!=e?this.terminalHandleImage:this.handleImage;if(null!=b)return b=new mxImageShape(new mxRectangle(0,0,b.width,b.height),b.src),b.preserveImageAspect=!1,b;b=mxConstants.HANDLE_SIZE;this.preferHtml&&--b;return new mxRectangleShape(new mxRectangle(0,0,b,b),mxConstants.HANDLE_FILLCOLOR,mxConstants.HANDLE_STROKECOLOR)};var C=mxVertexHandler.prototype.createSizerShape; mxVertexHandler.prototype.createSizerShape=function(a,c,b){this.handleImage=c==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:c==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return C.apply(this,arguments)};var K=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),b=c.getParent(a[0]),e=this.graph.getCellGeometry(a[0]);if(c.isEdge(b)&&null!=e&&e.relative&&(c=this.graph.view.getState(a[0]), null!=c&&2>c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return K.apply(this,arguments)};var Y=mxGraphHandler.prototype.getGuideStates;mxGraphHandler.prototype.getGuideStates=function(){for(var a=Y.apply(this,arguments),c=[],b=0;b<a.length;b++)"1"!=mxUtils.getValue(a[b].style,"part","0")&&c.push(a[b]);return c};var H=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(), @@ -2494,12 +2494,12 @@ var ba=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=fun null!=c&&(b=Math.max(b,c.y+c.height));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(b+this.verticalOffset/2+6+this.state.view.graph.tolerance)+"px"}};var G=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){G.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getSelectionModel().removeListener(this.changeHandler), this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var Z=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(Z.apply(this),null!=this.state&&null!=this.linkHint)){var a=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(a=new mxRectangle(a.x,a.y,a.width,a.height),a.add(this.state.text.bounds));this.linkHint.style.left= Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(a.y+a.height+6+this.state.view.graph.tolerance)+"px"}};var na=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){na.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var ja=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){ja.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint), -this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function f(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function l(){mxCylinder.call(this)}function m(){mxActor.call(this)}function p(){mxCylinder.call(this)}function v(){mxActor.call(this)}function y(){mxActor.call(this)}function B(){mxActor.call(this)}function c(){mxActor.call(this)}function e(){mxActor.call(this)}function k(){mxActor.call(this)}function t(){mxActor.call(this)}function n(a,c){this.canvas= +this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function f(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function l(){mxCylinder.call(this)}function m(){mxActor.call(this)}function p(){mxCylinder.call(this)}function v(){mxActor.call(this)}function y(){mxActor.call(this)}function B(){mxActor.call(this)}function c(){mxActor.call(this)}function e(){mxActor.call(this)}function k(){mxActor.call(this)}function u(){mxActor.call(this)}function n(a,c){this.canvas= a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=c;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,n.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,n.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,n.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,n.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo; -this.canvas.curveTo=mxUtils.bind(this,n.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,n.prototype.arcTo)}function g(){mxRectangleShape.call(this)}function z(){mxRectangleShape.call(this)}function A(){mxActor.call(this)}function q(){mxActor.call(this)}function F(){mxActor.call(this)}function x(){mxRectangleShape.call(this)}function E(){mxRectangleShape.call(this)}function u(){mxCylinder.call(this)}function C(){mxShape.call(this)}function K(){mxShape.call(this)} +this.canvas.curveTo=mxUtils.bind(this,n.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,n.prototype.arcTo)}function g(){mxRectangleShape.call(this)}function z(){mxRectangleShape.call(this)}function A(){mxActor.call(this)}function q(){mxActor.call(this)}function F(){mxActor.call(this)}function x(){mxRectangleShape.call(this)}function E(){mxRectangleShape.call(this)}function t(){mxCylinder.call(this)}function C(){mxShape.call(this)}function K(){mxShape.call(this)} function Y(){mxEllipse.call(this)}function H(){mxShape.call(this)}function Q(){mxShape.call(this)}function D(){mxRectangleShape.call(this)}function L(){mxShape.call(this)}function O(){mxShape.call(this)}function P(){mxShape.call(this)}function ba(){mxShape.call(this)}function W(){mxShape.call(this)}function G(){mxCylinder.call(this)}function Z(){mxDoubleEllipse.call(this)}function na(){mxDoubleEllipse.call(this)}function ja(){mxArrowConnector.call(this);this.spacing=0}function ca(){mxArrowConnector.call(this); this.spacing=0}function ka(){mxActor.call(this)}function S(){mxRectangleShape.call(this)}function V(){mxActor.call(this)}function pa(){mxActor.call(this)}function ga(){mxActor.call(this)}function R(){mxActor.call(this)}function la(){mxActor.call(this)}function M(){mxActor.call(this)}function I(){mxActor.call(this)}function ea(){mxActor.call(this)}function N(){mxActor.call(this)}function T(){mxActor.call(this)}function ha(){mxEllipse.call(this)}function ia(){mxEllipse.call(this)}function J(){mxEllipse.call(this)} -function qa(){mxRhombus.call(this)}function aa(){mxEllipse.call(this)}function da(){mxEllipse.call(this)}function Aa(){mxEllipse.call(this)}function wa(){mxEllipse.call(this)}function za(){mxActor.call(this)}function ma(){mxActor.call(this)}function fa(){mxActor.call(this)}function sa(){mxConnector.call(this)}function Ea(a,c,b,e,d,k,g,f,u,n){g+=u;var X=e.clone();e.x-=d*(2*g+u);e.y-=k*(2*g+u);d*=g+u;k*=g+u;return function(){a.ellipse(X.x-d-g,X.y-k-g,2*g,2*g);n?a.fillAndStroke():a.stroke()}}mxUtils.extend(a, +function qa(){mxRhombus.call(this)}function aa(){mxEllipse.call(this)}function da(){mxEllipse.call(this)}function Aa(){mxEllipse.call(this)}function wa(){mxEllipse.call(this)}function za(){mxActor.call(this)}function ma(){mxActor.call(this)}function fa(){mxActor.call(this)}function sa(){mxConnector.call(this)}function Ea(a,c,b,e,d,k,g,f,t,n){g+=t;var X=e.clone();e.x-=d*(2*g+t);e.y-=k*(2*g+t);d*=g+t;k*=g+t;return function(){a.ellipse(X.x-d-g,X.y-k-g,2*g,2*g);n?a.fillAndStroke():a.stroke()}}mxUtils.extend(a, mxCylinder);a.prototype.size=20;a.prototype.darkOpacity=0;a.prototype.darkOpacity2=0;a.prototype.paintVertexShape=function(a,c,b,e,d){var k=Math.max(0,Math.min(e,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),g=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),X=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity2",this.darkOpacity2))));a.translate(c,b);a.begin();a.moveTo(0,0);a.lineTo(e-k,0);a.lineTo(e, k);a.lineTo(e,d);a.lineTo(k,d);a.lineTo(0,d-k);a.lineTo(0,0);a.close();a.end();a.fillAndStroke();this.outline||(a.setShadow(!1),0!=g&&(a.setFillAlpha(Math.abs(g)),a.setFillColor(0>g?"#FFFFFF":"#000000"),a.begin(),a.moveTo(0,0),a.lineTo(e-k,0),a.lineTo(e,k),a.lineTo(k,k),a.close(),a.fill()),0!=X&&(a.setFillAlpha(Math.abs(X)),a.setFillColor(0>X?"#FFFFFF":"#000000"),a.begin(),a.moveTo(0,0),a.lineTo(k,k),a.lineTo(k,d),a.lineTo(0,d-k),a.close(),a.fill()),a.begin(),a.moveTo(k,d),a.lineTo(k,k),a.lineTo(0, 0),a.moveTo(k,k),a.lineTo(e,k),a.end(),a.stroke())};a.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?(a=parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale,new mxRectangle(a,a,0,0)):null};mxCellRenderer.registerShape("cube",a);var ta=Math.tan(mxUtils.toRadians(30)),oa=(.5-ta)/2;mxUtils.extend(b,mxActor);b.prototype.size=20;b.prototype.redrawPath=function(a,c,b,e,d){c=Math.min(e,d/ta);a.translate((e-c)/2,(d-c)/2+c/4);a.moveTo(0,.25*c);a.lineTo(.5* @@ -2516,10 +2516,10 @@ Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo( function(a){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var c=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,a.height*c),0,0)}return null};mxUtils.extend(c,mxActor);c.prototype.size=.2;c.prototype.isRoundable=function(){return!0};c.prototype.redrawPath=function(a,c,b,e,d){c=e*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/ 2;this.addPoints(a,[new mxPoint(0,d),new mxPoint(c,0),new mxPoint(e,0),new mxPoint(e-c,d)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("parallelogram",c);mxUtils.extend(e,mxActor);e.prototype.size=.2;e.prototype.isRoundable=function(){return!0};e.prototype.redrawPath=function(a,c,b,e,d){c=e*Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0, d),new mxPoint(c,0),new mxPoint(e-c,0),new mxPoint(e,d)],this.isRounded,b,!0)};mxCellRenderer.registerShape("trapezoid",e);mxUtils.extend(k,mxActor);k.prototype.size=.5;k.prototype.redrawPath=function(a,c,b,e,d){a.setFillColor(null);c=e*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(e,0),new mxPoint(c,0),new mxPoint(c,d/2),new mxPoint(0,d/2),new mxPoint(c, -d/2),new mxPoint(c,d),new mxPoint(e,d)],this.isRounded,b,!1);a.end()};mxCellRenderer.registerShape("curlyBracket",k);mxUtils.extend(t,mxActor);t.prototype.redrawPath=function(a,c,b,e,d){a.setStrokeWidth(1);a.setFillColor(this.stroke);c=e/5;a.rect(0,0,c,d);a.fillAndStroke();a.rect(2*c,0,c,d);a.fillAndStroke();a.rect(4*c,0,c,d);a.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",t);n.prototype.moveTo=function(a,c){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY= +d/2),new mxPoint(c,d),new mxPoint(e,d)],this.isRounded,b,!1);a.end()};mxCellRenderer.registerShape("curlyBracket",k);mxUtils.extend(u,mxActor);u.prototype.redrawPath=function(a,c,b,e,d){a.setStrokeWidth(1);a.setFillColor(this.stroke);c=e/5;a.rect(0,0,c,d);a.fillAndStroke();a.rect(2*c,0,c,d);a.fillAndStroke();a.rect(4*c,0,c,d);a.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",u);n.prototype.moveTo=function(a,c){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY= c;this.firstX=a;this.firstY=c};n.prototype.close=function(){null!=this.firstX&&null!=this.firstY&&(this.lineTo(this.firstX,this.firstY),this.originalClose.apply(this.canvas,arguments));this.originalClose.apply(this.canvas,arguments)};n.prototype.quadTo=function(a,c,b,e){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=b;this.lastY=e};n.prototype.curveTo=function(a,c,b,e,d,k){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=k};n.prototype.arcTo=function(a,c,b,e, d,k,g){this.originalArcTo.apply(this.canvas,arguments);this.lastX=k;this.lastY=g};n.prototype.lineTo=function(a,c){if(null!=this.lastX&&null!=this.lastY){var b=function(a){return"number"===typeof a?a?0>a?-1:1:a===a?0:NaN:NaN},e=Math.abs(a-this.lastX),d=Math.abs(c-this.lastY),k=Math.sqrt(e*e+d*d);if(2>k){this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;return}var g=Math.round(k/10),f=this.defaultVariation;5>g&&(g=5,f/=3);for(var X=b(a-this.lastX)*e/g,b=b(c-this.lastY)*d/g, -e=e/k,d=d/k,k=0;k<g;k++){var u=(Math.random()-.5)*f;this.originalLineTo.call(this.canvas,X*k+this.lastX-u*d,b*k+this.lastY-u*e)}this.originalLineTo.call(this.canvas,a,c)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c};n.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo}; +e=e/k,d=d/k,k=0;k<g;k++){var t=(Math.random()-.5)*f;this.originalLineTo.call(this.canvas,X*k+this.lastX-t*d,b*k+this.lastY-t*e)}this.originalLineTo.call(this.canvas,a,c)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c};n.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo}; var Ba=mxShape.prototype.paint;mxShape.prototype.defaultJiggle=1.5;mxShape.prototype.paint=function(a){null!=this.style&&"0"!=mxUtils.getValue(this.style,"comic","0")&&null==a.handHiggle&&(a.handJiggle=new n(a,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle)));Ba.apply(this,arguments);null!=a.handJiggle&&(a.handJiggle.destroy(),delete a.handJiggle)};mxRhombus.prototype.defaultJiggle=2;var La=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return(null== this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&La.apply(this,arguments)};var Ca=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(a,c,b,e,d){if(null==a.handJiggle)Ca.apply(this,arguments);else{var k=!0;null!=this.style&&(k="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(k||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)k||null!=this.fill&&this.fill!=mxConstants.NONE|| (a.pointerEvents=!1),a.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?k=Math.min(e/2,Math.min(d/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(k=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,k=Math.min(e*k,d*k)),a.moveTo(c+k,b),a.lineTo(c+e-k,b),a.quadTo(c+e,b,c+e,b+k),a.lineTo(c+e,b+d-k),a.quadTo(c+e,b+d,c+e-k,b+d),a.lineTo(c+k,b+d),a.quadTo(c,b+d,c,b+d-k), @@ -2534,32 +2534,32 @@ function(a,c,b,e,d){c=e*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.s c,b,e,d){var k=Math.min(e/5,d/5)+1;a.begin();a.moveTo(c+e/2,b+k);a.lineTo(c+e/2,b+d-k);a.moveTo(c+k,b+d/2);a.lineTo(c+e-k,b+d/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",x);var ua=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+ c,a.y+c,a.width-2*c,a.height-2*c)}return a};mxRhombus.prototype.paintVertexShape=function(a,c,b,e,d){ua.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);c+=k;b+=k;e-=2*k;d-=2*k;0<e&&0<d&&(a.setShadow(!1),ua.apply(this,[a,c,b,e,d]))}};mxUtils.extend(E,mxRectangleShape);E.prototype.isHtmlAllowed=function(){return!1};E.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(Math.max(2, this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};E.prototype.paintForeground=function(a,c,b,e,d){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var k=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=k;b+=k;e-=2*k;d-=2*k;0<e&&0<d&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var k=0,g;do{g=mxCellRenderer.defaultShapes[this.style["symbol"+ -k]];if(null!=g){var f=this.style["symbol"+k+"Align"],X=this.style["symbol"+k+"VerticalAlign"],u=this.style["symbol"+k+"Width"],n=this.style["symbol"+k+"Height"],t=this.style["symbol"+k+"Spacing"]||0,C=this.style["symbol"+k+"VSpacing"]||t,q=this.style["symbol"+k+"ArcSpacing"];null!=q&&(q*=this.getArcSize(e+this.strokewidth,d+this.strokewidth),t+=q,C+=q);var q=c,z=b,q=f==mxConstants.ALIGN_CENTER?q+(e-u)/2:f==mxConstants.ALIGN_RIGHT?q+(e-u-t):q+t,z=X==mxConstants.ALIGN_MIDDLE?z+(d-n)/2:X==mxConstants.ALIGN_BOTTOM? -z+(d-n-C):z+C;a.save();f=new g;f.style=this.style;g.prototype.paintVertexShape.call(f,a,q,z,u,n);a.restore()}k++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",E);mxUtils.extend(u,mxCylinder);u.prototype.redrawPath=function(a,c,b,e,d,k){k?(a.moveTo(0,0),a.lineTo(e/2,d/2),a.lineTo(e,0),a.end()):(a.moveTo(0,0),a.lineTo(e,0),a.lineTo(e,d),a.lineTo(0,d),a.close())};mxCellRenderer.registerShape("message",u);mxUtils.extend(C,mxShape); +k]];if(null!=g){var f=this.style["symbol"+k+"Align"],X=this.style["symbol"+k+"VerticalAlign"],t=this.style["symbol"+k+"Width"],n=this.style["symbol"+k+"Height"],u=this.style["symbol"+k+"Spacing"]||0,C=this.style["symbol"+k+"VSpacing"]||u,q=this.style["symbol"+k+"ArcSpacing"];null!=q&&(q*=this.getArcSize(e+this.strokewidth,d+this.strokewidth),u+=q,C+=q);var q=c,z=b,q=f==mxConstants.ALIGN_CENTER?q+(e-t)/2:f==mxConstants.ALIGN_RIGHT?q+(e-t-u):q+u,z=X==mxConstants.ALIGN_MIDDLE?z+(d-n)/2:X==mxConstants.ALIGN_BOTTOM? +z+(d-n-C):z+C;a.save();f=new g;f.style=this.style;g.prototype.paintVertexShape.call(f,a,q,z,t,n);a.restore()}k++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",E);mxUtils.extend(t,mxCylinder);t.prototype.redrawPath=function(a,c,b,e,d,k){k?(a.moveTo(0,0),a.lineTo(e/2,d/2),a.lineTo(e,0),a.end()):(a.moveTo(0,0),a.lineTo(e,0),a.lineTo(e,d),a.lineTo(0,d),a.close())};mxCellRenderer.registerShape("message",t);mxUtils.extend(C,mxShape); C.prototype.paintBackground=function(a,c,b,e,d){a.translate(c,b);a.ellipse(e/4,0,e/2,d/4);a.fillAndStroke();a.begin();a.moveTo(e/2,d/4);a.lineTo(e/2,2*d/3);a.moveTo(e/2,d/3);a.lineTo(0,d/3);a.moveTo(e/2,d/3);a.lineTo(e,d/3);a.moveTo(e/2,2*d/3);a.lineTo(0,d);a.moveTo(e/2,2*d/3);a.lineTo(e,d);a.end();a.stroke()};mxCellRenderer.registerShape("umlActor",C);mxUtils.extend(K,mxShape);K.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};K.prototype.paintBackground=function(a, c,b,e,d){a.translate(c,b);a.begin();a.moveTo(0,d/4);a.lineTo(0,3*d/4);a.end();a.stroke();a.begin();a.moveTo(0,d/2);a.lineTo(e/6,d/2);a.end();a.stroke();a.ellipse(e/6,0,5*e/6,d);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",K);mxUtils.extend(Y,mxEllipse);Y.prototype.paintVertexShape=function(a,c,b,e,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+e/8,b+d);a.lineTo(c+7*e/8,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",Y);mxUtils.extend(H, mxShape);H.prototype.paintVertexShape=function(a,c,b,e,d){a.translate(c,b);a.begin();a.moveTo(e,0);a.lineTo(0,d);a.moveTo(0,0);a.lineTo(e,d);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",H);mxUtils.extend(Q,mxShape);Q.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+a.height/8,a.width,7*a.height/8)};Q.prototype.paintBackground=function(a,c,b,e,d){a.translate(c,b);a.begin();a.moveTo(3*e/8,d/8*1.1);a.lineTo(5*e/8,0);a.end();a.stroke();a.ellipse(0,d/8,e,7*d/8);a.fillAndStroke()}; Q.prototype.paintForeground=function(a,c,b,e,d){a.begin();a.moveTo(3*e/8,d/8*1.1);a.lineTo(5*e/8,d/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",Q);mxUtils.extend(D,mxRectangleShape);D.prototype.size=40;D.prototype.isHtmlAllowed=function(){return!1};D.prototype.getLabelBounds=function(a){var c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(a.x,a.y,a.width,c)};D.prototype.paintBackground=function(a,c,b,e, d){var k=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),g=mxUtils.getValue(this.style,"participant");null==g||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,a,c,b,e,k):(g=this.state.view.graph.cellRenderer.getShape(g),null!=g&&g!=D&&(g=new g,g.apply(this.state),a.save(),g.paintVertexShape(a,c,b,e,k),a.restore()));k<d&&(a.setDashed(!0),a.begin(),a.moveTo(c+e/2,b+k),a.lineTo(c+e/2,b+d),a.end(),a.stroke())};D.prototype.paintForeground=function(a, c,b,e,d){var k=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,a,c,b,e,Math.min(d,k))};mxCellRenderer.registerShape("umlLifeline",D);mxUtils.extend(L,mxShape);L.prototype.width=60;L.prototype.height=30;L.prototype.corner=10;L.prototype.getLabelMargins=function(a){return new mxRectangle(0,0,a.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),a.height-parseFloat(mxUtils.getValue(this.style, -"height",this.height)*this.scale))};L.prototype.paintBackground=function(a,c,b,e,d){var k=this.corner,g=Math.min(e,Math.max(k,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),f=Math.min(d,Math.max(1.5*k,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),u=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);u!=mxConstants.NONE&&(a.setFillColor(u),a.rect(c,b,e,d),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!= +"height",this.height)*this.scale))};L.prototype.paintBackground=function(a,c,b,e,d){var k=this.corner,g=Math.min(e,Math.max(k,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),f=Math.min(d,Math.max(1.5*k,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),t=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);t!=mxConstants.NONE&&(a.setFillColor(t),a.rect(c,b,e,d),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!= mxConstants.NONE?(this.getGradientBounds(a,c,b,e,d),a.setGradient(this.fill,this.gradient,c,b,e,d,this.gradientDirection)):a.setFillColor(this.fill);a.begin();a.moveTo(c,b);a.lineTo(c+g,b);a.lineTo(c+g,b+Math.max(0,f-1.5*k));a.lineTo(c+Math.max(0,g-k),b+f);a.lineTo(c,b+f);a.close();a.fillAndStroke();a.begin();a.moveTo(c+g,b);a.lineTo(c+e,b);a.lineTo(c+e,b+d);a.lineTo(c,b+d);a.lineTo(c,b+f);a.stroke()};mxCellRenderer.registerShape("umlFrame",L);mxPerimeter.LifelinePerimeter=function(a,c,b,e){e=D.prototype.size; null!=c&&(e=mxUtils.getValue(c.style,"size",e)*c.view.scale);c=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;b.x<a.getCenterX()&&(c=-1*(c+1));return new mxPoint(a.getCenterX()+c,Math.min(a.y+a.height,Math.max(a.y+e,b.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(a,c,b,e){e=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter); mxPerimeter.BackbonePerimeter=function(a,c,b,e){e=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;null!=c.style.backboneSize&&(e+=parseFloat(c.style.backboneSize)*c.view.scale/2-1);if("south"==c.style[mxConstants.STYLE_DIRECTION]||"north"==c.style[mxConstants.STYLE_DIRECTION])return b.x<a.getCenterX()&&(e=-1*(e+1)),new mxPoint(a.getCenterX()+e,Math.min(a.y+a.height,Math.max(a.y,b.y)));b.y<a.getCenterY()&&(e=-1*(e+1));return new mxPoint(Math.min(a.x+a.width,Math.max(a.x,b.x)), a.getCenterY()+e)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(a,c,b,e){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(a,new mxRectangle(0,0,0,Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(c.style,"size",A.prototype.size))*c.view.scale))),c.style),c,b,e)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(a,b,e,d){var k=c.prototype.size; -null!=b&&(k=mxUtils.getValue(b.style,"size",k));var g=a.x,f=a.y,u=a.width,n=a.height;b=null!=b?mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH?(k=n*Math.max(0,Math.min(1,k)),f=[new mxPoint(g,f),new mxPoint(g+u,f+k),new mxPoint(g+u,f+n),new mxPoint(g,f+n-k),new mxPoint(g,f)]):(k=u*Math.max(0,Math.min(1,k)),f=[new mxPoint(g+k,f),new mxPoint(g+u,f),new mxPoint(g+u-k,f+n),new mxPoint(g, -f+n),new mxPoint(g+k,f)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(e.x<g||e.x>g+u?a.y=e.y:a.x=e.x);return mxUtils.getPerimeterPoint(f,a,e)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,b,d){var k=e.prototype.size;null!=c&&(k=mxUtils.getValue(c.style,"size",k));var g=a.x,f=a.y,u=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST; -c==mxConstants.DIRECTION_EAST?(k=u*Math.max(0,Math.min(1,k)),f=[new mxPoint(g+k,f),new mxPoint(g+u-k,f),new mxPoint(g+u,f+n),new mxPoint(g,f+n),new mxPoint(g+k,f)]):c==mxConstants.DIRECTION_WEST?(k=u*Math.max(0,Math.min(1,k)),f=[new mxPoint(g,f),new mxPoint(g+u,f),new mxPoint(g+u-k,f+n),new mxPoint(g+k,f+n),new mxPoint(g,f)]):c==mxConstants.DIRECTION_NORTH?(k=n*Math.max(0,Math.min(1,k)),f=[new mxPoint(g,f+k),new mxPoint(g+u,f),new mxPoint(g+u,f+n),new mxPoint(g,f+n-k),new mxPoint(g,f+k)]):(k=n*Math.max(0, -Math.min(1,k)),f=[new mxPoint(g,f),new mxPoint(g+u,f+k),new mxPoint(g+u,f+n-k),new mxPoint(g,f+n),new mxPoint(g,f)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(b.x<g||b.x>g+u?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(f,a,b)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(a,c,b,e){var d="0"!=mxUtils.getValue(c.style,"fixedSize","0"),k=d?q.prototype.fixedSize:q.prototype.size;null!=c&&(k=mxUtils.getValue(c.style, -"size",k));var g=a.x,f=a.y,u=a.width,n=a.height,X=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(d=d?Math.max(0,Math.min(u,k)):u*Math.max(0,Math.min(1,k)),f=[new mxPoint(g,f),new mxPoint(g+u-d,f),new mxPoint(g+u,a),new mxPoint(g+u-d,f+n),new mxPoint(g,f+n),new mxPoint(g+d,a),new mxPoint(g,f)]):c==mxConstants.DIRECTION_WEST?(d=d?Math.max(0,Math.min(u,k)):u*Math.max(0, -Math.min(1,k)),f=[new mxPoint(g+d,f),new mxPoint(g+u,f),new mxPoint(g+u-d,a),new mxPoint(g+u,f+n),new mxPoint(g+d,f+n),new mxPoint(g,a),new mxPoint(g+d,f)]):c==mxConstants.DIRECTION_NORTH?(d=d?Math.max(0,Math.min(n,k)):n*Math.max(0,Math.min(1,k)),f=[new mxPoint(g,f+d),new mxPoint(X,f),new mxPoint(g+u,f+d),new mxPoint(g+u,f+n),new mxPoint(X,f+n-d),new mxPoint(g,f+n),new mxPoint(g,f+d)]):(d=d?Math.max(0,Math.min(n,k)):n*Math.max(0,Math.min(1,k)),f=[new mxPoint(g,f),new mxPoint(X,f+d),new mxPoint(g+ -u,f),new mxPoint(g+u,f+n-d),new mxPoint(X,f+n),new mxPoint(g,f+n-d),new mxPoint(g,f)]);X=new mxPoint(X,a);e&&(b.x<g||b.x>g+u?X.y=b.y:X.x=b.x);return mxUtils.getPerimeterPoint(f,X,b)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,b,e){var d=F.prototype.size;null!=c&&(d=mxUtils.getValue(c.style,"size",d));var k=a.x,g=a.y,f=a.width,u=a.height,n=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION, -mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(d=u*Math.max(0,Math.min(1,d)),g=[new mxPoint(n,g),new mxPoint(k+f,g+d),new mxPoint(k+f,g+u-d),new mxPoint(n,g+u),new mxPoint(k,g+u-d),new mxPoint(k,g+d),new mxPoint(n,g)]):(d=f*Math.max(0,Math.min(1,d)),g=[new mxPoint(k+d,g),new mxPoint(k+f-d,g),new mxPoint(k+f,a),new mxPoint(k+f-d,g+u),new mxPoint(k+d,g+u),new mxPoint(k,a),new mxPoint(k+d,g)]);n=new mxPoint(n,a);e&&(b.x<k||b.x>k+ +null!=b&&(k=mxUtils.getValue(b.style,"size",k));var g=a.x,f=a.y,t=a.width,n=a.height;b=null!=b?mxUtils.getValue(b.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_SOUTH?(k=n*Math.max(0,Math.min(1,k)),f=[new mxPoint(g,f),new mxPoint(g+t,f+k),new mxPoint(g+t,f+n),new mxPoint(g,f+n-k),new mxPoint(g,f)]):(k=t*Math.max(0,Math.min(1,k)),f=[new mxPoint(g+k,f),new mxPoint(g+t,f),new mxPoint(g+t-k,f+n),new mxPoint(g, +f+n),new mxPoint(g+k,f)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(e.x<g||e.x>g+t?a.y=e.y:a.x=e.x);return mxUtils.getPerimeterPoint(f,a,e)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,b,d){var k=e.prototype.size;null!=c&&(k=mxUtils.getValue(c.style,"size",k));var g=a.x,f=a.y,t=a.width,n=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST; +c==mxConstants.DIRECTION_EAST?(k=t*Math.max(0,Math.min(1,k)),f=[new mxPoint(g+k,f),new mxPoint(g+t-k,f),new mxPoint(g+t,f+n),new mxPoint(g,f+n),new mxPoint(g+k,f)]):c==mxConstants.DIRECTION_WEST?(k=t*Math.max(0,Math.min(1,k)),f=[new mxPoint(g,f),new mxPoint(g+t,f),new mxPoint(g+t-k,f+n),new mxPoint(g+k,f+n),new mxPoint(g,f)]):c==mxConstants.DIRECTION_NORTH?(k=n*Math.max(0,Math.min(1,k)),f=[new mxPoint(g,f+k),new mxPoint(g+t,f),new mxPoint(g+t,f+n),new mxPoint(g,f+n-k),new mxPoint(g,f+k)]):(k=n*Math.max(0, +Math.min(1,k)),f=[new mxPoint(g,f),new mxPoint(g+t,f+k),new mxPoint(g+t,f+n-k),new mxPoint(g,f+n),new mxPoint(g,f)]);n=a.getCenterX();a=a.getCenterY();a=new mxPoint(n,a);d&&(b.x<g||b.x>g+t?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(f,a,b)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(a,c,b,e){var d="0"!=mxUtils.getValue(c.style,"fixedSize","0"),k=d?q.prototype.fixedSize:q.prototype.size;null!=c&&(k=mxUtils.getValue(c.style, +"size",k));var g=a.x,f=a.y,t=a.width,n=a.height,X=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_EAST?(d=d?Math.max(0,Math.min(t,k)):t*Math.max(0,Math.min(1,k)),f=[new mxPoint(g,f),new mxPoint(g+t-d,f),new mxPoint(g+t,a),new mxPoint(g+t-d,f+n),new mxPoint(g,f+n),new mxPoint(g+d,a),new mxPoint(g,f)]):c==mxConstants.DIRECTION_WEST?(d=d?Math.max(0,Math.min(t,k)):t*Math.max(0, +Math.min(1,k)),f=[new mxPoint(g+d,f),new mxPoint(g+t,f),new mxPoint(g+t-d,a),new mxPoint(g+t,f+n),new mxPoint(g+d,f+n),new mxPoint(g,a),new mxPoint(g+d,f)]):c==mxConstants.DIRECTION_NORTH?(d=d?Math.max(0,Math.min(n,k)):n*Math.max(0,Math.min(1,k)),f=[new mxPoint(g,f+d),new mxPoint(X,f),new mxPoint(g+t,f+d),new mxPoint(g+t,f+n),new mxPoint(X,f+n-d),new mxPoint(g,f+n),new mxPoint(g,f+d)]):(d=d?Math.max(0,Math.min(n,k)):n*Math.max(0,Math.min(1,k)),f=[new mxPoint(g,f),new mxPoint(X,f+d),new mxPoint(g+ +t,f),new mxPoint(g+t,f+n-d),new mxPoint(X,f+n),new mxPoint(g,f+n-d),new mxPoint(g,f)]);X=new mxPoint(X,a);e&&(b.x<g||b.x>g+t?X.y=b.y:X.x=b.x);return mxUtils.getPerimeterPoint(f,X,b)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,b,e){var d=F.prototype.size;null!=c&&(d=mxUtils.getValue(c.style,"size",d));var k=a.x,g=a.y,f=a.width,t=a.height,n=a.getCenterX();a=a.getCenterY();c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION, +mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;c==mxConstants.DIRECTION_NORTH||c==mxConstants.DIRECTION_SOUTH?(d=t*Math.max(0,Math.min(1,d)),g=[new mxPoint(n,g),new mxPoint(k+f,g+d),new mxPoint(k+f,g+t-d),new mxPoint(n,g+t),new mxPoint(k,g+t-d),new mxPoint(k,g+d),new mxPoint(n,g)]):(d=f*Math.max(0,Math.min(1,d)),g=[new mxPoint(k+d,g),new mxPoint(k+f-d,g),new mxPoint(k+f,a),new mxPoint(k+f-d,g+t),new mxPoint(k+d,g+t),new mxPoint(k,a),new mxPoint(k+d,g)]);n=new mxPoint(n,a);e&&(b.x<k||b.x>k+ f?n.y=b.y:n.x=b.x);return mxUtils.getPerimeterPoint(g,n,b)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(O,mxShape);O.prototype.size=10;O.prototype.paintBackground=function(a,c,b,e,d){var k=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(c,b);a.ellipse((e-k)/2,0,k,k);a.fillAndStroke();a.begin();a.moveTo(e/2,k);a.lineTo(e/2,d);a.end();a.stroke()};mxCellRenderer.registerShape("lollipop",O);mxUtils.extend(P,mxShape);P.prototype.size= 10;P.prototype.inset=2;P.prototype.paintBackground=function(a,c,b,e,d){var k=parseFloat(mxUtils.getValue(this.style,"size",this.size)),g=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,b);a.begin();a.moveTo(e/2,k+g);a.lineTo(e/2,d);a.end();a.stroke();a.begin();a.moveTo((e-k)/2-g,k/2);a.quadTo((e-k)/2-g,k+g,e/2,k+g);a.quadTo((e+k)/2+g,k+g,(e+k)/2+g,k/2);a.end();a.stroke()};mxCellRenderer.registerShape("requires",P);mxUtils.extend(ba,mxShape);ba.prototype.paintBackground= function(a,c,b,e,d){a.translate(c,b);a.begin();a.moveTo(0,0);a.quadTo(e,0,e,d/2);a.quadTo(e,d,0,d);a.end();a.stroke()};mxCellRenderer.registerShape("requiredInterface",ba);mxUtils.extend(W,mxShape);W.prototype.inset=2;W.prototype.paintBackground=function(a,c,b,e,d){var k=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,b);a.ellipse(0,k,e-2*k,d-2*k);a.fillAndStroke();a.begin();a.moveTo(e/2,0);a.quadTo(e,0,e,d/2);a.quadTo(e,d,e/2,d);a.end();a.stroke()};mxCellRenderer.registerShape("providedRequiredInterface", -W);mxUtils.extend(G,mxCylinder);G.prototype.jettyWidth=32;G.prototype.jettyHeight=12;G.prototype.redrawPath=function(a,c,b,e,d,k){var g=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));b=g/2;var g=b+g/2,f=.3*d-c/2,u=.7*d-c/2;k?(a.moveTo(b,f),a.lineTo(g,f),a.lineTo(g,f+c),a.lineTo(b,f+c),a.moveTo(b,u),a.lineTo(g,u),a.lineTo(g,u+c),a.lineTo(b,u+c)):(a.moveTo(b,0),a.lineTo(e,0),a.lineTo(e,d),a.lineTo(b,d), -a.lineTo(b,u+c),a.lineTo(0,u+c),a.lineTo(0,u),a.lineTo(b,u),a.lineTo(b,f+c),a.lineTo(0,f+c),a.lineTo(0,f),a.lineTo(b,f),a.close());a.end()};mxCellRenderer.registerShape("component",G);mxUtils.extend(Z,mxDoubleEllipse);Z.prototype.outerStroke=!0;Z.prototype.paintVertexShape=function(a,c,b,e,d){var k=Math.min(4,Math.min(e/5,d/5));0<e&&0<d&&(a.ellipse(c+k,b+k,e-2*k,d-2*k),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&(a.ellipse(c,b,e,d),a.stroke())};mxCellRenderer.registerShape("endState",Z); +W);mxUtils.extend(G,mxCylinder);G.prototype.jettyWidth=32;G.prototype.jettyHeight=12;G.prototype.redrawPath=function(a,c,b,e,d,k){var g=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));c=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));b=g/2;var g=b+g/2,f=.3*d-c/2,t=.7*d-c/2;k?(a.moveTo(b,f),a.lineTo(g,f),a.lineTo(g,f+c),a.lineTo(b,f+c),a.moveTo(b,t),a.lineTo(g,t),a.lineTo(g,t+c),a.lineTo(b,t+c)):(a.moveTo(b,0),a.lineTo(e,0),a.lineTo(e,d),a.lineTo(b,d), +a.lineTo(b,t+c),a.lineTo(0,t+c),a.lineTo(0,t),a.lineTo(b,t),a.lineTo(b,f+c),a.lineTo(0,f+c),a.lineTo(0,f),a.lineTo(b,f),a.close());a.end()};mxCellRenderer.registerShape("component",G);mxUtils.extend(Z,mxDoubleEllipse);Z.prototype.outerStroke=!0;Z.prototype.paintVertexShape=function(a,c,b,e,d){var k=Math.min(4,Math.min(e/5,d/5));0<e&&0<d&&(a.ellipse(c+k,b+k,e-2*k,d-2*k),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&(a.ellipse(c,b,e,d),a.stroke())};mxCellRenderer.registerShape("endState",Z); mxUtils.extend(na,Z);na.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",na);mxUtils.extend(ja,mxArrowConnector);ja.prototype.defaultWidth=4;ja.prototype.isOpenEnded=function(){return!0};ja.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};ja.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",ja);mxUtils.extend(ca,mxArrowConnector);ca.prototype.defaultWidth= 10;ca.prototype.defaultArrowWidth=20;ca.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};ca.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};ca.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",ca);mxUtils.extend(ka, mxActor);ka.prototype.size=30;ka.prototype.isRoundable=function(){return!0};ka.prototype.redrawPath=function(a,c,b,e,d){c=Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size)));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,d),new mxPoint(0,c),new mxPoint(e,0),new mxPoint(e,d)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("manualInput",ka);mxUtils.extend(S,mxRectangleShape);S.prototype.dx=20;S.prototype.dy= @@ -2582,12 +2582,12 @@ d):a.moveTo(c,b+d),"1"==mxUtils.getValue(this.style,"left","1")&&a.lineTo(c,b-th wa);mxUtils.extend(za,mxActor);za.prototype.redrawPath=function(a,c,b,e,d){c=Math.min(e,d/2);a.moveTo(0,0);a.lineTo(e-c,0);a.quadTo(e,0,e,d/2);a.quadTo(e,d,e-c,d);a.lineTo(0,d);a.close();a.end()};mxCellRenderer.registerShape("delay",za);mxUtils.extend(ma,mxActor);ma.prototype.size=.2;ma.prototype.redrawPath=function(a,c,b,e,d){c=Math.min(d,e);var k=Math.max(0,Math.min(c,c*parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=(d-k)/2;b=c+k;var g=(e-k)/2,k=g+k;a.moveTo(0,c);a.lineTo(g,c);a.lineTo(g, 0);a.lineTo(k,0);a.lineTo(k,c);a.lineTo(e,c);a.lineTo(e,b);a.lineTo(k,b);a.lineTo(k,d);a.lineTo(g,d);a.lineTo(g,b);a.lineTo(0,b);a.close();a.end()};mxCellRenderer.registerShape("cross",ma);mxUtils.extend(fa,mxActor);fa.prototype.size=.25;fa.prototype.redrawPath=function(a,c,b,e,d){c=Math.min(e,d/2);b=Math.min(e-c,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*e);a.moveTo(0,d/2);a.lineTo(b,0);a.lineTo(e-c,0);a.quadTo(e,0,e,d/2);a.quadTo(e,d,e-c,d);a.lineTo(b,d);a.close();a.end()}; mxCellRenderer.registerShape("display",fa);mxUtils.extend(sa,mxConnector);sa.prototype.origPaintEdgeShape=sa.prototype.paintEdgeShape;sa.prototype.paintEdgeShape=function(a,c,b){for(var e=[],d=0;d<c.length;d++)e.push(mxUtils.clone(c[d]));var d=a.state.dashed,k=a.state.fixDash;sa.prototype.origPaintEdgeShape.apply(this,[a,e,b]);3<=a.state.strokeWidth&&(e=mxUtils.getValue(this.style,"fillColor",null),null!=e&&(a.setStrokeColor(e),a.setStrokeWidth(a.state.strokeWidth-2),a.setDashed(d,k),sa.prototype.origPaintEdgeShape.apply(this, -[a,c,b])))};mxCellRenderer.registerShape("filledEdge",sa);"undefined"!==typeof StyleFormatPanel&&function(){var a=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var c=this.format.getSelectionState(),b=a.apply(this,arguments);"umlFrame"==c.style.shape&&b.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return b}}();mxMarker.addMarker("dash",function(a,c,b,e,d,k,g,f,u,n){var t=d*(g+u+1),q=k*(g+u+1);return function(){a.begin(); -a.moveTo(e.x-t/2-q/2,e.y-q/2+t/2);a.lineTo(e.x+q/2-3*t/2,e.y-3*q/2-t/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,b,e,d,k,g,f,u,n){var t=d*(g+u+1),q=k*(g+u+1);return function(){a.begin();a.moveTo(e.x-t/2-q/2,e.y-q/2+t/2);a.lineTo(e.x+q/2-3*t/2,e.y-3*q/2-t/2);a.moveTo(e.x-t/2+q/2,e.y-q/2-t/2);a.lineTo(e.x-q/2-3*t/2,e.y-3*q/2+t/2);a.stroke()}});mxMarker.addMarker("circle",Ea);mxMarker.addMarker("circlePlus",function(a,c,b,e,d,k,g,f,u,n){var t=e.clone(),q=Ea.apply(this,arguments),C=d*(g+ -2*u),z=k*(g+2*u);return function(){q.apply(this,arguments);a.begin();a.moveTo(t.x-d*u,t.y-k*u);a.lineTo(t.x-2*C+d*u,t.y-2*z+k*u);a.moveTo(t.x-C-z+k*u,t.y-z+C-d*u);a.lineTo(t.x+z-C-k*u,t.y-z-C+d*u);a.stroke()}});mxMarker.addMarker("halfCircle",function(a,c,b,e,d,k,g,f,u,n){var t=d*(g+u+1),q=k*(g+u+1),C=e.clone();e.x-=t;e.y-=q;return function(){a.begin();a.moveTo(C.x-q,C.y+t);a.quadTo(e.x-q,e.y+t,e.x,e.y);a.quadTo(e.x+q,e.y-t,C.x+q,C.y-t);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,e,d, -k,g,f,u,n){c=d*u*1.118;b=k*u*1.118;d*=g+u;k*=g+u;var t=e.clone();t.x-=c;t.y-=b;e.x+=1*-d-c;e.y+=1*-k-b;return function(){a.begin();a.moveTo(t.x,t.y);f?a.lineTo(t.x-d-k/2,t.y-k+d/2):a.lineTo(t.x+k/2-d,t.y-k-d/2);a.lineTo(t.x-d,t.y-k);a.close();n?a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,b,e,d,k,g,f,u,n,t){k*=f+n;g*=f+n;var q=d.clone();return function(){c.begin();c.moveTo(q.x,q.y);u?c.lineTo(q.x-k-g/a,q.y-g+k/a):c.lineTo(q.x+g/a-k,q.y- +[a,c,b])))};mxCellRenderer.registerShape("filledEdge",sa);"undefined"!==typeof StyleFormatPanel&&function(){var a=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var c=this.format.getSelectionState(),b=a.apply(this,arguments);"umlFrame"==c.style.shape&&b.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return b}}();mxMarker.addMarker("dash",function(a,c,b,e,d,k,g,f,t,n){var u=d*(g+t+1),q=k*(g+t+1);return function(){a.begin(); +a.moveTo(e.x-u/2-q/2,e.y-q/2+u/2);a.lineTo(e.x+q/2-3*u/2,e.y-3*q/2-u/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,b,e,d,k,g,f,t,n){var u=d*(g+t+1),q=k*(g+t+1);return function(){a.begin();a.moveTo(e.x-u/2-q/2,e.y-q/2+u/2);a.lineTo(e.x+q/2-3*u/2,e.y-3*q/2-u/2);a.moveTo(e.x-u/2+q/2,e.y-q/2-u/2);a.lineTo(e.x-q/2-3*u/2,e.y-3*q/2+u/2);a.stroke()}});mxMarker.addMarker("circle",Ea);mxMarker.addMarker("circlePlus",function(a,c,b,e,d,k,g,f,t,n){var u=e.clone(),q=Ea.apply(this,arguments),C=d*(g+ +2*t),z=k*(g+2*t);return function(){q.apply(this,arguments);a.begin();a.moveTo(u.x-d*t,u.y-k*t);a.lineTo(u.x-2*C+d*t,u.y-2*z+k*t);a.moveTo(u.x-C-z+k*t,u.y-z+C-d*t);a.lineTo(u.x+z-C-k*t,u.y-z-C+d*t);a.stroke()}});mxMarker.addMarker("halfCircle",function(a,c,b,e,d,k,g,f,t,n){var u=d*(g+t+1),q=k*(g+t+1),C=e.clone();e.x-=u;e.y-=q;return function(){a.begin();a.moveTo(C.x-q,C.y+u);a.quadTo(e.x-q,e.y+u,e.x,e.y);a.quadTo(e.x+q,e.y-u,C.x+q,C.y-u);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,e,d, +k,g,f,t,n){c=d*t*1.118;b=k*t*1.118;d*=g+t;k*=g+t;var u=e.clone();u.x-=c;u.y-=b;e.x+=1*-d-c;e.y+=1*-k-b;return function(){a.begin();a.moveTo(u.x,u.y);f?a.lineTo(u.x-d-k/2,u.y-k+d/2):a.lineTo(u.x+k/2-d,u.y-k-d/2);a.lineTo(u.x-d,u.y-k);a.close();n?a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,b,e,d,k,g,f,t,n,u){k*=f+n;g*=f+n;var q=d.clone();return function(){c.begin();c.moveTo(q.x,q.y);t?c.lineTo(q.x-k-g/a,q.y-g+k/a):c.lineTo(q.x+g/a-k,q.y- g-k/a);c.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var Fa=function(a,c,b){return ya(a,["width"],c,function(c,e,d,k,g){g=a.shape.getEdgeWidth()*a.view.scale+b;return new mxPoint(k.x+e*c/4+d*g/2,k.y+d*c/4-e*g/2)},function(c,e,d,k,g,f){c=Math.sqrt(mxUtils.ptSegDistSq(k.x,k.y,g.x,g.y,f.x,f.y));a.style.width=Math.round(2*c)/a.view.scale-b})},ya=function(a,c,b,e,d){return U(a,c,function(c){var d=a.absolutePoints,k=d.length-1;c=a.view.translate;var g=a.view.scale,f=b?d[0]:d[k],d=b?d[1]:d[k- -1],k=d.x-f.x,u=d.y-f.y,n=Math.sqrt(k*k+u*u),f=e.call(this,n,k/n,u/n,f,d);return new mxPoint(f.x/g-c.x,f.y/g-c.y)},function(c,e,k){var g=a.absolutePoints,f=g.length-1;c=a.view.translate;var u=a.view.scale,n=b?g[0]:g[f],g=b?g[1]:g[f-1],f=g.x-n.x,t=g.y-n.y,q=Math.sqrt(f*f+t*t);e.x=(e.x+c.x)*u;e.y=(e.y+c.y)*u;d.call(this,q,f/q,t/q,n,g,e,k)})},va=function(a){return function(c){return[U(c,["arrowWidth","arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",R.prototype.arrowWidth))), +1],k=d.x-f.x,t=d.y-f.y,n=Math.sqrt(k*k+t*t),f=e.call(this,n,k/n,t/n,f,d);return new mxPoint(f.x/g-c.x,f.y/g-c.y)},function(c,e,k){var g=a.absolutePoints,f=g.length-1;c=a.view.translate;var t=a.view.scale,n=b?g[0]:g[f],g=b?g[1]:g[f-1],f=g.x-n.x,u=g.y-n.y,q=Math.sqrt(f*f+u*u);e.x=(e.x+c.x)*t;e.y=(e.y+c.y)*t;d.call(this,q,f/q,u/q,n,g,e,k)})},va=function(a){return function(c){return[U(c,["arrowWidth","arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",R.prototype.arrowWidth))), e=Math.max(0,Math.min(a,mxUtils.getValue(this.state.style,"arrowSize",R.prototype.arrowSize)));return new mxPoint(c.x+(1-e)*c.width,c.y+(1-b)*c.height/2)},function(c,b){this.state.style.arrowWidth=Math.max(0,Math.min(1,Math.abs(c.y+c.height/2-b.y)/c.height*2));this.state.style.arrowSize=Math.max(0,Math.min(a,(c.x+c.width-b.x)/c.width))})]}},Ma=function(a,c,b){return function(e){var d=[U(e,["size"],function(b){var e=Math.max(0,Math.min(b.width,Math.min(b.height,parseFloat(mxUtils.getValue(this.state.style, "size",c)))))*a;return new mxPoint(b.x+e,b.y+e)},function(c,b){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(c.width,b.x-c.x),Math.min(c.height,b.y-c.y)))/a)})];b&&mxUtils.getValue(e.style,mxConstants.STYLE_ROUNDED,!1)&&d.push(ra(e));return d}},Ga=function(a,c,b,e,d){b=null!=b?b:1;return function(k){var g=[U(k,["size"],function(c){var b=null!=d?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,e=parseFloat(mxUtils.getValue(this.state.style,"size",b?d:a));return new mxPoint(c.x+ Math.max(0,Math.min(c.width,e*(b?1:c.width))),c.getCenterY())},function(a,c,e){var g=null!=d?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null;a=g?c.x-a.x:Math.max(0,Math.min(b,(c.x-a.x)/a.width));g&&!mxEvent.isAltDown(e.getEvent())&&(a=k.view.graph.snap(a));this.state.style.size=a},null,e)];c&&mxUtils.getValue(k.style,mxConstants.STYLE_ROUNDED,!1)&&g.push(ra(k));return g}},Na=function(a){return function(c){var b=[U(c,["size"],function(c){var b=Math.max(0,Math.min(a,parseFloat(mxUtils.getValue(this.state.style, @@ -2595,14 +2595,14 @@ Math.max(0,Math.min(c.width,e*(b?1:c.width))),c.getCenterY())},function(a,c,e){v mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var d=mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(b.x+b.width-Math.min(b.width/2,d),b.y+e)}d=Math.max(0,parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(b.x+b.width-Math.min(Math.max(b.width/2,b.height/2),Math.min(b.width,b.height)*d),b.y+e)},function(c,b,e){"1"==mxUtils.getValue(a.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)? this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(c.width,2*(c.x+c.width-b.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(c.width-b.x+c.x)/Math.min(c.width,c.height))))})},U=function(a,c,b,e,d,k){var g=new mxHandle(a,null,mxVertexHandler.prototype.secondaryHandleImage);g.execute=function(){for(var a=0;a<c.length;a++)this.copyStyle(c[a])};g.getPosition=b;g.setPosition=e;g.ignoreGrid=null!=d?d:!0;if(k){var f=g.positionChanged;g.positionChanged= function(){f.apply(this,arguments);a.view.invalidate(this.state.cell);a.view.validate()}}return g},Ha={link:function(a){return[Fa(a,!0,10),Fa(a,!1,10)]},flexArrow:function(a){var c=a.view.graph.gridSize/a.view.scale,b=[];mxUtils.getValue(a.style,mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(ya(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,e,d,k){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;k=3*mxUtils.getNumber(a.style, -mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(d.x+b*(k+a.shape.strokewidth*a.view.scale)+e*c/2,d.y+e*(k+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,e,d,k,g,f,u){b=Math.sqrt(mxUtils.ptSegDistSq(k.x,k.y,g.x,g.y,f.x,f.y));e=mxUtils.ptLineDist(k.x,k.y,k.x+d,k.y-e,f.x,f.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(e-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(u.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]= -a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(u.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE])})),b.push(ya(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,e,d,k){c=(a.shape.getStartArrowWidth()-a.shape.strokewidth)*a.view.scale;k=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/ -5)*a.view.scale;return new mxPoint(d.x+b*(k+a.shape.strokewidth*a.view.scale)+e*c/2,d.y+e*(k+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,e,d,k,g,f,u){b=Math.sqrt(mxUtils.ptSegDistSq(k.x,k.y,g.x,g.y,f.x,f.y));e=mxUtils.ptLineDist(k.x,k.y,k.x+d,k.y-e,f.x,f.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(e-a.shape.strokewidth)/3)/100/a.view.scale;a.style.startWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(u.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]= -a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(u.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(a.style.startWidth)-parseFloat(a.style.endWidth))<c&&(a.style.startWidth=a.style.endWidth))})));mxUtils.getValue(a.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(ya(a, -["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,e,d,k){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;k=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(d.x+b*(k+a.shape.strokewidth*a.view.scale)-e*c/2,d.y+e*(k+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,e,d,k,g,f,u){b=Math.sqrt(mxUtils.ptSegDistSq(k.x,k.y,g.x,g.y,f.x,f.y));e=mxUtils.ptLineDist(k.x,k.y,k.x+d,k.y-e,f.x,f.y);a.style[mxConstants.STYLE_ENDSIZE]= -Math.round(100*(e-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(u.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);mxEvent.isAltDown(u.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE])})),b.push(ya(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE], -!1,function(c,b,e,d,k){c=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;k=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(d.x+b*(k+a.shape.strokewidth*a.view.scale)-e*c/2,d.y+e*(k+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,e,d,k,g,f,u){b=Math.sqrt(mxUtils.ptSegDistSq(k.x,k.y,g.x,g.y,f.x,f.y));e=mxUtils.ptLineDist(k.x,k.y,k.x+d,k.y-e,f.x,f.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(e-a.shape.strokewidth)/ -3)/100/a.view.scale;a.style.endWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(u.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(u.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(a.style.endWidth)- +mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(d.x+b*(k+a.shape.strokewidth*a.view.scale)+e*c/2,d.y+e*(k+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,e,d,k,g,f,t){b=Math.sqrt(mxUtils.ptSegDistSq(k.x,k.y,g.x,g.y,f.x,f.y));e=mxUtils.ptLineDist(k.x,k.y,k.x+d,k.y-e,f.x,f.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(e-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(t.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]= +a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(t.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE])})),b.push(ya(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,e,d,k){c=(a.shape.getStartArrowWidth()-a.shape.strokewidth)*a.view.scale;k=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/ +5)*a.view.scale;return new mxPoint(d.x+b*(k+a.shape.strokewidth*a.view.scale)+e*c/2,d.y+e*(k+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,e,d,k,g,f,t){b=Math.sqrt(mxUtils.ptSegDistSq(k.x,k.y,g.x,g.y,f.x,f.y));e=mxUtils.ptLineDist(k.x,k.y,k.x+d,k.y-e,f.x,f.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(e-a.shape.strokewidth)/3)/100/a.view.scale;a.style.startWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(t.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]= +a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(t.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(a.style.startWidth)-parseFloat(a.style.endWidth))<c&&(a.style.startWidth=a.style.endWidth))})));mxUtils.getValue(a.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(ya(a, +["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,e,d,k){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;k=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(d.x+b*(k+a.shape.strokewidth*a.view.scale)-e*c/2,d.y+e*(k+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,e,d,k,g,f,t){b=Math.sqrt(mxUtils.ptSegDistSq(k.x,k.y,g.x,g.y,f.x,f.y));e=mxUtils.ptLineDist(k.x,k.y,k.x+d,k.y-e,f.x,f.y);a.style[mxConstants.STYLE_ENDSIZE]= +Math.round(100*(e-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(t.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);mxEvent.isAltDown(t.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE])})),b.push(ya(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE], +!1,function(c,b,e,d,k){c=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;k=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(d.x+b*(k+a.shape.strokewidth*a.view.scale)-e*c/2,d.y+e*(k+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,e,d,k,g,f,t){b=Math.sqrt(mxUtils.ptSegDistSq(k.x,k.y,g.x,g.y,f.x,f.y));e=mxUtils.ptLineDist(k.x,k.y,k.x+d,k.y-e,f.x,f.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(e-a.shape.strokewidth)/ +3)/100/a.view.scale;a.style.endWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(t.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(t.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(a.style.endWidth)- parseFloat(a.style.startWidth))<c&&(a.style.endWidth=a.style.startWidth))})));return b},swimlane:function(a){var c=[U(a,[mxConstants.STYLE_STARTSIZE],function(c){var b=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(c.getCenterX(),c.y+Math.max(0,Math.min(c.height,b))):new mxPoint(c.x+Math.max(0,Math.min(c.width,b)),c.getCenterY())},function(c,b){a.style[mxConstants.STYLE_STARTSIZE]= 1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(c.height,b.y-c.y))):Math.round(Math.max(0,Math.min(c.width,b.x-c.x)))})];if(mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED)){var b=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));c.push(ra(a,b/2))}return c},label:Da(),ext:Da(),rectangle:Da(),triangle:Da(),rhombus:Da(),umlLifeline:function(a){return[U(a,["size"],function(a){var c=Math.max(0,Math.min(a.height, parseFloat(mxUtils.getValue(this.state.style,"size",D.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))},!1)]},umlFrame:function(a){return[U(a,["width","height"],function(a){var c=Math.max(L.prototype.corner,Math.min(a.width,mxUtils.getValue(this.state.style,"width",L.prototype.width))),b=Math.max(1.5*L.prototype.corner,Math.min(a.height,mxUtils.getValue(this.state.style,"height",L.prototype.height))); @@ -2622,8 +2622,8 @@ Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",y.prototype.size) a.height-c.y)/a.height))})]},step:Ga(q.prototype.size,!0,null,!0,q.prototype.fixedSize),hexagon:Ga(F.prototype.size,!0,.5,!0),curlyBracket:Ga(k.prototype.size,!1),display:Ga(fa.prototype.size,!1),cube:Ma(1,a.prototype.size,!1),card:Ma(.5,v.prototype.size,!0),loopLimit:Ma(.5,N.prototype.size,!0),trapezoid:Na(.5),parallelogram:Na(1)};Graph.createHandle=U;Graph.handleFactory=Ha;mxVertexHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()&&this.graph.isCellRotatable(this.state.cell)){var a= this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a=mxConstants.SHAPE_RECTANGLE);a=Ha[a];null==a&&null!=this.state.shape&&this.state.shape.isRoundable()&&(a=Ha[mxConstants.SHAPE_RECTANGLE]);if(null!=a)return a(this.state)}return null};mxEdgeHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()){var a=this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a= mxConstants.SHAPE_CONNECTOR);a=Ha[a];if(null!=a)return a(this.state)}return null}}else Graph.createHandle=function(){},Graph.handleFactory={};var Ia=new mxPoint(1,0),Ja=new mxPoint(1,0),va=mxUtils.toRadians(-30),Ia=mxUtils.getRotatedPoint(Ia,Math.cos(va),Math.sin(va)),va=mxUtils.toRadians(-150),Ja=mxUtils.getRotatedPoint(Ja,Math.cos(va),Math.sin(va));mxEdgeStyle.IsometricConnector=function(a,c,b,e,d){var k=a.view;e=null!=e&&0<e.length?e[0]:null;var g=a.absolutePoints,f=g[0],g=g[g.length-1];null!= -e&&(e=k.transformControlPoint(a,e));null==f&&null!=c&&(f=new mxPoint(c.getCenterX(),c.getCenterY()));null==g&&null!=b&&(g=new mxPoint(b.getCenterX(),b.getCenterY()));var u=Ia.x,n=Ia.y,t=Ja.x,q=Ja.y,C="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=f){a=function(a,c,b){a-=z.x;var e=c-z.y;c=(q*a-t*e)/(u*q-n*t);a=(n*a-u*e)/(n*t-u*q);C?(b&&(z=new mxPoint(z.x+u*c,z.y+n*c),d.push(z)),z=new mxPoint(z.x+t*a,z.y+q*a)):(b&&(z=new mxPoint(z.x+t*a,z.y+q*a),d.push(z)),z=new mxPoint(z.x+ -u*c,z.y+n*c));d.push(z)};var z=f;null==e&&(e=new mxPoint(f.x+(g.x-f.x)/2,f.y+(g.y-f.y)/2));a(e.x,e.y,!0);a(g.x,g.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Oa=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Oa.apply(this,arguments)};b.prototype.constraints=[];f.prototype.getConstraints=function(a,c,b){a=[];var e= +e&&(e=k.transformControlPoint(a,e));null==f&&null!=c&&(f=new mxPoint(c.getCenterX(),c.getCenterY()));null==g&&null!=b&&(g=new mxPoint(b.getCenterX(),b.getCenterY()));var t=Ia.x,n=Ia.y,u=Ja.x,q=Ja.y,C="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=f){a=function(a,c,b){a-=z.x;var e=c-z.y;c=(q*a-u*e)/(t*q-n*u);a=(n*a-t*e)/(n*u-t*q);C?(b&&(z=new mxPoint(z.x+t*c,z.y+n*c),d.push(z)),z=new mxPoint(z.x+u*a,z.y+q*a)):(b&&(z=new mxPoint(z.x+u*a,z.y+q*a),d.push(z)),z=new mxPoint(z.x+ +t*c,z.y+n*c));d.push(z)};var z=f;null==e&&(e=new mxPoint(f.x+(g.x-f.x)/2,f.y+(g.y-f.y)/2));a(e.x,e.y,!0);a(g.x,g.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Oa=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Oa.apply(this,arguments)};b.prototype.constraints=[];f.prototype.getConstraints=function(a,c,b){a=[];var e= Math.tan(mxUtils.toRadians(30)),d=(.5-e)/2,e=Math.min(c,b/(.5+e));c=(c-e)/2;b=(b-e)/2;a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,b+.25*e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+.5*e,b+e*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+e,b+.25*e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+e,b+.75*e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+.5*e,b+(1-d)*e));a.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,c,b+.75*e));return a};A.prototype.getConstraints=function(a,c,b){a=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var e=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",this.position));var d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));a.push(new mxConnectionConstraint(new mxPoint(0, 0),!1));a.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*(b-e)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,b-e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0, @@ -2672,7 +2672,7 @@ function(){d.openLink(b.getUrl())});this.addAction("open...",function(){window.o ": "+c.message)}}));b.showDialog((new OpenDialog(this)).container,320,220,!0,!0,function(){window.openFile=null})}).isEnabled=l;this.addAction("save",function(){b.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=l;this.addAction("saveAs...",function(){b.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S").isEnabled=l;this.addAction("export...",function(){b.showDialog((new ExportDialog(b)).container,300,296,!0,!0)});this.addAction("editDiagram...",function(){var a=new EditDiagramDialog(b);b.showDialog(a.container, 620,420,!0,!1);a.init()});this.addAction("pageSetup...",function(){b.showDialog((new PageSetupDialog(b)).container,320,220,!0,!0)}).isEnabled=l;this.addAction("print...",function(){b.showDialog((new PrintDialog(b)).container,300,180,!0,!0)},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(d,null,10,10)});this.addAction("undo",function(){b.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){b.redo()},null,"sprite-redo",mxClient.IS_WIN? Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",function(){mxClipboard.cut(d)},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){mxClipboard.copy(d)},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&mxClipboard.paste(d)},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(a){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){d.getModel().beginUpdate(); -try{var b=mxClipboard.paste(d);if(null!=b){a=!0;for(var f=0;f<b.length&&a;f++)a=a&&d.model.isEdge(b[f]);var c=d.view.translate,e=d.view.scale,k=c.x,t=c.y,c=null;if(1==b.length&&a){var n=d.getCellGeometry(b[0]);null!=n&&(c=n.getTerminalPoint(!0))}c=null!=c?c:d.getBoundingBoxFromGeometry(b,a);if(null!=c){var g=Math.round(d.snap(d.popupMenuHandler.triggerX/e-k)),z=Math.round(d.snap(d.popupMenuHandler.triggerY/e-t));d.cellsMoved(b,g-c.x,z-c.y)}}}finally{d.getModel().endUpdate()}}});this.addAction("copySize", +try{var b=mxClipboard.paste(d);if(null!=b){a=!0;for(var f=0;f<b.length&&a;f++)a=a&&d.model.isEdge(b[f]);var c=d.view.translate,e=d.view.scale,k=c.x,u=c.y,c=null;if(1==b.length&&a){var n=d.getCellGeometry(b[0]);null!=n&&(c=n.getTerminalPoint(!0))}c=null!=c?c:d.getBoundingBoxFromGeometry(b,a);if(null!=c){var g=Math.round(d.snap(d.popupMenuHandler.triggerX/e-k)),z=Math.round(d.snap(d.popupMenuHandler.triggerY/e-u));d.cellsMoved(b,g-c.x,z-c.y)}}}finally{d.getModel().endUpdate()}}});this.addAction("copySize", function(a){a=d.getSelectionCell();d.isEnabled()&&null!=a&&d.getModel().isVertex(a)&&(a=d.getCellGeometry(a),null!=a&&(b.copiedSize=new mxRectangle(a.x,a.y,a.width,a.height)))},null,null,"Alt+Shit+X");this.addAction("pasteSize",function(a){if(d.isEnabled()&&!d.isSelectionEmpty()&&null!=b.copiedSize){d.getModel().beginUpdate();try{var f=d.getSelectionCells();for(a=0;a<f.length;a++)if(d.getModel().isVertex(f[a])){var l=d.getCellGeometry(f[a]);null!=l&&(l=l.clone(),l.width=b.copiedSize.width,l.height= b.copiedSize.height,d.getModel().setGeometry(f[a],l))}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shit+V");this.addAction("delete",function(b){a(null!=b&&mxEvent.isShiftDown(b))},null,null,"Delete");this.addAction("deleteAll",function(){a(!0)},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){d.setSelectionCells(d.duplicateCells())},null,null,Editor.ctrlKey+"+D");this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(){d.turnShapes(d.getSelectionCells())}, null,null,Editor.ctrlKey+"+R"));this.addAction("selectVertices",function(){d.selectVertices()},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){d.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",function(){d.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){d.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A");this.addAction("lockUnlock",function(){if(!d.isSelectionEmpty()){d.getModel().beginUpdate(); @@ -2683,8 +2683,8 @@ null,null,"F2/Enter");this.addAction("editData...",function(){var a=d.getSelecti 320,200,!0,!0);f.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var a=d.getLinkForCell(d.getSelectionCell());null!=a&&d.openLink(a)});this.addAction("editLink...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),f=a.getLinkForCell(d)||"";b.showLinkDialog(f,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(d,0<c.length?c:null)})}},null,null,"Alt+Shift+L");this.put("insertImage",new Action(mxResources.get("image")+ "...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(d.clearSelection(),b.actions.get("image").funct())})).isEnabled=l;this.put("insertLink",new Action(mxResources.get("link")+"...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&b.showLinkDialog("",mxResources.get("insert"),function(a,b){a=mxUtils.trim(a);if(0<a.length){var f=null,c=d.getLinkTitle(a);null!=b&&0<b.length&&(f=b[0].iconUrl,c=b[0].name||b[0].type,c=c.charAt(0).toUpperCase()+c.substring(1),30<c.length&& (c=c.substring(0,30)+"..."));var e=d.getFreeInsertPoint(),f=new mxCell(c,new mxGeometry(e.x,e.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+(null!=f?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+f:"spacing=10;"));f.vertex=!0;d.setLinkForCell(f,a);d.cellSizeUpdated(f,!0);d.getModel().beginUpdate();try{f=d.addCell(f),d.fireEvent(new mxEventObject("cellsInserted","cells",[f]))}finally{d.getModel().endUpdate()}d.setSelectionCell(f);d.scrollCellToVisible(d.getSelectionCell())}})})).isEnabled= -l;this.addAction("link...",mxUtils.bind(this,function(){var a=b.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var d=a.getSelectedElement(),f=a.getParentByName(d,"A",a.cellEditor.textarea),c="";if(null==f&&null!=d&&null!=d.getElementsByTagName)for(var e=d.getElementsByTagName("a"),k=0;k<e.length&&null==f;k++)e[k].textContent==d.textContent&&(f=e[k]);null!=f&&"A"==f.nodeName&&(c=f.getAttribute("href")||"",a.selectNode(f));var t=a.cellEditor.saveSelection();b.showLinkDialog(c,mxResources.get("apply"), -mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(t);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=l;this.addAction("autosize",function(){var a=d.getSelectionCells();if(null!=a){d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var f=a[b];if(d.getModel().getChildCount(f))d.updateGroupBounds([f],20);else{var c=d.view.getState(f),e=d.getCellGeometry(f);d.getModel().isVertex(f)&&null!=c&&null!=c.text&& +l;this.addAction("link...",mxUtils.bind(this,function(){var a=b.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var d=a.getSelectedElement(),f=a.getParentByName(d,"A",a.cellEditor.textarea),c="";if(null==f&&null!=d&&null!=d.getElementsByTagName)for(var e=d.getElementsByTagName("a"),k=0;k<e.length&&null==f;k++)e[k].textContent==d.textContent&&(f=e[k]);null!=f&&"A"==f.nodeName&&(c=f.getAttribute("href")||"",a.selectNode(f));var u=a.cellEditor.saveSelection();b.showLinkDialog(c,mxResources.get("apply"), +mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(u);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=l;this.addAction("autosize",function(){var a=d.getSelectionCells();if(null!=a){d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var f=a[b];if(d.getModel().getChildCount(f))d.updateGroupBounds([f],20);else{var c=d.view.getState(f),e=d.getCellGeometry(f);d.getModel().isVertex(f)&&null!=c&&null!=c.text&& null!=e&&d.isWrapping(f)?(e=e.clone(),e.height=c.text.boundingBox.height/d.view.scale,d.getModel().setGeometry(f,e)):d.updateCellSize(f)}}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=d.getView().getState(d.getSelectionCell());if(null!=a){var f="1";d.stopEditing();d.getModel().beginUpdate();try{if("1"==a.style.html){var f=null,l=d.convertValueToString(a.cell);"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(l=l.replace(/\n/g, "").replace(/<br\s*.?>/g,"\n"));var c=document.createElement("div");c.innerHTML=l;l=mxUtils.extractTextWithWhitespace(c.childNodes);d.cellLabelChanged(a.cell,l)}else l=mxUtils.htmlEntities(d.convertValueToString(a.cell),!1),"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(l=l.replace(/\n/g,"<br/>")),d.cellLabelChanged(a.cell,d.sanitizeHtml(l));d.setCellStyles("html",f);b.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=f?f:"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}}); this.addAction("wordWrap",function(){var a=d.getView().getState(d.getSelectionCell()),b="wrap";d.stopEditing();null!=a&&"wrap"==a.style[mxConstants.STYLE_WHITE_SPACE]&&(b=null);d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,b)});this.addAction("rotation",function(){var a="0",f=d.getView().getState(d.getSelectionCell());null!=f&&(a=f.style[mxConstants.STYLE_ROTATION]||a);a=new FilenameDialog(b,a,mxResources.get("apply"),function(a){null!=a&&0<a.length&&d.setCellStyles(mxConstants.STYLE_ROTATION,a)}, @@ -2713,7 +2713,7 @@ function(b){null!=b&&d.setCellStyle(mxUtils.trim(b),a)},null,null,400,220);this. if(null!=a&&d.getModel().isEdge(a)){var b=f.graph.selectionCellsHandler.getHandler(a);if(b instanceof mxEdgeHandler){for(var l=d.view.translate,c=d.view.scale,e=l.x,l=l.y,a=d.getModel().getParent(a),k=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=k;)e+=k.x,l+=k.y,a=d.getModel().getParent(a),k=d.getCellGeometry(a);e=Math.round(d.snap(d.popupMenuHandler.triggerX/c-e));c=Math.round(d.snap(d.popupMenuHandler.triggerY/c-l));b.addPointAt(b.state,e,c)}}});this.addAction("removeWaypoint",function(){var a= b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=d.getSelectionCells();if(null!=a){a=d.addAllEdges(a);d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var f=a[b];if(d.getModel().isEdge(f)){var c=d.getCellGeometry(f);null!=c&&(c=c.clone(),c.points=null,d.getModel().setGeometry(f,c))}}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C");m=this.addAction("subscript",mxUtils.bind(this, function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");m=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",f=d.getView().getState(d.getSelectionCell()),l="";null!= -f&&(l=f.style[mxConstants.STYLE_IMAGE]||l);var c=d.cellEditor.saveSelection();b.showImageDialog(a,l,function(a,b,f){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(c),d.insertImage(a,b,f);else{var e=d.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var k=null;d.getModel().beginUpdate();try{if(0==e.length){var t=d.getFreeInsertPoint(),k=e=[d.insertVertex(d.getDefaultParent(),null,"",t.x,t.y,b,f,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")]; +f&&(l=f.style[mxConstants.STYLE_IMAGE]||l);var c=d.cellEditor.saveSelection();b.showImageDialog(a,l,function(a,b,f){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(c),d.insertImage(a,b,f);else{var e=d.getSelectionCells();if(null!=a&&(0<a.length||0<e.length)){var k=null;d.getModel().beginUpdate();try{if(0==e.length){var u=d.getFreeInsertPoint(),k=e=[d.insertVertex(d.getDefaultParent(),null,"",u.x,u.y,b,f,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")]; d.fireEvent(new mxEventObject("cellsInserted","cells",k))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,e);var l=d.view.getState(e[0]),q=null!=l?l.style:d.getCellStyle(e[0]);"image"!=q[mxConstants.STYLE_SHAPE]&&"label"!=q[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",e):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,e);if(1==d.getSelectionCount()&&null!=b&&null!=f){var m=e[0],x=d.getModel().getGeometry(m);null!=x&&(x=x.clone(),x.width=b,x.height=f, d.getModel().setGeometry(m,x))}}finally{d.getModel().endUpdate()}null!=k&&(d.setSelectionCells(k),d.scrollCellToVisible(k[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=l;m=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(b,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide", function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("layers"))):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));m=this.addAction("formatPanel",mxUtils.bind(this,function(){b.toggleFormatPanel()}),null,null,Editor.ctrlKey+ @@ -2726,8 +2726,8 @@ DrawioFile.prototype.maxAutosaveRevisionDelay=3E5;DrawioFile.prototype.inConflic DrawioFile.prototype.synchronizeFile=function(a,b){this.savingFile?null!=b&&b({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(a,b):this.updateFile(a,b)}; DrawioFile.prototype.updateFile=function(a,b,f,d){null!=f&&f()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=b&&b():this.getLatestVersion(mxUtils.bind(this,function(l){try{null!=f&&f()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=b&&b():null!=l?this.mergeFile(l,a,b,d):this.reloadFile(a,b))}catch(m){null!=b&&b(m)}}),b))}; DrawioFile.prototype.mergeFile=function(a,b,f,d){var l=!0;try{this.stats.fileMerged++;var m=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),p=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=p&&0<p.length){this.shadowPages=p;this.backupPatch=this.isModified()?this.ui.diffPages(m,this.ui.pages):null;var v=[this.ui.diffPages(null!=d?d:m,this.shadowPages)];if(!this.ignorePatches(v)){var y=this.ui.patchPages(m, -v[0]);d={};var B=this.ui.getHashValueForPages(y,d),m={},c=this.ui.getHashValueForPages(this.shadowPages,m);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",v,"checksum",c==B,B);if(null!=B&&B!=c){var e=this.compressReportData(this.getAnonymizedXmlForPages(p)),k=this.compressReportData(this.getAnonymizedXmlForPages(y)),t=this.ui.hashValue(a.getCurrentEtag()),n=this.ui.hashValue(this.getCurrentEtag());this.checksumError(f,v,"Shadow Details: "+JSON.stringify(d)+ -"\nChecksum: "+B+"\nCurrent: "+c+"\nCurrent Details: "+JSON.stringify(m)+"\nFrom: "+t+"\nTo: "+n+"\n\nFile Data:\n"+e+"\nPatched Shadow:\n"+k,null,"mergeFile");return}this.patch(v,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw l=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=b&&b()}catch(A){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged(); +v[0]);d={};var B=this.ui.getHashValueForPages(y,d),m={},c=this.ui.getHashValueForPages(this.shadowPages,m);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",v,"checksum",c==B,B);if(null!=B&&B!=c){var e=this.compressReportData(this.getAnonymizedXmlForPages(p)),k=this.compressReportData(this.getAnonymizedXmlForPages(y)),u=this.ui.hashValue(a.getCurrentEtag()),n=this.ui.hashValue(this.getCurrentEtag());this.checksumError(f,v,"Shadow Details: "+JSON.stringify(d)+ +"\nChecksum: "+B+"\nCurrent: "+c+"\nCurrent Details: "+JSON.stringify(m)+"\nFrom: "+u+"\nTo: "+n+"\n\nFile Data:\n"+e+"\nPatched Shadow:\n"+k,null,"mergeFile");return}this.patch(v,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw l=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=b&&b()}catch(A){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged(); null!=f&&f(A);try{if(l)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,A);else{var g=this.getCurrentUser(),z=null!=g?g.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),z,A)}}catch(q){}}}; DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var b=new mxCodec(mxUtils.createXmlDocument()),f=b.document.createElement("mxfile");if(null!=a)for(var d=0;d<a.length;d++){var l=b.encode(new mxGraphModel(a[d].root));"1"!=urlParams.dev&&(l=this.ui.anonymizeNode(l,!0));l.setAttribute("id",a[d].getId());a[d].viewState&&this.ui.editor.graph.saveViewState(a[d].viewState,l,!0);f.appendChild(l)}return mxUtils.getPrettyXml(f)}; DrawioFile.prototype.compressReportData=function(a,b,f){b=null!=b?b:1E4;null!=f&&null!=a&&a.length>f?a=a.substring(0,f)+"[...]":null!=a&&a.length>b&&(a=Graph.compress(a)+"\n");return a}; @@ -2839,14 +2839,14 @@ c(a)};Editor.prototype.base64Encode=function(a){for(var c="",b=0,e=a.length,d,k, 4|(k&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2);c+="=";break}g=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4|(k&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2|(g&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return c}; Editor.prototype.loadUrl=function(a,c,b,e,d,k){try{var g=e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);d=null!=d?d:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=c){var e=a.getText();if(g){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var e=Array(a.length), d=0;d<a.length;d++)e[d]=String.fromCharCode(a[d]);e=e.join("")}k=null!=k?k:"data:image/png;base64,";e=k+this.base64Encode(e)}c(e)}}else null!=b&&b({code:App.ERROR_UNKNOWN},a)}),function(){null!=b&&b({code:App.ERROR_UNKNOWN})},g,this.timeout,function(){d&&null!=b&&b({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(O){null!=b&&b(O)}};Editor.prototype.loadFonts=function(a){if(null!=this.fontCss&&null==this.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$", -"g"),"")},b=this.fontCss.split("url("),e=0,d={},k=mxUtils.bind(this,function(){if(0==e){for(var k=[b[0]],g=1;g<b.length;g++){var f=b[g].indexOf(")");k.push('url("');k.push(d[c(b[g].substring(0,f))]);k.push('"'+b[g].substring(f))}this.resolvedFontCss=k.join("");a()}});if(0<b.length)for(var g=1;g<b.length;g++){var f=b[g].indexOf(")"),n=null,u=b[g].indexOf("format(",f);0<u&&(n=c(b[g].substring(u+7,b[g].indexOf(")",u))));mxUtils.bind(this,function(a){if(null==d[a]){d[a]=a;e++;var c="application/x-font-ttf"; +"g"),"")},b=this.fontCss.split("url("),e=0,d={},k=mxUtils.bind(this,function(){if(0==e){for(var k=[b[0]],g=1;g<b.length;g++){var f=b[g].indexOf(")");k.push('url("');k.push(d[c(b[g].substring(0,f))]);k.push('"'+b[g].substring(f))}this.resolvedFontCss=k.join("");a()}});if(0<b.length)for(var g=1;g<b.length;g++){var f=b[g].indexOf(")"),n=null,t=b[g].indexOf("format(",f);0<t&&(n=c(b[g].substring(t+7,b[g].indexOf(")",t))));mxUtils.bind(this,function(a){if(null==d[a]){d[a]=a;e++;var c="application/x-font-ttf"; if("svg"==n||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==n||"embedded-opentype"==n||/(\.otf)($|\?)/i.test(a))c="application/x-font-opentype";else if("woff"==n||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==n||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==n||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==n||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&& (b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){d[a]=c;e--;k()}),mxUtils.bind(this,function(a){e--;k()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[g].substring(0,f)),n)}}else a()};Editor.prototype.convertMath=function(a,c,b,e){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(c),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,function(){e()}))}),0)):e()};Editor.prototype.isExportToCanvas= -function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=function(a,c,b,e,d,k,g,f,n,t,q,z,l,x){k=null!=k?k:!0;z=null!=z?z:this.graph;l=null!=l?l:0;var u=n?null:z.background;u==mxConstants.NONE&&(u=null);null==u&&(u=e);null==u&&0==n&&(u=this.graph.defaultPageBackgroundColor);this.convertImages(z.getSvg(u,null,null,x,null,null!=g?g:!0,null,null,null,t),mxUtils.bind(this,function(b){var e=new Image;e.onload=mxUtils.bind(this,function(){try{var g= -document.createElement("canvas"),n=parseInt(b.getAttribute("width")),t=parseInt(b.getAttribute("height"));f=null!=f?f:1;null!=c&&(f=k?Math.min(1,Math.min(3*c/(4*t),c/n)):c/n);n=Math.ceil(f*n)+2*l;t=Math.ceil(f*t)+2*l;g.setAttribute("width",n);g.setAttribute("height",t);var q=g.getContext("2d");null!=u&&(q.beginPath(),q.rect(0,0,n,t),q.fillStyle=u,q.fill());q.scale(f,f);mxClient.IS_SF?window.setTimeout(function(){q.drawImage(e,l/f,l/f);a(g)},0):(q.drawImage(e,l/f,l/f),a(g))}catch(R){null!=d&&d(R)}}); -e.onerror=function(a){null!=d&&d(a)};try{t&&this.graph.addSvgShadow(b);var g=mxUtils.bind(this,function(){if(null!=this.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.resolvedFontCss;b.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(z,b,!0,mxUtils.bind(this,function(){e.src=this.createSvgDataUri(mxUtils.getXml(b))}))});this.loadFonts(g)}catch(S){null!=d&&d(S)}}),b,q)};Editor.prototype.writeGraphModelToPng=function(a,c,b,e, -d){function k(a,c){var b=n;n+=c;return a.substring(b,n)}function g(a){a=k(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function f(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var n=0;if(k(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(k(a,4),"IHDR"!=k(a,4))null!=d&&d();else{k(a,17);d=a.substring(0,n);do{var u=g(a); -if("IDAT"==k(a,4)){d=a.substring(0,n-8);b=b+String.fromCharCode(0)+("zTXt"==c?String.fromCharCode(0):"")+e;e=4294967295;e=EditorUi.prototype.updateCRC(e,c,0,4);e=EditorUi.prototype.updateCRC(e,b,0,b.length);d+=f(b.length)+c+b+f(e^4294967295);d+=a.substring(n-8,a.length);break}d+=a.substring(n-8,n-4+u);k(a,u);k(a,4)}while(u);return"data:image/png;base64,"+(window.btoa?btoa(d):Base64.encode(d,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://desk.draw.io/support/solutions/articles/16000091426"; +function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=function(a,c,b,e,d,k,g,f,n,u,q,z,l,x){k=null!=k?k:!0;z=null!=z?z:this.graph;l=null!=l?l:0;var t=n?null:z.background;t==mxConstants.NONE&&(t=null);null==t&&(t=e);null==t&&0==n&&(t=this.graph.defaultPageBackgroundColor);this.convertImages(z.getSvg(t,null,null,x,null,null!=g?g:!0,null,null,null,u),mxUtils.bind(this,function(b){var e=new Image;e.onload=mxUtils.bind(this,function(){try{var g= +document.createElement("canvas"),n=parseInt(b.getAttribute("width")),u=parseInt(b.getAttribute("height"));f=null!=f?f:1;null!=c&&(f=k?Math.min(1,Math.min(3*c/(4*u),c/n)):c/n);n=Math.ceil(f*n)+2*l;u=Math.ceil(f*u)+2*l;g.setAttribute("width",n);g.setAttribute("height",u);var q=g.getContext("2d");null!=t&&(q.beginPath(),q.rect(0,0,n,u),q.fillStyle=t,q.fill());q.scale(f,f);mxClient.IS_SF?window.setTimeout(function(){q.drawImage(e,l/f,l/f);a(g)},0):(q.drawImage(e,l/f,l/f),a(g))}catch(R){null!=d&&d(R)}}); +e.onerror=function(a){null!=d&&d(a)};try{u&&this.graph.addSvgShadow(b);var g=mxUtils.bind(this,function(){if(null!=this.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.resolvedFontCss;b.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(z,b,!0,mxUtils.bind(this,function(){e.src=this.createSvgDataUri(mxUtils.getXml(b))}))});this.loadFonts(g)}catch(S){null!=d&&d(S)}}),b,q)};Editor.prototype.writeGraphModelToPng=function(a,c,b,e, +d){function k(a,c){var b=n;n+=c;return a.substring(b,n)}function g(a){a=k(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function f(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var n=0;if(k(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(k(a,4),"IHDR"!=k(a,4))null!=d&&d();else{k(a,17);d=a.substring(0,n);do{var t=g(a); +if("IDAT"==k(a,4)){d=a.substring(0,n-8);b=b+String.fromCharCode(0)+("zTXt"==c?String.fromCharCode(0):"")+e;e=4294967295;e=EditorUi.prototype.updateCRC(e,c,0,4);e=EditorUi.prototype.updateCRC(e,b,0,b.length);d+=f(b.length)+c+b+f(e^4294967295);d+=a.substring(n-8,a.length);break}d+=a.substring(n-8,n-4+t);k(a,t);k(a,4)}while(t);return"data:image/png;base64,"+(window.btoa?btoa(d):Base64.encode(d,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://desk.draw.io/support/solutions/articles/16000091426"; var l=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,c){l.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()};var m=ColorDialog.resetRecentColors;ColorDialog.resetRecentColors=function(){m.apply(this,arguments);mxSettings.setRecentColors(ColorDialog.recentColors);mxSettings.save()}}window.EditDataDialog&&(EditDataDialog.getDisplayIdForCell=function(a,c){var b=null;null!=a.editor.graph.getModel().getParent(c)?b=c.getId():null!=a.currentPage&& (b=a.currentPage.getId());return b});if(null!=window.StyleFormatPanel){var p=Format.prototype.init;Format.prototype.init=function(){p.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var v=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?v.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isShadowOptionVisible=function(){var a=this.editorUi.getCurrentFile(); return"1"==urlParams.embed||null!=a&&a.isEditable()};DiagramFormatPanel.prototype.isMathOptionVisible=function(a){return!1};var y=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=y.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var c=this.editorUi,b=c.editor.graph,e=this.createOption(mxResources.get("shadow"),function(){return b.shadowVisible},function(a){var e=new ChangePageSetup(c);e.ignoreColor=!0;e.ignoreImage= @@ -2879,19 +2879,19 @@ Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperti {},e=a.vertices,d=a.edges,k=0;k<e.length;k++)this.findCommonProperties(e[k],b,0==k);for(k=0;k<d.length;k++)this.findCommonProperties(d[k],b,0==e.length&&0==k);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(b).length&&this.container.appendChild(this.addProperties(this.createPanel(),b,a))}};var e=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var c=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()})); c.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";c.style.marginRight="2px";a.appendChild(c);c=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("pasteStyle").funct()}));c.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";a.appendChild(c); mxUtils.br(a);return e.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,c,b){function e(a,c,b,e){q.getModel().beginUpdate();try{var d=[],k=[];if(null!=b.index){for(var g=[],f=b.parentRow.nextSibling;f&&f.getAttribute("data-pName")==a;)g.push(f.getAttribute("data-pValue")),f=f.nextSibling;b.index<g.length?null!=e?g.splice(e,1):g[b.index]=c:g.push(c);null!=b.size&&g.length>b.size&&(g=g.slice(0,b.size));c=g.join(",");null!=b.countProperty&& -(q.setCellStyles(b.countProperty,g.length,q.getSelectionCells()),d.push(b.countProperty),k.push(g.length))}q.setCellStyles(a,c,q.getSelectionCells());d.push(a);k.push(c);if(null!=b.dependentProps)for(a=0;a<b.dependentProps.length;a++){var n=b.dependentPropsDefVal[a],t=b.dependentPropsVals[a];if(t.length>c)t=t.slice(0,c);else for(var z=t.length;z<c;z++)t.push(n);t=t.join(",");q.setCellStyles(b.dependentProps[a],t,q.getSelectionCells());d.push(b.dependentProps[a]);k.push(t)}if("function"==typeof b.onChange)b.onChange(q, -c);u.editorUi.fireEvent(new mxEventObject("styleChanged","keys",d,"values",k,"cells",q.getSelectionCells()))}finally{q.getModel().endUpdate()}}function d(c,b,e){var d=mxUtils.getOffset(a,!0),k=mxUtils.getOffset(c,!0);b.style.position="absolute";b.style.left=k.x-d.x+"px";b.style.top=k.y-d.y+"px";b.style.width=c.offsetWidth+"px";b.style.height=c.offsetHeight-(e?4:0)+"px";b.style.zIndex=5}function k(a,c,b){var d=document.createElement("div");d.style.width="32px";d.style.height="4px";d.style.margin="2px"; -d.style.border="1px solid black";d.style.background=c&&"none"!=c?c:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(u,function(k){this.editorUi.pickColor(c,function(c){d.style.background="none"==c?"url('"+Dialog.prototype.noColorImage+"')":c;e(a,c,b)});mxEvent.consume(k)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(d);return btn}function g(a,c,b,d,k,g,f){null!=c&&(c=c.split(","),z.push({name:a,values:c,type:b,defVal:d,countProperty:k, -parentRow:g,isDeletable:!0,flipBkg:f}));btn=mxUtils.button("+",mxUtils.bind(u,function(c){for(var n=g,u=0;null!=n.nextSibling;)if(n.nextSibling.getAttribute("data-pName")==a)n=n.nextSibling,u++;else break;var q={type:b,parentRow:g,index:u,isDeletable:!0,defVal:d,countProperty:k},u=t(a,"",q,0==u%2,f);e(a,d,q);n.parentNode.insertBefore(u,n.nextSibling);mxEvent.consume(c)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function f(a,c,b,e,d,k,g){if(0<d){var f=Array(d); -c=null!=c?c.split(","):[];for(var n=0;n<d;n++)f[n]=null!=c[n]?c[n]:null!=e?e:"";z.push({name:a,values:f,type:b,defVal:e,parentRow:k,flipBkg:g,size:d})}return document.createElement("div")}function n(a,c,b){var d=document.createElement("input");d.type="checkbox";d.checked="1"==c;mxEvent.addListener(d,"change",function(){e(a,d.checked?"1":"0",b)});return d}function t(c,b,t,q,z){var l=t.dispName,x=t.type,A=document.createElement("tr");A.className="gePropRow"+(z?"Dark":"")+(q?"Alt":"")+" gePropNonHeaderRow"; -A.setAttribute("data-pName",c);A.setAttribute("data-pValue",b);q=!1;null!=t.index&&(A.setAttribute("data-index",t.index),l=(null!=l?l:"")+"["+t.index+"]",q=!0);var C=document.createElement("td");C.className="gePropRowCell";C.innerHTML=mxUtils.htmlEntities(mxResources.get(l,null,l));q&&(C.style.textAlign="right");A.appendChild(C);C=document.createElement("td");C.className="gePropRowCell";if("color"==x)C.appendChild(k(c,b,t));else if("bool"==x||"boolean"==x)C.appendChild(n(c,b,t));else if("enum"==x){var D= -t.enumList;for(z=0;z<D.length;z++)if(l=D[z],l.val==b){C.innerHTML=mxUtils.htmlEntities(mxResources.get(l.dispName,null,l.dispName));break}mxEvent.addListener(C,"click",mxUtils.bind(u,function(){var k=document.createElement("select");d(C,k);for(var g=0;g<D.length;g++){var f=D[g],n=document.createElement("option");n.value=mxUtils.htmlEntities(f.val);n.innerHTML=mxUtils.htmlEntities(mxResources.get(f.dispName,null,f.dispName));k.appendChild(n)}k.value=b;a.appendChild(k);mxEvent.addListener(k,"change", -function(){var a=mxUtils.htmlEntities(k.value);e(c,a,t)});k.focus();mxEvent.addListener(k,"blur",function(){a.removeChild(k)})}))}else"dynamicArr"==x?C.appendChild(g(c,b,t.subType,t.subDefVal,t.countProperty,A,z)):"staticArr"==x?C.appendChild(f(c,b,t.subType,t.subDefVal,t.size,A,z)):(C.innerHTML=b,mxEvent.addListener(C,"click",mxUtils.bind(u,function(){function k(){var a=g.value,a=0==a.length&&"string"!=x?0:a;t.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",x="string"):(a=parseFloat(a),a=isNaN(a)? -0:a));null!=t.min&&a<t.min?a=t.min:null!=t.max&&a>t.max&&(a=t.max);a=mxUtils.htmlEntities(("int"==x?parseInt(a):a)+"");e(c,a,t)}var g=document.createElement("input");d(C,g,!0);g.value=b;g.className="gePropEditor";"int"!=x&&"float"!=x||t.allowAuto||(g.type="number",g.step="int"==x?"1":"any",null!=t.min&&(g.min=parseFloat(t.min)),null!=t.max&&(g.max=parseFloat(t.max)));a.appendChild(g);mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&k()});g.focus();mxEvent.addListener(g,"blur",function(){k()})}))); -t.isDeletable&&(z=mxUtils.button("-",mxUtils.bind(u,function(a){e(c,"",t,t.index);mxEvent.consume(a)})),z.style.height="16px",z.style.width="25px",z.style["float"]="right",z.className="geColorBtn",C.appendChild(z));A.appendChild(C);return A}var u=this,q=this.editorUi.editor.graph,z=[];a.style.position="relative";a.style.padding="0";var l=document.createElement("table");l.style.whiteSpace="nowrap";l.style.width="100%";var x=document.createElement("tr");x.className="gePropHeader";var A=document.createElement("th"); -A.className="gePropHeaderCell";var C=document.createElement("img");C.src=Sidebar.prototype.expandedImage;A.appendChild(C);mxUtils.write(A,mxResources.get("property"));x.style.cursor="pointer";var m=function(){var c=l.querySelectorAll(".gePropNonHeaderRow"),b;if(u.editorUi.propertiesCollapsed){C.src=Sidebar.prototype.collapsedImage;b="none";for(var e=a.childNodes.length-1;0<=e;e--)try{var d=a.childNodes[e],k=d.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(d)}catch(J){}}else C.src=Sidebar.prototype.expandedImage, -b="";for(e=0;e<c.length;e++)c[e].style.display=b};mxEvent.addListener(x,"click",function(){u.editorUi.propertiesCollapsed=!u.editorUi.propertiesCollapsed;m()});x.appendChild(A);A=document.createElement("th");A.className="gePropHeaderCell";A.innerHTML=mxResources.get("value");x.appendChild(A);l.appendChild(x);var E=!1,F=!1,p;for(p in c)if(x=c[p],"function"!=typeof x.isVisible||x.isVisible(b,this)){var v=null!=b.style[p]?mxUtils.htmlEntities(b.style[p]+""):x.defVal;if("separator"==x.type)F=!F;else{if("staticArr"== -x.type)x.size=parseInt(b.style[x.sizeProperty]||c[x.sizeProperty].defVal)||0;else if(null!=x.dependentProps){for(var K=x.dependentProps,y=[],B=[],A=0;A<K.length;A++){var I=b.style[K[A]];B.push(c[K[A]].subDefVal);y.push(null!=I?I.split(","):[])}x.dependentPropsDefVal=B;x.dependentPropsVals=y}l.appendChild(t(p,v,x,E,F));E=!E}}for(A=0;A<z.length;A++)for(x=z[A],c=x.parentRow,b=0;b<x.values.length;b++)p=t(x.name,x.values[b],{type:x.type,parentRow:x.parentRow,isDeletable:x.isDeletable,index:b,defVal:x.defVal, +(q.setCellStyles(b.countProperty,g.length,q.getSelectionCells()),d.push(b.countProperty),k.push(g.length))}q.setCellStyles(a,c,q.getSelectionCells());d.push(a);k.push(c);if(null!=b.dependentProps)for(a=0;a<b.dependentProps.length;a++){var n=b.dependentPropsDefVal[a],u=b.dependentPropsVals[a];if(u.length>c)u=u.slice(0,c);else for(var z=u.length;z<c;z++)u.push(n);u=u.join(",");q.setCellStyles(b.dependentProps[a],u,q.getSelectionCells());d.push(b.dependentProps[a]);k.push(u)}if("function"==typeof b.onChange)b.onChange(q, +c);t.editorUi.fireEvent(new mxEventObject("styleChanged","keys",d,"values",k,"cells",q.getSelectionCells()))}finally{q.getModel().endUpdate()}}function d(c,b,e){var d=mxUtils.getOffset(a,!0),k=mxUtils.getOffset(c,!0);b.style.position="absolute";b.style.left=k.x-d.x+"px";b.style.top=k.y-d.y+"px";b.style.width=c.offsetWidth+"px";b.style.height=c.offsetHeight-(e?4:0)+"px";b.style.zIndex=5}function k(a,c,b){var d=document.createElement("div");d.style.width="32px";d.style.height="4px";d.style.margin="2px"; +d.style.border="1px solid black";d.style.background=c&&"none"!=c?c:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(t,function(k){this.editorUi.pickColor(c,function(c){d.style.background="none"==c?"url('"+Dialog.prototype.noColorImage+"')":c;e(a,c,b)});mxEvent.consume(k)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(d);return btn}function g(a,c,b,d,k,g,f){null!=c&&(c=c.split(","),z.push({name:a,values:c,type:b,defVal:d,countProperty:k, +parentRow:g,isDeletable:!0,flipBkg:f}));btn=mxUtils.button("+",mxUtils.bind(t,function(c){for(var n=g,t=0;null!=n.nextSibling;)if(n.nextSibling.getAttribute("data-pName")==a)n=n.nextSibling,t++;else break;var q={type:b,parentRow:g,index:t,isDeletable:!0,defVal:d,countProperty:k},t=u(a,"",q,0==t%2,f);e(a,d,q);n.parentNode.insertBefore(t,n.nextSibling);mxEvent.consume(c)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function f(a,c,b,e,d,k,g){if(0<d){var f=Array(d); +c=null!=c?c.split(","):[];for(var n=0;n<d;n++)f[n]=null!=c[n]?c[n]:null!=e?e:"";z.push({name:a,values:f,type:b,defVal:e,parentRow:k,flipBkg:g,size:d})}return document.createElement("div")}function n(a,c,b){var d=document.createElement("input");d.type="checkbox";d.checked="1"==c;mxEvent.addListener(d,"change",function(){e(a,d.checked?"1":"0",b)});return d}function u(c,b,u,q,z){var l=u.dispName,x=u.type,A=document.createElement("tr");A.className="gePropRow"+(z?"Dark":"")+(q?"Alt":"")+" gePropNonHeaderRow"; +A.setAttribute("data-pName",c);A.setAttribute("data-pValue",b);q=!1;null!=u.index&&(A.setAttribute("data-index",u.index),l=(null!=l?l:"")+"["+u.index+"]",q=!0);var C=document.createElement("td");C.className="gePropRowCell";C.innerHTML=mxUtils.htmlEntities(mxResources.get(l,null,l));q&&(C.style.textAlign="right");A.appendChild(C);C=document.createElement("td");C.className="gePropRowCell";if("color"==x)C.appendChild(k(c,b,u));else if("bool"==x||"boolean"==x)C.appendChild(n(c,b,u));else if("enum"==x){var D= +u.enumList;for(z=0;z<D.length;z++)if(l=D[z],l.val==b){C.innerHTML=mxUtils.htmlEntities(mxResources.get(l.dispName,null,l.dispName));break}mxEvent.addListener(C,"click",mxUtils.bind(t,function(){var k=document.createElement("select");d(C,k);for(var g=0;g<D.length;g++){var f=D[g],n=document.createElement("option");n.value=mxUtils.htmlEntities(f.val);n.innerHTML=mxUtils.htmlEntities(mxResources.get(f.dispName,null,f.dispName));k.appendChild(n)}k.value=b;a.appendChild(k);mxEvent.addListener(k,"change", +function(){var a=mxUtils.htmlEntities(k.value);e(c,a,u)});k.focus();mxEvent.addListener(k,"blur",function(){a.removeChild(k)})}))}else"dynamicArr"==x?C.appendChild(g(c,b,u.subType,u.subDefVal,u.countProperty,A,z)):"staticArr"==x?C.appendChild(f(c,b,u.subType,u.subDefVal,u.size,A,z)):(C.innerHTML=b,mxEvent.addListener(C,"click",mxUtils.bind(t,function(){function k(){var a=g.value,a=0==a.length&&"string"!=x?0:a;u.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",x="string"):(a=parseFloat(a),a=isNaN(a)? +0:a));null!=u.min&&a<u.min?a=u.min:null!=u.max&&a>u.max&&(a=u.max);a=mxUtils.htmlEntities(("int"==x?parseInt(a):a)+"");e(c,a,u)}var g=document.createElement("input");d(C,g,!0);g.value=b;g.className="gePropEditor";"int"!=x&&"float"!=x||u.allowAuto||(g.type="number",g.step="int"==x?"1":"any",null!=u.min&&(g.min=parseFloat(u.min)),null!=u.max&&(g.max=parseFloat(u.max)));a.appendChild(g);mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&k()});g.focus();mxEvent.addListener(g,"blur",function(){k()})}))); +u.isDeletable&&(z=mxUtils.button("-",mxUtils.bind(t,function(a){e(c,"",u,u.index);mxEvent.consume(a)})),z.style.height="16px",z.style.width="25px",z.style["float"]="right",z.className="geColorBtn",C.appendChild(z));A.appendChild(C);return A}var t=this,q=this.editorUi.editor.graph,z=[];a.style.position="relative";a.style.padding="0";var l=document.createElement("table");l.style.whiteSpace="nowrap";l.style.width="100%";var x=document.createElement("tr");x.className="gePropHeader";var A=document.createElement("th"); +A.className="gePropHeaderCell";var C=document.createElement("img");C.src=Sidebar.prototype.expandedImage;A.appendChild(C);mxUtils.write(A,mxResources.get("property"));x.style.cursor="pointer";var m=function(){var c=l.querySelectorAll(".gePropNonHeaderRow"),b;if(t.editorUi.propertiesCollapsed){C.src=Sidebar.prototype.collapsedImage;b="none";for(var e=a.childNodes.length-1;0<=e;e--)try{var d=a.childNodes[e],k=d.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(d)}catch(J){}}else C.src=Sidebar.prototype.expandedImage, +b="";for(e=0;e<c.length;e++)c[e].style.display=b};mxEvent.addListener(x,"click",function(){t.editorUi.propertiesCollapsed=!t.editorUi.propertiesCollapsed;m()});x.appendChild(A);A=document.createElement("th");A.className="gePropHeaderCell";A.innerHTML=mxResources.get("value");x.appendChild(A);l.appendChild(x);var E=!1,F=!1,p;for(p in c)if(x=c[p],"function"!=typeof x.isVisible||x.isVisible(b,this)){var v=null!=b.style[p]?mxUtils.htmlEntities(b.style[p]+""):x.defVal;if("separator"==x.type)F=!F;else{if("staticArr"== +x.type)x.size=parseInt(b.style[x.sizeProperty]||c[x.sizeProperty].defVal)||0;else if(null!=x.dependentProps){for(var K=x.dependentProps,y=[],B=[],A=0;A<K.length;A++){var I=b.style[K[A]];B.push(c[K[A]].subDefVal);y.push(null!=I?I.split(","):[])}x.dependentPropsDefVal=B;x.dependentPropsVals=y}l.appendChild(u(p,v,x,E,F));E=!E}}for(A=0;A<z.length;A++)for(x=z[A],c=x.parentRow,b=0;b<x.values.length;b++)p=u(x.name,x.values[b],{type:x.type,parentRow:x.parentRow,isDeletable:x.isDeletable,index:b,defVal:x.defVal, countProperty:x.countProperty,size:x.size},0==b%2,x.flipBkg),c.parentNode.insertBefore(p,c.nextSibling),c=p;a.appendChild(l);m();return a};StyleFormatPanel.prototype.addStyles=function(a){function c(a){function c(a){var c=mxUtils.button("",function(c){e.getModel().beginUpdate();try{var b=e.getSelectionCells();for(c=0;c<b.length;c++){for(var d=e.getModel().getStyle(b[c]),g=0;g<k.length;g++)d=mxUtils.removeStylename(d,k[g]);var f=e.getModel().isVertex(b[c])?e.defaultVertexStyle:e.defaultEdgeStyle;null!= a?(d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(f,mxConstants.STYLE_GRADIENTCOLOR,null)),d=""==a.fill?mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(f,mxConstants.STYLE_FILLCOLOR,null)),d=""==a.stroke?mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(f,mxConstants.STYLE_STROKECOLOR,null)),e.getModel().isVertex(b[c])&& (d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(f,mxConstants.STYLE_FONTCOLOR,null)))):(d=mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(f,mxConstants.STYLE_FILLCOLOR,"#ffffff")),d=mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(f,mxConstants.STYLE_STROKECOLOR,"#000000")),d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(f,mxConstants.STYLE_GRADIENTCOLOR,null)),e.getModel().isVertex(b[c])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR, @@ -2910,7 +2910,7 @@ a.button,c.relatedTarget=a.relatedTarget}catch(Q){}}k.apply(this,arguments);wind this.layoutManager.getLayout=function(a){var c=this.graph.getCellStyle(a);if(null!=c){if("rack"==c.childLayout){var b=new mxStackLayout(this.graph,!1);b.gridSize=null!=c.rackUnitSize?parseFloat(c.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;b.fill=!0;b.marginLeft=c.marginLeft||0;b.marginRight=c.marginRight||0;b.marginTop=c.marginTop||0;b.marginBottom=c.marginBottom||0;b.allowGaps=c.allowGaps||0;b.resizeParent=!1;return b}if("undefined"!==typeof mxTableLayout&&"tableLayout"== c.childLayout)return b=new mxTableLayout(this.graph),b.rows=c.tableRows||2,b.columns=c.tableColumns||2,b.colPercentages=c.colPercentages,b.rowPercentages=c.rowPercentages,b.equalColumns="1"==mxUtils.getValue(c,"equalColumns",b.colPercentages?"0":"1"),b.equalRows="1"==mxUtils.getValue(c,"equalRows",b.rowPercentages?"0":"1"),b.resizeParent="1"==mxUtils.getValue(c,"resizeParent","1"),b.border=c.tableBorder||b.border,b.marginLeft=c.marginLeft||0,b.marginRight=c.marginRight||0,b.marginTop=c.marginTop|| 0,b.marginBottom=c.marginBottom||0,b.autoAddCol="1"==mxUtils.getValue(c,"autoAddCol","0"),b.autoAddRow="1"==mxUtils.getValue(c,"autoAddRow",b.autoAddCol?"0":"1"),b.colWidths=c.colWidths||"100",b.rowHeights=c.rowHeights||"50",b}return e.apply(this,arguments)};this.updateGlobalUrlVariables()};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var a=JSON.parse(decodeURIComponent(urlParams.vars)); -if(null!=a)for(var c in a)this.globalVars[c]=a[c]}catch(K){null!=window.console&&console.log("Error in vars URL parameter: "+K)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var t=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var c=t.apply(this,arguments);null==c&&null!=this.globalVars&&(c=this.globalVars[a]);return c};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a= +if(null!=a)for(var c in a)this.globalVars[c]=a[c]}catch(K){null!=window.console&&console.log("Error in vars URL parameter: "+K)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var u=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var c=u.apply(this,arguments);null==c&&null!=this.globalVars&&(c=this.globalVars[a]);return c};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a= this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(a.ownerDocument)).decode(a)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var n=Graph.prototype.getSvg;Graph.prototype.getSvg=function(){var a=null;null!=this.themes&&"darkTheme"==this.defaultThemeName&&(a=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var c=n.apply(this,arguments);null!=a&&(this.stylesheet=a,this.refresh());return c};var g=Graph.prototype.isCssTransformsSupported; Graph.prototype.isCssTransformsSupported=function(){return g.apply(this,arguments)&&!mxClient.IS_SF};var z=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){z.apply(this,arguments);if(mxClient.IS_GC&&null!=this.getDrawPane()){var a=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;",a.ownerSVGElement.parentNode.insertBefore(this.webKitForceRepaintNode,a.ownerSVGElement))}}; @@ -2920,7 +2920,7 @@ b.highlight.duration,b.highlight.opacity));null!=b.scroll&&(e=this.getCellsForAc null!=b&&"data:action/json,"==b.substring(0,17)&&(d[g].setAttribute("href",this.updateCustomLink(a,b)),k=!0);k&&this.labelChanged(c,e.innerHTML)}};Graph.prototype.updateCustomLink=function(a,c){if("data:action/json,"==c.substring(0,17))try{var b=JSON.parse(c.substring(17));null!=b.actions&&(this.updateCustomLinkActions(a,b.actions),c="data:action/json,"+JSON.stringify(b))}catch(Y){}return c};Graph.prototype.updateCustomLinkActions=function(a,c){for(var b=0;b<c.length;b++){var e=c[b];this.updateCustomLinkAction(a, e.toggle);this.updateCustomLinkAction(a,e.show);this.updateCustomLinkAction(a,e.hide);this.updateCustomLinkAction(a,e.select);this.updateCustomLinkAction(a,e.highlight);this.updateCustomLinkAction(a,e.scroll)}};Graph.prototype.updateCustomLinkAction=function(a,c){if(null!=c&&null!=c.cells){for(var b=[],e=0;e<c.cells.length;e++)if("*"==c.cells[e])b.push(c.cells[e]);else{var d=a[c.cells[e]];null!=d?""!=d&&b.push(d):b.push(c.cells[e])}c.cells=b}};Graph.prototype.getCellsForAction=function(a,c){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags, null,null,c))};Graph.prototype.getCellsById=function(a){var c=[];if(null!=a)for(var b=0;b<a.length;b++)if("*"==a[b])var e=this.getDefaultParent(),c=c.concat(this.model.filterDescendants(function(a){return a!=e},e));else{var d=this.model.getCell(a[b]);null!=d&&c.push(d)}return c};Graph.prototype.getCellsForTags=function(a,c,b,e){var d=[];if(null!=a){c=null!=c?c:this.model.getDescendants(this.model.getRoot());b=null!=b?b:"tags";for(var k=0,g={},f=0;f<a.length;f++)0<a[f].length&&(g[a[f].toLowerCase()]= -!0,k++);for(f=0;f<c.length;f++)if(e&&this.model.getParent(c[f])==this.model.root||this.model.isVertex(c[f])||this.model.isEdge(c[f])){var n=null!=c[f].value&&"object"==typeof c[f].value?mxUtils.trim(c[f].value.getAttribute(b)||""):"",t=!1;if(0<n.length){if(n=n.toLowerCase().split(" "),n.length>=a.length){for(var q=t=0;q<n.length&&t<k;q++)null!=g[n[q]]&&t++;t=t==k}}else t=0==a.length;t&&d.push(c[f])}}return d};Graph.prototype.toggleCells=function(a){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c], +!0,k++);for(f=0;f<c.length;f++)if(e&&this.model.getParent(c[f])==this.model.root||this.model.isVertex(c[f])||this.model.isEdge(c[f])){var n=null!=c[f].value&&"object"==typeof c[f].value?mxUtils.trim(c[f].value.getAttribute(b)||""):"",u=!1;if(0<n.length){if(n=n.toLowerCase().split(" "),n.length>=a.length){for(var q=u=0;q<n.length&&u<k;q++)null!=g[n[q]]&&u++;u=u==k}}else u=0==a.length;u&&d.push(c[f])}}return d};Graph.prototype.toggleCells=function(a){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c], !this.model.isVisible(a[c]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(a,c){this.model.beginUpdate();try{for(var b=0;b<a.length;b++)this.model.setVisible(a[b],c)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(a,c,b,e){for(var d=0;d<a.length;d++)this.highlightCell(a[d],c,b,e)};Graph.prototype.highlightCell=function(a,c,b,e){c=null!=c?c:mxConstants.DEFAULT_VALID_COLOR;b=null!=b?b:1E3;a=this.view.getState(a);if(null!=a){var d=Math.max(5,mxUtils.getValue(a.style, mxConstants.STYLE_STROKEWIDTH,1)+4),k=new mxCellHighlight(this,c,d,!1);null!=e&&(k.opacity=e);k.highlight(a);window.setTimeout(function(){null!=k.shape&&(mxUtils.setPrefixedStyle(k.shape.node.style,"transition","all 1200ms ease-in-out"),k.shape.node.style.opacity=0);window.setTimeout(function(){k.destroy()},1200)},b)}};Graph.prototype.addSvgShadow=function(a,c,b){b=null!=b?b:!1;var e=a.ownerDocument,d=null!=e.createElementNS?e.createElementNS(mxConstants.NS_SVG,"filter"):e.createElement("filter"); d.setAttribute("id",this.shadowId);var k=null!=e.createElementNS?e.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):e.createElement("feGaussianBlur");k.setAttribute("in","SourceAlpha");k.setAttribute("stdDeviation",this.svgShadowBlur);k.setAttribute("result","blur");d.appendChild(k);k=null!=e.createElementNS?e.createElementNS(mxConstants.NS_SVG,"feOffset"):e.createElement("feOffset");k.setAttribute("in","blur");k.setAttribute("dx",this.svgShadowSize);k.setAttribute("dy",this.svgShadowSize);k.setAttribute("result", @@ -2936,28 +2936,28 @@ a)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this [SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"]; mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4= [SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"]; -mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var c=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var q=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,e,d,k,g,f,n,t){if(null!=b&&null==mxMarker.markers[b]){var z=this.getPackageForType(b);null!=z&&mxStencilRegistry.getStencil(z)}return q.apply(this,arguments)};PrintDialog.prototype.create= -function(a,c){function b(){x.value=Math.max(1,Math.min(f,Math.max(parseInt(x.value),parseInt(l.value))));l.value=Math.max(1,Math.min(f,Math.min(parseInt(x.value),parseInt(l.value))))}function e(c){function b(c,b,k){var g=c.useCssTransforms,f=c.currentTranslate,n=c.currentScale,t=c.view.translate,q=c.view.scale;c.useCssTransforms&&(c.useCssTransforms=!1,c.currentTranslate=new mxPoint(0,0),c.currentScale=1,c.view.translate=new mxPoint(0,0),c.view.scale=1);var z=c.getGraphBounds(),l=0,u=0,x=ha.get(), -A=1/c.pageScale,F=E.checked;if(F)var A=parseInt(N.value),p=parseInt(T.value),A=Math.min(x.height*p/(z.height/c.view.scale),x.width*A/(z.width/c.view.scale));else A=parseInt(m.value)/(100*c.pageScale),isNaN(A)&&(e=1/c.pageScale,m.value="100 %");x=mxRectangle.fromRectangle(x);x.width=Math.ceil(x.width*e);x.height=Math.ceil(x.height*e);A*=e;!F&&c.pageVisible?(z=c.getPageLayout(),l-=z.x*x.width,u-=z.y*x.height):F=!0;if(null==b){b=PrintDialog.createPrintPreview(c,A,x,0,l,u,F);b.pageSelector=!1;b.mathEnabled= +mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var c=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var q=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,e,d,k,g,f,n,u){if(null!=b&&null==mxMarker.markers[b]){var z=this.getPackageForType(b);null!=z&&mxStencilRegistry.getStencil(z)}return q.apply(this,arguments)};PrintDialog.prototype.create= +function(a,c){function b(){x.value=Math.max(1,Math.min(f,Math.max(parseInt(x.value),parseInt(l.value))));l.value=Math.max(1,Math.min(f,Math.min(parseInt(x.value),parseInt(l.value))))}function e(c){function b(c,b,k){var g=c.useCssTransforms,f=c.currentTranslate,n=c.currentScale,u=c.view.translate,q=c.view.scale;c.useCssTransforms&&(c.useCssTransforms=!1,c.currentTranslate=new mxPoint(0,0),c.currentScale=1,c.view.translate=new mxPoint(0,0),c.view.scale=1);var z=c.getGraphBounds(),l=0,t=0,x=ha.get(), +A=1/c.pageScale,F=E.checked;if(F)var A=parseInt(N.value),p=parseInt(T.value),A=Math.min(x.height*p/(z.height/c.view.scale),x.width*A/(z.width/c.view.scale));else A=parseInt(m.value)/(100*c.pageScale),isNaN(A)&&(e=1/c.pageScale,m.value="100 %");x=mxRectangle.fromRectangle(x);x.width=Math.ceil(x.width*e);x.height=Math.ceil(x.height*e);A*=e;!F&&c.pageVisible?(z=c.getPageLayout(),l-=z.x*x.width,t-=z.y*x.height):F=!0;if(null==b){b=PrintDialog.createPrintPreview(c,A,x,0,l,t,F);b.pageSelector=!1;b.mathEnabled= !1;l=a.getCurrentFile();null!=l&&(b.title=l.getTitle());var D=b.writeHead;b.writeHead=function(c){D.apply(this,arguments);null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var C=b.renderPage;b.renderPage=function(a,c,b,e,d,k){var g=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var f=C.apply(this,arguments);mxClient.NO_FO=g;this.graph.mathEnabled? -this.mathEnabled=this.mathEnabled||!0:f.className="geDisableMathJax";return f}}l=null;null!=d.themes&&"darkTheme"==d.defaultThemeName&&(l=d.stylesheet,d.stylesheet=d.getDefaultStylesheet(),d.refresh());b.open(null,null,k,!0);null!=l&&(d.stylesheet=l,d.refresh())}else{x=c.background;if(null==x||""==x||x==mxConstants.NONE)x="#ffffff";b.backgroundColor=x;b.autoOrigin=F;b.appendGraph(c,A,l,u,k,!0)}g&&(c.useCssTransforms=g,c.currentTranslate=f,c.currentScale=n,c.view.translate=t,c.view.scale=q);return b} -var e=parseInt(ia.value)/100;isNaN(e)&&(e=1,ia.value="100 %");var e=.75*e,k=l.value,g=x.value,f=!q.checked,t=null;f&&(f=k==n&&g==n);if(!f&&null!=a.pages&&a.pages.length){var z=0,f=a.pages.length-1;q.checked||(z=parseInt(k)-1,f=parseInt(g)-1);for(var u=z;u<=f;u++){var A=a.pages[u],k=A==a.currentPage?d:null;if(null==k){var k=a.createTemporaryGraph(d.getStylesheet()),g=!0,z=!1,F=null,p=null;null==A.viewState&&null==A.root&&a.updatePageRoot(A);null!=A.viewState&&(g=A.viewState.pageVisible,z=A.viewState.mathEnabled, -F=A.viewState.background,p=A.viewState.backgroundImage);k.background=F;k.backgroundImage=null!=p?new mxImage(p.src,p.width,p.height):null;k.pageVisible=g;k.mathEnabled=z;var D=k.getGlobalVariable;k.getGlobalVariable=function(c){return"page"==c?A.getName():"pagenumber"==c?u+1:"pagecount"==c?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(k.container);a.updatePageRoot(A);k.model.setRoot(A.root)}t=b(k,t,u!=f);k!=d&&k.container.parentNode.removeChild(k.container)}}else t= -b(d);null==t?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(t.mathEnabled&&(f=t.wnd.document,f.writeln('<script type="text/x-mathjax-config">'),f.writeln("MathJax.Hub.Config({"),f.writeln("showMathMenu: false,"),f.writeln('messageStyle: "none",'),f.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),f.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),f.writeln('"HTML-CSS": {'),f.writeln("imageFont: null"),f.writeln("},"),f.writeln("TeX: {"), +this.mathEnabled=this.mathEnabled||!0:f.className="geDisableMathJax";return f}}l=null;null!=d.themes&&"darkTheme"==d.defaultThemeName&&(l=d.stylesheet,d.stylesheet=d.getDefaultStylesheet(),d.refresh());b.open(null,null,k,!0);null!=l&&(d.stylesheet=l,d.refresh())}else{x=c.background;if(null==x||""==x||x==mxConstants.NONE)x="#ffffff";b.backgroundColor=x;b.autoOrigin=F;b.appendGraph(c,A,l,t,k,!0)}g&&(c.useCssTransforms=g,c.currentTranslate=f,c.currentScale=n,c.view.translate=u,c.view.scale=q);return b} +var e=parseInt(ia.value)/100;isNaN(e)&&(e=1,ia.value="100 %");var e=.75*e,k=l.value,g=x.value,f=!q.checked,u=null;f&&(f=k==n&&g==n);if(!f&&null!=a.pages&&a.pages.length){var z=0,f=a.pages.length-1;q.checked||(z=parseInt(k)-1,f=parseInt(g)-1);for(var t=z;t<=f;t++){var A=a.pages[t],k=A==a.currentPage?d:null;if(null==k){var k=a.createTemporaryGraph(d.getStylesheet()),g=!0,z=!1,p=null,F=null;null==A.viewState&&null==A.root&&a.updatePageRoot(A);null!=A.viewState&&(g=A.viewState.pageVisible,z=A.viewState.mathEnabled, +p=A.viewState.background,F=A.viewState.backgroundImage);k.background=p;k.backgroundImage=null!=F?new mxImage(F.src,F.width,F.height):null;k.pageVisible=g;k.mathEnabled=z;var D=k.getGlobalVariable;k.getGlobalVariable=function(c){return"page"==c?A.getName():"pagenumber"==c?t+1:"pagecount"==c?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(k.container);a.updatePageRoot(A);k.model.setRoot(A.root)}u=b(k,u,t!=f);k!=d&&k.container.parentNode.removeChild(k.container)}}else u= +b(d);null==u?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(u.mathEnabled&&(f=u.wnd.document,f.writeln('<script type="text/x-mathjax-config">'),f.writeln("MathJax.Hub.Config({"),f.writeln("showMathMenu: false,"),f.writeln('messageStyle: "none",'),f.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),f.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),f.writeln('"HTML-CSS": {'),f.writeln("imageFont: null"),f.writeln("},"),f.writeln("TeX: {"), f.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),f.writeln("},"),f.writeln("tex2jax: {"),f.writeln('\tignoreClass: "geDisableMathJax"'),f.writeln("},"),f.writeln("asciimath2jax: {"),f.writeln('\tignoreClass: "geDisableMathJax"'),f.writeln("}"),f.writeln("});"),c&&(f.writeln("MathJax.Hub.Queue(function () {"),f.writeln("window.print();"),f.writeln("});")),f.writeln("\x3c/script>"),f.writeln('<script type="text/javascript" src="'+DRAW_MATH_URL+'/MathJax.js">\x3c/script>')), -t.closeDocument(),!t.mathEnabled&&c&&PrintDialog.printPreview(t))}var d=a.editor.graph,k=document.createElement("div"),g=document.createElement("h3");g.style.width="100%";g.style.textAlign="center";g.style.marginTop="0px";mxUtils.write(g,c||mxResources.get("print"));k.appendChild(g);var f=1,n=1,t=document.createElement("div");t.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var q=document.createElement("input");q.style.cssText="margin-right:8px;margin-bottom:8px;"; -q.setAttribute("value","all");q.setAttribute("type","radio");q.setAttribute("name","pages-printdialog");t.appendChild(q);g=document.createElement("span");mxUtils.write(g,mxResources.get("printAllPages"));t.appendChild(g);mxUtils.br(t);var z=q.cloneNode(!0);q.setAttribute("checked","checked");z.setAttribute("value","range");t.appendChild(z);g=document.createElement("span");mxUtils.write(g,mxResources.get("pages")+":");t.appendChild(g);var l=document.createElement("input");l.style.cssText="margin:0 8px 0 8px;"; -l.setAttribute("value","1");l.setAttribute("type","number");l.setAttribute("min","1");l.style.width="50px";t.appendChild(l);g=document.createElement("span");mxUtils.write(g,mxResources.get("to"));t.appendChild(g);var x=l.cloneNode(!0);t.appendChild(x);mxEvent.addListener(l,"focus",function(){z.checked=!0});mxEvent.addListener(x,"focus",function(){z.checked=!0});mxEvent.addListener(l,"change",b);mxEvent.addListener(x,"change",b);if(null!=a.pages&&(f=a.pages.length,null!=a.currentPage))for(g=0;g<a.pages.length;g++)if(a.currentPage== -a.pages[g]){n=g+1;l.value=n;x.value=n;break}l.setAttribute("max",f);x.setAttribute("max",f);1<f&&k.appendChild(t);var u=document.createElement("div");u.style.marginBottom="10px";var A=document.createElement("input");A.style.marginRight="8px";A.setAttribute("value","adjust");A.setAttribute("type","radio");A.setAttribute("name","printZoom");u.appendChild(A);g=document.createElement("span");mxUtils.write(g,mxResources.get("adjustTo"));u.appendChild(g);var m=document.createElement("input");m.style.cssText= -"margin:0 8px 0 8px;";m.setAttribute("value","100 %");m.style.width="50px";u.appendChild(m);mxEvent.addListener(m,"focus",function(){A.checked=!0});k.appendChild(u);var t=t.cloneNode(!1),E=A.cloneNode(!0);E.setAttribute("value","fit");A.setAttribute("checked","checked");g=document.createElement("div");g.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";g.appendChild(E);t.appendChild(g);u=document.createElement("table");u.style.display="inline-block";var F=document.createElement("tbody"), -p=document.createElement("tr"),C=p.cloneNode(!0),v=document.createElement("td"),y=v.cloneNode(!0),B=v.cloneNode(!0),M=v.cloneNode(!0),I=v.cloneNode(!0),ea=v.cloneNode(!0);v.style.textAlign="right";M.style.textAlign="right";mxUtils.write(v,mxResources.get("fitTo"));var N=document.createElement("input");N.style.cssText="margin:0 8px 0 8px;";N.setAttribute("value","1");N.setAttribute("min","1");N.setAttribute("type","number");N.style.width="40px";y.appendChild(N);g=document.createElement("span");mxUtils.write(g, -mxResources.get("fitToSheetsAcross"));B.appendChild(g);mxUtils.write(M,mxResources.get("fitToBy"));var T=N.cloneNode(!0);I.appendChild(T);mxEvent.addListener(N,"focus",function(){E.checked=!0});mxEvent.addListener(T,"focus",function(){E.checked=!0});g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsDown"));ea.appendChild(g);p.appendChild(v);p.appendChild(y);p.appendChild(B);C.appendChild(M);C.appendChild(I);C.appendChild(ea);F.appendChild(p);F.appendChild(C);u.appendChild(F); -t.appendChild(u);k.appendChild(t);t=document.createElement("div");g=document.createElement("div");g.style.fontWeight="bold";g.style.marginBottom="12px";mxUtils.write(g,mxResources.get("paperSize"));t.appendChild(g);g=document.createElement("div");g.style.marginBottom="12px";var ha=PageSetupDialog.addPageFormatPanel(g,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);t.appendChild(g);g=document.createElement("span");mxUtils.write(g,mxResources.get("pageScale"));t.appendChild(g); -var ia=document.createElement("input");ia.style.cssText="margin:0 8px 0 8px;";ia.setAttribute("value","100 %");ia.style.width="60px";t.appendChild(ia);k.appendChild(t);g=document.createElement("div");g.style.cssText="text-align:right;margin:48px 0 0 0;";t=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});t.className="geBtn";a.editor.cancelFirst&&g.appendChild(t);a.isOffline()||(u=mxUtils.button(mxResources.get("help"),function(){d.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}), -u.className="geBtn",g.appendChild(u));PrintDialog.previewEnabled&&(u=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();e(!1)}),u.className="geBtn",g.appendChild(u));u=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();e(!0)});u.className="geBtn gePrimaryBtn";g.appendChild(u);a.editor.cancelFirst||g.appendChild(t);k.appendChild(g);this.container=k};var F=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null== +u.closeDocument(),!u.mathEnabled&&c&&PrintDialog.printPreview(u))}var d=a.editor.graph,k=document.createElement("div"),g=document.createElement("h3");g.style.width="100%";g.style.textAlign="center";g.style.marginTop="0px";mxUtils.write(g,c||mxResources.get("print"));k.appendChild(g);var f=1,n=1,u=document.createElement("div");u.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var q=document.createElement("input");q.style.cssText="margin-right:8px;margin-bottom:8px;"; +q.setAttribute("value","all");q.setAttribute("type","radio");q.setAttribute("name","pages-printdialog");u.appendChild(q);g=document.createElement("span");mxUtils.write(g,mxResources.get("printAllPages"));u.appendChild(g);mxUtils.br(u);var z=q.cloneNode(!0);q.setAttribute("checked","checked");z.setAttribute("value","range");u.appendChild(z);g=document.createElement("span");mxUtils.write(g,mxResources.get("pages")+":");u.appendChild(g);var l=document.createElement("input");l.style.cssText="margin:0 8px 0 8px;"; +l.setAttribute("value","1");l.setAttribute("type","number");l.setAttribute("min","1");l.style.width="50px";u.appendChild(l);g=document.createElement("span");mxUtils.write(g,mxResources.get("to"));u.appendChild(g);var x=l.cloneNode(!0);u.appendChild(x);mxEvent.addListener(l,"focus",function(){z.checked=!0});mxEvent.addListener(x,"focus",function(){z.checked=!0});mxEvent.addListener(l,"change",b);mxEvent.addListener(x,"change",b);if(null!=a.pages&&(f=a.pages.length,null!=a.currentPage))for(g=0;g<a.pages.length;g++)if(a.currentPage== +a.pages[g]){n=g+1;l.value=n;x.value=n;break}l.setAttribute("max",f);x.setAttribute("max",f);1<f&&k.appendChild(u);var t=document.createElement("div");t.style.marginBottom="10px";var A=document.createElement("input");A.style.marginRight="8px";A.setAttribute("value","adjust");A.setAttribute("type","radio");A.setAttribute("name","printZoom");t.appendChild(A);g=document.createElement("span");mxUtils.write(g,mxResources.get("adjustTo"));t.appendChild(g);var m=document.createElement("input");m.style.cssText= +"margin:0 8px 0 8px;";m.setAttribute("value","100 %");m.style.width="50px";t.appendChild(m);mxEvent.addListener(m,"focus",function(){A.checked=!0});k.appendChild(t);var u=u.cloneNode(!1),E=A.cloneNode(!0);E.setAttribute("value","fit");A.setAttribute("checked","checked");g=document.createElement("div");g.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";g.appendChild(E);u.appendChild(g);t=document.createElement("table");t.style.display="inline-block";var p=document.createElement("tbody"), +F=document.createElement("tr"),C=F.cloneNode(!0),v=document.createElement("td"),y=v.cloneNode(!0),B=v.cloneNode(!0),M=v.cloneNode(!0),I=v.cloneNode(!0),ea=v.cloneNode(!0);v.style.textAlign="right";M.style.textAlign="right";mxUtils.write(v,mxResources.get("fitTo"));var N=document.createElement("input");N.style.cssText="margin:0 8px 0 8px;";N.setAttribute("value","1");N.setAttribute("min","1");N.setAttribute("type","number");N.style.width="40px";y.appendChild(N);g=document.createElement("span");mxUtils.write(g, +mxResources.get("fitToSheetsAcross"));B.appendChild(g);mxUtils.write(M,mxResources.get("fitToBy"));var T=N.cloneNode(!0);I.appendChild(T);mxEvent.addListener(N,"focus",function(){E.checked=!0});mxEvent.addListener(T,"focus",function(){E.checked=!0});g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsDown"));ea.appendChild(g);F.appendChild(v);F.appendChild(y);F.appendChild(B);C.appendChild(M);C.appendChild(I);C.appendChild(ea);p.appendChild(F);p.appendChild(C);t.appendChild(p); +u.appendChild(t);k.appendChild(u);u=document.createElement("div");g=document.createElement("div");g.style.fontWeight="bold";g.style.marginBottom="12px";mxUtils.write(g,mxResources.get("paperSize"));u.appendChild(g);g=document.createElement("div");g.style.marginBottom="12px";var ha=PageSetupDialog.addPageFormatPanel(g,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);u.appendChild(g);g=document.createElement("span");mxUtils.write(g,mxResources.get("pageScale"));u.appendChild(g); +var ia=document.createElement("input");ia.style.cssText="margin:0 8px 0 8px;";ia.setAttribute("value","100 %");ia.style.width="60px";u.appendChild(ia);k.appendChild(u);g=document.createElement("div");g.style.cssText="text-align:right;margin:48px 0 0 0;";u=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});u.className="geBtn";a.editor.cancelFirst&&g.appendChild(u);a.isOffline()||(t=mxUtils.button(mxResources.get("help"),function(){d.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}), +t.className="geBtn",g.appendChild(t));PrintDialog.previewEnabled&&(t=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();e(!1)}),t.className="geBtn",g.appendChild(t));t=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();e(!0)});t.className="geBtn gePrimaryBtn";g.appendChild(t);a.editor.cancelFirst||g.appendChild(u);k.appendChild(g);this.container=k};var F=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null== this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(F.apply(this,arguments),null!=this.mathEnabled&& this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))};Editor.prototype.useCanvasForExport=!1;try{var x=document.createElement("canvas"),E=new Image;E.onload=function(){try{x.getContext("2d").drawImage(E,0,0);var a=x.toDataURL("image/png");Editor.prototype.useCanvasForExport= -null!=a&&6<a.length}catch(C){}};E.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(u){}})(); +null!=a&&6<a.length}catch(C){}};E.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(t){}})(); (function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,f,d){d.ui=a.ui;return f};a.afterDecode=function(a,f,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="@DRAWIO-VERSION@";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&/.*\.draw\.io$/.test(window.location.hostname)&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost="https://www.draw.io";EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars="\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t"; EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":"https://rt.draw.io/cache";Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.logError=function(a,b,d,f,n){if("1"==urlParams.dev)EditorUi.debug("logError",a,b, d,f,n);else if(EditorUi.enableLogging)try{if(a!=EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage=a;var c=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",e=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";n=null!=n?n:Error(a);(new Image).src=e+"/log?severity="+c+"&v="+encodeURIComponent(EditorUi.VERSION)+ @@ -2973,13 +2973,13 @@ b()};EditorUi.prototype.setMathEnabled=function(a){this.editor.graph.mathEnabled !navigator.onLine||!a&&"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,d){d=null!=d?d:24;var c=new Spinner({lines:12,length:d,width:Math.round(d/3),radius:Math.round(d/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),e=c.spin;c.spin=function(d,k){var g=!1;this.active||(e.call(this,d),this.active=!0,null!=k&&(g=document.createElement("div"),g.style.position="absolute",g.style.whiteSpace="nowrap",g.style.background="#4B4243", g.style.color="white",g.style.fontFamily="Helvetica, Arial",g.style.fontSize="9pt",g.style.padding="6px",g.style.paddingLeft="10px",g.style.paddingRight="10px",g.style.zIndex=2E9,g.style.left=Math.max(0,a)+"px",g.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(g.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(g.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(g.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=k.substring(k.length-3,k.length)&&"!"!= k.charAt(k.length-1)&&(k+="..."),g.innerHTML=k,d.appendChild(g),c.status=g,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(g.style.left=Math.round(Math.max(0,a-g.offsetWidth/2))+"px",g.style.top=Math.round(Math.max(0,b+70-g.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,k)}));this.stop();return a}),g=!0);return g};var k=c.stop;c.stop=function(){k.call(this);this.active=!1;null!= -c.status&&(c.status.parentNode.removeChild(c.status),c.status=null)};c.pause=function(){return function(){}};return c};EditorUi.prototype.isCompatibleString=function(a){try{var c=mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(t){}return!1};EditorUi.prototype.isVisioData=function(a){return 8<a.length&&208==a.charCodeAt(0)&&207==a.charCodeAt(1)&&17==a.charCodeAt(2)&&224==a.charCodeAt(3)&&161==a.charCodeAt(4)&& +c.status&&(c.status.parentNode.removeChild(c.status),c.status=null)};c.pause=function(){return function(){}};return c};EditorUi.prototype.isCompatibleString=function(a){try{var c=mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(u){}return!1};EditorUi.prototype.isVisioData=function(a){return 8<a.length&&208==a.charCodeAt(0)&&207==a.charCodeAt(1)&&17==a.charCodeAt(2)&&224==a.charCodeAt(3)&&161==a.charCodeAt(4)&& 177==a.charCodeAt(5)&&26==a.charCodeAt(6)&&225==a.charCodeAt(7)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&4==a.charCodeAt(3)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&6==a.charCodeAt(3)};EditorUi.prototype.isPngData=function(a){return 8<a.length&&137==a.charCodeAt(0)&&80==a.charCodeAt(1)&&78==a.charCodeAt(2)&&71==a.charCodeAt(3)&&13==a.charCodeAt(4)&&10==a.charCodeAt(5)&&26==a.charCodeAt(6)&&10==a.charCodeAt(7)};var a=EditorUi.prototype.extractGraphModelFromHtml; EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("<mxfile ");if(0<=d){var f=c.lastIndexOf("</mxfile>");f>d&&(b=c.substring(d,f+15).replace(/>/g,">").replace(/</g,"<").replace(/\\"/g,'"').replace(/\n/g,""))}else var n=mxUtils.parseXml(c),g=this.editor.extractGraphModel(n.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!=g?mxUtils.getXml(g):""}catch(z){}return b};EditorUi.prototype.validateFileData= function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length));a=Graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram"); if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var f=d.length-1;0<=f;f--){var g=this.updatePageRoot(new DiagramPage(d[f]));null==g.getName()&&g.setName(mxResources.get("pageWithNumber",[f+1]));c.model.execute(new ChangePage(this,g,0==f?g:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")), this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(f=0;f<b.length;f++)c.model.execute(new ChangePage(this,b[f],null))}finally{c.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,d,f,n,g,l,A,q,m,x){b=null!=b?b:this.editor.graph;n=null!=n?n:!1;q=null!=q?q:!0;var c,e=null;null== -d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":e=c=f;if(null==a)return"";var k=a;if("mxfile"!=k.nodeName.toLowerCase()){if(x){var t=a.ownerDocument.createElement("diagram");t.setAttribute("id",Editor.guid());t.appendChild(a)}else{t=Graph.zapGremlins(mxUtils.getXml(a));k=Graph.compress(t);if(Graph.decompress(k)!=t)return t;t=a.ownerDocument.createElement("diagram");t.setAttribute("id",Editor.guid());mxUtils.setTextContent(t,k)}k=a.ownerDocument.createElement("mxfile");k.appendChild(t)}m? +d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":e=c=f;if(null==a)return"";var k=a;if("mxfile"!=k.nodeName.toLowerCase()){if(x){var u=a.ownerDocument.createElement("diagram");u.setAttribute("id",Editor.guid());u.appendChild(a)}else{u=Graph.zapGremlins(mxUtils.getXml(a));k=Graph.compress(u);if(Graph.decompress(k)!=u)return u;u=a.ownerDocument.createElement("diagram");u.setAttribute("id",Editor.guid());mxUtils.setTextContent(u,k)}k=a.ownerDocument.createElement("mxfile");k.appendChild(u)}m? (k=k.cloneNode(!0),k.removeAttribute("modified"),k.removeAttribute("host"),k.removeAttribute("agent"),k.removeAttribute("etag"),k.removeAttribute("userAgent"),k.removeAttribute("version"),k.removeAttribute("editor"),k.removeAttribute("type")):(k.removeAttribute("userAgent"),k.removeAttribute("version"),k.removeAttribute("editor"),k.removeAttribute("pages"),k.removeAttribute("type"),mxClient.IS_CHROMEAPP?k.setAttribute("host","Chrome"):EditorUi.isElectronApp?k.setAttribute("host","Electron"):k.setAttribute("host", window.location.hostname),k.setAttribute("modified",(new Date).toISOString()),k.setAttribute("agent",navigator.userAgent),k.setAttribute("version",EditorUi.VERSION),k.setAttribute("etag",Editor.guid()),a=null!=d?d.getMode():this.mode,null!=a&&k.setAttribute("type",a),null!=this.pages&&k.setAttribute("pages",this.pages.length));x=x?mxUtils.getPrettyXml(k):mxUtils.getXml(k);if(!g&&!n&&(l||null!=d&&/(\.html)$/i.test(d.getTitle())))x=this.getHtml2(mxUtils.getXml(k),b,null!=d?d.getTitle():null,c,e);else if(g|| !n&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER||(f=null),x=this.getEmbeddedSvg(x,b,f,null,A,q,e);return x};EditorUi.prototype.getXmlFileData=function(a,b,d){a=null!=a?a:!0;b=null!=b?b:!1;d=null!=d?d:!Editor.compressXml;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(d?(EditorUi.removeChildNodes(this.currentPage.node),this.currentPage.node.appendChild(c)):(c=Graph.compressNode(c),mxUtils.setTextContent(this.currentPage.node, @@ -3002,15 +3002,15 @@ c=null!=a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a&&"m (b=d)}this.currentPage=null!=b?b:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];a=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(a);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)}; EditorUi.prototype.getBaseFilename=function(a){var c=this.getCurrentFile(),c=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(c)||/(\.html)$/i.test(c)||/(\.svg)$/i.test(c)||/(\.png)$/i.test(c)||/(\.drawio)$/i.test(c))c=c.substring(0,c.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(c=c+"-"+this.currentPage.getName());return c};EditorUi.prototype.downloadFile= function(a,b,d,f,n,g,l,A,q,m){try{f=null!=f?f:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(!n),e=c+"."+a;if("xml"==a){var k='<?xml version="1.0" encoding="UTF-8"?>\n'+this.getFileData(!0,null,null,null,f,n,null,null,null,b);this.saveData(e,a,k,"text/xml")}else if("html"==a)k=this.getHtml2(this.getFileData(!0),this.editor.graph,c),this.saveData(e,a,k,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?e=c+".png":"jpeg"== -a&&(e=c+".jpg"),this.saveRequest(e,a,mxUtils.bind(this,function(c,b){try{var e=this.editor.graph.pageVisible;null!=g&&(this.editor.graph.pageVisible=g);var d=this.createDownloadRequest(c,a,f,b,l,n,A,q,m);this.editor.graph.pageVisible=e;return d}catch(P){this.handleError(P)}}));else{var t=null,z=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(e,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(t)}))}); -if("svg"==a){var p=this.editor.graph.background;if(l||p==mxConstants.NONE)p=null;var F=this.editor.graph.getSvg(p,null,null,null,null,f);d&&this.editor.graph.addSvgShadow(F);this.convertImages(F,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();z('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else e=c+".svg",t=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop(); -z(a)}),f)}}catch(Q){this.handleError(Q)}};EditorUi.prototype.createDownloadRequest=function(a,b,d,f,n,g,l,A,q){var c=this.editor.graph,e=c.getGraphBounds();d=this.getFileData(!0,null,null,null,d,0==g?!1:"xmlpng"!=b);var k="",t="";if(e.width*e.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};e="0";"pdf"==b&&0==g&&(t="&allPages=1");if("xmlpng"==b&&(e="1",b="png",null!=this.pages&&null!=this.currentPage))for(g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){k= -"&from="+g;break}g=c.background;"png"==b&&n?g=mxConstants.NONE:n||null!=g&&g!=mxConstants.NONE||(g="#ffffff");n={globalVars:c.getExportVariables()};q&&(n.grid={size:c.gridSize,steps:c.view.gridSteps,color:c.view.gridColor});return new mxXmlRequest(EXPORT_URL,"format="+b+k+t+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+f+"&embedXml="+e+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(n))+(null!=l?"&scale="+l:"")+(null!=A?"&border="+ +a&&(e=c+".jpg"),this.saveRequest(e,a,mxUtils.bind(this,function(c,b){try{var e=this.editor.graph.pageVisible;null!=g&&(this.editor.graph.pageVisible=g);var d=this.createDownloadRequest(c,a,f,b,l,n,A,q,m);this.editor.graph.pageVisible=e;return d}catch(P){this.handleError(P)}}));else{var u=null,z=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(e,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(u)}))}); +if("svg"==a){var p=this.editor.graph.background;if(l||p==mxConstants.NONE)p=null;var F=this.editor.graph.getSvg(p,null,null,null,null,f);d&&this.editor.graph.addSvgShadow(F);this.convertImages(F,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();z('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else e=c+".svg",u=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop(); +z(a)}),f)}}catch(Q){this.handleError(Q)}};EditorUi.prototype.createDownloadRequest=function(a,b,d,f,n,g,l,A,q){var c=this.editor.graph,e=c.getGraphBounds();d=this.getFileData(!0,null,null,null,d,0==g?!1:"xmlpng"!=b);var k="",u="";if(e.width*e.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};e="0";"pdf"==b&&0==g&&(u="&allPages=1");if("xmlpng"==b&&(e="1",b="png",null!=this.pages&&null!=this.currentPage))for(g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){k= +"&from="+g;break}g=c.background;"png"==b&&n?g=mxConstants.NONE:n||null!=g&&g!=mxConstants.NONE||(g="#ffffff");n={globalVars:c.getExportVariables()};q&&(n.grid={size:c.gridSize,steps:c.view.gridSteps,color:c.view.gridColor});return new mxXmlRequest(EXPORT_URL,"format="+b+k+u+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+f+"&embedXml="+e+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(n))+(null!=l?"&scale="+l:"")+(null!=A?"&border="+ A:""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,d){var c=window.location.hash,e=mxUtils.bind(this,function(e){var d=null!=a.data?a.data:"";null!=e&&0<e.length&&(0<d.length&&(d+="\n"),d+=e);e=new LocalFile(this,"csv"!=a.format&&0<d.length?d:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);e.getHash=function(){return c};this.fileLoaded(e);"csv"==a.format&&this.importCsv(d,mxUtils.bind(this, function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var k=null!=a.interval?parseInt(a.interval):6E4,g=null,f=mxUtils.bind(this,function(){var c=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){c===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),n()):this.handleError({message:mxResources.get("error")+ " "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),n=mxUtils.bind(this,function(){window.clearTimeout(g);g=window.setTimeout(f,k)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){n();f()}));n();f()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var k=a.url;/^https?:\/\//.test(k)&&!this.editor.isCorsEnabledForUrl(k)&&(k=PROXY_URL+"?url="+encodeURIComponent(k));this.loadUrl(k,mxUtils.bind(this,function(a){e(a)}),mxUtils.bind(this,function(a){null!=d&& d(a)}))}else e("")};EditorUi.prototype.updateDiagram=function(a){function c(a){var c=new mxCellOverlay(a.image||f.warningImage,a.tooltip,a.align,a.valign,a.offset);c.addListener(mxEvent.CLICK,function(c,b){d.alert(a.tooltip)});return c}var b=null,d=this;if(null!=a&&0<a.length&&(b=mxUtils.parseXml(a),a=null!=b?b.documentElement:null,null!=a&&"updates"==a.nodeName)){var f=this.editor.graph,g=f.getModel();g.beginUpdate();var l=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var A=g.getCell(a.getAttribute("id")); -if(null!=A){try{var q=a.getAttribute("value");if(null!=q){var m=mxUtils.parseXml(q).documentElement;if(null!=m)if("1"==m.getAttribute("replace-value"))g.setValue(A,m);else for(var x=m.attributes,p=0;p<x.length;p++)f.setAttributeForCell(A,x[p].nodeName,0<x[p].nodeValue.length?x[p].nodeValue:null)}}catch(L){null!=window.console&&console.log("Error in value for "+A.id+": "+L)}try{var u=a.getAttribute("style");null!=u&&f.model.setStyle(A,u)}catch(L){null!=window.console&&console.log("Error in style for "+ +if(null!=A){try{var q=a.getAttribute("value");if(null!=q){var m=mxUtils.parseXml(q).documentElement;if(null!=m)if("1"==m.getAttribute("replace-value"))g.setValue(A,m);else for(var x=m.attributes,p=0;p<x.length;p++)f.setAttributeForCell(A,x[p].nodeName,0<x[p].nodeValue.length?x[p].nodeValue:null)}}catch(L){null!=window.console&&console.log("Error in value for "+A.id+": "+L)}try{var t=a.getAttribute("style");null!=t&&f.model.setStyle(A,t)}catch(L){null!=window.console&&console.log("Error in style for "+ A.id+": "+L)}try{var C=a.getAttribute("icon");if(null!=C){var v=0<C.length?JSON.parse(C):null;null!=v&&v.append||f.removeCellOverlays(A);null!=v&&f.addCellOverlay(A,c(v))}}catch(L){null!=window.console&&console.log("Error in icon for "+A.id+": "+L)}try{var y=a.getAttribute("geometry");if(null!=y){var y=JSON.parse(y),H=f.getCellGeometry(A);if(null!=H){H=H.clone();for(key in y){var B=parseFloat(y[key]);"dx"==key?H.x+=B:"dy"==key?H.y+=B:"dw"==key?H.width+=B:"dh"==key?H.height+=B:H[key]=parseFloat(y[key])}f.model.setGeometry(A, H)}}}catch(L){null!=window.console&&console.log("Error in icon for "+A.id+": "+L)}}}else if("model"==a.nodeName){for(var D=a.firstChild;null!=D&&D.nodeType!=mxConstants.NODETYPE_ELEMENT;)D=D.nextSibling;null!=D&&(new mxCodec(a.firstChild)).decode(D,g)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(f.view.scale=parseFloat(a.getAttribute("scale"))),a.hasAttribute("dx")||a.hasAttribute("dy"))f.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"== a.nodeName&&(l=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{g.endUpdate()}null!=l&&this.chromelessResize&&this.chromelessResize(!0,l)}return b};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,e="",d=c.lastIndexOf(".");0<=d&&(e=c.substring(d),c=c.substring(0,d));if(b)var f=new Date,d=f.getFullYear(),l=f.getMonth()+1,A=f.getDate(),q=f.getHours(),m=f.getMinutes(),f=f.getSeconds(),c= @@ -3030,16 +3030,16 @@ var b=c.lastChild,d=b.previousSibling;c.insertBefore(b,a);c.insertBefore(d,b)};E this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var e=null,k=mxUtils.bind(this,function(c,b){0==c.length&&a.isEditable()?(null==e&&(e=document.createElement("div"),e.className="geDropTarget",mxUtils.write(e,mxResources.get("dragElementsHere"))),b.appendChild(e)):this.addLibraryEntries(c,b)});null!=this.sidebar&& null!=b&&this.sidebar.addEntries(b);d=null!=d&&0<d.length?d:a.getTitle();var f=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){k(b,a)}));this.repositionLibrary(c);var l=f.parentNode.previousSibling;d=l.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&l.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var q=document.createElement("div");q.style.position="absolute";q.style.right="0px";q.style.top="0px";q.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode|| (q.style.backgroundColor="inherit");l.style.position="relative";var m=document.createElement("img");m.setAttribute("src",Dialog.prototype.closeImage);m.setAttribute("title",mxResources.get("close"));m.setAttribute("valign","absmiddle");m.setAttribute("border","0");m.style.margin="0 3px";var x=null;if(".scratchpad"!=a.title||this.closableScratchpad)q.appendChild(m),mxEvent.addListener(m,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)}); -null!=x?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var p=this.editor.graph,u=null,C=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),f,b,a,a.getMode());mxEvent.consume(c)}),v=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=u&&null!=u.parentNode&&u.parentNode.removeChild(u),u=m.cloneNode(!1),u.setAttribute("src",Editor.spinImage),u.setAttribute("title", -mxResources.get("saving")),u.style.cursor="default",u.style.marginRight="2px",u.style.marginTop="-2px",q.insertBefore(u,q.firstChild),l.style.paddingRight=18*q.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=u&&null!=u.parentNode&&(u.parentNode.removeChild(u),l.style.paddingRight=18*q.childNodes.length+"px")})):null==x&&(x=m.cloneNode(!1),x.setAttribute("src",IMAGE_PATH+"/download.png"),x.setAttribute("title",mxResources.get("save")),q.insertBefore(x,q.firstChild), +null!=x?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var p=this.editor.graph,t=null,C=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),f,b,a,a.getMode());mxEvent.consume(c)}),v=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t),t=m.cloneNode(!1),t.setAttribute("src",Editor.spinImage),t.setAttribute("title", +mxResources.get("saving")),t.style.cursor="default",t.style.marginRight="2px",t.style.marginTop="-2px",q.insertBefore(t,q.firstChild),l.style.paddingRight=18*q.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=t&&null!=t.parentNode&&(t.parentNode.removeChild(t),l.style.paddingRight=18*q.childNodes.length+"px")})):null==x&&(x=m.cloneNode(!1),x.setAttribute("src",IMAGE_PATH+"/download.png"),x.setAttribute("title",mxResources.get("save")),q.insertBefore(x,q.firstChild), mxEvent.addListener(x,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==x||a.isModified()||(l.style.paddingRight=18*q.childNodes.length+"px",x.parentNode.removeChild(x),x=null)});mxEvent.consume(c)})),l.style.paddingRight=18*q.childNodes.length+"px")}),y=mxUtils.bind(this,function(a,c,d,k){a=p.cloneCells(mxUtils.sortCells(p.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var n=p.getCellGeometry(a[g]);null!=n&& n.translate(-c.x,-c.y)}f.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,k||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=k&&(a.title=k);b.push(a);v(d);null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null)}),H=mxUtils.bind(this,function(a){if(p.isSelectionEmpty())p.getRubberband().isActive()?(p.getRubberband().execute(a),p.getRubberband().reset()):this.showError(mxResources.get("error"), mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=p.getSelectionCells(),b=p.view.getBounds(c),d=p.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=p.view.translate.x;b.y-=p.view.translate.y;y(c,b)}mxEvent.consume(a)});mxEvent.addGestureListeners(f,function(){},mxUtils.bind(this,function(a){p.isMouseDown&&null!=p.panningManager&&null!=p.graphHandler.shape&&(p.graphHandler.shape.node.style.visibility="hidden",f.style.backgroundColor="#f1f3f4",f.style.cursor="copy",p.panningManager.stop(), p.autoScroll=!1,null!=p.graphHandler.guide&&p.graphHandler.guide.setVisible(!1),null!=p.graphHandler.hint&&(p.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){p.isMouseDown&&null!=p.panningManager&&null!=p.graphHandler&&(f.style.backgroundColor="",f.style.cursor="default",this.sidebar.showTooltips=!0,p.panningManager.stop(),p.graphHandler.reset(),p.isMouseDown=!1,p.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(f,"mouseleave",mxUtils.bind(this, function(a){p.isMouseDown&&null!=p.graphHandler.shape&&(p.graphHandler.shape.node.style.visibility="visible",f.style.backgroundColor="",f.style.cursor="",p.autoScroll=!0,null!=p.graphHandler.guide&&p.graphHandler.guide.setVisible(!0),null!=p.graphHandler.hint&&(p.graphHandler.hint.style.visibility="visible"))}));Graph.fileSupport&&(mxEvent.addListener(f,"dragover",mxUtils.bind(this,function(a){f.style.backgroundColor="#f1f3f4";a.dataTransfer.dropEffect="copy";f.style.cursor="copy";this.sidebar.hideTooltip(); -a.stopPropagation();a.preventDefault()})),mxEvent.addListener(f,"drop",mxUtils.bind(this,function(a){f.style.cursor="";f.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,n,t,l,q,u,x){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,t,l),c)],c[0].vertex=!0,y(c,new mxRectangle(0, -0,t,l),a,mxEvent.isAltDown(a)?null:q.substring(0,q.lastIndexOf(".")).replace(/_/g," ")),null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null);else{var z=!1,A=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var n=JSON.parse(mxUtils.getTextContent(g.documentElement));k(n,f);b=b.concat(n);v(a);this.spinner.stop();z=!0}catch(M){}else if("mxfile"==g.documentElement.nodeName)try{for(var t=g.documentElement.getElementsByTagName("diagram"), -g=0;g<t.length;g++){var q=this.stringToCells(Editor.getDiagramNodeXml(t[g])),l=this.editor.graph.getBoundingBoxFromGeometry(q);y(q,new mxRectangle(0,0,l.width,l.height),a)}z=!0}catch(M){null!=window.console&&console.log("error in drop handler:",M)}}z||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null)});null!=x&&null!=q&&(/(\.v(dx|sdx?))($|\?)/i.test(q)||/(\.vs(x|sx?))($|\?)/i.test(q))? +a.stopPropagation();a.preventDefault()})),mxEvent.addListener(f,"drop",mxUtils.bind(this,function(a){f.style.cursor="";f.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,n,u,l,q,t,x){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,u,l),c)],c[0].vertex=!0,y(c,new mxRectangle(0, +0,u,l),a,mxEvent.isAltDown(a)?null:q.substring(0,q.lastIndexOf(".")).replace(/_/g," ")),null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null);else{var z=!1,A=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var n=JSON.parse(mxUtils.getTextContent(g.documentElement));k(n,f);b=b.concat(n);v(a);this.spinner.stop();z=!0}catch(M){}else if("mxfile"==g.documentElement.nodeName)try{for(var u=g.documentElement.getElementsByTagName("diagram"), +g=0;g<u.length;g++){var q=this.stringToCells(Editor.getDiagramNodeXml(u[g])),l=this.editor.graph.getBoundingBoxFromGeometry(q);y(q,new mxRectangle(0,0,l.width,l.height),a)}z=!0}catch(M){null!=window.console&&console.log("error in drop handler:",M)}}z||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=e&&null!=e.parentNode&&0<b.length&&(e.parentNode.removeChild(e),e=null)});null!=x&&null!=q&&(/(\.v(dx|sdx?))($|\?)/i.test(q)||/(\.vs(x|sx?))($|\?)/i.test(q))? this.importVisio(x,function(a){A(a,"text/xml")},null,q):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,q)&&null!=x?this.parseFile(x,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?A(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):A(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(f,"dragleave", function(a){f.style.cursor="";f.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));m=m.cloneNode(!1);m.setAttribute("src",Editor.editImage);m.setAttribute("title",mxResources.get("edit"));q.insertBefore(m,q.firstChild);mxEvent.addListener(m,"click",C);mxEvent.addListener(f,"dblclick",function(a){mxEvent.getSource(a)==f&&C(a)});d=m.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));q.insertBefore(d,q.firstChild);mxEvent.addListener(d, "click",H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",mxResources.get("help")),d.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),q.insertBefore(d,q.firstChild))}l.appendChild(q);l.style.paddingRight=18*q.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries= @@ -3052,12 +3052,12 @@ Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAM !0;this.editor.graph.model.execute(a)});var c=new BackgroundImageDialog(this,mxUtils.bind(this,function(c){a(c)}));this.showDialog(c.container,360,200,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(a,b,d,f,n){a=new LibraryDialog(this,a,b,d,f,n);this.showDialog(a.container,640,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};var b=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(a){var c= b.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(a){this.editor.graph.isSelectionEmpty()&&c.refresh()}));return c};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer geSidebarFooter");a.style.position="absolute";a.style.overflow="hidden";var b=document.createElement("a");b.className="geTitle";b.style.color="#DF6C0C";b.style.fontWeight="bold";b.style.height="100%";b.style.paddingTop="9px";b.innerHTML= '<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,d,f,n,g){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){}, -e=null!=a&&null!=a.error?a.error:a;if(null!=e||null!=b){var k=mxUtils.htmlEntities(mxResources.get("unknownError")),t=mxResources.get("ok"),l=null;b=null!=b?b:mxResources.get("error");if(null!=e){null!=e.retry&&(t=mxResources.get("cancel"),l=function(){c();e.retry()});if(404==e.code||404==e.status||403==e.code){var k=403==e.code?null!=e.message?mxUtils.htmlEntities(e.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):null!=n?n:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+ +e=null!=a&&null!=a.error?a.error:a;if(null!=e||null!=b){var k=mxUtils.htmlEntities(mxResources.get("unknownError")),u=mxResources.get("ok"),l=null;b=null!=b?b:mxResources.get("error");if(null!=e){null!=e.retry&&(u=mxResources.get("cancel"),l=function(){c();e.retry()});if(404==e.code||404==e.status||403==e.code){var k=403==e.code?null!=e.message?mxUtils.htmlEntities(e.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):null!=n?n:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+ (null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.displayName+", "+this.drive.user.email+")":"")),m=null!=g?g:window.location.hash;if(null!=m&&("#G"==m.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==m.substring(0,45))&&(null!=a&&null!=a.error&&(null!=a.error.errors&&0<a.error.errors.length&&"fileAccess"==a.error.errors[0].reason||null!=a.error.data&&0<a.error.data.length&&"fileAccess"==a.error.data[0].reason)||404==e.code||404==e.status)){m="#U"==m.substring(0,2)?m.substring(45, m.lastIndexOf("%26ex")):m.substring(2);this.showError(b,k,mxResources.get("openInNewWindow"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+m);this.handleError(a,b,d,f,n)}),l,mxResources.get("changeUser"),mxUtils.bind(this,function(){function a(){e.innerHTML="";for(var a=0;a<c.length;a++){var b=document.createElement("option");mxUtils.write(b,c[a].displayName);b.value=a;e.appendChild(b);b=document.createElement("option");b.innerHTML=" "; mxUtils.write(b,"<"+c[a].email+">");b.setAttribute("disabled","disabled");e.appendChild(b)}b=document.createElement("option");mxUtils.write(b,mxResources.get("addAccount"));b.value=c.length;e.appendChild(b)}var c=this.drive.getUsersList(),b=document.createElement("div"),d=document.createElement("span");d.style.marginTop="6px";mxUtils.write(d,mxResources.get("changeUser")+": ");b.appendChild(d);var e=document.createElement("select");e.style.width="200px";a();mxEvent.addListener(e,"change",mxUtils.bind(this, function(){var b=e.value,d=c.length!=b;d&&this.drive.setUser(c[b]);this.drive.authorize(d,mxUtils.bind(this,function(){d||(c=this.drive.getUsersList(),a())}),mxUtils.bind(this,function(a){this.handleError(a)}),!0)}));b.appendChild(e);b=new CustomDialog(this,b,mxUtils.bind(this,function(){this.loadFile(window.location.hash.substr(1),!0)}));this.showDialog(b.container,300,75,!0,!0)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.hideDialog();null!=d&&d()}),480,150);return}}null!=e.message? -k=mxUtils.htmlEntities(e.message):null!=e.response&&null!=e.response.error?k=mxUtils.htmlEntities(e.response.error):"undefined"!==typeof window.App&&(e.code==App.ERROR_TIMEOUT?k=mxUtils.htmlEntities(mxResources.get("timeout")):e.code==App.ERROR_BUSY&&(k=mxUtils.htmlEntities(mxResources.get("busy"))))}var u=g=null;null!=e&&null!=e.helpLink&&(g=mxResources.get("help"),u=mxUtils.bind(this,function(){return this.editor.graph.openLink(e.helpLink)}));this.showError(b,k,t,d,l,null,null,g,u,null,null,null, +k=mxUtils.htmlEntities(e.message):null!=e.response&&null!=e.response.error?k=mxUtils.htmlEntities(e.response.error):"undefined"!==typeof window.App&&(e.code==App.ERROR_TIMEOUT?k=mxUtils.htmlEntities(mxResources.get("timeout")):e.code==App.ERROR_BUSY&&(k=mxUtils.htmlEntities(mxResources.get("busy"))))}var t=g=null;null!=e&&null!=e.helpLink&&(g=mxResources.get("help"),t=mxUtils.bind(this,function(){return this.editor.graph.openLink(e.helpLink)}));this.showError(b,k,u,d,l,null,null,g,t,null,null,null, f?d:null)}else null!=d&&d()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,d,f,n,g){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},e=Math.min(200,28*Math.ceil(a.length/50));a=new ConfirmDialog(this,a,function(){c();null!=b&&b()},function(){c();null!=d&&d()},f,n,null,null,null,null,e);this.showDialog(a.container,340,46+ e,!0,g);a.init()};EditorUi.prototype.setCurrentFile=function(a){null!=a&&(a.opened=new Date);this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,d,f){var c= a.toDataURL("image/"+d);if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/"+d))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c,"tEXt","mxfile",encodeURIComponent(b)));0<f&&(c=this.writeGraphModelToPng(c,"pHYs","dpi",f));return c};EditorUi.prototype.saveCanvas=function(a,b,d,f,n){var c="jpeg"==d?"jpg":d;f=this.getBaseFilename(f)+"."+c;a=this.createImageDataUri(a,b,d,n);this.saveData(f,c,a.substring(a.lastIndexOf(",")+1),"image/"+d,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!= @@ -3066,7 +3066,7 @@ urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!= if(mxClient.IS_GC)var k=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),e=65==(k?parseInt(k[2],10):!1)?!1:e;if(e||this.isOffline()){c.href=URL.createObjectURL(f?this.base64ToBlob(a,d):new Blob([a],{type:d}));e?c.download=b:c.setAttribute("target","_blank");document.body.appendChild(c);try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(q){}}else this.createEchoRequest(a,b,d,f,n).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest= function(a,b,d,f,n,g){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=n?"&format="+n:"")+(null!=g?"&base64="+g:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(f?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var c=atob(a),d=c.length,e=Math.ceil(d/1024),f=Array(e),l=0;l<e;++l){for(var A=1024*l,q=Math.min(A+1024,d),m=Array(q-A),x=0;A<q;++x,++A)m[x]=c[A].charCodeAt(0);f[l]=new Uint8Array(m)}return new Blob(f,{type:b})}; EditorUi.prototype.saveLocalFile=function(a,b,d,f,n,g,l){g=null!=g?g:!1;l=null!=l?l:"vsdx"!=n&&(!mxClient.IS_IOS||!navigator.standalone);n=this.getServiceCount(g);isLocalStorage&&n++;var c=4>=n?2:6<n?4:3;b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)||"image/svg"==d.substring(0,9)&&!mxClient.IS_SVG){var e=window.open("about:blank");null==e?mxUtils.popup(a,!0):(e.document.write("<pre>"+mxUtils.htmlEntities(a,!1)+"<pre>"),e.document.close())}else this.openInNewWindow(a, -d,f);else b==App.MODE_DEVICE||"download"==b?this.doSaveLocalFile(a,c,d,f):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(e){try{this.exportFile(a,c,d,f,b,e)}catch(u){this.handleError(u)}}))}catch(E){this.handleError(E)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,l,null,1<n,c,a,d,f);g=this.isServices(n)?n>c?390:270:160;this.showDialog(b.container,400,g,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a, +d,f);else b==App.MODE_DEVICE||"download"==b?this.doSaveLocalFile(a,c,d,f):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(e){try{this.exportFile(a,c,d,f,b,e)}catch(t){this.handleError(t)}}))}catch(E){this.handleError(E)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,l,null,1<n,c,a,d,f);g=this.isServices(n)?n>c?390:270:160;this.showDialog(b.container,400,g,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a, b,d){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c||null==c.document?mxUtils.popup(a,!0):("image/svg+xml"==b?c.document.write("<html>"+a+"</html>"):c.document.write('<html><img src="data:'+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),c.document.close())}else c=window.open("data:"+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null!=c&&null!=c.document||mxUtils.popup(a,!0)}; var f=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d= c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left= @@ -3076,9 +3076,9 @@ b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,fu a,f,n,b,c)}),d,n,f)};EditorUi.prototype.saveRequest=function(a,b,d,f,n,g,l){l=null!=l?l:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);isLocalStorage&&c++;var e=4>=c?2:6<c?4:3;a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var e=d("_blank"==c?null:a,c==App.MODE_DEVICE||"download"==c||null==c||"_blank"==c?"0":"1");null!=e&&(c==App.MODE_DEVICE||"download"==c||"_blank"==c?e.simulate(document,"_blank"):this.pickFolder(c,mxUtils.bind(this, function(d){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=f)try{this.exportFile(f,a,g,!0,c,d)}catch(C){this.handleError(C)}else this.spinner.spin(document.body,mxResources.get("saving"))&&e.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=e.getStatus()&&299>=e.getStatus())try{this.exportFile(e.getText(),a,g,!0,c,d)}catch(C){this.handleError(C)}else this.handleError({message:mxResources.get("errorSavingFile")})}),function(a){this.spinner.stop();this.handleError(a)})})))}}), mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,!1,l,null,1<c,e,f,g,n);c=this.isServices(c)?4<c?390:270:160;this.showDialog(a.container,380,c,!0,!0);a.init()};EditorUi.prototype.isServices=function(a){return 1!=a};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,d,f,n,g){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,f, -n,g,l,m,q,p){if(this.spinner.spin(document.body,mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var e=this.editor.graph.getSvg(c,a,l,m,null,d,null,null,"blank"==p?"_blank":"self"==p?"_top":null);f&&this.editor.graph.addSvgShadow(e);var k=this.getBaseFilename()+".svg",t=mxUtils.bind(this,function(a){this.spinner.stop();n&&a.setAttribute("content",this.getFileData(!0, +n,g,l,m,q,p){if(this.spinner.spin(document.body,mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var e=this.editor.graph.getSvg(c,a,l,m,null,d,null,null,"blank"==p?"_blank":"self"==p?"_top":null);f&&this.editor.graph.addSvgShadow(e);var k=this.getBaseFilename()+".svg",u=mxUtils.bind(this,function(a){this.spinner.stop();n&&a.setAttribute("content",this.getFileData(!0, null,null,null,d,q,null,null,null,!1));if(null!=this.editor.fontCss){var c=a.ownerDocument,c=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"style"):c.createElement("style");c.setAttribute("type","text/css");mxUtils.setTextContent(c,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(c)}var b='<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()|| -b.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,e,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(e,t,this.thumbImageCache)):t(e)}))}};EditorUi.prototype.addRadiobox=function(a,b,d,f,n,g,l){return this.addCheckbox(a,d,f,n,g,l,!0,b)};EditorUi.prototype.addCheckbox= +b.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,e,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(e,u,this.thumbImageCache)):u(e)}))}};EditorUi.prototype.addRadiobox=function(a,b,d,f,n,g,l){return this.addCheckbox(a,d,f,n,g,l,!0,b)};EditorUi.prototype.addCheckbox= function(a,b,d,f,n,g,l,m){g=null!=g?g:!0;var c=document.createElement("input");c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type",l?"radio":"checkbox");l="geCheckbox-"+Editor.guid();c.id=l;null!=m&&c.setAttribute("name",m);d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);f&&c.setAttribute("disabled","disabled");g&&(a.appendChild(c),d=document.createElement("label"),mxUtils.write(d,b),d.setAttribute("for",l),a.appendChild(d),n||mxUtils.br(a));return c};EditorUi.prototype.addEditButton= function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),e="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(e=window.location.href);var f=document.createElement("select");f.style.width="120px";f.style.marginLeft="8px";f.style.marginRight="10px";f.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));f.appendChild(d);d=document.createElement("option"); d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");f.appendChild(d);a.appendChild(f);mxEvent.addListener(f,"change",mxUtils.bind(this,function(){if("custom"==f.value){var a=new FilenameDialog(this,e,mxResources.get("ok"),function(a){null!=a?e=a:f.value="blank"},mxResources.get("url"),null,null,null,null,function(){f.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b|| @@ -3091,60 +3091,60 @@ null,null,null,null,null,null,!0):Graph.compress(mxUtils.getXml(this.editor.getG var c={};""!=n&&n!=mxConstants.NONE&&(c.highlight=n);"auto"!==f&&(c.target=f);q||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled;d=parseInt(d);isNaN(d)||100==d||(c.zoom=d/100);d=[];l&&(d.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),c.resize=!0);m&&d.push("layers");0<d.length&&(q&&d.push("lightbox"),c.toolbar=d.join(" "));null!=p&&0<p.length&&(c.edit=p);null!=a?c.url=a:c.xml=this.getFileData(!0, null,null,null,null,!l);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";x(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.drawHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.drawHost+ "/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,f){var c=document.createElement("div");c.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,mxResources.get("html"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(e);var k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var l=document.createElement("input");l.style.cssText= -"margin-right:8px;margin-top:8px;margin-bottom:8px;";l.setAttribute("value","url");l.setAttribute("type","radio");l.setAttribute("name","type-embedhtmldialog");e=l.cloneNode(!0);e.setAttribute("value","copy");k.appendChild(e);var q=document.createElement("span");mxUtils.write(q,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(q);mxUtils.br(k);k.appendChild(l);q=document.createElement("span");mxUtils.write(q,mxResources.get("publicDiagramUrl"));k.appendChild(q);var t=this.getCurrentFile(); -null==d&&null!=t&&t.constructor==window.DriveFile&&(q=document.createElement("a"),q.style.paddingLeft="12px",q.style.color="gray",q.setAttribute("href","javascript:void(0);"),mxUtils.write(q,mxResources.get("share")),k.appendChild(q),mxEvent.addListener(q,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(t.getId())})));e.setAttribute("checked","checked");null==d&&l.setAttribute("disabled","disabled");c.appendChild(k);var x=this.addLinkSection(c),m=this.addCheckbox(c, -mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.style.marginRight="12px";u.value="100%";c.appendChild(u);var p=this.addCheckbox(c,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,v=v=this.addCheckbox(c,mxResources.get("allPages"),k,!k),y=this.addCheckbox(c,mxResources.get("layers"),!0),H=this.addCheckbox(c,mxResources.get("lightbox"), -!0),B=this.addEditButton(c,H),D=B.getEditInput();D.style.marginBottom="16px";mxEvent.addListener(H,"change",function(){H.checked?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled");D.checked&&H.checked?B.getEditSelect().removeAttribute("disabled"):B.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){f(l.checked?d:null,m.checked,u.value,x.getTarget(),x.getColor(),p.checked,v.checked,y.checked,H.checked,B.getLink())}),null,a, +"margin-right:8px;margin-top:8px;margin-bottom:8px;";l.setAttribute("value","url");l.setAttribute("type","radio");l.setAttribute("name","type-embedhtmldialog");e=l.cloneNode(!0);e.setAttribute("value","copy");k.appendChild(e);var q=document.createElement("span");mxUtils.write(q,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(q);mxUtils.br(k);k.appendChild(l);q=document.createElement("span");mxUtils.write(q,mxResources.get("publicDiagramUrl"));k.appendChild(q);var u=this.getCurrentFile(); +null==d&&null!=u&&u.constructor==window.DriveFile&&(q=document.createElement("a"),q.style.paddingLeft="12px",q.style.color="gray",q.setAttribute("href","javascript:void(0);"),mxUtils.write(q,mxResources.get("share")),k.appendChild(q),mxEvent.addListener(q,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(u.getId())})));e.setAttribute("checked","checked");null==d&&l.setAttribute("disabled","disabled");c.appendChild(k);var x=this.addLinkSection(c),m=this.addCheckbox(c, +mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value="100%";c.appendChild(t);var p=this.addCheckbox(c,mxResources.get("fit"),!0),k=null!=this.pages&&1<this.pages.length,v=v=this.addCheckbox(c,mxResources.get("allPages"),k,!k),y=this.addCheckbox(c,mxResources.get("layers"),!0),H=this.addCheckbox(c,mxResources.get("lightbox"), +!0),B=this.addEditButton(c,H),D=B.getEditInput();D.style.marginBottom="16px";mxEvent.addListener(H,"change",function(){H.checked?D.removeAttribute("disabled"):D.setAttribute("disabled","disabled");D.checked&&H.checked?B.getEditSelect().removeAttribute("disabled"):B.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){f(l.checked?d:null,m.checked,t.value,x.getTarget(),x.getColor(),p.checked,v.checked,y.checked,H.checked,B.getLink())}),null,a, b);this.showDialog(a.container,340,384,!0,!0);e.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,d,f,n,g){var c=document.createElement("div");c.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,a||mxResources.get("link"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(e);var k=this.getCurrentFile(),e="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=k&&k.constructor==window.DriveFile&& -!b){a=80;var e="https://desk.draw.io/support/solutions/articles/16000039384",l=document.createElement("div");l.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var t=document.createElement("div");t.style.whiteSpace="normal";mxUtils.write(t,mxResources.get("linkAccountRequired"));l.appendChild(t);t=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(k.getId())}));t.style.marginTop= -"12px";t.className="geBtn";l.appendChild(t);c.appendChild(l);t=document.createElement("a");t.style.paddingLeft="12px";t.style.color="gray";t.style.fontSize="11px";t.setAttribute("href","javascript:void(0);");mxUtils.write(t,mxResources.get("check"));l.appendChild(t);mxEvent.addListener(t,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null, -mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var m=null,u=null;if(null!=d||null!=f)a+=30,mxUtils.write(c,mxResources.get("width")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",c.appendChild(m),mxUtils.write(c,mxResources.get("height")+":"), -u=document.createElement("input"),u.setAttribute("type","text"),u.style.width="50px",u.style.marginLeft="6px",u.style.marginBottom="10px",u.value=f+"px",c.appendChild(u),mxUtils.br(c);var p=this.addLinkSection(c,g);d=null!=this.pages&&1<this.pages.length;var v=null;if(null==k||k.constructor!=window.DriveFile||b)v=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var y=this.addCheckbox(c,mxResources.get("lightbox"),!0),H=this.addEditButton(c,y),B=H.getEditInput(),D=this.addCheckbox(c,mxResources.get("layers"), +!b){a=80;var e="https://desk.draw.io/support/solutions/articles/16000039384",l=document.createElement("div");l.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var u=document.createElement("div");u.style.whiteSpace="normal";mxUtils.write(u,mxResources.get("linkAccountRequired"));l.appendChild(u);u=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(k.getId())}));u.style.marginTop= +"12px";u.className="geBtn";l.appendChild(u);c.appendChild(l);u=document.createElement("a");u.style.paddingLeft="12px";u.style.color="gray";u.style.fontSize="11px";u.setAttribute("href","javascript:void(0);");mxUtils.write(u,mxResources.get("check"));l.appendChild(u);mxEvent.addListener(u,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null, +mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var m=null,t=null;if(null!=d||null!=f)a+=30,mxUtils.write(c,mxResources.get("width")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",c.appendChild(m),mxUtils.write(c,mxResources.get("height")+":"), +t=document.createElement("input"),t.setAttribute("type","text"),t.style.width="50px",t.style.marginLeft="6px",t.style.marginBottom="10px",t.value=f+"px",c.appendChild(t),mxUtils.br(c);var p=this.addLinkSection(c,g);d=null!=this.pages&&1<this.pages.length;var v=null;if(null==k||k.constructor!=window.DriveFile||b)v=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var y=this.addCheckbox(c,mxResources.get("lightbox"),!0),H=this.addEditButton(c,y),B=H.getEditInput(),D=this.addCheckbox(c,mxResources.get("layers"), !0);D.style.marginLeft=B.style.marginLeft;D.style.marginBottom="16px";D.style.marginTop="8px";mxEvent.addListener(y,"change",function(){y.checked?(D.removeAttribute("disabled"),B.removeAttribute("disabled")):(D.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"));B.checked&&y.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){n(p.getTarget(),p.getColor(),null==v? -!0:v.checked,y.checked,H.getLink(),D.checked,null!=m?m.value:null,null!=u?u.value:null)}),null,mxResources.get("create"),e);this.showDialog(b.container,340,254+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):p.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,f,n){var c=document.createElement("div");c.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e, +!0:v.checked,y.checked,H.getLink(),D.checked,null!=m?m.value:null,null!=t?t.value:null)}),null,mxResources.get("create"),e);this.showDialog(b.container,340,254+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):p.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,f,n){var c=document.createElement("div");c.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e, mxResources.get("image"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(n?"10":"4")+"px";c.appendChild(e);if(n){mxUtils.write(c,mxResources.get("zoom")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.marginRight="16px";k.style.width="60px";k.style.marginLeft="4px";k.style.marginRight="12px";k.value=this.lastExportZoom||"100%";c.appendChild(k);mxUtils.write(c,mxResources.get("borderWidth")+":");var l=document.createElement("input");l.setAttribute("type", -"text");l.style.marginRight="16px";l.style.width="60px";l.style.marginLeft="4px";l.value=this.lastExportBorder||"0";c.appendChild(l);mxUtils.br(c)}var t=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),x=f?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0),e=this.editor.graph,m=f?null:this.addCheckbox(c,mxResources.get("transparentBackground"),e.background==mxConstants.NONE||null==e.background);null!=m&&(m.style.marginBottom="16px");a= -new CustomDialog(this,c,mxUtils.bind(this,function(){var a=parseInt(k.value)/100||1,c=parseInt(l.value)||0;d(!t.checked,null!=x?x.checked:!1,null!=m?m.checked:!1,a,c)}),null,a,b);this.showDialog(a.container,300,(n?25:0)+(f?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,f,l,g,m,A){m=null!=m?m:!0;var c=document.createElement("div");c.style.whiteSpace="nowrap";var e=this.editor.graph,k="jpeg"==A?196:300,n=document.createElement("h3");mxUtils.write(n,a);n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px"; -c.appendChild(n);mxUtils.write(c,mxResources.get("zoom")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.marginRight="16px";t.style.width="60px";t.style.marginLeft="4px";t.style.marginRight="12px";t.value=this.lastExportZoom||"100%";c.appendChild(t);mxUtils.write(c,mxResources.get("borderWidth")+":");var z=document.createElement("input");z.setAttribute("type","text");z.style.marginRight="16px";z.style.width="60px";z.style.marginLeft="4px";z.value=this.lastExportBorder|| +"text");l.style.marginRight="16px";l.style.width="60px";l.style.marginLeft="4px";l.value=this.lastExportBorder||"0";c.appendChild(l);mxUtils.br(c)}var u=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),x=f?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0),e=this.editor.graph,m=f?null:this.addCheckbox(c,mxResources.get("transparentBackground"),e.background==mxConstants.NONE||null==e.background);null!=m&&(m.style.marginBottom="16px");a= +new CustomDialog(this,c,mxUtils.bind(this,function(){var a=parseInt(k.value)/100||1,c=parseInt(l.value)||0;d(!u.checked,null!=x?x.checked:!1,null!=m?m.checked:!1,a,c)}),null,a,b);this.showDialog(a.container,300,(n?25:0)+(f?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,f,l,g,m,A){m=null!=m?m:!0;var c=document.createElement("div");c.style.whiteSpace="nowrap";var e=this.editor.graph,k="jpeg"==A?196:300,n=document.createElement("h3");mxUtils.write(n,a);n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px"; +c.appendChild(n);mxUtils.write(c,mxResources.get("zoom")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.marginRight="16px";u.style.width="60px";u.style.marginLeft="4px";u.style.marginRight="12px";u.value=this.lastExportZoom||"100%";c.appendChild(u);mxUtils.write(c,mxResources.get("borderWidth")+":");var z=document.createElement("input");z.setAttribute("type","text");z.style.marginRight="16px";z.style.width="60px";z.style.marginLeft="4px";z.value=this.lastExportBorder|| "0";c.appendChild(z);mxUtils.br(c);var p=this.addCheckbox(c,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=A),v=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,e.isSelectionEmpty()),y=document.createElement("input");y.style.marginTop="16px";y.style.marginRight="8px";y.style.marginLeft="24px";y.setAttribute("disabled","disabled");y.setAttribute("type","checkbox");g&&(c.appendChild(y),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),k+=26,mxEvent.addListener(v,"change",function(){v.checked? y.removeAttribute("disabled"):y.setAttribute("disabled","disabled")}));e.isSelectionEmpty()||(y.setAttribute("checked","checked"),y.defaultChecked=!0);var B=this.addCheckbox(c,mxResources.get("shadow"),e.shadowVisible),D=document.createElement("input");D.style.marginTop="16px";D.style.marginRight="8px";D.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||D.setAttribute("disabled","disabled");b&&(c.appendChild(D),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),k+= 26);var L=null;if("png"==A||"jpeg"==A)L=this.addCheckbox(c,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),k+=26;var O=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),m,null,null,"jpeg"!=A),P=null!=this.pages&&1<this.pages.length,ba=this.addCheckbox(c,P?mxResources.get("allPages"):"",P,!P,null,"jpeg"!=A);ba.style.marginLeft="24px";ba.style.marginBottom="16px";P||(ba.style.display="none");mxEvent.addListener(O,"change",function(){O.checked&&P?ba.removeAttribute("disabled"): ba.setAttribute("disabled","disabled")});m&&P||ba.setAttribute("disabled","disabled");var W=document.createElement("select");W.style.maxWidth="260px";W.style.marginLeft="8px";W.style.marginRight="10px";W.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));W.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));W.appendChild(a);a=document.createElement("option"); -a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));W.appendChild(a);"svg"==A&&(mxUtils.write(c,mxResources.get("links")+":"),c.appendChild(W),mxUtils.br(c),mxUtils.br(c),k+=26);d=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=z.value;this.lastExportZoom=t.value;l(t.value,p.checked,!v.checked,B.checked,O.checked,D.checked,z.value,y.checked,!ba.checked,W.value,null!=L?L.checked:null)}),null,d,f);this.showDialog(d.container,340,k,!0,!0,null, -null,null,null,!0);t.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,f,l){var c=document.createElement("div");c.style.whiteSpace="nowrap";var e=this.editor.graph;if(null!=b){var k=document.createElement("h3");mxUtils.write(k,b);k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(k)}var n=this.addCheckbox(c,mxResources.get("fit"), -!0),t=this.addCheckbox(c,mxResources.get("shadow"),e.shadowVisible&&f,!f),m=this.addCheckbox(c,d),p=this.addCheckbox(c,mxResources.get("lightbox"),!0),u=this.addEditButton(c,p),v=u.getEditInput(),y=1<e.model.getChildCount(e.model.getRoot()),B=this.addCheckbox(c,mxResources.get("layers"),y,!y);B.style.marginLeft=v.style.marginLeft;B.style.marginBottom="12px";B.style.marginTop="8px";mxEvent.addListener(p,"change",function(){p.checked?(y&&B.removeAttribute("disabled"),v.removeAttribute("disabled")): -(B.setAttribute("disabled","disabled"),v.setAttribute("disabled","disabled"));v.checked&&p.checked?u.getEditSelect().removeAttribute("disabled"):u.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(n.checked,t.checked,m.checked,p.checked,u.getLink(),B.checked)}),null,mxResources.get("embed"),l);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,f,l,g,m,p){function c(c){var b=" ",k="";f&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+ +a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));W.appendChild(a);"svg"==A&&(mxUtils.write(c,mxResources.get("links")+":"),c.appendChild(W),mxUtils.br(c),mxUtils.br(c),k+=26);d=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=z.value;this.lastExportZoom=u.value;l(u.value,p.checked,!v.checked,B.checked,O.checked,D.checked,z.value,y.checked,!ba.checked,W.value,null!=L?L.checked:null)}),null,d,f);this.showDialog(d.container,340,k,!0,!0,null, +null,null,null,!0);u.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?u.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,f,l){var c=document.createElement("div");c.style.whiteSpace="nowrap";var e=this.editor.graph;if(null!=b){var k=document.createElement("h3");mxUtils.write(k,b);k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(k)}var n=this.addCheckbox(c,mxResources.get("fit"), +!0),u=this.addCheckbox(c,mxResources.get("shadow"),e.shadowVisible&&f,!f),m=this.addCheckbox(c,d),p=this.addCheckbox(c,mxResources.get("lightbox"),!0),t=this.addEditButton(c,p),v=t.getEditInput(),y=1<e.model.getChildCount(e.model.getRoot()),B=this.addCheckbox(c,mxResources.get("layers"),y,!y);B.style.marginLeft=v.style.marginLeft;B.style.marginBottom="12px";B.style.marginTop="8px";mxEvent.addListener(p,"change",function(){p.checked?(y&&B.removeAttribute("disabled"),v.removeAttribute("disabled")): +(B.setAttribute("disabled","disabled"),v.setAttribute("disabled","disabled"));v.checked&&p.checked?t.getEditSelect().removeAttribute("disabled"):t.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){a(n.checked,u.checked,m.checked,p.checked,t.getLink(),B.checked)}),null,mxResources.get("embed"),l);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,f,l,g,m,p){function c(c){var b=" ",k="";f&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+ EditorUi.drawHost+"/?client=1&lightbox=1"+(l?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",k+="cursor:pointer;");a&&(k+="max-width:100%;");var n="";d&&(n=' width="'+Math.round(e.width)+'" height="'+Math.round(e.height)+'"');m('<img src="'+c+'"'+n+(""!=k?' style="'+k+'"':"")+b+"/>")}var e=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=f?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null, mxUtils.bind(this,function(a){p({message:mxResources.get("unknownError")})}),null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),e.width*e.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var k="";d&&(k="&w="+Math.round(2*e.width)+"&h="+Math.round(2*e.height));var n=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(f?"1":"0")+k+"&xml="+encodeURIComponent(b));n.send(mxUtils.bind(this,function(){200<=n.getStatus()&&299>=n.getStatus()?c("data:image/png;base64,"+n.getText()):p({message:mxResources.get("unknownError")})}))}else p({message:mxResources.get("drawingTooLarge")})}; -EditorUi.prototype.createEmbedSvg=function(a,b,d,f,l,g,m){var c=this.editor.graph.getSvg(),e=c.getElementsByTagName("a");if(null!=e)for(var k=0;k<e.length;k++){var n=e[k].getAttribute("href");null!=n&&"#"==n.charAt(0)&&"_blank"==e[k].getAttribute("target")&&e[k].removeAttribute("target")}f&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var t=" ",u="";f&&(t="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+ -EditorUi.drawHost+"/?client=1&lightbox=1"+(l?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",u+="cursor:pointer;");a&&(u+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){m('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=u?' style="'+u+'"':"")+t+"/>")}))}else u="",f&&(c.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+ -EditorUi.drawHost+"/?client=1&lightbox=1"+(l?"&edit=_blank":"")+(g?"&layers=1":"")+"');}}})(this);"),u+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","-0.5 -0.5 "+a+" "+b),u+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=u&&c.setAttribute("style",u),m(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var c=Math.floor(a/31536E3);if(1<c)return c+" "+mxResources.get("years"); +EditorUi.prototype.createEmbedSvg=function(a,b,d,f,l,g,m){var c=this.editor.graph.getSvg(),e=c.getElementsByTagName("a");if(null!=e)for(var k=0;k<e.length;k++){var n=e[k].getAttribute("href");null!=n&&"#"==n.charAt(0)&&"_blank"==e[k].getAttribute("target")&&e[k].removeAttribute("target")}f&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var u=" ",t="";f&&(u="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+ +EditorUi.drawHost+"/?client=1&lightbox=1"+(l?"&edit=_blank":"")+(g?"&layers=1":"")+"');}})(this);\"",t+="cursor:pointer;");a&&(t+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){m('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=t?' style="'+t+'"':"")+u+"/>")}))}else t="",f&&(c.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+ +EditorUi.drawHost+"/?client=1&lightbox=1"+(l?"&edit=_blank":"")+(g?"&layers=1":"")+"');}}})(this);"),t+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","-0.5 -0.5 "+a+" "+b),t+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=t&&c.setAttribute("style",t),m(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var c=Math.floor(a/31536E3);if(1<c)return c+" "+mxResources.get("years"); c=Math.floor(a/2592E3);if(1<c)return c+" "+mxResources.get("months");c=Math.floor(a/86400);if(1<c)return c+" "+mxResources.get("days");c=Math.floor(a/3600);if(1<c)return c+" "+mxResources.get("hours");c=Math.floor(a/60);return 1<c?c+" "+mxResources.get("minutes"):1==c?c+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,d,f){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(b),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this, function(){f()}))}),0)):f()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var c=null;if("diagram"==a.nodeName)c=a;else if("mxfile"==a.nodeName){var d=a.getElementsByTagName("diagram");if(0<d.length){var c=d[0],e=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:e.apply(this,arguments)}}}null!=c&&(a=Editor.parseDiagramNode(c))}d=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(g){}finally{this.editor.graph= d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){try{var c=this.editor.graph,e=null;if(null!=d&&0<d.length)c=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(c.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(d).documentElement,!0),c),e=d;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),f=c.getGlobalVariable,k=this.pages[0];c.getGlobalVariable=function(a){return"page"== a?k.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(c.container);c.model.setRoot(k.root)}this.exportToCanvas(mxUtils.bind(this,function(d){try{null==e&&(e=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var f=d.toDataURL("image/png"),f=this.writeGraphModelToPng(f,"tEXt","mxfile",encodeURIComponent(e));a(f.substring(f.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(F){null!=b&&b(F)}}),null,null,null,mxUtils.bind(this, function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)}catch(A){null!=b&&b(A)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,d,f,l,g,m){m=b.background;m==mxConstants.NONE&&(m=null);g=b.getSvg(m,null,null,null,null,g);b.shadowVisible&&b.addSvgShadow(g);null!=a&&g.setAttribute("content",a);null!=d&&g.setAttribute("resource",d);if(null!=l)this.convertImages(g,mxUtils.bind(this,function(a){l((f?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+ mxUtils.getXml(a))}));else return(f?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(g)};EditorUi.prototype.exportImage=function(a,b,d,f,l,g,m,p,q,v,x){q=null!=q?q:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this, -function(a){this.spinner.stop();try{this.saveCanvas(a,l?this.getFileData(!0,null,null,null,d,p):null,q,null==this.pages||0==this.pages.length,x)}catch(C){"Invalid image"==C.message?this.downloadFile(q):this.handleError(C)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,f,null,null,g,m,v)}catch(u){this.spinner.stop(),this.handleError(u)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var c= +function(a){this.spinner.stop();try{this.saveCanvas(a,l?this.getFileData(!0,null,null,null,d,p):null,q,null==this.pages||0==this.pages.length,x)}catch(C){"Invalid image"==C.message?this.downloadFile(q):this.handleError(C)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,f,null,null,g,m,v)}catch(t){this.spinner.stop(),this.handleError(t)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var c= function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),d=0,f={},g=mxUtils.bind(this,function(){if(0==d){for(var e=[b[0]],k=1;k<b.length;k++){var g=b[k].indexOf(")");e.push('url("');e.push(f[c(b[k].substring(0,g))]);e.push('"'+b[k].substring(g))}this.editor.resolvedFontCss=e.join("");a()}});if(0<b.length)for(var l=1;l<b.length;l++){var m=b[l].indexOf(")"),q=null,p=b[l].indexOf("format(",m);0<p&&(q=c(b[l].substring(p+7,b[l].indexOf(")", p))));mxUtils.bind(this,function(a){if(null==f[a]){f[a]=a;d++;var c="application/x-font-ttf";if("svg"==q||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==q||"embedded-opentype"==q||/(\.otf)($|\?)/i.test(a))c="application/x-font-opentype";else if("woff"==q||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==q||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==q||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==q||/(\.sfnt)($|\?)/i.test(a))c= -"application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.editor.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){f[a]=c;d--;g()}),mxUtils.bind(this,function(a){d--;g()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[l].substring(0,m)),q)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,f,l,g,m,p,q,v,x,E,u,C,y){try{g=null!=g?g:!0;m=null!=m?m:!0;E=null!=E?E:this.editor.graph;u=null!=u?u:0;var c=q?null:E.background; -c==mxConstants.NONE&&(c=null);null==c&&(c=f);null==c&&0==q&&(c="#ffffff");this.convertImages(E.getSvg(null,null,null,C,null,m,null,null,null,v),mxUtils.bind(this,function(d){var e=new Image;e.onload=mxUtils.bind(this,function(){try{var f=function(){mxClient.IS_SF?window.setTimeout(function(){q.drawImage(e,u/p,u/p);a(k)},0):(q.drawImage(e,u/p,u/p),a(k))},k=document.createElement("canvas"),n=parseInt(d.getAttribute("width")),t=parseInt(d.getAttribute("height"));p=null!=p?p:1;null!=b&&(p=g?Math.min(1, -Math.min(3*b/(4*t),b/n)):b/n);n=Math.ceil(p*n)+2*u;t=Math.ceil(p*t)+2*u;k.setAttribute("width",n);k.setAttribute("height",t);var q=k.getContext("2d");null!=c&&(q.beginPath(),q.rect(0,0,n,t),q.fillStyle=c,q.fill());q.scale(p,p);if(y){var m=E.view,x=btoa(unescape(encodeURIComponent(m.createSvgGrid(m.gridColor)))),x="data:image/svg+xml;base64,"+x,z=E.gridSize*m.gridSteps*p,A=E.getGraphBounds(),D=A.x*p,v=A.y*p,F=new Image;F.src=x;F.onload=function(){for(var a=-Math.round(z-mxUtils.mod(m.translate.x*p- -D,z)),c=-Math.round(z-mxUtils.mod(m.translate.y*p-v,z));a<n;a+=z)for(var b=c;b<t;b+=z)q.drawImage(F,a/p,b/p);f()}}else f()}catch(V){null!=l&&l(V)}});e.onerror=function(a){null!=l&&l(a)};try{v&&this.editor.graph.addSvgShadow(d);var f=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(E,d,!0,mxUtils.bind(this, +"application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.editor.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){f[a]=c;d--;g()}),mxUtils.bind(this,function(a){d--;g()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[l].substring(0,m)),q)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,f,l,g,m,p,q,v,x,E,t,C,y){try{g=null!=g?g:!0;m=null!=m?m:!0;E=null!=E?E:this.editor.graph;t=null!=t?t:0;var c=q?null:E.background; +c==mxConstants.NONE&&(c=null);null==c&&(c=f);null==c&&0==q&&(c="#ffffff");this.convertImages(E.getSvg(null,null,null,C,null,m,null,null,null,v),mxUtils.bind(this,function(d){var e=new Image;e.onload=mxUtils.bind(this,function(){try{var f=function(){mxClient.IS_SF?window.setTimeout(function(){q.drawImage(e,t/p,t/p);a(k)},0):(q.drawImage(e,t/p,t/p),a(k))},k=document.createElement("canvas"),n=parseInt(d.getAttribute("width")),u=parseInt(d.getAttribute("height"));p=null!=p?p:1;null!=b&&(p=g?Math.min(1, +Math.min(3*b/(4*u),b/n)):b/n);n=Math.ceil(p*n)+2*t;u=Math.ceil(p*u)+2*t;k.setAttribute("width",n);k.setAttribute("height",u);var q=k.getContext("2d");null!=c&&(q.beginPath(),q.rect(0,0,n,u),q.fillStyle=c,q.fill());q.scale(p,p);if(y){var m=E.view,x=btoa(unescape(encodeURIComponent(m.createSvgGrid(m.gridColor)))),x="data:image/svg+xml;base64,"+x,z=E.gridSize*m.gridSteps*p,A=E.getGraphBounds(),D=A.x*p,v=A.y*p,F=new Image;F.src=x;F.onload=function(){for(var a=-Math.round(z-mxUtils.mod(m.translate.x*p- +D,z)),c=-Math.round(z-mxUtils.mod(m.translate.y*p-v,z));a<n;a+=z)for(var b=c;b<u;b+=z)q.drawImage(F,a/p,b/p);f()}}else f()}catch(V){null!=l&&l(V)}});e.onerror=function(a){null!=l&&l(a)};try{v&&this.editor.graph.addSvgShadow(d);var f=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(E,d,!0,mxUtils.bind(this, function(){e.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(f)}catch(L){null!=l&&l(L)}}),d,x)}catch(H){null!=l&&l(H)}};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,d=this;a.convert=function(c){if(null!=c){var e="http://"==c.substring(0,7)||"https://"==c.substring(0,8);e&&!navigator.onLine?c=d.svgBrokenImage.src:!e||c.substring(0,a.baseUrl.length)==a.baseUrl||d.crossOriginImages&&d.editor.isCorsEnabledForUrl(c)?"chrome-extension://"== c.substring(0,19)||mxClient.IS_CHROMEAPP||(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c)}return c};return a};EditorUi.prototype.convertImages=function(a,b,d,f){null==f&&(f=this.createImageUrlConverter());var c=0,e=d||{};d=mxUtils.bind(this,function(d,k){for(var g=a.getElementsByTagName(d),l=0;l<g.length;l++)mxUtils.bind(this,function(d){try{if(null!=d){var g=f.convert(d.getAttribute(k));if(null!=g&&"data:"!=g.substring(0,5)){var l=e[g];null==l?(c++,this.convertImageToDataUri(g, function(f){null!=f&&(e[g]=f,d.setAttribute(k,f));c--;0==c&&b(a)})):d.setAttribute(k,l)}else null!=g&&d.setAttribute(k,g)}}catch(C){}})(g[l])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,f,l,g,m){try{var c=!m&&(f||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a));l=null!=l?l:!0;var e=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var e=a.getText(); if(c){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var e=Array(a.length),f=0;f<a.length;f++)e[f]=String.fromCharCode(a[f]);e=e.join("")}g=null!=g?g:"data:image/png;base64,";e=g+this.base64Encode(e)}b(e)}}else null!=d&&d({message:mxResources.get("error")+" "+a.getStatus()},a)}),function(a){null!=d&&d({message:mxResources.get("error")+" "+a.getStatus()})},c,this.timeout,function(){l&& null!=d&&d({code:App.ERROR_TIMEOUT,retry:e})})});e()}catch(F){null!=d&&d(F)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){try{var c=!0,d=window.setTimeout(mxUtils.bind(this,function(){c=!1;b(this.svgBrokenImage.src)}),this.timeout);if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){window.clearTimeout(d);c&&b(this.createSvgDataUri(a.getText()))}),function(){window.clearTimeout(d); c&&b(this.svgBrokenImage.src)});else{var e=new Image,f=this;this.crossOriginImages&&(e.crossOrigin="anonymous");e.onload=function(){window.clearTimeout(d);if(c)try{var a=document.createElement("canvas"),k=a.getContext("2d");a.height=e.height;a.width=e.width;k.drawImage(e,0,0);b(a.toDataURL())}catch(q){b(f.svgBrokenImage.src)}};e.onerror=function(){window.clearTimeout(d);c&&b(f.svgBrokenImage.src)};e.src=a}}catch(z){b(this.svgBrokenImage.src)}};EditorUi.prototype.importXml=function(a,b,d,f,l){b=null!= -b?b:0;d=null!=d?d:0;var c=[];try{var e=this.editor.graph;if(null!=a&&0<a.length){e.model.beginUpdate();try{var k=mxUtils.parseXml(a),n=this.editor.extractGraphModel(k.documentElement,null!=this.pages);if(null!=n&&"mxfile"==n.nodeName&&null!=this.pages){var t=n.getElementsByTagName("diagram");if(1==t.length)n=Editor.parseDiagramNode(t[0]);else if(1<t.length){a={};var k=[],m=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(n=Editor.parseDiagramNode(t[0]),f=!1,m=1);for(;m<t.length;m++){var p= -t[m].getAttribute("id");t[m].removeAttribute("id");var u=this.updatePageRoot(new DiagramPage(t[m]));a[p]=t[m].getAttribute("id");var v=this.pages.length;null==u.getName()&&u.setName(mxResources.get("pageWithNumber",[v+1]));e.model.execute(new ChangePage(this,u,u,v,!0));k.push(u)}this.updatePageLinks(a,k)}}null!=n&&"mxGraphModel"===n.nodeName&&(c=e.importGraphModel(n,b,d,f))}finally{e.model.endUpdate()}}}catch(K){if(l)throw K;this.handleError(K)}return c};EditorUi.prototype.updatePageLinks=function(a, +b?b:0;d=null!=d?d:0;var c=[];try{var e=this.editor.graph;if(null!=a&&0<a.length){e.model.beginUpdate();try{var k=mxUtils.parseXml(a),n=this.editor.extractGraphModel(k.documentElement,null!=this.pages);if(null!=n&&"mxfile"==n.nodeName&&null!=this.pages){var u=n.getElementsByTagName("diagram");if(1==u.length)n=Editor.parseDiagramNode(u[0]);else if(1<u.length){a={};var k=[],m=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(n=Editor.parseDiagramNode(u[0]),f=!1,m=1);for(;m<u.length;m++){var p= +u[m].getAttribute("id");u[m].removeAttribute("id");var t=this.updatePageRoot(new DiagramPage(u[m]));a[p]=u[m].getAttribute("id");var v=this.pages.length;null==t.getName()&&t.setName(mxResources.get("pageWithNumber",[v+1]));e.model.execute(new ChangePage(this,t,t,v,!0));k.push(t)}this.updatePageLinks(a,k)}}null!=n&&"mxGraphModel"===n.nodeName&&(c=e.importGraphModel(n,b,d,f))}finally{e.model.endUpdate()}}}catch(K){if(l)throw K;this.handleError(K)}return c};EditorUi.prototype.updatePageLinks=function(a, b){for(var c=0;c<b.length;c++)this.updatePageLinksForCell(a,b[c].root)};EditorUi.prototype.updatePageLinksForCell=function(a,b){var c=document.createElement("div"),d=this.editor.graph,e=d.getLinkForCell(b);null!=e&&d.setLinkForCell(b,this.updatePageLink(a,e));if(d.isHtmlLabel(b)){c.innerHTML=d.getLabel(b);for(var f=c.getElementsByTagName("a"),l=!1,m=0;m<f.length;m++)e=f[m].getAttribute("href"),null!=e&&(f[m].setAttribute("href",this.updatePageLink(a,e)),l=!0);l&&d.labelChanged(b,c.innerHTML)}for(m= 0;m<d.model.getChildCount(b);m++)this.updatePageLinksForCell(a,d.model.getChildAt(b,m))};EditorUi.prototype.updatePageLink=function(a,b){if("data:page/id,"==b.substring(0,13)){var c=a[b.substring(b.indexOf(",")+1)];b=null!=c?"data:page/id,"+c:null}else if("data:action/json,"==b.substring(0,17))try{var d=JSON.parse(b.substring(17));if(null!=d.actions){for(var e=0;e<d.actions.length;e++){var f=d.actions[e];null!=f.open&&"data:page/id,"==f.open.substring(0,13)&&(c=a[f.open.substring(f.open.indexOf(",")+ 1)],null!=c?f.open="data:page/id,"+c:delete f.open)}b="data:action/json,"+JSON.stringify(d)}}catch(z){}return b};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};EditorUi.prototype.importVisio=function(a,b,d,f){f=null!=f?f:a.name;d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio){var c=this.isRemoteVisioFormat(f);try{var e="UNKNOWN-VISIO", k=f.lastIndexOf(".");0<=k&&k<f.length&&(e=f.substring(k+1).toUpperCase());EditorUi.logEvent({category:e+"-MS-IMPORT-FILE",action:"filename_"+f,label:c?"remote":"local"})}catch(F){}if(c)if(null!=VSD_CONVERT_URL){c=new FormData;c.append("file1",a,f);var l=new XMLHttpRequest;l.open("POST",VSD_CONVERT_URL);l.responseType="blob";this.addRemoteServiceSecurityCheck(l);l.onreadystatechange=mxUtils.bind(this,function(){if(4==l.readyState)if(200<=l.status&&299>=l.status)try{var a=l.response;if("text/xml"== -a.type){var c=new FileReader;c.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(u){d({message:mxResources.get("errorLoadingFile")})}});c.readAsText(a)}else this.doImportVisio(a,b,d,f)}catch(E){d(E)}else d({})});l.send(c)}else d({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else try{this.doImportVisio(a,b,d,f)}catch(F){d(F)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}); +a.type){var c=new FileReader;c.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(t){d({message:mxResources.get("errorLoadingFile")})}});c.readAsText(a)}else this.doImportVisio(a,b,d,f)}catch(E){d(E)}else d({})});l.send(c)}else d({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else try{this.doImportVisio(a,b,d,f)}catch(F){d(F)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})}); this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?c():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",c))};EditorUi.prototype.importGraphML=function(a,b,d){d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(a,b,d)}catch(n){d(n)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportGraphML||this.loadingExtensions|| this.isOffline(!0)?c():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",c))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()||this.handleError({message:mxResources.get("unknownError")})}catch(e){this.handleError(e)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof VsdxExport|| this.loadingExtensions||this.isOffline(!0)?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,b,d){var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter){try{EditorUi.logEvent({category:"LUCIDCHART-IMPORT-FILE",action:"size_"+a.length})}catch(n){}try{b(LucidImporter.importState(JSON.parse(a)))}catch(n){d(n)}}else d({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!== @@ -3154,7 +3154,7 @@ this.status&&300>this.status)if("txt"==b)d(this.response);else{var c=new FileRea k.onerror=function(a){f(a)};k.send()};EditorUi.prototype.insertAsPreText=function(a,b,d){var c=this.editor.graph,e=null;c.getModel().beginUpdate();try{e=c.insertVertex(null,null,"<pre>"+a+"</pre>",b,d,1,1,"text;html=1;align=left;verticalAlign=top;"),c.updateCellSize(e,!0)}finally{c.getModel().endUpdate()}return e};EditorUi.prototype.insertTextAt=function(a,b,d,f,l,g,m){g=null!=g?g:!0;m=null!=m?m:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g, " ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(l||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=this.editor.graph;if("data:image/png;base64,"==a.substring(0,22)){var e=this.extractGraphModelFromPng(a),k=this.importXml(e,b,d,g,!0);if(0<k.length)return k}if("data:image/svg+xml;"==a.substring(0, 19))try{if(e=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(e=a.substring(a.indexOf(",")+1),e=window.atob&&!mxClient.IS_SF?atob(e):Base64.decode(e,!0)):e=decodeURIComponent(a.substring(a.indexOf(",")+1)),k=this.importXml(e,b,d,g,!0),0<k.length)return k}catch(x){}this.loadImage(a,mxUtils.bind(this,function(e){if("data:"==a.substring(0,5))this.resizeImage(e,a,mxUtils.bind(this,function(a,e,f){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+ -this.convertDataUri(a)+";"))}),m,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/e.height)),g=Math.round(e.width*f);e=Math.round(e.height*f);c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),g,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var e=null;c.getModel().beginUpdate();try{e=c.insertVertex(c.getDefaultParent(), +this.convertDataUri(a)+";"))}),m,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/e.height)),k=Math.round(e.width*f);e=Math.round(e.height*f);c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),k,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var e=null;c.getModel().beginUpdate();try{e=c.insertVertex(c.getDefaultParent(), null,a,c.snap(b),c.snap(d),1,1,"text;"+(f?"html=1;":"")),c.updateCellSize(e),c.fireEvent(new mxEventObject("textInserted","cells",[e]))}finally{c.getModel().endUpdate()}c.setSelectionCell(e)}))}else{a=Graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,d,g);if(0<a.length)if(this.isLucidChartData(a))this.convertLucidChart(a,mxUtils.bind(this,function(a){this.editor.graph.setSelectionCells(this.importXml(a,b,d,g))}),mxUtils.bind(this,function(a){this.handleError(a)})); else{c=this.editor.graph;l=null;c.getModel().beginUpdate();try{l=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),1,1,"text;"+(f?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[l])),"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a)),a.length>this.maxTextBytes&&(a=a.substring(0,this.maxTextBytes)+"..."),l.value=a,c.updateCellSize(l),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“â€â€˜â€™]))/i.test(l.value)&& c.setLinkForCell(l,l.value),l.geometry.width+=c.gridSize,l.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[l]}}return[]};EditorUi.prototype.formatFileSize=function(a){var c=-1;do a/=1024,c++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[c]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var c=a.indexOf(";");0<c&&(a=a.substring(0,c)+a.substring(a.indexOf(",",c+1)))}return a};EditorUi.prototype.isRemoteFileFormat= @@ -3167,19 +3167,19 @@ null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary( a+";")])):/(\.*<graphml )/.test(a)?(c=!0,this.importGraphML(a,k)):null!=q&&null!=m&&(/(\.v(dx|sdx?))($|\?)/i.test(m)||/(\.vs(x|sx?))($|\?)/i.test(m))?(c=!0,this.importVisio(q,k)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,m)?(c=!0,this.parseFile(null!=q?q:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?k(a.responseText):null!=p&&p(null))}),m)):0==a.indexOf("PK")&&null!=q?(c=!0,this.importZipFile(q, k,mxUtils.bind(this,function(){e=this.insertTextAt(this.validateFileData(a),d,f,!0,null,v);p(e)}))):/(\.v(sd|dx))($|\?)/i.test(m)||/(\.vs(s|x))($|\?)/i.test(m)||(e=this.insertTextAt(this.validateFileData(a),d,f,!0,null,v));c||null==p||p(e);return e};EditorUi.prototype.base64Encode=function(a){for(var c="",b=0,d=a.length,f,g,l;b<d;){f=a.charCodeAt(b++)&255;if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f& 3)<<4);c+="==";break}g=a.charCodeAt(b++);if(b==d){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(g&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);c+="=";break}l=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f& -3)<<4|(g&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(l&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(l&63)}return c};EditorUi.prototype.importFiles=function(a,b,d,f,l,g,m,p,q,v,x,y){b=null!=b?b:0;d=null!=d?d:0;f=null!=f?f:this.maxImageSize;v=null!=v?v:this.maxImageBytes;var c=null!=b&&null!=d,e=!0,k=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var n=x||this.resampleThreshold,t=0;t<a.length;t++)if("image/"==a[t].type.substring(0, -6)&&a[t].size>n){k=!0;break}var z=mxUtils.bind(this,function(){var k=this.editor.graph,n=k.gridSize;l=null!=l?l:mxUtils.bind(this,function(a,b,d,e,f,g,k,l,n){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,d,e,f,g,k,l,n,c,y)});g=null!=g?g:mxUtils.bind(this,function(a){k.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,u=q,t=[],z=mxUtils.bind(this,function(a, -c){t[a]=c;if(0==--u){this.spinner.stop();if(null!=p)p(t);else{var b=[];k.getModel().beginUpdate();try{for(var d=0;d<t.length;d++){var e=t[d]();null!=e&&(b=b.concat(e))}}finally{k.getModel().endUpdate()}}g(b)}}),A=0;A<q;A++)mxUtils.bind(this,function(c){var g=a[c];if(null!=g){var q=new FileReader;q.onload=mxUtils.bind(this,function(a){if(null==m||m(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var q=a.target.result,t=q.indexOf(","),u=decodeURIComponent(escape(atob(q.substring(t+ -1)))),p=mxUtils.parseXml(u),u=p.getElementsByTagName("svg");if(0<u.length){var u=u[0],D=y?null:u.getAttribute("content");null!=D&&"<"!=D.charAt(0)&&"%"!=D.charAt(0)&&(D=unescape(window.atob?atob(D):Base64.decode(D,!0)));null!=D&&"%"==D.charAt(0)&&(D=decodeURIComponent(D));null==D||"<mxfile "!==D.substring(0,8)&&"<mxGraphModel "!==D.substring(0,14)?z(c,mxUtils.bind(this,function(){try{if(q.substring(0,t+1),null!=p){var a=p.getElementsByTagName("svg");if(0<a.length){var e=a[0],m=e.getAttribute("width"), -u=e.getAttribute("height"),m=null!=m&&"%"!=m.charAt(m.length-1)?parseFloat(m):NaN,u=null!=u&&"%"!=u.charAt(u.length-1)?parseFloat(u):NaN,x=e.getAttribute("viewBox");if(null==x||0==x.length)e.setAttribute("viewBox","0 0 "+m+" "+u);else if(isNaN(m)||isNaN(u)){var z=x.split(" ");3<z.length&&(m=parseFloat(z[2]),u=parseFloat(z[3]))}q=this.createSvgDataUri(mxUtils.getXml(e));var v=Math.min(1,Math.min(f/Math.max(1,m)),f/Math.max(1,u)),D=l(q,g.type,b+c*n,d+c*n,Math.max(1,Math.round(m*v)),Math.max(1,Math.round(u* -v)),g.name);if(isNaN(m)||isNaN(u)){var A=new Image;A.onload=mxUtils.bind(this,function(){m=Math.max(1,A.width);u=Math.max(1,A.height);D[0].geometry.width=m;D[0].geometry.height=u;e.setAttribute("viewBox","0 0 "+m+" "+u);q=this.createSvgDataUri(mxUtils.getXml(e));var a=q.indexOf(";");0<a&&(q=q.substring(0,a)+q.substring(q.indexOf(",",a+1)));k.setCellStyles("image",q,[D[0]])});A.src=this.createSvgDataUri(mxUtils.getXml(e))}return D}}}catch(aa){}return null})):z(c,mxUtils.bind(this,function(){return l(D, -"text/xml",b+c*n,d+c*n,0,0,g.name)}))}else z(c,mxUtils.bind(this,function(){return null}))}else{u=!1;if("image/png"==g.type){var A=y?null:this.extractGraphModelFromPng(a.target.result);if(null!=A&&0<A.length){var P=new Image;P.src=a.target.result;z(c,mxUtils.bind(this,function(){return l(A,"text/xml",b+c*n,d+c*n,P.width,P.height,g.name)}));u=!0}}u||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"), -mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(k){this.resizeImage(k,a.target.result,mxUtils.bind(this,function(k,m,q){z(c,mxUtils.bind(this,function(){if(null!=k&&k.length<v){var u=e&&this.isResampleImage(a.target.result,x)?Math.min(1,Math.min(f/m,f/q)):1;return l(k,g.type,b+c*n,d+c*n,Math.round(m*u),Math.round(q*u),g.name)}this.handleError({message:mxResources.get("imageTooBig")}); -return null}))}),e,f,x)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else l(a.target.result,g.type,b+c*n,d+c*n,240,160,g.name,function(a){z(c,function(){return a})},g)});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||/(\.vs(x|sx?))($|\?)/i.test(g.name)?l(null,g.type,b+c*n,d+c*n,240,160,g.name,function(a){z(c,function(){return a})},g):"image"==g.type.substring(0,5)?q.readAsDataURL(g):q.readAsText(g)}})(A)});if(k){k=[];for(t=0;t<a.length;t++)k.push(a[t]); +3)<<4|(g&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(l&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(l&63)}return c};EditorUi.prototype.importFiles=function(a,b,d,f,l,g,m,p,q,v,x,y){b=null!=b?b:0;d=null!=d?d:0;f=null!=f?f:this.maxImageSize;v=null!=v?v:this.maxImageBytes;var c=null!=b&&null!=d,e=!0,k=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var n=x||this.resampleThreshold,u=0;u<a.length;u++)if("image/"==a[u].type.substring(0, +6)&&a[u].size>n){k=!0;break}var z=mxUtils.bind(this,function(){var k=this.editor.graph,n=k.gridSize;l=null!=l?l:mxUtils.bind(this,function(a,b,d,e,f,g,k,l,n){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,d,e,f,g,k,l,n,c,y)});g=null!=g?g:mxUtils.bind(this,function(a){k.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var q=a.length,u=q,t=[],z=mxUtils.bind(this,function(a, +c){t[a]=c;if(0==--u){this.spinner.stop();if(null!=p)p(t);else{var b=[];k.getModel().beginUpdate();try{for(var d=0;d<t.length;d++){var e=t[d]();null!=e&&(b=b.concat(e))}}finally{k.getModel().endUpdate()}}g(b)}}),A=0;A<q;A++)mxUtils.bind(this,function(c){var g=a[c];if(null!=g){var q=new FileReader;q.onload=mxUtils.bind(this,function(a){if(null==m||m(g))if("image/"==g.type.substring(0,6))if("image/svg"==g.type.substring(0,9)){var q=a.target.result,u=q.indexOf(","),t=decodeURIComponent(escape(atob(q.substring(u+ +1)))),p=mxUtils.parseXml(t),t=p.getElementsByTagName("svg");if(0<t.length){var t=t[0],D=y?null:t.getAttribute("content");null!=D&&"<"!=D.charAt(0)&&"%"!=D.charAt(0)&&(D=unescape(window.atob?atob(D):Base64.decode(D,!0)));null!=D&&"%"==D.charAt(0)&&(D=decodeURIComponent(D));null==D||"<mxfile "!==D.substring(0,8)&&"<mxGraphModel "!==D.substring(0,14)?z(c,mxUtils.bind(this,function(){try{if(q.substring(0,u+1),null!=p){var a=p.getElementsByTagName("svg");if(0<a.length){var e=a[0],m=e.getAttribute("width"), +t=e.getAttribute("height"),m=null!=m&&"%"!=m.charAt(m.length-1)?parseFloat(m):NaN,t=null!=t&&"%"!=t.charAt(t.length-1)?parseFloat(t):NaN,x=e.getAttribute("viewBox");if(null==x||0==x.length)e.setAttribute("viewBox","0 0 "+m+" "+t);else if(isNaN(m)||isNaN(t)){var z=x.split(" ");3<z.length&&(m=parseFloat(z[2]),t=parseFloat(z[3]))}q=this.createSvgDataUri(mxUtils.getXml(e));var v=Math.min(1,Math.min(f/Math.max(1,m)),f/Math.max(1,t)),D=l(q,g.type,b+c*n,d+c*n,Math.max(1,Math.round(m*v)),Math.max(1,Math.round(t* +v)),g.name);if(isNaN(m)||isNaN(t)){var A=new Image;A.onload=mxUtils.bind(this,function(){m=Math.max(1,A.width);t=Math.max(1,A.height);D[0].geometry.width=m;D[0].geometry.height=t;e.setAttribute("viewBox","0 0 "+m+" "+t);q=this.createSvgDataUri(mxUtils.getXml(e));var a=q.indexOf(";");0<a&&(q=q.substring(0,a)+q.substring(q.indexOf(",",a+1)));k.setCellStyles("image",q,[D[0]])});A.src=this.createSvgDataUri(mxUtils.getXml(e))}return D}}}catch(aa){}return null})):z(c,mxUtils.bind(this,function(){return l(D, +"text/xml",b+c*n,d+c*n,0,0,g.name)}))}else z(c,mxUtils.bind(this,function(){return null}))}else{t=!1;if("image/png"==g.type){var A=y?null:this.extractGraphModelFromPng(a.target.result);if(null!=A&&0<A.length){var P=new Image;P.src=a.target.result;z(c,mxUtils.bind(this,function(){return l(A,"text/xml",b+c*n,d+c*n,P.width,P.height,g.name)}));t=!0}}t||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"), +mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(k){this.resizeImage(k,a.target.result,mxUtils.bind(this,function(k,m,q){z(c,mxUtils.bind(this,function(){if(null!=k&&k.length<v){var t=e&&this.isResampleImage(a.target.result,x)?Math.min(1,Math.min(f/m,f/q)):1;return l(k,g.type,b+c*n,d+c*n,Math.round(m*t),Math.round(q*t),g.name)}this.handleError({message:mxResources.get("imageTooBig")}); +return null}))}),e,f,x)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else l(a.target.result,g.type,b+c*n,d+c*n,240,160,g.name,function(a){z(c,function(){return a})},g)});/(\.v(dx|sdx?))($|\?)/i.test(g.name)||/(\.vs(x|sx?))($|\?)/i.test(g.name)?l(null,g.type,b+c*n,d+c*n,240,160,g.name,function(a){z(c,function(){return a})},g):"image"==g.type.substring(0,5)?q.readAsDataURL(g):q.readAsText(g)}})(A)});if(k){k=[];for(u=0;u<a.length;u++)k.push(a[u]); a=k;this.confirmImageResize(function(a){e=a;z()},q)}else z()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?mxSettings.getResizeImages():null,e=function(d,e){if(d||b)mxSettings.setResizeImages(d?e:null),mxSettings.save();c();a(e)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a, !1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,d)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format","xml");c.append("upfile",a,d);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)}; -e.send(c);try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+a.size})}catch(g){}};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,f,l,g){l=null!=l?l:this.maxImageSize;var c=Math.max(1,a.width),e=Math.max(1,a.height);if(f&&this.isResampleImage(b,g))try{var k=Math.max(c/l,e/l);if(1<k){var n=Math.round(c/k),m=Math.round(e/k),t=document.createElement("canvas");t.width=n;t.height=m;t.getContext("2d").drawImage(a, -0,0,n,m);var u=t.toDataURL();if(u.length<b.length){var p=document.createElement("canvas");p.width=n;p.height=m;var v=p.toDataURL();u!==v&&(b=u,c=n,e=m)}}}catch(Y){}d(b,c,e)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var l=d,m=0;8>m;m++)l=1==(l&1)?3988292384^l>>>1:l>>>1,EditorUi.prototype.crcTable[d]=l;EditorUi.prototype.updateCRC=function(a,b,d,f){for(var c=0;c<f;c++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(d+c))&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable= +e.send(c);try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+a.size})}catch(g){}};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,f,l,g){l=null!=l?l:this.maxImageSize;var c=Math.max(1,a.width),e=Math.max(1,a.height);if(f&&this.isResampleImage(b,g))try{var k=Math.max(c/l,e/l);if(1<k){var n=Math.round(c/k),m=Math.round(e/k),u=document.createElement("canvas");u.width=n;u.height=m;u.getContext("2d").drawImage(a, +0,0,n,m);var t=u.toDataURL();if(t.length<b.length){var p=document.createElement("canvas");p.width=n;p.height=m;var v=p.toDataURL();t!==v&&(b=t,c=n,e=m)}}}catch(Y){}d(b,c,e)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var l=d,m=0;8>m;m++)l=1==(l&1)?3988292384^l>>>1:l>>>1,EditorUi.prototype.crcTable[d]=l;EditorUi.prototype.updateCRC=function(a,b,d,f){for(var c=0;c<f;c++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(d+c))&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable= this.crcTable||this.createCrcTable();for(var c=-1,b=0;b<a.length;b++)c=c>>>8^this.crcTable[(c^a.charCodeAt(b))&255];return(c^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,f,l){function c(a,c){var b=n;n+=c;return a.substring(b,n)}function e(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function k(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a, !0);var n=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=l&&l();else if(c(a,4),"IHDR"!=c(a,4))null!=l&&l();else{c(a,17);l=a.substring(0,n);do{var m=e(a);if("IDAT"==c(a,4)){l=a.substring(0,n-8);"pHYs"==b&&"dpi"==d?(d=Math.round(f/.0254),d=k(d)+k(d)+String.fromCharCode(1)):d=d+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+f;f=4294967295;f=this.updateCRC(f,b,0,4);f=this.updateCRC(f,d,0,d.length);l+=k(d.length)+b+d+k(f^4294967295);l+=a.substring(n-8, a.length);break}l+=a.substring(n-8,n-4+m);c(a,m);c(a,4)}while(m);return"data:image/png;base64,"+(window.btoa?btoa(l):Base64.encode(l,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){return Editor.extractGraphModelFromPng(a)};EditorUi.prototype.loadImage=function(a,b,d){try{var c=new Image;c.onload=function(){b(c)};null!=d&&(c.onerror=d);c.src=a}catch(n){if(null!=d)d(n);else throw n;}};var p=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&& @@ -3215,11 +3215,11 @@ function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClie "keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(a,b){mxSettings.setCustomFonts(this.menus.customFonts);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget()); mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor("dark"==uiTheme);this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){console.log("gridColorChanged",this.editor.graph.view.gridColor);mxSettings.setGridColor(this.editor.graph.view.gridColor,"dark"==uiTheme); mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(), -mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus(); -document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b,d){if(!mxEvent.isConsumed(a)){var c=b;d&&null!=a.clipboardData&&(c=document.createElement("div"),c.innerHTML=a.clipboardData.getData("text/html"));var e=c.getElementsByTagName("span");if(null!=e&&0<e.length&&"application/vnd.lucid.chart.objects"===e[0].getAttribute("data-lucid-type")){var f=e[0].getAttribute("data-lucid-content");null!=f&&0<f.length&&(this.convertLucidChart(f,mxUtils.bind(this,function(a){var b= -this.editor.graph;b.lastPasteXml==a?b.pasteCounter++:(b.lastPasteXml=a,b.pasteCounter=0);var c=b.pasteCounter*b.gridSize;b.setSelectionCells(this.importXml(a,c,c));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,function(a){this.handleError(a)})),mxEvent.consume(a))}else{var f=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(c):c.textContent),k=!1;try{var l=f.lastIndexOf("%3E");0<=l&&l<f.length-3&&(f=f.substring(0,l+3))}catch(x){}try{var e=c.getElementsByTagName("span"), -m=null!=e&&0<e.length?mxUtils.trim(decodeURIComponent(e[0].textContent)):decodeURIComponent(f);this.isCompatibleString(m)&&(k=!0,f=m)}catch(x){}if(null!=f&&0<f.length){var p=this.editor.graph;p.lastPasteXml==f?p.pasteCounter++:(p.lastPasteXml=f,p.pasteCounter=0);d=p.pasteCounter*p.gridSize;k||this.isCompatibleString(f)?p.setSelectionCells(this.importXml(f,d,d)):(k=p.getInsertPoint(),p.isMouseInsertPoint()&&(d=0,p.lastPasteXml==f&&0<p.pasteCounter&&p.pasteCounter--),p.setSelectionCells(this.insertTextAt(f, -k.x+d,k.y+d,!0)));if(!p.isSelectionEmpty()){p.scrollCellToVisible(p.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(p.view.getState(p.getSelectionCell()));try{mxEvent.consume(a)}catch(x){}}}else d||(p.lastPasteXml=null,p.pasteCounter=0)}}b.innerHTML=" "};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}), +mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(c.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll", +!1,null)}};EditorUi.prototype.pasteCells=function(a,b,d){if(!mxEvent.isConsumed(a)){var c=b;d&&null!=a.clipboardData&&(c=document.createElement("div"),c.innerHTML=a.clipboardData.getData("text/html"));var e=c.getElementsByTagName("span");if(null!=e&&0<e.length&&"application/vnd.lucid.chart.objects"===e[0].getAttribute("data-lucid-type")){var f=e[0].getAttribute("data-lucid-content");null!=f&&0<f.length&&(this.convertLucidChart(f,mxUtils.bind(this,function(a){var b=this.editor.graph;b.lastPasteXml== +a?b.pasteCounter++:(b.lastPasteXml=a,b.pasteCounter=0);var c=b.pasteCounter*b.gridSize;b.setSelectionCells(this.importXml(a,c,c));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,function(a){this.handleError(a)})),mxEvent.consume(a))}else{var f=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(c):c.textContent),k=!1;try{var l=f.lastIndexOf("%3E");0<=l&&l<f.length-3&&(f=f.substring(0,l+3))}catch(F){}try{var e=c.getElementsByTagName("span"),m=null!=e&&0< +e.length?mxUtils.trim(decodeURIComponent(e[0].textContent)):decodeURIComponent(f);this.isCompatibleString(m)&&(k=!0,f=m)}catch(F){}c=this.editor.graph;if(null!=f&&0<f.length){if(c.lastPasteXml==f?c.pasteCounter++:(c.lastPasteXml=f,c.pasteCounter=0),d=c.pasteCounter*c.gridSize,k||this.isCompatibleString(f)?c.setSelectionCells(this.importXml(f,d,d)):(k=c.getInsertPoint(),c.isMouseInsertPoint()&&(d=0,c.lastPasteXml==f&&0<c.pasteCounter&&c.pasteCounter--),c.setSelectionCells(this.insertTextAt(f,k.x+d, +k.y+d,!0))),!c.isSelectionEmpty()){c.scrollCellToVisible(c.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(c.view.getState(c.getSelectionCell()));try{mxEvent.consume(a)}catch(F){}}}else d||(c.lastPasteXml=null,c.pasteCounter=0)}}b.innerHTML=" "};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}), mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed? this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")? d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this, @@ -3246,12 +3246,12 @@ g.button);null!=g.modified&&(this.editor.modified=g.modified);return}if("prompt" "*")}):null);this.showDialog(k.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{k.init()}catch(P){l.postMessage(JSON.stringify({event:"draft",error:P.toString(),message:g}),"*")}return}if("template"==g.action){this.spinner.stop();var k=1==g.enableRecent,m=1==g.enableSearch,n=1==g.enableCustomTemp,k=new NewDialog(this,!1,null!=g.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=g.callback?l.postMessage(JSON.stringify({event:"template", xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,e,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,k?mxUtils.bind(this,function(a){this.remoteInvoke("getRecentDiagrams",null,null,a,function(){a(null,"Network Error!")})}):null,m?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):null,mxUtils.bind(this,function(a,b,c){l.postMessage(JSON.stringify({event:"template", docUrl:a,info:b,name:c}),"*")}),null,null,n?mxUtils.bind(this,function(a){this.remoteInvoke("getCustomTemplates",null,null,a,function(){a({},0)})}):null);this.showDialog(k.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));k.init();return}if("textContent"==g.action){k=this.getDiagramTextContent();l.postMessage(JSON.stringify({event:"textContent",data:k,message:g}),"*");return}if("status"==g.action){null!=g.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(g.messageKey))): -null!=g.message&&this.editor.setStatus(mxUtils.htmlEntities(g.message));null!=g.modified&&(this.editor.modified=g.modified);return}if("spinner"==g.action){var p=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||g.show?this.spinner.spin(document.body,p):this.spinner.stop();return}if("export"==g.action){if("png"==g.format||"xmlpng"==g.format){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var t=null!=g.xml? -g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var v=this.editor.graph,z=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=g.format;b.message=g;b.data=a;b.xml=encodeURIComponent(t);l.postMessage(JSON.stringify(b),"*")}),y=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==g.format&&(a=this.writeGraphModelToPng(a,"tEXt","mxfile",encodeURIComponent(t)));v!=this.editor.graph&&v.container.parentNode.removeChild(v.container); +null!=g.message&&this.editor.setStatus(mxUtils.htmlEntities(g.message));null!=g.modified&&(this.editor.modified=g.modified);return}if("spinner"==g.action){var p=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||g.show?this.spinner.spin(document.body,p):this.spinner.stop();return}if("export"==g.action){if("png"==g.format||"xmlpng"==g.format){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var u=null!=g.xml? +g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var v=this.editor.graph,z=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=g.format;b.message=g;b.data=a;b.xml=encodeURIComponent(u);l.postMessage(JSON.stringify(b),"*")}),y=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==g.format&&(a=this.writeGraphModelToPng(a,"tEXt","mxfile",encodeURIComponent(u)));v!=this.editor.graph&&v.container.parentNode.removeChild(v.container); z(a)}),m=g.pageId||(null!=this.pages?this.pages[0].getId():null);if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage.getId()!=m){for(var A=v.getGlobalVariable,v=this.createTemporaryGraph(v.getStylesheet()),D,k=0;k<this.pages.length;k++)if(this.pages[k].getId()==m){D=this.updatePageRoot(this.pages[k]);break}v.getGlobalVariable=function(a){return"page"==a?D.getName():"pagenumber"==a?1:A.apply(this,arguments)};document.body.appendChild(v.container);v.model.setRoot(D.root)}if(null!=g.layerIds){for(var m= v.model,n=m.getChildCells(m.getRoot()),B={},k=0;k<g.layerIds.length;k++)B[g.layerIds[k]]=!0;for(k=0;k<n.length;k++)m.setVisible(n[k],B[n[k].id]||!1)}this.exportToCanvas(mxUtils.bind(this,function(a){y(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){y(null)}),null,null,g.scale,null,null,null,v)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==g.format?"1":"0")+(null!=m?"&pageId="+m:"")+(null!=g.layerIds?"&extras="+encodeURIComponent(JSON.stringify({layerIds:g.layerIds})): -"")+(null!=g.scale?"&scale="+g.scale:"")+"&base64=1&xml="+encodeURIComponent(t))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?z("data:image/png;base64,"+a.getText()):y(null)}),mxUtils.bind(this,function(){y(null)}))}}else{null!=g.xml&&0<g.xml.length&&this.setFileData(g.xml);p=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),p.xml=mxUtils.getXml(k),p.data=this.getFileData(null, -null,!0,null,null,null,k),p.format=g.format;else if("html"==g.format)t=this.editor.getGraphXml(),p.data=this.getHtml(t,this.editor.graph),p.xml=mxUtils.getXml(t),p.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);p.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);p.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey): +"")+(null!=g.scale?"&scale="+g.scale:"")+"&base64=1&xml="+encodeURIComponent(u))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?z("data:image/png;base64,"+a.getText()):y(null)}),mxUtils.bind(this,function(){y(null)}))}}else{null!=g.xml&&0<g.xml.length&&this.setFileData(g.xml);p=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))k=this.getXmlFileData(),p.xml=mxUtils.getXml(k),p.data=this.getFileData(null, +null,!0,null,null,null,k),p.format=g.format;else if("html"==g.format)u=this.editor.getGraphXml(),p.data=this.getHtml(u,this.editor.graph),p.xml=mxUtils.getXml(u),p.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;k=this.editor.graph.background;k==mxConstants.NONE&&(k=null);p.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);p.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey): g.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==g.format?this.getEmbeddedSvg(p.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(a);l.postMessage(JSON.stringify(p),"*")})):this.convertImages(this.editor.graph.getSvg(k),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(mxUtils.getXml(a));l.postMessage(JSON.stringify(p),"*")}));return}k="xmlsvg"== g.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(k));p.data=this.createSvgDataUri(k)}l.postMessage(JSON.stringify(p),"*")}return}if("load"==g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(m=document.createElement("span"),mxUtils.write(m, g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="6px",this.buttonContainer.style.right="25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(m),this.embedFilenameSpan=m),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):g.xml;else{"remoteInvokeReady"== @@ -3264,14 +3264,14 @@ a.style.paddingTop="atlas"==uiTheme?"2px":"0px";a.style.paddingLeft="8px";a.styl " ("+Editor.ctrlKey+"+S)"),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()})),a.appendChild(b),"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b)));b=document.createElement("a"); mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.className="geBigButton geBigStandardButton";b.style.marginLeft="6px";b.style.marginRight="20px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog= new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://about.draw.io/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.executeLayoutList=function(a,b){for(var c=this.editor.graph,d=c.getSelectionCells(),e=0;e<a.length;e++){var f=new window[a[e].layout](c); -if(null!=a[e].config)for(var l in a[e].config)f[l]=a[e].config[l];this.executeLayout(function(){f.execute(c.getDefaultParent(),0==d.length?null:d)},e==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],e=[],f={};if(0<c.length){var l={},m=null,p=null,v=null,x=null,y=null,u=null,B=null,K=null,Y="",H="auto",Q="auto",D=null,L=null,O=40,P=40,ba=100,W=0,G=this.editor.graph;G.getGraphBounds();for(var Z=function(){null!=b?b(fa):(G.setSelectionCells(fa),G.scrollCellToVisible(G.getSelectionCell()))}, +if(null!=a[e].config)for(var l in a[e].config)f[l]=a[e].config[l];this.executeLayout(function(){f.execute(c.getDefaultParent(),0==d.length?null:d)},e==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],e=[],f={};if(0<c.length){var l={},m=null,p=null,v=null,x=null,y=null,t=null,B=null,K=null,Y="",H="auto",Q="auto",D=null,L=null,O=40,P=40,ba=100,W=0,G=this.editor.graph;G.getGraphBounds();for(var Z=function(){null!=b?b(fa):(G.setSelectionCells(fa),G.scrollCellToVisible(G.getSelectionCell()))}, na=G.getFreeInsertPoint(),ja=na.x,ca=na.y,na=ca,ka=null,S="auto",K=null,V=[],pa=null,ga=null,R=0;R<c.length&&"#"==c[R].charAt(0);){a=c[R];for(R++;R<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[R].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[R].substring(1)),R++;if("#"!=a.charAt(1)){var la=a.indexOf(":");if(0<la){var M=mxUtils.trim(a.substring(1,la)),I=mxUtils.trim(a.substring(la+1));"label"==M?ka=G.sanitizeHtml(I):"labelname"==M&&0<I.length&&"-"!=I?x=I:"labels"==M&&0<I.length&&"-"!=I?y=JSON.parse(I): -"style"==M?m=I:"parentstyle"==M?u=I:"stylename"==M&&0<I.length&&"-"!=I?v=I:"styles"==M&&0<I.length&&"-"!=I?p=JSON.parse(I):"identity"==M&&0<I.length&&"-"!=I?B=I:"parent"==M&&0<I.length&&"-"!=I?K=I:"namespace"==M&&0<I.length&&"-"!=I?Y=I:"width"==M?H=I:"height"==M?Q=I:"left"==M&&0<I.length?D=I:"top"==M&&0<I.length?L=I:"ignore"==M?ga=I.split(","):"connect"==M?V.push(JSON.parse(I)):"link"==M?pa=I:"padding"==M?W=parseFloat(I):"edgespacing"==M?O=parseFloat(I):"nodespacing"==M?P=parseFloat(I):"levelspacing"== +"style"==M?m=I:"parentstyle"==M?t=I:"stylename"==M&&0<I.length&&"-"!=I?v=I:"styles"==M&&0<I.length&&"-"!=I?p=JSON.parse(I):"identity"==M&&0<I.length&&"-"!=I?B=I:"parent"==M&&0<I.length&&"-"!=I?K=I:"namespace"==M&&0<I.length&&"-"!=I?Y=I:"width"==M?H=I:"height"==M?Q=I:"left"==M&&0<I.length?D=I:"top"==M&&0<I.length?L=I:"ignore"==M?ga=I.split(","):"connect"==M?V.push(JSON.parse(I)):"link"==M?pa=I:"padding"==M?W=parseFloat(I):"edgespacing"==M?O=parseFloat(I):"nodespacing"==M?P=parseFloat(I):"levelspacing"== M?ba=parseFloat(I):"layout"==M&&(S=I)}}}if(null==c[R])throw Error(mxResources.get("invalidOrMissingFile"));var ea=this.editor.csvToArray(c[R]),M=la=null;if(null!=B||null!=K)for(var N=0;N<ea.length;N++)B==ea[N]&&(la=N),K==ea[N]&&(M=N);null==ka&&(ka="%"+ea[0]+"%");if(null!=V)for(var T=0;T<V.length;T++)null==l[V[T].to]&&(l[V[T].to]={});G.model.beginUpdate();try{for(N=R+1;N<c.length;N++){var ha=this.editor.csvToArray(c[N]);if(null==ha){var ia=40<c[N].length?c[N].substring(0,40)+"...":c[N];throw Error(N+ " ("+ia+") "+mxResources.get("containsValidationErrors"));}if(ha.length==ea.length){var J=null,qa=null!=la?Y+ha[la]:null;null!=qa&&(J=G.model.getCell(qa));var B=null!=J,aa=new mxCell(ka,new mxGeometry(ja,na,0,0),m||"whiteSpace=wrap;html=1;");aa.vertex=!0;aa.id=qa;for(var da=0;da<ha.length;da++)G.setAttributeForCell(aa,ea[da],ha[da]);if(null!=x&&null!=y){var Aa=y[aa.getAttribute(x)];null!=Aa&&G.labelChanged(aa,Aa)}if(null!=v&&null!=p){var wa=p[aa.getAttribute(v)];null!=wa&&(aa.style=wa)}G.setAttributeForCell(aa, "placeholders","1");aa.style=G.replacePlaceholders(aa,aa.style);B&&(G.model.setGeometry(J,aa.geometry),G.model.setStyle(J,aa.style),0>mxUtils.indexOf(e,J)&&e.push(J));J=aa;if(!B)for(T=0;T<V.length;T++)l[V[T].to][J.getAttribute(V[T].to)]=J;null!=pa&&"link"!=pa&&(G.setLinkForCell(J,J.getAttribute(pa)),G.setAttributeForCell(J,pa,null));G.fireEvent(new mxEventObject("cellsInserted","cells",[J]));var za=this.editor.graph.getPreferredSizeForCell(J);J.vertex&&(null!=D&&null!=J.getAttribute(D)&&(J.geometry.x= ja+parseFloat(J.getAttribute(D))),null!=L&&null!=J.getAttribute(L)&&(J.geometry.y=ca+parseFloat(J.getAttribute(L))),"@"==H.charAt(0)&&null!=J.getAttribute(H.substring(1))?J.geometry.width=parseFloat(J.getAttribute(H.substring(1))):J.geometry.width="auto"==H?za.width+W:parseFloat(H),"@"==Q.charAt(0)&&null!=J.getAttribute(Q.substring(1))?J.geometry.height=parseFloat(J.getAttribute(Q.substring(1))):J.geometry.height="auto"==Q?za.height+W:parseFloat(Q),na+=J.geometry.height+P);B?(null==f[qa]&&(f[qa]= -[]),f[qa].push(J)):(K=null!=M?G.model.getCell(Y+ha[M]):null,d.push(J),null!=K?(K.style=G.replacePlaceholders(K,u),G.addCell(J,K)):e.push(G.addCell(J)))}}for(var ma=e.slice(),fa=e.slice(),T=0;T<V.length;T++)for(var sa=V[T],N=0;N<e.length;N++){var J=e[N],Ea=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d){G.setAttributeForCell(b,c.from,null);for(var d=d.split(","),e=0;e<d.length;e++){var f=l[c.to][d[e]];if(null!=f){var g=c.label;null!=c.fromlabel&&(g=(b.getAttribute(c.fromlabel)|| +[]),f[qa].push(J)):(K=null!=M?G.model.getCell(Y+ha[M]):null,d.push(J),null!=K?(K.style=G.replacePlaceholders(K,t),G.addCell(J,K)):e.push(G.addCell(J)))}}for(var ma=e.slice(),fa=e.slice(),T=0;T<V.length;T++)for(var sa=V[T],N=0;N<e.length;N++){var J=e[N],Ea=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d){G.setAttributeForCell(b,c.from,null);for(var d=d.split(","),e=0;e<d.length;e++){var f=l[c.to][d[e]];if(null!=f){var g=c.label;null!=c.fromlabel&&(g=(b.getAttribute(c.fromlabel)|| "")+(g||""));null!=c.tolabel&&(g=(g||"")+(f.getAttribute(c.tolabel)||""));fa.push(G.insertEdge(null,null,g||"",c.invert?f:a,c.invert?a:f,c.style||G.createCurrentEdgeStyle()));mxUtils.remove(c.invert?a:f,ma)}}}});Ea(J,J,sa);if(null!=f[J.id])for(da=0;da<f[J.id].length;da++)Ea(J,f[J.id][da],sa)}if(null!=ga)for(N=0;N<d.length;N++)for(J=d[N],da=0;da<ga.length;da++)G.setAttributeForCell(J,mxUtils.trim(ga[da]),null);if(0<e.length){var ta=new mxParallelEdgeLayout(G);ta.spacing=O;var oa=function(){0<ta.spacing&& ta.execute(G.getDefaultParent());for(var a=0;a<e.length;a++){var b=G.getCellGeometry(e[a]);b.x=Math.round(G.snap(b.x));b.y=Math.round(G.snap(b.y));"auto"==H&&(b.width=Math.round(G.snap(b.width)));"auto"==Q&&(b.height=Math.round(G.snap(b.height)))}};if("["==S.charAt(0)){var Ka=Z;G.view.validate();this.executeLayoutList(JSON.parse(S),function(){oa();Ka()});Z=null}else if("circle"==S){var Ba=new mxCircleLayout(G);Ba.resetEdges=!1;var La=Ba.isVertexIgnored;Ba.isVertexIgnored=function(a){return La.apply(this, arguments)||0>mxUtils.indexOf(e,a)};this.executeLayout(function(){Ba.execute(G.getDefaultParent());oa()},!0,Z);Z=null}else if("horizontaltree"==S||"verticaltree"==S||"auto"==S&&fa.length==2*e.length-1&&1==ma.length){G.view.validate();var Ca=new mxCompactTreeLayout(G,"horizontaltree"==S);Ca.levelDistance=P;Ca.edgeRouting=!1;Ca.resetEdges=!1;this.executeLayout(function(){Ca.execute(G.getDefaultParent(),0<ma.length?ma[0]:null)},!0,Z);Z=null}else if("horizontalflow"==S||"verticalflow"==S||"auto"==S&& @@ -3295,7 +3295,7 @@ this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionP d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("publishLink").setEnabled(null!=d&&!d.isRestricted());this.actions.get("tags").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("find").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility); this.actions.get("rename").setEnabled(null!=d&&d.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=d);this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var B=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.editUpdateListener&&(this.editor.undoManager.removeListener(this.editUpdateListener),this.editUpdateListener= null);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);B.apply(this,arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,f,l,g,m){var c=a.editor.graph;if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(f,l,g)),"image/svg+xml");else{var e= -a.getFileData(!0,null,null,null,null,!0),k=c.getGraphBounds(),n=Math.floor(k.width*l/c.view.scale),p=Math.floor(k.height*l/c.view.scale);if(e.length<=MAX_REQUEST_SIZE&&n*p<MAX_AREA)if(a.hideDialog(),"png"!=d&&"jpg"!=d&&"jpeg"!=d||!a.isExportToCanvas()){var u={globalVars:c.getExportVariables()};a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(u))+(0<m?"&dpi="+ +a.getFileData(!0,null,null,null,null,!0),k=c.getGraphBounds(),n=Math.floor(k.width*l/c.view.scale),p=Math.floor(k.height*l/c.view.scale);if(e.length<=MAX_REQUEST_SIZE&&n*p<MAX_AREA)if(a.hideDialog(),"png"!=d&&"jpg"!=d&&"jpeg"!=d||!a.isExportToCanvas()){var t={globalVars:c.getExportVariables()};a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(t))+(0<m?"&dpi="+ m:"")+"&bg="+(null!=f?f:"none")+"&w="+n+"&h="+p+"&border="+g+"&xml="+encodeURIComponent(e))})}else"png"==d?a.exportImage(l,null==f||"none"==f,!0,!1,!1,g,!0,!1,null,null,m):a.exportImage(l,!1,!0,!1,!1,g,!0,!1,"jpeg");else mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.updateEditReferences=function(a){for(var b=0;b<a.changes.length;b++){var c=a.changes[b];if(null!=c&&c.constructor==mxChildChange&&null!=c.child){var d=c.child;if(null!=d.source&&null!=d.source.id){var f=this.getFutureCellForEdit(c.model, a,d.source.id);f!=d.source&&(d.source=f)}null!=d.target&&null!=d.target.id&&(c=this.getFutureCellForEdit(c.model,a,d.target.id),c!=d.target&&(d.target=c))}}};EditorUi.prototype.getFutureCellForEdit=function(a,b,d){var c=a.getCell(d);if(null==c)for(var e=b.changes.length-1;0<=e;e--){var f=b.changes[e];if(f.constructor==mxChildChange&&null!=f.child&&f.child.id==d){a.contains(f.previous)&&(c=f.child);break}}return c};EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1); var a=this.editor.graph,b="";if(null!=this.pages)for(var d=0;d<this.pages.length;d++){var f=a;this.currentPage!=this.pages[d]&&(f=this.createTemporaryGraph(a.getStylesheet()),f.model.setRoot(this.pages[d].root));b+=this.pages[d].getName()+" "+f.getIndexableText()+" "}else b=a.getIndexableText();this.editor.graph.setEnabled(!0);return b};EditorUi.prototype.showRemotelyStoredLibrary=function(a){var b={},c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d, @@ -3311,30 +3311,30 @@ this.getCurrentFile();return null!=a?a.commentsRefreshNeeded():!0};EditorUi.prot a.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var a=this.getCurrentFile();return null!=a?a.canComment():!0};EditorUi.prototype.newComment=function(a,b){var c=this.getCurrentFile();return null!=c?c.newComment(a,b):new DrawioComment(this,null,a,Date.now(),Date.now(),!1,b)};EditorUi.prototype.isRevisionHistorySupported=function(){var a=this.getCurrentFile();return null!=a&&a.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(a,b){var c=this.getCurrentFile();null!= c&&c.getRevisions?c.getRevisions(a,b):b({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var a=this.getCurrentFile();return null!=a&&(a.constructor==DriveFile&&a.isEditable()||a.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(a){a.setRequestHeader("Content-Language","da, mi, en, de-DE")}})(); var CommentsWindow=function(a,b,f,d,l,m){function p(){for(var a=q.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==q&&b++;F.style.display=0==b?"block":"none"}function v(a,b,c,d){function e(){b.removeChild(l);b.removeChild(m);k.style.display="block";f.style.display="block"}g={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),k=b.querySelector(".geCommentActionsList"),l=document.createElement("textarea");l.className= -"geCommentEditTxtArea";l.style.minHeight=f.offsetHeight+"px";l.value=a.content;b.insertBefore(l,f);var m=document.createElement("div");m.className="geCommentEditBtns";var n=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),p()):e();g=null});n.className="geCommentEditBtn";m.appendChild(n);var u=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=l.value;mxUtils.write(f,a.content);e();c(a);g=null});mxEvent.addListener(l,"keydown",mxUtils.bind(this, -function(a){mxEvent.isConsumed(a)||((mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a))&&13==a.keyCode?(u.click(),mxEvent.consume(a)):27==a.keyCode&&(n.click(),mxEvent.consume(a)))}));u.focus();u.className="geCommentEditBtn gePrimaryBtn";m.appendChild(u);b.insertBefore(m,f);k.style.display="none";f.style.display="none";l.focus()}function y(b,c){c.innerHTML="";var d=new Date(b.modifiedDate),e=a.timeSince(d);null==e&&(e=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo", +"geCommentEditTxtArea";l.style.minHeight=f.offsetHeight+"px";l.value=a.content;b.insertBefore(l,f);var m=document.createElement("div");m.className="geCommentEditBtns";var n=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),p()):e();g=null});n.className="geCommentEditBtn";m.appendChild(n);var t=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=l.value;mxUtils.write(f,a.content);e();c(a);g=null});mxEvent.addListener(l,"keydown",mxUtils.bind(this, +function(a){mxEvent.isConsumed(a)||((mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a))&&13==a.keyCode?(t.click(),mxEvent.consume(a)):27==a.keyCode&&(n.click(),mxEvent.consume(a)))}));t.focus();t.className="geCommentEditBtn gePrimaryBtn";m.appendChild(t);b.insertBefore(m,f);k.style.display="none";f.style.display="none";l.focus()}function y(b,c){c.innerHTML="";var d=new Date(b.modifiedDate),e=a.timeSince(d);null==e&&(e=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo", [e],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function B(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function c(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function e(a){a.style.border="";a.removeChild(a.busyImg)}function k(b,d,f,l,m){function x(a,c,d){var e=document.createElement("li");e.className="geCommentAction";var f=document.createElement("a");f.className= -"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});O.appendChild(e);d&&(e.style.display="none")}function D(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=A;a(b);return{pdiv:d,replies:c}}function z(d,f,g,m,p){function n(){B(t);b.addReply(x,function(a){x.id=a;b.replies.push(x);e(t);g&&g()},function(b){u();c(t);a.handleError(b,null, -null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},m,p)}function u(){v(x,t,function(a){n()},!0)}var q=D().pdiv,x=a.newComment(d,a.getCurrentUser());x.pCommentId=b.id;null==b.replies&&(b.replies=[]);var t=k(x,b.replies,q,l+1);f?u():n()}if(m||!b.isResolved){F.style.display="none";var A=document.createElement("div");A.className="geCommentContainer";A.setAttribute("data-commentId",b.id);A.style.marginLeft=20*l+5+"px";b.isResolved&&"dark"!=uiTheme&&(A.style.backgroundColor="ghostWhite"); -var E=document.createElement("div");E.className="geCommentHeader";var C=document.createElement("img");C.className="geCommentUserImg";C.src=b.user.pictureUrl||Editor.userImage;E.appendChild(C);C=document.createElement("div");C.className="geCommentHeaderTxt";E.appendChild(C);var L=document.createElement("div");L.className="geCommentUsername";mxUtils.write(L,b.user.displayName||"");C.appendChild(L);L=document.createElement("div");L.className="geCommentDate";L.setAttribute("data-commentId",b.id);y(b, -L);C.appendChild(L);A.appendChild(E);E=document.createElement("div");E.className="geCommentTxt";mxUtils.write(E,b.content||"");A.appendChild(E);E=document.createElement("div");E.className="geCommentActions";var O=document.createElement("ul");O.className="geCommentActionsList";E.appendChild(O);t||0!=l&&!n||x(mxResources.get("reply"),function(){z("",!0)},b.isResolved);C=a.getCurrentUser();null==C||C.id!=b.user.id||t||(x(mxResources.get("edit"),function(){function d(){v(b,A,function(){B(A);b.editComment(b.content, +"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});O.appendChild(e);d&&(e.style.display="none")}function D(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=A;a(b);return{pdiv:d,replies:c}}function z(d,f,g,m,n){function p(){B(u);b.addReply(x,function(a){x.id=a;b.replies.push(x);e(u);g&&g()},function(b){t();c(u);a.handleError(b,null, +null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},m,n)}function t(){v(x,u,function(a){p()},!0)}var q=D().pdiv,x=a.newComment(d,a.getCurrentUser());x.pCommentId=b.id;null==b.replies&&(b.replies=[]);var u=k(x,b.replies,q,l+1);f?t():p()}if(m||!b.isResolved){F.style.display="none";var A=document.createElement("div");A.className="geCommentContainer";A.setAttribute("data-commentId",b.id);A.style.marginLeft=20*l+5+"px";b.isResolved&&"dark"!=uiTheme&&(A.style.backgroundColor="ghostWhite"); +var C=document.createElement("div");C.className="geCommentHeader";var E=document.createElement("img");E.className="geCommentUserImg";E.src=b.user.pictureUrl||Editor.userImage;C.appendChild(E);E=document.createElement("div");E.className="geCommentHeaderTxt";C.appendChild(E);var L=document.createElement("div");L.className="geCommentUsername";mxUtils.write(L,b.user.displayName||"");E.appendChild(L);L=document.createElement("div");L.className="geCommentDate";L.setAttribute("data-commentId",b.id);y(b, +L);E.appendChild(L);A.appendChild(C);C=document.createElement("div");C.className="geCommentTxt";mxUtils.write(C,b.content||"");A.appendChild(C);C=document.createElement("div");C.className="geCommentActions";var O=document.createElement("ul");O.className="geCommentActionsList";C.appendChild(O);u||0!=l&&!n||x(mxResources.get("reply"),function(){z("",!0)},b.isResolved);E=a.getCurrentUser();null==E||E.id!=b.user.id||u||(x(mxResources.get("edit"),function(){function d(){v(b,A,function(){B(A);b.editComment(b.content, function(){e(A)},function(b){c(A);d();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}d()},b.isResolved),x(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){B(A);b.deleteComment(function(){for(var a=D(b).replies,c=0;c<a.length;c++)q.removeChild(a[c]);for(c=0;c<d.length;c++)if(d[c]==b){d.splice(c,1);break}F.style.display=0==q.getElementsByTagName("div").length?"block":"none"},function(b){c(A);a.handleError(b,null,null, -null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));t||0!=l||x(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=a.target;c.innerHTML="";b.isResolved=!b.isResolved;mxUtils.write(c,b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var d=b.isResolved?"none":"",e=D(b).replies,f="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",g=0;g<e.length;g++){e[g].style.backgroundColor=f;for(var k=e[g].querySelectorAll(".geCommentAction"), -l=0;l<k.length;l++)k[l]!=c.parentNode&&(k[l].style.display=d);u||(e[g].style.display="none")}p()}b.isResolved?z(mxResources.get("reOpened")+": ",!0,c,!1,!0):z(mxResources.get("markedAsResolved"),!1,c,!0)});A.appendChild(E);null!=f?q.insertBefore(A,f.nextSibling):q.appendChild(A);for(f=0;null!=b.replies&&f<b.replies.length;f++)E=b.replies[f],E.isResolved=b.isResolved,k(E,b.replies,null,l+1,m);null!=g&&(g.comment.id==b.id?(m=b.content,b.content=g.comment.content,v(b,A,g.saveCallback,g.deleteOnCancel), -b.content=m):null==g.comment.id&&g.comment.pCommentId==b.id&&(q.appendChild(g.div),v(g.comment,g.div,g.saveCallback,g.deleteOnCancel)));return A}}var t=!a.canComment(),n=a.canReplyToReplies(),g=null,z=document.createElement("div");z.className="geCommentsWin";z.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;var A=EditorUi.compactUi?"26px":"30px",q=document.createElement("div");q.className="geCommentsList";q.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke": +null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));u||0!=l||x(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=a.target;c.innerHTML="";b.isResolved=!b.isResolved;mxUtils.write(c,b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var d=b.isResolved?"none":"",e=D(b).replies,f="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",g=0;g<e.length;g++){e[g].style.backgroundColor=f;for(var k=e[g].querySelectorAll(".geCommentAction"), +l=0;l<k.length;l++)k[l]!=c.parentNode&&(k[l].style.display=d);t||(e[g].style.display="none")}p()}b.isResolved?z(mxResources.get("reOpened")+": ",!0,c,!1,!0):z(mxResources.get("markedAsResolved"),!1,c,!0)});A.appendChild(C);null!=f?q.insertBefore(A,f.nextSibling):q.appendChild(A);for(f=0;null!=b.replies&&f<b.replies.length;f++)C=b.replies[f],C.isResolved=b.isResolved,k(C,b.replies,null,l+1,m);null!=g&&(g.comment.id==b.id?(m=b.content,b.content=g.comment.content,v(b,A,g.saveCallback,g.deleteOnCancel), +b.content=m):null==g.comment.id&&g.comment.pCommentId==b.id&&(q.appendChild(g.div),v(g.comment,g.div,g.saveCallback,g.deleteOnCancel)));return A}}var u=!a.canComment(),n=a.canReplyToReplies(),g=null,z=document.createElement("div");z.className="geCommentsWin";z.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;var A=EditorUi.compactUi?"26px":"30px",q=document.createElement("div");q.className="geCommentsList";q.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke": Dialog.backdropColor;q.style.bottom=parseInt(A)+7+"px";z.appendChild(q);var F=document.createElement("span");F.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(F,mxResources.get("noCommentsFound"));var x=document.createElement("div");x.className="geToolbarContainer geCommentsToolbar";x.style.height=A;x.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";x.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;mxClient.IS_QUIRKS&&(x.style.filter= -"none");A=document.createElement("a");A.className="geButton";mxClient.IS_QUIRKS&&(A.style.filter="none");if(!t){var E=A.cloneNode();E.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';E.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(E,"click",function(b){function d(){v(f,g,function(b){B(g);a.addComment(b,function(a){b.id=a;C.push(b);e(g)},function(b){c(g);d();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})}, -!0)}var f=a.newComment("",a.getCurrentUser()),g=k(f,C,null,0);d();b.preventDefault();mxEvent.consume(b)});x.appendChild(E)}E=A.cloneNode();E.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';E.setAttribute("title",mxResources.get("showResolved"));var u=!1;"dark"==uiTheme&&(E.style.filter="invert(100%)");mxEvent.addListener(E,"click",function(a){this.className=(u=!u)?"geButton geCheckedBtn":"geButton";K();a.preventDefault();mxEvent.consume(a)});x.appendChild(E);a.commentsRefreshNeeded()&& +"none");A=document.createElement("a");A.className="geButton";mxClient.IS_QUIRKS&&(A.style.filter="none");if(!u){var E=A.cloneNode();E.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';E.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(E,"click",function(b){function d(){v(f,g,function(b){B(g);a.addComment(b,function(a){b.id=a;C.push(b);e(g)},function(b){c(g);d();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})}, +!0)}var f=a.newComment("",a.getCurrentUser()),g=k(f,C,null,0);d();b.preventDefault();mxEvent.consume(b)});x.appendChild(E)}E=A.cloneNode();E.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';E.setAttribute("title",mxResources.get("showResolved"));var t=!1;"dark"==uiTheme&&(E.style.filter="invert(100%)");mxEvent.addListener(E,"click",function(a){this.className=(t=!t)?"geButton geCheckedBtn":"geButton";K();a.preventDefault();mxEvent.consume(a)});x.appendChild(E);a.commentsRefreshNeeded()&& (E=A.cloneNode(),E.innerHTML='<img src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',E.setAttribute("title",mxResources.get("refresh")),"dark"==uiTheme&&(E.style.filter="invert(100%)"),mxEvent.addListener(E,"click",function(a){K();a.preventDefault();mxEvent.consume(a)}),x.appendChild(E));a.commentsSaveNeeded()&&(A=A.cloneNode(),A.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',A.setAttribute("title",mxResources.get("save")),"dark"==uiTheme&& (A.style.filter="invert(100%)"),mxEvent.addListener(A,"click",function(a){m();a.preventDefault();mxEvent.consume(a)}),x.appendChild(A));z.appendChild(x);var C=[],K=mxUtils.bind(this,function(){this.hasError=!1;if(null!=g){g.div=g.div.cloneNode(!0);var b=g.div.querySelector(".geCommentEditTxtArea"),c=g.div.querySelector(".geCommentEditBtns");g.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}q.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+ '/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";n=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});q.innerHTML="";q.appendChild(F);F.style.display="block";C=a;for(a=0;a<C.length;a++)b(C[a].replies),k(C[a],C, -null,0,u);null!=g&&null==g.comment.id&&null==g.comment.pCommentId&&(q.appendChild(g.div),v(g.comment,g.div,g.saveCallback,g.deleteOnCancel))},mxUtils.bind(this,function(a){q.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(a&&a.message?": "+a.message:""));this.hasError=!0})):q.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});K();this.refreshComments=K;x=mxUtils.bind(this,function(){function a(b){var d=c[b.id];if(null!=d)for(y(b,d),d=0;null!=b.replies&&d<b.replies.length;d++)a(b.replies[d])} +null,0,t);null!=g&&null==g.comment.id&&null==g.comment.pCommentId&&(q.appendChild(g.div),v(g.comment,g.div,g.saveCallback,g.deleteOnCancel))},mxUtils.bind(this,function(a){q.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(a&&a.message?": "+a.message:""));this.hasError=!0})):q.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});K();this.refreshComments=K;x=mxUtils.bind(this,function(){function a(b){var d=c[b.id];if(null!=d)for(y(b,d),d=0;null!=b.replies&&d<b.replies.length;d++)a(b.replies[d])} if(this.window.isVisible()){for(var b=q.querySelectorAll(".geCommentDate"),c={},d=0;d<b.length;d++){var e=b[d];c[e.getAttribute("data-commentId")]=e}for(d=0;d<C.length;d++)a(C[d])}});setInterval(x,6E4);this.refreshCommentsTime=x;this.window=new mxWindow(mxResources.get("comments"),z,b,f,d,l,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW, mxUtils.bind(this,function(){this.window.fit()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)};var Y=mxUtils.bind(this,function(){var a=this.window.getX(), b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",Y);this.destroy=function(){mxEvent.removeListener(window,"resize",Y);this.window.destroy()}},ConfirmDialog=function(a,b,f,d,l,m,p,v,y,B,c){var e=document.createElement("div");e.style.textAlign="center";c=null!=c?c:44;var k=document.createElement("div");k.style.padding="6px";k.style.overflow="auto";k.style.maxHeight=c+"px";k.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(k.style.height="60px");mxUtils.write(k,b); -e.appendChild(k);null!=B&&(k=document.createElement("div"),k.style.padding="6px 0 6px 0",b=document.createElement("img"),b.setAttribute("src",B),k.appendChild(b),e.appendChild(k));B=document.createElement("div");B.style.textAlign="center";B.style.whiteSpace="nowrap";var t=document.createElement("input");t.setAttribute("type","checkbox");m=mxUtils.button(m||mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d(t.checked)});m.className="geBtn";null!=v&&(m.innerHTML=v+"<br>"+m.innerHTML,m.style.paddingBottom= -"8px",m.style.paddingTop="8px",m.style.height="auto",m.style.width="40%");a.editor.cancelFirst&&B.appendChild(m);var n=mxUtils.button(l||mxResources.get("ok"),function(){a.hideDialog();null!=f&&f(t.checked)});B.appendChild(n);null!=p?(n.innerHTML=p+"<br>"+n.innerHTML+"<br>",n.style.paddingBottom="8px",n.style.paddingTop="8px",n.style.height="auto",n.className="geBtn",n.style.width="40%"):n.className="geBtn gePrimaryBtn";a.editor.cancelFirst||B.appendChild(m);e.appendChild(B);y?(B.style.marginTop= -"10px",k=document.createElement("p"),k.style.marginTop="20px",k.appendChild(t),l=document.createElement("span"),mxUtils.write(l," "+mxResources.get("rememberThisSetting")),k.appendChild(l),e.appendChild(k),mxEvent.addListener(l,"click",function(a){t.checked=!t.checked;mxEvent.consume(a)})):B.style.marginTop="12px";this.init=function(){n.focus()};this.container=e};function DiagramPage(a,b){this.node=a;null!=b?this.node.setAttribute("id",b):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")}; +e.appendChild(k);null!=B&&(k=document.createElement("div"),k.style.padding="6px 0 6px 0",b=document.createElement("img"),b.setAttribute("src",B),k.appendChild(b),e.appendChild(k));B=document.createElement("div");B.style.textAlign="center";B.style.whiteSpace="nowrap";var u=document.createElement("input");u.setAttribute("type","checkbox");m=mxUtils.button(m||mxResources.get("cancel"),function(){a.hideDialog();null!=d&&d(u.checked)});m.className="geBtn";null!=v&&(m.innerHTML=v+"<br>"+m.innerHTML,m.style.paddingBottom= +"8px",m.style.paddingTop="8px",m.style.height="auto",m.style.width="40%");a.editor.cancelFirst&&B.appendChild(m);var n=mxUtils.button(l||mxResources.get("ok"),function(){a.hideDialog();null!=f&&f(u.checked)});B.appendChild(n);null!=p?(n.innerHTML=p+"<br>"+n.innerHTML+"<br>",n.style.paddingBottom="8px",n.style.paddingTop="8px",n.style.height="auto",n.className="geBtn",n.style.width="40%"):n.className="geBtn gePrimaryBtn";a.editor.cancelFirst||B.appendChild(m);e.appendChild(B);y?(B.style.marginTop= +"10px",k=document.createElement("p"),k.style.marginTop="20px",k.appendChild(u),l=document.createElement("span"),mxUtils.write(l," "+mxResources.get("rememberThisSetting")),k.appendChild(l),e.appendChild(k),mxEvent.addListener(l,"click",function(a){u.checked=!u.checked;mxEvent.consume(a)})):B.style.marginTop="12px";this.init=function(){n.focus()};this.container=e};function DiagramPage(a,b){this.node=a;null!=b?this.node.setAttribute("id",b):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")}; DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};function RenamePage(a,b,f){this.ui=a;this.page=b;this.previous=this.name=f}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))}; function MovePage(a,b,f){this.ui=a;this.oldIndex=b;this.newIndex=f}MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))}; function SelectPage(a,b,f){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b),null!=f&&(b.viewState=f,this.neverShown=!1))} @@ -3397,24 +3397,24 @@ this.model.setCollapsed(f[e],a))}for(e=0;e<c.length;e++)this.model.setVisible(c[ return b}function f(a){var b=!1;null!=a&&(a=z.getParent(a),b=g.view.getState(a),b="tree"==(null!=b?b.style:g.getCellStyle(a)).containerType);return b}function v(a){var b=!1;null!=a&&(a=z.getParent(a),b=g.view.getState(a),g.view.getState(a),b=null!=(null!=b?b.style:g.getCellStyle(a)).childLayout);return b}function y(a){a=g.view.getState(a);if(null!=a){var b=g.getIncomingEdges(a.cell);if(0<b.length&&(b=g.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y== a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==a.y+a.height&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function B(a,b){b=null!=b?b:!0;g.model.beginUpdate();try{var c=g.model.getParent(a),d=g.getIncomingEdges(a),e=g.cloneCells([d[0],a]);g.model.setTerminal(e[0],g.model.getTerminal(d[0],!0),!0);var f=y(a),k=c.geometry;f==mxConstants.DIRECTION_SOUTH|| f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-10:e[1].geometry.y+=b?a.geometry.height+10:-e[1].geometry.height-10;g.view.currentRoot!=c&&(e[1].geometry.x-=k.x,e[1].geometry.y-=k.y);var l=g.view.getState(a),m=g.view.scale;if(null!=l){var n=mxRectangle.fromRectangle(l);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?n.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*m:n.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*m;var p=g.getOutgoingEdges(g.model.getTerminal(d[0], -!0));if(null!=p){for(var u=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,q=k=d=0;q<p.length;q++){var x=g.model.getTerminal(p[q],!1);if(f==y(x)){var t=g.view.getState(x);x!=a&&null!=t&&(u&&b!=t.getCenterX()<l.getCenterX()||!u&&b!=t.getCenterY()<l.getCenterY())&&mxUtils.intersects(n,t)&&(d=10+Math.max(d,(Math.min(n.x+n.width,t.x+t.width)-Math.max(n.x,t.x))/m),k=10+Math.max(k,(Math.min(n.y+n.height,t.y+t.height)-Math.max(n.y,t.y))/m))}}u?k=0:d=0;for(q=0;q<p.length;q++)if(x=g.model.getTerminal(p[q], -!1),f==y(x)&&(t=g.view.getState(x),x!=a&&null!=t&&(u&&b!=t.getCenterX()<l.getCenterX()||!u&&b!=t.getCenterY()<l.getCenterY()))){var v=[];g.traverse(t.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});g.moveCells(v,(b?1:-1)*d,(b?1:-1)*k)}}}return g.addCells(e,c)}finally{g.model.endUpdate()}}function c(a){g.model.beginUpdate();try{var b=y(a),c=g.getIncomingEdges(a),d=g.cloneCells([c[0],a]);g.model.setTerminal(c[0],d[1],!1);g.model.setTerminal(d[0],d[1],!0);g.model.setTerminal(d[0],a,!1); +!0));if(null!=p){for(var t=f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH,q=k=d=0;q<p.length;q++){var x=g.model.getTerminal(p[q],!1);if(f==y(x)){var u=g.view.getState(x);x!=a&&null!=u&&(t&&b!=u.getCenterX()<l.getCenterX()||!t&&b!=u.getCenterY()<l.getCenterY())&&mxUtils.intersects(n,u)&&(d=10+Math.max(d,(Math.min(n.x+n.width,u.x+u.width)-Math.max(n.x,u.x))/m),k=10+Math.max(k,(Math.min(n.y+n.height,u.y+u.height)-Math.max(n.y,u.y))/m))}}t?k=0:d=0;for(q=0;q<p.length;q++)if(x=g.model.getTerminal(p[q], +!1),f==y(x)&&(u=g.view.getState(x),x!=a&&null!=u&&(t&&b!=u.getCenterX()<l.getCenterX()||!t&&b!=u.getCenterY()<l.getCenterY()))){var v=[];g.traverse(u.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});g.moveCells(v,(b?1:-1)*d,(b?1:-1)*k)}}}return g.addCells(e,c)}finally{g.model.endUpdate()}}function c(a){g.model.beginUpdate();try{var b=y(a),c=g.getIncomingEdges(a),d=g.cloneCells([c[0],a]);g.model.setTerminal(c[0],d[1],!1);g.model.setTerminal(d[0],d[1],!0);g.model.setTerminal(d[0],a,!1); var e=g.model.getParent(a),f=e.geometry,k=[];g.view.currentRoot!=e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);g.traverse(a,!0,function(a,b){null!=b&&k.push(b);k.push(a);return!0});var l=a.geometry.width+40,m=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?l=0:b==mxConstants.DIRECTION_NORTH?(l=0,m=-m):b==mxConstants.DIRECTION_WEST?(l=-l,m=0):b==mxConstants.DIRECTION_EAST&&(m=0);g.moveCells(k,l,m);return g.addCells(d,e)}finally{g.model.endUpdate()}}function e(a){g.model.beginUpdate();try{var b= -g.model.getParent(a),c=g.getIncomingEdges(a),d=g.cloneCells([c[0],a]);g.model.setTerminal(d[0],a,!0);var c=g.getOutgoingEdges(a),e=b.geometry,f=[];g.view.currentRoot==b&&(e=new mxRectangle);for(var k=0;k<c.length;k++){var l=g.model.getTerminal(c[k],!1);null!=l&&f.push(l)}var m=g.view.getBounds(f),n=y(a),p=g.view.translate,u=g.view.scale;n==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==m?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(m.x+m.width)/u-p.x-e.x+10,d[1].geometry.y+=d[1].geometry.height- -e.y+40):n==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==m?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(m.x+m.width)/u-p.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height+e.y+40):(d[1].geometry.x=n==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width+e.x+40):d[1].geometry.x+(d[1].geometry.width-e.x+40),d[1].geometry.y=null==m?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(m.y+m.height)/u-p.y+-e.y+10);return g.addCells(d,b)}finally{g.model.endUpdate()}}function k(a, -b,c){a=g.getOutgoingEdges(a);c=g.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=g.view.getState(g.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function t(a,b){var c=y(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST|| +g.model.getParent(a),c=g.getIncomingEdges(a),d=g.cloneCells([c[0],a]);g.model.setTerminal(d[0],a,!0);var c=g.getOutgoingEdges(a),e=b.geometry,f=[];g.view.currentRoot==b&&(e=new mxRectangle);for(var k=0;k<c.length;k++){var l=g.model.getTerminal(c[k],!1);null!=l&&f.push(l)}var m=g.view.getBounds(f),n=y(a),p=g.view.translate,t=g.view.scale;n==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==m?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(m.x+m.width)/t-p.x-e.x+10,d[1].geometry.y+=d[1].geometry.height- +e.y+40):n==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=null==m?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(m.x+m.width)/t-p.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height+e.y+40):(d[1].geometry.x=n==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width+e.x+40):d[1].geometry.x+(d[1].geometry.width-e.x+40),d[1].geometry.y=null==m?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(m.y+m.height)/t-p.y+-e.y+10);return g.addCells(d,b)}finally{g.model.endUpdate()}}function k(a, +b,c){a=g.getOutgoingEdges(a);c=g.view.getState(c);var d=[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=g.view.getState(g.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function u(a,b){var c=y(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST|| c==mxConstants.DIRECTION_WEST)==d&&c!=b?n.actions.get("selectParent").funct():c==b?(d=g.getOutgoingEdges(a),null!=d&&0<d.length&&g.setSelectionCell(g.model.getTerminal(d[0],!1))):(c=g.getIncomingEdges(a),null!=c&&0<c.length&&(d=k(g.model.getTerminal(c[0],!0),d,a),c=g.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&g.setSelectionCell(d[c].cell)))))}var n=this,g=n.editor.graph,z=g.getModel(),A=n.menus.createPopupMenu; n.menus.createPopupMenu=function(a,c,d){A.apply(this,arguments);if(1==g.getSelectionCount()){c=g.getSelectionCell();var e=g.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(g.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(g.getSelectionCell())&&(a.addSeparator(),0<g.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};n.actions.addAction("selectChildren",function(){if(g.isEnabled()&& 1==g.getSelectionCount()){var a=g.getSelectionCell(),a=g.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(g.model.getTerminal(a[c],!1));g.setSelectionCells(b)}}},null,null,"Alt+Shift+X");n.actions.addAction("selectSiblings",function(){if(g.isEnabled()&&1==g.getSelectionCount()){var a=g.getSelectionCell(),a=g.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=g.getOutgoingEdges(g.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(g.model.getTerminal(a[c], !1));g.setSelectionCells(b)}}},null,null,"Alt+Shift+S");n.actions.addAction("selectParent",function(){if(g.isEnabled()&&1==g.getSelectionCount()){var a=g.getSelectionCell(),a=g.getIncomingEdges(a);null!=a&&0<a.length&&g.setSelectionCell(g.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");n.actions.addAction("selectDescendants",function(){if(g.isEnabled()&&1==g.getSelectionCount()){var a=g.getSelectionCell(),b=[];g.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});g.setSelectionCells(b)}}, null,null,"Alt+Shift+D");var q=g.removeCells;g.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var d=[],e=0;e<a.length;e++){var k=a[e];z.isEdge(k)&&f(k)&&(d.push(k),k=z.getTerminal(k,!1));b(k)?(g.traverse(k,!0,function(a,b){null!=b&&d.push(b);d.push(a);return!0}),k=g.getIncomingEdges(a[e]),a=a.concat(k)):d.push(a[e])}a=d;return q.apply(this,arguments)};n.hoverIcons.getStateAt=function(a,c, d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,d))};var F=g.duplicateCells;g.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=g.view.getState(d[e]);if(null!=f&&b(f.cell))for(var k=g.getIncomingEdges(f.cell),f=0;f<k.length;f++)mxUtils.remove(k[f],a)}this.model.beginUpdate();try{var l=F.call(this,a,c);if(l.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var m=g.getIncomingEdges(l[e]),k=g.getIncomingEdges(a[e]); -if(0==m.length&&0<k.length){var n=this.cloneCell(k[0]);this.addEdge(n,g.getDefaultParent(),this.model.getTerminal(k[0],!0),l[e])}}}finally{this.model.endUpdate()}return l};var x=g.moveCells;g.moveCells=function(a,c,d,e,f,k,l){var m=null;this.model.beginUpdate();try{var n=f,p=this.view.getState(f),u=null!=p?p.style:this.getCellStyle(f);if(null!=a&&b(f)&&"1"==mxUtils.getValue(u,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||g.model.isEdge(a[q])&&null==g.model.getTerminal(a[q],!0)){f=g.model.getParent(a[q]); -break}if(null!=n&&f!=n&&null!=this.view.getState(a[0])){var t=g.getIncomingEdges(a[0]);if(0<t.length){var v=g.view.getState(g.model.getTerminal(t[0],!0));if(null!=v){var z=g.view.getState(n);null!=z&&(c=(z.getCenterX()-v.getCenterX())/g.view.scale,d=(z.getCenterY()-v.getCenterY())/g.view.scale)}}}}m=x.apply(this,arguments);if(null!=m&&null!=a&&m.length==a.length)for(q=0;q<m.length;q++)if(this.model.isEdge(m[q]))b(n)&&0>mxUtils.indexOf(m,this.model.getTerminal(m[q],!0))&&this.model.setTerminal(m[q], -n,!0);else if(b(a[q])&&(t=g.getIncomingEdges(a[q]),0<t.length))if(!e)b(n)&&0>mxUtils.indexOf(a,this.model.getTerminal(t[0],!0))&&this.model.setTerminal(t[0],n,!0);else if(0==g.getIncomingEdges(m[q]).length){p=n;if(null==p||p==g.model.getParent(a[q]))p=g.model.getTerminal(t[0],!0);e=this.cloneCell(t[0]);this.addEdge(e,g.getDefaultParent(),p,m[q])}}finally{this.model.endUpdate()}return m};if(null!=n.sidebar){var E=n.sidebar.dropAndConnect;n.sidebar.dropAndConnect=function(a,c,d,e){var f=g.model,k=null; -f.beginUpdate();try{if(k=E.apply(this,arguments),b(a))for(var l=0;l<k.length;l++)if(f.isEdge(k[l])&&null==f.getTerminal(k[l],!0)){f.setTerminal(k[l],a,!0);var m=g.getCellGeometry(k[l]);m.points=null;null!=m.getTerminalPoint(!0)&&m.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return k}}var u={88:n.actions.get("selectChildren"),84:n.actions.get("selectSubtree"),80:n.actions.get("selectParent"),83:n.actions.get("selectSiblings")},C=n.onKeyDown;n.onKeyDown=function(a){try{if(g.isEnabled()&&!g.isEditing()&& +if(0==m.length&&0<k.length){var n=this.cloneCell(k[0]);this.addEdge(n,g.getDefaultParent(),this.model.getTerminal(k[0],!0),l[e])}}}finally{this.model.endUpdate()}return l};var x=g.moveCells;g.moveCells=function(a,c,d,e,f,k,l){var m=null;this.model.beginUpdate();try{var n=f,p=this.view.getState(f),t=null!=p?p.style:this.getCellStyle(f);if(null!=a&&b(f)&&"1"==mxUtils.getValue(t,"treeFolding","0")){for(var q=0;q<a.length;q++)if(b(a[q])||g.model.isEdge(a[q])&&null==g.model.getTerminal(a[q],!0)){f=g.model.getParent(a[q]); +break}if(null!=n&&f!=n&&null!=this.view.getState(a[0])){var u=g.getIncomingEdges(a[0]);if(0<u.length){var v=g.view.getState(g.model.getTerminal(u[0],!0));if(null!=v){var z=g.view.getState(n);null!=z&&(c=(z.getCenterX()-v.getCenterX())/g.view.scale,d=(z.getCenterY()-v.getCenterY())/g.view.scale)}}}}m=x.apply(this,arguments);if(null!=m&&null!=a&&m.length==a.length)for(q=0;q<m.length;q++)if(this.model.isEdge(m[q]))b(n)&&0>mxUtils.indexOf(m,this.model.getTerminal(m[q],!0))&&this.model.setTerminal(m[q], +n,!0);else if(b(a[q])&&(u=g.getIncomingEdges(a[q]),0<u.length))if(!e)b(n)&&0>mxUtils.indexOf(a,this.model.getTerminal(u[0],!0))&&this.model.setTerminal(u[0],n,!0);else if(0==g.getIncomingEdges(m[q]).length){p=n;if(null==p||p==g.model.getParent(a[q]))p=g.model.getTerminal(u[0],!0);e=this.cloneCell(u[0]);this.addEdge(e,g.getDefaultParent(),p,m[q])}}finally{this.model.endUpdate()}return m};if(null!=n.sidebar){var E=n.sidebar.dropAndConnect;n.sidebar.dropAndConnect=function(a,c,d,e){var f=g.model,k=null; +f.beginUpdate();try{if(k=E.apply(this,arguments),b(a))for(var l=0;l<k.length;l++)if(f.isEdge(k[l])&&null==f.getTerminal(k[l],!0)){f.setTerminal(k[l],a,!0);var m=g.getCellGeometry(k[l]);m.points=null;null!=m.getTerminalPoint(!0)&&m.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return k}}var t={88:n.actions.get("selectChildren"),84:n.actions.get("selectSubtree"),80:n.actions.get("selectParent"),83:n.actions.get("selectSiblings")},C=n.onKeyDown;n.onKeyDown=function(a){try{if(g.isEnabled()&&!g.isEditing()&& b(g.getSelectionCell())&&1==g.getSelectionCount()){var d=null;0<g.getIncomingEdges(g.getSelectionCell()).length&&(9==a.which?d=mxEvent.isShiftDown(a)?c(g.getSelectionCell()):e(g.getSelectionCell()):13==a.which&&(d=B(g.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&g.model.isEdge(d[0])?g.setSelectionCell(g.model.getTerminal(d[0],!1)):g.setSelectionCell(d[d.length-1]),null!=n.hoverIcons&&n.hoverIcons.update(g.view.getState(g.getSelectionCell())),g.startEditingAtCell(g.getSelectionCell()), -mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var f=u[a.keyCode];null!=f&&(f.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(t(g.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(t(g.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(t(g.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(t(g.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(P){console.log("error", +mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var f=t[a.keyCode];null!=f&&(f.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(u(g.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(u(g.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(u(g.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(u(g.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(P){console.log("error", P)}mxEvent.isConsumed(a)||C.apply(this,arguments)};var K=g.connectVertex;g.connectVertex=function(a,d,f,k,l,m){var n=g.getIncomingEdges(a);return b(a)&&0<n.length?(f=y(a),k=f==mxConstants.DIRECTION_EAST||f==mxConstants.DIRECTION_WEST,l=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,f==d?e(a):k==l?c(a):B(a,d!=mxConstants.DIRECTION_NORTH&&d!=mxConstants.DIRECTION_WEST)):K.call(this,a,d,f,k,l,m)};g.getSubtree=function(a){var c=[a];!d(a)&&!b(a)||v(a)||g.traverse(a,!0,function(a,b){null!= b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var Y=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){Y.apply(this,arguments);(d(this.state.cell)||b(this.state.cell))&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="18px", this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells);this.graph.graphHandler.pBounds=this.graph.graphHandler.getPreviewBounds(this.graph.graphHandler.cells); @@ -3459,7 +3459,7 @@ mxUtils.bind(this,function(a,b){var c=new FilenameDialog(this.editorUi,a,mxResou null,d),a.addSeparator(),this.addSubmenu("layout",a)):e.isSelectionEmpty()&&e.isEnabled()?(a.addSeparator(),this.addMenuItems(a,["editData"],null,d),a.addSeparator(),this.addSubmenu("layout",a),this.addSubmenu("view",a,null,mxResources.get("options")),this.addMenuItems(a,["-","exitGroup"],null,d)):e.isEnabled()&&this.addMenuItems(a,["-","lockUnlock"],null,d)};EditorUi.prototype.toggleFormatPanel=function(b){null!=this.formatWindow?this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()): a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var e=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(), this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.window.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);e.apply(this,arguments)};var k= -EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){k.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=function(){};var t=Menus.prototype.init;Menus.prototype.init=function(){t.apply(this,arguments);var c=this.editorUi,d=c.editor.graph;c.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";c.actions.get("createShape").label= +EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){k.apply(this,arguments);a||(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=function(){};var u=Menus.prototype.init;Menus.prototype.init=function(){u.apply(this,arguments);var c=this.editorUi,d=c.editor.graph;c.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";c.actions.get("createShape").label= mxResources.get("shape")+"...";c.actions.get("outline").label=mxResources.get("outline")+"...";c.actions.get("layers").label=mxResources.get("layers")+"...";c.actions.put("importCsv",new Action(mxResources.get("csv")+"...",function(){d.popupMenuHandler.hideMenu();c.showImportCsvDialog()}));c.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(c,"Insert from Text");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("formatSql",new Action(mxResources.get("formatSql")+ "...",function(){var a=new ParseDialog(c,"Insert from Text","formatSql");c.showDialog(a.container,620,420,!0,!1);a.init()}));c.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",function(){b(c)}));c.actions.put("toggleFormat",new Action(mxResources.get("format")+"...",function(){a(c)}));EditorUi.enablePlantUml&&!c.isOffline()&&c.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(c,"Insert from Text","plantUml");c.showDialog(a.container, 620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();c.menus.addSubmenu("extras",a,b,mxResources.get("preferences"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(c.menus.addMenuItems(a,["new","open","-"],b),EditorUi.isElectronApp&&c.menus.addMenuItems(a,["synchronize","-"],b),c.menus.addMenuItems(a,["save","saveAs","-"],b)):"1"==urlParams.embed?(c.menus.addMenuItems(a,["-","save"],b),"1"==urlParams.saveAndExit&&c.menus.addMenuItems(a, @@ -3470,12 +3470,12 @@ b):(c.menus.addMenuItems(a,["save","saveAs","-","rename"],b),c.isOfflineApp()?na b);!c.isOfflineApp()&&isLocalStorage&&(a.addSeparator(b),c.menus.addMenuItem(a,"plugins",b));a.addSeparator(b)})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),b)})));this.put("insert",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),b);c.insertTemplateEnabled&&!c.isOffline()&& c.menus.addMenuItems(a,["insertTemplate"],b);a.addSeparator(b);this.addMenuItems(a,["createShape","insertFreehand","-"],b);this.addSubmenu("insertLayout",a,b,mxResources.get("layout"));this.addSubmenu("insertAdvanced",a,b,mxResources.get("advanced"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,["import"],b):c.menus.addSubmenu("importFrom",a,b)})));var k="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),l=function(a, b,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(c,d,e);c.showDialog(a.container,620,420,!0,!1);a.init()}),b)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<k.length;c++)"-"==k[c]?a.addSeparator(b):l(a,b,mxResources.get(k[c])+"...",k[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints -".split(" "),b);if("undefined"!==typeof MathJax){var d=c.menus.addMenuItem(a, -"mathematicalTypesetting",b);c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}c.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],b)})))};var n=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c){var d=l.menus.get(a),e=v.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),t);e.className="geMenuItem";e.style.display="inline-block";e.style.boxSizing="border-box";e.style.top="6px";e.style.marginRight= +"mathematicalTypesetting",b);c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}c.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],b)})))};var n=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c){var d=l.menus.get(a),e=v.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),u);e.className="geMenuItem";e.style.display="inline-block";e.style.boxSizing="border-box";e.style.top="6px";e.style.marginRight= "6px";e.style.height="30px";e.style.paddingTop="6px";e.style.paddingBottom="6px";e.style.cursor="pointer";e.setAttribute("title",mxResources.get(a));l.menus.menuCreated(d,e,"geMenuItem");null!=c?(e.style.backgroundImage="url("+c+")",e.style.backgroundPosition="center center",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="24px 24px",e.style.width="34px",e.innerHTML=""):b||(e.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",e.style.backgroundPosition="right 6px center", e.style.backgroundRepeat="no-repeat",e.style.paddingRight="22px");return e}function c(a,b,c,d,e,f){var g=document.createElement("a");g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.height="30px";g.style.padding="6px";g.style.position="relative";g.style.verticalAlign="top";g.style.top="0px";null!=l.statusContainer?p.insertBefore(g,l.statusContainer):p.appendChild(g);null!=f?(g.style.backgroundImage="url("+f+")",g.style.backgroundPosition="center center", g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px"):mxUtils.write(g,a);mxEvent.addListener(g,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(g,"click",function(a){"disabled"!=g.getAttribute("disabled")&&b(a);mxEvent.consume(a)});null==c&&(g.style.marginRight="4px");null!=d&&g.setAttribute("title",d);null!=e&&(a=function(){e.isEnabled()?(g.removeAttribute("disabled"),g.style.cursor="pointer"): (g.setAttribute("disabled","disabled"),g.style.cursor="default")},e.addListener("stateChanged",a),a());return g}function d(a,b){var c=document.createElement("div");c.className="geMenuItem";c.style.display="inline-block";c.style.verticalAlign="top";c.style.marginRight="6px";c.style.padding="0 4px 0 4px";c.style.height="30px";c.style.position="relative";c.style.top="0px";for(var d=0;d<a.length;d++)null!=a[d]&&(a[d].style.margin="0px",a[d].style.boxShadow="none",c.appendChild(a[d]));null!=b&&mxUtils.setOpacity(c, -b);null!=l.statusContainer?p.insertBefore(c,l.statusContainer):p.appendChild(c);return c}function e(){for(var b=p.firstChild;null!=b;){var e=b.nextSibling;"geMenuItem"!=b.className&&"geItem"!=b.className||b.parentNode.removeChild(b);b=e}t=p.firstChild;f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;(b=1E3>f)||a("diagram");d([b?a("diagram",null,IMAGE_PATH+"/drawlogo.svg"):null,c(mxResources.get("shapes"),l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"), +b);null!=l.statusContainer?p.insertBefore(c,l.statusContainer):p.appendChild(c);return c}function e(){for(var b=p.firstChild;null!=b;){var e=b.nextSibling;"geMenuItem"!=b.className&&"geItem"!=b.className||b.parentNode.removeChild(b);b=e}u=p.firstChild;f=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;(b=1E3>f)||a("diagram");d([b?a("diagram",null,IMAGE_PATH+"/drawlogo.svg"):null,c(mxResources.get("shapes"),l.actions.get("toggleShapes").funct,null,mxResources.get("shapes"), l.actions.get("image"),b?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),c(mxResources.get("format"),l.actions.get("toggleFormat").funct,null,mxResources.get("format")+" ("+l.actions.get("formatPanel").shortcut+")",l.actions.get("image"),b?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==": null)],b?60:null);e=a("insert",!0,b?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==":null);d([e,c(mxResources.get("delete"),l.actions.get("delete").funct,null,mxResources.get("delete"),l.actions.get("delete"),b?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiAxOWMwIDEuMS45IDIgMiAyaDhjMS4xIDAgMi0uOSAyLTJWN0g2djEyek0xOSA0aC0zLjVsLTEtMWgtNWwtMSAxSDV2MmgxNFY0eiIvPjwvc3ZnPg==": null)],b?60:null);if(411<=f&&(e=l.actions.get("undo"),b=l.actions.get("redo"),e=c("",e.funct,null,mxResources.get("undo")+" ("+e.shortcut+")",e,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIuNSA4Yy0yLjY1IDAtNS4wNS45OS02LjkgMi42TDIgN3Y5aDlsLTMuNjItMy42MmMxLjM5LTEuMTYgMy4xNi0xLjg4IDUuMTItMS44OCAzLjU0IDAgNi41NSAyLjMxIDcuNiA1LjVsMi4zNy0uNzhDMjEuMDggMTEuMDMgMTcuMTUgOCAxMi41IDh6Ii8+PC9zdmc+"),b=c("", @@ -3485,7 +3485,7 @@ d([c("",function(){m.popupMenuHandler.hideMenu();var a=m.view.scale,b=m.view.tra null,640<=f?c("",e.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",e,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHpNNyA5aDV2MUg3eiIvPjwvc3ZnPg=="): null],60)}b=l.menus.get("language");null!=b&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&600<=f?(null==O&&(e=v.addMenu("",b.funct),e.setAttribute("title",mxResources.get("language")),e.className="geToolbarButton",e.style.backgroundImage="url("+Editor.globeImage+")",e.style.backgroundPosition="center center",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="24px 24px",e.style.position="absolute",e.style.height="24px",e.style.width="24px",e.style.zIndex="1",e.style.right="8px",e.style.cursor= "pointer",e.style.top="1"==urlParams.embed?"12px":"11px",p.appendChild(e),O=e),l.buttonContainer.style.paddingRight="34px"):(l.buttonContainer.style.paddingRight="4px",null!=O&&(O.parentNode.removeChild(O),O=null))}n.apply(this,arguments);var k=document.createElement("div");k.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";k.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?"63px":"32px";this.sidebar=this.createSidebar(k);null==urlParams.clibs&& -null==urlParams.libs||b(this);var l=this,m=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));l.defaultLibraryName=mxResources.get("untitledLibrary");var p=document.createElement("div");p.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var t=null,v=new Menubar(l,p);l.statusContainer=l.createStatusContainer();l.statusContainer.style.position="relative"; +null==urlParams.libs||b(this);var l=this,m=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));l.defaultLibraryName=mxResources.get("untitledLibrary");var p=document.createElement("div");p.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var u=null,v=new Menubar(l,p);l.statusContainer=l.createStatusContainer();l.statusContainer.style.position="relative"; l.statusContainer.style.maxWidth="";l.statusContainer.style.marginTop="7px";l.statusContainer.style.marginLeft="6px";l.statusContainer.style.color="gray";l.statusContainer.style.cursor="default";l.editor.addListener("statusChanged",mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));var y=l.descriptorChanged;l.descriptorChanged=function(){y.apply(this,arguments);var a=l.getCurrentFile();if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==b?b="gitHub": "gitlab"==b?b="gitLab":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);p.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else p.removeAttribute("title")};l.setStatusText(l.editor.getStatus());p.appendChild(l.statusContainer);l.buttonContainer=document.createElement("div");l.buttonContainer.style.cssText="position:absolute;right:0px;padding-right:34px;top:10px;white-space:nowrap;padding-top:2px;background-color:inherit;";p.appendChild(l.buttonContainer);l.menubarContainer=l.buttonContainer; l.tabContainer=document.createElement("div");l.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;border-bottom:1px solid lightgray;background-color:#ffffff;border-top:1px solid lightgray;margin-bottom:-2px;visibility:hidden;";var k=l.diagramContainer.parentNode,B=document.createElement("div");B.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";l.diagramContainer.style.top="47px";var Q=l.menus.get("viewZoom"); @@ -3525,7 +3525,7 @@ function(){g.style.backgroundColor="#eee"}),mxUtils.setOpacity(a,60),g.style.cur f.style.whiteSpace="nowrap";f.style.textAlign="left";f.style.zIndex=this.toolbarZIndex;f.style.backgroundColor="#eee";f.style.height=this.toolbarHeight+"px";this.toolbar=f;if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(f.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(f,30);var d=null,l=null,m=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=l&&(window.clearTimeout(l),fadeThead2=null);d=window.setTimeout(mxUtils.bind(this, function(){mxUtils.setOpacity(f,0);d=null;l=window.setTimeout(mxUtils.bind(this,function(){f.style.display="none";l=null}),100)}),a||200)}),p=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=l&&(window.clearTimeout(l),fadeThead2=null);f.style.display="";mxUtils.setOpacity(f,a||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(p(30),m())}));mxEvent.addListener(f,mxClient.IS_POINTER? "pointermove":"mousemove",function(a){mxEvent.consume(a)});mxEvent.addListener(f,"mouseenter",mxUtils.bind(this,function(a){p(100)}));mxEvent.addListener(f,"mousemove",mxUtils.bind(this,function(a){p(100);mxEvent.consume(a)}));mxEvent.addListener(f,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||p(30)}));var v=this.graph,y=v.getTolerance();v.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY(); -this.scrollLeft=v.container.scrollLeft;this.scrollTop=v.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-v.container.scrollLeft)<y&&Math.abs(this.scrollTop-v.container.scrollTop)<y&&Math.abs(this.startX-b.getGraphX())<y&&Math.abs(this.startY-b.getGraphY())<y&&(0<parseFloat(f.style.opacity||0)?m():p(30))}})}for(var B=this.toolbarItems,c=0,e=null,k=null,t=0;t<B.length;t++){var n=B[t];if("pages"==n){k=b.ownerDocument.createElement("div"); +this.scrollLeft=v.container.scrollLeft;this.scrollTop=v.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-v.container.scrollLeft)<y&&Math.abs(this.scrollTop-v.container.scrollTop)<y&&Math.abs(this.startX-b.getGraphX())<y&&Math.abs(this.startY-b.getGraphY())<y&&(0<parseFloat(f.style.opacity||0)?m():p(30))}})}for(var B=this.toolbarItems,c=0,e=null,k=null,u=0;u<B.length;u++){var n=B[u];if("pages"==n){k=b.ownerDocument.createElement("div"); k.style.cssText="display:inline-block;position:relative;padding:3px 4px 0 4px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;";mxUtils.setOpacity(k,70);var g=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");g.style.borderRightStyle="none";g.style.paddingLeft="0px";g.style.paddingRight="0px";f.appendChild(k);var z=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+ 1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");z.style.paddingLeft="0px";z.style.paddingRight="0px";n=mxUtils.bind(this,function(){k.innerHTML="";mxUtils.write(k,this.currentPage+1+" / "+this.diagrams.length);k.style.display=1<this.diagrams.length?"inline-block":"none";g.style.display=k.style.display;z.style.display=k.style.display});this.addListener("graphChanged",n);n()}else if("zoom"==n)this.zoomEnabled&&(a(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage, mxResources.get("zoomOut")||"Zoom Out"),a(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),a(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==n){if(this.layersEnabled){var A=this.graph.getModel(),q=a(mxUtils.bind(this,function(a){if(null!=e)e.parentNode.removeChild(e), @@ -3555,7 +3555,7 @@ GraphViewer.initCss=function(){try{var a=document.createElement("style");a.type= GraphViewer.cachedUrls={};GraphViewer.getUrl=function(a,b,f){if(null!=GraphViewer.cachedUrls[a])b(GraphViewer.cachedUrls[a]);else{var d=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;d.open("GET",a);d.onload=function(){b(null!=d.getText?d.getText():d.responseText)};d.onerror=f;d.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeSensor=!0; (function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},b=function(f,d){function l(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function m(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function p(b,c){if(!b.resizedAttached)b.resizedAttached= new l,b.resizedAttached.add(c);else if(b.resizedAttached){b.resizedAttached.add(c);return}b.resizeSensor=document.createElement("div");b.resizeSensor.className="resize-sensor";b.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";b.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>'; -b.appendChild(b.resizeSensor);"static"==m(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],k=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};k();var p=!1,q=function(){b.resizedAttached&&(p&&(b.resizedAttached.call(),p=!1),a(q))};a(q);var v,x,y,u,B=function(){if((y=b.offsetWidth)!=v||(u=b.offsetHeight)!=x)p=!0,v=y,x=u;k()},K=function(a,b,c){a.attachEvent? +b.appendChild(b.resizeSensor);"static"==m(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],k=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};k();var p=!1,q=function(){b.resizedAttached&&(p&&(b.resizedAttached.call(),p=!1),a(q))};a(q);var v,x,y,t,B=function(){if((y=b.offsetWidth)!=v||(t=b.offsetHeight)!=x)p=!0,v=y,x=t;k()},K=function(a,b,c){a.attachEvent? a.attachEvent("on"+b,c):a.addEventListener(b,c)};K(d,"scroll",B);K(f,"scroll",B)}var v=function(){GraphViewer.resizeSensorEnabled&&d()},y=Object.prototype.toString.call(f),B="[object Array]"===y||"[object NodeList]"===y||"[object HTMLCollection]"===y||"undefined"!==typeof jQuery&&f instanceof jQuery||"undefined"!==typeof Elements&&f instanceof Elements;if(B)for(var y=0,c=f.length;y<c;y++)p(f[y],v);else p(f,v);this.detach=function(){if(B)for(var a=0,c=f.length;a<c;a++)b.detach(f[a]);else b.detach(f)}}; b.detach=function(a){a.resizeSensor&&(a.removeChild(a.resizeSensor),delete a.resizeSensor,delete a.resizedAttached)};window.ResizeSensor=b})(); (function(){Editor.initMath();GraphViewer.initCss();if(null!=window.onDrawioViewerLoad)window.onDrawioViewerLoad();else GraphViewer.processElements()})();