From a12988fbde718888ec4ae34d6defec07dde13c40 Mon Sep 17 00:00:00 2001 From: Gaudenz Alder Date: Sat, 2 Mar 2019 14:23:28 +0100 Subject: [PATCH] 10.3.1 release --- ChangeLog | 5 + VERSION | 2 +- .../java/com/mxgraph/online/ProxyServlet.java | 26 +- src/main/webapp/cache.manifest | 2 +- src/main/webapp/js/app.min.js | 363 +++---- src/main/webapp/js/diagramly/App.js | 116 ++- src/main/webapp/js/diagramly/EditorUi.js | 29 +- src/main/webapp/js/viewer.min.js | 902 +++++++++--------- src/main/webapp/plugins/cConf-1-4-8.js | 12 +- src/main/webapp/styles/atlas.css | 2 +- 10 files changed, 762 insertions(+), 697 deletions(-) diff --git a/ChangeLog b/ChangeLog index de9839ace2..2d969ab31d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +02-MAR-2019: 10.3.1 + +- Fixes loading spinner for Trello +- Uses magic numbers for templates + 01-MAR-2019: 10.3.0 - Adds validation step for Google file saving diff --git a/VERSION b/VERSION index 6495db7e21..1b77c51506 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.3.0 \ No newline at end of file +10.3.1 \ No newline at end of file diff --git a/src/main/java/com/mxgraph/online/ProxyServlet.java b/src/main/java/com/mxgraph/online/ProxyServlet.java index b98a8d93c6..6309dbd16b 100644 --- a/src/main/java/com/mxgraph/online/ProxyServlet.java +++ b/src/main/java/com/mxgraph/online/ProxyServlet.java @@ -5,6 +5,7 @@ package com.mxgraph.online; import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -13,7 +14,6 @@ import java.net.URL; import java.net.URLConnection; import java.net.UnknownHostException; -import java.util.Arrays; import java.util.logging.Level; import java.util.logging.Logger; @@ -179,23 +179,17 @@ protected void copyResponse(InputStream is, OutputStream out, byte[] head, try (BufferedInputStream in = new BufferedInputStream(is, BUFFER_SIZE)) { - StringBuilder result = new StringBuilder(); - result.append(mxBase64.encodeToString(head, false)); - byte[] chunk = new byte[BUFFER_SIZE]; - int len = 0; + ByteArrayOutputStream os = new ByteArrayOutputStream(); + byte[] buffer = new byte[0xFFFF]; - while ((len = in.read(chunk)) == BUFFER_SIZE) - { - result.append(mxBase64.encodeToString(chunk, false)); - } - - if (len > 0) - { - chunk = Arrays.copyOf(chunk, len); - result.append(mxBase64.encodeToString(chunk, false)); - } + os.write(head, 0, head.length); + + for (int len = is.read(buffer); len != -1; len = is.read(buffer)) + { + os.write(buffer, 0, len); + } - out.write(result.toString().getBytes()); + out.write(mxBase64.encodeToString(os.toByteArray(), false).getBytes()); } } else diff --git a/src/main/webapp/cache.manifest b/src/main/webapp/cache.manifest index cd346e22c2..978983156c 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! -# 03/01/2019 12:08 PM +# 03/02/2019 02:12 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 2f910e9589..53722e9daa 100644 --- a/src/main/webapp/js/app.min.js +++ b/src/main/webapp/js/app.min.js @@ -7749,7 +7749,7 @@ a.openLink(b)}catch(p){a.handleError({message:p.message||mxResources.get("drawin 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",g.appendChild(f))}q=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});g.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":(g.appendChild(f),f.className="geBtn gePrimaryBtn",q.className="geBtn"):(g.appendChild(n),q.className="geBtn",n.className="geBtn gePrimaryBtn");d.appendChild(g);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(K.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");if(2<=F.length){var m=n(F[0]),G=n(F[F.length-1]),F=new mxCell(2");if(2<=G.length){var m=n(G[0]),H=n(G[G.length-1]),G=new mxCell(2 Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: another authentication Response\n@enduml": "plantUmlSvg"==m.value||"plantUmlTxt"==m.value?"@startuml\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":";Example:\na->b\nb->edge label->c\nc->a\n"}var g=a.editor.graph.getFreeInsertPoint();c=document.createElement("div");c.style.textAlign="right";var k=document.createElement("textarea");k.style.resize="none";k.style.width="100%";k.style.height= @@ -7798,30 +7798,30 @@ n=document.createElement("option");n.setAttribute("value","diagram");mxUtils.wri ")");var f=document.createElement("option");f.setAttribute("value","plantUmlTxt");mxUtils.write(f,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==b&&(m.appendChild(n),m.appendChild(q),m.appendChild(f));var l=e();k.value=l;c.appendChild(k);this.init=function(){k.focus()};Graph.fileSupport&&(k.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),k.addEventListener("drop",function(a){a.stopPropagation(); a.preventDefault();if(0=a.getStatus()&&(x(u,a.getText(),c),A&&v())}))});mxEvent.addListener(u,"dblclick", +"center center";u.style.backgroundRepeat="no-repeat";var A=!1;mxEvent.addListener(u,"click",function(f){H.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;G.spin(N);mxUtils.get(f,mxUtils.bind(this,function(a){G.stop();200<=a.getStatus()&&299>=a.getStatus()&&(x(u,a.getText(),c),A&&v())}))});mxEvent.addListener(u,"dblclick", function(a){A=!0})}else u.innerHTML='
'+mxResources.get(f)+"
",l&&x(u),null!=g?mxEvent.addListener(u,"click",g):(mxEvent.addListener(u,"click",function(a){x(u)}),mxEvent.addListener(u,"dblclick",function(a){v()}));N.appendChild(u)}function K(){mxEvent.addListener(N,"scroll",function(a){N.scrollTop+N.clientHeight>=N.scrollHeight&&(z(),mxEvent.consume(a))});var a=null,b;for(b in aa){var c= document.createElement("div"),f=mxResources.get(b),d=aa[b];null==f&&(f=b.substring(0,1).toUpperCase()+b.substring(1));18c.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_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=".xml");0<=l&&(f=f.substring(0,l));C.value=f+p}}v(d)})}var x=document.createElement("a");x.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";x.style.display=mxClient.IS_QUIRKS?"inline": -"inline-block";x.className="geBaseButton";x.style.position="relative";x.style.margin="4px";x.style.padding="8px 8px 10px 8px";x.style.whiteSpace="nowrap";x.appendChild(g);mxClient.IS_QUIRKS&&(x.style.cssFloat="left",x.style.zoom="1");x.style.color="gray";x.style.fontSize="11px";var t=document.createElement("div");x.appendChild(t);mxUtils.write(t,f);if(null!=p&&null==a[p]){g.style.visibility="hidden";mxUtils.setOpacity(t,10);var u=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});u.spin(x);var y=window.setTimeout(function(){null==a[p]&&(u.stop(),x.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(y),mxUtils.setOpacity(t,100),g.style.visibility="",u.stop(),e())}))}else e();K.appendChild(x);++H==l&&(mxUtils.br(K),H=0)}function v(c){var f=C.value;if(null==c||null!=f&&0c.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_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=".xml");0<=l&&(f=f.substring(0,l));C.value=f+p}}v(d)})}var g=document.createElement("a");g.style.overflow="hidden";var x=document.createElement("img");x.src=b;x.setAttribute("border","0");x.setAttribute("align","absmiddle");x.style.width="60px";x.style.height="60px";x.style.paddingBottom="6px";g.style.display=mxClient.IS_QUIRKS?"inline": +"inline-block";g.className="geBaseButton";g.style.position="relative";g.style.margin="4px";g.style.padding="8px 8px 10px 8px";g.style.whiteSpace="nowrap";g.appendChild(x);mxClient.IS_QUIRKS&&(g.style.cssFloat="left",g.style.zoom="1");g.style.color="gray";g.style.fontSize="11px";var t=document.createElement("div");g.appendChild(t);mxUtils.write(t,f);if(null!=p&&null==a[p]){x.style.visibility="hidden";mxUtils.setOpacity(t,10);var u=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});u.spin(g);var y=window.setTimeout(function(){null==a[p]&&(u.stop(),g.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[p]&&(window.clearTimeout(y),mxUtils.setOpacity(t,100),x.style.visibility="",u.stop(),e())}))}else e();K.appendChild(g);++F==l&&(mxUtils.br(K),F=0)}function v(c){var f=C.value;if(null==c||null!=f&&0a.maxImageSize||e>a.maxImageSize){var B=Math.min(1,Math.min(a.maxImageSize/Math.max(1,p)),a.maxImageSize/Math.max(1,e));p*=B;e*=B}D>q?(q=Math.round(100*q/D),D=100):(D=Math.round(100*D/q),q=100);var G=document.createElement("div");G.setAttribute("draggable","true");G.style.display= -mxClient.IS_QUIRKS?"inline":"inline-block";G.style.position="relative";G.style.cursor="move";mxUtils.setPrefixedStyle(G.style,"transition","transform .1s ease-in-out");if(null!=b){var H=document.createElement("img");H.setAttribute("src",C.convert(b));H.style.width=D+"px";H.style.height=q+"px";H.style.margin="10px";H.style.paddingBottom=Math.floor((100-q)/2)+"px";H.style.paddingLeft=Math.floor((100-D)/2)+"px";G.appendChild(H)}else if(null!=g){var J=a.stringToCells(Graph.decompress(g.xml));0a.maxImageSize||e>a.maxImageSize){var B=Math.min(1,Math.min(a.maxImageSize/Math.max(1,p)),a.maxImageSize/Math.max(1,e));p*=B;e*=B}D>q?(q=Math.round(100*q/D),D=100):(D=Math.round(100*D/q),q=100);var H=document.createElement("div");H.setAttribute("draggable","true");H.style.display= +mxClient.IS_QUIRKS?"inline":"inline-block";H.style.position="relative";H.style.cursor="move";mxUtils.setPrefixedStyle(H.style,"transition","transform .1s ease-in-out");if(null!=b){var F=document.createElement("img");F.setAttribute("src",C.convert(b));F.style.width=D+"px";F.style.height=q+"px";F.style.margin="10px";F.style.paddingBottom=Math.floor((100-q)/2)+"px";F.style.paddingLeft=Math.floor((100-D)/2)+"px";H.appendChild(F)}else if(null!=g){var J=a.stringToCells(Graph.decompress(g.xml));0z?v-1:v,0,f.splice(z,1)[0]),t.insertBefore(t.children[z],t.children[v])): -(f.push(f.splice(z,1)[0]),t.appendChild(t.children[z]));else if(0=c.status&&(m(c.responseText,f,d,l,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0,g.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight))})):(m(c,f,d,l,p,e,g,"fixed",mxEvent.isAltDown(b)?null:g.substring(0, g.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",n);mxEvent.addListener(t,"drop",q);mxEvent.addListener(u,"dragover",n);mxEvent.addListener(u,"drop",q);b.appendChild(t);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);var A=document.createElement("input");A.setAttribute("multiple","multiple");A.setAttribute("type","file");null==document.documentMode&&(mxEvent.addListener(A, -"change",function(b){K=!1;a.importFiles(A.files,0,0,a.maxImageSize,function(a,c,f,d,l,p,e,g,v){H(b)(a,c,f,d,l,p,e,g,v);A.value=""});t.scrollTop=t.scrollHeight}),l=mxUtils.button(mxResources.get("import"),function(){null!=x&&(x(),x=null);A.click()}),l.setAttribute("id","btnAddImage"),l.className="geBtn",d.appendChild(l));l=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=x&&(x(),x=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){K=!1;if(null!=a){if("data:image/"== +"change",function(b){K=!1;a.importFiles(A.files,0,0,a.maxImageSize,function(a,c,f,d,l,p,e,g,v){F(b)(a,c,f,d,l,p,e,g,v);A.value=""});t.scrollTop=t.scrollHeight}),l=mxUtils.button(mxResources.get("import"),function(){null!=x&&(x(),x=null);A.click()}),l.setAttribute("id","btnAddImage"),l.className="geBtn",d.appendChild(l));l=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=x&&(x(),x=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){K=!1;if(null!=a){if("data:image/"== a.substring(0,11)){var f=a.indexOf(",");0
'+mxResources.get("allDiagrams",null,"All diagrams")+'

🛈 '+ mxResources.get("linkToDiagramHint",null,"Add a link to this diagram. The diagram can only be edited from the page that owns it.")+'
'+mxResources.get("create",null,"Create")+'
'+mxResources.get("cancel",null,"Cancel")+"
",c=document.createElement("div");c.innerHTML=a;c.className="geTemplateDlg"; var a=window.innerWidth,b=window.innerHeight,d=987,e=712;.9*a=b.getStatus()&&(c(b.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function y(a){a=a?"":"none";for(var b=H.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;c=b.getStatus()&&(c(b.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function y(a){a=a?"":"none";for(var b=F.querySelectorAll(".geTempDlgLinkToDiagram"),c=0;cg&&(e=e.substring(0,g)+"…");if(c){var m=document.createElement("tr"),x=document.createElement("td"),n=document.createElement("img");n.src="/images/icon-search.svg";n.className="geTempDlgDiagramListPreviewBtn";n.setAttribute("title",mxResources.get("preview"));x.appendChild(n);v=document.createElement("span");v.className="geTempDlgDiagramTitle";v.innerHTML=e;x.appendChild(v);m.appendChild(x);x=document.createElement("td"); @@ -7982,16 +7982,16 @@ x.innerHTML=k;m.appendChild(x);x=document.createElement("td");x.innerHTML=A;m.ap a[l]));k=document.createElement("div");k.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var C=document.createElement("img");C.style.display="none";(function(a,b){C.onload=function(){b.className="geTempDlgDiagramTileImg";a.style.display=""};C.onerror=function(){b.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(C,k);C.src=x;k.appendChild(C);z.appendChild(k);k=document.createElement("div");k.className="geTempDlgDiagramTileLbl";k.innerHTML=null!=e?e:"";z.appendChild(k); n=document.createElement("img");n.src="/images/icon-search.svg";n.className="geTempDlgDiagramPreviewBtn";n.setAttribute("title",mxResources.get("preview"));z.appendChild(n);(function(a,b){mxEvent.addListener(z,"click",function(){E!=b&&(f(),t(b,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(z,"dblclick",u);mxEvent.addListener(n,"click",function(){p(a)})})(a[l],z);U.appendChild(z)}}}function v(a,b){Z.innerHTML="";t();for(var c=!b&&5a.length?"none":""}function x(a){var b=H.querySelector(".geTemplatesList"), +g.src=NEW_DIAGRAM_CATS_PATH+"/"+d.img;e.appendChild(g);l.appendChild(e);e=document.createElement("div");e.className="geTempDlgNewDiagramCatItemLbl";e.innerHTML=p;l.appendChild(e);Z.appendChild(l);(function(a,b){mxEvent.addListener(l,"click",function(){E!=b&&(O.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),y(),t(b,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(l,"dblclick",u)})(d,l)}Q.style.display=5>a.length?"none":""}function x(a){var b=F.querySelector(".geTemplatesList"), c;for(c in a){var f=document.createElement("div"),d=mxResources.get(c),l=a[c];null==d&&(d=c.substring(0,1).toUpperCase()+c.substring(1));f.className="geTemplateCatLink";f.setAttribute("title",d+" ("+l.length+")");d=mxUtils.htmlEntities(d);15>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4);b+="==";break}l=a.charCodeAt(c++);if(c==f){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<< 4|(l&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((l&15)<<2);b+="=";break}p=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4|(l&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((l&15)<<2|(p&192)>>6);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(p&63)}return b}; @@ -8078,23 +8078,23 @@ stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff" font:"#ffffff"},{fill:"#6d8764",stroke:"#3A5431",font:"#ffffff"},{fill:"#647687",stroke:"#314354",font:"#ffffff"},{fill:"#76608a",stroke:"#432D57",font:"#ffffff"},{fill:"#a0522d",stroke:"#6D1F00",font:"#ffffff"}],[null,{fill:mxConstants.NONE,stroke:"#36393d"},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[null,{fill:"#f5f5f5",stroke:"#666666", gradient:"#b3b3b3"},{fill:"#dae8fc",stroke:"#6c8ebf",gradient:"#7ea6e0"},{fill:"#d5e8d4",stroke:"#82b366",gradient:"#97d077"},{fill:"#ffcd28",stroke:"#d79b00",gradient:"#ffa500"},{fill:"#fff2cc",stroke:"#d6b656",gradient:"#ffd966"},{fill:"#f8cecc",stroke:"#b85450",gradient:"#ea6b66"},{fill:"#e6d0de",stroke:"#996185",gradient:"#d5739d"}],[null,{fill:"#eeeeee",stroke:"#36393d"},{fill:"#f9f7ed",stroke:"#36393d"},{fill:"#ffcc99",stroke:"#36393d"},{fill:"#cce5ff",stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"}, {fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(a,b,c){if(null!=b){var f=function(a){if(null!=a)if(c)for(var f=0;f -c.size&&(p=p.slice(0,c.size));b=p.join(",");null!=c.countProperty&&(u.setCellStyles(c.countProperty,p.length,u.getSelectionCells()),d.push(c.countProperty),l.push(p.length))}u.setCellStyles(a,b,u.getSelectionCells());d.push(a);l.push(b);if(null!=c.dependentProps)for(a=0;ab)v=v.slice(0,b);else for(var t=v.length;t +c.size&&(p=p.slice(0,c.size));b=p.join(",");null!=c.countProperty&&(t.setCellStyles(c.countProperty,p.length,t.getSelectionCells()),d.push(c.countProperty),l.push(p.length))}t.setCellStyles(a,b,t.getSelectionCells());d.push(a);l.push(b);if(null!=c.dependentProps)for(a=0;ab)v=v.slice(0,b);else for(var u=v.length;uv.max&&(a=v.max);a=mxUtils.htmlEntities(("int"==y?parseInt(a):a)+"");f(b,a,v)}var p=document.createElement("input");d(n,p,!0);p.value=c;p.className="gePropEditor";"int"!=y&&"float"!=y||v.allowAuto||(p.type="number",p.step="int"==y?"1":"any",null!=v.min&&(p.min=parseFloat(v.min)),null!=v.max&&(p.max=parseFloat(v.max)));a.appendChild(p);mxEvent.addListener(p,"keypress",function(a){13==a.keyCode&&l()}); -p.focus();mxEvent.addListener(p,"blur",function(){l()})})));v.isDeletable&&(t=mxUtils.button("-",mxUtils.bind(x,function(a){f(b,"",v,v.index);mxEvent.consume(a)})),t.style.height="16px",t.style.width="25px",t.style["float"]="right",t.className="geColorBtn",n.appendChild(t));m.appendChild(n);return m}var x=this,u=this.editorUi.editor.graph,t=[];a.style.position="relative";a.style.padding="0";var k=document.createElement("table");k.style.whiteSpace="nowrap";k.style.width="100%";var y=document.createElement("tr"); +p.focus();mxEvent.addListener(p,"blur",function(){l()})})));v.isDeletable&&(u=mxUtils.button("-",mxUtils.bind(x,function(a){f(b,"",v,v.index);mxEvent.consume(a)})),u.style.height="16px",u.style.width="25px",u.style["float"]="right",u.className="geColorBtn",n.appendChild(u));m.appendChild(n);return m}var x=this,t=this.editorUi.editor.graph,u=[];a.style.position="relative";a.style.padding="0";var k=document.createElement("table");k.style.whiteSpace="nowrap";k.style.width="100%";var y=document.createElement("tr"); y.className="gePropHeader";var m=document.createElement("th");m.className="gePropHeaderCell";var n=document.createElement("img");n.src=Sidebar.prototype.expandedImage;m.appendChild(n);mxUtils.write(m,mxResources.get("property"));y.style.cursor="pointer";var A=function(){var b=k.querySelectorAll(".gePropNonHeaderRow"),c;if(x.editorUi.propertiesCollapsed){n.src=Sidebar.prototype.collapsedImage;c="none";for(var f=a.childNodes.length-1;0<=f;f--)try{var d=a.childNodes[f],l=d.nodeName.toUpperCase();"INPUT"!= l&&"SELECT"!=l||a.removeChild(d)}catch(da){}}else n.src=Sidebar.prototype.expandedImage,c="";for(f=0;f
')))}catch(A){}})(); +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 K=document.createElement("canvas"),F=new Image;F.onload=function(){try{K.getContext("2d").drawImage(F,0,0);var a=K.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6
')))}catch(A){}})(); var ErrorDialog=function(a,c,b,d,e,g,k,m,n,q,f){n=null!=n?n:!0;var l=document.createElement("div");l.style.textAlign="center";if(null!=c){var p=document.createElement("div");p.style.padding="0px";p.style.margin="0px";p.style.fontSize="18px";p.style.paddingBottom="16px";p.style.marginBottom="10px";p.style.borderBottom="1px solid #c0c0c0";p.style.color="gray";p.style.whiteSpace="nowrap";p.style.textOverflow="ellipsis";p.style.overflow="hidden";mxUtils.write(p,c);p.setAttribute("title",c);l.appendChild(p)}c= document.createElement("div");c.style.lineHeight="1.2em";c.style.padding="6px";c.innerHTML=b;l.appendChild(c);b=document.createElement("div");b.style.marginTop="12px";b.style.textAlign="center";null!=g&&(c=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();g()}),c.className="geBtn",b.appendChild(c),b.style.textAlign="center");null!=q&&(q=mxUtils.button(q,function(){null!=f&&f()}),q.className="geBtn",b.appendChild(q));var t=mxUtils.button(d,function(){n&&a.hideDialog();null!=e&&e()}); t.className="geBtn";b.appendChild(t);null!=k&&(d=mxUtils.button(k,function(){n&&a.hideDialog();null!=m&&m()}),d.className="geBtn gePrimaryBtn",b.appendChild(d));this.init=function(){t.focus()};l.appendChild(b);this.container=l}; -(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="10.3.0";EditorUi.compactUi="atlas"!=uiTheme;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.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!= +(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="10.3.1";EditorUi.compactUi="atlas"!=uiTheme;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.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(v){}};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!=a?"&data="+encodeURIComponent(JSON.stringify(a)): "")}catch(p){}};EditorUi.sendReport=function(a,b){if("1"==urlParams.dev)EditorUi.debug("sendReport",a);else if(EditorUi.enableLogging)try{b=null!=b?b:5E4,a.length>b&&(a=a.substring(0,b)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(a))}catch(p){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.test){for(var a=[(new Date).toISOString()],b=0;b'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"");!this.editor.isChromelessView()||this.editor.editable? -(this.editor.graph.selectUnlockedLayer(),this.showLayersDialog(),this.restoreLibraries(),window.self!==window.top&&window.focus()):this.editor.graph.isLightboxView()&&this.lightboxFit();this.chromelessResize&&this.chromelessResize();this.editor.fireEvent(new mxEventObject("fileLoaded"));c=!0;this.isOffline()||null==a.getMode()||EditorUi.logEvent({category:"File",action:"open",label:a.getMode()+"."+a.getSize()});if(this.editor.editable&&this.mode==a.getMode()&&a.getMode()!=App.MODE_DEVICE&&null!=a.getMode())try{this.addRecent({id:a.getHash(), -title:a.getTitle(),mode:a.getMode()})}catch(u){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(u){}}catch(u){this.fileLoadedError=u;null!=window.console&&console.log("error in fileLoaded:",a,u);if(EditorUi.enableLogging&&!this.isOffline())try{(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+(null!=u&&null!=u.message?":err:"+ -encodeURIComponent(u.message):"")+(null!=u&&null!=u.stack?"&stack="+encodeURIComponent(u.stack):"")}catch(y){}this.handleError(u,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=b?this.fileLoaded(b):d()}),!0)}else d();return c};EditorUi.prototype.getHashValueForPages=function(a,b){var c=0,d=new mxGraphModel,f=new mxCodec;null!=b&&(b.byteCount=0, -b.attrCount=0,b.eltCount=0,b.nodeCount=0);for(var l=0;l=a.status?y(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):y(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(g.style.border="3px solid transparent",g.style.cursor="");a.stopPropagation();a.preventDefault()})); -m=m.cloneNode(!1);m.setAttribute("src",Editor.editImage);m.setAttribute("title",mxResources.get("edit"));k.insertBefore(m,k.firstChild);mxEvent.addListener(m,"click",J);mxEvent.addListener(g,"dblclick",function(a){mxEvent.getSource(a)==g&&J(a)});c=m.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));k.insertBefore(c,k.firstChild);mxEvent.addListener(c,"click",G);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)})),k.insertBefore(c,k.firstChild))}p.appendChild(k);p.style.paddingRight=18*k.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var c=0;c=a.status?n(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):n(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(g.style.border="3px solid transparent",g.style.cursor="");a.stopPropagation(); +a.preventDefault()}));m=m.cloneNode(!1);m.setAttribute("src",Editor.editImage);m.setAttribute("title",mxResources.get("edit"));k.insertBefore(m,k.firstChild);mxEvent.addListener(m,"click",J);mxEvent.addListener(g,"dblclick",function(a){mxEvent.getSource(a)==g&&J(a)});c=m.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));k.insertBefore(c,k.firstChild);mxEvent.addListener(c,"click",H);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)})),k.insertBefore(c,k.firstChild))}p.appendChild(k);p.style.paddingRight=18*k.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var c=0;cnavigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof f.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),l=65==(g?parseInt(g[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(x){}}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),e=Array(f),l=0;le)?3:4,a,c,d);this.showDialog(b.container,420,1==e?160:4"+a+""):d.document.write(''),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= @@ -8270,9 +8270,9 @@ mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow( 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);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,f){if("_blank"==f||null!=a&&0=e.getStatus())try{this.exportFile(e.getText(),a,g,!0,f,c)}catch(A){this.handleError(A)}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\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,d){var f=document.createElement("div");f.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";f.appendChild(e);var g=document.createElement("div");g.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");g.appendChild(e);var p=document.createElement("span");mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(p);mxUtils.br(g);g.appendChild(l);p=document.createElement("span");mxUtils.write(p,mxResources.get("publicDiagramUrl"));g.appendChild(p);var k=this.getCurrentFile(); null==c&&null!=k&&k.constructor==window.DriveFile&&(p=document.createElement("a"),p.style.paddingLeft="12px",p.style.color="gray",p.setAttribute("href","javascript:void(0);"),mxUtils.write(p,mxResources.get("share")),g.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(k.getId())})));e.setAttribute("checked","checked");null==c&&l.setAttribute("disabled","disabled");f.appendChild(g);var m=this.addLinkSection(f),n=this.addCheckbox(f, -mxResources.get("zoom"),!0,null,!0);mxUtils.write(f,":");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%";f.appendChild(t);var q=this.addCheckbox(f,mxResources.get("fit"),!0),g=null!=this.pages&&1\n\n')+ mxUtils.getXml(a))}));else return(d?"":'\n\n')+mxUtils.getXml(g)};EditorUi.prototype.exportImage=function(a,b,c,d,e,g,k,v,x){x=null!=x?x:"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,v):null,x)}catch(H){"Invalid image"==H.message?this.downloadFile(x):this.handleError(H)}}),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)}catch(K){this.spinner.stop(),this.handleError(K)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var b=function(a){return a.replace(RegExp("^[\\s\"']+","g"), +try{this.saveCanvas(a,e?this.getFileData(!0,null,null,null,c,v):null,x)}catch(F){"Invalid image"==F.message?this.downloadFile(x):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)}catch(K){this.spinner.stop(),this.handleError(K)}}};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 e=[c[0]],g=1;g=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),e=0;e=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),e=0;e=a.status?p(a.responseText):null!=v&&v(null))}),k)):/(\.v(sd|dx))($|\?)/i.test(k)||/(\.vs(s|x))($|\?)/i.test(k)|| (l=this.insertTextAt(this.validateFileData(a),c,d,!0,null,n));f||null==v||v(l);return l};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,f,e,g;c>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&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,v,m,n,q,H){b=null!=b?b:0;c=null!=c?c:0;d=null!=d?d:this.maxImageSize;n=null!=n?n:this.maxImageBytes;var f=null!=b&&null!=c,l=!0,p=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var x=q||this.resampleThreshold,t=0;tx){p=!0;break}var u=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,g,l,k,p){return null!=a&&"x){p=!0;break}var u=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,g,l,k,p){return null!=a&&"','',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage|| @@ -8369,14 +8369,14 @@ null!=c&&(d.onerror=c);d.src=a};var k=EditorUi.prototype.init;EditorUi.prototype function(){c.apply(this,arguments)};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var d=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(b){b=null!=b?b:"";if(null!=a.pages&&null!=a.currentPage)for(var c=0;c=a.status&&"=a.status&&"mxUtils.indexOf(d,a)};this.executeLayout(function(){na.execute(B.getDefaultParent()); ra()},!0,I);I=null}else if("horizontaltree"==V||"verticaltree"==V||"auto"==V&&ca.length==2*d.length-1&&1==ha.length){B.view.validate();var oa=new mxCompactTreeLayout(B,"horizontaltree"==V);oa.levelDistance=E;oa.edgeRouting=!1;oa.resetEdges=!1;this.executeLayout(function(){oa.execute(B.getDefaultParent(),0d.length){B.view.validate();var la=new mxFastOrganicLayout(B);la.forceConstant=3*E;la.resetEdges=!1;var ua=la.isVertexIgnored;la.isVertexIgnored=function(a){return ua.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ma=new mxParallelEdgeLayout(B); +mxConstants.DIRECTION_NORTH);ka.intraCellSpacing=E;ka.parallelEdgeSpacing=J;ka.interRankCellSpacing=G;ka.disableEdgeStyle=!1;this.executeLayout(function(){ka.execute(B.getDefaultParent(),ca);B.moveCells(ca,P,Q)},!0,I);I=null}else if("organic"==V||"auto"==V&&ca.length>d.length){B.view.validate();var la=new mxFastOrganicLayout(B);la.forceConstant=3*E;la.resetEdges=!1;var ua=la.isVertexIgnored;la.isVertexIgnored=function(a){return ua.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ma=new mxParallelEdgeLayout(B); ma.spacing=J;this.executeLayout(function(){la.execute(B.getDefaultParent());ra()},!0,I);I=null}this.hideDialog()}finally{B.model.endUpdate()}null!=I&&I()}}catch(ta){this.handleError(ta)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0mxUtils.indexOf(a,d)&&null!=urlParams[d]&&(b+=c+d+"="+urlParams[d],c="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl= function(a){a=null!=a?a:window.location.pathname;var b=0mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,480,130,!0,!0);a.init()};var m= EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=m.apply(this,arguments),c=this.editor.graph,d=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(c.container)&&c.pageVisible&&null!=this.source.minimumGraphSize){var a=this.source.getPagePadding(),b=this.source.view.scale;return new mxRectangle(0,0,Math.ceil(this.source.minimumGraphSize.width-2*a.x/b),Math.ceil(this.source.minimumGraphSize.height-2*a.y/b))}return d.apply(this,arguments)}; @@ -8624,14 +8624,14 @@ a})}))};DriveClient.prototype.loadRealtime=function(a,c,b){"1"==urlParams.ignore DriveClient.prototype.getXmlFile=function(a,c,b,d,e){d=gapi.auth.getToken().access_token;this.ui.loadUrl(a.downloadUrl+"&access_token="+d,mxUtils.bind(this,function(d){try{if(null==d)b({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||e)a.mimeType!=this.libraryMimeType||e?c(new DriveLibrary(this.ui,d,a)):b({message:mxResources.get("notADiagramFile")});else{if(/\.png$/i.test(a.title)){var g=d.lastIndexOf(",");if(0"!==n.substring(0,14)||(d=n)}catch(q){}}}else"data:image/png;base64,PG14ZmlsZS"==d.substring(0,32)&&(n=d.substring(22),d=window.atob&&!mxClient.IS_SF?atob(n):Base64.decode(n));c(new DriveFile(this.ui,d,a))}}catch(q){if(null!=b)b(q);else throw q;}}),b,null!=a.mimeType&&"image/"==a.mimeType.substring(0,6)&&"image/svg"!=a.mimeType.substring(0, 9)||/\.png$/i.test(a.title)||/\.jpe?g$/i.test(a.title))}; -DriveClient.prototype.saveFile=function(a,c,b,d,e,g,k,m){if(a.isEditable()){var n=(new Date).getTime(),q=a.desc.modifiedDate,f=a.desc.headRevisionId,l=a.desc.fileSize,p=this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());e=null!=e?e:!this.ui.isLegacyDriveDomain()||"1"==urlParams.ignoremime;g=null!=g?g:!1;var t=mxUtils.bind(this,function(e,u,v){var x=null,t=!1,y={mimeType:a.desc.mimeType,title:a.getTitle()};this.isGoogleRealtimeMimeType(a.desc.mimeType)&&(y.mimeType=this.xmlMimeType,x=a.desc, -t=c=!0);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)}));v||(null!=e||g||(e=this.placeholderThumbnail,u=this.placeholderMimeType),null!=e&&null!=u&&(y.thumbnail={image:e,mimeType:u}));var H=a.getData(),A=mxUtils.bind(this,function(c){this.executeRequest(gapi.client.drive.files.get({fileId:a.getId(),fields:"modifiedDate,headRevisionId,fileSize", -supportsTeamDrives:!0}),mxUtils.bind(this,function(e){a.saveDelay=(new Date).getTime()-n;var g=(new Date(e.modifiedDate)).getTime()-(new Date(q)).getTime();0>=g?(d({message:mxResources.get("saveNotConfirmed")}),EditorUi.logEvent({category:"UNCONFIRMED-SAVE-GOOGLE",action:"file-"+a.desc.id+"-old-"+f+"."+l+"-new-"+e.headRevisionId+"."+e.fileSize+"-delta-"+g,label:null!=this.user?this.user.id:"unknown-user"})):(b(c,H),null!=x&&(this.executeRequest(gapi.client.drive.revisions.get({fileId:x.id,revisionId:x.headRevisionId, +DriveClient.prototype.saveFile=function(a,c,b,d,e,g,k,m){if(a.isEditable()){var n=(new Date).getTime(),q=a.desc.modifiedDate,f=a.desc.headRevisionId,l=a.desc.fileSize,p=this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());e=null!=e?e:!this.ui.isLegacyDriveDomain()||"1"==urlParams.ignoremime;g=null!=g?g:!1;var t=mxUtils.bind(this,function(e,t,v){var x=null,u=!1,y={mimeType:a.desc.mimeType,title:a.getTitle()};this.isGoogleRealtimeMimeType(a.desc.mimeType)&&(y.mimeType=this.xmlMimeType,x=a.desc, +u=c=!0);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)}));v||(null!=e||g||(e=this.placeholderThumbnail,t=this.placeholderMimeType),null!=e&&null!=t&&(y.thumbnail={image:e,mimeType:t}));var F=a.getData(),A=mxUtils.bind(this,function(c){this.executeRequest(gapi.client.drive.files.get({fileId:a.getId(),fields:"modifiedDate,headRevisionId,fileSize", +supportsTeamDrives:!0}),mxUtils.bind(this,function(e){a.saveDelay=(new Date).getTime()-n;var g=(new Date(e.modifiedDate)).getTime()-(new Date(q)).getTime();0>=g?(d({message:mxResources.get("saveNotConfirmed")}),EditorUi.logEvent({category:"UNCONFIRMED-SAVE-GOOGLE",action:"file-"+a.desc.id+"-old-"+f+"."+l+"-new-"+e.headRevisionId+"."+e.fileSize+"-delta-"+g,label:null!=this.user?this.user.id:"unknown-user"})):(b(c,F),null!=x&&(this.executeRequest(gapi.client.drive.revisions.get({fileId:x.id,revisionId:x.headRevisionId, supportsTeamDrives:!0}),mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest(gapi.client.drive.revisions.update({fileId:x.id,revisionId:x.headRevisionId,resource:a}))}))),EditorUi.logEvent({category:"RT-CONVERT-"+a.convertedFrom,action:"from-"+x.id+"."+x.headRevisionId+"-to-"+a.desc.id+"."+a.desc.headRevisionId+"-",label:null!=this.user?this.user.id:"unknown-user"})))}))}),z=mxUtils.bind(this,function(b,f){null!=m&&(y.properties=m);var g=k||a.constructor!=DriveFile||"manual"!= -DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),l=0,n=mxUtils.bind(this,function(e){var k=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType;this.executeRequest(this.createUploadRequest(a.getId(),y,b,c||e||k,f,e?null:g,t),A,mxUtils.bind(this,function(b){a.isConflict(b)?this.executeRequest(gapi.client.drive.files.get({fileId:a.getId(),fields:this.catchupFields,supportsTeamDrives:!0}),mxUtils.bind(this,function(c){if(null!=c&&c.etag== +DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),l=0,n=mxUtils.bind(this,function(e){var k=a.desc.mimeType!=this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType;this.executeRequest(this.createUploadRequest(a.getId(),y,b,c||e||k,f,e?null:g,u),A,mxUtils.bind(this,function(b){a.isConflict(b)?this.executeRequest(gapi.client.drive.files.get({fileId:a.getId(),fields:this.catchupFields,supportsTeamDrives:!0}),mxUtils.bind(this,function(c){if(null!=c&&c.etag== g)if(lthis.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g, +function(a){z(a,!0)}),d,this.ui.getCurrentFile()!=a?F:null):z(F,!1)}),u=mxUtils.bind(this,function(){(g||p||a.constructor==DriveLibrary||!this.enableThumbnails||"0"==urlParams.thumb||null!=a.desc.mimeType&&"application/vnd.jgraph.mxfile"!=a.desc.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(a){var b=null;if(null!=a)try{b=a.toDataURL("image/png")}catch(v){}b=null==b||b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g, "_");t(b,"image/png")})))&&t(null,null,a.constructor!=DriveLibrary)});e||!c?u():this.verifyMimeType(a.getId(),u,!0)}else this.ui.editor.graph.reset(),null!=d&&d({message:mxResources.get("readOnly")})}; DriveClient.prototype.verifyMimeType=function(a,c,b,d){null==this.lastMimeCheck&&(this.lastMimeCheck=0);var e=(new Date).getTime();if(b||e-this.lastMimeCheck>this.mimeTypeCheckCoolOff)this.lastMimeCheck=e,this.checkingMimeType||(this.checkingMimeType=!0,this.executeRequest(gapi.client.drive.files.get({fileId:a,fields:"mimeType",supportsTeamDrives:!0}),mxUtils.bind(this,function(b){this.checkingMimeType=!1;null!=b&&"application/vnd.jgraph.mxfile.realtime"==b.mimeType?this.redirectToNewApp(d,a):null!= c&&c()})))}; @@ -8854,7 +8854,7 @@ App.prototype.createBackground=function(){var a=this.createDiv("background");a.s this.appIcon.style.cursor="pointer"):c==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor="default")}if(b)try{if(isLocalStorage)localStorage.setItem(".mode",c);else if("undefined"!=typeof Storage){var e=new Date;e.setYear(e.getFullYear()+1);document.cookie="MODE="+c+"; expires="+e.toUTCString()}}catch(g){}}})(); App.prototype.appIconClicked=function(a){if(mxEvent.isAltDown(a))this.showSplash(!0);else{var c=this.getCurrentFile(),b=null!=c?c.getMode():null;b==App.MODE_GOOGLE?null!=c&&null!=c.desc&&null!=c.desc.parents&&0=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var a=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var a=mxUtils.bind(this,function(a){"data:image/png;base64,"==a.substring(0,22)&&(a=this.extractGraphModelFromPng(a));var b=urlParams.title,b=null!=b?decodeURIComponent(b): -this.defaultFilename;a=new LocalFile(this,a,b,!0);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(a.getHash=function(){return window.location.hash.substring(1)});this.fileLoaded(a);this.getCurrentFile().setModified(!this.editor.chromeless)}),b=window.opener||window.parent;if(b!=window){var c=urlParams.create;null!=c?a(b[decodeURIComponent(c)]):(c=urlParams.data,null!=c?a(decodeURIComponent(c)):this.installMessageHandler(mxUtils.bind(this,function(c,d){d.source==b&&a(c)})))}}else if(null== -this.dialog)if("1"==urlParams.demo)c=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=c;else{c=!1;try{c=null!=window.opener&&null!=window.opener.openFile}catch(q){}if(c)this.spinner.spin(document.body,mxResources.get("loading"));else if(c=this.getDiagramId(),"0"!=urlParams.splash||null!=c&&0!=c.length)this.loadFile(c);else if(!mxClient.IS_CHROMEAPP){var d=this.getDraft(),n=null!=d?d.data:this.getFileData(),c=Editor.useLocalStorage; -this.createFile(this.defaultFilename,n,null,null,null,null,null,!0);Editor.useLocalStorage=c;null!=d&&(c=this.getCurrentFile(),null!=c&&c.addUnsavedStatus())}}}),c=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&null!=c&&0=a?4:3,b=new CreateDialog(this,b,mxUtils.bind(this,function(a,b){if(null==b){this.hideDialog();var c=Editor.useLocalStorage;this.createFile(0c?390:270,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&this.showSplash()}));b.init()}}),c=decodeURIComponent(c);if("http://"!=c.substring(0,7)&&"https://"!=c.substring(0,8))try{null!= -window.opener&&null!=window.opener[c]?d(window.opener[c]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(e){this.handleError(e,mxResources.get("errorLoadingFile"))}else this.loadTemplate(c,function(a){d(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),b)}))}else(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action&&null!=this.stateArg.ids&&(window.location.hash= +App.prototype.start=function(){this.bg.parentNode.removeChild(this.bg);this.restoreLibraries();this.spinner.stop();try{if("1"!=urlParams.client&&"1"!=urlParams.embed&&mxEvent.addListener(window,"hashchange",mxUtils.bind(this,function(a){try{var b=this.getDiagramId(),c=this.getCurrentFile();console.log("hashchange",b,c.getHash());null!=c&&c.getHash()==b||this.loadFile(b,!0)}catch(m){null!=document.body&&this.handleError(m,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile(); +window.location.hash=null!=a?a.getHash():""}))}})),(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.url)this.loadFile("U"+urlParams.url,!0);else if(null==this.getCurrentFile()){var a=mxUtils.bind(this,function(){if("1"==urlParams.client&&(null==window.location.hash||0==window.location.hash.length||"#P"==window.location.hash.substring(0,2))){var a=mxUtils.bind(this,function(a){"data:image/png;base64,"==a.substring(0,22)&&(a=this.extractGraphModelFromPng(a));var b=urlParams.title, +b=null!=b?decodeURIComponent(b):this.defaultFilename;a=new LocalFile(this,a,b,!0);null!=window.location.hash&&"#P"==window.location.hash.substring(0,2)&&(a.getHash=function(){return window.location.hash.substring(1)});this.fileLoaded(a);this.getCurrentFile().setModified(!this.editor.chromeless)}),b=window.opener||window.parent;if(b!=window){var c=urlParams.create;null!=c?a(b[decodeURIComponent(c)]):(c=urlParams.data,null!=c?a(decodeURIComponent(c)):this.installMessageHandler(mxUtils.bind(this,function(c, +d){d.source==b&&a(c)})))}}else if(null==this.dialog)if("1"==urlParams.demo)c=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,!0),Editor.useLocalStorage=c;else{c=!1;try{c=null!=window.opener&&null!=window.opener.openFile}catch(q){}if(c)this.spinner.spin(document.body,mxResources.get("loading"));else if(c=this.getDiagramId(),"0"!=urlParams.splash||null!=c&&0!=c.length)this.loadFile(c);else if(!mxClient.IS_CHROMEAPP){var d=this.getDraft(),n=null!=d?d.data:this.getFileData(), +c=Editor.useLocalStorage;this.createFile(this.defaultFilename,n,null,null,null,null,null,!0);Editor.useLocalStorage=c;null!=d&&(c=this.getCurrentFile(),null!=c&&c.addUnsavedStatus())}}}),c=decodeURIComponent(urlParams.create||"");if((null==window.location.hash||1>=window.location.hash.length)&&null!=c&&0=a?4:3,b=new CreateDialog(this,b,mxUtils.bind(this,function(a,b){if(null==b){this.hideDialog();var c=Editor.useLocalStorage;this.createFile(0c?390:270,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&this.showSplash()}));b.init()}}),c=decodeURIComponent(c);if("http://"!=c.substring(0,7)&&"https://"!=c.substring(0, +8))try{null!=window.opener&&null!=window.opener[c]?d(window.opener[c]):this.handleError(null,mxResources.get("errorLoadingFile"))}catch(e){this.handleError(e,mxResources.get("errorLoadingFile"))}else this.loadTemplate(c,function(a){d(a)},mxUtils.bind(this,function(){this.handleError(null,mxResources.get("errorLoadingFile"),b)}))}else(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.state&&null!=this.stateArg&&"open"==this.stateArg.action&&null!=this.stateArg.ids&&(window.location.hash= "G"+this.stateArg.ids[0]),(null==window.location.hash||1>=window.location.hash.length)&&null!=this.drive&&null!=this.stateArg&&"create"==this.stateArg.action?(this.setMode(App.MODE_GOOGLE),this.actions.get("new").funct()):a()}}catch(e){this.handleError(e)}}; App.prototype.showSplash=function(a){var c=this.getServiceCount(!0,!0),b=mxUtils.bind(this,function(){var a=new SplashDialog(this);this.showDialog(a.container,340,2>c||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?200:260,!0,!0,mxUtils.bind(this,function(a){a&&!mxClient.IS_CHROMEAPP&&(a=Editor.useLocalStorage,this.createFile(this.defaultFilename,null,null,null,null,null,null,"1"!=urlParams.local),Editor.useLocalStorage=a)}),!0)});if(this.editor.isChromelessView())this.handleError({message:mxResources.get("noFileSelected")}, mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){this.showSplash()}));else if(mxClient.IS_CHROMEAPP||null!=this.mode&&!a)null==urlParams.create&&b();else{a=4==c?2:3;var d=new StorageDialog(this,mxUtils.bind(this,function(){this.hideDialog();b()}),a);this.showDialog(d.container,3>a?260:300,4<=c?420:300,!0,!1);d.init()}}; @@ -8893,10 +8893,11 @@ function(){b.save(!0,mxUtils.bind(this,function(a){this.spinner.stop();this.hide App.prototype.saveFile=function(a,c){var b=this.getCurrentFile();if(null!=b){var d=mxUtils.bind(this,function(){this.removeDraft();this.getCurrentFile()==b||b.isModified()||(b.getMode()!=App.MODE_DEVICE?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):this.editor.setStatus(""));null!=c&&c()});if(a||null==b.getTitle()||null==this.mode){var e=null!=b.getTitle()?b.getTitle():this.defaultFilename,g=!mxClient.IS_IOS||!navigator.standalone,k=this.mode,m=this.getServiceCount(!0); isLocalStorage&&m++;var n=4>=m?2:6a.indexOf(".")||/(\.drawio)$/i.test(a),/(\.svg)$/i.test(a),/(\.html)$/i.test(a)),null,b,d,null==this.mode,c)})):null!=b&&this.save(a,d))}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),null,null,g,this.isOffline()?null:"https://desk.draw.io/support/solutions/articles/16000042485",!0,n,null,null,null,this.editor.fileExtensions);this.showDialog(e.container,460,m>n?390:270,!0,!0);e.init()}else this.save(b.getTitle(), -d)}}; -App.prototype.loadTemplate=function(a,c,b,d){var e=a;this.editor.isCorsEnabledForUrl(e)||(e="t="+(new Date).getTime(),e=PROXY_URL+"?url="+encodeURIComponent(a)+"&"+e);var g=null!=d?d:a;this.loadUrl(e,mxUtils.bind(this,function(d){/(\.v(dx|sdx?))($|\?)/i.test(g)?this.importVisio(this.base64ToBlob(d.substring(d.indexOf(",")+1)),function(a){c(a)},b,g):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,g)?this.parseFile(new Blob([d],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4== -a.readyState&&200<=a.status&&299>=a.status&&"=a.status&&"k&&0mxUtils.indexOf(l,this.model.getTerminal(l[q],!0))&&this.model.setTerminal(l[q],m,!0);else if(b(a[q])&&(v=u.getIncomingEdges(a[q]),0mxUtils.indexOf(a,this.model.getTerminal(v[0],!0))&&this.model.setTerminal(v[0],m,!0);else if(0==u.getIncomingEdges(l[q]).length){n=m;if(null==n||n==u.model.getParent(a[q]))n=u.model.getTerminal(v[0],!0);e=this.cloneCell(v[0]);this.addEdge(e,u.getDefaultParent(),n,l[q])}}finally{this.model.endUpdate()}return l};if(null!=t.sidebar){var K=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(a,c,d,e){var f=u.model,g=null;f.beginUpdate();try{if(g=K.apply(this,arguments),b(a))for(var k=0;kmxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var J= mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){J.apply(this,arguments);b(this.state.cell)&&0this.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 F=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){F.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle), +var E=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){E.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 G=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){G.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle), this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var d=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=d.apply(this,arguments),b=this.graph;return a.concat([this.addEntry("tree container",function(){var a=new mxCell("Tree Container",new mxGeometry(0,0,220,160),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea branch topic", function(){var a=new mxCell("Mindmap",new mxGeometry(0,0,420,126),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Central Idea",new mxGeometry(160,60,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");b.vertex=!0;var c=new mxCell("Topic",new mxGeometry(320,40,80,20),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;"); c.vertex=!0;var d=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");d.geometry.relative=!0;d.edge=!0;b.insertEdge(d,!0);c.insertEdge(d,!1);var e=new mxCell("Branch",new mxGeometry(320,80,72,26),"whiteSpace=wrap;html=1;shape=partialRectangle;top=0;left=0;bottom=1;right=0;points=[[0,1],[1,1]];strokeColor=#000000;fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;container=1;recursiveResize=0;autosize=1;treeFolding=1;"); @@ -9222,18 +9223,18 @@ null],60)}c=k.menus.get("language");null!=c&&!mxClient.IS_CHROMEAPP&&!EditorUi.i c(this);var k=this,l=k.editor.graph;k.toolbar=this.createToolbar(k.createDiv("geToolbar"));k.defaultLibraryName=mxResources.get("untitledLibrary");var m=document.createElement("div");m.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 n=null,p=new Menubar(k,m);k.statusContainer=k.createStatusContainer();k.statusContainer.style.position="relative";k.statusContainer.style.maxWidth= "";k.statusContainer.style.marginTop="7px";k.statusContainer.style.marginLeft="6px";k.statusContainer.style.color="gray";k.statusContainer.style.cursor="default";k.editor.addListener("statusChanged",mxUtils.bind(this,function(){k.setStatusText(k.editor.getStatus())}));var q=k.descriptorChanged;k.descriptorChanged=function(){q.apply(this,arguments);var a=k.getCurrentFile();if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==b?b="gitHub":"onedrive"==b&&(b="oneDrive"); b=mxResources.get(b);m.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else m.removeAttribute("title")};k.setStatusText(k.editor.getStatus());m.appendChild(k.statusContainer);k.buttonContainer=document.createElement("div");k.buttonContainer.style.cssText="position:absolute;right:0px;padding-right:34px;top:10px;white-space:nowrap;padding-top:2px;background-color:inherit;";m.appendChild(k.buttonContainer);k.menubarContainer=k.buttonContainer;k.tabContainer=document.createElement("div");k.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 g=k.diagramContainer.parentNode,t=document.createElement("div");t.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";k.diagramContainer.style.top="47px";var G=k.menus.get("viewZoom");if(null!=G){this.tabContainer.style.right="70px";var B=p.addMenu("100%", -G.funct);B.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");B.style.whiteSpace="nowrap";B.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";B.style.backgroundPosition="right 6px center";B.style.backgroundRepeat="no-repeat";B.style.backgroundColor="#ffffff";B.style.paddingRight="10px";B.style.display="block";B.style.position="absolute";B.style.textDecoration="none";B.style.textDecoration="none";B.style.right="0px";B.style.bottom="0px";B.style.overflow="hidden";B.style.visibility= -"hidden";B.style.textAlign="center";B.style.color="#000";B.style.fontSize="12px";B.style.color="#707070";B.style.width="59px";B.style.borderTop="1px solid lightgray";B.style.borderLeft="1px solid lightgray";B.style.height=parseInt(k.tabContainer.style.height)-1+"px";B.style.lineHeight=parseInt(k.tabContainer.style.height)+1+"px";t.appendChild(B);G=mxUtils.bind(this,function(){B.innerHTML=Math.round(100*k.editor.graph.view.scale)+"%"});k.editor.graph.view.addListener(mxEvent.EVENT_SCALE,G);k.editor.addListener("resetGraphView", -G);k.editor.addListener("pageSelected",G);var I=k.setGraphEnabled;k.setGraphEnabled=function(){I.apply(this,arguments);null!=this.tabContainer&&(B.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?"30px":"0px")}}t.appendChild(k.tabContainer);t.appendChild(m);t.appendChild(k.diagramContainer);g.appendChild(t);k.updateTabContainer();var M=null;f();mxEvent.addListener(window,"resize",function(){f();null!=k.sidebarWindow&& +"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 g=k.diagramContainer.parentNode,t=document.createElement("div");t.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";k.diagramContainer.style.top="47px";var H=k.menus.get("viewZoom");if(null!=H){this.tabContainer.style.right="70px";var B=p.addMenu("100%", +H.funct);B.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");B.style.whiteSpace="nowrap";B.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";B.style.backgroundPosition="right 6px center";B.style.backgroundRepeat="no-repeat";B.style.backgroundColor="#ffffff";B.style.paddingRight="10px";B.style.display="block";B.style.position="absolute";B.style.textDecoration="none";B.style.textDecoration="none";B.style.right="0px";B.style.bottom="0px";B.style.overflow="hidden";B.style.visibility= +"hidden";B.style.textAlign="center";B.style.color="#000";B.style.fontSize="12px";B.style.color="#707070";B.style.width="59px";B.style.borderTop="1px solid lightgray";B.style.borderLeft="1px solid lightgray";B.style.height=parseInt(k.tabContainer.style.height)-1+"px";B.style.lineHeight=parseInt(k.tabContainer.style.height)+1+"px";t.appendChild(B);H=mxUtils.bind(this,function(){B.innerHTML=Math.round(100*k.editor.graph.view.scale)+"%"});k.editor.graph.view.addListener(mxEvent.EVENT_SCALE,H);k.editor.addListener("resetGraphView", +H);k.editor.addListener("pageSelected",H);var I=k.setGraphEnabled;k.setGraphEnabled=function(){I.apply(this,arguments);null!=this.tabContainer&&(B.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?"30px":"0px")}}t.appendChild(k.tabContainer);t.appendChild(m);t.appendChild(k.diagramContainer);g.appendChild(t);k.updateTabContainer();var M=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,g,k){var d=c.y,e=c.x,q=!1,f=!1;if(null!=this.states&&null!=b&&null!=c){var l=this,p=new mxCellState,t=this.graph.getView().scale,u=Math.max(2,this.getGuideTolerance()/2);p.x=b.x+e;p.y=b.y+d;p.width=b.width;p.height=b.height;for(var y=[],z=[],v=0;v=x.x&&p.x<=x.x+x.width||x.x>=p.x&&x.x<=p.x+p.width)&&(p.y> -x.y+x.height+4||p.y+p.height+4=x.y&&p.y<=x.y+x.height||x.y>=p.y&&x.y<=p.y+p.height)&&(p.x>x.x+x.width+4||p.x+p.width+4=x.y&&p.y<=x.y+x.height||x.y>=p.y&&x.y<=p.y+p.height)&&(p.x>x.x+x.width+4||p.x+p.width+4 1 && id.charAt(0) == 'T') + { + var idx = id.indexOf('#'); + + if (idx > 0) + { + id = id.substring(0, idx); + } + } + return id; }; @@ -2225,6 +2236,9 @@ App.prototype.start = function() { var id = this.getDiagramId(); var file = this.getCurrentFile(); + + console.log('hashchange', id, file.getHash()); + if (file == null || file.getHash() != id) { @@ -3137,6 +3151,28 @@ App.prototype.saveFile = function(forceDialog, success) } }; +/** + * Returns true if the given binary data is a Visio file. + */ +App.prototype.isVisioData = function(data) +{ + return data.length > 8 && (data.charCodeAt(0) == 0xD0 && data.charCodeAt(1) == 0xCF && + data.charCodeAt(2) == 0x11 && data.charCodeAt(3) == 0xE0 && data.charCodeAt(4) == 0xA1 && data.charCodeAt(5) == 0xB1 && + data.charCodeAt(6) == 0x1A && data.charCodeAt(7) == 0xE1) || (data.charCodeAt(0) == 0x50 && data.charCodeAt(1) == 0x4B && + data.charCodeAt(2) == 0x03 && data.charCodeAt(3) == 0x04) || (data.charCodeAt(0) == 0x50 && data.charCodeAt(1) == 0x4B && + data.charCodeAt(2) == 0x03 && data.charCodeAt(3) == 0x06); +}; + +/** + * Returns true if the given binary data is a PNG file. + */ +App.prototype.isPngData = function(data) +{ + return data.length > 8 && data.charCodeAt(0) == 137 && data.charCodeAt(1) == 80 && + data.charCodeAt(2) == 78 && data.charCodeAt(3) == 71 && data.charCodeAt(4) == 13 && + data.charCodeAt(5) == 10 && data.charCodeAt(6) == 26 && data.charCodeAt(7) == 10; +}; + /** * Translates this point by the given vector. * @@ -3145,57 +3181,70 @@ App.prototype.saveFile = function(forceDialog, success) */ App.prototype.loadTemplate = function(url, onload, onerror, templateFilename) { + var base64 = false; var realUrl = url; if (!this.editor.isCorsEnabledForUrl(realUrl)) { + // Always uses base64 response to check magic numbers for file type var nocache = 't=' + new Date().getTime(); - realUrl = PROXY_URL + '?url=' + encodeURIComponent(url) + '&' + nocache; + realUrl = PROXY_URL + '?url=' + encodeURIComponent(url) + '&base64=1&' + nocache; + base64 = true; } var filterFn = (templateFilename != null) ? templateFilename : url; - this.loadUrl(realUrl, mxUtils.bind(this, function(data) + this.loadUrl(realUrl, mxUtils.bind(this, function(responseData) { - if (/(\.v(dx|sdx?))($|\?)/i.test(filterFn)) + try { - this.importVisio(this.base64ToBlob(data.substring(data.indexOf(',') + 1)), function(xml) + var data = (!base64) ? responseData : ((window.atob && !mxClient.IS_IE && !mxClient.IS_IE11) ? + atob(responseData) : Base64.decode(responseData)); + + if (/(\.v(dx|sdx?))($|\?)/i.test(filterFn) || this.isVisioData(data)) { - onload(xml); - }, onerror, filterFn); - } - else if (!this.isOffline() && new XMLHttpRequest().upload && this.isRemoteFileFormat(data, filterFn)) - { - // Asynchronous parsing via server - this.parseFile(new Blob([data], {type: 'application/octet-stream'}), mxUtils.bind(this, function(xhr) + this.importVisio(this.base64ToBlob(data.substring(data.indexOf(',') + 1)), function(xml) + { + onload(xml); + }, onerror, filterFn); + } + else if (!this.isOffline() && new XMLHttpRequest().upload && this.isRemoteFileFormat(data, filterFn)) { - if (xhr.readyState == 4 && xhr.status >= 200 && xhr.status <= 299 && - xhr.responseText.substring(0, 13) == '= 200 && xhr.status <= 299 && + xhr.responseText.substring(0, 13) == ' 0) + if (!noDialogs && window.location.hash != null && window.location.hash.length > 0) { window.location.hash = ''; } @@ -2185,7 +2185,11 @@ this.editor.setStatus(''); this.updateUi(); - this.showSplash(); + + if (!noDialogs) + { + this.showSplash(); + } }); if (file != null) @@ -2319,7 +2323,7 @@ } // Asynchronous handling of errors - this.handleError(e, mxResources.get('errorLoadingFile'), mxUtils.bind(this, function() + var fn = mxUtils.bind(this, function() { // Removes URL parameter and reloads the page if (urlParams['url'] != null && this.spinner.spin(document.body, mxResources.get('reconnecting'))) @@ -2334,7 +2338,16 @@ { noFile(); } - }), true); + }); + + if (!noDialogs) + { + this.handleError(e, mxResources.get('errorLoadingFile'), fn, true); + } + else + { + fn(); + } } } else @@ -6306,12 +6319,12 @@ /** * Checks if the client is authorized and calls the next step. */ - EditorUi.prototype.loadUrl = function(url, success, error, forceBinary, retry, dataUriPrefix) + EditorUi.prototype.loadUrl = function(url, success, error, forceBinary, retry, dataUriPrefix, noBinary) { try { - var binary = forceBinary || /(\.png)($|\?)/i.test(url) || - /(\.jpe?g)($|\?)/i.test(url) || /(\.gif)($|\?)/i.test(url); + var binary = !noBinary && (forceBinary || /(\.png)($|\?)/i.test(url) || + /(\.jpe?g)($|\?)/i.test(url) || /(\.gif)($|\?)/i.test(url)); retry = (retry != null) ? retry : true; var fn = mxUtils.bind(this, function() diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.js index f942d1eff7..23dd170677 100644 --- a/src/main/webapp/js/viewer.min.js +++ b/src/main/webapp/js/viewer.min.js @@ -2003,11 +2003,11 @@ Editor.prototype.setFilename=function(a){this.filename=a}; Editor.prototype.createUndoManager=function(){var a=this.graph,b=new mxUndoManager;this.undoListener=function(a,e){b.undoableEditHappened(e.getProperty("edit"))};var e=mxUtils.bind(this,function(a,b){this.undoListener.apply(this,arguments)});a.getModel().addListener(mxEvent.UNDO,e);a.getView().addListener(mxEvent.UNDO,e);e=function(b,e){var d=a.getSelectionCellsForChanges(e.getProperty("edit").changes);a.getModel();for(var k=[],t=0;tdocument.documentMode)&&(c=80);e+=c;d+=c;var f=e,g=d,n=mxUtils.getDocumentSize(),l=n.height,p=Math.max(1,Math.round((n.width-e-64)/2)),B=Math.max(1,Math.round((l-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(b.style.maxHeight="100%");e=null!=document.body?Math.min(e,document.body.scrollWidth-64):e;d=Math.min(d,l-64);0v.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=B+14+"px",m.style.left=p+e+38-c+"px",m.style.zIndex=this.zIndex,mxEvent.addListener(m,"click",mxUtils.bind(this,function(){a.hideDialog(!0)})), -document.body.appendChild(m),this.dialogImg=m,mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){if(null!=A){var n=A();null!=n&&(f=e=n.w,g=d=n.h)}n=mxUtils.getDocumentSize();l=n.height;this.bg.style.height=l+"px";p=Math.max(1,Math.round((n.width-e-64)/2));B=Math.max(1,Math.round((l-d-a.footerHeight)/3));e=null!=document.body?Math.min(f,document.body.scrollWidth-64):f;d=Math.min(g,l-64);n=this.getPosition(p, -B,e,d);p=n.x;B=n.y;v.style.left=p+"px";v.style.top=B+"px";v.style.width=e+"px";v.style.height=d+"px";!t&&b.clientHeight>v.clientHeight-64&&(b.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=B+14+"px",this.dialogImg.style.left=p+e+38-c+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=r;this.container=v;a.editor.fireEvent(new mxEventObject("showDialog"))}Dialog.backdropColor="white";Dialog.prototype.zIndex=mxPopupMenu.prototype.zIndex-1; +function Dialog(a,b,e,d,k,m,q,t,v,A){var c=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(c=80);e+=c;d+=c;var f=e,g=d,n=mxUtils.getDocumentSize(),l=n.height,p=Math.max(1,Math.round((n.width-e-64)/2)),z=Math.max(1,Math.round((l-d-a.footerHeight)/3));mxClient.IS_QUIRKS||(b.style.maxHeight="100%");e=null!=document.body?Math.min(e,document.body.scrollWidth-64):e;d=Math.min(d,l-64);0x.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=z+14+"px",m.style.left=p+e+38-c+"px",m.style.zIndex=this.zIndex,mxEvent.addListener(m,"click",mxUtils.bind(this,function(){a.hideDialog(!0)})), +document.body.appendChild(m),this.dialogImg=m,mxEvent.addGestureListeners(this.bg,null,null,mxUtils.bind(this,function(c){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){if(null!=A){var n=A();null!=n&&(f=e=n.w,g=d=n.h)}n=mxUtils.getDocumentSize();l=n.height;this.bg.style.height=l+"px";p=Math.max(1,Math.round((n.width-e-64)/2));z=Math.max(1,Math.round((l-d-a.footerHeight)/3));e=null!=document.body?Math.min(f,document.body.scrollWidth-64):f;d=Math.min(g,l-64);n=this.getPosition(p, +z,e,d);p=n.x;z=n.y;x.style.left=p+"px";x.style.top=z+"px";x.style.width=e+"px";x.style.height=d+"px";!t&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=z+14+"px",this.dialogImg.style.left=p+e+38-c+"px")});mxEvent.addListener(window,"resize",this.resizeListener);this.onDialogClose=q;this.container=x;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"; Dialog.prototype.clearImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDQAKAIABAMDAwP///yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6OUIzOEM1NzI4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6OUIzOEM1NzM4NjEyMTFFMUEzMkNDMUE3NjZERDE2QjIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5QjM4QzU3MDg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5QjM4QzU3MTg2MTIxMUUxQTMyQ0MxQTc2NkREMTZCMiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PgH//v38+/r5+Pf29fTz8vHw7+7t7Ovq6ejn5uXk4+Lh4N/e3dzb2tnY19bV1NPS0dDPzs3My8rJyMfGxcTDwsHAv769vLu6ubi3trW0s7KxsK+urayrqqmop6alpKOioaCfnp2cm5qZmJeWlZSTkpGQj46NjIuKiYiHhoWEg4KBgH9+fXx7enl4d3Z1dHNycXBvbm1sa2ppaGdmZWRjYmFgX15dXFtaWVhXVlVUU1JRUE9OTUxLSklIR0ZFRENCQUA/Pj08Ozo5ODc2NTQzMjEwLy4tLCsqKSgnJiUkIyIhIB8eHRwbGhkYFxYVFBMSERAPDg0MCwoJCAcGBQQDAgEAACH5BAEAAAEALAAAAAANAAoAAAIXTGCJebD9jEOTqRlttXdrB32PJ2ncyRQAOw==":IMAGE_PATH+ @@ -2018,29 +2018,29 @@ Dialog.prototype.unlockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGg "/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 PrintDialog=function(a,b){this.create(a,b)}; PrintDialog.prototype.create=function(a){function b(a){var b=t.checked||A.checked,d=parseInt(f.value)/100;isNaN(d)&&(d=1,f.value="100%");var d=.75*d,g=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,n=1/e.pageScale;if(b){var u=t.checked?1:parseInt(c.value);isNaN(u)||(n=mxUtils.getScaleForPageCount(u,e,g))}e.getGraphBounds();var k=u=0,g=mxRectangle.fromRectangle(g);g.width=Math.ceil(g.width*d);g.height=Math.ceil(g.height*d);n*=d;!b&&e.pageVisible?(d=e.getPageLayout(),u-=d.x*g.width,k-=d.y*g.height): -b=!0;b=PrintDialog.createPrintPreview(e,n,g,0,u,k,b);b.open();a&&PrintDialog.printPreview(b)}var e=a.editor.graph,d,k,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var r=document.createElement("tbody");d=document.createElement("tr");var t=document.createElement("input");t.setAttribute("type","checkbox");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(t);var x=document.createElement("span");mxUtils.write(x," "+mxResources.get("fitPage")); -k.appendChild(x);mxEvent.addListener(x,"click",function(a){t.checked=!t.checked;A.checked=!t.checked;mxEvent.consume(a)});mxEvent.addListener(t,"change",function(){A.checked=!t.checked});d.appendChild(k);r.appendChild(d);d=d.cloneNode(!1);var A=document.createElement("input");A.setAttribute("type","checkbox");k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(A);x=document.createElement("span");mxUtils.write(x," "+mxResources.get("posterPrint")+":");k.appendChild(x);mxEvent.addListener(x, -"click",function(a){A.checked=!A.checked;t.checked=!A.checked;mxEvent.consume(a)});d.appendChild(k);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";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(c);mxUtils.write(k," "+mxResources.get("pages")+" (max)");d.appendChild(k);r.appendChild(d);mxEvent.addListener(A,"change", -function(){A.checked?c.removeAttribute("disabled"):c.setAttribute("disabled","disabled");t.checked=!A.checked});d=d.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");d.appendChild(k);k=document.createElement("td");var f=document.createElement("input");f.setAttribute("value","100 %");f.setAttribute("size","5");f.style.width="50px";k.appendChild(f);d.appendChild(k);r.appendChild(d);d=document.createElement("tr");k=document.createElement("td");k.colSpan=2; -k.style.paddingTop="20px";k.setAttribute("align","right");x=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});x.className="geBtn";a.editor.cancelFirst&&k.appendChild(x);if(PrintDialog.previewEnabled){var g=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();b(!1)});g.className="geBtn";k.appendChild(g)}g=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();b(!0)});g.className="geBtn gePrimaryBtn";k.appendChild(g);a.editor.cancelFirst|| -k.appendChild(x);d.appendChild(k);r.appendChild(d);m.appendChild(r);this.container=m};PrintDialog.printPreview=function(a){if(null!=a.wnd){var b=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(b,500):b()}}; -PrintDialog.createPrintPreview=function(a,b,e,d,k,m,r){b=new mxPrintPreview(a,b,e,d,k,m);b.title=mxResources.get("preview");b.printBackgroundImage=!0;b.autoOrigin=r;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";b.backgroundColor=a;var t=b.writeHead;b.writeHead=function(a){t.apply(this,arguments);a.writeln('")};return b}; +b=!0;b=PrintDialog.createPrintPreview(e,n,g,0,u,k,b);b.open();a&&PrintDialog.printPreview(b)}var e=a.editor.graph,d,k,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var q=document.createElement("tbody");d=document.createElement("tr");var t=document.createElement("input");t.setAttribute("type","checkbox");k=document.createElement("td");k.setAttribute("colspan","2");k.style.fontSize="10pt";k.appendChild(t);var v=document.createElement("span");mxUtils.write(v," "+mxResources.get("fitPage")); +k.appendChild(v);mxEvent.addListener(v,"click",function(a){t.checked=!t.checked;A.checked=!t.checked;mxEvent.consume(a)});mxEvent.addListener(t,"change",function(){A.checked=!t.checked});d.appendChild(k);q.appendChild(d);d=d.cloneNode(!1);var A=document.createElement("input");A.setAttribute("type","checkbox");k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(A);v=document.createElement("span");mxUtils.write(v," "+mxResources.get("posterPrint")+":");k.appendChild(v);mxEvent.addListener(v, +"click",function(a){A.checked=!A.checked;t.checked=!A.checked;mxEvent.consume(a)});d.appendChild(k);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";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(c);mxUtils.write(k," "+mxResources.get("pages")+" (max)");d.appendChild(k);q.appendChild(d);mxEvent.addListener(A,"change", +function(){A.checked?c.removeAttribute("disabled"):c.setAttribute("disabled","disabled");t.checked=!A.checked});d=d.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");d.appendChild(k);k=document.createElement("td");var f=document.createElement("input");f.setAttribute("value","100 %");f.setAttribute("size","5");f.style.width="50px";k.appendChild(f);d.appendChild(k);q.appendChild(d);d=document.createElement("tr");k=document.createElement("td");k.colSpan=2; +k.style.paddingTop="20px";k.setAttribute("align","right");v=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});v.className="geBtn";a.editor.cancelFirst&&k.appendChild(v);if(PrintDialog.previewEnabled){var g=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();b(!1)});g.className="geBtn";k.appendChild(g)}g=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();b(!0)});g.className="geBtn gePrimaryBtn";k.appendChild(g);a.editor.cancelFirst|| +k.appendChild(v);d.appendChild(k);q.appendChild(d);m.appendChild(q);this.container=m};PrintDialog.printPreview=function(a){if(null!=a.wnd){var b=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(b,500):b()}}; +PrintDialog.createPrintPreview=function(a,b,e,d,k,m,q){b=new mxPrintPreview(a,b,e,d,k,m);b.title=mxResources.get("preview");b.printBackgroundImage=!0;b.autoOrigin=q;a=a.background;if(null==a||""==a||a==mxConstants.NONE)a="#ffffff";b.backgroundColor=a;var t=b.writeHead;b.writeHead=function(a){t.apply(this,arguments);a.writeln('")};return b}; PrintDialog.previewEnabled=!0; -var PageSetupDialog=function(a){function b(){null==c||c==mxConstants.NONE?(A.style.backgroundColor="",A.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(A.style.backgroundColor=c,A.style.backgroundImage="")}function e(){null==n?(g.removeAttribute("title"),g.style.fontSize="",g.innerHTML=mxResources.get("change")+"..."):(g.setAttribute("title",n.src),g.style.fontSize="11px",g.innerHTML=n.src.substring(0,42)+"...")}var d=a.editor.graph,k,m,r=document.createElement("table");r.style.width= -"100%";r.style.height="100%";var t=document.createElement("tbody");k=document.createElement("tr");m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";mxUtils.write(m,mxResources.get("paperSize")+":");k.appendChild(m);m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";var x=PageSetupDialog.addPageFormatPanel(m,"pagesetupdialog",d.pageFormat);k.appendChild(m);t.appendChild(k);k=document.createElement("tr");m=document.createElement("td"); +var PageSetupDialog=function(a){function b(){null==c||c==mxConstants.NONE?(A.style.backgroundColor="",A.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(A.style.backgroundColor=c,A.style.backgroundImage="")}function e(){null==n?(g.removeAttribute("title"),g.style.fontSize="",g.innerHTML=mxResources.get("change")+"..."):(g.setAttribute("title",n.src),g.style.fontSize="11px",g.innerHTML=n.src.substring(0,42)+"...")}var d=a.editor.graph,k,m,q=document.createElement("table");q.style.width= +"100%";q.style.height="100%";var t=document.createElement("tbody");k=document.createElement("tr");m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";mxUtils.write(m,mxResources.get("paperSize")+":");k.appendChild(m);m=document.createElement("td");m.style.verticalAlign="top";m.style.fontSize="10pt";var v=PageSetupDialog.addPageFormatPanel(m,"pagesetupdialog",d.pageFormat);k.appendChild(m);t.appendChild(k);k=document.createElement("tr");m=document.createElement("td"); mxUtils.write(m,mxResources.get("background")+":");k.appendChild(m);m=document.createElement("td");m.style.whiteSpace="nowrap";document.createElement("input").setAttribute("type","text");var A=document.createElement("button");A.style.width="18px";A.style.height="18px";A.style.marginRight="20px";A.style.backgroundPosition="center center";A.style.backgroundRepeat="no-repeat";var c=d.background;b();mxEvent.addListener(A,"click",function(f){a.pickColor(c||"none",function(a){c=a;b()});mxEvent.consume(f)}); m.appendChild(A);mxUtils.write(m,mxResources.get("gridSize")+":");var f=document.createElement("input");f.setAttribute("type","number");f.setAttribute("min","0");f.style.width="40px";f.style.marginLeft="6px";f.value=d.getGridSize();m.appendChild(f);mxEvent.addListener(f,"change",function(){var a=parseInt(f.value);f.value=Math.max(1,isNaN(a)?d.getGridSize():a)});k.appendChild(m);t.appendChild(k);k=document.createElement("tr");m=document.createElement("td");mxUtils.write(m,mxResources.get("image")+ ":");k.appendChild(m);m=document.createElement("td");var g=document.createElement("a");g.style.textDecoration="underline";g.style.cursor="pointer";g.style.color="#a0a0a0";var n=d.backgroundImage;mxEvent.addListener(g,"click",function(c){a.showBackgroundImageDialog(function(a){n=a;e()});mxEvent.consume(c)});e();m.appendChild(g);k.appendChild(m);t.appendChild(k);k=document.createElement("tr");m=document.createElement("td");m.colSpan=2;m.style.paddingTop="16px";m.setAttribute("align","right");var l= -mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});l.className="geBtn";a.editor.cancelFirst&&m.appendChild(l);var p=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.gridSize!==f.value&&d.setGridSize(parseInt(f.value));var b=new ChangePageSetup(a,c,n,x.get());b.ignoreColor=d.background==c;b.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=n?n.src:null);d.pageFormat.width==b.previousFormat.width&&d.pageFormat.height==b.previousFormat.height&& -b.ignoreColor&&b.ignoreImage||d.model.execute(b)});p.className="geBtn gePrimaryBtn";m.appendChild(p);a.editor.cancelFirst||m.appendChild(l);k.appendChild(m);t.appendChild(k);r.appendChild(t);this.container=r}; +mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});l.className="geBtn";a.editor.cancelFirst&&m.appendChild(l);var p=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();d.gridSize!==f.value&&d.setGridSize(parseInt(f.value));var b=new ChangePageSetup(a,c,n,v.get());b.ignoreColor=d.background==c;b.ignoreImage=(null!=d.backgroundImage?d.backgroundImage.src:null)===(null!=n?n.src:null);d.pageFormat.width==b.previousFormat.width&&d.pageFormat.height==b.previousFormat.height&& +b.ignoreColor&&b.ignoreImage||d.model.execute(b)});p.className="geBtn gePrimaryBtn";m.appendChild(p);a.editor.cancelFirst||m.appendChild(l);k.appendChild(m);t.appendChild(k);q.appendChild(t);this.container=q}; PageSetupDialog.addPageFormatPanel=function(a,b,e,d){function k(a,b,d){if(d||f!=document.activeElement&&g!=document.activeElement){a=!1;for(b=0;b=l)f.value=e.width/100;l=parseFloat(g.value);if(isNaN(l)||0>=l)g.value=e.height/100;l=new mxRectangle(0,0,Math.floor(100*parseFloat(f.value)),Math.floor(100*parseFloat(g.value)));"custom"!=t.value&&r.checked&&(l=new mxRectangle(0,0, -l.height,l.width));b&&u||l.width==E.width&&l.height==E.height||(E=l,null!=d&&d(E))};mxEvent.addListener(b,"click",function(a){m.checked=!0;z(a);mxEvent.consume(a)});mxEvent.addListener(A,"click",function(a){r.checked=!0;z(a);mxEvent.consume(a)});mxEvent.addListener(f,"blur",z);mxEvent.addListener(f,"click",z);mxEvent.addListener(g,"blur",z);mxEvent.addListener(g,"click",z);mxEvent.addListener(r,"change",z);mxEvent.addListener(m,"change",z);mxEvent.addListener(t,"change",function(a){u="custom"==t.value; -z(a,!0)});z();return{set:function(a){e=a;k(null,null,!0)},get:function(){return E},widthInput:f,heightInput:g}}; +e.height==d.format.height?(t.value=d.key,m.setAttribute("checked","checked"),m.defaultChecked=!0,m.checked=!0,q.removeAttribute("checked"),q.defaultChecked=!1,q.checked=!1,a=!0):e.width==d.format.height&&e.height==d.format.width&&(t.value=d.key,m.removeAttribute("checked"),m.defaultChecked=!1,m.checked=!1,q.setAttribute("checked","checked"),q.defaultChecked=!0,a=q.checked=!0));a?(v.style.display="",c.style.display="none"):(f.value=e.width/100,g.value=e.height/100,m.setAttribute("checked","checked"), +t.value="custom",v.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 q=document.createElement("input");q.setAttribute("name",b);q.setAttribute("type","radio");q.setAttribute("value","landscape");var t=document.createElement("select");t.style.marginBottom="8px";t.style.width="202px";var v=document.createElement("div");v.style.marginLeft="4px";v.style.width="210px"; +v.style.height="24px";m.style.marginRight="6px";v.appendChild(m);b=document.createElement("span");b.style.maxWidth="100px";mxUtils.write(b,mxResources.get("portrait"));v.appendChild(b);q.style.marginLeft="10px";q.style.marginRight="6px";v.appendChild(q);var A=document.createElement("span");A.style.width="100px";mxUtils.write(A,mxResources.get("landscape"));v.appendChild(A);var c=document.createElement("div");c.style.marginLeft="4px";c.style.width="210px";c.style.height="24px";var f=document.createElement("input"); +f.setAttribute("size","7");f.style.textAlign="right";c.appendChild(f);mxUtils.write(c," in x ");var g=document.createElement("input");g.setAttribute("size","7");g.style.textAlign="right";c.appendChild(g);mxUtils.write(c," in");v.style.display="none";c.style.display="none";for(var n={},l=PageSetupDialog.getFormats(),p=0;p=l)f.value=e.width/100;l=parseFloat(g.value);if(isNaN(l)||0>=l)g.value=e.height/100;l=new mxRectangle(0,0,Math.floor(100*parseFloat(f.value)),Math.floor(100*parseFloat(g.value)));"custom"!=t.value&&q.checked&&(l=new mxRectangle(0,0, +l.height,l.width));b&&u||l.width==E.width&&l.height==E.height||(E=l,null!=d&&d(E))};mxEvent.addListener(b,"click",function(a){m.checked=!0;y(a);mxEvent.consume(a)});mxEvent.addListener(A,"click",function(a){q.checked=!0;y(a);mxEvent.consume(a)});mxEvent.addListener(f,"blur",y);mxEvent.addListener(f,"click",y);mxEvent.addListener(g,"blur",y);mxEvent.addListener(g,"click",y);mxEvent.addListener(q,"change",y);mxEvent.addListener(m,"change",y);mxEvent.addListener(t,"change",function(a){u="custom"==t.value; +y(a,!0)});y();return{set:function(a){e=a;k(null,null,!0)},get:function(){return E},widthInput:f,heightInput:g}}; 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 (279 mm x 432 mm)",format:new mxRectangle(0,0,1100,1700)},{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)",format:new mxRectangle(0,0,2339,3300)},{key:"a2",title:"A2 (420 mm x 594 mm)", format:new mxRectangle(0,0,1654,2336)},{key:"a3",title:"A3 (297 mm x 420 mm)",format:new mxRectangle(0,0,1169,1654)},{key:"a4",title:"A4 (210 mm x 297 mm)",format:mxConstants.PAGE_FORMAT_A4_PORTRAIT},{key:"a5",title:"A5 (148 mm x 210 mm)",format:new mxRectangle(0,0,583,827)},{key:"a6",title:"A6 (105 mm x 148 mm)",format:new mxRectangle(0,0,413,583)},{key:"a7",title:"A7 (74 mm x 105 mm)",format:new mxRectangle(0,0,291,413)},{key:"custom",title:mxResources.get("custom"),format:null}]}; (function(){mxGraphView.prototype.validateBackgroundPage=function(){var a=this.graph;if(null!=a.container&&!a.transparentBackground){if(a.pageVisible){var b=this.getBackgroundPageBounds();if(null==this.backgroundPageShape){for(var d=a.container.firstChild;null!=d&&d.nodeType!=mxConstants.NODETYPE_ELEMENT;)d=d.nextSibling;null!=d&&(this.backgroundPageShape=this.createBackgroundPageShape(b),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!mxClient.IS_QUIRKS,this.backgroundPageShape.dialect= @@ -2051,32 +2051,32 @@ c="url("+this.gridImage+")";var g=d=0;null!=a.view.backgroundPageShape&&(g=this. b,a.container.className="geDiagramContainer geDiagramBackdrop",d.style.backgroundImage="none",d.style.backgroundColor=""):(a.container.className="geDiagramContainer",d.style.backgroundPosition=f,d.style.backgroundColor=b,d.style.backgroundImage=c)};mxGraphView.prototype.createSvgGrid=function(a){for(var b=this.graph.gridSize*this.scale;b'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(b,d){a.apply(this,arguments);if(null!=this.shiftPreview1){var e= this.view.canvas;null!=e.ownerSVGElement&&(e=e.ownerSVGElement);var c=this.gridSize*this.view.scale*this.view.gridSteps,c=-Math.round(c-mxUtils.mod(this.view.translate.x*this.view.scale+b,c))+"px "+-Math.round(c-mxUtils.mod(this.view.translate.y*this.view.scale+d,c))+"px";e.style.backgroundPosition=c}};mxGraph.prototype.updatePageBreaks=function(a,b,d){var c=this.view.scale,f=this.view.translate,g=this.pageFormat,e=c*this.pageScale,l=this.view.getBackgroundPageBounds();b=l.width;d=l.height;var p= -new mxRectangle(c*f.x,c*f.y,g.width*e,g.height*e),k=(a=a&&Math.min(p.width,p.height)>this.minPageBreakDist)?Math.ceil(d/p.height)-1:0,v=a?Math.ceil(b/p.width)-1:0,u=l.x+b,t=l.y+d;null==this.horizontalPageBreaks&&0this.minPageBreakDist)?Math.ceil(d/p.height)-1:0,k=a?Math.ceil(b/p.width)-1:0,u=l.x+b,t=l.y+d;null==this.horizontalPageBreaks&&0document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",b):this.diagramContainer.oncontextmenu=b):d.panningHandler.usePopupTrigger=!1;d.init(this.diagramContainer);mxClient.IS_SVG&&null!=d.view.getDrawPane()&&(b=d.view.getDrawPane().ownerSVGElement,null!=b&&(b.style.position="absolute"));this.hoverIcons= -this.createHoverIcons();mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(a){var c=mxUtils.getOffset(this.diagramContainer);0mxUtils.indexOf(this.toolbar.staticElements,a)&&(a.parentNode.removeChild(a),b.push(a));a=e}a=this.toolbar.fontMenu;e=this.toolbar.sizeMenu;if(null==g)this.toolbar.createTextToolbar();else{for(var l=0;lmxUtils.indexOf(u,E[a])&&u.push(E[a]);var D=function(a,c){var b= -d.getModel();b.beginUpdate();try{if(c)for(var f=b.isEdge(n),g=f?d.currentEdgeStyle:d.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;emxUtils.indexOf(E,v))||(O=mxUtils.setStyle(O,v,x),console.log("here",v,x))}b.setStyle(n,O)}}finally{b.endUpdate()}};d.addListener("cellsInserted",function(a,c){D(c.getProperty("cells"))});d.addListener("textInserted",function(a,c){D(c.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT, -function(a,c){var b=[c.getProperty("cell")];c.getProperty("terminalInserted")&&b.push(c.getProperty("terminal"));D(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var b=c.getProperty("cells"),f=!1,g=!1;if(0mxUtils.indexOf(u,E[a])&&u.push(E[a]);var C=function(a,c){var b= +d.getModel();b.beginUpdate();try{if(c)for(var f=b.isEdge(n),g=f?d.currentEdgeStyle:d.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;emxUtils.indexOf(E,x))||(O=mxUtils.setStyle(O,x,v),console.log("here",x,v))}b.setStyle(n,O)}}finally{b.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 b=[c.getProperty("cell")];c.getProperty("terminalInserted")&&b.push(c.getProperty("terminal"));C(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var b=c.getProperty("cells"),f=!1,g=!1;if(0this.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),f=0,d=0;null!=q&&(f=a.container.offsetWidth/2-q.x+c.x,d=a.container.offsetHeight/2-q.y+c.y);c=this.view.scale; +this.autoTranslate=!1)}}}a.updateZoomTimeout=null;a.cumulativeZoomFactor=1;var r=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),f=0,d=0;null!=r&&(f=a.container.offsetWidth/2-r.x+c.x,d=a.container.offsetHeight/2-r.y+c.y);c=this.view.scale; this.zoom(this.cumulativeZoomFactor);this.view.scale!=c&&(null!=b&&e.chromelessResize(!1,null,f*(this.cumulativeZoomFactor-1),d*(this.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(a.container)||0==f&&0==d||(a.container.scrollLeft-=f*(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,b){if((null==this.dialogs||0==this.dialogs.length)&& -a.isZoomWheelEvent(c))for(var f=mxEvent.getSource(c);null!=f;){if(f==a.container){q=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c));a.lazyZoom(b);mxEvent.consume(c);break}f=f.parentNode}}))};EditorUi.prototype.addChromelessToolbarItems=function(a){a(mxUtils.bind(this,function(a){this.actions.get("print").funct();mxEvent.consume(a)}),Editor.printLargeImage,mxResources.get("print"))}; +a.isZoomWheelEvent(c))for(var f=mxEvent.getSource(c);null!=f;){if(f==a.container){r=new mxPoint(mxEvent.getClientX(c),mxEvent.getClientY(c));a.lazyZoom(b);mxEvent.consume(c);break}f=f.parentNode}}))};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&&0screen.width&&(a.style.maxWidth=Math.max(20,screen.width-320)+"px",a.style.overflow="hidden");return a};EditorUi.prototype.setStatusText=function(a){this.statusContainer.innerHTML=a};EditorUi.prototype.createToolbar=function(a){return new Toolbar(this,a)}; EditorUi.prototype.createSidebar=function(a){return new Sidebar(this,a)};EditorUi.prototype.createFormat=function(a){return new Format(this,a)};EditorUi.prototype.createFooter=function(){return this.createDiv("geFooter")};EditorUi.prototype.createDiv=function(a){var b=document.createElement("div");b.className=a;return b}; -EditorUi.prototype.addSplitHandler=function(a,b,e,d){function k(a){if(null!=r){var f=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));d(Math.max(0,t+(b?f.x-r.x:r.y-f.y)-e));mxEvent.consume(a);t!=c()&&(x=!0,A=null)}}function m(a){k(a);r=t=null}var r=null,t=null,x=!0,A=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var c=mxUtils.bind(this,function(){var c=parseInt(b?a.style.left:a.style.bottom);b||(c=c+e-this.footerHeight);return c});mxEvent.addGestureListeners(a,function(a){r=new mxPoint(mxEvent.getClientX(a), -mxEvent.getClientY(a));t=c();x=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){if(!x&&this.hsplitClickEnabled){var b=null!=A?A-e:0;A=c();d(b);mxEvent.consume(a)}}));mxEvent.addGestureListeners(document,null,k,m);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,k,m)})}; -EditorUi.prototype.showDialog=function(a,b,e,d,k,m,r,t,x){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,b,e,d,k,m,r,t,x);this.dialogs.push(this.dialog)}; +EditorUi.prototype.addSplitHandler=function(a,b,e,d){function k(a){if(null!=q){var f=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));d(Math.max(0,t+(b?f.x-q.x:q.y-f.y)-e));mxEvent.consume(a);t!=c()&&(v=!0,A=null)}}function m(a){k(a);q=t=null}var q=null,t=null,v=!0,A=null;mxClient.IS_POINTER&&(a.style.touchAction="none");var c=mxUtils.bind(this,function(){var c=parseInt(b?a.style.left:a.style.bottom);b||(c=c+e-this.footerHeight);return c});mxEvent.addGestureListeners(a,function(a){q=new mxPoint(mxEvent.getClientX(a), +mxEvent.getClientY(a));t=c();v=!1;mxEvent.consume(a)});mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){if(!v&&this.hsplitClickEnabled){var b=null!=A?A-e:0;A=c();d(b);mxEvent.consume(a)}}));mxEvent.addGestureListeners(document,null,k,m);this.destroyFunctions.push(function(){mxEvent.removeGestureListeners(document,null,k,m)})}; +EditorUi.prototype.showDialog=function(a,b,e,d,k,m,q,t,v){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,b,e,d,k,m,q,t,v);this.dialogs.push(this.dialog)}; EditorUi.prototype.hideDialog=function(a,b){if(null!=this.dialogs&&0navigator.userAgent.indexOf("Camino")?(a=new mxMorphing(d),a.addListener(mxEvent.DONE,mxUtils.bind(this,function(){d.getModel().endUpdate();null!=e&&e()})),a.startAnimation()):(d.getModel().endUpdate(),null!=e&&e())}}}; -EditorUi.prototype.showImageDialog=function(a,b,e,d){d=this.editor.graph.cellEditor;var k=d.saveSelection(),m=mxUtils.prompt(a,b);d.restoreSelection(k);if(null!=m&&0f||Math.abs(m.y-c.getGraphY())>f){this.isCellSelected(b.cell)||this.setSelectionCell(b.cell);var d=this.selectionCellsHandler.getHandler(b.cell);if(null!=d&&null!=d.bends&&0f||Math.abs(m.y-c.getGraphY())>f){this.isCellSelected(b.cell)||this.setSelectionCell(b.cell);var d=this.selectionCellsHandler.getHandler(b.cell);if(null!=d&&null!=d.bends&&0mxUtils.indexOf(c,d)&&b.push(d)):b.push(c[f])}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 f=new mxRubberband(this); this.getRubberband=function(){return f};var g=(new Date).getTime(),n=0,l=this.connectionHandler.mouseMove;this.connectionHandler.mouseMove=function(){var a=this.currentState;l.apply(this,arguments);a!=this.currentState?(g=(new Date).getTime(),n=0):n=(new Date).getTime()-g};var p=this.connectionHandler.isOutlineConnectEvent;this.connectionHandler.isOutlineConnectEvent=function(a){return null!=this.currentState&&a.getState()==this.currentState&&2E3=a&&k.y+k.height<=q&&k.y>=c&&k.x+k.width<=l&&e.push(u);this.getAllCells(a,c,b,f,u,e)}}}return e};var G=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?!1:G.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 q=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b=c.getProperty("event").getState();q=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"),d=c.getProperty("cell");null==d?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),f.start(b.x,b.y)):null!=q?this.addSelectionCells(q):1=a&&k.y+k.height<=r&&k.y>=c&&k.x+k.width<=l&&e.push(u);this.getAllCells(a,c,b,f,u,e)}}}return e};var G=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?!1:G.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 r=null;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")){var b=c.getProperty("event").getState();r=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"),d=c.getProperty("cell");null==d?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),f.start(b.x,b.y)):null!=r?this.addSelectionCells(r):1'+e+""));return new mxImage("data:image/svg+xml;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0)),a,b)}; Graph.zapGremlins=function(a){for(var b=[],e=0;eg?"a":"p",tt:12>g?"am":"pm",T:12>g?"A":"P",TT:12>g?"AM":"PM",Z:e?"UTC":(String(a).match(k)||[""]).pop().replace(m,""),o:(0g?"a":"p",tt:12>g?"am":"pm",T:12>g?"A":"P",TT:12>g?"AM":"PM",Z:e?"UTC":(String(a).match(k)||[""]).pop().replace(m,""),o:(0d&&"%"==b.charAt(match.index-1))m=k.substring(1);else{var r=k.substring(1,k.length-1);if(0>r.indexOf("{"))for(var t=a;null==m&&null!=t;)null!=t.value&&"object"==typeof t.value&&(m=t.hasAttribute(r)?null!=t.getAttribute(r)?t.getAttribute(r):"":null),t=this.model.getParent(t);null==m&&(m=this.getGlobalVariable(r))}e.push(b.substring(d, +Graph.prototype.replacePlaceholders=function(a,b){var e=[];if(null!=b){for(var d=0;match=this.placeholderPattern.exec(b);){var k=match[0];if(2d&&"%"==b.charAt(match.index-1))m=k.substring(1);else{var q=k.substring(1,k.length-1);if(0>q.indexOf("{"))for(var t=a;null==m&&null!=t;)null!=t.value&&"object"==typeof t.value&&(m=t.hasAttribute(q)?null!=t.getAttribute(q)?t.getAttribute(q):"":null),t=this.model.getParent(t);null==m&&(m=this.getGlobalVariable(q))}e.push(b.substring(d, match.index)+(null!=m?m:k));d=match.index+k.length}}e.push(b.substring(d))}return e.join("")};Graph.prototype.restoreSelection=function(a){if(null!=a&&0e||Math.abs(u.y-D.y)>e)&&(Math.abs(u.x-q.x)>e||Math.abs(u.y-q.y)>e)){q=u.x-k.x;D=u.y-k.y;u={distSq:q*q+D*D,x:u.x,y:u.y};for(q=0;qu.distSq){v.splice(q,0,u);u=null;break}null==u||0!=v.length&&v[v.length-1].x===u.x&&v[v.length-1].y===u.y||v.push(u)}}}for(z=0;zd*d&&0d*d&&(q=new mxPoint(m.x-u.x,m.y-u.y),z=new mxPoint(m.x+u.x, -m.y+u.y),l.push(q),this.addPoints(a,l,c,f,!1,null,p),l=0>Math.round(u.x)||0==Math.round(u.x)&&0>=Math.round(u.y)?1:-1,p=!1,"sharp"==e?(a.lineTo(q.x-u.y*l,q.y+u.x*l),a.lineTo(z.x-u.y*l,z.y+u.x*l),a.lineTo(z.x,z.y)):"arc"==e?(l*=1.3,a.curveTo(q.x-u.y*l,q.y+u.x*l,z.x-u.y*l,z.y+u.x*l,z.x,z.y)):(a.moveTo(z.x,z.y),p=!0),l=[z],q=!0))}else u=null;q||(l.push(m),B=m)}this.addPoints(a,l,c,f,!1,null,p);a.stroke()}};var m=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint= -function(a,b,c,f){if(null==b||null==a||"1"!=b.style.snapToPoint&&"1"!=a.style.snapToPoint)m.apply(this,arguments);else{b=this.getTerminalPort(a,b,f);var d=this.getNextPoint(a,c,f),e=this.graph.isOrthogonal(a),l=mxUtils.toRadians(Number(b.style[mxConstants.STYLE_ROTATION]||"0")),p=new mxPoint(b.getCenterX(),b.getCenterY());if(0!=l)var k=Math.cos(-l),v=Math.sin(-l),d=mxUtils.getRotatedPoint(d,k,v,p);k=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);k+=parseFloat(a.style[f?mxConstants.STYLE_SOURCE_PERIMETER_SPACING: -mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);d=this.getPerimeterPoint(b,d,0==l&&e,k);0!=l&&(k=Math.cos(l),v=Math.sin(l),d=mxUtils.getRotatedPoint(d,k,v,p));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,b,c,f,d),f)}};mxGraphView.prototype.snapToAnchorPoint=function(a,b,c,f,d){if(null!=b&&null!=a){a=this.graph.getAllConnectionConstraints(b);f=c=null;if(null!=a)for(var e=0;ee||Math.abs(u.y-C.y)>e)&&(Math.abs(u.x-r.x)>e||Math.abs(u.y-r.y)>e)){r=u.x-k.x;C=u.y-k.y;u={distSq:r*r+C*C,x:u.x,y:u.y};for(r=0;ru.distSq){x.splice(r,0,u);u=null;break}null==u||0!=x.length&&x[x.length-1].x===u.x&&x[x.length-1].y===u.y||x.push(u)}}}for(y=0;yd*d&&0d*d&&(r=new mxPoint(m.x-u.x,m.y-u.y),y=new mxPoint(m.x+u.x, +m.y+u.y),l.push(r),this.addPoints(a,l,c,f,!1,null,p),l=0>Math.round(u.x)||0==Math.round(u.x)&&0>=Math.round(u.y)?1:-1,p=!1,"sharp"==e?(a.lineTo(r.x-u.y*l,r.y+u.x*l),a.lineTo(y.x-u.y*l,y.y+u.x*l),a.lineTo(y.x,y.y)):"arc"==e?(l*=1.3,a.curveTo(r.x-u.y*l,r.y+u.x*l,y.x-u.y*l,y.y+u.x*l,y.x,y.y)):(a.moveTo(y.x,y.y),p=!0),l=[y],r=!0))}else u=null;r||(l.push(m),z=m)}this.addPoints(a,l,c,f,!1,null,p);a.stroke()}};var m=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint= +function(a,b,c,f){if(null==b||null==a||"1"!=b.style.snapToPoint&&"1"!=a.style.snapToPoint)m.apply(this,arguments);else{b=this.getTerminalPort(a,b,f);var d=this.getNextPoint(a,c,f),e=this.graph.isOrthogonal(a),l=mxUtils.toRadians(Number(b.style[mxConstants.STYLE_ROTATION]||"0")),p=new mxPoint(b.getCenterX(),b.getCenterY());if(0!=l)var k=Math.cos(-l),x=Math.sin(-l),d=mxUtils.getRotatedPoint(d,k,x,p);k=parseFloat(a.style[mxConstants.STYLE_PERIMETER_SPACING]||0);k+=parseFloat(a.style[f?mxConstants.STYLE_SOURCE_PERIMETER_SPACING: +mxConstants.STYLE_TARGET_PERIMETER_SPACING]||0);d=this.getPerimeterPoint(b,d,0==l&&e,k);0!=l&&(k=Math.cos(l),x=Math.sin(l),d=mxUtils.getRotatedPoint(d,k,x,p));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,b,c,f,d),f)}};mxGraphView.prototype.snapToAnchorPoint=function(a,b,c,f,d){if(null!=b&&null!=a){a=this.graph.getAllConnectionConstraints(b);f=c=null;if(null!=a)for(var e=0;e=m.getStatus()&&eval.call(window,m.getText())}}catch(r){null!=window.console&&console.log("error in getStencil:",k,r)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);b=mxStencilRegistry.stencils[a]}}return b}; +mxUtils.load(k);null!=m&&200<=m.getStatus()&&299>=m.getStatus()&&eval.call(window,m.getText())}}catch(q){null!=window.console&&console.log("error in getStencil:",k,q)}}mxStencilRegistry.packages[e]=1}}else e=e.replace("_-_","_"),mxStencilRegistry.loadStencilSet(STENCIL_PATH+"/"+e+".xml",null);b=mxStencilRegistry.stencils[a]}}return b}; mxStencilRegistry.getBasenameForStencil=function(a){var b=null;if(null!=a&&(a=a.split("."),0=a.getStatus()?a.getXml():null)}));else return mxUtils.load(a).getXml()};mxStencilRegistry.parseStencilSets=function(a){for(var b=0;b
"));l=this.graph.sanitizeHtml(c?l.replace(/\n/g,"").replace(/<br\s*.?>/g,"
"):l,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var f=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT? Math.round(f*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(f)+"px";this.textarea.style.textDecoration="";this.textarea.style.fontWeight="normal";this.textarea.style.fontStyle="";this.textarea.style.fontFamily=mxConstants.DEFAULT_FONTFAMILY;this.textarea.style.textAlign="left";this.textarea.style.padding="2px";this.textarea.innerHTML!=l&&(this.textarea.innerHTML=l);this.codeViewMode=!0}this.textarea.focus();null!=this.switchSelectionState&&this.restoreSelection(this.switchSelectionState); -this.switchSelectionState=b;this.resize()}};var x=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(a,c){if(null!=this.textarea)if(a=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=a){var b=a.view.scale;this.bounds=mxRectangle.fromRectangle(a);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*b;this.bounds.height=60*b;var f=null!=a.text?a.text.margin:null;null==f&&(f=mxUtils.getAlignmentAsPoint(mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN, +this.switchSelectionState=b;this.resize()}};var v=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(a,c){if(null!=this.textarea)if(a=this.graph.getView().getState(this.editingCell),this.codeViewMode&&null!=a){var b=a.view.scale;this.bounds=mxRectangle.fromRectangle(a);if(0==this.bounds.width&&0==this.bounds.height){this.bounds.width=160*b;this.bounds.height=60*b;var f=null!=a.text?a.text.margin:null;null==f&&(f=mxUtils.getAlignmentAsPoint(mxUtils.getValue(a.style,mxConstants.STYLE_ALIGN, mxConstants.ALIGN_CENTER),mxUtils.getValue(a.style,mxConstants.STYLE_VERTICAL_ALIGN,mxConstants.ALIGN_MIDDLE)));this.bounds.x+=f.x*this.bounds.width;this.bounds.y+=f.y*this.bounds.height}this.textarea.style.width=Math.round((this.bounds.width-4)/b)+"px";this.textarea.style.height=Math.round((this.bounds.height-4)/b)+"px";this.textarea.style.overflow="auto";this.textarea.clientHeight"));return b=this.graph.sanitizeHtml(b,!0)}; +"transform","scale("+b+","+b+")")}else this.textarea.style.height="",this.textarea.style.overflow="",v.apply(this,arguments)};mxCellEditorGetInitialValue=mxCellEditor.prototype.getInitialValue;mxCellEditor.prototype.getInitialValue=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,"
"));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,"
").replace(/\n/g,"
"):c.replace(/\r\n/g,"").replace(/\n/g,"")};var A=mxCellEditor.prototype.stopEditing;mxCellEditor.prototype.stopEditing=function(a){this.codeViewMode&& this.toggleViewMode();A.apply(this,arguments);this.focusContainer()};mxCellEditor.prototype.focusContainer=function(){try{this.graph.container.focus()}catch(J){}};var c=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(a,b){this.graph.getModel().beginUpdate();try{if(c.apply(this,arguments),this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)){var f=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),d=mxUtils.getValue(a.style, mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);""==b&&f==mxConstants.NONE&&d==mxConstants.NONE&&this.graph.removeCells([a.cell],!1)}}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(a){var c=null;if(this.graph.getModel().isEdge(a.cell)||this.graph.getModel().isEdge(this.graph.getModel().getParent(a.cell)))c=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null),c==mxConstants.NONE&&(c=null);return c};mxCellEditor.prototype.getMinimumSize= @@ -2428,18 +2428,18 @@ 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 n=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(a,c){n.apply(this,arguments);mxEvent.isTouchEvent(c.getEvent())&&this.graph.isCellSelected(c.getCell())&&1g||Math.abs(e)>g)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(), this.update(f,b),this.isSpaceEvent(c)?(f=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.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 l=mxRubberband.prototype.reset;mxRubberband.prototype.reset=function(){null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv), -this.secondDiv=null);l.apply(this,arguments)};var p=(new Date).getTime(),B=0,v=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,b,f){v.apply(this,arguments);b!=this.currentTerminalState?(p=(new Date).getTime(),B=0):B=(new Date).getTime()-p;this.currentTerminalState=b};var u=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&& -2E3=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state, +this.secondDiv=null);l.apply(this,arguments)};var p=(new Date).getTime(),z=0,x=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,b,f){x.apply(this,arguments);b!=this.currentTerminalState?(p=(new Date).getTime(),z=0):z=(new Date).getTime()-p;this.currentTerminalState=b};var u=mxEdgeHandler.prototype.isOutlineConnectEvent;mxEdgeHandler.prototype.isOutlineConnectEvent=function(a){return null!=this.currentTerminalState&&a.getState()==this.currentTerminalState&& +2E3=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state, f,b):null,b=null!=(null!=d?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b),d):null)?this.fixedHandleImage:null!=d&&null!=f?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 E=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 E.apply(this,arguments)};var z=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var c=this.graph.getModel(),b=c.getParent(a[0]),f=this.graph.getCellGeometry(a[0]);if(c.isEdge(b)&&null!=f&&f.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 z.apply(this,arguments)};var G=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),b=c.getParent(a.cell),f=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=f&&f.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox, -new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))):G.apply(this,arguments)};var q=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,c){var b=this.graph.getModel(),f=b.getParent(this.state.cell),d=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(c)==mxEvent.ROTATION_HANDLE||!b.isEdge(f)||null==d||!d.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&q.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible= -function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()c.width&&2>c.height&&null!=c.text&&null!=c.text.boundingBox))return mxRectangle.fromRectangle(c.text.boundingBox)}return y.apply(this,arguments)};var G=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var c=this.graph.getModel(),b=c.getParent(a.cell),f=this.graph.getCellGeometry(a.cell);return c.isEdge(b)&&null!=f&&f.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(c=a.text.unrotatedBoundingBox||a.text.boundingBox, +new mxRectangle(Math.round(c.x),Math.round(c.y),Math.round(c.width),Math.round(c.height))):G.apply(this,arguments)};var r=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,c){var b=this.graph.getModel(),f=b.getParent(this.state.cell),d=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(c)==mxEvent.ROTATION_HANDLE||!b.isEdge(f)||null==d||!d.relative||null==this.state||2<=this.state.width||2<=this.state.height)&&r.apply(this,arguments)};mxVertexHandler.prototype.isRotationHandleVisible= +function(){return this.graph.isEnabled()&&this.rotationEnabled&&this.graph.isCellRotatable(this.state.cell)&&(0>=mxGraphHandler.prototype.maxCells||this.graph.getSelectionCount()C?"#FFFFFF":"#000000"),a.begin(),a.moveTo(0,0),a.lineTo(f-e,0),a.lineTo(f,e),a.lineTo(e,e),a.close(),a.fill()),0!=g&&(a.setFillAlpha(Math.abs(g)),a.setFillColor(0>g?"#FFFFFF":"#000000"),a.begin(),a.moveTo(0,0),a.lineTo(e,e),a.lineTo(e,d),a.lineTo(0,d-e),a.close(),a.fill()),a.begin(),a.moveTo(e,d),a.lineTo(e,e),a.lineTo(0, +function wa(){mxRhombus.call(this)}function ua(){mxEllipse.call(this)}function pa(){mxEllipse.call(this)}function ta(){mxEllipse.call(this)}function va(){mxEllipse.call(this)}function ma(){mxActor.call(this)}function ra(){mxActor.call(this)}function ka(){mxActor.call(this)}function da(){mxConnector.call(this)}function sa(a,c,b,f,d,e,g,l,r,n){g+=r;var D=f.clone();f.x-=d*(2*g+r);f.y-=e*(2*g+r);d*=g+r;e*=g+r;return function(){a.ellipse(D.x-d-g,D.y-e-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,f,d){var e=Math.max(0,Math.min(f,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),D=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity)))),g=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(f-e,0);a.lineTo(f, +e);a.lineTo(f,d);a.lineTo(e,d);a.lineTo(0,d-e);a.lineTo(0,0);a.close();a.end();a.fillAndStroke();this.outline||(a.setShadow(!1),0!=D&&(a.setFillAlpha(Math.abs(D)),a.setFillColor(0>D?"#FFFFFF":"#000000"),a.begin(),a.moveTo(0,0),a.lineTo(f-e,0),a.lineTo(f,e),a.lineTo(e,e),a.close(),a.fill()),0!=g&&(a.setFillAlpha(Math.abs(g)),a.setFillColor(0>g?"#FFFFFF":"#000000"),a.begin(),a.moveTo(0,0),a.lineTo(e,e),a.lineTo(e,d),a.lineTo(0,d-e),a.close(),a.fill()),a.begin(),a.moveTo(e,d),a.lineTo(e,e),a.lineTo(0, 0),a.moveTo(e,e),a.lineTo(f,e),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 xa=Math.tan(mxUtils.toRadians(30)),na=(.5-xa)/2;mxUtils.extend(b,mxActor);b.prototype.size=20;b.prototype.redrawPath=function(a,c,b,f,d){c=Math.min(f,d/xa);a.translate((f-c)/2,(d-c)/2+c/4);a.moveTo(0,.25*c);a.lineTo(.5* c,c*na);a.lineTo(c,.25*c);a.lineTo(.5*c,(.5-na)*c);a.lineTo(0,.25*c);a.close();a.end()};mxCellRenderer.registerShape("isoRectangle",b);mxUtils.extend(e,mxCylinder);e.prototype.size=20;e.prototype.redrawPath=function(a,c,b,f,d,e){c=Math.min(f,d/(.5+xa));e?(a.moveTo(0,.25*c),a.lineTo(.5*c,(.5-na)*c),a.lineTo(c,.25*c),a.moveTo(.5*c,(.5-na)*c),a.lineTo(.5*c,(1-na)*c)):(a.translate((f-c)/2,(d-c)/2),a.moveTo(0,.25*c),a.lineTo(.5*c,c*na),a.lineTo(c,.25*c),a.lineTo(c,.75*c),a.lineTo(.5*c,(1-na)*c),a.lineTo(0, .75*c),a.close());a.end()};mxCellRenderer.registerShape("isoCube",e);mxUtils.extend(d,mxCylinder);d.prototype.redrawPath=function(a,c,b,f,d,e){c=Math.min(d/2,Math.round(d/8)+this.strokewidth-1);if(e&&null!=this.fill||!e&&null==this.fill)a.moveTo(0,c),a.curveTo(0,2*c,f,2*c,f,c),e||(a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,f,2*c,f,c),e||(a.stroke(),a.begin()),a.translate(0,c/2),a.moveTo(0,c),a.curveTo(0,2*c,f,2*c,f,c),e||(a.stroke(),a.begin()),a.translate(0,-c);e||(a.moveTo(0, c),a.curveTo(0,-c/3,f,-c/3,f,c),a.lineTo(f,d-c),a.curveTo(f,d+c/3,0,d+c/3,0,d-c),a.close())};d.prototype.getLabelMargins=function(a){return new mxRectangle(0,2.5*Math.min(a.height/2,Math.round(a.height/8)+this.strokewidth-1)*this.scale,0,0)};mxCellRenderer.registerShape("datastore",d);mxUtils.extend(k,mxCylinder);k.prototype.size=30;k.prototype.darkOpacity=0;k.prototype.paintVertexShape=function(a,c,b,f,d){var e=Math.max(0,Math.min(f,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))))), -C=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));a.translate(c,b);a.begin();a.moveTo(0,0);a.lineTo(f-e,0);a.lineTo(f,e);a.lineTo(f,d);a.lineTo(0,d);a.lineTo(0,0);a.close();a.end();a.fillAndStroke();this.outline||(a.setShadow(!1),0!=C&&(a.setFillAlpha(Math.abs(C)),a.setFillColor(0>C?"#FFFFFF":"#000000"),a.begin(),a.moveTo(f-e,0),a.lineTo(f-e,e),a.lineTo(f,e),a.close(),a.fill()),a.begin(),a.moveTo(f-e,0),a.lineTo(f-e,e),a.lineTo(f,e),a.end(),a.stroke())}; -mxCellRenderer.registerShape("note",k);mxUtils.extend(m,mxActor);m.prototype.redrawPath=function(a,c,b,f,d){a.moveTo(0,0);a.quadTo(f/2,.5*d,f,0);a.quadTo(.5*f,d/2,f,d);a.quadTo(f/2,.5*d,0,d);a.quadTo(.5*f,d/2,0,0);a.end()};mxCellRenderer.registerShape("switch",m);mxUtils.extend(r,mxCylinder);r.prototype.tabWidth=60;r.prototype.tabHeight=20;r.prototype.tabPosition="right";r.prototype.redrawPath=function(a,c,b,f,d,e){c=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))); -b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var C=mxUtils.getValue(this.style,"tabPosition",this.tabPosition);e?"left"==C?(a.moveTo(0,b),a.lineTo(c,b)):(a.moveTo(f-c,b),a.lineTo(f,b)):("left"==C?(a.moveTo(0,0),a.lineTo(c,0),a.lineTo(c,b),a.lineTo(f,b)):(a.moveTo(0,b),a.lineTo(f-c,b),a.lineTo(f-c,0),a.lineTo(f,0)),a.lineTo(f,d),a.lineTo(0,d),a.lineTo(0,b),a.close());a.end()};mxCellRenderer.registerShape("folder",r);mxUtils.extend(t,mxActor);t.prototype.size= -30;t.prototype.isRoundable=function(){return!0};t.prototype.redrawPath=function(a,c,b,f,d){c=Math.max(0,Math.min(f,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(c,0),new mxPoint(f,0),new mxPoint(f,d),new mxPoint(0,d),new mxPoint(0,c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("card",t);mxUtils.extend(x,mxActor);x.prototype.size=.4;x.prototype.redrawPath= -function(a,c,b,f,d){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,c/2);a.quadTo(f/4,1.4*c,f/2,c/2);a.quadTo(3*f/4,c*(1-1.4),f,c/2);a.lineTo(f,d-c/2);a.quadTo(3*f/4,d-1.4*c,f/2,d-c/2);a.quadTo(f/4,d-c*(1-1.4),0,d-c/2);a.lineTo(0,c/2);a.close();a.end()};x.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var c=mxUtils.getValue(this.style,"size",this.size),b=a.width,f=a.height;if(null==this.direction||this.direction== -mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return c*=f,new mxRectangle(a.x,a.y+c,b,f-2*c);c*=b;return new mxRectangle(a.x+c,a.y,b-2*c,f)}return a};mxCellRenderer.registerShape("tape",x);mxUtils.extend(A,mxActor);A.prototype.size=.3;A.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*a.height):null};A.prototype.redrawPath=function(a,c,b,f,d){c=d*Math.max(0, +D=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));a.translate(c,b);a.begin();a.moveTo(0,0);a.lineTo(f-e,0);a.lineTo(f,e);a.lineTo(f,d);a.lineTo(0,d);a.lineTo(0,0);a.close();a.end();a.fillAndStroke();this.outline||(a.setShadow(!1),0!=D&&(a.setFillAlpha(Math.abs(D)),a.setFillColor(0>D?"#FFFFFF":"#000000"),a.begin(),a.moveTo(f-e,0),a.lineTo(f-e,e),a.lineTo(f,e),a.close(),a.fill()),a.begin(),a.moveTo(f-e,0),a.lineTo(f-e,e),a.lineTo(f,e),a.end(),a.stroke())}; +mxCellRenderer.registerShape("note",k);mxUtils.extend(m,mxActor);m.prototype.redrawPath=function(a,c,b,f,d){a.moveTo(0,0);a.quadTo(f/2,.5*d,f,0);a.quadTo(.5*f,d/2,f,d);a.quadTo(f/2,.5*d,0,d);a.quadTo(.5*f,d/2,0,0);a.end()};mxCellRenderer.registerShape("switch",m);mxUtils.extend(q,mxCylinder);q.prototype.tabWidth=60;q.prototype.tabHeight=20;q.prototype.tabPosition="right";q.prototype.redrawPath=function(a,c,b,f,d,e){c=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))); +b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));var D=mxUtils.getValue(this.style,"tabPosition",this.tabPosition);e?"left"==D?(a.moveTo(0,b),a.lineTo(c,b)):(a.moveTo(f-c,b),a.lineTo(f,b)):("left"==D?(a.moveTo(0,0),a.lineTo(c,0),a.lineTo(c,b),a.lineTo(f,b)):(a.moveTo(0,b),a.lineTo(f-c,b),a.lineTo(f-c,0),a.lineTo(f,0)),a.lineTo(f,d),a.lineTo(0,d),a.lineTo(0,b),a.close());a.end()};mxCellRenderer.registerShape("folder",q);mxUtils.extend(t,mxActor);t.prototype.size= +30;t.prototype.isRoundable=function(){return!0};t.prototype.redrawPath=function(a,c,b,f,d){c=Math.max(0,Math.min(f,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(c,0),new mxPoint(f,0),new mxPoint(f,d),new mxPoint(0,d),new mxPoint(0,c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("card",t);mxUtils.extend(v,mxActor);v.prototype.size=.4;v.prototype.redrawPath= +function(a,c,b,f,d){c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,c/2);a.quadTo(f/4,1.4*c,f/2,c/2);a.quadTo(3*f/4,c*(1-1.4),f,c/2);a.lineTo(f,d-c/2);a.quadTo(3*f/4,d-1.4*c,f/2,d-c/2);a.quadTo(f/4,d-c*(1-1.4),0,d-c/2);a.lineTo(0,c/2);a.close();a.end()};v.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var c=mxUtils.getValue(this.style,"size",this.size),b=a.width,f=a.height;if(null==this.direction||this.direction== +mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return c*=f,new mxRectangle(a.x,a.y+c,b,f-2*c);c*=b;return new mxRectangle(a.x+c,a.y,b-2*c,f)}return a};mxCellRenderer.registerShape("tape",v);mxUtils.extend(A,mxActor);A.prototype.size=.3;A.prototype.getLabelMargins=function(a){return mxUtils.getValue(this.style,"boundedLbl",!1)?new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*a.height):null};A.prototype.redrawPath=function(a,c,b,f,d){c=d*Math.max(0, Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,0);a.lineTo(f,0);a.lineTo(f,d-c/2);a.quadTo(3*f/4,d-1.4*c,f/2,d-c/2);a.quadTo(f/4,d-c*(1-1.4),0,d-c/2);a.lineTo(0,c/2);a.close();a.end()};mxCellRenderer.registerShape("document",A);var Ia=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(a,c,b,f){var d=mxUtils.getValue(this.style,"size");return null!=d?f*Math.max(0,Math.min(1,d)):Ia.apply(this,arguments)};mxCylinder.prototype.getLabelMargins= 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,f,d){c=f*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(f,0),new mxPoint(f-c,d)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("parallelogram",c);mxUtils.extend(f,mxActor);f.prototype.size=.2;f.prototype.isRoundable=function(){return!0};f.prototype.redrawPath=function(a,c,b,f,d){c=f*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(f-c,0),new mxPoint(f,d)],this.isRounded,b,!0)};mxCellRenderer.registerShape("trapezoid",f);mxUtils.extend(g,mxActor);g.prototype.size=.5;g.prototype.redrawPath=function(a,c,b,f,d){a.setFillColor(null);c=f*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(f,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(f,d)],this.isRounded,b,!1);a.end()};mxCellRenderer.registerShape("curlyBracket",g);mxUtils.extend(n,mxActor);n.prototype.redrawPath=function(a,c,b,f,d){a.setStrokeWidth(1);a.setFillColor(this.stroke);c=f/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",n);l.prototype.moveTo=function(a,c){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY= c;this.firstX=a;this.firstY=c};l.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)};l.prototype.quadTo=function(a,c,b,f){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=b;this.lastY=f};l.prototype.curveTo=function(a,c,b,f,d,e){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=d;this.lastY=e};l.prototype.arcTo=function(a,c,b,f, -d,e,g){this.originalArcTo.apply(this.canvas,arguments);this.lastX=e;this.lastY=g};l.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},f=Math.abs(a-this.lastX),d=Math.abs(c-this.lastY),e=Math.sqrt(f*f+d*d);if(2>e){this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;return}var g=Math.round(e/10),C=this.defaultVariation;5>g&&(g=5,C/=3);for(var l=b(a-this.lastX)*f/g,b=b(c-this.lastY)*d/g, -f=f/e,d=d/e,e=0;ea?-1:1:a===a?0:NaN:NaN},f=Math.abs(a-this.lastX),d=Math.abs(c-this.lastY),e=Math.sqrt(f*f+d*d);if(2>e){this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c;return}var g=Math.round(e/10),D=this.defaultVariation;5>g&&(g=5,D/=3);for(var l=b(a-this.lastX)*f/g,b=b(c-this.lastY)*d/g, +f=f/e,d=d/e,e=0;eg+C?a.y=f.y:a.x=f.x);return mxUtils.getPerimeterPoint(l,a,f)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,b,d){var e=f.prototype.size;null!=c&&(e=mxUtils.getValue(c.style,"size",e));var g=a.x,l=a.y,q=a.width,C=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST; -c==mxConstants.DIRECTION_EAST?(e=q*Math.max(0,Math.min(1,e)),l=[new mxPoint(g+e,l),new mxPoint(g+q-e,l),new mxPoint(g+q,l+C),new mxPoint(g,l+C),new mxPoint(g+e,l)]):c==mxConstants.DIRECTION_WEST?(e=q*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+q,l),new mxPoint(g+q-e,l+C),new mxPoint(g+e,l+C),new mxPoint(g,l)]):c==mxConstants.DIRECTION_NORTH?(e=C*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l+e),new mxPoint(g+q,l),new mxPoint(g+q,l+C),new mxPoint(g,l+C-e),new mxPoint(g,l+e)]):(e=C*Math.max(0, -Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+q,l+e),new mxPoint(g+q,l+C-e),new mxPoint(g,l+C),new mxPoint(g,l)]);C=a.getCenterX();a=a.getCenterY();a=new mxPoint(C,a);d&&(b.xg+q?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(l,a,b)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(a,c,b,f){var d="0"!=mxUtils.getValue(c.style,"fixedSize","0"),e=d?u.prototype.fixedSize:u.prototype.size;null!=c&&(e=mxUtils.getValue(c.style, -"size",e));var g=a.x,l=a.y,q=a.width,C=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_EAST?(d=d?Math.max(0,Math.min(q,e)):q*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+q-d,l),new mxPoint(g+q,a),new mxPoint(g+q-d,l+C),new mxPoint(g,l+C),new mxPoint(g+d,a),new mxPoint(g,l)]):c==mxConstants.DIRECTION_WEST?(d=d?Math.max(0,Math.min(q,e)):q*Math.max(0, -Math.min(1,e)),l=[new mxPoint(g+d,l),new mxPoint(g+q,l),new mxPoint(g+q-d,a),new mxPoint(g+q,l+C),new mxPoint(g+d,l+C),new mxPoint(g,a),new mxPoint(g+d,l)]):c==mxConstants.DIRECTION_NORTH?(d=d?Math.max(0,Math.min(C,e)):C*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l+d),new mxPoint(n,l),new mxPoint(g+q,l+d),new mxPoint(g+q,l+C),new mxPoint(n,l+C-d),new mxPoint(g,l+C),new mxPoint(g,l+d)]):(d=d?Math.max(0,Math.min(C,e)):C*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(n,l+d),new mxPoint(g+ -q,l),new mxPoint(g+q,l+C-d),new mxPoint(n,l+C),new mxPoint(g,l+C-d),new mxPoint(g,l)]);n=new mxPoint(n,a);f&&(b.xg+q?n.y=b.y:n.x=b.x);return mxUtils.getPerimeterPoint(l,n,b)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,b,f){var d=E.prototype.size;null!=c&&(d=mxUtils.getValue(c.style,"size",d));var e=a.x,g=a.y,l=a.width,q=a.height,C=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=q*Math.max(0,Math.min(1,d)),g=[new mxPoint(C,g),new mxPoint(e+l,g+d),new mxPoint(e+l,g+q-d),new mxPoint(C,g+q),new mxPoint(e,g+q-d),new mxPoint(e,g+d),new mxPoint(C,g)]):(d=l*Math.max(0,Math.min(1,d)),g=[new mxPoint(e+d,g),new mxPoint(e+l-d,g),new mxPoint(e+l,a),new mxPoint(e+l-d,g+q),new mxPoint(e+d,g+q),new mxPoint(e,a),new mxPoint(e+d,g)]);C=new mxPoint(C,a);f&&(b.xe+ -l?C.y=b.y:C.x=b.x);return mxUtils.getPerimeterPoint(g,C,b)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(S,mxShape);S.prototype.size=10;S.prototype.paintBackground=function(a,c,b,f,d){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(c,b);a.ellipse((f-e)/2,0,e,e);a.fillAndStroke();a.begin();a.moveTo(f/2,e);a.lineTo(f/2,d);a.end();a.stroke()};mxCellRenderer.registerShape("lollipop",S);mxUtils.extend(V,mxShape);V.prototype.size= +a.getCenterY()+f)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(a,c,b,f){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(a,new mxRectangle(0,0,0,Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(c.style,"size",x.prototype.size))*c.view.scale))),c.style),c,b,f)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(a,b,f,d){var e=c.prototype.size; +null!=b&&(e=mxUtils.getValue(b.style,"size",e));var g=a.x,l=a.y,D=a.width,r=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?(e=r*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+D,l+e),new mxPoint(g+D,l+r),new mxPoint(g,l+r-e),new mxPoint(g,l)]):(e=D*Math.max(0,Math.min(1,e)),l=[new mxPoint(g+e,l),new mxPoint(g+D,l),new mxPoint(g+D-e,l+r),new mxPoint(g, +l+r),new mxPoint(g+e,l)]);r=a.getCenterX();a=a.getCenterY();a=new mxPoint(r,a);d&&(f.xg+D?a.y=f.y:a.x=f.x);return mxUtils.getPerimeterPoint(l,a,f)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,c,b,d){var e=f.prototype.size;null!=c&&(e=mxUtils.getValue(c.style,"size",e));var g=a.x,l=a.y,r=a.width,D=a.height;c=null!=c?mxUtils.getValue(c.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST; +c==mxConstants.DIRECTION_EAST?(e=r*Math.max(0,Math.min(1,e)),l=[new mxPoint(g+e,l),new mxPoint(g+r-e,l),new mxPoint(g+r,l+D),new mxPoint(g,l+D),new mxPoint(g+e,l)]):c==mxConstants.DIRECTION_WEST?(e=r*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+r,l),new mxPoint(g+r-e,l+D),new mxPoint(g+e,l+D),new mxPoint(g,l)]):c==mxConstants.DIRECTION_NORTH?(e=D*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l+e),new mxPoint(g+r,l),new mxPoint(g+r,l+D),new mxPoint(g,l+D-e),new mxPoint(g,l+e)]):(e=D*Math.max(0, +Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+r,l+e),new mxPoint(g+r,l+D-e),new mxPoint(g,l+D),new mxPoint(g,l)]);D=a.getCenterX();a=a.getCenterY();a=new mxPoint(D,a);d&&(b.xg+r?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(l,a,b)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(a,c,b,f){var d="0"!=mxUtils.getValue(c.style,"fixedSize","0"),e=d?u.prototype.fixedSize:u.prototype.size;null!=c&&(e=mxUtils.getValue(c.style, +"size",e));var g=a.x,l=a.y,r=a.width,D=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_EAST?(d=d?Math.max(0,Math.min(r,e)):r*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+r-d,l),new mxPoint(g+r,a),new mxPoint(g+r-d,l+D),new mxPoint(g,l+D),new mxPoint(g+d,a),new mxPoint(g,l)]):c==mxConstants.DIRECTION_WEST?(d=d?Math.max(0,Math.min(r,e)):r*Math.max(0, +Math.min(1,e)),l=[new mxPoint(g+d,l),new mxPoint(g+r,l),new mxPoint(g+r-d,a),new mxPoint(g+r,l+D),new mxPoint(g+d,l+D),new mxPoint(g,a),new mxPoint(g+d,l)]):c==mxConstants.DIRECTION_NORTH?(d=d?Math.max(0,Math.min(D,e)):D*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l+d),new mxPoint(n,l),new mxPoint(g+r,l+d),new mxPoint(g+r,l+D),new mxPoint(n,l+D-d),new mxPoint(g,l+D),new mxPoint(g,l+d)]):(d=d?Math.max(0,Math.min(D,e)):D*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(n,l+d),new mxPoint(g+ +r,l),new mxPoint(g+r,l+D-d),new mxPoint(n,l+D),new mxPoint(g,l+D-d),new mxPoint(g,l)]);n=new mxPoint(n,a);f&&(b.xg+r?n.y=b.y:n.x=b.x);return mxUtils.getPerimeterPoint(l,n,b)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,c,b,f){var d=E.prototype.size;null!=c&&(d=mxUtils.getValue(c.style,"size",d));var e=a.x,g=a.y,l=a.width,r=a.height,D=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=r*Math.max(0,Math.min(1,d)),g=[new mxPoint(D,g),new mxPoint(e+l,g+d),new mxPoint(e+l,g+r-d),new mxPoint(D,g+r),new mxPoint(e,g+r-d),new mxPoint(e,g+d),new mxPoint(D,g)]):(d=l*Math.max(0,Math.min(1,d)),g=[new mxPoint(e+d,g),new mxPoint(e+l-d,g),new mxPoint(e+l,a),new mxPoint(e+l-d,g+r),new mxPoint(e+d,g+r),new mxPoint(e,a),new mxPoint(e+d,g)]);D=new mxPoint(D,a);f&&(b.xe+ +l?D.y=b.y:D.x=b.x);return mxUtils.getPerimeterPoint(g,D,b)};mxStyleRegistry.putValue("hexagonPerimeter2",mxPerimeter.HexagonPerimeter2);mxUtils.extend(S,mxShape);S.prototype.size=10;S.prototype.paintBackground=function(a,c,b,f,d){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(c,b);a.ellipse((f-e)/2,0,e,e);a.fillAndStroke();a.begin();a.moveTo(f/2,e);a.lineTo(f/2,d);a.end();a.stroke()};mxCellRenderer.registerShape("lollipop",S);mxUtils.extend(V,mxShape);V.prototype.size= 10;V.prototype.inset=2;V.prototype.paintBackground=function(a,c,b,f,d){var e=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(f/2,e+g);a.lineTo(f/2,d);a.end();a.stroke();a.begin();a.moveTo((f-e)/2-g,e/2);a.quadTo((f-e)/2-g,e+g,f/2,e+g);a.quadTo((f+e)/2+g,e+g,(f+e)/2+g,e/2);a.end();a.stroke()};mxCellRenderer.registerShape("requires",V);mxUtils.extend(U,mxShape);U.prototype.paintBackground= function(a,c,b,f,d){a.translate(c,b);a.begin();a.moveTo(0,0);a.quadTo(f,0,f,d/2);a.quadTo(f,d,0,d);a.end();a.stroke()};mxCellRenderer.registerShape("requiredInterface",U);mxUtils.extend(X,mxShape);X.prototype.inset=2;X.prototype.paintBackground=function(a,c,b,f,d){var e=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(c,b);a.ellipse(0,e,f-2*e,d-2*e);a.fillAndStroke();a.begin();a.moveTo(f/2,0);a.quadTo(f,0,f,d/2);a.quadTo(f,d,f/2,d);a.end();a.stroke()};mxCellRenderer.registerShape("providedRequiredInterface", -X);mxUtils.extend(J,mxCylinder);J.prototype.jettyWidth=32;J.prototype.jettyHeight=12;J.prototype.redrawPath=function(a,c,b,f,d,e){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,l=.3*d-c/2,q=.7*d-c/2;e?(a.moveTo(b,l),a.lineTo(g,l),a.lineTo(g,l+c),a.lineTo(b,l+c),a.moveTo(b,q),a.lineTo(g,q),a.lineTo(g,q+c),a.lineTo(b,q+c)):(a.moveTo(b,0),a.lineTo(f,0),a.lineTo(f,d),a.lineTo(b,d), -a.lineTo(b,q+c),a.lineTo(0,q+c),a.lineTo(0,q),a.lineTo(b,q),a.lineTo(b,l+c),a.lineTo(0,l+c),a.lineTo(0,l),a.lineTo(b,l),a.close());a.end()};mxCellRenderer.registerShape("component",J);mxUtils.extend(aa,mxDoubleEllipse);aa.prototype.outerStroke=!0;aa.prototype.paintVertexShape=function(a,c,b,f,d){var e=Math.min(4,Math.min(f/5,d/5));0=2*f&&a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return a};mxRectangleShape.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5, 0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)]; mxEllipse.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!0),new mxConnectionConstraint(new mxPoint(1,0),!0),new mxConnectionConstraint(new mxPoint(0,1),!0),new mxConnectionConstraint(new mxPoint(1,1),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(1,.5))];mxLabel.prototype.constraints=mxRectangleShape.prototype.constraints;mxImageShape.prototype.constraints= -mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;z.prototype.constraints=mxRectangleShape.prototype.constraints;k.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-f),0));a.push(new mxConnectionConstraint(new mxPoint(0,0), +mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;y.prototype.constraints=mxRectangleShape.prototype.constraints;k.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-f),0));a.push(new mxConnectionConstraint(new mxPoint(0,0), !1,null,c-f,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-.5*f,.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*(b+f)));a.push(new mxConnectionConstraint(new mxPoint(1,1),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));c>=2*f&&a.push(new mxConnectionConstraint(new mxPoint(.5, 0),!1));return a};t.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*f,.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,f));a.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,0,.5*(b+f)));a.push(new mxConnectionConstraint(new mxPoint(0,1),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(1,1),!1));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));c>=2*f&&a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return a};a.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size)))));a.push(new mxConnectionConstraint(new mxPoint(0, 0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-f),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-f,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-.5*f,.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*(b+f)));a.push(new mxConnectionConstraint(new mxPoint(1,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),b));a.push(new mxConnectionConstraint(new mxPoint(0, -0),!1,null,f,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*f,b-.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,b-f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b-f)));return a};r.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),d=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style, +0),!1,null,f,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*f,b-.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,b-f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b-f)));return a};q.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),d=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"tabHeight",this.tabHeight))));"left"==mxUtils.getValue(this.style, "tabPosition",this.tabPosition)?(a.push(new mxConnectionConstraint(new mxPoint(0,0),!1)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*f,0)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,0)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,d)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),d))):(a.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-.5*f,0)),a.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,c-f,0)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-f,d)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-f),d)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.25*(b-d)+d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*(b-d)+d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.75*(b-d)+d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1, null,c,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(b-d)+d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b-d)+d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.75*(b-d)+d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,b));a.push(new mxConnectionConstraint(new mxPoint(.25,1),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(.75, 1),!1));return a};K.prototype.constraints=mxRectangleShape.prototype.constraints;fa.prototype.constraints=mxRectangleShape.prototype.constraints;ga.prototype.constraints=mxEllipse.prototype.constraints;W.prototype.constraints=mxEllipse.prototype.constraints;Z.prototype.constraints=mxEllipse.prototype.constraints;va.prototype.constraints=mxEllipse.prototype.constraints;ba.prototype.constraints=mxRectangleShape.prototype.constraints;ma.prototype.constraints=mxRectangleShape.prototype.constraints;ka.prototype.getConstraints= function(a,c,b){a=[];var f=Math.min(c,b/2),d=Math.min(c-f,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*c);a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d+c-f),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-f,0));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));a.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,c-f,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d+c-f),b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b));return a};P.prototype.constraints=mxRectangleShape.prototype.constraints;ca.prototype.constraints=mxRectangleShape.prototype.constraints;mxCylinder.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.15,.05),!1),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.85,.05),!1),new mxConnectionConstraint(new mxPoint(0, -.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];D.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5, +.3),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.3),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.7),!0),new mxConnectionConstraint(new mxPoint(.15,.95),!1),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.85,.95),!1)];C.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.1),!1),new mxConnectionConstraint(new mxPoint(.5, 0),!1),new mxConnectionConstraint(new mxPoint(.75,.1),!1),new mxConnectionConstraint(new mxPoint(0,1/3),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(1,1/3),!1),new mxConnectionConstraint(new mxPoint(1,1),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1)];J.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(0, .3),!0),new mxConnectionConstraint(new mxPoint(0,.7),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];mxActor.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.25,.2),!1),new mxConnectionConstraint(new mxPoint(.1, .5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.75,.25),!1),new mxConnectionConstraint(new mxPoint(.9,.5),!1),new mxConnectionConstraint(new mxPoint(1,.75),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0)];m.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(.5,.25),!1),new mxConnectionConstraint(new mxPoint(1, -0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];x.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1, +0),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.5,.75),!1),new mxConnectionConstraint(new mxPoint(1,1),!1)];v.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.35),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.65),!1),new mxConnectionConstraint(new mxPoint(1,.35),!1),new mxConnectionConstraint(new mxPoint(1, .5),!1),new mxConnectionConstraint(new mxPoint(1,.65),!1),new mxConnectionConstraint(new mxPoint(.25,1),!1),new mxConnectionConstraint(new mxPoint(.75,0),!1)];u.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.75,0),!0),new mxConnectionConstraint(new mxPoint(.25,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.75,1),!0),new mxConnectionConstraint(new mxPoint(0, .25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(1,.25),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0),new mxConnectionConstraint(new mxPoint(1,.75),!0)];mxLine.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)];S.prototype.constraints= [new mxConnectionConstraint(new mxPoint(.5,0),!1),new mxConnectionConstraint(new mxPoint(.5,1),!1)];mxDoubleEllipse.prototype.constraints=mxEllipse.prototype.constraints;mxRhombus.prototype.constraints=mxEllipse.prototype.constraints;mxTriangle.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!0),new mxConnectionConstraint(new mxPoint(0,.5),!0),new mxConnectionConstraint(new mxPoint(0,.75),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.5, @@ -2624,7 +2624,7 @@ function(a,c,b){a=[];var f=Math.min(c,b/2),d=Math.min(c-f,Math.max(0,parseFloat( 0),!1,null,d,b));return a};ra.prototype.getConstraints=function(a,c,b){a=[];var f=Math.min(b,c),d=Math.max(0,Math.min(f,f*parseFloat(mxUtils.getValue(this.style,"size",this.size)))),f=(b-d)/2,e=f+d,g=(c-d)/2,d=g+d;a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,0));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,0));a.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,d,.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,b-.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,b));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b-.5*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,e));a.push(new mxConnectionConstraint(new mxPoint(0, 0),!1,null,.5*(c+d),f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,f));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+d),e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*g,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,f));a.push(new mxConnectionConstraint(new mxPoint(0, -.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*g,e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,f));return a};y.prototype.constraints=null;F.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7, +.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*g,e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,f));return a};B.prototype.constraints=null;F.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.25),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7, .1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];ja.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.175,.25),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.175,.75),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(.7,.1),!1),new mxConnectionConstraint(new mxPoint(.7,.9),!1)];U.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1, .5),!1)];X.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1)]})();function Actions(a){this.editorUi=a;this.actions={};this.init()} Actions.prototype.init=function(){function a(a){d.escape();var b=d.getDeletableCells(d.getSelectionCells());if(null!=b&&0e?a=a.substring(0,e)+"[...]":null!=a&&a.length>b&&(a=Graph.compress(a)+"\n");return a}; DrawioFile.prototype.checksumError=function(a,b,e,d,k){this.stats.checksumErrors++;this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=this.sync&&this.sync.updateOnlineState();null!=a&&a();try{if(this.errorReportsEnabled){if(null!=b)for(a=0;amxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{m.container.style.visibility="";m.model.endUpdate();m.cellRenderer.redraw=A;this.changeListenerEnabled=r;e.history=d;e.indexOfNextAdd=k;e.fireEvent(new mxEventObject(mxEvent.CLEAR));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)x!= +DrawioFile.prototype.patch=function(a,b){var e=this.ui.editor.undoManager,d=e.history.slice(),k=e.indexOfNextAdd,m=this.ui.editor.graph;m.container.style.visibility="hidden";var q=this.changeListenerEnabled;this.changeListenerEnabled=!1;var t=m.foldingEnabled,v=m.mathEnabled,A=m.cellRenderer.redraw;m.cellRenderer.redraw=function(a){a.view.graph.isEditing(a.cell)&&(a.view.graph.scrollCellToVisible(a.cell),a.view.graph.cellEditor.resize());A.apply(this,arguments)};m.model.beginUpdate();try{for(var c= +0;cmxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{m.container.style.visibility="";m.model.endUpdate();m.cellRenderer.redraw=A;this.changeListenerEnabled=q;e.history=d;e.indexOfNextAdd=k;e.fireEvent(new mxEventObject(mxEvent.CLEAR));if(null==this.ui.currentPage||this.ui.currentPage.needsUpdate)v!= m.mathEnabled?(this.ui.editor.updateGraphComponents(),m.refresh()):(t!=m.foldingEnabled?m.view.revalidate():m.view.validate(),m.sizeDidChange());this.ui.updateTabContainer()}}; DrawioFile.prototype.save=function(a,b,e,d,k,m){if(this.isEditable())if(!k&&this.invalidChecksum)if(null!=e)e({message:mxResources.get("checksum")});else throw Error(mxResources.get("checksum"));else this.updateFileData(),this.clearAutosave();else if(null!=e)e({message:mxResources.get("readOnly")});else throw Error(mxResources.get("readOnly"));};DrawioFile.prototype.updateFileData=function(){this.setData(this.ui.getFileData(null,null,null,null,null,null,null,null,this))}; DrawioFile.prototype.saveAs=function(a,b,e){};DrawioFile.prototype.saveFile=function(a,b,e,d){};DrawioFile.prototype.getPublicUrl=function(a){a(null)};DrawioFile.prototype.isRestricted=function(){return!1};DrawioFile.prototype.isModified=function(){return this.modified};DrawioFile.prototype.setModified=function(a){this.modified=a};DrawioFile.prototype.isAutosaveOptional=function(){return!1};DrawioFile.prototype.isAutosave=function(){return!this.inConflictState&&this.ui.editor.autosave}; @@ -2728,8 +2728,8 @@ DrawioFile.prototype.handleConflictError=function(a,b){var e=mxUtils.bind(this,f function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.save(!0,e,d,null,null,this.constructor==GitHubFile&&null!=a?a.commitMessage:null)}),d)});"none"==DrawioFile.SYNC?this.showCopyDialog(e,d,k):this.invalidChecksum?this.showRefreshDialog(e,d,this.getErrorMessage(a)):b?this.showConflictDialog(k,m):this.addConflictStatus(mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));this.synchronizeFile(e, d)}),this.getErrorMessage(a))};DrawioFile.prototype.getErrorMessage=function(a){return null!=a?null!=a.error?a.error.message:a.message:null}; DrawioFile.prototype.fileChanged=function(){this.setModified(!0);this.isAutosave()?(this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){null==this.autosaveThread&&this.handleFileSuccess(!0)}),mxUtils.bind(this,function(a){this.handleFileError(a)}))):this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus()}; -DrawioFile.prototype.fileSaved=function(a,b,e,d){this.lastSaved=new Date;try{this.stats.saved++,this.invalidChecksum=this.inConflictState=!1,null==this.sync?(this.shadowData=a,this.shadowPages=null,null!=e&&e()):this.sync.fileSaved(this.ui.getPagesForNode(mxUtils.parseXml(a).documentElement),b,e,d,a)}catch(r){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=d&&d(r);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,r);else{var k=this.getCurrentUser(), -m=null!=k?k.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),m,r)}}catch(t){}}}; +DrawioFile.prototype.fileSaved=function(a,b,e,d){this.lastSaved=new Date;try{this.stats.saved++,this.invalidChecksum=this.inConflictState=!1,null==this.sync?(this.shadowData=a,this.shadowPages=null,null!=e&&e()):this.sync.fileSaved(this.ui.getPagesForNode(mxUtils.parseXml(a).documentElement),b,e,d,a)}catch(q){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=d&&d(q);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,q);else{var k=this.getCurrentUser(), +m=null!=k?k.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),m,q)}}catch(t){}}}; DrawioFile.prototype.autosave=function(a,b,e,d){null==this.lastAutosave&&(this.lastAutosave=(new Date).getTime());a=(new Date).getTime()-this.lastAutosavethis.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))}; @@ -2791,14 +2791,14 @@ d=0;d>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 p=0;if(e(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(e(a,4),"IHDR"!=e(a,4))null!=d&&d();else{e(a,17);d=a.substring(0,p);do{var n=g(a); if("IDAT"==e(a,4)){d=a.substring(0,p-8);b=b+String.fromCharCode(0)+("zTXt"==c?String.fromCharCode(0):"")+f;f=4294967295;f=EditorUi.prototype.updateCRC(f,c,0,4);f=EditorUi.prototype.updateCRC(f,b,0,b.length);d+=l(b.length)+c+b+l(f^4294967295);d+=a.substring(p-8,a.length);break}d+=a.substring(p-8,p-4+n);e(a,n);e(a,4)}while(n);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 k=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,c){k.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 r=Format.prototype.init;Format.prototype.init=function(){r.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var t=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?t.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isShadowOptionVisible=function(){var a=this.editorUi.getCurrentFile(); -return"1"==urlParams.embed||null!=a&&a.isEditable()};DiagramFormatPanel.prototype.isMathOptionVisible=function(a){return!1};var x=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=x.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var c=this.editorUi,b=c.editor.graph,f=this.createOption(mxResources.get("shadow"),function(){return b.shadowVisible},function(a){var f=new ChangePageSetup(c);f.ignoreColor=!0;f.ignoreImage= +(b=a.currentPage.getId());return b});if(null!=window.StyleFormatPanel){var q=Format.prototype.init;Format.prototype.init=function(){q.apply(this,arguments);this.editorUi.editor.addListener("fileLoaded",this.update)};var t=Format.prototype.refresh;Format.prototype.refresh=function(){null!=this.editorUi.getCurrentFile()||"1"==urlParams.embed||this.editorUi.editor.chromeless?t.apply(this,arguments):this.clear()};DiagramFormatPanel.prototype.isShadowOptionVisible=function(){var a=this.editorUi.getCurrentFile(); +return"1"==urlParams.embed||null!=a&&a.isEditable()};DiagramFormatPanel.prototype.isMathOptionVisible=function(a){return!1};var v=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(a){a=v.apply(this,arguments);this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var c=this.editorUi,b=c.editor.graph,f=this.createOption(mxResources.get("shadow"),function(){return b.shadowVisible},function(a){var f=new ChangePageSetup(c);f.ignoreColor=!0;f.ignoreImage= !0;f.shadowVisible=a;b.model.execute(f)},{install:function(a){this.listener=function(){a(b.shadowVisible)};c.addListener("shadowVisibleChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}});Editor.shadowOptionEnabled||(f.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(f,60));a.appendChild(f)}return a};var A=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(a){a=A.apply(this,arguments);var c=this.editorUi, b=c.editor.graph;if(b.isEnabled()){var f=c.getCurrentFile();null!=f&&f.isAutosaveOptional()&&(f=this.createOption(mxResources.get("autosave"),function(){return c.editor.autosave},function(a){c.editor.setAutosave(a)},{install:function(a){this.listener=function(){a(c.editor.autosave)};c.editor.addListener("autosaveChanged",this.listener)},destroy:function(){c.editor.removeListener(this.listener)}}),a.appendChild(f))}if(this.isMathOptionVisible()&&b.isEnabled()&&"undefined"!==typeof MathJax){f=this.createOption(mxResources.get("mathematicalTypesetting"), function(){return b.mathEnabled},function(a){c.actions.get("mathematicalTypesetting").funct()},{install:function(a){this.listener=function(){a(b.mathEnabled)};c.addListener("mathEnabledChanged",this.listener)},destroy:function(){c.removeListener(this.listener)}});f.style.paddingTop="5px";a.appendChild(f);var d=c.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000032875");d.style.position="relative";d.style.marginLeft="6px";d.style.top="2px";f.appendChild(d)}return a};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties= @@ -2828,19 +2828,19 @@ c.apply(this,arguments);if(Editor.enableCustomProperties){for(var b={},f=a.verti 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 f.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,c,b){function f(a,c,b,f){u.getModel().beginUpdate();try{var d=[],e=[];if(null!=b.index){for(var g=[],l=b.parentRow.nextSibling;l&&l.getAttribute("data-pName")==a;)g.push(l.getAttribute("data-pValue")),l=l.nextSibling;b.index b.size&&(g=g.slice(0,b.size));c=g.join(",");null!=b.countProperty&&(u.setCellStyles(b.countProperty,g.length,u.getSelectionCells()),d.push(b.countProperty),e.push(g.length))}u.setCellStyles(a,c,u.getSelectionCells());d.push(a);e.push(c);if(null!=b.dependentProps)for(a=0;ac)n=n.slice(0,c);else for(var k=n.length;kn.max&&(a=n.max);a=mxUtils.htmlEntities(("int"==B?parseInt(a):a)+"");f(c,a,n)}var g=document.createElement("input");d(y,g,!0);g.value=b;g.className="gePropEditor";"int"!=B&&"float"!=B||n.allowAuto||(g.type="number",g.step="int"==B?"1":"any",null!=n.min&&(g.min=parseFloat(n.min)),null!=n.max&&(g.max=parseFloat(n.max)));a.appendChild(g);mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&e()}); -g.focus();mxEvent.addListener(g,"blur",function(){e()})})));n.isDeletable&&(k=mxUtils.button("-",mxUtils.bind(q,function(a){f(c,"",n,n.index);mxEvent.consume(a)})),k.style.height="16px",k.style.width="25px",k.style["float"]="right",k.className="geColorBtn",y.appendChild(k));m.appendChild(y);return m}var q=this,u=this.editorUi.editor.graph,k=[];a.style.position="relative";a.style.padding="0";var v=document.createElement("table");v.style.whiteSpace="nowrap";v.style.width="100%";var B=document.createElement("tr"); -B.className="gePropHeader";var m=document.createElement("th");m.className="gePropHeaderCell";var z=document.createElement("img");z.src=Sidebar.prototype.expandedImage;m.appendChild(z);mxUtils.write(m,mxResources.get("property"));B.style.cursor="pointer";var r=function(){var c=v.querySelectorAll(".gePropNonHeaderRow"),b;if(q.editorUi.propertiesCollapsed){z.src=Sidebar.prototype.collapsedImage;b="none";for(var f=a.childNodes.length-1;0<=f;f--)try{var d=a.childNodes[f],e=d.nodeName.toUpperCase();"INPUT"!= -e&&"SELECT"!=e||a.removeChild(d)}catch(Z){}}else z.src=Sidebar.prototype.expandedImage,b="";for(f=0;fn.max&&(a=n.max);a=mxUtils.htmlEntities(("int"==x?parseInt(a):a)+"");f(c,a,n)}var g=document.createElement("input");d(y,g,!0);g.value=b;g.className="gePropEditor";"int"!=x&&"float"!=x||n.allowAuto||(g.type="number",g.step="int"==x?"1":"any",null!=n.min&&(g.min=parseFloat(n.min)),null!=n.max&&(g.max=parseFloat(n.max)));a.appendChild(g);mxEvent.addListener(g,"keypress",function(a){13==a.keyCode&&e()}); +g.focus();mxEvent.addListener(g,"blur",function(){e()})})));n.isDeletable&&(k=mxUtils.button("-",mxUtils.bind(r,function(a){f(c,"",n,n.index);mxEvent.consume(a)})),k.style.height="16px",k.style.width="25px",k.style["float"]="right",k.className="geColorBtn",y.appendChild(k));m.appendChild(y);return m}var r=this,u=this.editorUi.editor.graph,k=[];a.style.position="relative";a.style.padding="0";var z=document.createElement("table");z.style.whiteSpace="nowrap";z.style.width="100%";var x=document.createElement("tr"); +x.className="gePropHeader";var m=document.createElement("th");m.className="gePropHeaderCell";var y=document.createElement("img");y.src=Sidebar.prototype.expandedImage;m.appendChild(y);mxUtils.write(m,mxResources.get("property"));x.style.cursor="pointer";var q=function(){var c=z.querySelectorAll(".gePropNonHeaderRow"),b;if(r.editorUi.propertiesCollapsed){y.src=Sidebar.prototype.collapsedImage;b="none";for(var f=a.childNodes.length-1;0<=f;f--)try{var d=a.childNodes[f],e=d.nodeName.toUpperCase();"INPUT"!= +e&&"SELECT"!=e||a.removeChild(d)}catch(Z){}}else y.src=Sidebar.prototype.expandedImage,b="";for(f=0;fdocument.documentMode)?c.style.filter="progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+a.fill+"', EndColorStr='"+a.gradient+"', GradientType=0)":c.style.backgroundImage="linear-gradient("+a.fill+" 0px,"+a.gradient+" 100%)":a.fill==mxConstants.NONE? @@ -2857,9 +2857,9 @@ this.getInsertPoint=function(){return null!=c?this.getPointForEvent(c):b.apply(t c)};b.fill=!0;b.unitSize=mxRackContainer.unitSize|20;b.marginLeft=c.marginLeft||0;b.marginRight=c.marginRight||0;b.marginTop=c.marginTop||0;b.marginBottom=c.marginBottom||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 f.apply(this,arguments)}}; var n=Graph.prototype.getSvg;Graph.prototype.getSvg=function(){var a=null;if(null!=this.themes&&"darkTheme"==this.defaultThemeName){a=this.stylesheet;this.stylesheet=new mxStylesheet;var c=this.themes["default-style2"];(new mxCodec(c.ownerDocument)).decode(c,this.getStylesheet());this.refresh()}c=n.apply(this,arguments);null!=a&&(this.stylesheet=a,this.refresh());return c};var l=Graph.prototype.isCssTransformsSupported;Graph.prototype.isCssTransformsSupported=function(){return l.apply(this,arguments)&& -!mxClient.IS_SF};var p=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var c=p.apply(this,arguments);if(null==c){if(null==this.globalUrlVars&&null!=urlParams.vars)try{this.globalUrlVars=JSON.parse(decodeURIComponent(urlParams.vars))}catch(Q){null!=window.console&&console.log("Error in vars URL parameter: "+Q)}null!=this.globalUrlVars&&(c=this.globalUrlVars[a])}return c};var B=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage= -function(){B.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))}};var v=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){v.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(a){if("data:action/json,"== +!mxClient.IS_SF};var p=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var c=p.apply(this,arguments);if(null==c){if(null==this.globalUrlVars&&null!=urlParams.vars)try{this.globalUrlVars=JSON.parse(decodeURIComponent(urlParams.vars))}catch(Q){null!=window.console&&console.log("Error in vars URL parameter: "+Q)}null!=this.globalUrlVars&&(c=this.globalUrlVars[a])}return c};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))}};var x=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){x.apply(this,arguments);this.currentStyle="default-style2"};Graph.prototype.handleCustomLink=function(a){if("data:action/json,"== a.substring(0,17)&&(a=JSON.parse(a.substring(17)),null!=a.actions)){for(var c=0;c'),c.writeln(a.editor.fontCss),c.writeln(""))};if("undefined"!==typeof MathJax){var B=b.renderPage;b.renderPage=function(a,c,b,f,d,e){var g=mxClient.NO_FO;mxClient.NO_FO= -this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var l=B.apply(this,arguments);mxClient.NO_FO=g;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:l.className="geDisableMathJax";return l}}b.open(null,null,d,!0)}else{n=c.background;if(null==n||""==n||n==mxConstants.NONE)n="#ffffff";b.backgroundColor=n;b.autoOrigin=u;b.appendGraph(c,p,g,l,d,!0)}return b}var f=parseInt(W.value)/100;isNaN(f)&&(f=1,W.value="100 %");var f=.75*f,e=v.value,g=q.value,l=!u.checked, -n=null;l&&(l=e==p&&g==p);if(!l&&null!=a.pages&&a.pages.length){var k=0,l=a.pages.length-1;u.checked||(k=parseInt(e)-1,l=parseInt(g)-1);for(var B=k;B<=l;B++){var m=a.pages[B],e=m==a.currentPage?d:null;if(null==e){var e=a.createTemporaryGraph(d.getStylesheet()),g=!0,k=!1,y=null,E=null;null==m.viewState&&null==m.root&&a.updatePageRoot(m);null!=m.viewState&&(g=m.viewState.pageVisible,k=m.viewState.mathEnabled,y=m.viewState.background,E=m.viewState.backgroundImage);e.background=y;e.backgroundImage=null!= -E?new mxImage(E.src,E.width,E.height):null;e.pageVisible=g;e.mathEnabled=k;var G=e.getGlobalVariable;e.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?B+1:G.apply(this,arguments)};document.body.appendChild(e.container);a.updatePageRoot(m);e.model.setRoot(m.root)}n=b(e,n,B!=l);e!=d&&e.container.parentNode.removeChild(e.container)}}else n=b(d);null==n?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(n.mathEnabled&&(l=n.wnd.document,l.writeln('