Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jgraph/drawio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaudenz Alder <gaudenz@jgraph.com>2019-03-12 12:03:41 +0300
committerGaudenz Alder <gaudenz@jgraph.com>2019-03-12 12:03:41 +0300
commit1cb19c4289dbc05e5758638f46522633ebac636a (patch)
tree6afd3553eed471a3ab1aa9878695abef799c77cd
parentfe5c05c842ba73ca537790b66f3f603b290675a4 (diff)
10.4.3 releasev10.4.3
Former-commit-id: 5587c6c0844cabb3220f45514ef80574310d8163
-rw-r--r--ChangeLog4
-rw-r--r--VERSION2
-rw-r--r--etc/mxgraph/mxClient.js13
-rw-r--r--src/main/java/com/mxgraph/online/ProxyServlet.java5
-rw-r--r--src/main/webapp/cache.manifest2
-rw-r--r--src/main/webapp/js/app.min.js601
-rw-r--r--src/main/webapp/js/diagramly/App.js24
-rw-r--r--src/main/webapp/js/diagramly/DrawioFile.js8
-rw-r--r--src/main/webapp/js/diagramly/DrawioFileSync.js21
-rw-r--r--src/main/webapp/js/diagramly/DriveClient.js54
-rw-r--r--src/main/webapp/js/diagramly/DriveFile.js11
-rw-r--r--src/main/webapp/js/diagramly/EditorUi.js54
-rw-r--r--src/main/webapp/js/diagramly/Menus.js2
-rw-r--r--src/main/webapp/js/diagramly/OneDriveFile.js3
-rw-r--r--src/main/webapp/js/viewer.min.js2043
15 files changed, 1445 insertions, 1402 deletions
diff --git a/ChangeLog b/ChangeLog
index 45f1b64f..e3e09363 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+12-MAR-2019: 10.4.3
+
+- Uses mxGraph 4.0.1 beta 1
+
11-MAR-2019: 10.4.2
- Adds logging
diff --git a/VERSION b/VERSION
index d3a69816..32002b99 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-10.4.2 \ No newline at end of file
+10.4.3 \ No newline at end of file
diff --git a/etc/mxgraph/mxClient.js b/etc/mxgraph/mxClient.js
index 2702307d..d45699d4 100644
--- a/etc/mxgraph/mxClient.js
+++ b/etc/mxgraph/mxClient.js
@@ -1,11 +1,10 @@
-var mxClient={VERSION:"3.9.13",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
+var mxClient={VERSION:"4.0.1",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
-0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
-0<=navigator.userAgent.indexOf("Epiphany/")||0<=navigator.userAgent.indexOf("AppleWebKit/")||0<=navigator.userAgent.indexOf("Gecko/")||0<=navigator.userAgent.indexOf("Opera/")||null!=document.documentMode&&9<=document.documentMode,NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg","foreignObject")||0<=navigator.userAgent.indexOf("Opera/"),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_WIN:0<navigator.appVersion.indexOf("Win"),
-IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(0<navigator.appVersion.indexOf("Mac")),IS_LOCAL:0>document.location.href.indexOf("http://")&&0>document.location.href.indexOf("https://"),defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(a,b,c){c=c||document;if(mxClient.IS_IE6)c.write('<link rel="'+a+'" href="'+b+'" charset="UTF-8" type="text/css"/>');else{var d=
-c.createElement("link");d.setAttribute("rel",a);d.setAttribute("href",b);d.setAttribute("charset","UTF-8");d.setAttribute("type","text/css");c.getElementsByTagName("head")[0].appendChild(d)}},loadResources:function(a,b){function c(){0==--d&&a()}for(var d=mxClient.defaultBundles.length,e=0;e<mxClient.defaultBundles.length;e++)mxResources.add(mxClient.defaultBundles[e],b,c)},include:function(a){document.write('<script src="'+a+'">\x3c/script>')}};
-"undefined"==typeof mxLoadResources&&(mxLoadResources=!0);"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1);"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt");"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0);"undefined"!=typeof mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".";
+0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg",
+"foreignObject")||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(0<navigator.appVersion.indexOf("Mac")),IS_LOCAL:0>document.location.href.indexOf("http://")&&0>document.location.href.indexOf("https://"),defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(a,b,c){c=c||document;
+if(mxClient.IS_IE6)c.write('<link rel="'+a+'" href="'+b+'" charset="UTF-8" type="text/css"/>');else{var d=c.createElement("link");d.setAttribute("rel",a);d.setAttribute("href",b);d.setAttribute("charset","UTF-8");d.setAttribute("type","text/css");c.getElementsByTagName("head")[0].appendChild(d)}},loadResources:function(a,b){function c(){0==--d&&a()}for(var d=mxClient.defaultBundles.length,e=0;e<mxClient.defaultBundles.length;e++)mxResources.add(mxClient.defaultBundles[e],b,c)},include:function(a){document.write('<script src="'+
+a+'">\x3c/script>')}};"undefined"==typeof mxLoadResources&&(mxLoadResources=!0);"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1);"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt");"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0);"undefined"!=typeof mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".";
"undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images";mxClient.language="undefined"!=typeof mxLanguage&&null!=mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language;
mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxDefaultLanguage:"en";mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css");"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages);
mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office")),mxClient.IS_QUIRKS&&30<=document.styleSheets.length?function(){var a=
@@ -1110,7 +1109,7 @@ mxGraph.prototype.fit=function(a,b,c,d,e,f,g){if(null!=this.container){a=null!=a
(n=Math.max(n,this.backgroundImage.width-g.x/k),p=Math.max(p,this.backgroundImage.height-g.y/k));var q=(b?a:2*a)+c+1,l=l-q,m=m-q;e=e?m/p:f?l/n:Math.min(l/n,m/p);null!=this.minFitScale&&(e=Math.max(e,this.minFitScale));null!=this.maxFitScale&&(e=Math.min(e,this.maxFitScale));if(d)b?this.view.scale!=e&&this.view.setScale(e):mxUtils.hasScrollbars(this.container)?(this.view.setScale(e),a=this.getGraphBounds(),null!=a.x&&(this.container.scrollLeft=a.x),null!=a.y&&(this.container.scrollTop=a.y)):this.view.scaleAndTranslate(e,
null!=g.x?Math.floor(this.view.translate.x-g.x/k+a/e+c/2):a,null!=g.y?Math.floor(this.view.translate.y-g.y/k+a/e+c/2):a);else return e}}return this.view.scale};
mxGraph.prototype.sizeDidChange=function(){var a=this.getGraphBounds();if(null!=this.container){var b=this.getBorder(),c=Math.max(0,a.x+a.width+2*b*this.view.scale),b=Math.max(0,a.y+a.height+2*b*this.view.scale);null!=this.minimumContainerSize&&(c=Math.max(c,this.minimumContainerSize.width),b=Math.max(b,this.minimumContainerSize.height));this.resizeContainer&&this.doResizeContainer(c,b);if(this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var d=this.getPreferredPageSize(a,Math.max(1,c),Math.max(1,
-b));null!=d&&(c=d.width*this.view.scale,b=d.height*this.view.scale)}null!=this.minimumGraphSize&&(c=Math.max(c,this.minimumGraphSize.width*this.view.scale),b=Math.max(b,this.minimumGraphSize.height*this.view.scale));c=Math.ceil(c);b=Math.ceil(b);this.dialect==mxConstants.DIALECT_SVG?(d=this.view.getDrawPane().ownerSVGElement,d.style.minWidth=Math.max(1,c)+"px",d.style.minHeight=Math.max(1,b)+"px",d.style.width="100%",d.style.height="100%"):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,
+b));null!=d&&(c=d.width*this.view.scale,b=d.height*this.view.scale)}null!=this.minimumGraphSize&&(c=Math.max(c,this.minimumGraphSize.width*this.view.scale),b=Math.max(b,this.minimumGraphSize.height*this.view.scale));c=Math.ceil(c);b=Math.ceil(b);this.dialect==mxConstants.DIALECT_SVG?(d=this.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.minWidth=Math.max(1,c)+"px",d.style.minHeight=Math.max(1,b)+"px",d.style.width="100%",d.style.height="100%")):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,
c),Math.max(1,b)):(this.view.canvas.style.minWidth=Math.max(1,c)+"px",this.view.canvas.style.minHeight=Math.max(1,b)+"px");this.updatePageBreaks(this.pageBreaksVisible,c,b)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",a))};mxGraph.prototype.doResizeContainer=function(a,b){null!=this.maximumContainerSize&&(a=Math.min(this.maximumContainerSize.width,a),b=Math.min(this.maximumContainerSize.height,b));this.container.style.width=Math.ceil(a)+"px";this.container.style.height=Math.ceil(b)+"px"};
mxGraph.prototype.updatePageBreaks=function(a,b,c){b=this.view.scale;c=this.view.translate;var d=this.pageFormat,e=b*this.pageScale,f=new mxRectangle(0,0,d.width*e,d.height*e),d=mxRectangle.fromRectangle(this.getGraphBounds());d.width=Math.max(1,d.width);d.height=Math.max(1,d.height);f.x=Math.floor((d.x-c.x*b)/f.width)*f.width+c.x*b;f.y=Math.floor((d.y-c.y*b)/f.height)*f.height+c.y*b;d.width=Math.ceil((d.width+(d.x-f.x))/f.width)*f.width;d.height=Math.ceil((d.height+(d.y-f.y))/f.height)*f.height;
var g=(a=a&&Math.min(f.width,f.height)>this.minPageBreakDist)?Math.ceil(d.height/f.height)+1:0,k=a?Math.ceil(d.width/f.width)+1:0,l=(k-1)*f.width,m=(g-1)*f.height;null==this.horizontalPageBreaks&&0<g&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<k&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var b=a==this.horizontalPageBreaks?g:k,c=0;c<=b;c++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(f.x),Math.round(f.y+c*f.height)),new mxPoint(Math.round(f.x+
diff --git a/src/main/java/com/mxgraph/online/ProxyServlet.java b/src/main/java/com/mxgraph/online/ProxyServlet.java
index 6309dbd1..326a9898 100644
--- a/src/main/java/com/mxgraph/online/ProxyServlet.java
+++ b/src/main/java/com/mxgraph/online/ProxyServlet.java
@@ -67,14 +67,14 @@ public class ProxyServlet extends HttpServlet
String ua = request.getHeader("User-Agent");
String dom = getCorsDomain(ref, ua);
- try
+ try(OutputStream out = response.getOutputStream())
{
request.setCharacterEncoding("UTF-8");
response.setCharacterEncoding("UTF-8");
URL url = new URL(urlParam);
URLConnection connection = url.openConnection();
- OutputStream out = response.getOutputStream();
+
response.setHeader("Cache-Control", "private, max-age=86400");
// Workaround for 451 response from Iconfinder CDN
@@ -123,7 +123,6 @@ public class ProxyServlet extends HttpServlet
}
out.flush();
- out.close();
log.log(Level.FINEST, "processed proxy request: url="
+ ((urlParam != null) ? urlParam : "[null]")
diff --git a/src/main/webapp/cache.manifest b/src/main/webapp/cache.manifest
index 1922e7b1..e6b8f8da 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/11/2019 09:44 AM
+# 03/12/2019 09:54 AM
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 add059f2..85dce11a 100644
--- a/src/main/webapp/js/app.min.js
+++ b/src/main/webapp/js/app.min.js
@@ -141,14 +141,13 @@ ko:"한국어",ja:"日本語",zh:"简体中文","zh-tw":"繁體中文"};"undefin
window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefined"!==typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}try{null==a&&414>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)&&(a="min")}catch(c){}return a}();function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)}
(function(){if("undefined"!==typeof JSON&&isLocalStorage)try{var a=localStorage.getItem(".drawio-config"),b=!0;null!=a&&(b=JSON.parse(a).showStartScreen);0==b&&(urlParams.splash="0")}catch(c){}a=urlParams["export"];null!=a&&("http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),EXPORT_URL=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";b=window.location.host;"test.draw.io"!=b&&(a=b.length-7,b=b.lastIndexOf("draw.io",a),-1!==b&&b===a&&(window.DRAWIO_LOG_URL="https://log.draw.io"))})();
if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local)urlParams.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.tr="0";if("1"==urlParams.offline||"1"==urlParams.local)urlParams.math="0";"1"==urlParams.lightbox&&(urlParams.chrome="0");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
-window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"3.9.13",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
+window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"4.0.1",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
-0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
-0<=navigator.userAgent.indexOf("Epiphany/")||0<=navigator.userAgent.indexOf("AppleWebKit/")||0<=navigator.userAgent.indexOf("Gecko/")||0<=navigator.userAgent.indexOf("Opera/")||null!=document.documentMode&&9<=document.documentMode,NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg","foreignObject")||0<=navigator.userAgent.indexOf("Opera/"),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_WIN:0<navigator.appVersion.indexOf("Win"),
-IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(0<navigator.appVersion.indexOf("Mac")),IS_LOCAL:0>document.location.href.indexOf("http://")&&0>document.location.href.indexOf("https://"),defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(a,b,c){c=c||document;if(mxClient.IS_IE6)c.write('<link rel="'+a+'" href="'+b+'" charset="UTF-8" type="text/css"/>');else{var d=
-c.createElement("link");d.setAttribute("rel",a);d.setAttribute("href",b);d.setAttribute("charset","UTF-8");d.setAttribute("type","text/css");c.getElementsByTagName("head")[0].appendChild(d)}},loadResources:function(a,b){function c(){0==--d&&a()}for(var d=mxClient.defaultBundles.length,e=0;e<mxClient.defaultBundles.length;e++)mxResources.add(mxClient.defaultBundles[e],b,c)},include:function(a){document.write('<script src="'+a+'">\x3c/script>')}};
-"undefined"==typeof mxLoadResources&&(mxLoadResources=!0);"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1);"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt");"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0);"undefined"!=typeof mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".";
+0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg",
+"foreignObject")||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(0<navigator.appVersion.indexOf("Mac")),IS_LOCAL:0>document.location.href.indexOf("http://")&&0>document.location.href.indexOf("https://"),defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(a,b,c){c=c||document;
+if(mxClient.IS_IE6)c.write('<link rel="'+a+'" href="'+b+'" charset="UTF-8" type="text/css"/>');else{var d=c.createElement("link");d.setAttribute("rel",a);d.setAttribute("href",b);d.setAttribute("charset","UTF-8");d.setAttribute("type","text/css");c.getElementsByTagName("head")[0].appendChild(d)}},loadResources:function(a,b){function c(){0==--d&&a()}for(var d=mxClient.defaultBundles.length,e=0;e<mxClient.defaultBundles.length;e++)mxResources.add(mxClient.defaultBundles[e],b,c)},include:function(a){document.write('<script src="'+
+a+'">\x3c/script>')}};"undefined"==typeof mxLoadResources&&(mxLoadResources=!0);"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1);"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt");"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0);"undefined"!=typeof mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".";
"undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images";mxClient.language="undefined"!=typeof mxLanguage&&null!=mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language;
mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxDefaultLanguage:"en";mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css");"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages);
mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office")),mxClient.IS_QUIRKS&&30<=document.styleSheets.length?function(){var a=
@@ -1253,7 +1252,7 @@ mxGraph.prototype.fit=function(a,b,c,d,e,f,g){if(null!=this.container){a=null!=a
(n=Math.max(n,this.backgroundImage.width-g.x/k),p=Math.max(p,this.backgroundImage.height-g.y/k));var q=(b?a:2*a)+c+1,l=l-q,m=m-q;e=e?m/p:f?l/n:Math.min(l/n,m/p);null!=this.minFitScale&&(e=Math.max(e,this.minFitScale));null!=this.maxFitScale&&(e=Math.min(e,this.maxFitScale));if(d)b?this.view.scale!=e&&this.view.setScale(e):mxUtils.hasScrollbars(this.container)?(this.view.setScale(e),a=this.getGraphBounds(),null!=a.x&&(this.container.scrollLeft=a.x),null!=a.y&&(this.container.scrollTop=a.y)):this.view.scaleAndTranslate(e,
null!=g.x?Math.floor(this.view.translate.x-g.x/k+a/e+c/2):a,null!=g.y?Math.floor(this.view.translate.y-g.y/k+a/e+c/2):a);else return e}}return this.view.scale};
mxGraph.prototype.sizeDidChange=function(){var a=this.getGraphBounds();if(null!=this.container){var b=this.getBorder(),c=Math.max(0,a.x+a.width+2*b*this.view.scale),b=Math.max(0,a.y+a.height+2*b*this.view.scale);null!=this.minimumContainerSize&&(c=Math.max(c,this.minimumContainerSize.width),b=Math.max(b,this.minimumContainerSize.height));this.resizeContainer&&this.doResizeContainer(c,b);if(this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var d=this.getPreferredPageSize(a,Math.max(1,c),Math.max(1,
-b));null!=d&&(c=d.width*this.view.scale,b=d.height*this.view.scale)}null!=this.minimumGraphSize&&(c=Math.max(c,this.minimumGraphSize.width*this.view.scale),b=Math.max(b,this.minimumGraphSize.height*this.view.scale));c=Math.ceil(c);b=Math.ceil(b);this.dialect==mxConstants.DIALECT_SVG?(d=this.view.getDrawPane().ownerSVGElement,d.style.minWidth=Math.max(1,c)+"px",d.style.minHeight=Math.max(1,b)+"px",d.style.width="100%",d.style.height="100%"):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,
+b));null!=d&&(c=d.width*this.view.scale,b=d.height*this.view.scale)}null!=this.minimumGraphSize&&(c=Math.max(c,this.minimumGraphSize.width*this.view.scale),b=Math.max(b,this.minimumGraphSize.height*this.view.scale));c=Math.ceil(c);b=Math.ceil(b);this.dialect==mxConstants.DIALECT_SVG?(d=this.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.minWidth=Math.max(1,c)+"px",d.style.minHeight=Math.max(1,b)+"px",d.style.width="100%",d.style.height="100%")):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,
c),Math.max(1,b)):(this.view.canvas.style.minWidth=Math.max(1,c)+"px",this.view.canvas.style.minHeight=Math.max(1,b)+"px");this.updatePageBreaks(this.pageBreaksVisible,c,b)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",a))};mxGraph.prototype.doResizeContainer=function(a,b){null!=this.maximumContainerSize&&(a=Math.min(this.maximumContainerSize.width,a),b=Math.min(this.maximumContainerSize.height,b));this.container.style.width=Math.ceil(a)+"px";this.container.style.height=Math.ceil(b)+"px"};
mxGraph.prototype.updatePageBreaks=function(a,b,c){b=this.view.scale;c=this.view.translate;var d=this.pageFormat,e=b*this.pageScale,f=new mxRectangle(0,0,d.width*e,d.height*e),d=mxRectangle.fromRectangle(this.getGraphBounds());d.width=Math.max(1,d.width);d.height=Math.max(1,d.height);f.x=Math.floor((d.x-c.x*b)/f.width)*f.width+c.x*b;f.y=Math.floor((d.y-c.y*b)/f.height)*f.height+c.y*b;d.width=Math.ceil((d.width+(d.x-f.x))/f.width)*f.width;d.height=Math.ceil((d.height+(d.y-f.y))/f.height)*f.height;
var g=(a=a&&Math.min(f.width,f.height)>this.minPageBreakDist)?Math.ceil(d.height/f.height)+1:0,k=a?Math.ceil(d.width/f.width)+1:0,l=(k-1)*f.width,m=(g-1)*f.height;null==this.horizontalPageBreaks&&0<g&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<k&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var b=a==this.horizontalPageBreaks?g:k,c=0;c<=b;c++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(f.x),Math.round(f.y+c*f.height)),new mxPoint(Math.round(f.x+
@@ -7729,9 +7728,10 @@ DrawioFile.prototype.save=function(a,c,b,d,e,g){if(this.isEditable())if(!e&&this
DrawioFile.prototype.saveAs=function(a,c,b){};DrawioFile.prototype.saveFile=function(a,c,b,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};
DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,c,b){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.move=function(a,c,b){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};
DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};DrawioFile.prototype.open=function(){this.stats.opened++;var a=this.getData();null!=a&&(this.ui.setFileData(a),this.isModified()||(this.shadowData=mxUtils.getXml(this.ui.getXmlFileData()),this.shadowPages=null));this.installListeners();this.isSyncSupported()&&this.startSync()};DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};
-DrawioFile.prototype.getRevisions=function(a,c){a(null)};DrawioFile.prototype.loadDescriptor=function(a,c){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,c){this.loadDescriptor(mxUtils.bind(this,function(b){a(b)}),c)};DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.sync.start())};
-DrawioFile.prototype.isConflict=function(){return!1};DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(a){return null};DrawioFile.prototype.getCurrentUser=function(){return null};DrawioFile.prototype.getLatestVersion=function(a,c){a(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};
-DrawioFile.prototype.setCurrentEtag=function(a){this.setDescriptorEtag(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())};DrawioFile.prototype.getDescriptor=function(){return null};DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorEtag=function(a,c){};DrawioFile.prototype.getDescriptorEtag=function(a){return null};DrawioFile.prototype.getDescriptorSecret=function(a){return null};
+DrawioFile.prototype.getRevisions=function(a,c){a(null)};DrawioFile.prototype.loadDescriptor=function(a,c){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,c){this.loadDescriptor(mxUtils.bind(this,function(b){a(b)}),c)};DrawioFile.prototype.patchDescriptor=function(a,c){this.setDescriptorEtag(a,this.getDescriptorEtag(c))};
+DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1};DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(a){return null};DrawioFile.prototype.getCurrentUser=function(){return null};
+DrawioFile.prototype.getLatestVersion=function(a,c){a(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};DrawioFile.prototype.setCurrentEtag=function(a){this.setDescriptorEtag(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())};DrawioFile.prototype.getDescriptor=function(){return null};DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorEtag=function(a,c){};
+DrawioFile.prototype.getDescriptorEtag=function(a){return null};DrawioFile.prototype.getDescriptorSecret=function(a){return null};
DrawioFile.prototype.installListeners=function(){null==this.changeListener&&(this.changeListener=mxUtils.bind(this,function(a,c){var b=null!=c?c.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=b&&b.ignoreEdit||this.fileChanged()}),this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener),this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener),this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener),this.ui.addListener("pageFormatChanged",
this.changeListener),this.ui.addListener("pageScaleChanged",this.changeListener),this.ui.addListener("backgroundColorChanged",this.changeListener),this.ui.addListener("backgroundImageChanged",this.changeListener),this.ui.addListener("foldingEnabledChanged",this.changeListener),this.ui.addListener("mathEnabledChanged",this.changeListener),this.ui.addListener("gridEnabledChanged",this.changeListener),this.ui.addListener("guidesEnabledChanged",this.changeListener),this.ui.addListener("pageViewChanged",
this.changeListener))};DrawioFile.prototype.addAllSavedStatus=function(a){null!=this.ui.statusContainer&&this.ui.getCurrentFile()==this&&(a=null!=a?a:mxUtils.htmlEntities(mxResources.get(this.allChangesSavedKey)),this.ui.editor.setStatus('<div title="'+a+'">'+a+"</div>"),a=this.ui.statusContainer.getElementsByTagName("div"),0<a.length&&this.isRevisionHistorySupported()&&(a[0].style.cursor="pointer",a[0].style.textDecoration="underline",mxEvent.addListener(a[0],"click",mxUtils.bind(this,function(){this.ui.actions.get("revisionHistory").funct()}))))};
@@ -8141,21 +8141,21 @@ stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#363
null!=d.shape&&(d.shape.commonCustomPropAdded||(d.shape.commonCustomPropAdded=!0,d.shape.customProperties=d.shape.customProperties||[],d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)),f(d.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{f(JSON.parse(a))}catch(H){}}};var f=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=
this.format.createSelectionState();"image"!=a.style.shape&&this.container.appendChild(this.addStyles(this.createPanel()));f.apply(this,arguments);if(Editor.enableCustomProperties){for(var b={},c=a.vertices,d=a.edges,k=0;k<c.length;k++)this.findCommonProperties(c[k],b,0==k);for(k=0;k<d.length;k++)this.findCommonProperties(d[k],b,0==c.length&&0==k);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(b).length&&this.container.appendChild(this.addProperties(this.createPanel(),b,a))}};var k=
StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var b=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));b.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");b.style.marginBottom="2px";b.style.width="100px";b.style.marginRight="2px";a.appendChild(b);b=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("pasteStyle").funct()}));
-b.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");b.style.marginBottom="2px";b.style.width="100px";a.appendChild(b);mxUtils.br(a);return k.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,b,c){function f(a,b,c,f){t.getModel().beginUpdate();try{var d=[],k=[];if(null!=c.index){for(var p=[],e=c.parentRow.nextSibling;e&&e.getAttribute("data-pName")==a;)p.push(e.getAttribute("data-pValue")),
-e=e.nextSibling;c.index<p.length?null!=f?p.splice(f,1):p[c.index]=b:p.push(b);null!=c.size&&p.length>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),k.push(p.length))}t.setCellStyles(a,b,t.getSelectionCells());d.push(a);k.push(b);if(null!=c.dependentProps)for(a=0;a<c.dependentProps.length;a++){var g=c.dependentPropsDefVal[a],v=c.dependentPropsVals[a];if(v.length>b)v=v.slice(0,b);else for(var u=
-v.length;u<b;u++)v.push(g);v=v.join(",");t.setCellStyles(c.dependentProps[a],v,t.getSelectionCells());d.push(c.dependentProps[a]);k.push(v)}x.editorUi.fireEvent(new mxEventObject("styleChanged","keys",d,"values",k,"cells",t.getSelectionCells()))}finally{t.getModel().endUpdate()}}function d(b,c,f){var d=mxUtils.getOffset(a,!0),k=mxUtils.getOffset(b,!0);c.style.position="absolute";c.style.left=k.x-d.x+"px";c.style.top=k.y-d.y+"px";c.style.width=b.offsetWidth+"px";c.style.height=b.offsetHeight-(f?4:
+b.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");b.style.marginBottom="2px";b.style.width="100px";a.appendChild(b);mxUtils.br(a);return k.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,b,c){function f(a,b,c,f){u.getModel().beginUpdate();try{var d=[],k=[];if(null!=c.index){for(var p=[],e=c.parentRow.nextSibling;e&&e.getAttribute("data-pName")==a;)p.push(e.getAttribute("data-pValue")),
+e=e.nextSibling;c.index<p.length?null!=f?p.splice(f,1):p[c.index]=b:p.push(b);null!=c.size&&p.length>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),k.push(p.length))}u.setCellStyles(a,b,u.getSelectionCells());d.push(a);k.push(b);if(null!=c.dependentProps)for(a=0;a<c.dependentProps.length;a++){var g=c.dependentPropsDefVal[a],v=c.dependentPropsVals[a];if(v.length>b)v=v.slice(0,b);else for(var t=
+v.length;t<b;t++)v.push(g);v=v.join(",");u.setCellStyles(c.dependentProps[a],v,u.getSelectionCells());d.push(c.dependentProps[a]);k.push(v)}x.editorUi.fireEvent(new mxEventObject("styleChanged","keys",d,"values",k,"cells",u.getSelectionCells()))}finally{u.getModel().endUpdate()}}function d(b,c,f){var d=mxUtils.getOffset(a,!0),k=mxUtils.getOffset(b,!0);c.style.position="absolute";c.style.left=k.x-d.x+"px";c.style.top=k.y-d.y+"px";c.style.width=b.offsetWidth+"px";c.style.height=b.offsetHeight-(f?4:
0)+"px";c.style.zIndex=5}function k(a,b,c){var d=document.createElement("div");d.style.width="32px";d.style.height="4px";d.style.margin="2px";d.style.border="1px solid black";d.style.background=b&&"none"!=b?b:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(x,function(k){this.editorUi.pickColor(b,function(b){d.style.background="none"==b?"url('"+Dialog.prototype.noColorImage+"')":b;f(a,b,c)});mxEvent.consume(k)}));btn.style.height="12px";btn.style.width="40px";btn.className=
-"geColorBtn";btn.appendChild(d);return btn}function p(a,b,c,d,k,p,e){null!=b&&(b=b.split(","),u.push({name:a,values:b,type:c,defVal:d,countProperty:k,parentRow:p,isDeletable:!0,flipBkg:e}));btn=mxUtils.button("+",mxUtils.bind(x,function(b){for(var g=p,x=0;null!=g.nextSibling;)if(g.nextSibling.getAttribute("data-pName")==a)g=g.nextSibling,x++;else break;var t={type:c,parentRow:p,index:x,isDeletable:!0,defVal:d,countProperty:k},x=v(a,"",t,0==x%2,e);f(a,d,t);g.parentNode.insertBefore(x,g.nextSibling);
-mxEvent.consume(b)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function e(a,b,c,f,d,k,p){if(0<d){var e=Array(d);b=null!=b?b.split(","):[];for(var g=0;g<d;g++)e[g]=null!=b[g]?b[g]:null!=f?f:"";u.push({name:a,values:e,type:c,defVal:f,parentRow:k,flipBkg:p,size:d})}return document.createElement("div")}function g(a,b,c){var d=document.createElement("input");d.type="checkbox";d.checked="1"==b;mxEvent.addListener(d,"change",function(){f(a,d.checked?"1":"0",c)});
-return d}function v(b,c,v,t,u){var l=v.dispName,y=v.type,m=document.createElement("tr");m.className="gePropRow"+(u?"Dark":"")+(t?"Alt":"")+" gePropNonHeaderRow";m.setAttribute("data-pName",b);m.setAttribute("data-pValue",c);t=!1;null!=v.index&&(m.setAttribute("data-index",v.index),l=(null!=l?l:"")+"["+v.index+"]",t=!0);var n=document.createElement("td");n.className="gePropRowCell";n.innerHTML=mxUtils.htmlEntities(mxResources.get(l,null,l));t&&(n.style.textAlign="right");m.appendChild(n);n=document.createElement("td");
-n.className="gePropRowCell";if("color"==y)n.appendChild(k(b,c,v));else if("bool"==y||"boolean"==y)n.appendChild(g(b,c,v));else if("enum"==y){var A=v.enumList;for(u=0;u<A.length;u++)if(l=A[u],l.val==c){n.innerHTML=mxUtils.htmlEntities(mxResources.get(l.dispName,null,l.dispName));break}mxEvent.addListener(n,"click",mxUtils.bind(x,function(){var k=document.createElement("select");d(n,k);for(var p=0;p<A.length;p++){var e=A[p],g=document.createElement("option");g.value=mxUtils.htmlEntities(e.val);g.innerHTML=
-mxUtils.htmlEntities(mxResources.get(e.dispName,null,e.dispName));k.appendChild(g)}k.value=c;a.appendChild(k);mxEvent.addListener(k,"change",function(){var a=mxUtils.htmlEntities(k.value);f(b,a,v)});k.focus();mxEvent.addListener(k,"blur",function(){a.removeChild(k)})}))}else"dynamicArr"==y?n.appendChild(p(b,c,v.subType,v.subDefVal,v.countProperty,m,u)):"staticArr"==y?n.appendChild(e(b,c,v.subType,v.subDefVal,v.size,m,u)):(n.innerHTML=c,mxEvent.addListener(n,"click",mxUtils.bind(x,function(){function k(){var a=
+"geColorBtn";btn.appendChild(d);return btn}function p(a,b,c,d,k,p,e){null!=b&&(b=b.split(","),t.push({name:a,values:b,type:c,defVal:d,countProperty:k,parentRow:p,isDeletable:!0,flipBkg:e}));btn=mxUtils.button("+",mxUtils.bind(x,function(b){for(var g=p,x=0;null!=g.nextSibling;)if(g.nextSibling.getAttribute("data-pName")==a)g=g.nextSibling,x++;else break;var u={type:c,parentRow:p,index:x,isDeletable:!0,defVal:d,countProperty:k},x=v(a,"",u,0==x%2,e);f(a,d,u);g.parentNode.insertBefore(x,g.nextSibling);
+mxEvent.consume(b)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function e(a,b,c,f,d,k,p){if(0<d){var e=Array(d);b=null!=b?b.split(","):[];for(var g=0;g<d;g++)e[g]=null!=b[g]?b[g]:null!=f?f:"";t.push({name:a,values:e,type:c,defVal:f,parentRow:k,flipBkg:p,size:d})}return document.createElement("div")}function g(a,b,c){var d=document.createElement("input");d.type="checkbox";d.checked="1"==b;mxEvent.addListener(d,"change",function(){f(a,d.checked?"1":"0",c)});
+return d}function v(b,c,v,u,t){var l=v.dispName,y=v.type,m=document.createElement("tr");m.className="gePropRow"+(t?"Dark":"")+(u?"Alt":"")+" gePropNonHeaderRow";m.setAttribute("data-pName",b);m.setAttribute("data-pValue",c);u=!1;null!=v.index&&(m.setAttribute("data-index",v.index),l=(null!=l?l:"")+"["+v.index+"]",u=!0);var n=document.createElement("td");n.className="gePropRowCell";n.innerHTML=mxUtils.htmlEntities(mxResources.get(l,null,l));u&&(n.style.textAlign="right");m.appendChild(n);n=document.createElement("td");
+n.className="gePropRowCell";if("color"==y)n.appendChild(k(b,c,v));else if("bool"==y||"boolean"==y)n.appendChild(g(b,c,v));else if("enum"==y){var A=v.enumList;for(t=0;t<A.length;t++)if(l=A[t],l.val==c){n.innerHTML=mxUtils.htmlEntities(mxResources.get(l.dispName,null,l.dispName));break}mxEvent.addListener(n,"click",mxUtils.bind(x,function(){var k=document.createElement("select");d(n,k);for(var p=0;p<A.length;p++){var e=A[p],g=document.createElement("option");g.value=mxUtils.htmlEntities(e.val);g.innerHTML=
+mxUtils.htmlEntities(mxResources.get(e.dispName,null,e.dispName));k.appendChild(g)}k.value=c;a.appendChild(k);mxEvent.addListener(k,"change",function(){var a=mxUtils.htmlEntities(k.value);f(b,a,v)});k.focus();mxEvent.addListener(k,"blur",function(){a.removeChild(k)})}))}else"dynamicArr"==y?n.appendChild(p(b,c,v.subType,v.subDefVal,v.countProperty,m,t)):"staticArr"==y?n.appendChild(e(b,c,v.subType,v.subDefVal,v.size,m,t)):(n.innerHTML=c,mxEvent.addListener(n,"click",mxUtils.bind(x,function(){function k(){var a=
p.value,a=0==a.length&&"string"!=y?0:a;v.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",y="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=v.min&&a<v.min?a=v.min:null!=v.max&&a>v.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&&k()});p.focus();mxEvent.addListener(p,"blur",function(){k()})})));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 l=document.createElement("table");
+a.appendChild(p);mxEvent.addListener(p,"keypress",function(a){13==a.keyCode&&k()});p.focus();mxEvent.addListener(p,"blur",function(){k()})})));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 l=document.createElement("table");
l.style.whiteSpace="nowrap";l.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=l.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],k=d.nodeName.toUpperCase();"INPUT"!=k&&"SELECT"!=k||a.removeChild(d)}catch(da){}}else n.src=Sidebar.prototype.expandedImage,c="";for(f=0;f<b.length;f++)b[f].style.display=c};mxEvent.addListener(y,"click",function(){x.editorUi.propertiesCollapsed=!x.editorUi.propertiesCollapsed;A()});y.appendChild(m);m=document.createElement("th");m.className="gePropHeaderCell";m.innerHTML=mxResources.get("value");y.appendChild(m);l.appendChild(y);var z=!1,q=!1,D;for(D in b)if(y=
b[D],"function"!=typeof y.isVisible||y.isVisible(c)){var J=null!=c.style[D]?mxUtils.htmlEntities(c.style[D]+""):y.defVal;if("separator"==y.type)q=!q;else{if("staticArr"==y.type)y.size=parseInt(c.style[y.sizeProperty]||b[y.sizeProperty].defVal)||0;else if(null!=y.dependentProps){for(var F=y.dependentProps,E=[],I=[],m=0;m<F.length;m++){var L=c.style[F[m]];I.push(b[F[m]].subDefVal);E.push(null!=L?L.split(","):[])}y.dependentPropsDefVal=I;y.dependentPropsVals=E}l.appendChild(v(D,J,y,z,q));z=!z}}for(m=
-0;m<u.length;m++)for(y=u[m],b=y.parentRow,c=0;c<y.values.length;c++)D=v(y.name,y.values[c],{type:y.type,parentRow:y.parentRow,isDeletable:y.isDeletable,index:c,defVal:y.defVal,countProperty:y.countProperty,size:y.size},0==c%2,y.flipBkg),b.parentNode.insertBefore(D,b.nextSibling),b=D;a.appendChild(l);A();return a};StyleFormatPanel.prototype.addStyles=function(a){function b(a){function b(a){var b=mxUtils.button("",function(b){f.getModel().beginUpdate();try{var c=f.getSelectionCells();for(b=0;b<c.length;b++){for(var d=
+0;m<t.length;m++)for(y=t[m],b=y.parentRow,c=0;c<y.values.length;c++)D=v(y.name,y.values[c],{type:y.type,parentRow:y.parentRow,isDeletable:y.isDeletable,index:c,defVal:y.defVal,countProperty:y.countProperty,size:y.size},0==c%2,y.flipBkg),b.parentNode.insertBefore(D,b.nextSibling),b=D;a.appendChild(l);A();return a};StyleFormatPanel.prototype.addStyles=function(a){function b(a){function b(a){var b=mxUtils.button("",function(b){f.getModel().beginUpdate();try{var c=f.getSelectionCells();for(b=0;b<c.length;b++){for(var d=
f.getModel().getStyle(c[b]),p=0;p<k.length;p++)d=mxUtils.removeStylename(d,k[p]);var e=f.getModel().isVertex(c[b])?f.defaultVertexStyle:f.defaultEdgeStyle;null!=a?(d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),d=""==a.fill?mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,null)),d=""==a.stroke?mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,
null):mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,null)),f.getModel().isVertex(c[b])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,null)))):(d=mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FILLCOLOR,"#ffffff")),d=mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(e,mxConstants.STYLE_STROKECOLOR,"#000000")),d=mxUtils.setStyle(d,
mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(e,mxConstants.STYLE_GRADIENTCOLOR,null)),f.getModel().isVertex(c[b])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(e,mxConstants.STYLE_FONTCOLOR,null))));f.getModel().setStyle(c[b],d)}}finally{f.getModel().endUpdate()}});b.className="geStyleButton";b.style.width="36px";b.style.height="30px";b.style.margin="0px 6px 6px 0px";if(null!=a)null!=a.gradient?mxClient.IS_IE&&(mxClient.IS_QUIRKS||10>document.documentMode)?b.style.filter=
@@ -8196,8 +8196,8 @@ STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries["electr
STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];
mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=
[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var b=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?b="mxgraph.er":"sysML"==a.substring(0,5)&&(b="mxgraph.sysml"));return b};var x=mxMarker.createMarker;mxMarker.createMarker=function(a,b,c,f,d,k,p,e,g,v){if(null!=c&&null==mxMarker.markers[c]){var u=
-this.getPackageForType(c);null!=u&&mxStencilRegistry.getStencil(u)}return x.apply(this,arguments)};PrintDialog.prototype.create=function(a,b){function c(){l.value=Math.max(1,Math.min(e,Math.max(parseInt(l.value),parseInt(t.value))));t.value=Math.max(1,Math.min(e,Math.min(parseInt(l.value),parseInt(t.value))))}function f(b){function c(b,c,d){var k=b.getGraphBounds(),p=0,e=0,g=ha.get(),v=1/b.pageScale,x=z.checked;if(x)var v=parseInt(X.value),u=parseInt(ia.value),v=Math.min(g.height*u/(k.height/b.view.scale),
-g.width*v/(k.width/b.view.scale));else v=parseInt(n.value)/(100*b.pageScale),isNaN(v)&&(f=1/b.pageScale,n.value="100 %");g=mxRectangle.fromRectangle(g);g.width=Math.ceil(g.width*f);g.height=Math.ceil(g.height*f);v*=f;!x&&b.pageVisible?(k=b.getPageLayout(),p-=k.x*g.width,e-=k.y*g.height):x=!0;if(null==c){c=PrintDialog.createPrintPreview(b,v,g,0,p,e,x);c.pageSelector=!1;c.mathEnabled=!1;b=a.getCurrentFile();null!=b&&(c.title=b.getTitle());var t=c.writeHead;c.writeHead=function(b){t.apply(this,arguments);
+this.getPackageForType(c);null!=u&&mxStencilRegistry.getStencil(u)}return x.apply(this,arguments)};PrintDialog.prototype.create=function(a,b){function c(){l.value=Math.max(1,Math.min(e,Math.max(parseInt(l.value),parseInt(t.value))));t.value=Math.max(1,Math.min(e,Math.min(parseInt(l.value),parseInt(t.value))))}function f(b){function c(b,c,d){var k=b.getGraphBounds(),p=0,e=0,g=ha.get(),v=1/b.pageScale,x=z.checked;if(x)var v=parseInt(X.value),t=parseInt(ia.value),v=Math.min(g.height*t/(k.height/b.view.scale),
+g.width*v/(k.width/b.view.scale));else v=parseInt(n.value)/(100*b.pageScale),isNaN(v)&&(f=1/b.pageScale,n.value="100 %");g=mxRectangle.fromRectangle(g);g.width=Math.ceil(g.width*f);g.height=Math.ceil(g.height*f);v*=f;!x&&b.pageVisible?(k=b.getPageLayout(),p-=k.x*g.width,e-=k.y*g.height):x=!0;if(null==c){c=PrintDialog.createPrintPreview(b,v,g,0,p,e,x);c.pageSelector=!1;c.mathEnabled=!1;b=a.getCurrentFile();null!=b&&(c.title=b.getTitle());var u=c.writeHead;c.writeHead=function(b){u.apply(this,arguments);
null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"))};if("undefined"!==typeof MathJax){var l=c.renderPage;c.renderPage=function(a,b,c,f,d,k){var p=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var e=l.apply(this,arguments);mxClient.NO_FO=p;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:e.className="geDisableMathJax";return e}}c.open(null,null,d,!0)}else{g=
b.background;if(null==g||""==g||g==mxConstants.NONE)g="#ffffff";c.backgroundColor=g;c.autoOrigin=x;c.appendGraph(b,v,p,e,d,!0)}return c}var f=parseInt(ca.value)/100;isNaN(f)&&(f=1,ca.value="100 %");var f=.75*f,k=t.value,p=l.value,e=!x.checked,v=null;e&&(e=k==g&&p==g);if(!e&&null!=a.pages&&a.pages.length){var u=0,e=a.pages.length-1;x.checked||(u=parseInt(k)-1,e=parseInt(p)-1);for(var y=u;y<=e;y++){var m=a.pages[y],k=m==a.currentPage?d:null;if(null==k){var k=a.createTemporaryGraph(d.getStylesheet()),
p=!0,u=!1,q=null,D=null;null==m.viewState&&null==m.root&&a.updatePageRoot(m);null!=m.viewState&&(p=m.viewState.pageVisible,u=m.viewState.mathEnabled,q=m.viewState.background,D=m.viewState.backgroundImage);k.background=q;k.backgroundImage=null!=D?new mxImage(D.src,D.width,D.height):null;k.pageVisible=p;k.mathEnabled=u;var J=k.getGlobalVariable;k.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?y+1:J.apply(this,arguments)};document.body.appendChild(k.container);a.updatePageRoot(m);
@@ -8219,7 +8219,7 @@ document.createElement("canvas"),F=new Image;F.onload=function(){try{J.getContex
var ErrorDialog=function(a,c,b,d,e,g,l,m,n,q,f){n=null!=n?n:!0;var k=document.createElement("div");k.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);k.appendChild(p)}c=
document.createElement("div");c.style.lineHeight="1.2em";c.style.padding="6px";c.innerHTML=b;k.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!=l&&(d=mxUtils.button(l,function(){n&&a.hideDialog();null!=m&&m()}),d.className="geBtn gePrimaryBtn",b.appendChild(d));this.init=function(){t.focus()};k.appendChild(b);this.container=k};
-(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.4.2";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.4.3";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",k=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";e=null!=e?e:Error(a);(new Image).src=k+"/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.dev){for(var a=[(new Date).toISOString()],b=0;b<arguments.length;b++)a.push(arguments[b]);
@@ -8234,127 +8234,128 @@ function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();
p.style.fontFamily="Helvetica, Arial",p.style.fontSize="9pt",p.style.padding="6px",p.style.paddingLeft="10px",p.style.paddingRight="10px",p.style.zIndex=2E9,p.style.left=Math.max(0,a)+"px",p.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(p.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(p.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(p.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=k.substring(k.length-3,k.length)&&"!"!=k.charAt(k.length-1)&&
(k+="..."),p.innerHTML=k,c.appendChild(p),f.status=p,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(p.style.left=Math.round(Math.max(0,a-p.offsetWidth/2))+"px",p.style.top=Math.round(Math.max(0,b+70-p.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(c,k)}));this.stop();return a}),p=!0);return p};var k=f.stop;f.stop=function(){k.call(this);this.active=!1;null!=f.status&&(f.status.parentNode.removeChild(f.status),
f.status=null)};f.pause=function(){return function(){}};return f};EditorUi.parsePng=function(a,b,c){function f(a,b){var c=k;k+=b;return a.substring(c,k)}function d(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var k=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(f(a,4),"IHDR"!=f(a,4))null!=c&&c();else{f(a,17);do{c=d(a);var p=f(a,4);if(null!=b&&b(k-8,p,c))break;value=f(a,c);f(a,4);if("IEND"==p)break}while(c)}};
-EditorUi.prototype.isCompatibleString=function(a){try{var b=mxUtils.parseXml(a),c=this.editor.extractGraphModel(b.documentElement,!0);return null!=c&&0==c.getElementsByTagName("parsererror").length}catch(t){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(b){var c=a.apply(this,arguments);if(null==c)try{var f=b.indexOf("&lt;mxfile ");if(0<=f){var d=b.lastIndexOf("&lt;/mxfile&gt;");d>f&&(c=b.substring(f,d+15).replace(/&gt;/g,">").replace(/&lt;/g,
-"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var e=mxUtils.parseXml(b),g=this.editor.extractGraphModel(e.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),c=null!=g?mxUtils.getXml(g):""}catch(z){}return c};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var b=a.indexOf('<meta charset="utf-8">');0<=b&&(a=a.slice(0,b)+'<meta charset="utf-8"/>'+a.slice(b+23-1,a.length));a=Graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=
-function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var b=null!=a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(null!=a){b=this.editor.graph;b.model.beginUpdate();try{var c=null!=this.pages?this.pages.slice():null,f=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<f.length||1==f.length&&f[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var d=f.length-1;0<=d;d--){var e=this.updatePageRoot(new DiagramPage(f[d]));
-null==e.getName()&&e.setName(mxResources.get("pageWithNumber",[d+1]));b.model.execute(new ChangePage(this,e,0==d?e:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),b.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=
-this.editor.graph.model.root);if(null!=c)for(d=0;d<c.length;d++)b.model.execute(new ChangePage(this,c[d],null))}finally{b.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,d,e,g,l,v,x,m){b=null!=b?b:this.editor.graph;e=null!=e?e:!1;x=null!=x?x:!0;var f,k=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?f="_blank":k=f=d;if(null==a)return"";var p=a;if("mxfile"!=p.nodeName.toLowerCase()){var u=Graph.zapGremlins(mxUtils.getXml(a)),p=Graph.compress(u);if(Graph.decompress(p)!=
-u)return u;u=a.ownerDocument.createElement("diagram");u.setAttribute("id",Editor.guid());mxUtils.setTextContent(u,p);p=a.ownerDocument.createElement("mxfile");p.appendChild(u)}m?(p=p.cloneNode(!0),p.removeAttribute("userAgent"),p.removeAttribute("version"),p.removeAttribute("editor"),p.removeAttribute("type")):(p.removeAttribute("userAgent"),p.removeAttribute("version"),p.removeAttribute("editor"),p.removeAttribute("type"),p.setAttribute("modified",(new Date).toISOString()),p.setAttribute("host",
-window.location.hostname),p.setAttribute("agent",navigator.userAgent),p.setAttribute("version",EditorUi.VERSION),p.setAttribute("etag",Editor.guid()),a=null!=c?c.getMode():this.mode,null!=a&&p.setAttribute("type",a));a=mxUtils.getXml(p);if(!g&&!e&&(l||null!=c&&/(\.html)$/i.test(c.getTitle())))a=this.getHtml2(mxUtils.getXml(p),b,null!=c?c.getTitle():null,f,k);else if(g||!e&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER||(d=null),a=this.getEmbeddedSvg(a,
-b,d,null,v,x,k);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(c=Graph.compressNode(c),mxUtils.setTextContent(this.currentPage.node,c),c=this.fileNode.cloneNode(!1),b)c.appendChild(this.currentPage.node);else for(var f=0;f<this.pages.length;f++){if(this.currentPage!=this.pages[f]&&this.pages[f].needsUpdate){var d=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(this.pages[f].root));
-this.editor.graph.saveViewState(this.pages[f].viewState,d);mxUtils.setTextContent(this.pages[f].node,Graph.compressNode(d));delete this.pages[f].needsUpdate}c.appendChild(this.pages[f].node)}return c};EditorUi.prototype.anonymizeString=function(a,b){for(var c=[],f=0;f<a.length;f++){var d=a.charAt(f);0<=EditorUi.ignoredAnonymizedChars.indexOf(d)?c.push(d):isNaN(parseInt(d))?d.toLowerCase()!=d?c.push(String.fromCharCode(65+Math.round(25*Math.random()))):d.toUpperCase()!=d?c.push(String.fromCharCode(97+
-Math.round(25*Math.random()))):/\s/.test(d)?c.push(" "):c.push("?"):c.push(b?"0":Math.round(9*Math.random()))}return c.join("")};EditorUi.prototype.anonymizePatch=function(a){if(null!=a[EditorUi.DIFF_INSERT])for(var b=0;b<a[EditorUi.DIFF_INSERT].length;b++)try{var c=mxUtils.parseXml(a[EditorUi.DIFF_INSERT][b].data).documentElement.cloneNode(!1);null!=c.getAttribute("name")&&c.setAttribute("name",this.anonymizeString(c.getAttribute("name")));a[EditorUi.DIFF_INSERT][b].data=mxUtils.getXml(c)}catch(y){a[EditorUi.DIFF_INSERT][b].data=
-y.message}if(null!=a[EditorUi.DIFF_UPDATE]){for(var f in a[EditorUi.DIFF_UPDATE]){var d=a[EditorUi.DIFF_UPDATE][f];null!=d.name&&(d.name=this.anonymizeString(d.name));null!=d.cells&&(b=mxUtils.bind(this,function(a){var b=d.cells[a];if(null!=b){for(var c in b)null!=b[c].value&&(b[c].value="["+b[c].value.length+"]"),null!=b[c].xmlValue&&(b[c].xmlValue="["+b[c].xmlValue.length+"]"),null!=b[c].style&&(b[c].style="["+b[c].style.length+"]"),0==Object.keys(b[c]).length&&delete b[c];0==Object.keys(b).length&&
-delete d.cells[a]}}),b(EditorUi.DIFF_INSERT),b(EditorUi.DIFF_UPDATE),0==Object.keys(d.cells).length&&delete d.cells);0==Object.keys(d).length&&delete a[EditorUi.DIFF_UPDATE][f]}0==Object.keys(a[EditorUi.DIFF_UPDATE]).length&&delete a[EditorUi.DIFF_UPDATE]}return a};EditorUi.prototype.anonymizeAttributes=function(a,b){if(null!=a.attributes)for(var c=0;c<a.attributes.length;c++)"as"!=a.attributes[c].name&&a.setAttribute(a.attributes[c].name,this.anonymizeString(a.attributes[c].value,b));if(null!=a.childNodes)for(c=
-0;c<a.childNodes.length;c++)this.anonymizeAttributes(a.childNodes[c],b)};EditorUi.prototype.anonymizeNode=function(a,b){for(var c=a.getElementsByTagName("mxCell"),f=0;f<c.length;f++)null!=c[f].getAttribute("value")&&c[f].setAttribute("value","["+c[f].getAttribute("value").length+"]"),null!=c[f].getAttribute("xmlValue")&&c[f].setAttribute("xmlValue","["+c[f].getAttribute("xmlValue").length+"]"),null!=c[f].getAttribute("style")&&c[f].setAttribute("style","["+c[f].getAttribute("style").length+"]"),null!=
-c[f].parentNode&&"root"!=c[f].parentNode.nodeName&&null!=c[f].parentNode.parentNode&&(c[f].setAttribute("id",c[f].parentNode.getAttribute("id")),c[f].parentNode.parentNode.replaceChild(c[f],c[f].parentNode));return a};EditorUi.prototype.synchronizeCurrentFile=function(a){var b=this.getCurrentFile();null!=b&&(b.savingFile?this.handleError({message:mxResources.get("busy")}):!a&&b.invalidChecksum?b.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(b.clearAutosave(),
-this.editor.setStatus(""),a?b.reloadFile(mxUtils.bind(this,function(){b.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){b.handleFileError(a,!0)})):b.synchronizeFile(mxUtils.bind(this,function(){b.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){b.handleFileError(a,!0)}))))};EditorUi.prototype.getFileData=function(a,b,c,d,e,g,l,v,x){e=null!=e?e:!0;l=null!=l?l:this.getXmlFileData(e,null!=g?g:!1);x=null!=x?x:this.getCurrentFile();g=this.editor.graph;
-if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=x&&/(\.svg)$/i.test(x.getTitle()))){g=this.createTemporaryGraph(g.getStylesheet());var f=g.getGlobalVariable,k=this.pages[0];g.getGlobalVariable=function(a){return"page"==a?k.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(g.container);g.model.setRoot(k.root)}a=this.createFileData(l,g,x,window.location.href,a,b,c,d,e,v);g!=this.editor.graph&&g.container.parentNode.removeChild(g.container);return a};
-EditorUi.prototype.getHtml=function(a,b,c,d,e,g){g=null!=g?g:!0;var f=null,k=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=b){var f=g?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),p=b.view.scale;g=Math.floor(f.x/p-b.view.translate.x);p=Math.floor(f.y/p-b.view.translate.y);f=b.background;null==e&&(b=this.getBasenames().join(";"),0<b.length&&(k=EditorUi.drawHost+"/embed.js?s="+b));a.setAttribute("x0",g);a.setAttribute("y0",p)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom",
-"1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=d&&a.setAttribute("edit",d));null!=e&&(e=e.replace(/&/g,"&amp;"));a=null!=a?Graph.zapGremlins(mxUtils.getXml(a)):"";d=Graph.compress(a);Graph.decompress(d)!=a&&(d=encodeURIComponent(a));return(null==e?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=e?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+
-(null==e?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=e?'<meta http-equiv="refresh" content="0;URL=\''+e+"'\"/>\n":"")+"</head>\n<body"+(null==e&&null!=f&&f!=mxConstants.NONE?' style="background-color:'+f+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+d+"</div>\n</div>\n"+(null==e?'<script type="text/javascript" src="'+k+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+
-e+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,c,d,e){b=EditorUi.drawHost+"/js/viewer.min.js";null!=e&&(e=e.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==e?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
-"")+"<!DOCTYPE html>\n<html"+(null!=e?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==e?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=e?'<meta http-equiv="refresh" content="0;URL=\''+e+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==e?'<script type="text/javascript" src="'+
-b+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+e+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(a){a=this.validateFileData(a);this.pages=this.fileNode=this.currentPage=null;a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var b=null!=a?a.getElementsByTagName("parsererror"):null;if(null!=b&&0<b.length)throw a=mxResources.get("invalidOrMissingFile"),
-b=b[0].getElementsByTagName("div"),0<b.length&&(a=mxUtils.getTextContent(b[0])),Error(a);b=null!=a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(null!=a&&"mxfile"==a.nodeName&&(b=a.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<b.length||1==b.length&&b[0].hasAttribute("name"))){var c=null;this.fileNode=a;this.pages=[];for(a=0;a<b.length;a++){null==b[a].getAttribute("id")&&b[a].setAttribute("id",a);var d=new DiagramPage(b[a]);null==d.getName()&&d.setName(mxResources.get("pageWithNumber",
-[a+1]));this.pages.push(d);null!=urlParams["page-id"]&&d.getId()==urlParams["page-id"]&&(c=d)}this.currentPage=null!=c?c:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];a=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(a);
-null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(a){var b=this.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(b)||/(\.html)$/i.test(b)||/(\.svg)$/i.test(b)||/(\.png)$/i.test(b)||/(\.drawio)$/i.test(b))b=b.substring(0,b.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&
-(b=b+"-"+this.currentPage.getName());return b};EditorUi.prototype.downloadFile=function(a,b,c,d,e,g,l){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var f=this.getBaseFilename(!e),k=f+"."+a;if("xml"==a){var p='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(d)):this.getFileData(!0,null,null,null,d,e));this.saveData(k,a,p,"text/xml")}else if("html"==a)p=this.getHtml2(this.getFileData(!0),this.editor.graph,f),this.saveData(k,a,p,"text/html");else if("svg"!=
-a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?k=f+".png":"jpeg"==a&&(k=f+".jpg"),this.saveRequest(k,a,mxUtils.bind(this,function(b,c){try{var f=this.editor.graph.pageVisible;null!=g&&(this.editor.graph.pageVisible=g);var k=this.createDownloadRequest(b,a,d,c,l,e);this.editor.graph.pageVisible=f;return k}catch(B){this.handleError(B)}}));else{var u=null,t=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},
-mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(u)}))});if("svg"==a){var m=this.editor.graph.background;if(l||m==mxConstants.NONE)m=null;var y=this.editor.graph.getSvg(m,null,null,null,null,d);c&&this.editor.graph.addSvgShadow(y);this.convertImages(y,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();t('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else k=
-f+".svg",u=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();t(a)}),d)}}catch(I){this.handleError(I)}};EditorUi.prototype.createDownloadRequest=function(a,b,c,d,e,g){var f=this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==g?!1:"xmlpng"!=b);var k="",p="";if(f.width*f.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};f="0";"pdf"==b&&0==g&&(p="&allPages=1");if("xmlpng"==b&&(f="1",b="png",null!=this.pages&&
-null!=this.currentPage))for(g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){k="&from="+g;break}g=this.editor.graph.background;"png"==b&&e&&(g=mxConstants.NONE);return new mxXmlRequest(EXPORT_URL,"format="+b+k+p+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+d+"&embedXml="+f+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var d=window.location.hash,
-f=mxUtils.bind(this,function(c){var f=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<f.length&&(f+="\n"),f+=c);c=new LocalFile(this,"csv"!=a.format&&0<f.length?f:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);c.getHash=function(){return d};this.fileLoaded(c);"csv"==a.format&&this.importCsv(f,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var k=null!=a.interval?
-parseInt(a.interval):6E4,e=null,p=mxUtils.bind(this,function(){var b=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){b===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),g()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),g=mxUtils.bind(this,function(){window.clearTimeout(e);e=window.setTimeout(p,
-k)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){g();p()}));g();p()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var k=a.url;/^https?:\/\//.test(k)&&!this.editor.isCorsEnabledForUrl(k)&&(k=PROXY_URL+"?url="+encodeURIComponent(k));this.loadUrl(k,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=c&&c(a)}))}else f("")};EditorUi.prototype.updateDiagram=function(a){function b(a){var b=new mxCellOverlay(a.image||f.warningImage,a.tooltip,a.align,a.valign,
-a.offset);b.addListener(mxEvent.CLICK,function(b,c){d.alert(a.tooltip)});return b}var c=null,d=this;if(null!=a&&0<a.length&&(c=mxUtils.parseXml(a),a=null!=c?c.documentElement:null,null!=a&&"updates"==a.nodeName)){var f=this.editor.graph,e=f.getModel();e.beginUpdate();var g=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var v=e.getCell(a.getAttribute("id"));if(null!=v){try{var x=a.getAttribute("value");if(null!=x){var l=mxUtils.parseXml(x).documentElement;if(null!=l)if("1"==l.getAttribute("replace-value"))e.setValue(v,
-l);else for(var m=l.attributes,n=0;n<m.length;n++)f.setAttributeForCell(v,m[n].nodeName,0<m[n].nodeValue.length?m[n].nodeValue:null)}}catch(K){null!=window.console&&console.log("Error in value for "+v.id+": "+K)}try{var q=a.getAttribute("style");null!=q&&f.model.setStyle(v,q)}catch(K){null!=window.console&&console.log("Error in style for "+v.id+": "+K)}try{var E=a.getAttribute("icon");if(null!=E){var I=0<E.length?JSON.parse(E):null;null!=I&&I.append||f.removeCellOverlays(v);null!=I&&f.addCellOverlay(v,
-b(I))}}catch(K){null!=window.console&&console.log("Error in icon for "+v.id+": "+K)}try{var C=a.getAttribute("geometry");if(null!=C){var C=JSON.parse(C),G=f.getCellGeometry(v);if(null!=G){G=G.clone();for(key in C){var H=parseFloat(C[key]);"dx"==key?G.x+=H:"dy"==key?G.y+=H:"dw"==key?G.width+=H:"dh"==key?G.height+=H:G[key]=parseFloat(C[key])}f.model.setGeometry(v,G)}}}catch(K){null!=window.console&&console.log("Error in icon for "+v.id+": "+K)}}}else if("model"==a.nodeName){for(var B=a.firstChild;null!=
-B&&B.nodeType!=mxConstants.NODETYPE_ELEMENT;)B=B.nextSibling;null!=B&&(new mxCodec(a.firstChild)).decode(B,e)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(f.view.scale=parseFloat(a.getAttribute("scale"))),a.hasAttribute("dx")||a.hasAttribute("dy"))f.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(g=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=
-g&&this.chromelessResize&&this.chromelessResize(!0,g)}return c};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,d="",f=c.lastIndexOf(".");0<=f&&(d=c.substring(f),c=c.substring(0,f));if(b)var k=new Date,f=k.getFullYear(),e=k.getMonth()+1,g=k.getDate(),x=k.getHours(),l=k.getMinutes(),k=k.getSeconds(),c=c+(" "+(f+"-"+e+"-"+g+"-"+x+"-"+l+"-"+k));return c=mxResources.get("copyOf",[c])+d};EditorUi.prototype.fileLoaded=function(a,b){var c=
-this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var d=!1;this.hideDialog();null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var f=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!b&&null!=window.location.hash&&0<window.location.hash.length&&
-(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename")));this.editor.setStatus("");this.updateUi();b||this.showSplash()});if(null!=a)try{mxClient.IS_SF&&"min"==uiTheme&&(this.diagramContainer.style.visibility="");this.openingFile=!0;this.setCurrentFile(a);a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();
-delete this.openingFile;this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();a.isEditable()?a.isModified()?(a.addUnsavedStatus(),null!=a.backupPatch&&a.patch([a.backupPatch])):this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</span>");!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"));d=!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(z){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(z){}}catch(z){this.fileLoadedError=z;null!=window.console&&console.log("error in fileLoaded:",a,z);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!=z&&null!=z.message?":err:"+
-encodeURIComponent(z.message):"")+(null!=z&&null!=z.stack?"&stack="+encodeURIComponent(z.stack):"")}catch(v){}var k=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=c?this.fileLoaded(c):f()});b?k():this.handleError(z,mxResources.get("errorLoadingFile"),k,!0)}else f();return d};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 k=0;k<a.length;k++){this.updatePageRoot(a[k]);var e=a[k].node.cloneNode(!1);e.removeAttribute("name");d.root=a[k].root;var g=f.encode(d);this.editor.graph.saveViewState(a[k].viewState,g,!0);g.removeAttribute("pageWidth");g.removeAttribute("pageHeight");e.appendChild(g);null!=b&&(b.eltCount+=e.getElementsByTagName("*").length,b.nodeCount+=e.getElementsByTagName("mxCell").length);c=(c<<5)-c+this.hashValue(e,function(a,b,c,d){return!d||
-"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=b&&"y"!=b&&"width"!=b&&"height"!=b?d&&"mxCell"==a.nodeName&&"previous"==b?null:c:Math.round(c)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,c){var d=0;if(null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(d^=this.hashValue(a.nodeName,b,c));if(null!=a.attributes){null!=c&&(c.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var k=
-a.attributes[f].name,e=null!=b?b(a,k,a.attributes[f].value,!0):a.attributes[f].value;null!=e&&(d^=this.hashValue(k,b,c)+this.hashValue(e,b,c))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)d=(d<<5)-d+this.hashValue(a.childNodes[f],b,c)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;d^=b}return d};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};
-EditorUi.prototype.saveLibrary=function(a,b,c,d,e,g,l){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var b=
-mxUtils.createXmlDocument(),c=b.createElement("mxlibrary");mxUtils.setTextContent(c,JSON.stringify(a));b.appendChild(c);return mxUtils.getXml(b)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var b=this.sidebar.palettes[a];if(null!=b){for(var c=0;c<b.length;c++)b[c].parentNode.removeChild(b[c]);
-delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var b=this.sidebar.container;if(null==a){var c=this.sidebar.palettes["L.scratchpad"];null==c&&(c=this.sidebar.palettes.search);null!=c&&(a=c[c.length-1].nextSibling)}a=null!=a?a:b.firstChild.nextSibling.nextSibling;var c=b.lastChild,d=c.previousSibling;b.insertBefore(c,a);b.insertBefore(d,c)};EditorUi.prototype.loadLibrary=function(a){var b=mxUtils.parseXml(a.getData());if("mxlibrary"==b.documentElement.nodeName){var c=
-JSON.parse(mxUtils.getTextContent(b.documentElement));this.libraryLoaded(a,c,b.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,c){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var d=this.sidebar.palettes[a.getHash()],d=null!=d?d[d.length-1].nextSibling:
-null;this.removeLibrarySidebar(a.getHash());var f=null,k=mxUtils.bind(this,function(b,c){0==b.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),f.className="geDropTarget",mxUtils.write(f,mxResources.get("dragElementsHere"))),c.appendChild(f)):this.addLibraryEntries(b,c)});if(null!=this.sidebar&&null!=b)for(var e=0;e<b.length;e++)mxUtils.bind(this,function(a){var b=a.data;null!=b&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){b=this.convertDataUri(b);var c=
-"shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(c+="aspect=fixed;");return this.sidebar.createVertexTemplate(c+"image="+b,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var b=this.stringToCells(Graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[e]);c=null!=c&&0<c.length?c:a.getTitle();var g=this.sidebar.addPalette(a.getHash(),
-c,!0,mxUtils.bind(this,function(a){k(b,a)}));this.repositionLibrary(d);var p=g.parentNode.previousSibling;c=p.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&p.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var l=document.createElement("div");l.style.position="absolute";l.style.right="0px";l.style.top="0px";l.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(l.style.backgroundColor="inherit");p.style.position="relative";var m=document.createElement("img");
-m.setAttribute("src",Dialog.prototype.closeImage);m.setAttribute("title",mxResources.get("close"));m.setAttribute("valign","absmiddle");m.setAttribute("border","0");m.style.margin="0 3px";var n=null;if(".scratchpad"!=a.title||this.closableScratchpad)l.appendChild(m),mxEvent.addListener(m,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=n?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):
-c();mxEvent.consume(b)}}));if(a.isEditable()){var q=this.editor.graph,E=null,I=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),g,b,a,a.getMode());mxEvent.consume(c)}),C=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=E&&null!=E.parentNode&&E.parentNode.removeChild(E),E=m.cloneNode(!1),E.setAttribute("src",Editor.spinImage),E.setAttribute("title",mxResources.get("saving")),E.style.cursor="default",E.style.marginRight="2px",E.style.marginTop="-2px",l.insertBefore(E,
-l.firstChild),p.style.paddingRight=18*l.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=E&&null!=E.parentNode&&(E.parentNode.removeChild(E),p.style.paddingRight=18*l.childNodes.length+"px")})):null==n&&(n=m.cloneNode(!1),n.setAttribute("src",IMAGE_PATH+"/download.png"),n.setAttribute("title",mxResources.get("save")),l.insertBefore(n,l.firstChild),mxEvent.addListener(n,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==
-LocalLibrary,!0,function(){null==n||a.isModified()||(p.style.paddingRight=18*l.childNodes.length+"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(c)})),p.style.paddingRight=18*l.childNodes.length+"px")}),G=mxUtils.bind(this,function(a,c,d,k){a=q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var e=0;e<a.length;e++){var p=q.getCellGeometry(a[e]);null!=p&&p.translate(-c.x,-c.y)}g.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,k||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),
-w:c.width,h:c.height};null!=k&&(a.title=k);b.push(a);C(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),H=mxUtils.bind(this,function(a){if(q.isSelectionEmpty())q.getRubberband().isActive()?(q.getRubberband().execute(a),q.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=q.getSelectionCells(),c=q.view.getBounds(b),d=q.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=q.view.translate.x;
-c.y-=q.view.translate.y;G(b,c)}mxEvent.consume(a)});mxEvent.addGestureListeners(g,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="hidden",g.style.backgroundColor="#f1f3f4",g.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),
-mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler&&(g.style.backgroundColor="",g.style.cursor="default",this.sidebar.showTooltips=!0,q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,q.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(g,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="visible",g.style.backgroundColor="",g.style.cursor="",q.autoScroll=
-!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"))}));Graph.fileSupport&&(mxEvent.addListener(g,"dragover",mxUtils.bind(this,function(a){g.style.backgroundColor="#f1f3f4";a.dataTransfer.dropEffect="copy";g.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"drop",mxUtils.bind(this,function(a){g.style.cursor="";g.style.backgroundColor="";0<a.dataTransfer.files.length&&
-this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,e,p,v,x,l,m,t){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,v,x),c)],c[0].vertex=!0,G(c,new mxRectangle(0,0,v,x),a,mxEvent.isAltDown(a)?null:l.substring(0,l.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var u=
-!1,n=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var e=mxUtils.parseXml(c);if("mxlibrary"==e.documentElement.nodeName)try{var p=JSON.parse(mxUtils.getTextContent(e.documentElement));k(p,g);b=b.concat(p);C(a);this.spinner.stop();u=!0}catch(L){}else if("mxfile"==e.documentElement.nodeName)try{for(var v=e.documentElement.getElementsByTagName("diagram"),e=0;e<v.length;e++){var p=mxUtils.getTextContent(v[e]),x=this.stringToCells(Graph.decompress(p)),l=this.editor.graph.getBoundingBoxFromGeometry(x);
-G(x,new mxRectangle(0,0,l.width,l.height),a)}u=!0}catch(L){null!=window.console&&console.log("error in drop handler:",L)}}u||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=t&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?this.importVisio(t,function(a){n(a,"text/xml")},null,l):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,
-l)&&null!=t?this.parseFile(t,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=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){g.style.cursor="";g.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));m=m.cloneNode(!1);m.setAttribute("src",
-Editor.editImage);m.setAttribute("title",mxResources.get("edit"));l.insertBefore(m,l.firstChild);mxEvent.addListener(m,"click",I);mxEvent.addListener(g,"dblclick",function(a){mxEvent.getSource(a)==g&&I(a)});c=m.cloneNode(!1);c.setAttribute("src",Editor.plusImage);c.setAttribute("title",mxResources.get("add"));l.insertBefore(c,l.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)})),l.insertBefore(c,l.firstChild))}p.appendChild(l);p.style.paddingRight=18*l.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var c=0;c<a.length;c++){var d=a[c],f=d.data;if(null!=f){var f=this.convertDataUri(f),k="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";
-"fixed"==d.aspect&&(k+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(k+"image="+f,d.w,d.h,"",d.title||"",!1,!1,!0))}else null!=d.xml&&(f=this.stringToCells(Graph.decompress(d.xml)),0<f.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(f,d.w,d.h,d.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=function(a){return null!=a?a[mxLanguage]||a.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.offline||EditorUi.isElectronApp||("1"==urlParams.savesidebar&&
-(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.createFooter=function(){return document.getElementById("geFooter")});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=
-3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor=
-"black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",
-Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))};EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display=
-"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var b=document.getElementById("geFooter");null!=b&&(this.footerHeight=a,b.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,d,e){a=new ImageDialog(this,a,b,c,d,e);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=
-!0;this.editor.graph.model.execute(a)});var b=new BackgroundImageDialog(this,mxUtils.bind(this,function(b){a(b)}));this.showDialog(b.container,360,200,!0,!0);b.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,d,e){a=new LibraryDialog(this,a,b,c,d,e);this.showDialog(a.container,640,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};var c=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(a){var b=
-c.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(a){this.editor.graph.isSelectionEmpty()&&b.refresh()}));return b};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer geSidebarFooter");a.style.position="absolute";a.style.overflow="hidden";var b=document.createElement("a");b.className="geTitle";b.style.color="#188038";b.style.height="100%";b.style.paddingTop="9px";b.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';
-mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c,d){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},k=null!=a&&null!=a.error?a.error:a;if(null!=k||null!=
-b){var e=mxUtils.htmlEntities(mxResources.get("unknownError")),g=mxResources.get("ok"),p=null;b=null!=b?b:mxResources.get("error");if(null!=k)if(null!=k.retry&&(g=mxResources.get("cancel"),p=function(){f();k.retry()}),404==k.code||404==k.status||403==k.code){var e=403==k.code?null!=k.message?mxUtils.htmlEntities(k.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")),l=window.location.hash;if(null!=l&&"#G"==l.substring(0,2)&&null!=
-a&&null!=a.error&&null!=a.error.errors&&0<a.error.errors.length&&"fileAccess"==a.error.errors[0].reason){l=l.substring(2);this.showError(b,e,mxResources.get("cancel"),null,p,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+l)}),null,null,380);return}}else null!=k.message?e=mxUtils.htmlEntities(k.message):null!=k.response&&null!=k.response.error?e=mxUtils.htmlEntities(k.response.error):"undefined"!==window.App&&(k.code==
-App.ERROR_TIMEOUT?e=mxUtils.htmlEntities(mxResources.get("timeout")):k.code==App.ERROR_BUSY&&(e=mxUtils.htmlEntities(mxResources.get("busy"))));this.showError(b,e,g,c,p,null,null,null,null,null,null,null,d?c:null)}else null!=c&&c()};EditorUi.prototype.showError=function(a,b,c,d,e,g,l,v,x,m,n,q,A){a=new ErrorDialog(this,a,b,c||mxResources.get("ok"),d,e,g,l,q,v,x);this.showDialog(a.container,m||340,n||(null!=b&&120<b.length?180:150),!0,!1,A);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,
-null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,c,d,e,g){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};a=new ConfirmDialog(this,a,function(){f();null!=b&&b()},function(){f();null!=c&&c()},d,e);this.showDialog(a.container,340,90,!0,g);a.init()};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=
-function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,c){var d=a.toDataURL("image/"+c);if(6>=d.length||d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(Graph.compress(b))));return d};EditorUi.prototype.saveCanvas=
-function(a,b,c){var d="jpeg"==c?"jpg":c,f=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(f,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=
-function(a,b){var c=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));c.textarea.style.width="600px";c.textarea.style.height="380px";this.showDialog(c.container,620,460,!0,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(a,b,c,d,e){if(window.Blob&&navigator.msSaveOrOpenBlob)a=d?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,
-!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else{var f=document.createElement("a"),k=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof f.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),k=65==(g?parseInt(g[2],10):!1)?!1:k;if(k||this.isOffline()){f.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));k?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),k=0;k<f;++k){for(var g=1024*k,x=Math.min(g+1024,d),l=Array(x-g),m=0;g<x;++m,++g)l[m]=c[g].charCodeAt(0);e[k]=new Uint8Array(l)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,g,l){g=null!=g?g:!1;l=null!=l?l:"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,f){try{if("_blank"==f)if(null==c||"image/"!=c.substring(0,6)||
-"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var e=window.open("about:blank");null==e?mxUtils.popup(a,!0):(e.document.write(mxUtils.htmlEntities(a,!1)),e.document.close())}else this.openInNewWindow(a,c,d);else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(f,mxUtils.bind(this,function(e){try{this.exportFile(a,b,c,d,f,e)}catch(F){this.handleError(F)}}))}catch(J){this.handleError(J)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),
-mxResources.get("download"),!1,g,l,null,1<e,4<e&&(!g||6>e)?3:4,a,c,d);this.showDialog(b.container,420,1==e?160:4<e?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");null==d||null==d.document?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+
-'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null!=d&&null!=d.document||mxUtils.popup(a,!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),
-this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding=
-"4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=d.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog);
-this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.style.backgroundColor="white";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);
-mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,
-c,d,e){this.isLocalFileSave()?this.saveLocalFile(c,a,d,e,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,f){return this.createEchoRequest(c,a,d,e,b,f)}),c,e,d)};EditorUi.prototype.saveRequest=function(a,b,c,d,e,g,l){l=null!=l?l:!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<a.length){var e=c("_blank"==f?null:a,f==App.MODE_DEVICE||"download"==f||null==f||"_blank"==f?"0":"1");null!=e&&(f==
-App.MODE_DEVICE||"download"==f||"_blank"==f?e.simulate(document,"_blank"):this.pickFolder(f,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,a,g,!0,f,c)}catch(A){this.handleError(A)}else this.spinner.spin(document.body,mxResources.get("saving"))&&e.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=e.getStatus()&&299>=e.getStatus())try{this.exportFile(e.getText(),a,g,!0,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,l,null,1<f,4<f?3:4,d,g,e);this.showDialog(a.container,380,1==f?160:4<f?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,e,g){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,e,g,l,
-v,x,m){if(this.spinner.spin(document.body,mxResources.get("export"))){var f=this.editor.graph.isSelectionEmpty();c=null!=c?c:f;f=b?null:this.editor.graph.background;f==mxConstants.NONE&&(f=null);null==f&&0==b&&(f="#ffffff");var k=this.editor.graph.getSvg(f,a,l,v,null,c,null,null,"blank"==m?"_blank":"self"==m?"_top":null);d&&this.editor.graph.addSvgShadow(k);var p=this.getBaseFilename()+".svg",n=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0,null,
-null,null,c,x));if(null!=this.editor.fontCss){var b=a.ownerDocument,b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var d='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||d.length<=MAX_REQUEST_SIZE?this.saveData(p,"svg",d,"image/svg+xml"):
-this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(d)}))});this.convertMath(this.editor.graph,k,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(k,n,this.thumbImageCache)):n(k)}))}};EditorUi.prototype.addRadiobox=function(a,b,c,d,e,g,l){return this.addCheckbox(a,c,d,e,g,l,!0,b)};EditorUi.prototype.addCheckbox=function(a,b,c,d,e,g,l,v){g=null!=g?g:!0;var f=document.createElement("input");
-f.style.marginRight="8px";f.style.marginTop="16px";f.setAttribute("type",l?"radio":"checkbox");l="geCheckbox-"+Editor.guid();f.id=l;null!=v&&f.setAttribute("name",v);c&&(f.setAttribute("checked","checked"),f.defaultChecked=!0);d&&f.setAttribute("disabled","disabled");g&&(a.appendChild(f),c=document.createElement("label"),mxUtils.write(c,b),c.setAttribute("for",l),a.appendChild(c),e||mxUtils.br(a));return f};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+
-":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,
-mxResources.get("custom")+"...");e.appendChild(d);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"==e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled",
-"disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===e.value?"_blank":f:null},getEditInput:function(){return c},getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+
-"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));d.appendChild(f);f=document.createElement("option");
-f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));d.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();k.style.padding=
-mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,e,g,l,v){var f=this.getCurrentFile(),k=[];d&&(k.push("lightbox=1"),"auto"!=a&&k.push("target="+
-a),null!=b&&b!=mxConstants.NONE&&k.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0<e.length&&k.push("edit="+encodeURIComponent(e)),g&&k.push("layers=1"),this.editor.graph.foldingEnabled&&k.push("nav=1"));c&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&k.push("page-id="+this.currentPage.getId());a=!0;null!=l?c="#U"+encodeURIComponent(l):(f=this.getCurrentFile(),v||null==f||f.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,
-null,null,null,null,null,null,!0):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+f.getHash(),a=!1));a&&null!=f&&null!=f.getTitle()&&f.getTitle()!=this.defaultFilename&&k.push("title="+encodeURIComponent(f.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host+"/")+(0<k.length?"?"+k.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,d,e,g,l,v,x,m,n){this.getBasenames();
-var f={};""!=e&&e!=mxConstants.NONE&&(f.highlight=e);"auto"!==d&&(f.target=d);x||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(f.zoom=c/100);c=[];l&&(c.push("pages"),f.resize=!0,null!=this.pages&&null!=this.currentPage&&(f.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),f.resize=!0);v&&c.push("layers");0<c.length&&(x&&c.push("lightbox"),f.toolbar=c.join(" "));null!=m&&0<m.length&&(f.edit=m);null!=a?f.url=a:f.xml=this.getFileData(!0,
-null,null,null,null,!l);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(f))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";n(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.drawHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.drawHost+
-"/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,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 k=document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var g=document.createElement("input");g.style.cssText=
-"margin-right:8px;margin-top:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");e=g.cloneNode(!0);e.setAttribute("value","copy");k.appendChild(e);var p=document.createElement("span");mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(p);mxUtils.br(k);k.appendChild(g);p=document.createElement("span");mxUtils.write(p,mxResources.get("publicDiagramUrl"));k.appendChild(p);var l=this.getCurrentFile();
-null==c&&null!=l&&l.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")),k.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(l.getId())})));e.setAttribute("checked","checked");null==c&&g.setAttribute("disabled","disabled");f.appendChild(k);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),k=null!=this.pages&&1<this.pages.length,I=I=this.addCheckbox(f,mxResources.get("allPages"),k,!k),C=this.addCheckbox(f,mxResources.get("layers"),!0),G=this.addCheckbox(f,mxResources.get("lightbox"),
-!0),H=this.addEditButton(f,G),B=H.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(G,"change",function(){G.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&G.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,f,mxUtils.bind(this,function(){d(g.checked?c:null,n.checked,t.value,m.getTarget(),m.getColor(),q.checked,I.checked,C.checked,G.checked,H.getLink())}),null,a,
-b);this.showDialog(a.container,340,384,!0,!0);e.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,g){var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=document.createElement("h3");mxUtils.write(k,a||mxResources.get("link"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(k);var p=this.getCurrentFile(),k="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=p&&p.constructor==window.DriveFile&&
-!b){a=80;var k="https://desk.draw.io/support/solutions/articles/16000039384",l=document.createElement("div");l.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var m=document.createElement("div");m.style.whiteSpace="normal";mxUtils.write(m,mxResources.get("linkAccountRequired"));l.appendChild(m);m=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(p.getId())}));m.style.marginTop=
-"12px";m.className="geBtn";l.appendChild(m);f.appendChild(l);m=document.createElement("a");m.style.paddingLeft="12px";m.style.color="gray";m.style.fontSize="11px";m.setAttribute("href","javascript:void(0);");mxUtils.write(m,mxResources.get("check"));l.appendChild(m);mxEvent.addListener(m,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,
-mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var n=null,t=null;if(null!=c||null!=d)a+=30,mxUtils.write(f,mxResources.get("width")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.marginRight="16px",n.style.width="50px",n.style.marginLeft="6px",n.style.marginRight="16px",n.style.marginBottom="10px",n.value="100%",f.appendChild(n),mxUtils.write(f,mxResources.get("height")+":"),
-t=document.createElement("input"),t.setAttribute("type","text"),t.style.width="50px",t.style.marginLeft="6px",t.style.marginBottom="10px",t.value=d+"px",f.appendChild(t),mxUtils.br(f);var u=this.addLinkSection(f,g);c=null!=this.pages&&1<this.pages.length;var q=null;if(null==p||p.constructor!=window.DriveFile||b)q=this.addCheckbox(f,mxResources.get("allPages"),c,!c);var y=this.addCheckbox(f,mxResources.get("lightbox"),!0),G=this.addEditButton(f,y),H=G.getEditInput(),B=this.addCheckbox(f,mxResources.get("layers"),
+EditorUi.prototype.isCompatibleString=function(a){try{var b=mxUtils.parseXml(a),c=this.editor.extractGraphModel(b.documentElement,!0);return null!=c&&0==c.getElementsByTagName("parsererror").length}catch(t){}return!1};EditorUi.prototype.isVisioData=function(a){return 8<a.length&&208==a.charCodeAt(0)&&207==a.charCodeAt(1)&&17==a.charCodeAt(2)&&224==a.charCodeAt(3)&&161==a.charCodeAt(4)&&177==a.charCodeAt(5)&&26==a.charCodeAt(6)&&225==a.charCodeAt(7)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&
+4==a.charCodeAt(3)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&6==a.charCodeAt(3)};EditorUi.prototype.isPngData=function(a){return 8<a.length&&137==a.charCodeAt(0)&&80==a.charCodeAt(1)&&78==a.charCodeAt(2)&&71==a.charCodeAt(3)&&13==a.charCodeAt(4)&&10==a.charCodeAt(5)&&26==a.charCodeAt(6)&&10==a.charCodeAt(7)};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(b){var c=a.apply(this,arguments);if(null==c)try{var f=b.indexOf("&lt;mxfile ");
+if(0<=f){var d=b.lastIndexOf("&lt;/mxfile&gt;");d>f&&(c=b.substring(f,d+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var e=mxUtils.parseXml(b),g=this.editor.extractGraphModel(e.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),c=null!=g?mxUtils.getXml(g):""}catch(z){}return c};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var b=a.indexOf('<meta charset="utf-8">');0<=b&&(a=a.slice(0,b)+'<meta charset="utf-8"/>'+
+a.slice(b+23-1,a.length));a=Graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var b=null!=a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(null!=a){b=this.editor.graph;b.model.beginUpdate();try{var c=null!=this.pages?this.pages.slice():null,f=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<f.length||1==f.length&&f[0].hasAttribute("name")){this.fileNode=a;this.pages=
+null!=this.pages?this.pages:[];for(var d=f.length-1;0<=d;d--){var e=this.updatePageRoot(new DiagramPage(f[d]));null==e.getName()&&e.setName(mxResources.get("pageWithNumber",[d+1]));b.model.execute(new ChangePage(this,e,0==d?e:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),b.model.execute(new ChangePage(this,
+this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=c)for(d=0;d<c.length;d++)b.model.execute(new ChangePage(this,c[d],null))}finally{b.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,d,e,g,l,v,x,m){b=null!=b?b:this.editor.graph;e=null!=e?e:!1;x=null!=x?x:!0;var f,k=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?f="_blank":k=f=d;if(null==a)return"";var p=
+a;if("mxfile"!=p.nodeName.toLowerCase()){var u=Graph.zapGremlins(mxUtils.getXml(a)),p=Graph.compress(u);if(Graph.decompress(p)!=u)return u;u=a.ownerDocument.createElement("diagram");u.setAttribute("id",Editor.guid());mxUtils.setTextContent(u,p);p=a.ownerDocument.createElement("mxfile");p.appendChild(u)}m?(p=p.cloneNode(!0),p.removeAttribute("userAgent"),p.removeAttribute("version"),p.removeAttribute("editor"),p.removeAttribute("type")):(p.removeAttribute("userAgent"),p.removeAttribute("version"),
+p.removeAttribute("editor"),p.removeAttribute("type"),p.setAttribute("modified",(new Date).toISOString()),p.setAttribute("host",window.location.hostname),p.setAttribute("agent",navigator.userAgent),p.setAttribute("version",EditorUi.VERSION),p.setAttribute("etag",Editor.guid()),a=null!=c?c.getMode():this.mode,null!=a&&p.setAttribute("type",a));a=mxUtils.getXml(p);if(!g&&!e&&(l||null!=c&&/(\.html)$/i.test(c.getTitle())))a=this.getHtml2(mxUtils.getXml(p),b,null!=c?c.getTitle():null,f,k);else if(g||!e&&
+null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER||(d=null),a=this.getEmbeddedSvg(a,b,d,null,v,x,k);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(c=Graph.compressNode(c),mxUtils.setTextContent(this.currentPage.node,c),c=this.fileNode.cloneNode(!1),b)c.appendChild(this.currentPage.node);else for(var f=0;f<this.pages.length;f++){if(this.currentPage!=
+this.pages[f]&&this.pages[f].needsUpdate){var d=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(this.pages[f].root));this.editor.graph.saveViewState(this.pages[f].viewState,d);mxUtils.setTextContent(this.pages[f].node,Graph.compressNode(d));delete this.pages[f].needsUpdate}c.appendChild(this.pages[f].node)}return c};EditorUi.prototype.anonymizeString=function(a,b){for(var c=[],f=0;f<a.length;f++){var d=a.charAt(f);0<=EditorUi.ignoredAnonymizedChars.indexOf(d)?c.push(d):isNaN(parseInt(d))?
+d.toLowerCase()!=d?c.push(String.fromCharCode(65+Math.round(25*Math.random()))):d.toUpperCase()!=d?c.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(d)?c.push(" "):c.push("?"):c.push(b?"0":Math.round(9*Math.random()))}return c.join("")};EditorUi.prototype.anonymizePatch=function(a){if(null!=a[EditorUi.DIFF_INSERT])for(var b=0;b<a[EditorUi.DIFF_INSERT].length;b++)try{var c=mxUtils.parseXml(a[EditorUi.DIFF_INSERT][b].data).documentElement.cloneNode(!1);null!=c.getAttribute("name")&&
+c.setAttribute("name",this.anonymizeString(c.getAttribute("name")));a[EditorUi.DIFF_INSERT][b].data=mxUtils.getXml(c)}catch(y){a[EditorUi.DIFF_INSERT][b].data=y.message}if(null!=a[EditorUi.DIFF_UPDATE]){for(var f in a[EditorUi.DIFF_UPDATE]){var d=a[EditorUi.DIFF_UPDATE][f];null!=d.name&&(d.name=this.anonymizeString(d.name));null!=d.cells&&(b=mxUtils.bind(this,function(a){var b=d.cells[a];if(null!=b){for(var c in b)null!=b[c].value&&(b[c].value="["+b[c].value.length+"]"),null!=b[c].xmlValue&&(b[c].xmlValue=
+"["+b[c].xmlValue.length+"]"),null!=b[c].style&&(b[c].style="["+b[c].style.length+"]"),0==Object.keys(b[c]).length&&delete b[c];0==Object.keys(b).length&&delete d.cells[a]}}),b(EditorUi.DIFF_INSERT),b(EditorUi.DIFF_UPDATE),0==Object.keys(d.cells).length&&delete d.cells);0==Object.keys(d).length&&delete a[EditorUi.DIFF_UPDATE][f]}0==Object.keys(a[EditorUi.DIFF_UPDATE]).length&&delete a[EditorUi.DIFF_UPDATE]}return a};EditorUi.prototype.anonymizeAttributes=function(a,b){if(null!=a.attributes)for(var c=
+0;c<a.attributes.length;c++)"as"!=a.attributes[c].name&&a.setAttribute(a.attributes[c].name,this.anonymizeString(a.attributes[c].value,b));if(null!=a.childNodes)for(c=0;c<a.childNodes.length;c++)this.anonymizeAttributes(a.childNodes[c],b)};EditorUi.prototype.anonymizeNode=function(a,b){for(var c=a.getElementsByTagName("mxCell"),f=0;f<c.length;f++)null!=c[f].getAttribute("value")&&c[f].setAttribute("value","["+c[f].getAttribute("value").length+"]"),null!=c[f].getAttribute("xmlValue")&&c[f].setAttribute("xmlValue",
+"["+c[f].getAttribute("xmlValue").length+"]"),null!=c[f].getAttribute("style")&&c[f].setAttribute("style","["+c[f].getAttribute("style").length+"]"),null!=c[f].parentNode&&"root"!=c[f].parentNode.nodeName&&null!=c[f].parentNode.parentNode&&(c[f].setAttribute("id",c[f].parentNode.getAttribute("id")),c[f].parentNode.parentNode.replaceChild(c[f],c[f].parentNode));return a};EditorUi.prototype.synchronizeCurrentFile=function(a){var b=this.getCurrentFile();null!=b&&(b.savingFile?this.handleError({message:mxResources.get("busy")}):
+!a&&b.invalidChecksum?b.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(b.clearAutosave(),this.editor.setStatus(""),a?b.reloadFile(mxUtils.bind(this,function(){b.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){b.handleFileError(a,!0)})):b.synchronizeFile(mxUtils.bind(this,function(){b.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){b.handleFileError(a,!0)}))))};EditorUi.prototype.getFileData=
+function(a,b,c,d,e,g,l,v,x){e=null!=e?e:!0;l=null!=l?l:this.getXmlFileData(e,null!=g?g:!1);x=null!=x?x:this.getCurrentFile();g=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=x&&/(\.svg)$/i.test(x.getTitle()))){g=this.createTemporaryGraph(g.getStylesheet());var f=g.getGlobalVariable,k=this.pages[0];g.getGlobalVariable=function(a){return"page"==a?k.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(g.container);g.model.setRoot(k.root)}a=
+this.createFileData(l,g,x,window.location.href,a,b,c,d,e,v);g!=this.editor.graph&&g.container.parentNode.removeChild(g.container);return a};EditorUi.prototype.getHtml=function(a,b,c,d,e,g){g=null!=g?g:!0;var f=null,k=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=b){var f=g?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),p=b.view.scale;g=Math.floor(f.x/p-b.view.translate.x);p=Math.floor(f.y/p-b.view.translate.y);f=b.background;null==e&&(b=this.getBasenames().join(";"),0<b.length&&
+(k=EditorUi.drawHost+"/embed.js?s="+b));a.setAttribute("x0",g);a.setAttribute("y0",p)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom","1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=d&&a.setAttribute("edit",d));null!=e&&(e=e.replace(/&/g,"&amp;"));a=null!=a?Graph.zapGremlins(mxUtils.getXml(a)):"";d=Graph.compress(a);Graph.decompress(d)!=a&&(d=encodeURIComponent(a));return(null==e?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
+"")+"<!DOCTYPE html>\n<html"+(null!=e?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==e?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=e?'<meta http-equiv="refresh" content="0;URL=\''+e+"'\"/>\n":"")+"</head>\n<body"+(null==e&&null!=f&&f!=mxConstants.NONE?' style="background-color:'+f+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+d+
+"</div>\n</div>\n"+(null==e?'<script type="text/javascript" src="'+k+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+e+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,c,d,e){b=EditorUi.drawHost+"/js/viewer.min.js";null!=e&&(e=e.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(a),
+toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==e?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=e?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==e?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=e?'<meta http-equiv="refresh" content="0;URL=\''+e+"'\"/>\n":
+"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==e?'<script type="text/javascript" src="'+b+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+e+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(a){a=
+this.validateFileData(a);this.pages=this.fileNode=this.currentPage=null;a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var b=null!=a?a.getElementsByTagName("parsererror"):null;if(null!=b&&0<b.length)throw a=mxResources.get("invalidOrMissingFile"),b=b[0].getElementsByTagName("div"),0<b.length&&(a=mxUtils.getTextContent(b[0])),Error(a);b=null!=a?this.editor.extractGraphModel(a,!0):null;null!=b&&(a=b);if(null!=a&&"mxfile"==a.nodeName&&(b=a.getElementsByTagName("diagram"),"0"!=urlParams.pages||
+1<b.length||1==b.length&&b[0].hasAttribute("name"))){var c=null;this.fileNode=a;this.pages=[];for(a=0;a<b.length;a++){null==b[a].getAttribute("id")&&b[a].setAttribute("id",a);var f=new DiagramPage(b[a]);null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[a+1]));this.pages.push(f);null!=urlParams["page-id"]&&f.getId()==urlParams["page-id"]&&(c=f)}this.currentPage=null!=c?c:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];a=this.currentPage.node}"0"!=urlParams.pages&&
+null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(a);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(a){var b=this.getCurrentFile(),b=null!=b&&null!=b.getTitle()?b.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(b)||
+/(\.html)$/i.test(b)||/(\.svg)$/i.test(b)||/(\.png)$/i.test(b)||/(\.drawio)$/i.test(b))b=b.substring(0,b.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(b=b+"-"+this.currentPage.getName());return b};EditorUi.prototype.downloadFile=function(a,b,c,d,e,g,l){try{d=null!=d?d:this.editor.graph.isSelectionEmpty();var f=this.getBaseFilename(!e),k=f+"."+a;if("xml"==a){var p='<?xml version="1.0" encoding="UTF-8"?>\n'+
+(b?mxUtils.getXml(this.editor.getGraphXml(d)):this.getFileData(!0,null,null,null,d,e));this.saveData(k,a,p,"text/xml")}else if("html"==a)p=this.getHtml2(this.getFileData(!0),this.editor.graph,f),this.saveData(k,a,p,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?k=f+".png":"jpeg"==a&&(k=f+".jpg"),this.saveRequest(k,a,mxUtils.bind(this,function(b,c){try{var f=this.editor.graph.pageVisible;null!=g&&(this.editor.graph.pageVisible=g);
+var k=this.createDownloadRequest(b,a,d,c,l,e);this.editor.graph.pageVisible=f;return k}catch(B){this.handleError(B)}}));else{var u=null,t=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(k,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(u)}))});if("svg"==a){var m=this.editor.graph.background;if(l||m==mxConstants.NONE)m=null;var y=this.editor.graph.getSvg(m,null,null,null,
+null,d);c&&this.editor.graph.addSvgShadow(y);this.convertImages(y,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();t('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else k=f+".svg",u=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();t(a)}),d)}}catch(I){this.handleError(I)}};EditorUi.prototype.createDownloadRequest=function(a,b,c,d,e,g){var f=
+this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==g?!1:"xmlpng"!=b);var k="",p="";if(f.width*f.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};f="0";"pdf"==b&&0==g&&(p="&allPages=1");if("xmlpng"==b&&(f="1",b="png",null!=this.pages&&null!=this.currentPage))for(g=0;g<this.pages.length;g++)if(this.pages[g]==this.currentPage){k="&from="+g;break}g=this.editor.graph.background;"png"==b&&e&&(g=mxConstants.NONE);return new mxXmlRequest(EXPORT_URL,
+"format="+b+k+p+"&bg="+(null!=g?g:mxConstants.NONE)+"&base64="+d+"&embedXml="+f+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var d=window.location.hash,f=mxUtils.bind(this,function(c){var f=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<f.length&&(f+="\n"),f+=c);c=new LocalFile(this,"csv"!=a.format&&0<f.length?f:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):
+this.defaultFilename,!0);c.getHash=function(){return d};this.fileLoaded(c);"csv"==a.format&&this.importCsv(f,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var k=null!=a.interval?parseInt(a.interval):6E4,e=null,p=mxUtils.bind(this,function(){var b=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){b===this.currentPage&&(200<=
+a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),g()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),g=mxUtils.bind(this,function(){window.clearTimeout(e);e=window.setTimeout(p,k)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){g();p()}));g();p()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var k=a.url;/^https?:\/\//.test(k)&&!this.editor.isCorsEnabledForUrl(k)&&(k=PROXY_URL+
+"?url="+encodeURIComponent(k));this.loadUrl(k,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=c&&c(a)}))}else f("")};EditorUi.prototype.updateDiagram=function(a){function b(a){var b=new mxCellOverlay(a.image||f.warningImage,a.tooltip,a.align,a.valign,a.offset);b.addListener(mxEvent.CLICK,function(b,c){d.alert(a.tooltip)});return b}var c=null,d=this;if(null!=a&&0<a.length&&(c=mxUtils.parseXml(a),a=null!=c?c.documentElement:null,null!=a&&"updates"==a.nodeName)){var f=this.editor.graph,
+e=f.getModel();e.beginUpdate();var g=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var v=e.getCell(a.getAttribute("id"));if(null!=v){try{var x=a.getAttribute("value");if(null!=x){var l=mxUtils.parseXml(x).documentElement;if(null!=l)if("1"==l.getAttribute("replace-value"))e.setValue(v,l);else for(var m=l.attributes,n=0;n<m.length;n++)f.setAttributeForCell(v,m[n].nodeName,0<m[n].nodeValue.length?m[n].nodeValue:null)}}catch(K){null!=window.console&&console.log("Error in value for "+
+v.id+": "+K)}try{var q=a.getAttribute("style");null!=q&&f.model.setStyle(v,q)}catch(K){null!=window.console&&console.log("Error in style for "+v.id+": "+K)}try{var E=a.getAttribute("icon");if(null!=E){var I=0<E.length?JSON.parse(E):null;null!=I&&I.append||f.removeCellOverlays(v);null!=I&&f.addCellOverlay(v,b(I))}}catch(K){null!=window.console&&console.log("Error in icon for "+v.id+": "+K)}try{var C=a.getAttribute("geometry");if(null!=C){var C=JSON.parse(C),G=f.getCellGeometry(v);if(null!=G){G=G.clone();
+for(key in C){var H=parseFloat(C[key]);"dx"==key?G.x+=H:"dy"==key?G.y+=H:"dw"==key?G.width+=H:"dh"==key?G.height+=H:G[key]=parseFloat(C[key])}f.model.setGeometry(v,G)}}}catch(K){null!=window.console&&console.log("Error in icon for "+v.id+": "+K)}}}else if("model"==a.nodeName){for(var B=a.firstChild;null!=B&&B.nodeType!=mxConstants.NODETYPE_ELEMENT;)B=B.nextSibling;null!=B&&(new mxCodec(a.firstChild)).decode(B,e)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(f.view.scale=parseFloat(a.getAttribute("scale"))),
+a.hasAttribute("dx")||a.hasAttribute("dy"))f.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(g=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=g&&this.chromelessResize&&this.chromelessResize(!0,g)}return c};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,d="",f=c.lastIndexOf(".");0<=f&&(d=
+c.substring(f),c=c.substring(0,f));if(b)var k=new Date,f=k.getFullYear(),e=k.getMonth()+1,g=k.getDate(),x=k.getHours(),l=k.getMinutes(),k=k.getSeconds(),c=c+(" "+(f+"-"+e+"-"+g+"-"+x+"-"+l+"-"+k));return c=mxResources.get("copyOf",[c])+d};EditorUi.prototype.fileLoaded=function(a,b){var c=this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var d=!1;this.hideDialog();null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();this.editor.undoManager.clear();
+var f=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!b&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename")));this.editor.setStatus("");this.updateUi();b||this.showSplash()});
+if(null!=a)try{mxClient.IS_SF&&"min"==uiTheme&&(this.diagramContainer.style.visibility="");this.openingFile=!0;this.setCurrentFile(a);a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();a.isEditable()?a.isModified()?(a.addUnsavedStatus(),
+null!=a.backupPatch&&a.patch([a.backupPatch])):this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</span>");!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"));
+d=!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(z){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(z){}}catch(z){this.fileLoadedError=z;null!=window.console&&console.log("error in fileLoaded:",a,z);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!=z&&null!=z.message?":err:"+encodeURIComponent(z.message):"")+(null!=z&&null!=z.stack?"&stack="+encodeURIComponent(z.stack):"")}catch(v){}var k=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):
+null!=c?this.fileLoaded(c):f()});b?k():this.handleError(z,mxResources.get("errorLoadingFile"),k,!0)}else f();return d};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 k=0;k<a.length;k++){this.updatePageRoot(a[k]);var e=a[k].node.cloneNode(!1);e.removeAttribute("name");d.root=a[k].root;var g=f.encode(d);this.editor.graph.saveViewState(a[k].viewState,g,!0);g.removeAttribute("pageWidth");
+g.removeAttribute("pageHeight");e.appendChild(g);null!=b&&(b.eltCount+=e.getElementsByTagName("*").length,b.nodeCount+=e.getElementsByTagName("mxCell").length);c=(c<<5)-c+this.hashValue(e,function(a,b,c,d){return!d||"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=b&&"y"!=b&&"width"!=b&&"height"!=b?d&&"mxCell"==a.nodeName&&"previous"==b?null:c:Math.round(c)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,c){var d=0;if(null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===
+typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(d^=this.hashValue(a.nodeName,b,c));if(null!=a.attributes){null!=c&&(c.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var k=a.attributes[f].name,e=null!=b?b(a,k,a.attributes[f].value,!0):a.attributes[f].value;null!=e&&(d^=this.hashValue(k,b,c)+this.hashValue(e,b,c))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)d=(d<<5)-d+this.hashValue(a.childNodes[f],b,c)<<0}else if(null!=a&&"function"!==
+typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;d^=b}return d};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,d,e,g,l){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",
+mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var b=mxUtils.createXmlDocument(),c=b.createElement("mxlibrary");mxUtils.setTextContent(c,JSON.stringify(a));b.appendChild(c);return mxUtils.getXml(b)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),
+".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var b=this.sidebar.palettes[a];if(null!=b){for(var c=0;c<b.length;c++)b[c].parentNode.removeChild(b[c]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var b=this.sidebar.container;if(null==a){var c=this.sidebar.palettes["L.scratchpad"];null==c&&(c=this.sidebar.palettes.search);null!=c&&(a=c[c.length-1].nextSibling)}a=null!=a?a:b.firstChild.nextSibling.nextSibling;
+var c=b.lastChild,d=c.previousSibling;b.insertBefore(c,a);b.insertBefore(d,c)};EditorUi.prototype.loadLibrary=function(a){var b=mxUtils.parseXml(a.getData());if("mxlibrary"==b.documentElement.nodeName){var c=JSON.parse(mxUtils.getTextContent(b.documentElement));this.libraryLoaded(a,c,b.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,c){if(null!=
+this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var d=this.sidebar.palettes[a.getHash()],d=null!=d?d[d.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,k=mxUtils.bind(this,function(b,c){0==b.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),f.className="geDropTarget",mxUtils.write(f,mxResources.get("dragElementsHere"))),c.appendChild(f)):this.addLibraryEntries(b,c)});if(null!=
+this.sidebar&&null!=b)for(var e=0;e<b.length;e++)mxUtils.bind(this,function(a){var b=a.data;null!=b&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){b=this.convertDataUri(b);var c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(c+="aspect=fixed;");return this.sidebar.createVertexTemplate(c+"image="+b,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var b=
+this.stringToCells(Graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(b,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[e]);c=null!=c&&0<c.length?c:a.getTitle();var g=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){k(b,a)}));this.repositionLibrary(d);var p=g.parentNode.previousSibling;c=p.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&p.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var l=document.createElement("div");l.style.position=
+"absolute";l.style.right="0px";l.style.top="0px";l.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(l.style.backgroundColor="inherit");p.style.position="relative";var m=document.createElement("img");m.setAttribute("src",Dialog.prototype.closeImage);m.setAttribute("title",mxResources.get("close"));m.setAttribute("valign","absmiddle");m.setAttribute("border","0");m.style.margin="0 3px";var n=null;if(".scratchpad"!=a.title||this.closableScratchpad)l.appendChild(m),mxEvent.addListener(m,
+"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var c=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=n?this.confirm(mxResources.get("allChangesLost"),null,c,mxResources.get("cancel"),mxResources.get("discardChanges")):c();mxEvent.consume(b)}}));if(a.isEditable()){var q=this.editor.graph,E=null,I=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),g,b,a,a.getMode());mxEvent.consume(c)}),C=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=
+E&&null!=E.parentNode&&E.parentNode.removeChild(E),E=m.cloneNode(!1),E.setAttribute("src",Editor.spinImage),E.setAttribute("title",mxResources.get("saving")),E.style.cursor="default",E.style.marginRight="2px",E.style.marginTop="-2px",l.insertBefore(E,l.firstChild),p.style.paddingRight=18*l.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=E&&null!=E.parentNode&&(E.parentNode.removeChild(E),p.style.paddingRight=18*l.childNodes.length+"px")})):null==n&&(n=m.cloneNode(!1),
+n.setAttribute("src",IMAGE_PATH+"/download.png"),n.setAttribute("title",mxResources.get("save")),l.insertBefore(n,l.firstChild),mxEvent.addListener(n,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==n||a.isModified()||(p.style.paddingRight=18*l.childNodes.length+"px",n.parentNode.removeChild(n),n=null)});mxEvent.consume(c)})),p.style.paddingRight=18*l.childNodes.length+"px")}),G=mxUtils.bind(this,function(a,c,d,k){a=
+q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var e=0;e<a.length;e++){var p=q.getCellGeometry(a[e]);null!=p&&p.translate(-c.x,-c.y)}g.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,k||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=k&&(a.title=k);b.push(a);C(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),H=mxUtils.bind(this,function(a){if(q.isSelectionEmpty())q.getRubberband().isActive()?
+(q.getRubberband().execute(a),q.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var b=q.getSelectionCells(),c=q.view.getBounds(b),d=q.view.scale;c.x/=d;c.y/=d;c.width/=d;c.height/=d;c.x-=q.view.translate.x;c.y-=q.view.translate.y;G(b,c)}mxEvent.consume(a)});mxEvent.addGestureListeners(g,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility=
+"hidden",g.style.backgroundColor="#f1f3f4",g.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler&&(g.style.backgroundColor="",g.style.cursor="default",this.sidebar.showTooltips=!0,q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,
+q.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(g,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="visible",g.style.backgroundColor="",g.style.cursor="",q.autoScroll=!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"))}));Graph.fileSupport&&(mxEvent.addListener(g,"dragover",mxUtils.bind(this,function(a){g.style.backgroundColor=
+"#f1f3f4";a.dataTransfer.dropEffect="copy";g.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(g,"drop",mxUtils.bind(this,function(a){g.style.cursor="";g.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,e,p,v,x,l,m,t){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),
+c=[new mxCell("",new mxGeometry(0,0,v,x),c)],c[0].vertex=!0,G(c,new mxRectangle(0,0,v,x),a,mxEvent.isAltDown(a)?null:l.substring(0,l.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var u=!1,n=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var e=mxUtils.parseXml(c);if("mxlibrary"==e.documentElement.nodeName)try{var p=JSON.parse(mxUtils.getTextContent(e.documentElement));k(p,g);b=b.concat(p);C(a);this.spinner.stop();
+u=!0}catch(L){}else if("mxfile"==e.documentElement.nodeName)try{for(var v=e.documentElement.getElementsByTagName("diagram"),e=0;e<v.length;e++){var p=mxUtils.getTextContent(v[e]),x=this.stringToCells(Graph.decompress(p)),l=this.editor.graph.getBoundingBoxFromGeometry(x);G(x,new mxRectangle(0,0,l.width,l.height),a)}u=!0}catch(L){null!=window.console&&console.log("error in drop handler:",L)}}u||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&
+0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=t&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||/(\.vs(x|sx?))($|\?)/i.test(l))?this.importVisio(t,function(a){n(a,"text/xml")},null,l):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,l)&&null!=t?this.parseFile(t,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=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){g.style.cursor="";g.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));m=m.cloneNode(!1);m.setAttribute("src",Editor.editImage);m.setAttribute("title",mxResources.get("edit"));l.insertBefore(m,l.firstChild);mxEvent.addListener(m,"click",I);mxEvent.addListener(g,"dblclick",function(a){mxEvent.getSource(a)==g&&I(a)});c=m.cloneNode(!1);c.setAttribute("src",
+Editor.plusImage);c.setAttribute("title",mxResources.get("add"));l.insertBefore(c,l.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)})),
+l.insertBefore(c,l.firstChild))}p.appendChild(l);p.style.paddingRight=18*l.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var c=0;c<a.length;c++){var d=a[c],f=d.data;if(null!=f){var f=this.convertDataUri(f),k="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==d.aspect&&(k+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(k+"image="+f,d.w,d.h,"",d.title||"",!1,!1,!0))}else null!=d.xml&&(f=this.stringToCells(Graph.decompress(d.xml)),
+0<f.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(f,d.w,d.h,d.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=function(a){return null!=a?a[mxLanguage]||a.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.offline||EditorUi.isElectronApp||("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.createFooter=function(){return document.getElementById("geFooter")});EditorUi.initTheme=function(){"atlas"==uiTheme?
+(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName=
+"darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor=
+"#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))};
+EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display="none",this.refresh())};EditorUi.prototype.showFooter=function(a){var b=document.getElementById("geFooter");null!=b&&(this.footerHeight=a,b.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,d,e){a=new ImageDialog(this,a,b,c,d,e);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,
+!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=!0;this.editor.graph.model.execute(a)});var b=new BackgroundImageDialog(this,mxUtils.bind(this,function(b){a(b)}));this.showDialog(b.container,360,200,!0,!0);b.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,d,e){a=new LibraryDialog(this,a,b,c,d,e);this.showDialog(a.container,640,440,!0,!1,mxUtils.bind(this,function(a){a&&null==
+this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};var c=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(a){var b=c.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(a){this.editor.graph.isSelectionEmpty()&&b.refresh()}));return b};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer geSidebarFooter");a.style.position="absolute";a.style.overflow="hidden";
+var b=document.createElement("a");b.className="geTitle";b.style.color="#188038";b.style.height="100%";b.style.paddingTop="9px";b.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);
+return a};EditorUi.prototype.handleError=function(a,b,c,d){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},k=null!=a&&null!=a.error?a.error:a;if(null!=k||null!=b){var e=mxUtils.htmlEntities(mxResources.get("unknownError")),g=mxResources.get("ok"),p=null;b=null!=b?b:mxResources.get("error");if(null!=k)if(null!=k.retry&&(g=mxResources.get("cancel"),p=function(){f();k.retry()}),404==k.code||404==k.status||403==k.code){var e=403==k.code?null!=k.message?mxUtils.htmlEntities(k.message):
+mxUtils.htmlEntities(mxResources.get("accessDenied")):mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")),l=window.location.hash;if(null!=l&&"#G"==l.substring(0,2)&&null!=a&&null!=a.error&&null!=a.error.errors&&0<a.error.errors.length&&"fileAccess"==a.error.errors[0].reason){l=l.substring(2);this.showError(b,e,mxResources.get("cancel"),null,p,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+l)}),null,null,
+380);return}}else null!=k.message?e=mxUtils.htmlEntities(k.message):null!=k.response&&null!=k.response.error?e=mxUtils.htmlEntities(k.response.error):"undefined"!==window.App&&(k.code==App.ERROR_TIMEOUT?e=mxUtils.htmlEntities(mxResources.get("timeout")):k.code==App.ERROR_BUSY&&(e=mxUtils.htmlEntities(mxResources.get("busy"))));this.showError(b,e,g,c,p,null,null,null,null,null,null,null,d?c:null)}else null!=c&&c()};EditorUi.prototype.showError=function(a,b,c,d,e,g,l,v,x,m,n,q,A){a=new ErrorDialog(this,
+a,b,c||mxResources.get("ok"),d,e,g,l,q,v,x);this.showDialog(a.container,m||340,n||(null!=b&&120<b.length?180:150),!0,!1,A);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,c,d,e,g){var f=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};a=new ConfirmDialog(this,a,function(){f();null!=b&&b()},function(){f();null!=c&&c()},
+d,e);this.showDialog(a.container,340,90,!0,g);a.init()};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,c){var d=
+a.toDataURL("image/"+c);if(6>=d.length||d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(Graph.compress(b))));return d};EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,f=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(f,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||
+"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(a,b){var c=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));c.textarea.style.width="600px";c.textarea.style.height="380px";this.showDialog(c.container,620,460,!0,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=
+function(a,b,c,d,e){if(window.Blob&&navigator.msSaveOrOpenBlob)a=d?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else{var f=document.createElement("a"),k=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof f.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),
+k=65==(g?parseInt(g[2],10):!1)?!1:k;if(k||this.isOffline()){f.href=URL.createObjectURL(d?this.base64ToBlob(a,c):new Blob([a],{type:c}));k?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),k=0;k<f;++k){for(var g=1024*k,x=Math.min(g+1024,d),l=Array(x-g),m=0;g<x;++m,++g)l[m]=c[g].charCodeAt(0);e[k]=new Uint8Array(l)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,d,e,g,l){g=null!=g?g:!1;l=null!=l?l:
+"vsdx"!=e&&(!mxClient.IS_IOS||!navigator.standalone);e=this.getServiceCount(g);b=new CreateDialog(this,b,mxUtils.bind(this,function(b,f){try{if("_blank"==f)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var e=window.open("about:blank");null==e?mxUtils.popup(a,!0):(e.document.write(mxUtils.htmlEntities(a,!1)),e.document.close())}else this.openInNewWindow(a,c,d);else f==App.MODE_DEVICE||"download"==f?this.doSaveLocalFile(a,b,c,d):null!=b&&0<b.length&&this.pickFolder(f,
+mxUtils.bind(this,function(e){try{this.exportFile(a,b,c,d,f,e)}catch(F){this.handleError(F)}}))}catch(J){this.handleError(J)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,g,l,null,1<e,4<e&&(!g||6>e)?3:4,a,c,d);this.showDialog(b.container,420,1==e?160:4<e?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");
+null==d||null==d.document?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null!=d&&null!=d.document||mxUtils.popup(a,!0)};var b=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=
+null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign=
+"center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);
+this.exportDialog.style.zIndex=d.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";
+a.style.cursor="pointer";a.style.backgroundColor="white";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,
+"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}b.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,d,e){this.isLocalFileSave()?this.saveLocalFile(c,a,d,e,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,f){return this.createEchoRequest(c,a,d,e,b,f)}),c,e,d)};EditorUi.prototype.saveRequest=function(a,b,c,d,e,g,l){l=null!=l?l:!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<a.length){var e=c("_blank"==f?null:a,f==App.MODE_DEVICE||"download"==f||null==f||"_blank"==f?"0":"1");null!=e&&(f==App.MODE_DEVICE||"download"==f||"_blank"==f?e.simulate(document,"_blank"):this.pickFolder(f,mxUtils.bind(this,function(c){g=null!=g?g:"pdf"==b?"application/pdf":"image/"+b;if(null!=d)try{this.exportFile(d,a,g,!0,f,c)}catch(A){this.handleError(A)}else this.spinner.spin(document.body,mxResources.get("saving"))&&e.send(mxUtils.bind(this,
+function(){this.spinner.stop();if(200<=e.getStatus()&&299>=e.getStatus())try{this.exportFile(e.getText(),a,g,!0,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,l,null,1<f,4<f?3:4,d,g,e);this.showDialog(a.container,380,1==f?160:4<f?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=
+function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,d,e,g){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,d,e,g,l,v,x,m){if(this.spinner.spin(document.body,mxResources.get("export"))){var f=this.editor.graph.isSelectionEmpty();c=null!=c?c:f;f=b?null:this.editor.graph.background;f==mxConstants.NONE&&(f=null);null==f&&0==b&&(f="#ffffff");var k=this.editor.graph.getSvg(f,a,l,v,null,c,null,null,"blank"==m?"_blank":
+"self"==m?"_top":null);d&&this.editor.graph.addSvgShadow(k);var p=this.getBaseFilename()+".svg",n=mxUtils.bind(this,function(a){this.spinner.stop();e&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,x));if(null!=this.editor.fontCss){var b=a.ownerDocument,b=null!=b.createElementNS?b.createElementNS(mxConstants.NS_SVG,"style"):b.createElement("style");b.setAttribute("type","text/css");mxUtils.setTextContent(b,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(b)}var d=
+'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||d.length<=MAX_REQUEST_SIZE?this.saveData(p,"svg",d,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(d)}))});this.convertMath(this.editor.graph,k,!1,mxUtils.bind(this,function(){g?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(k,n,this.thumbImageCache)):
+n(k)}))}};EditorUi.prototype.addRadiobox=function(a,b,c,d,e,g,l){return this.addCheckbox(a,c,d,e,g,l,!0,b)};EditorUi.prototype.addCheckbox=function(a,b,c,d,e,g,l,v){g=null!=g?g:!0;var f=document.createElement("input");f.style.marginRight="8px";f.style.marginTop="16px";f.setAttribute("type",l?"radio":"checkbox");l="geCheckbox-"+Editor.guid();f.id=l;null!=v&&f.setAttribute("name",v);c&&(f.setAttribute("checked","checked"),f.defaultChecked=!0);d&&f.setAttribute("disabled","disabled");g&&(a.appendChild(f),
+c=document.createElement("label"),mxUtils.write(c,b),c.setAttribute("for",l),a.appendChild(c),e||mxUtils.br(a));return f};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";
+e.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,mxResources.get("custom")+"...");e.appendChild(d);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"==e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,
+null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===e.value?"_blank":f:null},getEditInput:function(){return c},getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+
+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));
+d.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));d.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+
+":");var e="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();k.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},
+focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,c,d,e,g,l,v){var f=this.getCurrentFile(),k=[];d&&(k.push("lightbox=1"),"auto"!=a&&k.push("target="+a),null!=b&&b!=mxConstants.NONE&&k.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=e&&0<e.length&&k.push("edit="+encodeURIComponent(e)),g&&k.push("layers=1"),this.editor.graph.foldingEnabled&&k.push("nav=1"));c&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&k.push("page-id="+this.currentPage.getId());
+a=!0;null!=l?c="#U"+encodeURIComponent(l):(f=this.getCurrentFile(),v||null==f||f.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+f.getHash(),a=!1));a&&null!=f&&null!=f.getTitle()&&f.getTitle()!=this.defaultFilename&&k.push("title="+encodeURIComponent(f.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:
+"https://"+window.location.host+"/")+(0<k.length?"?"+k.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,d,e,g,l,v,x,m,n){this.getBasenames();var f={};""!=e&&e!=mxConstants.NONE&&(f.highlight=e);"auto"!==d&&(f.target=d);x||(f.lightbox=!1);f.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(f.zoom=c/100);c=[];l&&(c.push("pages"),f.resize=!0,null!=this.pages&&null!=this.currentPage&&(f.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),f.resize=!0);
+v&&c.push("layers");0<c.length&&(x&&c.push("lightbox"),f.toolbar=c.join(" "));null!=m&&0<m.length&&(f.edit=m);null!=a?f.url=a:f.xml=this.getFileData(!0,null,null,null,null,!l);b='<div class="mxgraph" style="'+(g?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(f))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";n(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":
+EditorUi.drawHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.drawHost+"/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,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 k=document.createElement("div");
+k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var g=document.createElement("input");g.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";g.setAttribute("value","url");g.setAttribute("type","radio");g.setAttribute("name","type-embedhtmldialog");e=g.cloneNode(!0);e.setAttribute("value","copy");k.appendChild(e);var p=document.createElement("span");mxUtils.write(p,mxResources.get("includeCopyOfMyDiagram"));k.appendChild(p);mxUtils.br(k);k.appendChild(g);
+p=document.createElement("span");mxUtils.write(p,mxResources.get("publicDiagramUrl"));k.appendChild(p);var l=this.getCurrentFile();null==c&&null!=l&&l.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")),k.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(l.getId())})));e.setAttribute("checked",
+"checked");null==c&&g.setAttribute("disabled","disabled");f.appendChild(k);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),k=null!=this.pages&&1<this.pages.length,I=I=this.addCheckbox(f,mxResources.get("allPages"),
+k,!k),C=this.addCheckbox(f,mxResources.get("layers"),!0),G=this.addCheckbox(f,mxResources.get("lightbox"),!0),H=this.addEditButton(f,G),B=H.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(G,"change",function(){G.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&G.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,f,mxUtils.bind(this,function(){d(g.checked?c:null,n.checked,
+t.value,m.getTarget(),m.getColor(),q.checked,I.checked,C.checked,G.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);e.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,d,e,g){var f=document.createElement("div");f.style.whiteSpace="nowrap";var k=document.createElement("h3");mxUtils.write(k,a||mxResources.get("link"));k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(k);var p=this.getCurrentFile(),k="https://desk.draw.io/support/solutions/articles/16000051941";
+a=0;if(null!=p&&p.constructor==window.DriveFile&&!b){a=80;var k="https://desk.draw.io/support/solutions/articles/16000039384",l=document.createElement("div");l.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var m=document.createElement("div");m.style.whiteSpace="normal";mxUtils.write(m,mxResources.get("linkAccountRequired"));l.appendChild(m);m=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(p.getId())}));
+m.style.marginTop="12px";m.className="geBtn";l.appendChild(m);f.appendChild(l);m=document.createElement("a");m.style.paddingLeft="12px";m.style.color="gray";m.style.fontSize="11px";m.setAttribute("href","javascript:void(0);");mxUtils.write(m,mxResources.get("check"));l.appendChild(m);mxEvent.addListener(m,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,
+null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var n=null,t=null;if(null!=c||null!=d)a+=30,mxUtils.write(f,mxResources.get("width")+":"),n=document.createElement("input"),n.setAttribute("type","text"),n.style.marginRight="16px",n.style.width="50px",n.style.marginLeft="6px",n.style.marginRight="16px",n.style.marginBottom="10px",n.value="100%",f.appendChild(n),mxUtils.write(f,mxResources.get("height")+
+":"),t=document.createElement("input"),t.setAttribute("type","text"),t.style.width="50px",t.style.marginLeft="6px",t.style.marginBottom="10px",t.value=d+"px",f.appendChild(t),mxUtils.br(f);var u=this.addLinkSection(f,g);c=null!=this.pages&&1<this.pages.length;var q=null;if(null==p||p.constructor!=window.DriveFile||b)q=this.addCheckbox(f,mxResources.get("allPages"),c,!c);var y=this.addCheckbox(f,mxResources.get("lightbox"),!0),G=this.addEditButton(f,y),H=G.getEditInput(),B=this.addCheckbox(f,mxResources.get("layers"),
!0);B.style.marginLeft=H.style.marginLeft;B.style.marginBottom="16px";B.style.marginTop="8px";mxEvent.addListener(y,"change",function(){y.checked?(B.removeAttribute("disabled"),H.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&y.checked?G.getEditSelect().removeAttribute("disabled"):G.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,f,mxUtils.bind(this,function(){e(u.getTarget(),u.getColor(),null==q?
!0:q.checked,y.checked,G.getLink(),B.checked,null!=n?n.value:null,null!=t?t.value:null)}),null,mxResources.get("create"),k);this.showDialog(b.container,340,254+a,!0,!0);null!=n?(n.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)):u.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,d){var f=document.createElement("div");f.style.whiteSpace="nowrap";var e=document.createElement("h3");mxUtils.write(e,
mxResources.get("image"));e.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";f.appendChild(e);var k=this.addCheckbox(f,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),g=d?null:this.addCheckbox(f,mxResources.get("includeCopyOfMyDiagram"),!0),e=this.editor.graph,p=d?null:this.addCheckbox(f,mxResources.get("transparentBackground"),e.background==mxConstants.NONE||null==e.background);null!=p&&(p.style.marginBottom="16px");a=new CustomDialog(this,f,
@@ -8425,85 +8426,85 @@ if(d&&this.isResampleImage(b,g))try{var l=Math.max(f/e,k/e);if(1<l){var p=Math.r
e;EditorUi.prototype.updateCRC=function(a,b,c,d){for(var f=0;f<d;f++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(c+f))&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var b=-1,c=0;c<a.length;c++)b=b>>>8^this.crcTable[(b^a.charCodeAt(c))&255];return(b^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,d,e){function f(a,b){var c=l;l+=b;return a.substring(c,l)}function g(a){a=f(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<
8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function k(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var l=0;if(f(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(f(a,4),"IHDR"!=f(a,4))null!=e&&e();else{f(a,17);e=a.substring(0,l);do{var p=g(a);if("IDAT"==f(a,4)){e=a.substring(0,l-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+d;d=4294967295;
d=this.updateCRC(d,b,0,4);d=this.updateCRC(d,c,0,c.length);e+=k(c.length)+b+c+k(d^4294967295);e+=a.substring(l-8,a.length);break}e+=a.substring(l-8,l-4+p);f(a,p);f(a,4)}while(p);return"data:image/png;base64,"+(window.btoa?btoa(e):Base64.encode(e,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,f){a=d.substring(a+8,a+8+f);"zTXt"==
-c?(f=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,f)&&(a=Graph.bytesToString(pako.inflateRaw(a.substring(f+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(u){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){var d=new Image;d.onload=function(){b(d)};
-null!=c&&(d.onerror=c);d.src=a};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(b){return a.getLinkTitle(b)};b.customLinkClicked=function(b){var c=!1;try{a.handleCustomLink(b),c=!0}catch(B){a.handleError(B)}return c};var c=this.clearDefaultStyle;this.clearDefaultStyle=
-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.pages.length;c++)if(a.pages[c]==a.currentPage){0<c&&(b+=(0<b.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(b+=(0<b.length?"&":"?")+"dev=1&drawdev=1");return d.apply(this,
-arguments)};var e=b.addClickHandler;b.addClickHandler=function(a,c,d){var f=c;c=function(a,c){if(null==c){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(c=d.getAttribute("href"))}null!=c&&b.isCustomLink(c)&&(mxEvent.isTouchEvent(a)||!mxEvent.isPopupTrigger(a))&&b.customLinkClicked(c)&&mxEvent.consume(a);null!=f&&f(a,c)};e.call(this,a,c,d)};l.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(b.view.canvas.ownerSVGElement,null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,
-360,null!=a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var g=b.getGlobalVariable;b.getGlobalVariable=function(b){return"page"==b&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==b?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:g.apply(this,arguments)};var m=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var f=c.getAttribute("href");if(null==f||!b.isCustomLink(f)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))m.apply(this,
-arguments);else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(f),b.getRubberband().reset();mxEvent.consume(d)}};this.editor.getOrCreateFilename=function(){var b=a.defaultFilename,c=a.getCurrentFile();null!=c&&(b=null!=c.getTitle()?c.getTitle():b);return b};var v=this.actions.get("print");v.setEnabled(!mxClient.IS_IOS||!navigator.standalone);v.visible=v.isEnabled();if(!this.editor.chromeless||this.editor.editable){var n=function(){window.setTimeout(function(){q.innerHTML="&nbsp;";
-q.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(this.altShiftActions[83]="synchronize");mxClient.IS_IE||
-b.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,f=0;f<c.types.length;f++)if("text/"===c.types[f].substring(0,5)){d=!0;break}if(!d){var e=c.items;for(index in e){var g=e[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,c,d,f,e,g){b.insertImage(a,e,g)},function(){},function(a){return"image/"==a.type.substring(0,
-6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var k=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],k.x,k.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(U){}}),!1);var q=document.createElement("div");q.style.position="absolute";q.style.whiteSpace="nowrap";q.style.overflow="hidden";q.style.display="block";q.contentEditable=!0;mxUtils.setOpacity(q,0);q.style.width="1px";q.style.height="1px";q.innerHTML="&nbsp;";var J=!1;this.keyHandler.bindControlKey(88,null);
-this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||J||(q.style.left=b.container.scrollLeft+10+"px",q.style.top=b.container.scrollTop+10+"px",b.container.appendChild(q),
-J=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){q.focus();document.execCommand("selectAll",!1,null)},0):(q.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!J||224!=c&&17!=c&&91!=c||(J=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),q.parentNode.removeChild(q),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(q,
-"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(q),n())}));mxEvent.addListener(q,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(q,!0),n())}));mxEvent.addListener(q,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(q.innerHTML="&nbsp;",q.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,q);q.innerHTML="&nbsp;"}),0))}),!0);var F=this.isSelectionAllowed;this.isSelectionAllowed=
-function(a){return mxEvent.getSource(a)==q?!0:F.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),
-mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,f,e,g){b.insertImage(a,e,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=
-0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var f=this.maxImageSize,f=Math.min(1,Math.min(f/Math.max(1,d)),f/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*f,a*f)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=
-mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){v=document.createElement("div");v.style.position="absolute";v.style.top="95px";v.style.left="250px";v.style.width="2000px";v.style.height="30px";v.style.background=
-"whiteSmoke";document.body.appendChild(v);var A=document.createElement("div");A.style.position="absolute";A.style.top="125px";A.style.left="220px";A.style.width="30px";A.style.height="1000px";A.style.background="whiteSmoke";document.body.appendChild(A);var E=document.createElement("div");E.style.position="absolute";E.style.top="95px";E.style.left="220px";E.style.width="30px";E.style.height="30px";E.style.background="whiteSmoke";document.body.appendChild(E);this.vRuler=new mxRuler(this.editor.graph,
-A,!0);this.hRuler=new mxRuler(this.editor.graph,v,!1)}if("1"==urlParams.styledev){v=document.getElementById("geFooter");null!=v&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,
-function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),v.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var I=this.isSelectionAllowed;
-this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:I.apply(this,arguments)}}v=document.getElementById("geInfo");null!=v&&v.parentNode.removeChild(v);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var C=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=C&&(C.parentNode.removeChild(C),C=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==
-C&&(!mxClient.IS_IE||10<document.documentMode)&&(C=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=C&&(C.parentNode.removeChild(C),C=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,f=b.view.scale,e=c.x/f-d.x,g=c.y/f-d.y;mxEvent.isAltDown(a)&&(g=e=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,
-e,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var k=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=c)b.setSelectionCells(this.importXml(c,e,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var l=a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=l;var p=null,d=c.getElementsByTagName("img");
-null!=d&&1==d.length?(l=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(p=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(l=c[0].getAttribute("href")));var v=!0,m=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(l,e,g,!0,p,null,v))});p&&l.length>this.resampleThreshold?this.confirmImageResize(function(a){v=a;m()},mxEvent.isControlDown(a)):m()}else null!=k&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)?this.loadImage(decodeURIComponent(k),mxUtils.bind(this,
-function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",e,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+k+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(k,e,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),
-e,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();this.editUpdateListener=mxUtils.bind(this,function(a,b){var c=b.getProperty("edit");null!=c&&this.updateEditReferences(c)});this.editor.undoManager.addListener(mxEvent.BEFORE_UNDO,this.editUpdateListener);this.editor.undoManager.addListener(mxEvent.BEFORE_REDO,this.editUpdateListener);"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(a){var b=Graph.prototype.getLinkTitle.apply(this,
-arguments);if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");0<c&&(b=this.getPageById(a.substring(c+1)),b=null!=b?b.getName():mxResources.get("pageNotFound"))}else"data:"==a.substring(0,5)&&(b=mxResources.get("action"));return b};EditorUi.prototype.handleCustomLink=function(a){if("data:page/id,"==a.substring(0,13)){var b=a.indexOf(",");if(a=this.getPageById(a.substring(b+1)))this.selectPage(a);else throw Error(mxResources.get("pageNotFound")||"Page not found");}else this.editor.graph.handleCustomLink(a)};
-EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",
-mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);
-mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),
-mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),f=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(f));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=f,c.pasteCounter=0);a.focus();
-document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.convertLucidChart(d,mxUtils.bind(this,function(a){var b=this.editor.graph;b.setSelectionCells(this.importXml(a,0,0));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,
-function(a){this.handleError(a)})),mxEvent.consume(a))}else{var d=this.editor.graph,f=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),e=!1;try{var g=f.lastIndexOf("%3E");0<=g&&g<f.length-3&&(f=f.substring(0,g+3))}catch(x){}try{var c=b.getElementsByTagName("span"),k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(f);this.isCompatibleString(k)&&(e=!0,f=k)}catch(x){}d.lastPasteXml==f?d.pasteCounter++:(d.lastPasteXml=
-f,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=f&&0<f.length&&(e||this.isCompatibleString(f)?d.setSelectionCells(this.importXml(f,c,c)):(e=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==f&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(f,e.x+c,e.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(x){}}}}};
-EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),
-mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:
-a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==
-c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":
-"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,f;if(null==a){f=document.body;var e=document.documentElement;d=(f.clientWidth||e.clientWidth)-3;f=Math.max(f.clientHeight||0,e.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,f=a.clientHeight;e=document.createElement("div");e.style.zIndex=mxPopupMenu.prototype.zIndex+
-2;e.style.border="3px dotted rgb(254, 137, 12)";e.style.pointerEvents="none";e.style.position="absolute";e.style.top=b+"px";e.style.left=c+"px";e.style.width=Math.max(0,d-3)+"px";e.style.height=Math.max(0,f-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(e):document.body.appendChild(e);return e};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),
-d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){try{var d=c.target.result,f=a.name;if(null!=f&&0<f.length){!this.useCanvasForExport&&/(\.png)$/i.test(f)&&(f=f.substring(0,f.length-4)+".xml");var e=
-mxUtils.bind(this,function(a){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".xml":f+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,f))}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,f,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(f)||/(\.vs(x|sx?))($|\?)/i.test(f))this.importVisio(a,mxUtils.bind(this,
-function(a){this.spinner.stop();e(a)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(a){this.spinner.stop();e(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,f))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?e(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));
-else if(this.isLucidChartData(d))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".xml"),this.convertLucidChart(d,mxUtils.bind(this,function(a){this.spinner.stop();this.openLocalFile(a,f,b)}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,
-c.target.result,a.name))}catch(D){this.handleError(D,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,f,b)}}catch(D){this.handleError(D)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,
-b,c){var d=this.getCurrentFile(),f=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,c))});if(null!=a&&0<a.length)null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?f():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?
-this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):f()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=
-function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],c;for(c in a)b.push(c);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1,a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,f=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(f[mxConstants.STYLE_SHAPE]));
-d.model.isEdge(a)&&(c(mxMarker.getPackageForType(f[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(f[mxConstants.STYLE_ENDARROW])));for(var f=d.model.getChildCount(a),e=0;e<f;e++)this.addBasenamesForCell(d.model.getChildAt(a,e),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=
-a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden");a||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&&this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1),null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);
-(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));
-this.editor.undoManager.clear();this.editor.modified=null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=
-function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,bounds:b.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:b.view.scale,page:b.view.getBackgroundPageBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,f=null,e=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});
-this.editor.graph.model.addListener(mxEvent.CHANGE,e);mxEvent.addListener(window,"message",mxUtils.bind(this,function(e){if(e.source==(window.opener||window.parent)){var k=e.data,l=mxUtils.bind(this,function(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/png;base64,"==a.substring(0,22)?a=this.extractGraphModelFromPng(a):"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&
-("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=Graph.decompress(a)))}catch(M){}return a});if("json"==urlParams.proto){try{k=JSON.parse(k)}catch(K){k=null}if(null==k)return;if("dialog"==k.action){this.showError(null!=k.titleKey?mxResources.get(k.titleKey):k.title,null!=k.messageKey?mxResources.get(k.messageKey):k.message,null!=k.buttonKey?mxResources.get(k.buttonKey):k.button);null!=k.modified&&(this.editor.modified=k.modified);return}if("prompt"==k.action){this.spinner.stop();l=new FilenameDialog(this,
-k.defaultValue||"",null!=k.okKey?mxResources.get(k.okKey):null,function(a){null!=a&&g.postMessage(JSON.stringify({event:"prompt",value:a,message:k}),"*")},null!=k.titleKey?mxResources.get(k.titleKey):k.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==k.action){var p=l(k.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[k.name||this.defaultFilename]),p,mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",
-result:"edit",message:k}),"*")}),mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"discard",message:k}),"*")}),k.editKey?mxResources.get(k.editKey):null,k.discardKey?mxResources.get(k.discardKey):null,k.ignore?mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"ignore",message:k}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));
-try{l.init()}catch(K){g.postMessage(JSON.stringify({event:"draft",error:K.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();l=1==k.enableRecent;p=1==k.enableSearch;l=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=k.callback?g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,e,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,
-null,null,null,null,l?mxUtils.bind(this,function(a){this.remoteInvoke("getRecentDiagrams",null,null,a,function(){a(null,"Network Error!")})}):null,p?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):null,function(a,b,c){g.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("textContent"==
-k.action){l=this.getDiagramTextContent();g.postMessage(JSON.stringify({event:"textContent",data:l,message:k}),"*");return}if("status"==k.action){null!=k.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(k.messageKey))):null!=k.message&&this.editor.setStatus(mxUtils.htmlEntities(k.message));null!=k.modified&&(this.editor.modified=k.modified);return}if("spinner"==k.action){var m=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,
-m):this.spinner.stop();return}if("export"==k.action){if("png"==k.format||"xmlpng"==k.format){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var v=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var n=this.editor.graph,q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=k.format;b.message=k;b.data=a;b.xml=encodeURIComponent(v);
-g.postMessage(JSON.stringify(b),"*")}),t=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==k.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(Graph.compress(v))));n!=this.editor.graph&&n.container.parentNode.removeChild(n.container);q(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var n=this.createTemporaryGraph(n.getStylesheet()),u=n.getGlobalVariable,y=this.pages[0];n.getGlobalVariable=function(a){return"page"==a?y.getName():
-"pagenumber"==a?1:u.apply(this,arguments)};document.body.appendChild(n.container);n.model.setRoot(y.root)}this.exportToCanvas(mxUtils.bind(this,function(a){t(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){t(null)}),null,null,null,null,null,null,n)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(v)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+
-a.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);m=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=this.getFileData(null,null,!0,null,null,null,l),m.format=k.format;else if("html"==k.format)v=this.editor.getGraphXml(),m.data=this.getHtml(v,this.editor.graph),m.xml=mxUtils.getXml(v),m.format=
-k.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";if(k.embedImages||null==k.embedImages){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==k.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=
-this.createSvgDataUri(a);g.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=this.createSvgDataUri(l)}g.postMessage(JSON.stringify(m),"*")}return}if("load"==
-k.action)d=1==k.autosave,this.hideDialog(),null!=k.modified&&null==urlParams.modified&&(urlParams.modified=k.modified),null!=k.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=k.saveAndExit),null!=k.title&&null!=this.buttonContainer&&(p=document.createElement("span"),mxUtils.write(p,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px",this.buttonContainer.style.right="25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight=
-"38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(p),this.embedFilenameSpan=p),k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):k.xml;else{"remoteInvokeReady"==k.action?this.handleRemoteInvokeReady(g):"remoteInvoke"==k.action?this.handleRemoteInvoke(k):"remoteInvokeResponse"==k.action?this.handleRemoteInvokeResponse(k):g.postMessage(JSON.stringify({error:"unknownMessage",
-data:JSON.stringify(k)}),"*");return}}var z=mxUtils.bind(this,function(e,k){c=!0;try{a(e,k)}catch(O){this.handleError(O)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var l=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});f=l();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=l();if(d!=f&&!c){var e=this.createLoadMessage("autosave");e.xml=d;d=JSON.stringify(e);(window.opener||
-window.parent).postMessage(d,"*")}f=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",
-b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")});null!=k&&"function"===typeof k.substring&&"data:application/vnd.visio;base64,"==k.substring(0,34)?(l="0M8R4KGxGuE"==k.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(k.substring(k.indexOf(",")+1)),function(a){z(a,e)},mxUtils.bind(this,function(a){this.handleError(a)}),l)):null!=k&&"function"===typeof k.substring&&
-!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(k,"")?this.parseFile(new Blob([k],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&z(a.responseText,e)}),""):null!=k&&"function"===typeof k.substring&&this.isLucidChartData(k)?this.convertLucidChart(k,mxUtils.bind(this,function(a){z(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(k=l(k),z(k,e))}}));var g=
-window.opener||window.parent,e="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(e,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",
-mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding=
-"4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);
-this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=
-function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,g=null,k=null,l=null,m="",n="auto",q="auto",A=null,E=null,I=40,C=40,G=100,H=0,B=this.editor.graph;B.getGraphBounds();for(var K=function(){null!=b?b(ca):(B.setSelectionCells(ca),B.scrollCellToVisible(B.getSelectionCell()))},M=B.getFreeInsertPoint(),Q=M.x,O=M.y,M=O,T=null,U="auto",l=null,W=[],Y=null,fa=null,N=0;N<c.length&&"#"==c[N].charAt(0);){a=c[N];for(N++;N<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[N].charAt(0);)a=a.substring(0,
-a.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=a.charAt(1)){var Z=a.indexOf(":");if(0<Z){var P=mxUtils.trim(a.substring(1,Z)),R=mxUtils.trim(a.substring(Z+1));"label"==P?T=B.sanitizeHtml(R):"style"==P?f=R:"parentstyle"==P?g=R:"identity"==P&&0<R.length&&"-"!=R?k=R:"parent"==P&&0<R.length&&"-"!=R?l=R:"namespace"==P&&0<R.length&&"-"!=R?m=R:"width"==P?n=R:"height"==P?q=R:"left"==P&&0<R.length?A=R:"top"==P&&0<R.length?E=R:"ignore"==P?fa=R.split(","):"connect"==P?W.push(JSON.parse(R)):"link"==
-P?Y=R:"padding"==P?H=parseFloat(R):"edgespacing"==P?I=parseFloat(R):"nodespacing"==P?C=parseFloat(R):"levelspacing"==P?G=parseFloat(R):"layout"==P&&(U=R)}}}var aa=this.editor.csvToArray(c[N]),P=Z=null;if(null!=k||null!=l)for(var V=0;V<aa.length;V++)k==aa[V]&&(Z=V),l==aa[V]&&(P=V);null==T&&(T="%"+aa[0]+"%");if(null!=W)for(var S=0;S<W.length;S++)null==e[W[S].to]&&(e[W[S].to]={});B.model.beginUpdate();try{for(V=N+1;V<c.length;V++){var ba=this.editor.csvToArray(c[V]);if(null==ba){var ga=40<c[V].length?
-c[V].substring(0,40)+"...":c[V];throw Error(V+" ("+ga+") "+mxResources.get("containsValidationErrors"));}if(ba.length==aa.length){var L=null,ea=null!=Z?m+ba[Z]:null;null!=ea&&(L=B.model.getCell(ea));null==L&&(L=new mxCell(T,new mxGeometry(Q,M,0,0),f||"whiteSpace=wrap;html=1;"),L.vertex=!0,L.id=ea);for(var X=0;X<ba.length;X++)B.setAttributeForCell(L,aa[X],ba[X]);B.setAttributeForCell(L,"placeholders","1");L.style=B.replacePlaceholders(L,L.style);for(S=0;S<W.length;S++)e[W[S].to][L.getAttribute(W[S].to)]=
+c?(f=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,f)&&(a=Graph.bytesToString(pako.inflateRaw(a.substring(f+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(u){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){try{var d=new Image;d.onload=
+function(){b(d)};null!=c&&(d.onerror=c);d.src=a}catch(u){if(null!=c)c(u);else throw u;}};var l=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(b){return a.getLinkTitle(b)};b.customLinkClicked=function(b){var c=!1;try{a.handleCustomLink(b),c=!0}catch(B){a.handleError(B)}return c};
+var c=this.clearDefaultStyle;this.clearDefaultStyle=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.pages.length;c++)if(a.pages[c]==a.currentPage){0<c&&(b+=(0<b.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&
+(b+=(0<b.length?"&":"?")+"dev=1&drawdev=1");return d.apply(this,arguments)};var e=b.addClickHandler;b.addClickHandler=function(a,c,d){var f=c;c=function(a,c){if(null==c){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(c=d.getAttribute("href"))}null!=c&&b.isCustomLink(c)&&(mxEvent.isTouchEvent(a)||!mxEvent.isPopupTrigger(a))&&b.customLinkClicked(c)&&mxEvent.consume(a);null!=f&&f(a,c)};e.call(this,a,c,d)};l.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(b.view.canvas.ownerSVGElement,
+null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,360,null!=a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var g=b.getGlobalVariable;b.getGlobalVariable=function(b){return"page"==b&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==b?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:g.apply(this,arguments)};var m=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var f=
+c.getAttribute("href");if(null==f||!b.isCustomLink(f)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))m.apply(this,arguments);else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(f),b.getRubberband().reset();mxEvent.consume(d)}};this.editor.getOrCreateFilename=function(){var b=a.defaultFilename,c=a.getCurrentFile();null!=c&&(b=null!=c.getTitle()?c.getTitle():b);return b};var v=this.actions.get("print");v.setEnabled(!mxClient.IS_IOS||!navigator.standalone);v.visible=v.isEnabled();
+if(!this.editor.chromeless||this.editor.editable){var n=function(){window.setTimeout(function(){q.innerHTML="&nbsp;";q.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,
+"insertEllipse",!0);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(this.altShiftActions[83]="synchronize");mxClient.IS_IE||b.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,f=0;f<c.types.length;f++)if("text/"===c.types[f].substring(0,5)){d=!0;break}if(!d){var e=c.items;for(index in e){var g=e[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],
+0,0,this.maxImageSize,function(a,c,d,f,e,g){b.insertImage(a,e,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var k=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],k.x,k.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(U){}}),!1);var q=document.createElement("div");q.style.position="absolute";q.style.whiteSpace="nowrap";q.style.overflow="hidden";q.style.display="block";q.contentEditable=!0;mxUtils.setOpacity(q,
+0);q.style.width="1px";q.style.height="1px";q.innerHTML="&nbsp;";var J=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||
+J||(q.style.left=b.container.scrollLeft+10+"px",q.style.top=b.container.scrollTop+10+"px",b.container.appendChild(q),J=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){q.focus();document.execCommand("selectAll",!1,null)},0):(q.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!J||224!=c&&17!=c&&91!=c||(J=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),
+q.parentNode.removeChild(q),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(q,"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(q),n())}));mxEvent.addListener(q,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(q,!0),n())}));mxEvent.addListener(q,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(q.innerHTML="&nbsp;",q.focus(),window.setTimeout(mxUtils.bind(this,
+function(){this.pasteCells(a,q);q.innerHTML="&nbsp;"}),0))}),!0);var F=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==q?!0:F.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&
+(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,
+this.maxImageSize,function(a,c,d,f,e,g){b.insertImage(a,e,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var f=this.maxImageSize,f=Math.min(1,
+Math.min(f/Math.max(1,d)),f/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*f,a*f)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==
+typeof mxRuler){v=document.createElement("div");v.style.position="absolute";v.style.top="95px";v.style.left="250px";v.style.width="2000px";v.style.height="30px";v.style.background="whiteSmoke";document.body.appendChild(v);var A=document.createElement("div");A.style.position="absolute";A.style.top="125px";A.style.left="220px";A.style.width="30px";A.style.height="1000px";A.style.background="whiteSmoke";document.body.appendChild(A);var E=document.createElement("div");E.style.position="absolute";E.style.top=
+"95px";E.style.left="220px";E.style.width="30px";E.style.height="30px";E.style.background="whiteSmoke";document.body.appendChild(E);this.vRuler=new mxRuler(this.editor.graph,A,!0);this.hRuler=new mxRuler(this.editor.graph,v,!1)}if("1"==urlParams.styledev){v=document.getElementById("geFooter");null!=v&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",
+this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),v.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),
+c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var I=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:I.apply(this,arguments)}}v=document.getElementById("geInfo");null!=v&&v.parentNode.removeChild(v);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var C=null;mxEvent.addListener(b.container,"dragleave",
+function(a){b.isEnabled()&&(null!=C&&(C.parentNode.removeChild(C),C=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==C&&(!mxClient.IS_IE||10<document.documentMode)&&(C=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=C&&(C.parentNode.removeChild(C),C=null);if(b.isEnabled()){var c=
+mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,f=b.view.scale,e=c.x/f-d.x,g=c.y/f-d.y;mxEvent.isAltDown(a)&&(g=e=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,e,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var k=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(a,null!=this.pages);
+if(null!=c)b.setSelectionCells(this.importXml(c,e,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var l=a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=l;var p=null,d=c.getElementsByTagName("img");null!=d&&1==d.length?(l=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)||(p=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(l=c[0].getAttribute("href")));var v=!0,m=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(l,
+e,g,!0,p,null,v))});p&&l.length>this.resampleThreshold?this.confirmImageResize(function(a){v=a;m()},mxEvent.isControlDown(a)):m()}else null!=k&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)?this.loadImage(decodeURIComponent(k),mxUtils.bind(this,function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",e,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
+k+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(k,e,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),e,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();this.editUpdateListener=mxUtils.bind(this,function(a,b){var c=b.getProperty("edit");null!=c&&this.updateEditReferences(c)});this.editor.undoManager.addListener(mxEvent.BEFORE_UNDO,this.editUpdateListener);this.editor.undoManager.addListener(mxEvent.BEFORE_REDO,
+this.editUpdateListener);"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(a){var b=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");0<c&&(b=this.getPageById(a.substring(c+1)),b=null!=b?b.getName():mxResources.get("pageNotFound"))}else"data:"==a.substring(0,5)&&(b=mxResources.get("action"));return b};EditorUi.prototype.handleCustomLink=function(a){if("data:page/id,"==a.substring(0,
+13)){var b=a.indexOf(",");if(a=this.getPageById(a.substring(b+1)))this.selectPage(a);else throw Error(mxResources.get("pageNotFound")||"Page not found");}else this.editor.graph.handleCustomLink(a)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.fireEvent(new mxEventObject("styleChanged",
+"keys",[],"values",[],"cells",[]));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);
+mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",
+mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),
+f=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(f));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=f,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&
+(this.convertLucidChart(d,mxUtils.bind(this,function(a){var b=this.editor.graph;b.setSelectionCells(this.importXml(a,0,0));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,function(a){this.handleError(a)})),mxEvent.consume(a))}else{var d=this.editor.graph,f=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),e=!1;try{var g=f.lastIndexOf("%3E");0<=g&&g<f.length-3&&(f=f.substring(0,g+3))}catch(x){}try{var c=b.getElementsByTagName("span"),
+k=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(f);this.isCompatibleString(k)&&(e=!0,f=k)}catch(x){}d.lastPasteXml==f?d.pasteCounter++:(d.lastPasteXml=f,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=f&&0<f.length&&(e||this.isCompatibleString(f)?d.setSelectionCells(this.importXml(f,c,c)):(e=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==f&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(f,e.x+c,e.y+c,!0))),
+!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(x){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||
+"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&
+!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),
+0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&
+(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,f;if(null==a){f=document.body;var e=document.documentElement;d=(f.clientWidth||e.clientWidth)-3;f=Math.max(f.clientHeight||0,e.clientHeight)-
+3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,f=a.clientHeight;e=document.createElement("div");e.style.zIndex=mxPopupMenu.prototype.zIndex+2;e.style.border="3px dotted rgb(254, 137, 12)";e.style.pointerEvents="none";e.style.position="absolute";e.style.top=b+"px";e.style.left=c+"px";e.style.width=Math.max(0,d-3)+"px";e.style.height=Math.max(0,f-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(e):document.body.appendChild(e);return e};EditorUi.prototype.stringToCells=
+function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){try{var d=
+c.target.result,f=a.name;if(null!=f&&0<f.length){!this.useCanvasForExport&&/(\.png)$/i.test(f)&&(f=f.substring(0,f.length-4)+".xml");var e=mxUtils.bind(this,function(a){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".xml":f+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,f))}catch(J){this.handleError(J,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,
+f,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(f)||/(\.vs(x|sx?))($|\?)/i.test(f))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();e(a)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(a){this.spinner.stop();e(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,f))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?e(a.responseText):this.handleError({message:mxResources.get(413==
+a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(d))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".xml"),this.convertLucidChart(d,mxUtils.bind(this,function(a){this.spinner.stop();this.openLocalFile(a,f,b)}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,
+this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,c.target.result,a.name))}catch(D){this.handleError(D,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,f,b)}}catch(D){this.handleError(D)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):
+c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,b,c){var d=this.getCurrentFile(),f=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,c))});if(null!=a&&0<a.length)null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?f():
+(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):f()})));else throw Error(mxResources.get("notADiagramFile"));
+};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],c;for(c in a)b.push(c);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1,a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,f=d.getCellStyle(a);
+c(mxStencilRegistry.getBasenameForStencil(f[mxConstants.STYLE_SHAPE]));d.model.isEdge(a)&&(c(mxMarker.getPackageForType(f[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(f[mxConstants.STYLE_ENDARROW])));for(var f=d.model.getChildCount(a),e=0;e<f;e++)this.addBasenamesForCell(d.model.getChildAt(a,e),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=
+a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden");a||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&&this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1),null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};
+EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&
+this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};
+EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,bounds:b.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:b.view.scale,page:b.view.getBackgroundPageBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,f=null,e=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?
+null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,e);mxEvent.addListener(window,"message",mxUtils.bind(this,function(e){if(e.source==(window.opener||window.parent)){var k=e.data,l=mxUtils.bind(this,function(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/png;base64,"==a.substring(0,22)?a=this.extractGraphModelFromPng(a):"data:image/svg+xml;base64,"==
+a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=Graph.decompress(a)))}catch(M){}return a});if("json"==urlParams.proto){try{k=JSON.parse(k)}catch(K){k=null}if(null==k)return;if("dialog"==k.action){this.showError(null!=k.titleKey?mxResources.get(k.titleKey):k.title,null!=k.messageKey?mxResources.get(k.messageKey):k.message,null!=k.buttonKey?mxResources.get(k.buttonKey):
+k.button);null!=k.modified&&(this.editor.modified=k.modified);return}if("prompt"==k.action){this.spinner.stop();l=new FilenameDialog(this,k.defaultValue||"",null!=k.okKey?mxResources.get(k.okKey):null,function(a){null!=a&&g.postMessage(JSON.stringify({event:"prompt",value:a,message:k}),"*")},null!=k.titleKey?mxResources.get(k.titleKey):k.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==k.action){var p=l(k.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",
+[k.name||this.defaultFilename]),p,mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"edit",message:k}),"*")}),mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"discard",message:k}),"*")}),k.editKey?mxResources.get(k.editKey):null,k.discardKey?mxResources.get(k.discardKey):null,k.ignore?mxUtils.bind(this,function(){this.hideDialog();g.postMessage(JSON.stringify({event:"draft",result:"ignore",message:k}),
+"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(K){g.postMessage(JSON.stringify({event:"draft",error:K.toString(),message:k}),"*")}return}if("template"==k.action){this.spinner.stop();l=1==k.enableRecent;p=1==k.enableSearch;l=new NewDialog(this,!1,null!=k.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=k.callback?g.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,
+name:c}),"*"):(a(b,e,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.remoteInvoke("getRecentDiagrams",null,null,a,function(){a(null,"Network Error!")})}):null,p?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):null,function(a,b,c){g.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(l.container,
+620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("textContent"==k.action){l=this.getDiagramTextContent();g.postMessage(JSON.stringify({event:"textContent",data:l,message:k}),"*");return}if("status"==k.action){null!=k.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(k.messageKey))):null!=k.message&&this.editor.setStatus(mxUtils.htmlEntities(k.message));null!=k.modified&&(this.editor.modified=k.modified);return}if("spinner"==
+k.action){var m=null!=k.messageKey?mxResources.get(k.messageKey):k.message;null==k.show||k.show?this.spinner.spin(document.body,m):this.spinner.stop();return}if("export"==k.action){if("png"==k.format||"xmlpng"==k.format){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin)){var v=null!=k.xml?k.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var n=this.editor.graph,q=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);
+this.spinner.stop();var b=this.createLoadMessage("export");b.format=k.format;b.message=k;b.data=a;b.xml=encodeURIComponent(v);g.postMessage(JSON.stringify(b),"*")}),t=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==k.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(Graph.compress(v))));n!=this.editor.graph&&n.container.parentNode.removeChild(n.container);q(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var n=this.createTemporaryGraph(n.getStylesheet()),
+u=n.getGlobalVariable,y=this.pages[0];n.getGlobalVariable=function(a){return"page"==a?y.getName():"pagenumber"==a?1:u.apply(this,arguments)};document.body.appendChild(n.container);n.model.setRoot(y.root)}this.exportToCanvas(mxUtils.bind(this,function(a){t(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){t(null)}),null,null,null,null,null,null,n)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==k.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(v)))).send(mxUtils.bind(this,
+function(a){200<=a.getStatus()&&299>=a.getStatus()?q("data:image/png;base64,"+a.getText()):t(null)}),mxUtils.bind(this,function(){t(null)}))}}else{null!=k.xml&&0<k.xml.length&&this.setFileData(k.xml);m=this.createLoadMessage("export");if("html2"==k.format||"html"==k.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),m.xml=mxUtils.getXml(l),m.data=this.getFileData(null,null,!0,null,null,null,l),m.format=k.format;else if("html"==k.format)v=this.editor.getGraphXml(),
+m.data=this.getHtml(v,this.editor.graph),m.xml=mxUtils.getXml(v),m.format=k.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);m.xml=this.getFileData(!0);m.format="svg";if(k.embedImages||null==k.embedImages){if(null==k.spin&&null==k.spinKey||this.spinner.spin(document.body,null!=k.spinKey?mxResources.get(k.spinKey):k.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==k.format?this.getEmbeddedSvg(m.xml,this.editor.graph,null,!0,mxUtils.bind(this,
+function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(a);g.postMessage(JSON.stringify(m),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();m.data=this.createSvgDataUri(mxUtils.getXml(a));g.postMessage(JSON.stringify(m),"*")}));return}l="xmlsvg"==k.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));m.data=
+this.createSvgDataUri(l)}g.postMessage(JSON.stringify(m),"*")}return}if("load"==k.action)d=1==k.autosave,this.hideDialog(),null!=k.modified&&null==urlParams.modified&&(urlParams.modified=k.modified),null!=k.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=k.saveAndExit),null!=k.title&&null!=this.buttonContainer&&(p=document.createElement("span"),mxUtils.write(p,k.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px",this.buttonContainer.style.right=
+"25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(p),this.embedFilenameSpan=p),k=null!=k.xmlpng?this.extractGraphModelFromPng(k.xmlpng):k.xml;else{"remoteInvokeReady"==k.action?this.handleRemoteInvokeReady(g):"remoteInvoke"==k.action?this.handleRemoteInvoke(k):"remoteInvokeResponse"==k.action?this.handleRemoteInvokeResponse(k):
+g.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(k)}),"*");return}}var z=mxUtils.bind(this,function(e,k){c=!0;try{a(e,k)}catch(O){this.handleError(O)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var l=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});f=l();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=l();if(d!=f&&!c){var e=this.createLoadMessage("autosave");
+e.xml=d;d=JSON.stringify(e);(window.opener||window.parent).postMessage(d,"*")}f=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",
+b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||g.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")});null!=k&&"function"===typeof k.substring&&"data:application/vnd.visio;base64,"==k.substring(0,34)?(l="0M8R4KGxGuE"==k.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(k.substring(k.indexOf(",")+1)),function(a){z(a,e)},mxUtils.bind(this,function(a){this.handleError(a)}),
+l)):null!=k&&"function"===typeof k.substring&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(k,"")?this.parseFile(new Blob([k],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&z(a.responseText,e)}),""):null!=k&&"function"===typeof k.substring&&this.isLucidChartData(k)?this.convertLucidChart(k,mxUtils.bind(this,function(a){z(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):
+(k=l(k),z(k,e))}}));var g=window.opener||window.parent,e="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";g.postMessage(e,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));
+b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft=
+"6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));
+a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};
+EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var e={},f=null,g=null,k=null,l=null,m="",n="auto",q="auto",A=null,E=null,I=40,C=40,G=100,H=0,B=this.editor.graph;B.getGraphBounds();for(var K=function(){null!=b?b(ca):(B.setSelectionCells(ca),B.scrollCellToVisible(B.getSelectionCell()))},M=B.getFreeInsertPoint(),Q=M.x,O=M.y,M=O,T=null,U="auto",l=null,W=[],Y=null,fa=null,N=0;N<c.length&&"#"==c[N].charAt(0);){a=c[N];for(N++;N<c.length&&"\\"==a.charAt(a.length-1)&&
+"#"==c[N].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[N].substring(1)),N++;if("#"!=a.charAt(1)){var Z=a.indexOf(":");if(0<Z){var P=mxUtils.trim(a.substring(1,Z)),R=mxUtils.trim(a.substring(Z+1));"label"==P?T=B.sanitizeHtml(R):"style"==P?f=R:"parentstyle"==P?g=R:"identity"==P&&0<R.length&&"-"!=R?k=R:"parent"==P&&0<R.length&&"-"!=R?l=R:"namespace"==P&&0<R.length&&"-"!=R?m=R:"width"==P?n=R:"height"==P?q=R:"left"==P&&0<R.length?A=R:"top"==P&&0<R.length?E=R:"ignore"==P?fa=R.split(","):"connect"==
+P?W.push(JSON.parse(R)):"link"==P?Y=R:"padding"==P?H=parseFloat(R):"edgespacing"==P?I=parseFloat(R):"nodespacing"==P?C=parseFloat(R):"levelspacing"==P?G=parseFloat(R):"layout"==P&&(U=R)}}}var aa=this.editor.csvToArray(c[N]),P=Z=null;if(null!=k||null!=l)for(var V=0;V<aa.length;V++)k==aa[V]&&(Z=V),l==aa[V]&&(P=V);null==T&&(T="%"+aa[0]+"%");if(null!=W)for(var S=0;S<W.length;S++)null==e[W[S].to]&&(e[W[S].to]={});B.model.beginUpdate();try{for(V=N+1;V<c.length;V++){var ba=this.editor.csvToArray(c[V]);if(null==
+ba){var ga=40<c[V].length?c[V].substring(0,40)+"...":c[V];throw Error(V+" ("+ga+") "+mxResources.get("containsValidationErrors"));}if(ba.length==aa.length){var L=null,ea=null!=Z?m+ba[Z]:null;null!=ea&&(L=B.model.getCell(ea));null==L&&(L=new mxCell(T,new mxGeometry(Q,M,0,0),f||"whiteSpace=wrap;html=1;"),L.vertex=!0,L.id=ea);for(var X=0;X<ba.length;X++)B.setAttributeForCell(L,aa[X],ba[X]);B.setAttributeForCell(L,"placeholders","1");L.style=B.replacePlaceholders(L,L.style);for(S=0;S<W.length;S++)e[W[S].to][L.getAttribute(W[S].to)]=
L;null!=Y&&"link"!=Y&&(B.setLinkForCell(L,L.getAttribute(Y)),B.setAttributeForCell(L,Y,null));B.fireEvent(new mxEventObject("cellsInserted","cells",[L]));var ia=this.editor.graph.getPreferredSizeForCell(L);L.vertex&&(null!=A&&null!=L.getAttribute(A)&&(L.geometry.x=Q+parseFloat(L.getAttribute(A))),null!=E&&null!=L.getAttribute(E)&&(L.geometry.y=O+parseFloat(L.getAttribute(E))),"@"==n.charAt(0)&&null!=L.getAttribute(n.substring(1))?L.geometry.width=parseFloat(L.getAttribute(n.substring(1))):L.geometry.width=
"auto"==n?ia.width+H:parseFloat(n),"@"==q.charAt(0)&&null!=L.getAttribute(q.substring(1))?L.geometry.height=parseFloat(L.getAttribute(q.substring(1))):L.geometry.height="auto"==q?ia.height+H:parseFloat(q),M+=L.geometry.height+C);l=null!=P?B.model.getCell(m+ba[P]):null;null!=l?(l.style=B.replacePlaceholders(l,g),B.addCell(L,l)):d.push(B.addCell(L))}}for(var ha=d.slice(),ca=d.slice(),S=0;S<W.length;S++)for(var da=W[S],V=0;V<d.length;V++){var L=d[V],qa=L.getAttribute(da.from);if(null!=qa){B.setAttributeForCell(L,
da.from,null);for(var pa=qa.split(","),X=0;X<pa.length;X++){var ja=e[da.to][pa[X]];null!=ja&&(T=da.label,null!=da.fromlabel&&(T=(L.getAttribute(da.fromlabel)||"")+(T||"")),null!=da.tolabel&&(T=(T||"")+(ja.getAttribute(da.tolabel)||"")),ca.push(B.insertEdge(null,null,T||"",da.invert?ja:L,da.invert?L:ja,da.style||B.createCurrentEdgeStyle())),mxUtils.remove(da.invert?L:ja,ha))}}}if(null!=fa)for(V=0;V<d.length;V++)for(L=d[V],X=0;X<fa.length;X++)B.setAttributeForCell(L,mxUtils.trim(fa[X]),null);var ma=
@@ -8594,22 +8595,22 @@ DrawioFileSync.prototype.resetUpdateStatusThread=function(){null!=this.updateSta
DrawioFileSync.prototype.handleMessageData=function(a){"desc"==a.a?this.file.savingFile||this.reloadDescriptor():"join"==a.a||"leave"==a.a?("join"==a.a&&this.file.stats.joined++,null!=a.name&&(this.lastMessage=mxResources.get("join"==a.a?"userJoined":"userLeft",[a.name]),this.resetUpdateStatusThread(),this.updateStatus())):null!=a.m&&(a=new Date(a.m),null==this.lastMessageModified||this.lastMessageModified<a)&&(this.lastMessageModified=a,this.fileChangedNotify())};
DrawioFileSync.prototype.isValidState=function(){return this.ui.getCurrentFile()==this.file&&this.file.sync==this&&!this.file.invalidChecksum&&!this.file.redirectDialogShowing};
DrawioFileSync.prototype.fileChangedNotify=function(){if(this.isValidState())if(this.file.savingFile)this.remoteFileChanged=!0;else var a=this.fileChanged(mxUtils.bind(this,function(a){this.updateStatus()}),mxUtils.bind(this,function(a){this.file.handleFileError(a)}),mxUtils.bind(this,function(){return!this.file.savingFile&&this.notifyThread!=a}))};
-DrawioFileSync.prototype.fileChanged=function(a,c,b){var d=window.setTimeout(mxUtils.bind(this,function(){null!=b&&b()||(this.isValidState()?this.file.loadPatchDescriptor(mxUtils.bind(this,function(d){null!=b&&b()||(this.isValidState()?this.catchup(this.file.getDescriptorEtag(d),this.file.getDescriptorSecret(d),a,c,b):null!=c&&c())}),c):null!=c&&c())}),0);return this.notifyThread=d};
+DrawioFileSync.prototype.fileChanged=function(a,c,b){var d=window.setTimeout(mxUtils.bind(this,function(){null!=b&&b()||(this.isValidState()?this.file.loadPatchDescriptor(mxUtils.bind(this,function(d){null!=b&&b()||(this.isValidState()?this.catchup(d,a,c,b):null!=c&&c())}),c):null!=c&&c())}),0);return this.notifyThread=d};
DrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mxUtils.bind(this,function(a){null!=a?(this.file.setDescriptorEtag(a,this.file.getCurrentEtag()),this.updateDescriptor(a),this.fileChangedNotify()):(this.file.inConflictState=!0,this.file.handleFileError())}),mxUtils.bind(this,function(a){this.file.inConflictState=!0;this.file.handleFileError(a)}))};DrawioFileSync.prototype.updateDescriptor=function(a){this.file.setDescriptor(a);this.file.descriptorChanged();this.start()};
-DrawioFileSync.prototype.catchup=function(a,c,b,d,e){if(null==e||!e()){var g=this.file.getCurrentEtag();if(g==a)null!=b&&b();else if(this.isValidState()){var l=0,m=!1,n=mxUtils.bind(this,function(){if(null==e||!e())if(g!=this.file.getCurrentEtag())null!=b&&b();else if(this.isValidState()){var q=!0,f=window.setTimeout(mxUtils.bind(this,function(){q=!1;this.reload(b,d,e)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(g)+"&to="+
-encodeURIComponent(a)+(null!=c?"&secret="+encodeURIComponent(c):""),mxUtils.bind(this,function(c){this.file.stats.bytesReceived+=c.getText().length;window.clearTimeout(f);if(q&&(null==e||!e()))if(g!=this.file.getCurrentEtag())null!=b&&b();else if(this.isValidState()){var k=null,t=[];if(200<=c.getStatus()&&299>=c.getStatus()&&0<c.getText().length)try{var u=JSON.parse(c.getText());if(null!=u&&0<u.length)for(var y=0;y<u.length;y++){var z=this.stringToObject(u[y]);if(z.v>DrawioFileSync.PROTOCOL){m=!0;
-t=[];break}else if(z.v===DrawioFileSync.PROTOCOL&&null!=z.d)k=z.d.checksum,t.push(z.d.patch);else{m=!0;t=[];break}}}catch(v){t=[],null!=window.console&&"1"==urlParams.test&&console.log(v)}try{0<t.length?(this.file.stats.cacheHits++,this.merge(t,k,a,b,d,e)):l<=this.maxCacheReadyRetries&&!m&&401!=c.getStatus()?(l++,this.file.stats.cacheMiss++,window.setTimeout(n,(l+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(b,d,e))}catch(v){null!=d&&d(v)}}else null!=d&&d()}))}else null!=d&&d()});
-window.setTimeout(n,this.cacheReadyDelay)}else null!=d&&d()}};DrawioFileSync.prototype.reload=function(a,c,b,d){this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=a&&a()}),mxUtils.bind(this,function(a){null!=c&&c(a)}),b,d)};
-DrawioFileSync.prototype.merge=function(a,c,b,d,e,g){try{this.file.stats.merged++;this.lastModified=new Date;this.file.shadowPages=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);this.file.backupPatch=this.file.isModified()?this.ui.diffPages(this.file.shadowPages,this.ui.pages):null;if(!this.file.ignorePatches(a)){for(g=0;g<a.length;g++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages,a[g]);var l=null!=
-c?this.ui.getHashValueForPages(this.file.shadowPages):null;"1"==urlParams.test&&EditorUi.debug("Sync.merge",[this],"from",this.file.getCurrentEtag(),"to",b,"backup",this.file.backupPatch,"attempt",this.catchupRetryCount,"patches",a,"checksum",c==l,c);if(null!=c&&c!=l){var m=this.ui.hashValue(this.file.getCurrentEtag()),n=this.ui.hashValue(b);this.file.checksumError(e,a,"From: "+m+"\nTo: "+n+"\nChecksum: "+c+"\nCurrent: "+l,b,"merge");return}this.file.patch(a,DrawioFile.LAST_WRITE_WINS?this.file.backupPatch:
-null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.setCurrentEtag(b);this.file.backupPatch=null;null!=d&&d()}catch(k){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=e&&e(k);try{if(this.file.errorReportsEnabled)m=this.ui.hashValue(this.file.getCurrentEtag()),n=this.ui.hashValue(b),this.file.sendErrorReport("Error in merge","From: "+m+"\nTo: "+n+"\nChecksum: "+c+"\nPatches:\n"+this.file.compressReportData(JSON.stringify(a,null,2)),
-k);else{var q=this.file.getCurrentUser(),f=null!=q?q.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),f,k)}}catch(p){}}};
+DrawioFileSync.prototype.catchup=function(a,c,b,d){if(null==d||!d()){var e=this.file.getDescriptorSecret(a),g=this.file.getDescriptorEtag(a),l=this.file.getCurrentEtag();if(l==g)null!=c&&c();else if(this.isValidState()){var m=0,n=!1,q=mxUtils.bind(this,function(){if(null==d||!d())if(l!=this.file.getCurrentEtag())null!=c&&c();else if(this.isValidState()){var f=!0,k=window.setTimeout(mxUtils.bind(this,function(){f=!1;this.reload(c,b,d)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+
+"&from="+encodeURIComponent(l)+"&to="+encodeURIComponent(g)+(null!=e?"&secret="+encodeURIComponent(e):""),mxUtils.bind(this,function(e){this.file.stats.bytesReceived+=e.getText().length;window.clearTimeout(k);if(f&&(null==d||!d()))if(l!=this.file.getCurrentEtag())null!=c&&c();else if(this.isValidState()){var g=null,p=[];if(200<=e.getStatus()&&299>=e.getStatus()&&0<e.getText().length)try{var y=JSON.parse(e.getText());if(null!=y&&0<y.length)for(var z=0;z<y.length;z++){var v=this.stringToObject(y[z]);
+if(v.v>DrawioFileSync.PROTOCOL){n=!0;p=[];break}else if(v.v===DrawioFileSync.PROTOCOL&&null!=v.d)g=v.d.checksum,p.push(v.d.patch);else{n=!0;p=[];break}}}catch(x){p=[],null!=window.console&&"1"==urlParams.test&&console.log(x)}try{0<p.length?(this.file.stats.cacheHits++,this.merge(p,g,a,c,b,d)):m<=this.maxCacheReadyRetries&&!n&&401!=e.getStatus()?(m++,this.file.stats.cacheMiss++,window.setTimeout(q,(m+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(c,b,d))}catch(x){null!=b&&b(x)}}else null!=
+b&&b()}))}else null!=b&&b()});window.setTimeout(q,this.cacheReadyDelay)}else null!=b&&b()}};DrawioFileSync.prototype.reload=function(a,c,b,d){this.file.updateFile(mxUtils.bind(this,function(){this.lastModified=this.file.getLastModifiedDate();this.updateStatus();this.start();null!=a&&a()}),mxUtils.bind(this,function(a){null!=c&&c(a)}),b,d)};
+DrawioFileSync.prototype.merge=function(a,c,b,d,e,g){try{this.file.stats.merged++;this.lastModified=new Date;this.file.shadowPages=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);this.file.backupPatch=this.file.isModified()?this.ui.diffPages(this.file.shadowPages,this.ui.pages):null;var l=this.file.ignorePatches(a),m=this.file.getDescriptorEtag(b);if(!l){for(g=0;g<a.length;g++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages,
+a[g]);var n=null!=c?this.ui.getHashValueForPages(this.file.shadowPages):null;"1"==urlParams.test&&EditorUi.debug("Sync.merge",[this],"from",this.file.getCurrentEtag(),"to",m,"backup",this.file.backupPatch,"attempt",this.catchupRetryCount,"patches",a,"checksum",c==n,c);if(null!=c&&c!=n){var q=this.ui.hashValue(this.file.getCurrentEtag()),f=this.ui.hashValue(m);this.file.checksumError(e,a,"From: "+q+"\nTo: "+f+"\nChecksum: "+c+"\nCurrent: "+n,m,"merge");return}this.file.patch(a,DrawioFile.LAST_WRITE_WINS?
+this.file.backupPatch:null)}this.file.invalidChecksum=!1;this.file.inConflictState=!1;this.file.patchDescriptor(this.file.getDescriptor(),b);this.file.backupPatch=null;null!=d&&d()}catch(t){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=e&&e(t);try{if(this.file.errorReportsEnabled)q=this.ui.hashValue(this.file.getCurrentEtag()),f=this.ui.hashValue(m),this.file.sendErrorReport("Error in merge","From: "+q+"\nTo: "+f+"\nChecksum: "+c+"\nPatches:\n"+this.file.compressReportData(JSON.stringify(a,
+null,2)),t);else{var k=this.file.getCurrentUser(),p=null!=k?k.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),p,t)}}catch(u){}}};
DrawioFileSync.prototype.descriptorChanged=function(a){this.lastModified=this.file.getLastModifiedDate();if(null!=this.channelId){var c=this.objectToString(this.createMessage({a:"desc",m:this.lastModified.getTime()})),b=this.file.getCurrentEtag(),d=this.objectToString({});mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(a)+"&to="+encodeURIComponent(b)+"&msg="+encodeURIComponent(c)+"&data="+encodeURIComponent(d));this.file.stats.bytesSent+=d.length;this.file.stats.msgSent++}this.updateStatus()};
DrawioFileSync.prototype.objectToString=function(a){a=Graph.compress(JSON.stringify(a));null!=this.key&&"undefined"!==typeof CryptoJS&&(a=CryptoJS.AES.encrypt(a,this.key).toString());return a};DrawioFileSync.prototype.stringToObject=function(a){null!=this.key&&"undefined"!==typeof CryptoJS&&(a=CryptoJS.AES.decrypt(a,this.key).toString(CryptoJS.enc.Utf8));return JSON.parse(Graph.decompress(a))};
DrawioFileSync.prototype.fileSaved=function(a,c,b,d){this.lastModified=this.file.getLastModifiedDate();this.resetUpdateStatusThread();this.catchupRetryCount=0;if(!this.ui.isOffline()&&!this.file.inConflictState&&!this.file.redirectDialogShowing&&(this.start(),null!=this.channelId)){var e=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);d=this.ui.getHashValueForPages(a);e=this.ui.diffPages(e,a);c=this.file.getDescriptorEtag(c);
var g=this.file.getCurrentEtag(),l=this.objectToString(this.createMessage({patch:e,checksum:d})),m=this.objectToString(this.createMessage({m:this.lastModified.getTime()})),n=this.file.getDescriptorSecret(this.file.getDescriptor());this.file.stats.bytesSent+=l.length;this.file.stats.msgSent++;mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(c)+"&to="+encodeURIComponent(g)+"&msg="+encodeURIComponent(m)+(null!=n?"&secret="+encodeURIComponent(n):"")+(l.length<this.maxCacheEntrySize?
"&data="+encodeURIComponent(l):""),mxUtils.bind(this,function(a){}));"1"==urlParams.test&&EditorUi.debug("Sync.fileSaved",[this],"from",c,"to",g,l.length,"bytes","diff",e,"checksum",d)}this.file.shadowPages=a;null!=b&&b()};DrawioFileSync.prototype.getIdParameters=function(){var a="id="+this.channelId;null!=this.pusher&&null!=this.pusher.connection&&null!=this.pusher.connection.socket_id&&(a+="&sid="+this.pusher.connection.socket_id);return a};
-DrawioFileSync.prototype.createMessage=function(a){return{v:DrawioFileSync.PROTOCOL,d:a,c:this.clientId}};DrawioFileSync.prototype.fileConflict=function(a,c,b){this.catchupRetryCount++;if(this.catchupRetryCount<this.maxCatchupRetries)if(this.file.stats.conflicts++,null!=a){var d=this.file.getDescriptorEtag(a);a=this.file.getDescriptorSecret(a);this.catchup(d,a,c,b)}else this.fileChanged(c,b);else this.file.stats.timeouts++,this.catchupRetryCount=0,null!=b&&b({message:mxResources.get("timeout")})};
+DrawioFileSync.prototype.createMessage=function(a){return{v:DrawioFileSync.PROTOCOL,d:a,c:this.clientId}};DrawioFileSync.prototype.fileConflict=function(a,c,b){this.catchupRetryCount++;this.catchupRetryCount<this.maxCatchupRetries?(this.file.stats.conflicts++,null!=a?this.catchup(a,c,b):this.fileChanged(c,b)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=b&&b({message:mxResources.get("timeout")}))};
DrawioFileSync.prototype.stop=function(){null!=this.pusher&&(EditorUi.debug("Sync.stop",[this]),null!=this.pusher.connection&&(this.pusher.connection.unbind("state_change",this.connectionListener),this.pusher.connection.unbind("error",this.pusherErrorListener)),null!=this.channel&&(this.channel.unbind("changed",this.changeListener),this.channel=null),this.pusher.disconnect(),this.pusher=null);this.updateOnlineState();this.updateStatus()};
DrawioFileSync.prototype.destroy=function(){if(null!=this.channelId){var a=this.file.getCurrentUser(),c={a:"leave"};null!=a&&(c.name=a.displayName,c.uid=a.id);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&msg="+encodeURIComponent(this.objectToString(this.createMessage(c))));this.file.stats.msgSent++}this.stop();null!=this.updateStatusThread&&(window.clearInterval(this.updateStatusThread),this.updateStatusThread=null);null!=this.onlineListener&&(mxEvent.removeListener(window,"online",this.onlineListener),
this.onlineListener=null);null!=this.visibleListener&&(mxEvent.removeListener(document,"visibilitychange",this.visibleListener),this.visibleListener=null);null!=this.activityListener&&(mxEvent.removeListener(document,mxClient.IS_POINTER?"pointermove":"mousemove",this.activityListener),mxEvent.removeListener(document,"keypress",this.activityListener),mxEvent.removeListener(window,"focus",this.activityListener),!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&(mxEvent.removeListener(document,"touchstart",this.activityListener),
@@ -8659,9 +8660,9 @@ DriveFile.prototype.isSyncSupported=function(){return!0};DriveFile.prototype.isR
DriveFile.prototype.getRevisions=function(a,c){this.ui.drive.executeRequest(gapi.client.drive.revisions.list({fileId:this.getId()}),mxUtils.bind(this,function(b){for(var c=0;c<b.items.length;c++)mxUtils.bind(this,function(a){a.title=a.originalFilename;a.getXml=mxUtils.bind(this,function(b,c){this.ui.drive.getXmlFile(a,mxUtils.bind(this,function(a){b(a.getData())}),c)});a.getUrl=mxUtils.bind(this,function(b){return this.ui.getUrl(window.location.pathname+"?rev="+a.id+"&chrome=0&nav=1&layers=1&edit=_blank"+
(null!=b?"&page="+b:""))+window.location.hash})})(b.items[c]);a(b.items)}),c)};DriveFile.prototype.getLatestVersion=function(a,c){this.ui.drive.getFile(this.getId(),a,c,!0)};DriveFile.prototype.getChannelId=function(){var a=this.ui.drive.getCustomProperty(this.desc,"channel");null!=a&&(a="G-"+this.getId()+"."+a);return a};DriveFile.prototype.getChannelKey=function(){return this.ui.drive.getCustomProperty(this.desc,"key")};DriveFile.prototype.getLastModifiedDate=function(){return new Date(this.desc.modifiedDate)};
DriveFile.prototype.getDescriptor=function(){return this.desc};DriveFile.prototype.setDescriptor=function(a){this.desc=a};DriveFile.prototype.getDescriptorSecret=function(a){return this.ui.drive.getCustomProperty(a,"secret")};DriveFile.prototype.getDescriptorEtag=function(a){return a.etag};DriveFile.prototype.setDescriptorEtag=function(a,c){a.etag=c};
-DriveFile.prototype.loadPatchDescriptor=function(a,c){this.ui.drive.executeRequest(gapi.client.drive.files.get({fileId:this.getId(),fields:this.ui.drive.catchupFields,supportsTeamDrives:!0}),mxUtils.bind(this,function(b){a(b)}),c)};DriveFile.prototype.loadDescriptor=function(a,c){this.ui.drive.loadDescriptor(this.getId(),a,c)};DriveLibrary=function(a,c,b){DriveFile.call(this,a,c,b)};mxUtils.extend(DriveLibrary,DriveFile);DriveLibrary.prototype.isAutosave=function(){return!0};DriveLibrary.prototype.save=function(a,c,b){this.ui.drive.saveFile(this,a,mxUtils.bind(this,function(a){this.desc=a;null!=c&&c(a)}),b)};DriveLibrary.prototype.open=function(){};DriveClient=function(a){mxEventSource.call(this);this.ui=a;this.xmlMimeType="application/vnd.jgraph.mxfile";this.ui.isDriveDomain()?(this.appId="671128082532",this.clientId="671128082532.apps.googleusercontent.com",this.mimeType="application/vnd.jgraph.mxfile.realtime"):(this.appId="420247213240",this.clientId="420247213240-hnbju1pt13seqrc1hhd5htpotk4g9q7u.apps.googleusercontent.com",this.mimeType="application/vnd.jgraph.mxfile.rtlegacy");this.mimeTypes=this.xmlMimeType+"application/mxe,application/mxr,application/vnd.jgraph.mxfile.realtime,application/vnd.jgraph.mxfile.rtlegacy"};
+DriveFile.prototype.loadPatchDescriptor=function(a,c){this.ui.drive.executeRequest(gapi.client.drive.files.get({fileId:this.getId(),fields:this.ui.drive.catchupFields,supportsTeamDrives:!0}),mxUtils.bind(this,function(b){a(b)}),c)};DriveFile.prototype.patchDescriptor=function(a,c){DrawioFile.prototype.patchDescriptor.apply(this,arguments);a.headRevisionId=c.headRevisionId;a.modifiedDate=c.modifiedDate};DriveFile.prototype.loadDescriptor=function(a,c){this.ui.drive.loadDescriptor(this.getId(),a,c)};DriveLibrary=function(a,c,b){DriveFile.call(this,a,c,b)};mxUtils.extend(DriveLibrary,DriveFile);DriveLibrary.prototype.isAutosave=function(){return!0};DriveLibrary.prototype.save=function(a,c,b){this.ui.drive.saveFile(this,a,mxUtils.bind(this,function(a){this.desc=a;null!=c&&c(a)}),b)};DriveLibrary.prototype.open=function(){};DriveClient=function(a){mxEventSource.call(this);this.ui=a;this.xmlMimeType="application/vnd.jgraph.mxfile";this.ui.isDriveDomain()?(this.appId="671128082532",this.clientId="671128082532.apps.googleusercontent.com",this.mimeType="application/vnd.jgraph.mxfile.realtime"):(this.appId="420247213240",this.clientId="420247213240-hnbju1pt13seqrc1hhd5htpotk4g9q7u.apps.googleusercontent.com",this.mimeType="application/vnd.jgraph.mxfile.rtlegacy");this.mimeTypes=this.xmlMimeType+"application/mxe,application/mxr,application/vnd.jgraph.mxfile.realtime,application/vnd.jgraph.mxfile.rtlegacy"};
mxUtils.extend(DriveClient,mxEventSource);DriveClient.prototype.scopes="1"==urlParams.photos?["https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/drive.install","https://www.googleapis.com/auth/photos","https://www.googleapis.com/auth/photos.upload","https://www.googleapis.com/auth/userinfo.profile"]:["https://www.googleapis.com/auth/drive.file","https://www.googleapis.com/auth/drive.install","https://www.googleapis.com/auth/userinfo.profile"];
-DriveClient.prototype.allFields="kind,id,parents,headRevisionId,etag,title,mimeType,modifiedDate,editable,copyable,labels,properties,downloadUrl,webContentLink,userPermission,fileSize";DriveClient.prototype.catchupFields="etag,properties(key,value)";DriveClient.prototype.enableThumbnails=!0;DriveClient.prototype.thumbnailWidth=1E3;DriveClient.prototype.maxThumbnailSize=2E6;
+DriveClient.prototype.allFields="kind,id,parents,headRevisionId,etag,title,mimeType,modifiedDate,editable,copyable,labels,properties,downloadUrl,webContentLink,userPermission,fileSize";DriveClient.prototype.catchupFields="etag,headRevisionId,modifiedDate,properties(key,value)";DriveClient.prototype.enableThumbnails=!0;DriveClient.prototype.thumbnailWidth=1E3;DriveClient.prototype.maxThumbnailSize=2E6;
DriveClient.prototype.placeholderThumbnail="iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAMAAAAL34HQAAACN1BMVEXwhwXvhgX4iwXzhwXgbQzvhgXhbAzocgzqcwzldAoAAADhbgvjcQnmdgrlbgDwhgXsfwXufgjwhgXwgQfziAXxgADibgz4iwX4jAX3iwTpcwr1igXoewjsfgj3igX4iwXqcQv4jAX3iwXtfQnndQrvhAbibArwhwXgbQz//////v39jwX6jQX+/v7fagHfawzdVQDwhADgbhPgbhXwhwPocQ3uvKvwiA/faQDscgzxiAT97+XgciTgcSP6jAXgbQ3gcCHwiRfpcQzwhwfeXQD77ef74NLvhgTvegD66uPgbAf66+TvfADwjCzgcCfwiSD67ObhcjjwiBHhczvwiyrgbxj///777ujgcSHgcB/xiRzgbhveWgDeVwDhdEDgbRDqfgffYgDfXwD97+bvfQDxiz7//vvwiRr118rrcgztggbfZgDfZAD++PT98+3gbBPsgAb99vD33tPgcB7icAvuhAX//Pn66N/00sTyy7vuuqbjekLwhwzkcgr88er449n++vfutp/kh1vgcBvhbwvmdwnwgwDwgADeWQD87eLxxrTssJjqpIf0roHmjWTkhFP759n63czvvanomnjnlHDhczD22cr4y6/wwa/3xKX2wJ3rqpH0tY7qp4vpnoDymlbjf0vxjjntcwzldAroegj/kgX12s7518PzqnnnkWfynmLieUjpewjrdAD40Lj1uZTzpm3idTbiciLydQzzfwnyiQTsfgD3xqnzp3TxlkzgbCrdTwDdSwBLKUlNAAAAJ3RSTlP8/b2X/YH8wb+FAIuIggJbQin5opAM9+a/ubaubyD78NjSyr2WgRp4sjN4AAAI70lEQVR42u2cZ38SQRDGT8WGvfde4E4BxVMRRaKiUURRlJhQRDCCSgQVO/bee++9994+nMt5ywoezFJd/fm8uITi3p9n5mbYkcCpO6rVnVu2YEXd+3dRIySuo7pLv4GjGNKg7j3UHTl1l14PajmG9OFBnx7Ird4PumpYEtf1QXc112l0M7OGKXEfeg3guo3iNIyJG92Jaz61mYYxcaNacs1H/8f6j6X5j1WI/mMVIsawRFEzI49SjwOqAJa43emclk8Rp2c7AFZ+LDGyvXE2kmO2Q1Lq17RSd6ND48QIwFVuLNHTOPbEpTOz8ujMpccHGz0AV5mxIo4TpwUeUPj0YwfAVVYs0Tn7VZjnBUA8v+n6CyfERY8FR/DEJj7MQ6oL85vOvfDUAsuVC8s19s5yXuAppOPnvPk4EeSCsehCeBVTwVzHfE6RcFUQa4an8Qw91kpbw2oz4aoc1sSxniO0WAI/J24wriabmEpizZtM79bc+fr4/tUarEpiLabGElJYRsOGjbJfjGDpJCxtmosRLOEnVpqLESzZLYlLg65H1rAkLo2GESwcROwXI1jELcS1Y6OGQSzEVaupZQJLDiLhYtCtFBcbbslYhOueqKllDwtzwVhTq4RFuBh0C3EdEBl0C3OBWNUrEISLvSD+5GLQLYmLoSqfwcUiFuaqzhYDxiJc981lxqqdVsCGbHPcQLBgrtK3rwLt9tWqhblKxxI9hW3267U5ZHhuBrCKzXl4NIJTS5FrmbmMWGIEDZIouOp0/O6boYQ2jxBXWcdu13fzRILuF/2Ku+aGr96uBbhALHo5Z38+XcfXyVRZVx/+Ed513ldDCCCu0rFE0Xlo2mu5TAj8ki0XV0q6ePHilhi+d/15b9ACQGGusg3AFzc+XSMBCPzu89+CNlnB7zfD8t1z4iaLXUvDVT6sGdMOnv5pi47f6r9Qk9YF3xZ0l8S11UfMArlgLMpZM6bamYy6rWnta9q7TrZrzZPgPgoqg3atubY8WK6D8lQXHfb4p/wSK7vFfxmxSsAPQ96AlZ4LxoLNeompdkUDGQVznL5mLr4ar5ESD3PBWHA9fbpbjlT4pq1Bm6H6w9dwfOd69ePouNDYt3S3ULPGZ96S3YqtAW/Tepz1E8bgAANc+xEXhAX36ut1cslcd6rJq81SIvgEe7lmL3kY5iqxVYvOI9isswp22KeMOcrriJlWai5giwHl+yec73Ma9Mbfz+qOJndKz6hLpR5V1uPxavFuTTt0K1XfpbNeO0wKeUaR2IPBN5sMRlqu1eY8bsFmPeIFUpi0CjIGTLvSZY2EGeYSi3VL9Dgeb0I+SQl9MlcZT4TObZKzfmfS5NZSx1GsLQ5r+8Sxp7ERR/1TtDlUn2qNuGXCrZGM5URlLDiEVzDVkje5fdjXdDsm27XpXChBz4XG0UpYcDOMYaxjGc3wtyJxFtu1PohaI71f2K2imqEONcN4nrMZ9TWbMf81wg9z3VNwC26Gr3enY4ObobLqbccFefuz5AKONpVfzQp2y3NoVvrN32GLNl9orA22lTiM+Nqg5CJY1DueOjkwsdtNgAP7gidR2SWVhFqt3o9QwoKHIuiwDcwX+xT/UWztSlvCaqXGmtQBY1GadQmfh6anuE0XlkhhRFs3tGGkd+tuIVhiJN0M+brj0mlAu46lX0bcbizVLbgZrgwl4JhYA+NQa9TJQUetsSJYHscJvAVct7eJKoUbQudxPYmdirqzsYsIojhjoitD01yadH287J+vpZF1/uGt2K4ttinjshQo2C2XMzI2U64X6WY4tyZq99a7wZS3eA3BpNyrUPn1x00Z0uM1ACzilOfg7EN3VmRo8dN16WYYerYw6G9qCOSDCjQ0jQkufRbalt65LVyapaA/2mClxhK3Rxy3rsyavDxDR/DL5sMLFiyYu/7sXps7z8VldPv2Xl6PnjlTwOOuJQuytH7CXpvXCOQWoZrYeHWd4nw2Q+v22OLGnFSG0Nk1PCi0xjgjpVvTGi8hht9F+ARBGq8dtXmtOSLoDm1FhUSHnihkTecESalHkPAaWVhtFbA8jqvQGBmbt8fWkKtNn0Xw9GvAWK6DX9bBVHjzqtyvvcG9a+jXyC5oKoKV/a4YFG7Yij2ofszlgtaA3ZoRwW+pIOH3w0qZFURNh3oNtKsDsAr9LNvMC0pj93H6hTPpX9ocg8FIgTVvcgFYC03jFLBMi6ix0MDAoi8/lh7Cgt2q0VfNrSX0ayhjTa2IW0tKdotNrMq4NbPkILKZW+xdiSoGgshogfh7Ul7FcIEoFevfrPLC3+XWf6y/CEvHZoFQqlts9sQigqjLxFpQCJauakFcsqhKPXH79rGb6bE2B5Qmu0b91zn0WJtN8Wys9tgtIqfjEf2SWw7XKI8gHuKQ0X0eDsQSI44TaGBN6dYN5dlI/eFj9I7f8GWtoUJYOIgkiq6Ds/gw5T7dZDUqTrfscbLbB9eIB7JmEKsUgiii/4uO8ToBfJlhfif5tEGWEsGTMT4Mr6HDa0BBlP5Y88lcnkdkCtLhnyjMM0+Gcn2WzW6xnd/J8zn+LZq4SUeEvUBaA8LCs6Tk1p1AetXt3JoMWexWZSyr3RK6vSUGrRHbmkRUVgCLpP1HW/L4tgl5tO140mdKKFFhrkTUdxta4xleA8DCXC6n/vCYvPJFa9zAWL4m6qNaA8IiqjW73lreWnJrSj0AJYFZpvwq6RZRzjVUGEtB5tX7DdoqCXaL+PXHuEjdYsuvVqva4Sqv6NdabdW4YLeIKsoFYzHGhYPIGBd2izGuVpPaSVgAV7VEsOQgsuUXdosxLuwWxLVMW0WRK5ExLiiIpN4vq2YYVTiIbPmFgii5xRiXimCBqmIcVSS3WMqvdMqz5VcKqzdKeca4UrnVT/ryR6bi2Opuf64TwYJlfl4FLqu2Zxeux5BRXZnisvZ8103NqTtzoziuGa24+wZVRdVK9W7wyNSX1nYeOmrU6JSmjp6KhH5BR+kGvk++Ld0c/X66rPH4SEQeGl+kpq8a33eAumPqK347durWpzm9hrWhUevi1Hd4ZzVC+gGMHY0TYnDOYwAAAABJRU5ErkJggg==".replace(/\+/g,"-").replace(/\//g,
"_");DriveClient.prototype.placeholderMimeType="image/png";DriveClient.prototype.libraryMimeType="application/vnd.jgraph.mxlibrary";DriveClient.prototype.newAppHostname="www.draw.io";DriveClient.prototype.oldAppHostname="legacy.draw.io";DriveClient.prototype.extension=".drawio";DriveClient.prototype.tokenRefreshInterval=0;DriveClient.prototype.lastTokenRefresh=0;DriveClient.prototype.maxRetries=5;DriveClient.prototype.coolOff=1E3;DriveClient.prototype.mimeTypeCheckCoolOff=6E4;
DriveClient.prototype.user=null;DriveClient.prototype.setUser=function(a){this.user=a;null==this.user&&null!=this.tokenRefreshThread&&(window.clearTimeout(this.tokenRefreshThread),this.tokenRefreshThread=null);this.fireEvent(new mxEventObject("userChanged"))};DriveClient.prototype.getUser=function(){return this.user};
@@ -8680,14 +8681,14 @@ DriveClient.prototype.updateUser=function(a,c,b){try{var d=gapi.auth.getToken().
d,g,l,e.locale));this.setUserId(e.id,b);null!=a&&a()}),c)}),c)}catch(e){if(null!=c)c(e);else throw e;}};DriveClient.prototype.copyFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(gapi.client.drive.files.copy({fileId:a,fields:this.allFields,supportsTeamDrives:!0,resource:{title:c,properties:[{key:"channel",value:Editor.guid()}]}}),b,d)};DriveClient.prototype.renameFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{title:c}),b,d)};
DriveClient.prototype.moveFile=function(a,c,b,d){null!=a&&null!=c&&this.executeRequest(this.createDriveRequest(a,{parents:[{kind:"drive#fileLink",id:c}]}),b,d)};DriveClient.prototype.createDriveRequest=function(a,c){return gapi.client.request({path:"/drive/v2/files/"+a,method:"PUT",params:{uploadType:"multipart",supportsTeamDrives:!0},headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(c)})};DriveClient.prototype.getLibrary=function(a,c,b){return this.getFile(a,c,b,!0,!0)};
DriveClient.prototype.loadDescriptor=function(a,c,b,d){this.executeRequest(gapi.client.drive.files.get({fileId:a,fields:null!=d?d:this.allFields,supportsTeamDrives:!0}),c,b)};DriveClient.prototype.getCustomProperty=function(a,c){var b=a.properties,d=null;if(null!=b)for(var e=0;e<b.length;e++)if(b[e].key==c){d=b[e].value;break}return d};
-DriveClient.prototype.getFile=function(a,c,b,d,e){d=null!=d?d:!1;e=null!=e?e:!1;null!=urlParams.rev?this.executeRequest(gapi.client.drive.revisions.get({fileId:a,revisionId:urlParams.rev,supportsTeamDrives:!0}),mxUtils.bind(this,function(a){a.title=a.originalFilename;this.getXmlFile(a,c,b)}),b):this.loadDescriptor(a,mxUtils.bind(this,function(a){try{if(null!=this.user){var g=/\.png$/i.test(a.title);if(/\.v(dx|sdx?)$/i.test(a.title)||/\.gliffy$/i.test(a.title)||!this.ui.useCanvasForExport&&g){var m=
-a.downloadUrl+"&access_token="+gapi.auth.getToken().access_token;this.ui.convertFile(m,a.title,a.mimeType,this.extension,c,b)}else d||e||a.mimeType==this.libraryMimeType||a.mimeType==this.xmlMimeType?this.getXmlFile(a,c,b,!0,e):this.isGoogleRealtimeMimeType(a.mimeType)?this.convertRealtimeFile(a,c,b):this.getXmlFile(a,c,b)}else b({message:mxResources.get("loggedOut")})}catch(n){if(null!=b)b(n);else throw n;}}),b)};
+DriveClient.prototype.getFile=function(a,c,b,d,e){d=null!=d?d:!1;e=null!=e?e:!1;null!=urlParams.rev?this.executeRequest(gapi.client.drive.revisions.get({fileId:a,revisionId:urlParams.rev,supportsTeamDrives:!0}),mxUtils.bind(this,function(d){d.title=d.originalFilename;d.headRevisionId=d.id;d.id=a;this.getXmlFile(d,c,b)}),b):this.loadDescriptor(a,mxUtils.bind(this,function(a){try{if(null!=this.user){var g=/\.png$/i.test(a.title);if(/\.v(dx|sdx?)$/i.test(a.title)||/\.gliffy$/i.test(a.title)||!this.ui.useCanvasForExport&&
+g){var m=a.downloadUrl+"&access_token="+gapi.auth.getToken().access_token;this.ui.convertFile(m,a.title,a.mimeType,this.extension,c,b)}else d||e||a.mimeType==this.libraryMimeType||a.mimeType==this.xmlMimeType?this.getXmlFile(a,c,b,!0,e):this.isGoogleRealtimeMimeType(a.mimeType)?this.convertRealtimeFile(a,c,b):this.getXmlFile(a,c,b)}else b({message:mxResources.get("loggedOut")})}catch(n){if(null!=b)b(n);else throw n;}}),b)};
DriveClient.prototype.isGoogleRealtimeMimeType=function(a){return null!=a&&"application/vnd.jgraph.mxfile."==a.substring(0,30)};
DriveClient.prototype.getRealtimeData=function(a,c,b,d){this.executeRequest(gapi.client.drive.realtime.get({fileId:a,supportsTeamDrives:!0}),mxUtils.bind(this,function(d){d=null!=d.result?d.result.data:null;null!=d&&null!=d.value&&null!=d.value.diagrams?c(d):null!=b&&b({message:"realtime.get returned invalid data for "+a})}),mxUtils.bind(this,function(e){null==d&&(d=0);3>d?window.setTimeout(mxUtils.bind(this,function(){this.getRealtimeData(a,c,b,d+1)}),100*(d+1)):null!=b&&b({message:"realtime.get failed for "+
a})}))};DriveClient.prototype.loadRealtime=function(a,c,b){"1"==urlParams.ignoremime||"420247213240"!=this.appId||"application/vnd.jgraph.mxfile.realtime"!=a.mimeType&&"application/mxr"!=a.mimeType?c():this.redirectToNewApp(b,a.id)};
-DriveClient.prototype.getXmlFile=function(a,c,b,d,e){try{var g=gapi.auth.getToken().access_token;this.ui.loadUrl(a.downloadUrl+"&access_token="+g,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<g){var l=this.ui.extractGraphModelFromPng(d.substring(g+
-1));if(null!=l&&0<l.length)d=l;else try{var q=atob(d.substring(g+1));null==q||"<mxfile "!==q.substring(0,8)&&"<mxGraphModel "!==q.substring(0,14)&&"<mxGraphModel>"!==q.substring(0,14)||(d=q)}catch(f){}}}else"data:image/png;base64,PG14ZmlsZS"==d.substring(0,32)&&(q=d.substring(22),d=window.atob&&!mxClient.IS_SF?atob(q):Base64.decode(q));c(new DriveFile(this.ui,d,a))}}catch(f){if(null!=b)b(f);else throw f;}}),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))}catch(l){if(null!=b)b(l);else throw l;}};
+DriveClient.prototype.getXmlFile=function(a,c,b,d,e){try{var g=gapi.auth.getToken().access_token;this.ui.loadUrl(a.downloadUrl+"&access_token="+g,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{var g=!1;if(/\.png$/i.test(a.title)){var l=d.lastIndexOf(",");if(0<l){var q=this.ui.extractGraphModelFromPng(d.substring(l+
+1));if(null!=q&&0<q.length)d=q;else try{var q=d.substring(l+1),f=!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(q):atob(q),k=this.ui.editor.extractGraphModel(mxUtils.parseXml(f).documentElement,!0);null==k||0<k.getElementsByTagName("parsererror").length?g=!0:d=f}catch(p){g=!0}}}else"data:image/png;base64,PG14ZmlsZS"==d.substring(0,32)&&(f=d.substring(22),d=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f));c(g?new LocalFile(this.ui,d,a.title,!0):new DriveFile(this.ui,d,a))}}catch(p){if(null!=
+b)b(p);else throw p;}}),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))}catch(l){if(null!=b)b(l);else throw l;}};
DriveClient.prototype.saveFile=function(a,c,b,d,e,g,l,m){var n=mxUtils.bind(this,function(b){try{EditorUi.logError(b.message,null,null,b),EditorUi.sendReport("Critical error in DriveClient.saveFile "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nFile="+a.desc.id+"."+a.desc.headRevisionId+"\nUser="+(null!=this.user?this.user.id:"unknown")+"\nMessage="+b.message+"\n\nStack:\n"+b.stack)}catch(z){}if(null!=d)d(b);else throw b;});try{if(a.isEditable()&&null!=a.desc){var q=(new Date).getTime(),
f=a.desc.modifiedDate,k=a.desc.headRevisionId,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){try{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 F=a.getData(),A=mxUtils.bind(this,function(e){try{if(a.saveDelay=(new Date).getTime()-q,0>=(new Date(e.modifiedDate)).getTime()-(new Date(f)).getTime()||c&&k==e.headRevisionId){d({message:mxResources.get("errorSavingFile")});try{EditorUi.sendReport("Critical: Error saving to Google Drive "+
@@ -8729,14 +8730,13 @@ c.objects[a.ref]:null};
DriveClient.prototype.jsonToCell=function(a,c){var b=new mxCell;b.id=a.cellId.json;b.vertex="vertex"==a.type.json;b.edge="edge"==a.type.json;b.connectable="0"!=a.connectable.json;b.collapsed="1"==a.collapsed.json;b.visible="0"!=a.visible.json;b.style=null!=a.style?a.style.json:null;b.value=null!=a.xmlValue?mxUtils.parseXml(a.xmlValue.json).documentElement:null!=a.value?a.value.json:null;b.geometry=null!=a.geometry?c.decode(mxUtils.parseXml(a.geometry.json).documentElement):null;return b};
DriveClient.prototype.checkRealtimeFiles=function(a){this.executeRequest(gapi.client.drive.files.list({maxResults:1,q:"mimeType='application/vnd.jgraph.mxfile.realtime'",includeTeamDriveItems:!0,supportsTeamDrives:!0}),mxUtils.bind(this,function(c){null!=c&&(null!=c.nextPageToken||null!=c.items&&0<c.items.length)&&a()}))};
DriveClient.prototype.convertRealtimeFiles=function(){var a=document.createElement("div");a.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;padding:8px;background:#ffffff;z-index:2;overflow:auto;white-space:nowrap;line-height:1.5em;";document.body.appendChild(a);var c=Date.now(),b=mxUtils.bind(this,function(b,c){a.innerHTML+=b+(c?"":"<br>");a.scrollTop=a.scrollHeight});b("draw.io ("+EditorUi.VERSION+") is searching files to be converted...");this.ui.spinner.spin(document.body,
-"Searching files...")?this.checkToken(mxUtils.bind(this,function(){var a=(new Date).getDay(),e=6===a||0===a?2E3:15E3,g={},l=0,m=0,n=0,q=0,f=0,k=0,p=0,t=0,u=mxUtils.bind(this,function(){this.ui.spinner.stop();b("<br>Conversion complete. Successfully converted "+l+" file(s).",!0);0<p?b(" Failed to convert "+p+' file(s).<br><br><b>ACTION REQUIRED:</b><br><ul><li>Click <a target="_blank" href="https://drive.google.com/drive/u/0/search?q=type:application/vnd.jgraph.mxfile.realtime">here</a> to list all affected files</li><li>Open each file in turn by right-clicking the file and selecting open with draw.io</li><li>Open each file in turn. When loaded, select File->Save</li></ul>'):
-b("<br><br>This window can now be closed.");try{var a=Date.now()-c;EditorUi.sendReport("Convert Realtime Report "+(new Date).toISOString()+":\n\nBrowser="+navigator.userAgent+"\nUser="+(null!=this.user?this.user.id:"unknown")+"\nFound="+t+" (Backup: "+n+", Realtime: "+m+")\nConverted="+l+"\nFailed="+p+" (Load: "+q+", Save: "+k+", Invalid: "+f+")\ndt="+Math.round(a/1E3)+" sec(s)")}catch(v){}}),y=function(a){return null==a?"":null!=a.message?a.message:null!=a.error&&null!=a.error.message?a.error.message:
-""};this.executeRequest(gapi.client.drive.files.list({maxResults:1E4,q:"mimeType='application/vnd.jgraph.mxfile.realtime'",includeTeamDriveItems:!0,supportsTeamDrives:!0}),mxUtils.bind(this,function(a){this.ui.spinner.stop();t=null!=a&&null!=a.items?a.items.length:0;if(this.ui.spinner.spin(document.body,"Converting "+t+" file(s)")){b("Found "+t+" file(s). This will take up to "+Math.ceil(t*(e+3E3)/6E4)+" minute(s). <b>Please do not close this window!</b><br>");var c=0,d=mxUtils.bind(this,function(a,
-v){var x={maxResults:1,q:"mimeType='application/vnd.jgraph.mxfile.realtime'",includeTeamDriveItems:!0,supportsTeamDrives:!0};null!=a&&(x.pageToken=a);this.executeRequest(gapi.client.drive.files.list(x),mxUtils.bind(this,function(a){var x=mxUtils.bind(this,function(){null!=a.nextPageToken?d(a.nextPageToken):null!=a.nextPageToken?d(a.nextPageToken):u()});if(null==a||null!=a.items&&0!=a.items.length||null==a.nextPageToken)if(null!=a&&null!=a.items&&0<a.items.length){var A=a.items[0].id;this.ui.spinner.stop();
-c++;this.ui.spinner.spin(document.body,"Converting file "+c+" of "+t)&&(b("Converting "+c+" of "+t+': "'+mxUtils.htmlEntities(a.items[0].title)+'" ('+A+")... ",!0),window.setTimeout(mxUtils.bind(this,function(){if(null==g[A]){var a=g[A]=!0,c=window.setTimeout(mxUtils.bind(this,function(){a=!1;p++;q++;b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> Timeout');x()}),this.ui.timeout);this.getFile(A,mxUtils.bind(this,function(d){window.clearTimeout(c);a&&(d.constructor==
-DriveFile?("json"==d.convertedFrom?m++:n++,a=!0,c=window.setTimeout(mxUtils.bind(this,function(){a=!1;p++;k++;b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> Timeout');x()}),this.ui.timeout),this.saveFile(d,null,mxUtils.bind(this,function(){window.clearTimeout(c);a&&(l++,b('<img src="'+Editor.checkmarkImage+'" border="0" valign="middle"/>'),x())}),mxUtils.bind(this,function(d){window.clearTimeout(c);a&&(d=y(d),p++,k++,b('<img src="'+this.ui.editor.graph.warningImage.src+
-'" border="0" valign="absmiddle"/> '+d),x())}))):(p++,f++,b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> Invalid file'),x()))}),mxUtils.bind(this,function(d){window.clearTimeout(c);a&&(d=y(d),p++,q++,b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> '+d),x())}))}else this.ui.spinner.stop(),b("Search returned duplicate file "+A+". Exiting.<br><br>This window can now be closed.")}),null!=v?v:e))}else u();else d(a.nextPageToken,
-1E4)}))});d()}}))})):(this.ui.spinner.stop(),b("Busy. <br><br>This window can now be closed."))};DropboxFile=function(a,c,b){DrawioFile.call(this,a,c);this.stat=b};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getId=function(){return this.stat.path_display.substring(1)};DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.getId())};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.getTitle=function(){return this.stat.name};
+"Searching files...")?this.checkToken(mxUtils.bind(this,function(){var a=(new Date).getDay(),e=6===a||0===a?1E3:5E3,g={},l=0,m=0,n=0,q=0,f=0,k=0,p=0,t=0,u=mxUtils.bind(this,function(){this.ui.spinner.stop();b("<br>Conversion complete. Successfully converted "+l+" file(s).",!0);0<p?b(" Failed to convert "+p+' file(s).<br><br><b>ACTION REQUIRED:</b><br><ul><li>Click <a target="_blank" href="https://drive.google.com/drive/u/0/search?q=type:application/vnd.jgraph.mxfile.realtime">here</a> to list all affected files</li><li>Open each file in turn by right-clicking the file and selecting open with draw.io</li><li>Open each file in turn. When loaded, select File->Save</li></ul>'):
+b("<br><br>This window can now be closed.");try{var a=Date.now()-c;EditorUi.logEvent({category:"AUTO-CONVERT",action:"total-"+t+"-xml-"+n+"-json-"+m+"-done-"+l+"-fail-"+p+"-load-"+q+"-save-"+k+"-invalid-"+f+"-dt-"+Math.round(a/1E3),label:null!=this.user?this.user.id:"unknown-user"})}catch(v){}}),y=function(a){return null==a?"":null!=a.message?a.message:null!=a.error&&null!=a.error.message?a.error.message:""};this.executeRequest(gapi.client.drive.files.list({maxResults:1E4,q:"mimeType='application/vnd.jgraph.mxfile.realtime'",
+includeTeamDriveItems:!0,supportsTeamDrives:!0}),mxUtils.bind(this,function(a){this.ui.spinner.stop();t=null!=a&&null!=a.items?a.items.length:0;if(this.ui.spinner.spin(document.body,"Converting "+t+" file(s)")){b("Found "+t+" file(s). This will take up to "+Math.ceil(t*(e+3E3)/6E4)+" minute(s). <b>Please do not close this window!</b><br>");var c=0,d=mxUtils.bind(this,function(a,v){var x={maxResults:1,q:"mimeType='application/vnd.jgraph.mxfile.realtime'",includeTeamDriveItems:!0,supportsTeamDrives:!0};
+null!=a&&(x.pageToken=a);this.executeRequest(gapi.client.drive.files.list(x),mxUtils.bind(this,function(a){var x=mxUtils.bind(this,function(){null!=a.nextPageToken?d(a.nextPageToken):null!=a.nextPageToken?d(a.nextPageToken):u()});if(null==a||null!=a.items&&0!=a.items.length||null==a.nextPageToken)if(null!=a&&null!=a.items&&0<a.items.length){var A=a.items[0].id;this.ui.spinner.stop();c++;this.ui.spinner.spin(document.body,"Converting file "+c+" of "+t)&&(b("Converting "+c+" of "+t+': "'+mxUtils.htmlEntities(a.items[0].title)+
+'" ('+A+")... ",!0),window.setTimeout(mxUtils.bind(this,function(){if(null==g[A]){var a=g[A]=!0,c=window.setTimeout(mxUtils.bind(this,function(){a=!1;p++;q++;b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> Timeout');x()}),this.ui.timeout);this.getFile(A,mxUtils.bind(this,function(d){window.clearTimeout(c);a&&(d.constructor==DriveFile?("json"==d.convertedFrom?m++:n++,a=!0,c=window.setTimeout(mxUtils.bind(this,function(){a=!1;p++;k++;b('<img src="'+this.ui.editor.graph.warningImage.src+
+'" border="0" valign="absmiddle"/> Timeout');x()}),this.ui.timeout),this.saveFile(d,null,mxUtils.bind(this,function(){window.clearTimeout(c);a&&(l++,b('OK <img src="'+Editor.checkmarkImage+'" border="0" valign="middle"/>'),x())}),mxUtils.bind(this,function(d){window.clearTimeout(c);a&&(d=y(d),p++,k++,b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> '+d),x())}))):(p++,f++,b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> Invalid file'),
+x()))}),mxUtils.bind(this,function(d){window.clearTimeout(c);a&&(d=y(d),p++,q++,b('<img src="'+this.ui.editor.graph.warningImage.src+'" border="0" valign="absmiddle"/> '+d),x())}))}else this.ui.spinner.stop(),b("Search returned duplicate file "+A+". Exiting.<br><br>This window can now be closed.")}),null!=v?v:e))}else u();else d(a.nextPageToken,1E4)}))});d()}}))})):(this.ui.spinner.stop(),b("Busy. <br><br>This window can now be closed."))};DropboxFile=function(a,c,b){DrawioFile.call(this,a,c);this.stat=b};mxUtils.extend(DropboxFile,DrawioFile);DropboxFile.prototype.getId=function(){return this.stat.path_display.substring(1)};DropboxFile.prototype.getHash=function(){return"D"+encodeURIComponent(this.getId())};DropboxFile.prototype.getMode=function(){return App.MODE_DROPBOX};DropboxFile.prototype.isAutosaveOptional=function(){return!0};DropboxFile.prototype.getTitle=function(){return this.stat.name};
DropboxFile.prototype.isRenamable=function(){return!0};DropboxFile.prototype.getSize=function(){return this.stat.size};DropboxFile.prototype.isRevisionHistorySupported=function(){return!0};
DropboxFile.prototype.getRevisions=function(a,c){var b=this.ui.dropbox.client.filesListRevisions({path:this.stat.path_lower,limit:100});b.then(mxUtils.bind(this,function(b){try{for(var d=[],g=b.entries.length-1;0<=g;g--)mxUtils.bind(this,function(a){d.push({modifiedDate:a.client_modified,fileSize:a.size,getXml:mxUtils.bind(this,function(b,c){this.ui.dropbox.readFile({path:this.stat.path_lower,rev:a.rev},b,c)}),getUrl:mxUtils.bind(this,function(b){return this.ui.getUrl(window.location.pathname+"?rev="+
a.rev+"&chrome=0&nav=1&layers=1&edit=_blank"+(null!=b?"&page="+b:""))+window.location.hash})})})(b.entries[g]);a(d)}catch(l){c(l)}}));b["catch"](function(a){c(a)})};DropboxFile.prototype.getLatestVersion=function(a,c){this.ui.dropbox.getFile(this.getId(),a,c)};DropboxFile.prototype.updateDescriptor=function(a){this.stat=a.stat};DropboxFile.prototype.save=function(a,c,b){this.doSave(this.getTitle(),c,b)};DropboxFile.prototype.saveAs=function(a,c,b){this.doSave(a,c,b)};
@@ -8768,7 +8768,7 @@ DropboxClient.prototype.pickFile=function(a,c){null!=Dropbox.choose?(a=null!=a?a
function(b,c){this.ui.spinner.stop();a(b,c)}),g=/\.png$/i.test(b[0].name);if(/\.vsdx$/i.test(b[0].name)||/\.gliffy$/i.test(b[0].name)||!this.ui.useCanvasForExport&&g)e(b[0].link);else{var l=b[0].link.indexOf(this.appPath);if(0<l){var m=decodeURIComponent(b[0].link.substring(l+this.appPath.length-1));this.readFile({path:m},mxUtils.bind(this,function(c,l){if(null!=l&&l.id==b[0].id){var f=g?c.lastIndexOf(","):-1;this.ui.spinner.stop();var k=null;0<f&&(f=this.ui.extractGraphModelFromPng(c.substring(f+
1)),null!=f&&0<f.length?c=f:k=new LocalFile(this,c,m,!0));a(m.substring(1),null!=k?k:new DropboxFile(this.ui,c,l))}else this.createFile(b[0],e,d)}),d,g)}else this.createFile(b[0],e,d)}}})})):this.ui.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})};
DropboxClient.prototype.createFile=function(a,c,b){var d=/(\.png)$/i.test(a.name);this.ui.loadUrl(a.link,mxUtils.bind(this,function(e){null!=e&&0<e.length?this.ui.confirm(mxResources.get("note")+": "+mxResources.get("fileWillBeSavedInAppFolder",[a.name]),mxUtils.bind(this,function(){var g=d?e.lastIndexOf(","):-1;0<g&&(g=this.ui.extractGraphModelFromPng(e.substring(g+1)),null!=g&&0<g.length&&(e=g));this.insertFile(a.name,e,mxUtils.bind(this,function(b){c(a.name,b)}),b)}),mxUtils.bind(this,function(){this.ui.spinner.stop()})):
-(this.ui.spinner.stop(),b({message:mxResources.get("errorLoadingFile")}))}),b,d)};OneDriveFile=function(a,c,b){DrawioFile.call(this,a,c);this.meta=b};mxUtils.extend(OneDriveFile,DrawioFile);OneDriveFile.prototype.getId=function(){return this.getIdOf(this.meta)};OneDriveFile.prototype.getParentId=function(){return this.getIdOf(this.meta,!0)};OneDriveFile.prototype.getIdOf=function(a,c){return(a.parentReference.driveId?a.parentReference.driveId+"/":"")+(c?a.parentReference.id:a.id)};
+(this.ui.spinner.stop(),b({message:mxResources.get("errorLoadingFile")}))}),b,d)};OneDriveFile=function(a,c,b){DrawioFile.call(this,a,c);this.meta=b};mxUtils.extend(OneDriveFile,DrawioFile);OneDriveFile.prototype.getId=function(){return this.getIdOf(this.meta)};OneDriveFile.prototype.getParentId=function(){return this.getIdOf(this.meta,!0)};OneDriveFile.prototype.getIdOf=function(a,c){return(null!=a.parentReference&&null!=a.parentReference.driveId?a.parentReference.driveId+"/":"")+(null!=c?a.parentReference.id:a.id)};
OneDriveFile.prototype.getChannelId=function(){return"W-"+DrawioFile.prototype.getChannelId.apply(this,arguments)};OneDriveFile.prototype.getHash=function(){return"W"+encodeURIComponent(this.getId())};OneDriveFile.prototype.getMode=function(){return App.MODE_ONEDRIVE};OneDriveFile.prototype.isAutosaveOptional=function(){return!0};OneDriveFile.prototype.getTitle=function(){return this.meta.name};OneDriveFile.prototype.isRenamable=function(){return!0};OneDriveFile.prototype.isSyncSupported=function(){return!0};
OneDriveFile.prototype.getSize=function(){return this.meta.size};OneDriveFile.prototype.isConflict=function(a){return null!=a&&(412==a.getStatus()||409==a.getStatus())};OneDriveFile.prototype.getCurrentUser=function(){return null!=this.ui.oneDrive?this.ui.oneDrive.user:null};
OneDriveFile.prototype.loadDescriptor=function(a,c){this.ui.oneDrive.executeRequest(this.ui.oneDrive.getItemURL(this.getId()),mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?a(JSON.parse(b.getText())):null!=c&&c()}),c)};OneDriveFile.prototype.getLatestVersion=function(a,c){this.ui.oneDrive.getFile(this.getId(),a,c)};OneDriveFile.prototype.getDescriptor=function(){return this.meta};OneDriveFile.prototype.setDescriptor=function(a){this.meta=a};
@@ -8905,7 +8905,7 @@ App.prototype.init=function(){EditorUi.prototype.init.apply(this,arguments);this
if("1"!=urlParams.embed||"1"==urlParams.od){var a=mxUtils.bind(this,function(){"undefined"!==typeof OneDrive?(this.oneDrive=new OneDriveClient(this),this.oneDrive.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.oneDrive))):null==window.DrawOneDriveClientCallback&&(window.DrawOneDriveClientCallback=a)});a()}if("1"!=urlParams.embed||"1"==urlParams.tr){var c=mxUtils.bind(this,function(){"undefined"!==
typeof window.Trello?(this.trello=new TrelloClient(this),this.trello.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))):null==window.DrawTrelloClientCallback&&(window.DrawTrelloClientCallback=c)});c()}if("1"!=urlParams.embed||"1"==urlParams.gapi){var b=mxUtils.bind(this,function(){if("undefined"!==typeof gapi){var a=mxUtils.bind(this,function(){this.drive=new DriveClient(this);
"420247213240"==this.drive.appId&&this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var a=this.getCurrentFile();null!=a&&a.constructor==DriveFile&&(a=document.getElementById("geFooterItem2"),null!=a&&(a.innerHTML='<a href="https://support.draw.io/display/DO/2014/11/27/Switching+application+in+Google+Drive" target="_blank" title="IMPORTANT NOTICE">IMPORTANT NOTICE</a>'))}));this.drive.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries();
-this.checkLicense();this.drive.checkRealtimeFiles(mxUtils.bind(this,function(){var a=(new Date).getDay();if(6===a||0===a||.8<Math.random()){var b=document.createElement("div");b.style.cssText="position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;white-space:nowrap;left:50%;bottom:2px;";b.className="geStatusAlert";mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,110%)");mxUtils.setPrefixedStyle(b.style,"transition","all 1s ease");b.style.whiteSpace="nowrap";b.innerHTML=
+this.checkLicense();this.drive.checkRealtimeFiles(mxUtils.bind(this,function(){var a=(new Date).getDay();if(6===a||0===a||.6<Math.random()){var b=document.createElement("div");b.style.cssText="position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;white-space:nowrap;left:50%;bottom:2px;";b.className="geStatusAlert";mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,110%)");mxUtils.setPrefixedStyle(b.style,"transition","all 1s ease");b.style.whiteSpace="nowrap";b.innerHTML=
'<a href="https://desk.draw.io/support/solutions/articles/16000092210" target="_blank" style="display:inline;text-decoration:none;font-weight:700;font-size:13px;opacity:1;"><img src="'+this.editor.graph.warningImage.src+'" border="0" style="margin-top:-4px;margin-right:2px;" valign="middle"/>&nbsp;You need to take action to convert legacy files. Click here.&nbsp;<img src="'+this.editor.graph.warningImage.src+'" border="0" style="margin-top:-4px;margin-left:2px;" valign="middle"/></a>';a=document.createElement("img");
a.setAttribute("src",Dialog.prototype.closeImage);a.setAttribute("title",mxResources.get("close"));a.style.position="absolute";a.style.cursor="pointer";a.style.right="10px";a.style.top="12px";b.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){b.parentNode.removeChild(b);this.hideFooter()}));document.body.appendChild(b);window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(b.style,"transform","translate(-50%,0%)")}),1500)}}))}));this.fireEvent(new mxEventObject("clientLoaded",
"client",this.drive))});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+"auth:"+App.GOOGLE_APIS,mxUtils.bind(this,function(b){null!=gapi.client&&gapi.client.load("drive","v2",mxUtils.bind(this,function(){gapi.auth.init(mxUtils.bind(this,function(){null!=gapi.client.drive&&a()}))}))})),window.DrawGapiClientCallback=null):a()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=b)});b()}if("1"!=urlParams.embed||"1"==urlParams.db){var d=mxUtils.bind(this,
@@ -8970,11 +8970,10 @@ 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,l=this.mode,m=this.getServiceCount(!0);
isLocalStorage&&m++;var n=4>=m?2:6<m?4:3,e=new CreateDialog(this,e,mxUtils.bind(this,function(a,b){null!=a&&0<a.length&&(null==l&&b==App.MODE_DEVICE?(this.setMode(App.MODE_DEVICE),this.save(a,d)):"download"==b?(new LocalFile(this,null,a)).save():"_blank"==b?(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(this.getFileData(!0)),this.openLink(this.getUrl(window.location.pathname),null,!0)):l!=b?this.pickFolder(b,mxUtils.bind(this,function(c){this.createFile(a,
this.getFileData(/(\.xml)$/i.test(a)||0>a.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.isVisioData=function(a){return 8<a.length&&208==a.charCodeAt(0)&&207==a.charCodeAt(1)&&17==a.charCodeAt(2)&&224==a.charCodeAt(3)&&161==a.charCodeAt(4)&&177==a.charCodeAt(5)&&26==a.charCodeAt(6)&&225==a.charCodeAt(7)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&4==a.charCodeAt(3)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&6==a.charCodeAt(3)};
-App.prototype.isPngData=function(a){return 8<a.length&&137==a.charCodeAt(0)&&80==a.charCodeAt(1)&&78==a.charCodeAt(2)&&71==a.charCodeAt(3)&&13==a.charCodeAt(4)&&10==a.charCodeAt(5)&&26==a.charCodeAt(6)&&10==a.charCodeAt(7)};
-App.prototype.loadTemplate=function(a,c,b,d){var e=!1,g=a;this.editor.isCorsEnabledForUrl(g)||(g="t="+(new Date).getTime(),g=PROXY_URL+"?url="+encodeURIComponent(a)+"&base64=1&"+g,e=!0);var l=null!=d?d:a;this.loadUrl(g,mxUtils.bind(this,function(d){try{var g=e?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(d):atob(d):d;if(/(\.v(dx|sdx?))($|\?)/i.test(l)||this.isVisioData(g))this.importVisio(this.base64ToBlob(g.substring(g.indexOf(",")+1)),function(a){c(a)},b,l);else if(!this.isOffline()&&
-(new XMLHttpRequest).upload&&this.isRemoteFileFormat(g,l))this.parseFile(new Blob([g],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&c(a.responseText)}),a);else if(this.isLucidChartData(g))this.convertLucidChart(g,mxUtils.bind(this,function(a){c(a)}),mxUtils.bind(this,function(a){b(a)}));else{if(/(\.png)($|\?)/i.test(l)||this.isPngData(g))g=this.extractGraphModelFromPng(d);c(g)}}catch(q){b(q)}}),
-b,/(\.png)($|\?)/i.test(l)||/(\.v(dx|sdx?))($|\?)/i.test(l),null,null,e)};App.prototype.getPeerForMode=function(a){return a==App.MODE_GOOGLE?this.drive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_DROPBOX?this.dropbox:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_TRELLO?this.trello:null};
+d)}};
+App.prototype.loadTemplate=function(a,c,b,d){var e=!1,g=a;this.editor.isCorsEnabledForUrl(g)||(g="t="+(new Date).getTime(),g=PROXY_URL+"?url="+encodeURIComponent(a)+"&base64=1&"+g,e=!0);var l=null!=d?d:a;this.loadUrl(g,mxUtils.bind(this,function(d){try{var g=e?!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(d):atob(d):d;if(/(\.v(dx|sdx?))($|\?)/i.test(l)||this.isVisioData(g))this.importVisio(this.base64ToBlob(g.substring(g.indexOf(",")+1)),function(a){c(a)},b,l);else if(!this.isOffline()&&(new XMLHttpRequest).upload&&
+this.isRemoteFileFormat(g,l))this.parseFile(new Blob([g],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&c(a.responseText)}),a);else if(this.isLucidChartData(g))this.convertLucidChart(g,mxUtils.bind(this,function(a){c(a)}),mxUtils.bind(this,function(a){b(a)}));else{if(/(\.png)($|\?)/i.test(l)||this.isPngData(g))g=this.extractGraphModelFromPng(d);c(g)}}catch(q){b(q)}}),b,/(\.png)($|\?)/i.test(l)||
+/(\.v(dx|sdx?))($|\?)/i.test(l),null,null,e)};App.prototype.getPeerForMode=function(a){return a==App.MODE_GOOGLE?this.drive:a==App.MODE_GITHUB?this.gitHub:a==App.MODE_DROPBOX?this.dropbox:a==App.MODE_ONEDRIVE?this.oneDrive:a==App.MODE_TRELLO?this.trello:null};
App.prototype.createFile=function(a,c,b,d,e,g,l,m){d=m?null:null!=d?d:this.mode;if(null!=a&&this.spinner.spin(document.body,mxResources.get("inserting"))){c=null!=c?c:this.emptyDiagramXml;var n=mxUtils.bind(this,function(){this.spinner.stop()}),q=mxUtils.bind(this,function(a){n();null==a&&null==this.getCurrentFile()&&null==this.dialog?this.showSplash():null!=a&&this.handleError(a)});try{if(d==App.MODE_GOOGLE&&null!=this.drive)null==l&&null!=this.stateArg&&null!=this.stateArg.folderId&&(l=this.stateArg.folderId),
this.drive.insertFile(a,c,l,mxUtils.bind(this,function(a){n();this.fileCreated(a,b,g,e)}),q);else if(d==App.MODE_GITHUB&&null!=this.gitHub)this.gitHub.insertFile(a,c,mxUtils.bind(this,function(a){n();this.fileCreated(a,b,g,e)}),q,!1,l);else if(d==App.MODE_TRELLO&&null!=this.trello)this.trello.insertFile(a,c,mxUtils.bind(this,function(a){n();this.fileCreated(a,b,g,e)}),q,!1,l);else if(d==App.MODE_DROPBOX&&null!=this.dropbox)this.dropbox.insertFile(a,c,mxUtils.bind(this,function(a){n();this.fileCreated(a,
b,g,e)}),q);else if(d==App.MODE_ONEDRIVE&&null!=this.oneDrive)this.oneDrive.insertFile(a,c,mxUtils.bind(this,function(a){n();this.fileCreated(a,b,g,e)}),q,!1,l);else if(d==App.MODE_BROWSER){n();var f=mxUtils.bind(this,function(){var d=new StorageFile(this,c,a);d.saveFile(a,!1,mxUtils.bind(this,function(){this.fileCreated(d,b,g,e)}),q)});null==localStorage.getItem(a)?f():this.confirm(mxResources.get("replaceIt",[a]),f,mxUtils.bind(this,function(){null==this.getCurrentFile()&&null==this.dialog&&this.showSplash()}))}else n(),
@@ -9108,52 +9107,52 @@ q.setToggleAction(!0),q.setSelectedCallback(function(){return null!=a.scratchpad
function(b){d.isEditing()&&d.stopEditing();var c="0"!=urlParams.pages||null!=a.pages&&1<a.pages.length?a.getFileData(!0):mxUtils.getXml(a.editor.getGraphXml());if("json"==urlParams.proto){var e=a.createLoadMessage("save");e.xml=c;b&&(e.exit=!0);c=JSON.stringify(e)}(window.opener||window.parent).postMessage(c,"*");"0"!=urlParams.modified&&"1"!=urlParams.keepmodified&&(a.editor.modified=!1,a.editor.setStatus(""));null!=a.getCurrentFile()&&a.saveFile()},a.actions.addAction("saveAndExit",function(){a.actions.get("save").funct(!0)}),
a.actions.addAction("exit",function(){var b=function(){a.editor.modified=!1;var b="json"==urlParams.proto?JSON.stringify({event:"exit",modified:a.editor.modified}):"";(window.opener||window.parent).postMessage(b,"*")};a.editor.modified?a.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b()}));this.put("exportAs",new Menu(mxUtils.bind(this,function(b,c){a.isExportToCanvas()?(this.addMenuItems(b,["exportPng"],c),a.jpgSupported&&this.addMenuItems(b,
["exportJpg"],c)):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPng","exportJpg"],c);this.addMenuItems(b,["exportSvg","-"],c);a.isOffline()||a.printPdfExport?this.addMenuItems(b,["exportPdf"],c):a.isOffline()||mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["exportPdf"],c);mxClient.IS_IE||"undefined"===typeof VsdxExport&&a.isOffline()||this.addMenuItems(b,["exportVsdx"],c);this.addMenuItems(b,["-","exportHtml","exportXml","exportUrl"],c);a.isOffline()||
-(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.put("importFrom",new Menu(mxUtils.bind(this,function(b,c){function e(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c=k(b.getTitle());/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");f(b.getData(),c,b.getTitle())},function(b){a.handleError(b,
-null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var f=mxUtils.bind(this,function(b,c,e){var f=d.view,g=d.getGraphBounds(),k=d.snap(Math.ceil(Math.max(0,g.x/f.scale-f.translate.x)+4*d.gridSize)),l=d.snap(Math.ceil(Math.max(0,(g.y+g.height)/f.scale-f.translate.y)+4*d.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(f){var g=!0,m=mxUtils.bind(this,function(){a.resizeImage(f,b,mxUtils.bind(this,function(f,m,n){f=g?Math.min(1,Math.min(a.maxImageSize/
-m,a.maxImageSize/n)):1;a.importFile(b,c,k,l,Math.round(m*f),Math.round(n*f),e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),g)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){g=a;m()}):m()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,k,l,0,0,e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),k=mxUtils.bind(this,function(a){var b=
-"text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){e(a.drive)},c):g&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){e(a.oneDrive)},
-c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){e(a.dropbox)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){e(a.gitHub)},c);null!=a.trello?
-b.addItem(mxResources.get("trello")+"...",null,function(){e(a.trello)},c):n&&"function"===typeof window.TrelloClient&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.importLocalFile(!1)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!0)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+
-"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){f(a,c,b)},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))}))).isEnabled=e;this.put("theme",
-new Menu(mxUtils.bind(this,function(b,c){var d=mxSettings.getUi(),e=b.addItem(mxResources.get("automatic"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"!=d&&"atlas"!=d&&"dark"!=d&&"min"!=d&&b.addCheckmark(e,Editor.checkmarkImage);b.addSeparator(c);e=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("kennedy");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"==d&&b.addCheckmark(e,
-Editor.checkmarkImage);e=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("dark"),null,function(){mxSettings.setUi("dark");
-mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==d&&b.addCheckmark(e,Editor.checkmarkImage)})));q=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&null!=b&&a!=b.getTitle()&&this.editorUi.spinner.spin(document.body,
-mxResources.get("renaming"))&&b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,null,null,null,a.editor.fileExtensions);this.editorUi.showDialog(c.container,
-340,90,!0,!0);c.init()}}));q.isEnabled=function(){return this.enabled&&e.apply(this,arguments)};q.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=a.getCopyFilename(b);b.constructor==DriveFile?(c=new CreateDialog(a,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(document.body,mxResources.get("saving"))&&b.saveAs(c,mxUtils.bind(this,function(c){b.desc=
-c;b.save(!1,mxUtils.bind(this,function(){a.spinner.stop();b.setModified(!1);b.addAllSavedStatus()}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):a.createFile(c,a.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0,null,null,null,null,a.editor.fileExtensions),a.showDialog(c.container,420,380,!0,!0),c.init()):a.editor.editAsNew(this.editorUi.getFileData(!0),
-c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(b.getMode()==App.MODE_GOOGLE||b.getMode()==App.MODE_ONEDRIVE){var c=!1;if(b.getMode()==App.MODE_GOOGLE&&null!=b.desc.parents)for(var d=0;d<b.desc.parents.length;d++)if(b.desc.parents[d].isRoot){c=!0;break}a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}),
-null,!0,c)}}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var b=a.getCurrentFile();null!=b&&a.drive.showPermissions(b.getId())}catch(x){a.handleError(x)}}));
-this.put("embed",new Menu(mxUtils.bind(this,function(b,c){var d=a.getCurrentFile();null==d||d.getMode()!=App.MODE_GOOGLE&&d.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(d.getTitle())||this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);"1"==urlParams.embed||a.isOffline()||this.addMenuItems(b,["-","googleDocs","googleSlides"],c)})));var u=function(b,c,d,e){("plantUml"!=
-e||EditorUi.enablePlantUml&&!a.isOffline())&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e){var b=new ParseDialog(a,d,e);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},y=function(a,b,c,e){var f=d.isMouseInsertPoint()?d.getInsertPoint():d.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,c),e);a.vertex=!0;d.getModel().beginUpdate();
-try{a=d.addCell(a),d.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{d.getModel().endUpdate()}d.scrollCellToVisible(a);d.setSelectionCell(a);d.container.focus();d.editAfterInsert&&d.startEditing(a);return a};a.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,k,l,m,n){b=parseInt(b);
-!isNaN(b)&&0<b&&a.exportSvg(b/100,c,d,e,f,g,k,!l,m,n)}),!0,null,"svg")}));a.actions.put("insertText",new Action(mxResources.get("text"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&d.startEditingAtCell(y("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))}),null,null,Editor.ctrlKey+"+Shift+X").isEnabled=e;a.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),function(){d.isEnabled()&&
-!d.isCellLocked(d.getDefaultParent())&&y("",120,60,"whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+K").isEnabled=e;a.actions.put("insertEllipse",new Action(mxResources.get("ellipse"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",80,80,"ellipse;whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+Shift+K").isEnabled=e;a.actions.put("insertRhombus",new Action(mxResources.get("rhombus"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",80,80,"rhombus;whiteSpace=wrap;html=1;")})).isEnabled=
-e;var z=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):u(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);a.insertTemplateEnabled&&!a.isOffline()&&this.addMenuItems(b,["insertTemplate","-"],c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);z(b,c,["fromText",
-"plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},c)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){z(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("openRecent",new Menu(function(b,c){var d=a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+
-" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},c)}));this.put("openFrom",new Menu(function(b,c){null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},c):g&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+
-"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+
-"...",null,function(){a.pickFile(App.MODE_GITHUB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},c):n&&"function"===typeof window.TrelloClient&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},c);b.addItem(mxResources.get("device")+"...",null,
-function(){a.pickFile(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&&(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);
-b.init()},c))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},c):g&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+
-"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},
-c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},c):n&&"function"===typeof window.TrelloClient&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+
-"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},c)})),this.put("openLibraryFrom",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},c):g&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+
-" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+
-" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},c):n&&"function"===typeof window.TrelloClient&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+
-"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.editor.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=
-c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(E){a.handleError(E,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c));"1"==urlParams.confLib&&(b.addSeparator(c),b.addItem(mxResources.get("confCloud",null,"Confluence Cloud")+
-"...",null,function(){a.showRemotelyStoredLibrary(mxResources.get("confCloudLibs",null,"Confluence Cloud Libraries"))},c))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip - editStyle editGeometry - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));this.put("view",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?
-["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);(!a.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),c);mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,
-"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);(!a.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=
-urlParams.embed&&this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","createShape","editDiagram"],c);b.addSeparator(c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(b,["showStartScreen"],c);!a.isOfflineApp()&&isLocalStorage&&this.addMenuItem(b,"plugins",c);b.addSeparator(c);this.addMenuItem(b,"tags",c);b.addSeparator(c);"1"==urlParams.newTempDlg&&(a.actions.addAction("templates",function(){var b=new TemplatesDialog;a.showDialog(b.container,b.width,b.height,
-!0,!1,null,!1,!0);b.init(a,function(a){console.log(a)},null,null,null,"user",function(a,b){setTimeout(function(){b?a([{url:"123",title:"Test 1Test 1Test 1Test 1Test 1Test 1Test 11Test 1Test 11Test 1Test 1dgdsgdfg fdg dfgdfg dfg dfg"},{url:"123",title:"Test 2",imgUrl:"https://www.google.com.eg/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"},{url:"123",title:"Test 3",changedBy:"Ashraf Teleb",lastModifiedOn:"Yesterday"},{url:"123",title:"Test 4"},{url:"123",title:"Test 5"},{url:"123",title:"Test 6"}]):
-a([{url:"123",title:"Test 4",imgUrl:"https://images.pexels.com/photos/459225/pexels-photo-459225.jpeg"},{url:"123",title:"Test 5"},{url:"123",title:"Test 6"},{url:"123",title:"Test 1Test 1Test 1Test 1Test 1Test 1Test 11Test 1Test 11Test 1Test 1dgdsgdfg fdg dfgdfg dfg dfg"},{url:"123",title:"Test 2",imgUrl:"https://www.google.com.eg/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"},{url:"123",title:"Test 3",changedBy:"Ashraf Teleb",lastModifiedOn:"Yesterday"}]);console.log(b)},1E3)},function(a,
-b,c){setTimeout(function(){b(c?[{url:"123",title:a+"Test 1Test 1Test 1Test 1Test 1Test 1Test 1"},{url:"123",title:a+"Test 2"},{url:"123",title:a+"Test 3"},{url:"123",title:a+"Test 4"},{url:"123",title:a+"Test 5"},{url:"123",title:a+"Test 6"}]:[{url:"123",title:a+"Test 5"},{url:"123",title:a+"Test 6"},{url:"123",title:a+"Test 1Test 1Test 1Test 1Test 1Test 1Test 1"},{url:"123",title:a+"Test 2"},{url:"123",title:a+"Test 3"},{url:"123",title:a+"Test 4"}])},2E3)},null)}),this.addMenuItem(b,"templates",
-c))})));this.put("file",new Menu(mxUtils.bind(this,function(b,c){if("1"==urlParams.embed)this.addSubmenu("importFrom",b,c),this.addSubmenu("exportAs",b,c),this.addSubmenu("embed",b,c),"1"==urlParams.libraries&&(this.addMenuItems(b,["-"],c),this.addSubmenu("newLibrary",b,c),this.addSubmenu("openLibraryFrom",b,c)),this.addMenuItems(b,"- pageSetup print - rename save".split(" "),c),"1"==urlParams.saveAndExit&&this.addMenuItems(b,["saveAndExit"],c),this.addMenuItems(b,["exit"],c);else{var d=this.editorUi.getCurrentFile();
-if(null!=d&&d.constructor==DriveFile){d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c);this.addMenuItems(b,["save","-","share"],c);var e=this.addMenuItem(b,"synchronize",c);(!a.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(e,"https://desk.draw.io/support/solutions/articles/16000087947");b.addSeparator(c)}else this.addMenuItems(b,["new"],c);this.addSubmenu("openFrom",b,c);isLocalStorage&&this.addSubmenu("openRecent",b,c);null!=d&&d.constructor==DriveFile?
-this.addMenuItems(b,["new","-","rename","makeCopy","moveToFolder"],c):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||(b.addSeparator(c),e=this.addMenuItem(b,"synchronize",c),(!a.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(e,"https://desk.draw.io/support/solutions/articles/16000087947")),this.addMenuItems(b,["-","save","saveAs"],c),this.addMenuItems(b,["-","rename"],c),a.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&
-this.addMenuItems(b,["upload"],c):(this.addMenuItems(b,["makeCopy"],c),null!=d&&d.constructor==OneDriveFile&&this.addMenuItems(b,["moveToFolder"],c)));b.addSeparator(c);this.addSubmenu("importFrom",b,c);this.addSubmenu("exportAs",b,c);b.addSeparator(c);this.addSubmenu("embed",b,c);this.addSubmenu("publish",b,c);b.addSeparator(c);this.addSubmenu("newLibrary",b,c);this.addSubmenu("openLibraryFrom",b,c);null!=d&&d.isRevisionHistorySupported()&&this.addMenuItems(b,["-","revisionHistory"],c);this.addMenuItems(b,
-["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))}})();function DiagramPage(a){this.node=a;null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};
+(b.addSeparator(c),this.addMenuItem(b,"export",c).firstChild.nextSibling.innerHTML=mxResources.get("advanced")+"...")})));this.put("importFrom",new Menu(mxUtils.bind(this,function(b,c){function e(b){b.pickFile(function(c){a.spinner.spin(document.body,mxResources.get("loading"))&&b.getFile(c,function(b){var c="data:image/"==b.getData().substring(0,11)?k(b.getTitle()):"text/xml";/\.svg$/i.test(b.getTitle())&&!a.editor.isDataSvg(b.getData())&&(b.setData(a.createSvgDataUri(b.getData())),c="image/svg+xml");
+f(b.getData(),c,b.getTitle())},function(b){a.handleError(b,null!=b?mxResources.get("errorLoadingFile"):null)},b==a.drive)},!0)}var f=mxUtils.bind(this,function(b,c,e){var f=d.view,g=d.getGraphBounds(),k=d.snap(Math.ceil(Math.max(0,g.x/f.scale-f.translate.x)+4*d.gridSize)),l=d.snap(Math.ceil(Math.max(0,(g.y+g.height)/f.scale-f.translate.y)+4*d.gridSize));"data:image/"==b.substring(0,11)?a.loadImage(b,mxUtils.bind(this,function(f){var g=!0,m=mxUtils.bind(this,function(){a.resizeImage(f,b,mxUtils.bind(this,
+function(f,m,n){f=g?Math.min(1,Math.min(a.maxImageSize/m,a.maxImageSize/n)):1;a.importFile(b,c,k,l,Math.round(m*f),Math.round(n*f),e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),g)});b.length>a.resampleThreshold?a.confirmImageResize(function(a){g=a;m()}):m()}),mxUtils.bind(this,function(){a.handleError({message:mxResources.get("cannotOpenFile")})})):a.importFile(b,c,k,l,0,0,e,function(b){a.spinner.stop();d.setSelectionCells(b);d.scrollCellToVisible(d.getSelectionCell())})}),
+k=mxUtils.bind(this,function(a){var b="text/xml";/\.png$/i.test(a)?b="image/png":/\.jpe?g$/i.test(a)?b="image/jpg":/\.gif$/i.test(a)&&(b="image/gif");return b});"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){e(a.drive)},c):g&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+
+"...",null,function(){e(a.oneDrive)},c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){e(a.dropbox)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){e(a.gitHub)},
+c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){e(a.trello)},c):n&&"function"===typeof window.TrelloClient&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.importLocalFile(!1)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.importLocalFile(!0)},c);a.isOffline()||(b.addSeparator(c),
+b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("import"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=/(\.png)($|\?)/i.test(b)?"image/png":"text/xml";a.loadUrl(PROXY_URL+"?url="+encodeURIComponent(b),function(a){f(a,c,b)},function(){a.spinner.stop();a.handleError(null,mxResources.get("errorLoadingFile"))},"image/png"==c)}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},
+c))}))).isEnabled=e;this.put("theme",new Menu(mxUtils.bind(this,function(b,c){var d=mxSettings.getUi(),e=b.addItem(mxResources.get("automatic"),null,function(){mxSettings.setUi("");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"kennedy"!=d&&"atlas"!=d&&"dark"!=d&&"min"!=d&&b.addCheckmark(e,Editor.checkmarkImage);b.addSeparator(c);e=b.addItem(mxResources.get("kennedy"),null,function(){mxSettings.setUi("kennedy");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},
+c);"kennedy"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("minimal"),null,function(){mxSettings.setUi("min");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"min"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("atlas"),null,function(){mxSettings.setUi("atlas");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"atlas"==d&&b.addCheckmark(e,Editor.checkmarkImage);e=b.addItem(mxResources.get("dark"),
+null,function(){mxSettings.setUi("dark");mxSettings.save();a.alert(mxResources.get("restartForChangeRequired"))},c);"dark"==d&&b.addCheckmark(e,Editor.checkmarkImage)})));q=this.editorUi.actions.addAction("rename...",mxUtils.bind(this,function(){var b=this.editorUi.getCurrentFile();if(null!=b){var c=null!=b.getTitle()?b.getTitle():this.editorUi.defaultFilename,c=new FilenameDialog(this.editorUi,c,mxResources.get("rename"),mxUtils.bind(this,function(a){null!=a&&0<a.length&&null!=b&&a!=b.getTitle()&&
+this.editorUi.spinner.spin(document.body,mxResources.get("renaming"))&&b.rename(a,mxUtils.bind(this,function(a){this.editorUi.spinner.stop()}),mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.get("errorRenamingFile"):null)}))}),b.constructor==DriveFile||b.constructor==StorageFile?mxResources.get("diagramName"):null,function(b){if(null!=b&&0<b.length)return!0;a.showError(mxResources.get("error"),mxResources.get("invalidName"),mxResources.get("ok"));return!1},null,null,
+null,null,a.editor.fileExtensions);this.editorUi.showDialog(c.container,340,90,!0,!0);c.init()}}));q.isEnabled=function(){return this.enabled&&e.apply(this,arguments)};q.visible="1"!=urlParams.embed;a.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(null!=b){var c=a.getCopyFilename(b);b.constructor==DriveFile?(c=new CreateDialog(a,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?a.spinner.spin(document.body,
+mxResources.get("saving"))&&b.saveAs(c,mxUtils.bind(this,function(c){b.desc=c;b.save(!1,mxUtils.bind(this,function(){a.spinner.stop();b.setModified(!1);b.addAllSavedStatus()}),mxUtils.bind(this,function(b){a.handleError(b)}))}),mxUtils.bind(this,function(b){a.handleError(b)})):a.createFile(c,a.getFileData(!0),null,d))}),mxUtils.bind(this,function(){a.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0,null,null,null,null,a.editor.fileExtensions),a.showDialog(c.container,
+420,380,!0,!0),c.init()):a.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));a.actions.addAction("moveToFolder...",mxUtils.bind(this,function(){var b=a.getCurrentFile();if(b.getMode()==App.MODE_GOOGLE||b.getMode()==App.MODE_ONEDRIVE){var c=!1;if(b.getMode()==App.MODE_GOOGLE&&null!=b.desc.parents)for(var d=0;d<b.desc.parents.length;d++)if(b.desc.parents[d].isRoot){c=!0;break}a.pickFolder(b.getMode(),mxUtils.bind(this,function(c){a.spinner.spin(document.body,mxResources.get("moving"))&&b.move(c,
+mxUtils.bind(this,function(b){a.spinner.stop()}),mxUtils.bind(this,function(b){a.handleError(b)}))}),null,!0,c)}}));this.put("publish",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["publishLink"],b)})));a.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){a.openLink("https://app.draw.io/")}));a.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+"...",function(){a.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",
+mxUtils.bind(this,function(){try{var b=a.getCurrentFile();null!=b&&a.drive.showPermissions(b.getId())}catch(x){a.handleError(x)}}));this.put("embed",new Menu(mxUtils.bind(this,function(b,c){var d=a.getCurrentFile();null==d||d.getMode()!=App.MODE_GOOGLE&&d.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(d.getTitle())||this.addMenuItems(b,["liveImage","-"],c);this.addMenuItems(b,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||a.isOffline()||this.addMenuItems(b,["embedIframe"],c);"1"==
+urlParams.embed||a.isOffline()||this.addMenuItems(b,["-","googleDocs","googleSlides"],c)})));var u=function(b,c,d,e){("plantUml"!=e||EditorUi.enablePlantUml&&!a.isOffline())&&b.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e){var b=new ParseDialog(a,d,e);a.showDialog(b.container,620,420,!0,!1);a.dialog.container.style.overflow="auto"}else b=new CreateGraphDialog(a,d,e),a.showDialog(b.container,620,420,!0,!1);b.init()}),c)},y=function(a,b,c,e){var f=d.isMouseInsertPoint()?
+d.getInsertPoint():d.getFreeInsertPoint();a=new mxCell(a,new mxGeometry(f.x,f.y,b,c),e);a.vertex=!0;d.getModel().beginUpdate();try{a=d.addCell(a),d.fireEvent(new mxEventObject("cellsInserted","cells",[a]))}finally{d.getModel().endUpdate()}d.scrollCellToVisible(a);d.setSelectionCell(a);d.container.focus();d.editAfterInsert&&d.startEditing(a);return a};a.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){a.showExportDialog(mxResources.get("formatSvg"),!0,mxResources.get("export"),
+"https://support.draw.io/display/DO/Exporting+Files",mxUtils.bind(this,function(b,c,d,e,f,g,k,l,m,n){b=parseInt(b);!isNaN(b)&&0<b&&a.exportSvg(b/100,c,d,e,f,g,k,!l,m,n)}),!0,null,"svg")}));a.actions.put("insertText",new Action(mxResources.get("text"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&d.startEditingAtCell(y("Text",40,20,"text;html=1;resizable=0;autosize=1;align=center;verticalAlign=middle;points=[];fillColor=none;strokeColor=none;rounded=0;"))}),null,null,Editor.ctrlKey+
+"+Shift+X").isEnabled=e;a.actions.put("insertRectangle",new Action(mxResources.get("rectangle"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",120,60,"whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+K").isEnabled=e;a.actions.put("insertEllipse",new Action(mxResources.get("ellipse"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",80,80,"ellipse;whiteSpace=wrap;html=1;")}),null,null,Editor.ctrlKey+"+Shift+K").isEnabled=e;a.actions.put("insertRhombus",
+new Action(mxResources.get("rhombus"),function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&y("",80,80,"rhombus;whiteSpace=wrap;html=1;")})).isEnabled=e;var z=mxUtils.bind(this,function(a,b,c){for(var d=0;d<c.length;d++)"-"==c[d]?a.addSeparator(b):u(a,b,mxResources.get(c[d])+"...",c[d])});this.put("insert",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),c);a.insertTemplateEnabled&&
+!a.isOffline()&&this.addMenuItems(b,["insertTemplate","-"],c);this.addSubmenu("insertLayout",b,c,mxResources.get("layout"));b.addSeparator(c);z(b,c,["fromText","plantUml","-","formatSql"]);b.addItem(mxResources.get("csv")+"...",null,function(){a.showImportCsvDialog()},c)})));this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){z(a,b,"horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "))})));this.put("openRecent",new Menu(function(b,c){var d=
+a.getRecent();if(null!=d){for(var e=0;e<d.length;e++)(function(d){var e=d.mode;e==App.MODE_GOOGLE?e="googleDrive":e==App.MODE_ONEDRIVE&&(e="oneDrive");b.addItem(d.title+" ("+mxResources.get(e)+")",null,function(){a.loadFile(d.id)},c)})(d[e]);b.addSeparator(c)}b.addItem(mxResources.get("reset"),null,function(){a.resetRecent()},c)}));this.put("openFrom",new Menu(function(b,c){null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickFile(App.MODE_GOOGLE)},c):g&&"function"===
+typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickFile(App.MODE_ONEDRIVE)},c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickFile(App.MODE_DROPBOX)},
+c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickFile(App.MODE_GITHUB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickFile(App.MODE_TRELLO)},c):n&&"function"===typeof window.TrelloClient&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},
+c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickFile(App.MODE_BROWSER)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.pickFile(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,"",mxResources.get("open"),function(b){null!=b&&0<b.length&&(null==a.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):
+window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c))}));Editor.enableCustomLibraries&&(this.put("newLibrary",new Menu(function(b,c){"undefined"!=typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GOOGLE)},
+c):g&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_ONEDRIVE)},c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+
+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DROPBOX)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_GITHUB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_TRELLO)},c):
+n&&"function"===typeof window.TrelloClient&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_BROWSER)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.showLibraryDialog(null,null,null,null,App.MODE_DEVICE)},c)})),this.put("openLibraryFrom",new Menu(function(b,c){"undefined"!=
+typeof google&&"undefined"!=typeof google.picker&&(null!=a.drive?b.addItem(mxResources.get("googleDrive")+"...",null,function(){a.pickLibrary(App.MODE_GOOGLE)},c):g&&"function"===typeof window.DriveClient&&b.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=a.oneDrive?b.addItem(mxResources.get("oneDrive")+"...",null,function(){a.pickLibrary(App.MODE_ONEDRIVE)},c):m&&"function"===typeof window.OneDriveClient&&b.addItem(mxResources.get("oneDrive")+
+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.dropbox?b.addItem(mxResources.get("dropbox")+"...",null,function(){a.pickLibrary(App.MODE_DROPBOX)},c):l&&"function"===typeof window.DropboxClient&&b.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=a.gitHub&&b.addItem(mxResources.get("github")+"...",null,function(){a.pickLibrary(App.MODE_GITHUB)},c);null!=a.trello?b.addItem(mxResources.get("trello")+"...",null,function(){a.pickLibrary(App.MODE_TRELLO)},
+c):n&&"function"===typeof window.TrelloClient&&b.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);b.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&b.addItem(mxResources.get("browser")+"...",null,function(){a.pickLibrary(App.MODE_BROWSER)},c);b.addItem(mxResources.get("device")+"...",null,function(){a.pickLibrary(App.MODE_DEVICE)},c);a.isOffline()||(b.addSeparator(c),b.addItem(mxResources.get("url")+"...",null,function(){var b=new FilenameDialog(a,
+"",mxResources.get("open"),function(b){if(null!=b&&0<b.length&&a.spinner.spin(document.body,mxResources.get("loading"))){var c=b;a.editor.isCorsEnabledForUrl(b)||(c=PROXY_URL+"?url="+encodeURIComponent(b));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){a.spinner.stop();try{a.loadLibrary(new UrlLibrary(this,c.getText(),b))}catch(E){a.handleError(E,mxResources.get("errorLoadingFile"))}}else a.spinner.stop(),a.handleError(null,mxResources.get("errorLoadingFile"))},function(){a.spinner.stop();
+a.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));a.showDialog(b.container,300,80,!0,!0);b.init()},c));"1"==urlParams.confLib&&(b.addSeparator(c),b.addItem(mxResources.get("confCloud",null,"Confluence Cloud")+"...",null,function(){a.showRemotelyStoredLibrary(mxResources.get("confCloudLibs",null,"Confluence Cloud Libraries"))},c))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,"undo redo - cut copy paste delete - duplicate - find - editData editTooltip - editStyle editGeometry - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));
+this.put("view",new Menu(mxUtils.bind(this,function(b,c){this.addMenuItems(b,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers","-"]));this.addMenuItems(b,["-","search"],c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(b,"scratchpad",c);(!a.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(b,"shapes - pageView pageScale - scrollbars tooltips - grid guides".split(" "),
+c);mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(b,"shadowVisible",c);this.addMenuItems(b,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(b,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",b,c),b.addSeparator(c));this.addMenuItems(b,["copyConnect","collapseExpand","-"],c);if("undefined"!==typeof MathJax){var d=this.addMenuItem(b,"mathematicalTypesetting",c);(!a.isOffline()||
+mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}"1"!=urlParams.embed&&this.addMenuItems(b,["autosave"],c);this.addMenuItems(b,["-","createShape","editDiagram"],c);b.addSeparator(c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(b,["showStartScreen"],c);!a.isOfflineApp()&&isLocalStorage&&this.addMenuItem(b,"plugins",c);b.addSeparator(c);this.addMenuItem(b,"tags",c);b.addSeparator(c);
+"1"==urlParams.newTempDlg&&(a.actions.addAction("templates",function(){var b=new TemplatesDialog;a.showDialog(b.container,b.width,b.height,!0,!1,null,!1,!0);b.init(a,function(a){console.log(a)},null,null,null,"user",function(a,b){setTimeout(function(){b?a([{url:"123",title:"Test 1Test 1Test 1Test 1Test 1Test 1Test 11Test 1Test 11Test 1Test 1dgdsgdfg fdg dfgdfg dfg dfg"},{url:"123",title:"Test 2",imgUrl:"https://www.google.com.eg/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"},{url:"123",
+title:"Test 3",changedBy:"Ashraf Teleb",lastModifiedOn:"Yesterday"},{url:"123",title:"Test 4"},{url:"123",title:"Test 5"},{url:"123",title:"Test 6"}]):a([{url:"123",title:"Test 4",imgUrl:"https://images.pexels.com/photos/459225/pexels-photo-459225.jpeg"},{url:"123",title:"Test 5"},{url:"123",title:"Test 6"},{url:"123",title:"Test 1Test 1Test 1Test 1Test 1Test 1Test 11Test 1Test 11Test 1Test 1dgdsgdfg fdg dfgdfg dfg dfg"},{url:"123",title:"Test 2",imgUrl:"https://www.google.com.eg/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"},
+{url:"123",title:"Test 3",changedBy:"Ashraf Teleb",lastModifiedOn:"Yesterday"}]);console.log(b)},1E3)},function(a,b,c){setTimeout(function(){b(c?[{url:"123",title:a+"Test 1Test 1Test 1Test 1Test 1Test 1Test 1"},{url:"123",title:a+"Test 2"},{url:"123",title:a+"Test 3"},{url:"123",title:a+"Test 4"},{url:"123",title:a+"Test 5"},{url:"123",title:a+"Test 6"}]:[{url:"123",title:a+"Test 5"},{url:"123",title:a+"Test 6"},{url:"123",title:a+"Test 1Test 1Test 1Test 1Test 1Test 1Test 1"},{url:"123",title:a+"Test 2"},
+{url:"123",title:a+"Test 3"},{url:"123",title:a+"Test 4"}])},2E3)},null)}),this.addMenuItem(b,"templates",c))})));this.put("file",new Menu(mxUtils.bind(this,function(b,c){if("1"==urlParams.embed)this.addSubmenu("importFrom",b,c),this.addSubmenu("exportAs",b,c),this.addSubmenu("embed",b,c),"1"==urlParams.libraries&&(this.addMenuItems(b,["-"],c),this.addSubmenu("newLibrary",b,c),this.addSubmenu("openLibraryFrom",b,c)),this.addMenuItems(b,"- pageSetup print - rename save".split(" "),c),"1"==urlParams.saveAndExit&&
+this.addMenuItems(b,["saveAndExit"],c),this.addMenuItems(b,["exit"],c);else{var d=this.editorUi.getCurrentFile();if(null!=d&&d.constructor==DriveFile){d.isRestricted()&&this.addMenuItems(b,["exportOptionsDisabled"],c);this.addMenuItems(b,["save","-","share"],c);var e=this.addMenuItem(b,"synchronize",c);(!a.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(e,"https://desk.draw.io/support/solutions/articles/16000087947");b.addSeparator(c)}else this.addMenuItems(b,["new"],
+c);this.addSubmenu("openFrom",b,c);isLocalStorage&&this.addSubmenu("openRecent",b,c);null!=d&&d.constructor==DriveFile?this.addMenuItems(b,["new","-","rename","makeCopy","moveToFolder"],c):(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||null==d||d.constructor==LocalFile||(b.addSeparator(c),e=this.addMenuItem(b,"synchronize",c),(!a.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(e,"https://desk.draw.io/support/solutions/articles/16000087947")),this.addMenuItems(b,["-",
+"save","saveAs"],c),this.addMenuItems(b,["-","rename"],c),a.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&this.addMenuItems(b,["upload"],c):(this.addMenuItems(b,["makeCopy"],c),null!=d&&d.constructor==OneDriveFile&&this.addMenuItems(b,["moveToFolder"],c)));b.addSeparator(c);this.addSubmenu("importFrom",b,c);this.addSubmenu("exportAs",b,c);b.addSeparator(c);this.addSubmenu("embed",b,c);this.addSubmenu("publish",b,c);b.addSeparator(c);this.addSubmenu("newLibrary",b,c);this.addSubmenu("openLibraryFrom",
+b,c);null!=d&&d.isRevisionHistorySupported()&&this.addMenuItems(b,["-","revisionHistory"],c);this.addMenuItems(b,["-","pageSetup"],c);mxClient.IS_IOS&&navigator.standalone||this.addMenuItems(b,["print"],c);this.addMenuItems(b,["-","close"])}})))}})();function DiagramPage(a){this.node=a;null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};
function RenamePage(a,c,b){this.ui=a;this.page=c;this.previous=this.name=b}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(a,c,b){this.ui=a;this.oldIndex=c;this.newIndex=b}
MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(a,c,b){this.ui=a;this.previousPage=this.page=c;this.neverShown=!0;null!=c&&(this.neverShown=null==c.viewState,this.ui.updatePageRoot(c),null!=b&&(c.viewState=b,this.neverShown=!1))}
SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,c=this.ui.editor,b=c.graph,d=Graph.compressNode(c.getGraphXml(!0));mxUtils.setTextContent(a.node,d);a.viewState=b.getViewState();a.root=b.model.root;null!=a.model&&a.model.rootChanged(a.root);b.view.clear(a.root,!0);b.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;b.model.prefix=Editor.guid()+"-";b.model.rootChanged(a.root);
diff --git a/src/main/webapp/js/diagramly/App.js b/src/main/webapp/js/diagramly/App.js
index 033240cf..5669fce3 100644
--- a/src/main/webapp/js/diagramly/App.js
+++ b/src/main/webapp/js/diagramly/App.js
@@ -1023,7 +1023,7 @@ App.prototype.init = function()
var day = new Date().getDay();
var isWeekend = (day === 6) || (day === 0);
- if (isWeekend || Math.random() > 0.8)
+ if (isWeekend || Math.random() > 0.6)
{
var footer = document.createElement('div');
footer.style.cssText = 'position:absolute;bottom:0px;max-width:90%;padding:10px;padding-right:26px;' +
@@ -3194,28 +3194,6 @@ 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.
*
* @param {number} dx X-coordinate of the translation.
diff --git a/src/main/webapp/js/diagramly/DrawioFile.js b/src/main/webapp/js/diagramly/DrawioFile.js
index 9c4033f8..ddafffa3 100644
--- a/src/main/webapp/js/diagramly/DrawioFile.js
+++ b/src/main/webapp/js/diagramly/DrawioFile.js
@@ -1036,6 +1036,14 @@ DrawioFile.prototype.loadPatchDescriptor = function(success, error)
};
/**
+ * Adds the listener for automatically saving the diagram for local changes.
+ */
+DrawioFile.prototype.patchDescriptor = function(desc, patch)
+{
+ this.setDescriptorEtag(desc, this.getDescriptorEtag(patch));
+};
+
+/**
* Creates a starts the synchronization.
*/
DrawioFile.prototype.startSync = function()
diff --git a/src/main/webapp/js/diagramly/DrawioFileSync.js b/src/main/webapp/js/diagramly/DrawioFileSync.js
index 84d08c13..8e7901e0 100644
--- a/src/main/webapp/js/diagramly/DrawioFileSync.js
+++ b/src/main/webapp/js/diagramly/DrawioFileSync.js
@@ -630,9 +630,7 @@ DrawioFileSync.prototype.fileChanged = function(success, error, abort)
}
else
{
- this.catchup(this.file.getDescriptorEtag(desc),
- this.file.getDescriptorSecret(desc),
- success, error, abort);
+ this.catchup(desc, success, error, abort);
}
}
}), error);
@@ -684,12 +682,14 @@ DrawioFileSync.prototype.updateDescriptor = function(desc)
/**
* Adds the listener for automatically saving the diagram for local changes.
*/
-DrawioFileSync.prototype.catchup = function(etag, secret, success, error, abort)
+DrawioFileSync.prototype.catchup = function(desc, success, error, abort)
{
if (abort == null || !abort())
{
+ var secret = this.file.getDescriptorSecret(desc);
+ var etag = this.file.getDescriptorEtag(desc);
var current = this.file.getCurrentEtag();
-
+
if (current == etag)
{
if (success != null)
@@ -820,7 +820,7 @@ DrawioFileSync.prototype.catchup = function(etag, secret, success, error, abort)
if (temp.length > 0)
{
this.file.stats.cacheHits++;
- this.merge(temp, checksum, etag, success, error, abort);
+ this.merge(temp, checksum, desc, success, error, abort);
}
// Retries if cache entry was not yet there
else if (cacheReadyRetryCount <= this.maxCacheReadyRetries &&
@@ -882,7 +882,7 @@ DrawioFileSync.prototype.reload = function(success, error, abort, shadow)
/**
* Adds the listener for automatically saving the diagram for local changes.
*/
-DrawioFileSync.prototype.merge = function(patches, checksum, etag, success, error, abort)
+DrawioFileSync.prototype.merge = function(patches, checksum, desc, success, error, abort)
{
try
{
@@ -897,6 +897,7 @@ DrawioFileSync.prototype.merge = function(patches, checksum, etag, success, erro
this.ui.diffPages(this.file.shadowPages,
this.ui.pages) : null;
var ignored = this.file.ignorePatches(patches);
+ var etag = this.file.getDescriptorEtag(desc);
if (!ignored)
{
@@ -946,7 +947,7 @@ DrawioFileSync.prototype.merge = function(patches, checksum, etag, success, erro
this.file.invalidChecksum = false;
this.file.inConflictState = false;
- this.file.setCurrentEtag(etag);
+ this.file.patchDescriptor(this.file.getDescriptor(), desc);
this.file.backupPatch = null;
if (success != null)
@@ -1147,9 +1148,7 @@ DrawioFileSync.prototype.fileConflict = function(desc, success, error)
if (desc != null)
{
- var etag = this.file.getDescriptorEtag(desc);
- var secret = this.file.getDescriptorSecret(desc);
- this.catchup(etag, secret, success, error);
+ this.catchup(desc, success, error);
}
else
{
diff --git a/src/main/webapp/js/diagramly/DriveClient.js b/src/main/webapp/js/diagramly/DriveClient.js
index 33d899dd..5da29362 100644
--- a/src/main/webapp/js/diagramly/DriveClient.js
+++ b/src/main/webapp/js/diagramly/DriveClient.js
@@ -61,7 +61,7 @@ DriveClient.prototype.allFields = 'kind,id,parents,headRevisionId,etag,title,mim
*
* TODO: Limit to etag and ekey property only
*/
-DriveClient.prototype.catchupFields = 'etag,properties(key,value)';
+DriveClient.prototype.catchupFields = 'etag,headRevisionId,modifiedDate,properties(key,value)';
/**
* Specifies if thumbnails should be enabled. Default is true.
@@ -789,6 +789,11 @@ DriveClient.prototype.getFile = function(id, success, error, readXml, readLibrar
// Redirects title to originalFilename to
// match expected descriptor interface
resp.title = resp.originalFilename;
+
+ // Uses ID of file instead of revision ID in descriptor
+ // to avoid a change of the document hash property
+ resp.headRevisionId = resp.id;
+ resp.id = id;
this.getXmlFile(resp, success, error);
}), error);
@@ -952,10 +957,12 @@ DriveClient.prototype.getXmlFile = function(resp, success, error, ignoreMime, re
}
else
{
+ var importFile = false;
+
if (/\.png$/i.test(resp.title))
{
var index = data.lastIndexOf(',');
-
+
if (index > 0)
{
var xml = this.ui.extractGraphModelFromPng(data.substring(index + 1));
@@ -971,22 +978,24 @@ DriveClient.prototype.getXmlFile = function(resp, success, error, ignoreMime, re
// is required for creating the images for .PNG and .SVG files.
try
{
- var temp = atob(data.substring(index + 1));
+ var xml = data.substring(index + 1);
+ var temp = (window.atob && !mxClient.IS_IE && !mxClient.IS_IE11) ?
+ atob(xml) : Base64.decode(xml);
+ var node = this.ui.editor.extractGraphModel(
+ mxUtils.parseXml(temp).documentElement, true);
- if (temp != null && (temp.substring(0, 8) === '<mxfile ' ||
- temp.substring(0, 14) === '<mxGraphModel ' ||
- temp.substring(0, 14) === '<mxGraphModel>'))
- {
- data = temp;
- }
+ if (node == null || node.getElementsByTagName('parsererror').length > 0)
+ {
+ importFile = true;
+ }
else
{
- // TODO: Import as PNG
+ data = temp;
}
}
catch (e)
{
- // ignore
+ importFile = true;
}
}
}
@@ -998,7 +1007,7 @@ DriveClient.prototype.getXmlFile = function(resp, success, error, ignoreMime, re
data = (window.atob && !mxClient.IS_SF) ? atob(temp) : Base64.decode(temp);
}
- success(new DriveFile(this.ui, data, resp));
+ success((importFile) ? new LocalFile(this.ui, data, resp.title, true) : new DriveFile(this.ui, data, resp));
}
}
catch (e)
@@ -2451,7 +2460,7 @@ DriveClient.prototype.convertRealtimeFiles = function()
var day = new Date().getDay();
var isWeekend = (day === 6) || (day === 0);
var q = 'mimeType=\'application/vnd.jgraph.mxfile.realtime\'';
- var convertDelay = (isWeekend) ? 2000 : 15000;
+ var convertDelay = (isWeekend) ? 1000 : 5000;
var convertedIds = {};
var converted = 0;
var fromJson = 0;
@@ -2483,15 +2492,14 @@ DriveClient.prototype.convertRealtimeFiles = function()
{
var dt = Date.now() - t0;
- EditorUi.sendReport('Convert Realtime Report ' +
- new Date().toISOString() + ':' +
- '\n\nBrowser=' + navigator.userAgent +
- '\nUser=' + ((this.user != null) ? this.user.id : 'unknown') +
- '\nFound=' + total + ' (Backup: ' + fromXml + ', Realtime: ' + fromJson + ')' +
- '\nConverted=' + converted +
- '\nFailed=' + failed + ' (Load: ' + loadFail + ', Save: ' +
- saveFail + ', Invalid: ' + invalid + ')' +
- '\ndt=' + Math.round(dt / 1000) + ' sec(s)');
+ // Logs conversion
+ EditorUi.logEvent({category: 'AUTO-CONVERT',
+ action: 'total-' + total + '-xml-' + fromXml +
+ '-json-' + fromJson + '-done-' + converted +
+ '-fail-' + failed + '-load-' + loadFail +
+ '-save-' + saveFail + '-invalid-' + invalid +
+ '-dt-' + Math.round(dt / 1000),
+ label: (this.user != null) ? this.user.id : 'unknown-user'});
}
catch (e)
{
@@ -2622,7 +2630,7 @@ DriveClient.prototype.convertRealtimeFiles = function()
if (acceptResponse)
{
converted++;
- print('<img src="' + Editor.checkmarkImage + '" border="0" valign="middle"/>');
+ print('OK <img src="' + Editor.checkmarkImage + '" border="0" valign="middle"/>');
doNextPage();
}
}), mxUtils.bind(this, function(err)
diff --git a/src/main/webapp/js/diagramly/DriveFile.js b/src/main/webapp/js/diagramly/DriveFile.js
index 756386a3..fa81551d 100644
--- a/src/main/webapp/js/diagramly/DriveFile.js
+++ b/src/main/webapp/js/diagramly/DriveFile.js
@@ -646,6 +646,17 @@ DriveFile.prototype.loadPatchDescriptor = function(success, error)
/**
* Adds the listener for automatically saving the diagram for local changes.
*/
+DriveFile.prototype.patchDescriptor = function(desc, patch)
+{
+ DrawioFile.prototype.patchDescriptor.apply(this, arguments);
+
+ desc.headRevisionId = patch.headRevisionId;
+ desc.modifiedDate = patch.modifiedDate;
+};
+
+/**
+ * Adds the listener for automatically saving the diagram for local changes.
+ */
DriveFile.prototype.loadDescriptor = function(success, error)
{
this.ui.drive.loadDescriptor(this.getId(), success, error);
diff --git a/src/main/webapp/js/diagramly/EditorUi.js b/src/main/webapp/js/diagramly/EditorUi.js
index e07598ef..222e6fe8 100644
--- a/src/main/webapp/js/diagramly/EditorUi.js
+++ b/src/main/webapp/js/diagramly/EditorUi.js
@@ -653,6 +653,28 @@
};
/**
+ * Returns true if the given binary data is a Visio file.
+ */
+ EditorUi.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.
+ */
+ EditorUi.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;
+ };
+
+ /**
* Extracts the mxfile from the given HTML data from a data transfer event.
*/
var editorUiExtractGraphModelFromHtml = EditorUi.prototype.extractGraphModelFromHtml;
@@ -7954,19 +7976,33 @@
*/
EditorUi.prototype.loadImage = function(uri, onload, onerror)
{
- var img = new Image();
-
- img.onload = function()
+ try
{
- onload(img);
+ var img = new Image();
+
+ img.onload = function()
+ {
+ onload(img);
+ }
+
+ if (onerror != null)
+ {
+ img.onerror = onerror;
+ }
+
+ img.src = uri;
}
-
- if (onerror != null)
+ catch (e)
{
- img.onerror = onerror;
+ if (onerror != null)
+ {
+ onerror(e);
+ }
+ else
+ {
+ throw e;
+ }
}
-
- img.src = uri;
};
// Initializes the user interface
diff --git a/src/main/webapp/js/diagramly/Menus.js b/src/main/webapp/js/diagramly/Menus.js
index d554e563..88435b6d 100644
--- a/src/main/webapp/js/diagramly/Menus.js
+++ b/src/main/webapp/js/diagramly/Menus.js
@@ -1823,7 +1823,7 @@
// as slightly different semantic, but works the same way.
service.getFile(id, function(file)
{
- var mime = getMimeType(file.getTitle());
+ var mime = (file.getData().substring(0, 11) == 'data:image/') ? getMimeType(file.getTitle()) : 'text/xml';
// Imports SVG as images
if (/\.svg$/i.test(file.getTitle()) && !editorUi.editor.isDataSvg(file.getData()))
diff --git a/src/main/webapp/js/diagramly/OneDriveFile.js b/src/main/webapp/js/diagramly/OneDriveFile.js
index 85450285..e45c750c 100644
--- a/src/main/webapp/js/diagramly/OneDriveFile.js
+++ b/src/main/webapp/js/diagramly/OneDriveFile.js
@@ -43,7 +43,8 @@ OneDriveFile.prototype.getParentId = function()
OneDriveFile.prototype.getIdOf = function(itemObj, parent)
{
//TODO driveId is most probably always there. No need to check if it exists. Also, after some time, the code that check the old id format won't be needed
- return (itemObj.parentReference.driveId? itemObj.parentReference.driveId + '/' : '') + (parent? itemObj.parentReference.id : itemObj.id);
+ return ((itemObj.parentReference != null && itemObj.parentReference.driveId != null) ? itemObj.parentReference.driveId + '/' : '') +
+ ((parent != null) ? itemObj.parentReference.id : itemObj.id);
};
/**
diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.js
index 6137d5b0..9f1c4dab 100644
--- a/src/main/webapp/js/viewer.min.js
+++ b/src/main/webapp/js/viewer.min.js
@@ -107,14 +107,13 @@ ko:"한국어",ja:"日本語",zh:"简体中文","zh-tw":"繁體中文"};"undefin
window.uiTheme=window.uiTheme||function(){var a=urlParams.ui;if(null==a&&"undefined"!==typeof JSON&&isLocalStorage)try{var b=localStorage.getItem(".drawio-config");null!=b&&(a=JSON.parse(b).ui||null)}catch(c){isLocalStorage=!1}try{null==a&&414>=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)&&(a="min")}catch(c){}return a}();function setCurrentXml(a,b){null!=window.parent&&null!=window.parent.openFile&&window.parent.openFile.setData(a,b)}
(function(){if("undefined"!==typeof JSON&&isLocalStorage)try{var a=localStorage.getItem(".drawio-config"),b=!0;null!=a&&(b=JSON.parse(a).showStartScreen);0==b&&(urlParams.splash="0")}catch(c){}a=urlParams["export"];null!=a&&("http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&(a="http://"+a),EXPORT_URL=a);window.DRAWIO_LOG_URL=window.DRAWIO_LOG_URL||"";b=window.location.host;"test.draw.io"!=b&&(a=b.length-7,b=b.lastIndexOf("draw.io",a),-1!==b&&b===a&&(window.DRAWIO_LOG_URL="https://log.draw.io"))})();
if("1"==urlParams.offline||"1"==urlParams.demo||"1"==urlParams.stealth||"1"==urlParams.local)urlParams.picker="0",urlParams.gapi="0",urlParams.db="0",urlParams.od="0",urlParams.gh="0",urlParams.tr="0";if("1"==urlParams.offline||"1"==urlParams.local)urlParams.math="0";"1"==urlParams.lightbox&&(urlParams.chrome="0");(null==window.location.hash||1>=window.location.hash.length)&&null!=urlParams.open&&(window.location.hash=urlParams.open);window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
-window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"3.9.13",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
+window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"4.0.1",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
-0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||
-0<=navigator.userAgent.indexOf("Epiphany/")||0<=navigator.userAgent.indexOf("AppleWebKit/")||0<=navigator.userAgent.indexOf("Gecko/")||0<=navigator.userAgent.indexOf("Opera/")||null!=document.documentMode&&9<=document.documentMode,NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg","foreignObject")||0<=navigator.userAgent.indexOf("Opera/"),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_WIN:0<navigator.appVersion.indexOf("Win"),
-IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(0<navigator.appVersion.indexOf("Mac")),IS_LOCAL:0>document.location.href.indexOf("http://")&&0>document.location.href.indexOf("https://"),defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(a,b,c){c=c||document;if(mxClient.IS_IE6)c.write('<link rel="'+a+'" href="'+b+'" charset="UTF-8" type="text/css"/>');else{var d=
-c.createElement("link");d.setAttribute("rel",a);d.setAttribute("href",b);d.setAttribute("charset","UTF-8");d.setAttribute("type","text/css");c.getElementsByTagName("head")[0].appendChild(d)}},loadResources:function(a,b){function c(){0==--d&&a()}for(var d=mxClient.defaultBundles.length,e=0;e<mxClient.defaultBundles.length;e++)mxResources.add(mxClient.defaultBundles[e],b,c)},include:function(a){document.write('<script src="'+a+'">\x3c/script>')}};
-"undefined"==typeof mxLoadResources&&(mxLoadResources=!0);"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1);"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt");"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0);"undefined"!=typeof mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".";
+0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_VML:"MICROSOFT INTERNET EXPLORER"==navigator.appName.toUpperCase(),IS_SVG:"MICROSOFT INTERNET EXPLORER"!=navigator.appName.toUpperCase(),NO_FO:!document.createElementNS||"[object SVGForeignObjectElement]"!=document.createElementNS("http://www.w3.org/2000/svg",
+"foreignObject")||0<=navigator.userAgent.indexOf("Opera/"),IS_WIN:0<navigator.appVersion.indexOf("Win"),IS_MAC:0<navigator.appVersion.indexOf("Mac"),IS_TOUCH:"ontouchstart"in document.documentElement,IS_POINTER:null!=window.PointerEvent&&!(0<navigator.appVersion.indexOf("Mac")),IS_LOCAL:0>document.location.href.indexOf("http://")&&0>document.location.href.indexOf("https://"),defaultBundles:[],isBrowserSupported:function(){return mxClient.IS_VML||mxClient.IS_SVG},link:function(a,b,c){c=c||document;
+if(mxClient.IS_IE6)c.write('<link rel="'+a+'" href="'+b+'" charset="UTF-8" type="text/css"/>');else{var d=c.createElement("link");d.setAttribute("rel",a);d.setAttribute("href",b);d.setAttribute("charset","UTF-8");d.setAttribute("type","text/css");c.getElementsByTagName("head")[0].appendChild(d)}},loadResources:function(a,b){function c(){0==--d&&a()}for(var d=mxClient.defaultBundles.length,e=0;e<mxClient.defaultBundles.length;e++)mxResources.add(mxClient.defaultBundles[e],b,c)},include:function(a){document.write('<script src="'+
+a+'">\x3c/script>')}};"undefined"==typeof mxLoadResources&&(mxLoadResources=!0);"undefined"==typeof mxForceIncludes&&(mxForceIncludes=!1);"undefined"==typeof mxResourceExtension&&(mxResourceExtension=".txt");"undefined"==typeof mxLoadStylesheets&&(mxLoadStylesheets=!0);"undefined"!=typeof mxBasePath&&0<mxBasePath.length?("/"==mxBasePath.substring(mxBasePath.length-1)&&(mxBasePath=mxBasePath.substring(0,mxBasePath.length-1)),mxClient.basePath=mxBasePath):mxClient.basePath=".";
"undefined"!=typeof mxImageBasePath&&0<mxImageBasePath.length?("/"==mxImageBasePath.substring(mxImageBasePath.length-1)&&(mxImageBasePath=mxImageBasePath.substring(0,mxImageBasePath.length-1)),mxClient.imageBasePath=mxImageBasePath):mxClient.imageBasePath=mxClient.basePath+"/images";mxClient.language="undefined"!=typeof mxLanguage&&null!=mxLanguage?mxLanguage:mxClient.IS_IE?navigator.userLanguage:navigator.language;
mxClient.defaultLanguage="undefined"!=typeof mxDefaultLanguage&&null!=mxDefaultLanguage?mxDefaultLanguage:"en";mxLoadStylesheets&&mxClient.link("stylesheet",mxClient.basePath+"/css/common.css");"undefined"!=typeof mxLanguages&&null!=mxLanguages&&(mxClient.languages=mxLanguages);
mxClient.IS_VML&&(mxClient.IS_SVG?mxClient.IS_VML=!1:(8==document.documentMode?(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml","#default#VML"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office","#default#VML")):(document.namespaces.add(mxClient.VML_PREFIX,"urn:schemas-microsoft-com:vml"),document.namespaces.add(mxClient.OFFICE_PREFIX,"urn:schemas-microsoft-com:office:office")),mxClient.IS_QUIRKS&&30<=document.styleSheets.length?function(){var a=
@@ -1219,7 +1218,7 @@ mxGraph.prototype.fit=function(a,b,c,d,e,f,g){if(null!=this.container){a=null!=a
(n=Math.max(n,this.backgroundImage.width-g.x/k),p=Math.max(p,this.backgroundImage.height-g.y/k));var q=(b?a:2*a)+c+1,l=l-q,m=m-q;e=e?m/p:f?l/n:Math.min(l/n,m/p);null!=this.minFitScale&&(e=Math.max(e,this.minFitScale));null!=this.maxFitScale&&(e=Math.min(e,this.maxFitScale));if(d)b?this.view.scale!=e&&this.view.setScale(e):mxUtils.hasScrollbars(this.container)?(this.view.setScale(e),a=this.getGraphBounds(),null!=a.x&&(this.container.scrollLeft=a.x),null!=a.y&&(this.container.scrollTop=a.y)):this.view.scaleAndTranslate(e,
null!=g.x?Math.floor(this.view.translate.x-g.x/k+a/e+c/2):a,null!=g.y?Math.floor(this.view.translate.y-g.y/k+a/e+c/2):a);else return e}}return this.view.scale};
mxGraph.prototype.sizeDidChange=function(){var a=this.getGraphBounds();if(null!=this.container){var b=this.getBorder(),c=Math.max(0,a.x+a.width+2*b*this.view.scale),b=Math.max(0,a.y+a.height+2*b*this.view.scale);null!=this.minimumContainerSize&&(c=Math.max(c,this.minimumContainerSize.width),b=Math.max(b,this.minimumContainerSize.height));this.resizeContainer&&this.doResizeContainer(c,b);if(this.preferPageSize||!mxClient.IS_IE&&this.pageVisible){var d=this.getPreferredPageSize(a,Math.max(1,c),Math.max(1,
-b));null!=d&&(c=d.width*this.view.scale,b=d.height*this.view.scale)}null!=this.minimumGraphSize&&(c=Math.max(c,this.minimumGraphSize.width*this.view.scale),b=Math.max(b,this.minimumGraphSize.height*this.view.scale));c=Math.ceil(c);b=Math.ceil(b);this.dialect==mxConstants.DIALECT_SVG?(d=this.view.getDrawPane().ownerSVGElement,d.style.minWidth=Math.max(1,c)+"px",d.style.minHeight=Math.max(1,b)+"px",d.style.width="100%",d.style.height="100%"):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,
+b));null!=d&&(c=d.width*this.view.scale,b=d.height*this.view.scale)}null!=this.minimumGraphSize&&(c=Math.max(c,this.minimumGraphSize.width*this.view.scale),b=Math.max(b,this.minimumGraphSize.height*this.view.scale));c=Math.ceil(c);b=Math.ceil(b);this.dialect==mxConstants.DIALECT_SVG?(d=this.view.getDrawPane().ownerSVGElement,null!=d&&(d.style.minWidth=Math.max(1,c)+"px",d.style.minHeight=Math.max(1,b)+"px",d.style.width="100%",d.style.height="100%")):mxClient.IS_QUIRKS?this.view.updateHtmlCanvasSize(Math.max(1,
c),Math.max(1,b)):(this.view.canvas.style.minWidth=Math.max(1,c)+"px",this.view.canvas.style.minHeight=Math.max(1,b)+"px");this.updatePageBreaks(this.pageBreaksVisible,c,b)}this.fireEvent(new mxEventObject(mxEvent.SIZE,"bounds",a))};mxGraph.prototype.doResizeContainer=function(a,b){null!=this.maximumContainerSize&&(a=Math.min(this.maximumContainerSize.width,a),b=Math.min(this.maximumContainerSize.height,b));this.container.style.width=Math.ceil(a)+"px";this.container.style.height=Math.ceil(b)+"px"};
mxGraph.prototype.updatePageBreaks=function(a,b,c){b=this.view.scale;c=this.view.translate;var d=this.pageFormat,e=b*this.pageScale,f=new mxRectangle(0,0,d.width*e,d.height*e),d=mxRectangle.fromRectangle(this.getGraphBounds());d.width=Math.max(1,d.width);d.height=Math.max(1,d.height);f.x=Math.floor((d.x-c.x*b)/f.width)*f.width+c.x*b;f.y=Math.floor((d.y-c.y*b)/f.height)*f.height+c.y*b;d.width=Math.ceil((d.width+(d.x-f.x))/f.width)*f.width;d.height=Math.ceil((d.height+(d.y-f.y))/f.height)*f.height;
var g=(a=a&&Math.min(f.width,f.height)>this.minPageBreakDist)?Math.ceil(d.height/f.height)+1:0,k=a?Math.ceil(d.width/f.width)+1:0,l=(k-1)*f.width,m=(g-1)*f.height;null==this.horizontalPageBreaks&&0<g&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<k&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var b=a==this.horizontalPageBreaks?g:k,c=0;c<=b;c++){var d=a==this.horizontalPageBreaks?[new mxPoint(Math.round(f.x),Math.round(f.y+c*f.height)),new mxPoint(Math.round(f.x+
@@ -1963,8 +1962,8 @@ x.style.color=.5>.213*this.rgb[0]+.715*this.rgb[1]+.072*this.rgb[2]?"#FFF":"#000
this.rgb[1]=b;var e=null===c?this.rgb[2]:this.rgb[2]=c,f=Math.min(Math.min(a,b),e);c=Math.max(Math.max(a,b),e);var g=c-f;0===g?a=[null,0,c]:(a=a===f?3+(e-b)/g:b===f?5+(a-e)/g:1+(b-a)/g,a=[6===a?0:a,g/c,c]);null!==a[0]&&(this.hsv[0]=a[0]);0!==a[2]&&(this.hsv[1]=a[1]);this.hsv[2]=a[2];this.exportColor(d)};this.fromString=function(a,b){var c=a.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);return c?(6===c[1].length?this.fromRGB(parseInt(c[1].substr(0,2),16)/255,parseInt(c[1].substr(2,2),16)/255,parseInt(c[1].substr(4,
2),16)/255,b):this.fromRGB(parseInt(c[1].charAt(0)+c[1].charAt(0),16)/255,parseInt(c[1].charAt(1)+c[1].charAt(1),16)/255,parseInt(c[1].charAt(2)+c[1].charAt(2),16)/255,b),!0):!1};this.toString=function(){return(256|Math.round(255*this.rgb[0])).toString(16).substr(1)+(256|Math.round(255*this.rgb[1])).toString(16).substr(1)+(256|Math.round(255*this.rgb[2])).toString(16).substr(1)};var r=this,t="hvs"===this.pickerMode.toLowerCase()?1:0,u=jscolor.fetchElement(this.valueElement),x=jscolor.fetchElement(this.styleElement),
y=!1,A=!1,z=1,v=2,B=4,C=8;u&&(q=function(){r.fromString(u.value,z);p()},jscolor.addEvent(u,"keyup",q),jscolor.addEvent(u,"input",q),jscolor.addEvent(u,"blur",l),u.setAttribute("autocomplete","off"));x&&(x.jscStyle={backgroundImage:x.style.backgroundImage,backgroundColor:x.style.backgroundColor,color:x.style.color});switch(t){case 0:jscolor.requireImage("hs.png");break;case 1:jscolor.requireImage("hv.png")}this.importColor()}};jscolor.install();
-Editor=function(a,b,e,d,k){mxEventSource.call(this);this.chromeless=null!=a?a:this.chromeless;this.initStencilRegistry();this.graph=d||this.createGraph(b,e);this.editable=null!=k?k:!a;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(a){this.status=a;this.fireEvent(new mxEventObject("statusChanged"))};this.getStatus=
-function(){return this.status};this.graphChangeListener=function(a,b){var d=null!=b?b.getProperty("edit"):null;null!=d&&d.ignoreEdit||this.setModified(!0)};this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)}));this.graph.resetViewOnRootChange=!1;this.init()};Editor.pageCounter=0;
+Editor=function(a,b,e,c,k){mxEventSource.call(this);this.chromeless=null!=a?a:this.chromeless;this.initStencilRegistry();this.graph=c||this.createGraph(b,e);this.editable=null!=k?k:!a;this.undoManager=this.createUndoManager();this.status="";this.getOrCreateFilename=function(){return this.filename||mxResources.get("drawing",[Editor.pageCounter])+".xml"};this.getFilename=function(){return this.filename};this.setStatus=function(a){this.status=a;this.fireEvent(new mxEventObject("statusChanged"))};this.getStatus=
+function(){return this.status};this.graphChangeListener=function(a,b){var c=null!=b?b.getProperty("edit"):null;null!=c&&c.ignoreEdit||this.setModified(!0)};this.graph.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.graphChangeListener.apply(this,arguments)}));this.graph.resetViewOnRootChange=!1;this.init()};Editor.pageCounter=0;
(function(){try{for(var a=window;null!=a.opener&&"undefined"!==typeof a.opener.Editor&&!isNaN(a.opener.Editor.pageCounter)&&a.opener!=a;)a=a.opener;null!=a&&(a.Editor.pageCounter++,Editor.pageCounter=a.Editor.pageCounter)}catch(b){}})();Editor.useLocalStorage="undefined"!=typeof Storage&&mxClient.IS_IOS;
Editor.helpImage=mxClient.IS_SVG?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSJub25lIiBkPSJNMCAwaDI0djI0SDB6Ii8+PHBhdGggZD0iTTExIDE4aDJ2LTJoLTJ2MnptMS0xNkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMCAxOGMtNC40MSAwLTgtMy41OS04LThzMy41OS04IDgtOCA4IDMuNTkgOCA4LTMuNTkgOC04IDh6bTAtMTRjLTIuMjEgMC00IDEuNzktNCA0aDJjMC0xLjEuOS0yIDItMnMyIC45IDIgMmMwIDItMyAxLjc1LTMgNWgyYzAtMi4yNSAzLTIuNSAzLTUgMC0yLjIxLTEuNzktNC00LTR6Ii8+PC9zdmc+":IMAGE_PATH+
"/help.png";
@@ -2000,14 +1999,14 @@ Editor.prototype.getGraphXml=function(a){a=(null!=a?a:1)?(new mxCodec(mxUtils.cr
this.graph.gridSize);a.setAttribute("guides",this.graph.graphHandler.guidesEnabled?"1":"0");a.setAttribute("tooltips",this.graph.tooltipHandler.isEnabled()?"1":"0");a.setAttribute("connect",this.graph.connectionHandler.isEnabled()?"1":"0");a.setAttribute("arrows",this.graph.connectionArrowsEnabled?"1":"0");a.setAttribute("fold",this.graph.foldingEnabled?"1":"0");a.setAttribute("page",this.graph.pageVisible?"1":"0");a.setAttribute("pageScale",this.graph.pageScale);a.setAttribute("pageWidth",this.graph.pageFormat.width);
a.setAttribute("pageHeight",this.graph.pageFormat.height);null!=this.graph.background&&a.setAttribute("background",this.graph.background);return a};Editor.prototype.updateGraphComponents=function(){var a=this.graph;null!=a.container&&(a.view.validateBackground(),a.container.style.overflow=a.scrollbars?"auto":this.defaultGraphOverflow,this.fireEvent(new mxEventObject("updateGraphComponents")))};Editor.prototype.setModified=function(a){this.modified=a};
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;t<d.length;t++)null!=a.view.getState(d[t])&&k.push(d[t]);a.setSelectionCells(k)};
+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 c=a.getSelectionCellsForChanges(e.getProperty("edit").changes);a.getModel();for(var k=[],t=0;t<c.length;t++)null!=a.view.getState(c[t])&&k.push(c[t]);a.setSelectionCells(k)};
b.addListener(mxEvent.UNDO,e);b.addListener(mxEvent.REDO,e);return b};Editor.prototype.initStencilRegistry=function(){};Editor.prototype.destroy=function(){null!=this.graph&&(this.graph.destroy(),this.graph=null)};OpenFile=function(a){this.consumer=this.producer=null;this.done=a;this.args=null};OpenFile.prototype.setConsumer=function(a){this.consumer=a;this.execute()};OpenFile.prototype.setData=function(){this.args=arguments;this.execute()};OpenFile.prototype.error=function(a){this.cancel(!0);mxUtils.alert(a)};
OpenFile.prototype.execute=function(){null!=this.consumer&&null!=this.args&&(this.cancel(!1),this.consumer.apply(this,this.args))};OpenFile.prototype.cancel=function(a){null!=this.done&&this.done(null!=a?a:!0)};
-function Dialog(a,b,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)),y=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);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&&(this.bg=a.createDiv("background"),
-this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=l+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));n=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=n.x+"px";this.bg.style.top=n.y+"px";p+=n.x;y+=n.y;k&&document.body.appendChild(this.bg);var x=a.createDiv(v?"geTransDialog":"geDialog");k=this.getPosition(p,y,e,d);p=k.x;y=k.y;x.style.width=
-e+"px";x.style.height=d+"px";x.style.left=p+"px";x.style.top=y+"px";x.style.zIndex=this.zIndex;x.appendChild(b);document.body.appendChild(x);!t&&b.clientHeight>x.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=y+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));y=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,
-y,e,d);p=n.x;y=n.y;x.style.left=p+"px";x.style.top=y+"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=y+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;
+function Dialog(a,b,e,c,k,m,q,t,v,A){var d=0;mxClient.IS_VML&&(null==document.documentMode||8>document.documentMode)&&(d=80);e+=d;c+=d;var f=e,g=c,n=mxUtils.getDocumentSize(),l=n.height,p=Math.max(1,Math.round((n.width-e-64)/2)),y=Math.max(1,Math.round((l-c-a.footerHeight)/3));mxClient.IS_QUIRKS||(b.style.maxHeight="100%");e=null!=document.body?Math.min(e,document.body.scrollWidth-64):e;c=Math.min(c,l-64);0<a.dialogs.length&&(this.zIndex+=2*a.dialogs.length);null==this.bg&&(this.bg=a.createDiv("background"),
+this.bg.style.position="absolute",this.bg.style.background=Dialog.backdropColor,this.bg.style.height=l+"px",this.bg.style.right="0px",this.bg.style.zIndex=this.zIndex-2,mxUtils.setOpacity(this.bg,this.bgOpacity),mxClient.IS_QUIRKS&&new mxDivResizer(this.bg));n=mxUtils.getDocumentScrollOrigin(document);this.bg.style.left=n.x+"px";this.bg.style.top=n.y+"px";p+=n.x;y+=n.y;k&&document.body.appendChild(this.bg);var x=a.createDiv(v?"geTransDialog":"geDialog");k=this.getPosition(p,y,e,c);p=k.x;y=k.y;x.style.width=
+e+"px";x.style.height=c+"px";x.style.left=p+"px";x.style.top=y+"px";x.style.zIndex=this.zIndex;x.appendChild(b);document.body.appendChild(x);!t&&b.clientHeight>x.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=y+14+"px",m.style.left=p+e+38-d+"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(d){a.hideDialog(!0)})));this.resizeListener=mxUtils.bind(this,function(){if(null!=A){var n=A();null!=n&&(f=e=n.w,g=c=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));y=Math.max(1,Math.round((l-c-a.footerHeight)/3));e=null!=document.body?Math.min(f,document.body.scrollWidth-64):f;c=Math.min(g,l-64);n=this.getPosition(p,
+y,e,c);p=n.x;y=n.y;x.style.left=p+"px";x.style.top=y+"px";x.style.width=e+"px";x.style.height=c+"px";!t&&b.clientHeight>x.clientHeight-64&&(b.style.overflowY="auto");null!=this.dialogImg&&(this.dialogImg.style.top=y+14+"px",this.dialogImg.style.left=p+e+38-d+"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+
@@ -2017,117 +2016,117 @@ Dialog.prototype.lockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoA
Dialog.prototype.unlockedImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAMAAABhq6zVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MzdDMDZCN0QxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MzdDMDZCN0UxNzIxMTFFNUI0RTk5NTg4OTcyMUUyODEiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDozN0MwNkI3QjE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDozN0MwNkI3QzE3MjExMUU1QjRFOTk1ODg5NzIxRTI4MSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PkKMpVwAAAAYUExURZmZmbKysr+/v6ysrOXl5czMzLGxsf///zHN5lwAAAAIdFJOU/////////8A3oO9WQAAADxJREFUeNpUzFESACAEBNBVsfe/cZJU+8Mzs8CIABCidtfGOndnYsT40HDSiCcbPdoJo10o9aI677cpwACRoAF3dFNlswAAAABJRU5ErkJggg==":IMAGE_PATH+
"/unlocked.png";Dialog.prototype.bgOpacity=80;Dialog.prototype.getPosition=function(a,b){return new mxPoint(a,b)};Dialog.prototype.close=function(a,b){if(null!=this.onDialogClose){if(0==this.onDialogClose(a,b))return!1;this.onDialogClose=null}null!=this.dialogImg&&(this.dialogImg.parentNode.removeChild(this.dialogImg),this.dialogImg=null);null!=this.bg&&null!=this.bg.parentNode&&this.bg.parentNode.removeChild(this.bg);mxEvent.removeListener(window,"resize",this.resizeListener);this.container.parentNode.removeChild(this.container)};
var 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 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;
+PrintDialog.prototype.create=function(a){function b(a){var b=t.checked||A.checked,c=parseInt(f.value)/100;isNaN(c)&&(c=1,f.value="100%");var c=.75*c,g=e.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT,n=1/e.pageScale;if(b){var u=t.checked?1:parseInt(d.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*c);g.height=Math.ceil(g.height*c);n*=c;!b&&e.pageVisible?(c=e.getPageLayout(),u-=c.x*g.width,k-=c.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,c,k,m=document.createElement("table");m.style.width="100%";m.style.height="100%";var q=document.createElement("tbody");c=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});c.appendChild(k);q.appendChild(c);c=c.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)});c.appendChild(k);var d=document.createElement("input");d.setAttribute("value","1");d.setAttribute("type","number");d.setAttribute("min","1");d.setAttribute("size","4");d.setAttribute("disabled","disabled");d.style.width="50px";k=document.createElement("td");k.style.fontSize="10pt";k.appendChild(d);mxUtils.write(k," "+mxResources.get("pages")+" (max)");c.appendChild(k);q.appendChild(c);mxEvent.addListener(A,"change",
+function(){A.checked?d.removeAttribute("disabled"):d.setAttribute("disabled","disabled");t.checked=!A.checked});c=c.cloneNode(!1);k=document.createElement("td");mxUtils.write(k,mxResources.get("pageScale")+":");c.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);c.appendChild(k);q.appendChild(c);c=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){try{if(null!=a.wnd){var b=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(b,500):b()}}catch(e){}};
-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('<style type="text/css">');a.writeln("@media screen {");a.writeln(" body > div { padding:30px;box-sizing:content-box; }");a.writeln("}");a.writeln("</style>")};return b};
+k.appendChild(v);c.appendChild(k);q.appendChild(c);m.appendChild(q);this.container=m};PrintDialog.printPreview=function(a){try{if(null!=a.wnd){var b=function(){a.wnd.focus();a.wnd.print();a.wnd.close()};mxClient.IS_GC?window.setTimeout(b,500):b()}}catch(e){}};
+PrintDialog.createPrintPreview=function(a,b,e,c,k,m,q){b=new mxPrintPreview(a,b,e,c,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('<style type="text/css">');a.writeln("@media screen {");a.writeln(" body > div { padding:30px;box-sizing:content-box; }");a.writeln("}");a.writeln("</style>")};return b};
PrintDialog.previewEnabled=!0;
-var PageSetupDialog=function(a){function b(){null==c||c==mxConstants.NONE?(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,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.length;b++)d=l[b],u?"custom"==d.key&&(t.value=d.key,u=!1):null!=d.format&&("a4"==d.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==d.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==d.format.width&&
-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.length;p++){var y=l[p];n[y.key]=y;var x=document.createElement("option");x.setAttribute("value",y.key);mxUtils.write(x,y.title);t.appendChild(x)}var u=!1;k();a.appendChild(t);mxUtils.br(a);
-a.appendChild(v);a.appendChild(c);var G=e,z=function(a,b){var l=n[t.value];null!=l.format?(f.value=l.format.width/100,g.value=l.format.height/100,c.style.display="none",v.style.display=""):(v.style.display="none",c.style.display="");l=parseFloat(f.value);if(isNaN(l)||0>=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==G.width&&l.height==G.height||(G=l,null!=d&&d(G))};mxEvent.addListener(b,"click",function(a){m.checked=!0;z(a);mxEvent.consume(a)});mxEvent.addListener(A,"click",function(a){q.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(q,"change",z);mxEvent.addListener(m,"change",z);mxEvent.addListener(t,"change",function(a){u="custom"==t.value;
+var PageSetupDialog=function(a){function b(){null==d||d==mxConstants.NONE?(A.style.backgroundColor="",A.style.backgroundImage="url('"+Dialog.prototype.noColorImage+"')"):(A.style.backgroundColor=d,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 c=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",c.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 d=c.background;b();mxEvent.addListener(A,"click",function(f){a.pickColor(d||"none",function(a){d=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=c.getGridSize();m.appendChild(f);mxEvent.addListener(f,"change",function(){var a=parseInt(f.value);f.value=Math.max(1,isNaN(a)?c.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=c.backgroundImage;mxEvent.addListener(g,"click",function(d){a.showBackgroundImageDialog(function(a){n=a;e()});mxEvent.consume(d)});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();c.gridSize!==f.value&&c.setGridSize(parseInt(f.value));var b=new ChangePageSetup(a,d,n,v.get());b.ignoreColor=c.background==d;b.ignoreImage=(null!=c.backgroundImage?c.backgroundImage.src:null)===(null!=n?n.src:null);c.pageFormat.width==b.previousFormat.width&&c.pageFormat.height==b.previousFormat.height&&
+b.ignoreColor&&b.ignoreImage||c.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,c){function k(a,b,c){if(c||f!=document.activeElement&&g!=document.activeElement){a=!1;for(b=0;b<l.length;b++)c=l[b],u?"custom"==c.key&&(t.value=c.key,u=!1):null!=c.format&&("a4"==c.key?826==e.width?(e=mxRectangle.fromRectangle(e),e.width=827):826==e.height&&(e=mxRectangle.fromRectangle(e),e.height=827):"a5"==c.key&&(584==e.width?(e=mxRectangle.fromRectangle(e),e.width=583):584==e.height&&(e=mxRectangle.fromRectangle(e),e.height=583)),e.width==c.format.width&&
+e.height==c.format.height?(t.value=c.key,m.setAttribute("checked","checked"),m.defaultChecked=!0,m.checked=!0,q.removeAttribute("checked"),q.defaultChecked=!1,q.checked=!1,a=!0):e.width==c.format.height&&e.height==c.format.width&&(t.value=c.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="",d.style.display="none"):(f.value=e.width/100,g.value=e.height/100,m.setAttribute("checked","checked"),
+t.value="custom",v.style.display="none",d.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 d=document.createElement("div");d.style.marginLeft="4px";d.style.width="210px";d.style.height="24px";var f=document.createElement("input");
+f.setAttribute("size","7");f.style.textAlign="right";d.appendChild(f);mxUtils.write(d," in x ");var g=document.createElement("input");g.setAttribute("size","7");g.style.textAlign="right";d.appendChild(g);mxUtils.write(d," in");v.style.display="none";d.style.display="none";for(var n={},l=PageSetupDialog.getFormats(),p=0;p<l.length;p++){var y=l[p];n[y.key]=y;var x=document.createElement("option");x.setAttribute("value",y.key);mxUtils.write(x,y.title);t.appendChild(x)}var u=!1;k();a.appendChild(t);mxUtils.br(a);
+a.appendChild(v);a.appendChild(d);var G=e,z=function(a,b){var l=n[t.value];null!=l.format?(f.value=l.format.width/100,g.value=l.format.height/100,d.style.display="none",v.style.display=""):(v.style.display="none",d.style.display="");l=parseFloat(f.value);if(isNaN(l)||0>=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==G.width&&l.height==G.height||(G=l,null!=c&&c(G))};mxEvent.addListener(b,"click",function(a){m.checked=!0;z(a);mxEvent.consume(a)});mxEvent.addListener(A,"click",function(a){q.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(q,"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 G},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=
-mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(a.container),d.style.position="absolute",a.container.insertBefore(this.backgroundPageShape.node,d),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(c){a.dblClick(c)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(c){a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(c))}),
-mxUtils.bind(this,function(c){null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide();a.isMouseDown&&!mxEvent.isConsumed(c)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(c))}),mxUtils.bind(this,function(c){a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(c))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=b,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=
-null);this.validateBackgroundStyles()}};mxGraphView.prototype.validateBackgroundStyles=function(){var a=this.graph,b=null==a.background||a.background==mxConstants.NONE?a.defaultPageBackgroundColor:a.background,d=null!=b&&this.gridColor!=b.toLowerCase()?this.gridColor:"#ffffff",c="none",f="";if(a.isGridEnabled()){f=10;mxClient.IS_SVG?(c=unescape(encodeURIComponent(this.createSvgGrid(d))),c=window.btoa?btoa(c):Base64.encode(c,!0),c="url(data:image/svg+xml;base64,"+c+")",f=a.gridSize*this.scale*this.gridSteps):
-c="url("+this.gridImage+")";var g=d=0;null!=a.view.backgroundPageShape&&(g=this.getBackgroundPageBounds(),d=1+g.x,g=1+g.y);f=-Math.round(f-mxUtils.mod(this.translate.x*this.scale-d,f))+"px "+-Math.round(f-mxUtils.mod(this.translate.y*this.scale-g,f))+"px"}d=a.view.canvas;null!=d.ownerSVGElement&&(d=d.ownerSVGElement);null!=a.view.backgroundPageShape?(a.view.backgroundPageShape.node.style.backgroundPosition=f,a.view.backgroundPageShape.node.style.backgroundImage=c,a.view.backgroundPageShape.node.style.backgroundColor=
-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<this.minGridSize;)b*=2;for(var d=this.gridSteps*b,c=[],f=1;f<this.gridSteps;f++){var g=f*b;c.push("M 0 "+g+" L "+d+" "+g+" M "+g+" 0 L "+g+" "+d)}return'<svg width="'+
-d+'" height="'+d+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+d+'" height="'+d+'" patternUnits="userSpaceOnUse"><path d="'+c.join(" ")+'" fill="none" stroke="'+a+'" opacity="0.2" stroke-width="1"/><path d="M '+d+" 0 L 0 0 0 "+d+'" fill="none" stroke="'+a+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};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),y=(a=a&&Math.min(p.width,p.height)>this.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&&0<y&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<k&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var c=a==this.horizontalPageBreaks?y:k,f=0;f<=c;f++){var b=a==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),Math.round(l.y+(f+1)*p.height)),
-new mxPoint(Math.round(u),Math.round(l.y+(f+1)*p.height))]:[new mxPoint(Math.round(l.x+(f+1)*p.width),Math.round(l.y)),new mxPoint(Math.round(l.x+(f+1)*p.width),Math.round(t))];null!=a[f]?(a[f].points=b,a[f].redraw()):(b=new mxPolyline(b,this.pageBreakColor),b.dialect=this.dialect,b.isDashed=this.pageBreakDashed,b.pointerEvents=!1,b.init(this.view.backgroundPane),b.redraw(),a[f]=b)}for(f=c;f<a.length;f++)a[f].destroy();a.splice(c,a.length-c)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
-var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,d,e){for(var c=0;c<d.length;c++)if(this.graph.getModel().isVertex(d[c])){var f=this.graph.getCellGeometry(d[c]);if(null!=f&&f.relative)return!1}return b.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=e.apply(this,arguments);a.intersects=mxUtils.bind(this,function(b,d){return this.isConnecting()?
-!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.getGraphBounds(),b=0<a.width?a.x/this.scale-this.translate.x:0,d=0<a.height?a.y/this.scale-this.translate.y:0,c=this.graph.pageFormat,f=this.graph.pageScale,g=c.width*f,c=c.height*f,f=Math.floor(Math.min(0,b)/g),e=Math.floor(Math.min(0,
-d)/c);return new mxRectangle(this.scale*(this.translate.x+f*g),this.scale*(this.translate.y+e*c),this.scale*(Math.ceil(Math.max(1,b+a.width/this.scale)/g)-f)*g,this.scale*(Math.ceil(Math.max(1,d+a.height/this.scale)/c)-e)*c)};var d=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,b){d.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=
-a+"px",this.view.backgroundPageShape.node.style.marginTop=b+"px")};var k=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,d,c,f,g){var e=k.apply(this,arguments);null==g||g||mxEvent.addListener(e,"mousedown",function(a){mxEvent.consume(a)});return e};var m=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),d=b.getParent(this.graph.getSelectionCell()),c=m.apply(this,arguments),f=b.getParent(c);
-if(null==d||d!=c&&d!=f)for(;!this.graph.isCellSelected(c)&&!this.graph.isCellSelected(f)&&b.isVertex(f)&&!this.graph.isContainer(f);)c=f,f=this.graph.getModel().getParent(c);return c};var q=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,b){var d=q.apply(this,arguments);if(!d)for(var c=this.graph.getModel(),f=c.getParent(a);null!=f;){if(this.graph.isCellSelected(f)&&c.isVertex(f)){d=!0;break}f=c.getParent(f)}return d};mxGraphHandler.prototype.selectDelayed=
-function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);var d=this.graph.view.getState(b);if(null==d||!a.isSource(d.control))for(var d=this.graph.getModel(),c=d.getParent(b);!this.graph.isCellSelected(c)&&d.isVertex(c);)b=c,c=d.getParent(b);this.graph.selectCellForEvent(b,a.getEvent())}};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){a=a.getCell();for(var b=this.graph.getModel(),d=b.getParent(a);b.isVertex(d)&&!this.graph.isContainer(d);)this.graph.isCellSelected(d)&&
-(a=d),d=b.getParent(d);return a}})();EditorUi=function(a,b,e){mxEventSource.call(this);this.destroyFunctions=[];this.editor=a||new Editor;this.container=b||document.body;var d=this.editor.graph;d.lightbox=e;d.useCssTransforms&&(this.lazyZoomDelay=0);mxClient.IS_SVG?mxPopupMenu.prototype.submenuImage="data:image/gif;base64,R0lGODlhCQAJAIAAAP///zMzMyH5BAEAAAAALAAAAAAJAAkAAAIPhI8WebHsHopSOVgb26AAADs=":(new Image).src=mxPopupMenu.prototype.submenuImage;mxClient.IS_SVG||null==mxConnectionHandler.prototype.connectImage||((new Image).src=mxConnectionHandler.prototype.connectImage.src);
-this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,d.isEnabled=function(){return!1},d.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())});this.actions=new Actions(this);this.menus=this.createMenus();this.createDivs();this.createUi();this.refresh();var k=mxUtils.bind(this,function(a){null==a&&(a=window.event);return d.isEditing()||null!=a&&this.isSelectionAllowed(a)});this.container==document.body&&(this.menubarContainer.onselectstart=k,this.menubarContainer.onmousedown=
-k,this.toolbarContainer.onselectstart=k,this.toolbarContainer.onmousedown=k,this.diagramContainer.onselectstart=k,this.diagramContainer.onmousedown=k,this.sidebarContainer.onselectstart=k,this.sidebarContainer.onmousedown=k,this.formatContainer.onselectstart=k,this.formatContainer.onmousedown=k,this.footerContainer.onselectstart=k,this.footerContainer.onmousedown=k,null!=this.tabContainer&&(this.tabContainer.onselectstart=k));!this.editor.chromeless||this.editor.editable?(b=function(a){if(null!=a){var c=
-mxEvent.getSource(a);if("A"==c.nodeName)for(;null!=c;){if("geHint"==c.className)return!0;c=c.parentNode}}return k(a)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.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);0<mxEvent.getClientX(a)-c.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(a)-c.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var m=!1,q=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(a,c){return m||q.apply(this,
-arguments)};this.keydownHandler=mxUtils.bind(this,function(a){32==a.which?(m=!0,this.hoverIcons.reset(),d.container.style.cursor="move",d.isEditing()||mxEvent.getSource(a)!=d.container||mxEvent.consume(a)):mxEvent.isConsumed(a)||27!=a.keyCode||this.hideDialog(null,!0)});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(a){d.container.style.cursor="";m=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var t=d.panningHandler.isForcePanningEvent;
-d.panningHandler.isForcePanningEvent=function(a){return t.apply(this,arguments)||m||mxEvent.isMouseEvent(a.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(a.getEvent()))&&(!mxEvent.isControlDown(a.getEvent())&&mxEvent.isRightMouseButton(a.getEvent())||mxEvent.isMiddleMouseButton(a.getEvent()))};var v=d.cellEditor.isStopEditingEvent;d.cellEditor.isStopEditingEvent=function(a){return v.apply(this,arguments)||13==a.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a)||
-mxClient.IS_SF&&mxEvent.isShiftDown(a))};var A=!1,c=null,f=null,g=null,n=mxUtils.bind(this,function(){if(null!=this.toolbar&&A!=d.cellEditor.isContentEditing()){for(var a=this.toolbar.container.firstChild,b=[];null!=a;){var e=a.nextSibling;0>mxUtils.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;l<g.length;l++)this.toolbar.container.appendChild(g[l]);this.toolbar.fontMenu=
-c;this.toolbar.sizeMenu=f}A=d.cellEditor.isContentEditing();c=a;f=e;g=b}}),l=this,p=d.cellEditor.startEditing;d.cellEditor.startEditing=function(){p.apply(this,arguments);n();if(d.cellEditor.isContentEditing()){var a=!1,c=function(){a||(a=!0,window.setTimeout(function(){for(var c=d.getSelectedElement();null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.parentNode;if(null!=c&&(c=mxUtils.getCurrentStyle(c),null!=c&&null!=l.toolbar)){var b=c.fontFamily;"'"==b.charAt(0)&&(b=b.substring(1));"'"==b.charAt(b.length-
-1)&&(b=b.substring(0,b.length-1));l.toolbar.setFontName(b);l.toolbar.setFontSize(parseInt(c.fontSize))}a=!1},0))};mxEvent.addListener(d.cellEditor.textarea,"input",c);mxEvent.addListener(d.cellEditor.textarea,"touchend",c);mxEvent.addListener(d.cellEditor.textarea,"mouseup",c);mxEvent.addListener(d.cellEditor.textarea,"keyup",c);c()}};var y=d.cellEditor.stopEditing;d.cellEditor.stopEditing=function(a,c){y.apply(this,arguments);n()};d.container.setAttribute("tabindex","0");d.container.style.cursor=
-"default";if(window.self===window.top&&null!=d.container.parentNode)try{d.container.focus()}catch(Q){}var x=d.fireMouseEvent;d.fireMouseEvent=function(a,c,b){a==mxEvent.MOUSE_DOWN&&this.container.focus();x.apply(this,arguments)};d.popupMenuHandler.autoExpand=!0;null!=this.menus&&(d.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,c,b){this.menus.createPopupMenu(a,c,b)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(a){d.popupMenuHandler.hideMenu()}));this.keyHandler=
-this.createKeyHandler(a);this.getKeyHandler=function(){return keyHandler};var u="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),G="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){var c=d.view.getState(a);if(null!=c){a=a.clone();a.style="";a=d.getCellStyle(a);var b=[],f=[],g;for(g in c.style)a[g]!=c.style[g]&&(b.push(c.style[g]),f.push(g));g=d.getModel().getStyle(c.cell);for(var e=null!=g?g.split(";"):[],l=0;l<
-e.length;l++){var r=e[l],n=r.indexOf("=");0<=n&&(g=r.substring(0,n),r=r.substring(n+1),null!=a[g]&&"none"==r&&(b.push(r),f.push(g)))}d.getModel().isEdge(c.cell)?d.currentEdgeStyle={}:d.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",b,"cells",[c.cell]))}};this.clearDefaultStyle=function(){d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle);d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",
-[],"cells",[]))};var z=["fontFamily","fontSize","fontColor"],E="edgeStyle startArrow startFill startSize endArrow endFill endSize".split(" "),r=["startArrow startFill startSize sourcePerimeterSpacing endArrow endFill endSize targetPerimeterSpacing".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],z,["opacity"],["align"],["html"]];for(a=0;a<r.length;a++)for(b=0;b<r[a].length;b++)u.push(r[a][b]);for(a=0;a<G.length;a++)0>mxUtils.indexOf(u,G[a])&&u.push(G[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;e<f.length;e++){var l=g[f[e]];null!=l&&d.setCellStyles(f[e],l,a)}else for(l=0;l<a.length;l++){for(var n=a[l],p=b.getStyle(n),C=null!=p?p.split(";"):[],J=u.slice(),e=0;e<C.length;e++){var y=C[e],k=y.indexOf("=");if(0<=k){var x=y.substring(0,k),Q=mxUtils.indexOf(J,x);0<=Q&&J.splice(Q,1);for(var m=0;m<r.length;m++){var z=r[m];if(0<=mxUtils.indexOf(z,x))for(var t=
-0;t<z.length;t++){var q=mxUtils.indexOf(J,z[t]);0<=q&&J.splice(q,1)}}}}for(var g=(f=b.isEdge(n))?d.currentEdgeStyle:d.currentVertexStyle,O=b.getStyle(n),e=0;e<J.length;e++){var x=J[e],v=g[x];null==v||"shape"==x&&!f||f&&!(0>mxUtils.indexOf(G,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(0<b.length)for(var e=0;e<b.length&&(f=d.getModel().isVertex(b[e])||f,!(g=d.getModel().isEdge(b[e])||g)||!f);e++);else g=f=!0;for(var b=c.getProperty("keys"),l=c.getProperty("values"),e=0;e<b.length;e++){var r=0<=mxUtils.indexOf(z,b[e]);if("strokeColor"!=b[e]||null!=l[e]&&"none"!=
-l[e])if(0<=mxUtils.indexOf(G,b[e]))g||0<=mxUtils.indexOf(E,b[e])?null==l[e]?delete d.currentEdgeStyle[b[e]]:d.currentEdgeStyle[b[e]]=l[e]:f&&0<=mxUtils.indexOf(u,b[e])&&(null==l[e]?delete d.currentVertexStyle[b[e]]:d.currentVertexStyle[b[e]]=l[e]);else if(0<=mxUtils.indexOf(u,b[e])){if(f||r)null==l[e]?delete d.currentVertexStyle[b[e]]:d.currentVertexStyle[b[e]]=l[e];if(g||r||0<=mxUtils.indexOf(E,b[e]))null==l[e]?delete d.currentEdgeStyle[b[e]]:d.currentEdgeStyle[b[e]]=l[e]}}null!=this.toolbar&&(this.toolbar.setFontName(d.currentVertexStyle.fontFamily||
-Menus.prototype.defaultFont),this.toolbar.setFontSize(d.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==d.currentEdgeStyle.edgeStyle&&"1"==d.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==d.currentEdgeStyle.edgeStyle||"none"==d.currentEdgeStyle.edgeStyle||null==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"==
-d.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==d.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==d.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==d.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):"geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==d.currentEdgeStyle.shape?
-"geSprite geSprite-linkedge":"flexArrow"==d.currentEdgeStyle.shape?"geSprite geSprite-arrow":"arrow"==d.currentEdgeStyle.shape?"geSprite geSprite-simplearrow":"geSprite geSprite-connection"),null!=this.toolbar.lineStartMenu&&(this.toolbar.lineStartMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("start",d.currentEdgeStyle.shape,d.currentEdgeStyle[mxConstants.STYLE_STARTARROW],mxUtils.getValue(d.currentEdgeStyle,"startFill","1"))),null!=this.toolbar.lineEndMenu&&(this.toolbar.lineEndMenu.getElementsByTagName("div")[0].className=
-this.getCssClassForMarker("end",d.currentEdgeStyle.shape,d.currentEdgeStyle[mxConstants.STYLE_ENDARROW],mxUtils.getValue(d.currentEdgeStyle,"endFill","1"))))}));null!=this.toolbar&&(a=mxUtils.bind(this,function(){var a=d.currentVertexStyle.fontFamily||"Helvetica",c=String(d.currentVertexStyle.fontSize||"12"),b=d.getView().getState(d.getSelectionCell());null!=b&&(a=b.style[mxConstants.STYLE_FONTFAMILY]||a,c=b.style[mxConstants.STYLE_FONTSIZE]||c,10<a.length&&(a=a.substring(0,8)+"..."));this.toolbar.setFontName(a);
-this.toolbar.setFontSize(c)}),d.getSelectionModel().addListener(mxEvent.CHANGE,a),d.getModel().addListener(mxEvent.CHANGE,a));d.addListener(mxEvent.CELLS_ADDED,function(a,c){var b=c.getProperty("cells"),f=c.getProperty("parent");d.getModel().isLayer(f)&&!d.isCellVisible(f)&&null!=b&&0<b.length&&d.getModel().setVisible(f,!0)});this.gestureHandler=mxUtils.bind(this,function(a){null!=this.currentMenu&&mxEvent.getSource(a)!=this.currentMenu.div&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,
+(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 c=a.container.firstChild;null!=c&&c.nodeType!=mxConstants.NODETYPE_ELEMENT;)c=c.nextSibling;null!=c&&(this.backgroundPageShape=this.createBackgroundPageShape(b),this.backgroundPageShape.scale=1,this.backgroundPageShape.isShadow=!mxClient.IS_QUIRKS,this.backgroundPageShape.dialect=
+mxConstants.DIALECT_STRICTHTML,this.backgroundPageShape.init(a.container),c.style.position="absolute",a.container.insertBefore(this.backgroundPageShape.node,c),this.backgroundPageShape.redraw(),this.backgroundPageShape.node.className="geBackgroundPage",mxEvent.addListener(this.backgroundPageShape.node,"dblclick",mxUtils.bind(this,function(d){a.dblClick(d)})),mxEvent.addGestureListeners(this.backgroundPageShape.node,mxUtils.bind(this,function(d){a.fireMouseEvent(mxEvent.MOUSE_DOWN,new mxMouseEvent(d))}),
+mxUtils.bind(this,function(d){null!=a.tooltipHandler&&a.tooltipHandler.isHideOnHover()&&a.tooltipHandler.hide();a.isMouseDown&&!mxEvent.isConsumed(d)&&a.fireMouseEvent(mxEvent.MOUSE_MOVE,new mxMouseEvent(d))}),mxUtils.bind(this,function(d){a.fireMouseEvent(mxEvent.MOUSE_UP,new mxMouseEvent(d))})))}else this.backgroundPageShape.scale=1,this.backgroundPageShape.bounds=b,this.backgroundPageShape.redraw()}else null!=this.backgroundPageShape&&(this.backgroundPageShape.destroy(),this.backgroundPageShape=
+null);this.validateBackgroundStyles()}};mxGraphView.prototype.validateBackgroundStyles=function(){var a=this.graph,b=null==a.background||a.background==mxConstants.NONE?a.defaultPageBackgroundColor:a.background,c=null!=b&&this.gridColor!=b.toLowerCase()?this.gridColor:"#ffffff",d="none",f="";if(a.isGridEnabled()){f=10;mxClient.IS_SVG?(d=unescape(encodeURIComponent(this.createSvgGrid(c))),d=window.btoa?btoa(d):Base64.encode(d,!0),d="url(data:image/svg+xml;base64,"+d+")",f=a.gridSize*this.scale*this.gridSteps):
+d="url("+this.gridImage+")";var g=c=0;null!=a.view.backgroundPageShape&&(g=this.getBackgroundPageBounds(),c=1+g.x,g=1+g.y);f=-Math.round(f-mxUtils.mod(this.translate.x*this.scale-c,f))+"px "+-Math.round(f-mxUtils.mod(this.translate.y*this.scale-g,f))+"px"}c=a.view.canvas;null!=c.ownerSVGElement&&(c=c.ownerSVGElement);null!=a.view.backgroundPageShape?(a.view.backgroundPageShape.node.style.backgroundPosition=f,a.view.backgroundPageShape.node.style.backgroundImage=d,a.view.backgroundPageShape.node.style.backgroundColor=
+b,a.container.className="geDiagramContainer geDiagramBackdrop",c.style.backgroundImage="none",c.style.backgroundColor=""):(a.container.className="geDiagramContainer",c.style.backgroundPosition=f,c.style.backgroundColor=b,c.style.backgroundImage=d)};mxGraphView.prototype.createSvgGrid=function(a){for(var b=this.graph.gridSize*this.scale;b<this.minGridSize;)b*=2;for(var c=this.gridSteps*b,d=[],f=1;f<this.gridSteps;f++){var g=f*b;d.push("M 0 "+g+" L "+c+" "+g+" M "+g+" 0 L "+g+" "+c)}return'<svg width="'+
+c+'" height="'+c+'" xmlns="'+mxConstants.NS_SVG+'"><defs><pattern id="grid" width="'+c+'" height="'+c+'" patternUnits="userSpaceOnUse"><path d="'+d.join(" ")+'" fill="none" stroke="'+a+'" opacity="0.2" stroke-width="1"/><path d="M '+c+" 0 L 0 0 0 "+c+'" fill="none" stroke="'+a+'" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(#grid)"/></svg>'};var a=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(b,c){a.apply(this,arguments);if(null!=this.shiftPreview1){var e=
+this.view.canvas;null!=e.ownerSVGElement&&(e=e.ownerSVGElement);var d=this.gridSize*this.view.scale*this.view.gridSteps,d=-Math.round(d-mxUtils.mod(this.view.translate.x*this.view.scale+b,d))+"px "+-Math.round(d-mxUtils.mod(this.view.translate.y*this.view.scale+c,d))+"px";e.style.backgroundPosition=d}};mxGraph.prototype.updatePageBreaks=function(a,b,c){var d=this.view.scale,f=this.view.translate,g=this.pageFormat,e=d*this.pageScale,l=this.view.getBackgroundPageBounds();b=l.width;c=l.height;var p=
+new mxRectangle(d*f.x,d*f.y,g.width*e,g.height*e),y=(a=a&&Math.min(p.width,p.height)>this.minPageBreakDist)?Math.ceil(c/p.height)-1:0,k=a?Math.ceil(b/p.width)-1:0,u=l.x+b,t=l.y+c;null==this.horizontalPageBreaks&&0<y&&(this.horizontalPageBreaks=[]);null==this.verticalPageBreaks&&0<k&&(this.verticalPageBreaks=[]);a=mxUtils.bind(this,function(a){if(null!=a){for(var d=a==this.horizontalPageBreaks?y:k,b=0;b<=d;b++){var f=a==this.horizontalPageBreaks?[new mxPoint(Math.round(l.x),Math.round(l.y+(b+1)*p.height)),
+new mxPoint(Math.round(u),Math.round(l.y+(b+1)*p.height))]:[new mxPoint(Math.round(l.x+(b+1)*p.width),Math.round(l.y)),new mxPoint(Math.round(l.x+(b+1)*p.width),Math.round(t))];null!=a[b]?(a[b].points=f,a[b].redraw()):(f=new mxPolyline(f,this.pageBreakColor),f.dialect=this.dialect,f.isDashed=this.pageBreakDashed,f.pointerEvents=!1,f.init(this.view.backgroundPane),f.redraw(),a[b]=f)}for(b=d;b<a.length;b++)a[b].destroy();a.splice(d,a.length-d)}});a(this.horizontalPageBreaks);a(this.verticalPageBreaks)};
+var b=mxGraphHandler.prototype.shouldRemoveCellsFromParent;mxGraphHandler.prototype.shouldRemoveCellsFromParent=function(a,c,e){for(var d=0;d<c.length;d++)if(this.graph.getModel().isVertex(c[d])){var f=this.graph.getCellGeometry(c[d]);if(null!=f&&f.relative)return!1}return b.apply(this,arguments)};var e=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=e.apply(this,arguments);a.intersects=mxUtils.bind(this,function(b,c){return this.isConnecting()?
+!0:mxCellMarker.prototype.intersects.apply(a,arguments)});return a};mxGraphView.prototype.createBackgroundPageShape=function(a){return new mxRectangleShape(a,"#ffffff",this.graph.defaultPageBorderColor)};mxGraphView.prototype.getBackgroundPageBounds=function(){var a=this.getGraphBounds(),b=0<a.width?a.x/this.scale-this.translate.x:0,c=0<a.height?a.y/this.scale-this.translate.y:0,d=this.graph.pageFormat,f=this.graph.pageScale,g=d.width*f,d=d.height*f,f=Math.floor(Math.min(0,b)/g),e=Math.floor(Math.min(0,
+c)/d);return new mxRectangle(this.scale*(this.translate.x+f*g),this.scale*(this.translate.y+e*d),this.scale*(Math.ceil(Math.max(1,b+a.width/this.scale)/g)-f)*g,this.scale*(Math.ceil(Math.max(1,c+a.height/this.scale)/d)-e)*d)};var c=mxGraph.prototype.panGraph;mxGraph.prototype.panGraph=function(a,b){c.apply(this,arguments);this.dialect==mxConstants.DIALECT_SVG||null==this.view.backgroundPageShape||this.useScrollbarsForPanning&&mxUtils.hasScrollbars(this.container)||(this.view.backgroundPageShape.node.style.marginLeft=
+a+"px",this.view.backgroundPageShape.node.style.marginTop=b+"px")};var k=mxPopupMenu.prototype.addItem;mxPopupMenu.prototype.addItem=function(a,b,c,d,f,g){var e=k.apply(this,arguments);null==g||g||mxEvent.addListener(e,"mousedown",function(a){mxEvent.consume(a)});return e};var m=mxGraphHandler.prototype.getInitialCellForEvent;mxGraphHandler.prototype.getInitialCellForEvent=function(a){var b=this.graph.getModel(),c=b.getParent(this.graph.getSelectionCell()),d=m.apply(this,arguments),f=b.getParent(d);
+if(null==c||c!=d&&c!=f)for(;!this.graph.isCellSelected(d)&&!this.graph.isCellSelected(f)&&b.isVertex(f)&&!this.graph.isContainer(f);)d=f,f=this.graph.getModel().getParent(d);return d};var q=mxGraphHandler.prototype.isDelayedSelection;mxGraphHandler.prototype.isDelayedSelection=function(a,b){var c=q.apply(this,arguments);if(!c)for(var d=this.graph.getModel(),f=d.getParent(a);null!=f;){if(this.graph.isCellSelected(f)&&d.isVertex(f)){c=!0;break}f=d.getParent(f)}return c};mxGraphHandler.prototype.selectDelayed=
+function(a){if(!this.graph.popupMenuHandler.isPopupTrigger(a)){var b=a.getCell();null==b&&(b=this.cell);var c=this.graph.view.getState(b);if(null==c||!a.isSource(c.control))for(var c=this.graph.getModel(),d=c.getParent(b);!this.graph.isCellSelected(d)&&c.isVertex(d);)b=d,d=c.getParent(b);this.graph.selectCellForEvent(b,a.getEvent())}};mxPopupMenuHandler.prototype.getCellForPopupEvent=function(a){a=a.getCell();for(var b=this.graph.getModel(),c=b.getParent(a);b.isVertex(c)&&!this.graph.isContainer(c);)this.graph.isCellSelected(c)&&
+(a=c),c=b.getParent(c);return a}})();EditorUi=function(a,b,e){mxEventSource.call(this);this.destroyFunctions=[];this.editor=a||new Editor;this.container=b||document.body;var c=this.editor.graph;c.lightbox=e;c.useCssTransforms&&(this.lazyZoomDelay=0);mxClient.IS_SVG?mxPopupMenu.prototype.submenuImage="data:image/gif;base64,R0lGODlhCQAJAIAAAP///zMzMyH5BAEAAAAALAAAAAAJAAkAAAIPhI8WebHsHopSOVgb26AAADs=":(new Image).src=mxPopupMenu.prototype.submenuImage;mxClient.IS_SVG||null==mxConnectionHandler.prototype.connectImage||((new Image).src=mxConnectionHandler.prototype.connectImage.src);
+this.editor.chromeless&&!this.editor.editable&&(this.footerHeight=0,c.isEnabled=function(){return!1},c.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())});this.actions=new Actions(this);this.menus=this.createMenus();this.createDivs();this.createUi();this.refresh();var k=mxUtils.bind(this,function(a){null==a&&(a=window.event);return c.isEditing()||null!=a&&this.isSelectionAllowed(a)});this.container==document.body&&(this.menubarContainer.onselectstart=k,this.menubarContainer.onmousedown=
+k,this.toolbarContainer.onselectstart=k,this.toolbarContainer.onmousedown=k,this.diagramContainer.onselectstart=k,this.diagramContainer.onmousedown=k,this.sidebarContainer.onselectstart=k,this.sidebarContainer.onmousedown=k,this.formatContainer.onselectstart=k,this.formatContainer.onmousedown=k,this.footerContainer.onselectstart=k,this.footerContainer.onmousedown=k,null!=this.tabContainer&&(this.tabContainer.onselectstart=k));!this.editor.chromeless||this.editor.editable?(b=function(a){if(null!=a){var d=
+mxEvent.getSource(a);if("A"==d.nodeName)for(;null!=d;){if("geHint"==d.className)return!0;d=d.parentNode}}return k(a)},mxClient.IS_IE&&("undefined"===typeof document.documentMode||9>document.documentMode)?mxEvent.addListener(this.diagramContainer,"contextmenu",b):this.diagramContainer.oncontextmenu=b):c.panningHandler.usePopupTrigger=!1;c.init(this.diagramContainer);mxClient.IS_SVG&&null!=c.view.getDrawPane()&&(b=c.view.getDrawPane().ownerSVGElement,null!=b&&(b.style.position="absolute"));this.hoverIcons=
+this.createHoverIcons();mxEvent.addListener(this.diagramContainer,"mousemove",mxUtils.bind(this,function(a){var d=mxUtils.getOffset(this.diagramContainer);0<mxEvent.getClientX(a)-d.x-this.diagramContainer.clientWidth||0<mxEvent.getClientY(a)-d.y-this.diagramContainer.clientHeight?this.diagramContainer.setAttribute("title",mxResources.get("panTooltip")):this.diagramContainer.removeAttribute("title")}));var m=!1,q=this.hoverIcons.isResetEvent;this.hoverIcons.isResetEvent=function(a,d){return m||q.apply(this,
+arguments)};this.keydownHandler=mxUtils.bind(this,function(a){32==a.which?(m=!0,this.hoverIcons.reset(),c.container.style.cursor="move",c.isEditing()||mxEvent.getSource(a)!=c.container||mxEvent.consume(a)):mxEvent.isConsumed(a)||27!=a.keyCode||this.hideDialog(null,!0)});mxEvent.addListener(document,"keydown",this.keydownHandler);this.keyupHandler=mxUtils.bind(this,function(a){c.container.style.cursor="";m=!1});mxEvent.addListener(document,"keyup",this.keyupHandler);var t=c.panningHandler.isForcePanningEvent;
+c.panningHandler.isForcePanningEvent=function(a){return t.apply(this,arguments)||m||mxEvent.isMouseEvent(a.getEvent())&&(this.usePopupTrigger||!mxEvent.isPopupTrigger(a.getEvent()))&&(!mxEvent.isControlDown(a.getEvent())&&mxEvent.isRightMouseButton(a.getEvent())||mxEvent.isMiddleMouseButton(a.getEvent()))};var v=c.cellEditor.isStopEditingEvent;c.cellEditor.isStopEditingEvent=function(a){return v.apply(this,arguments)||13==a.keyCode&&(!mxClient.IS_SF&&mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a)||
+mxClient.IS_SF&&mxEvent.isShiftDown(a))};var A=!1,d=null,f=null,g=null,n=mxUtils.bind(this,function(){if(null!=this.toolbar&&A!=c.cellEditor.isContentEditing()){for(var a=this.toolbar.container.firstChild,b=[];null!=a;){var e=a.nextSibling;0>mxUtils.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;l<g.length;l++)this.toolbar.container.appendChild(g[l]);this.toolbar.fontMenu=
+d;this.toolbar.sizeMenu=f}A=c.cellEditor.isContentEditing();d=a;f=e;g=b}}),l=this,p=c.cellEditor.startEditing;c.cellEditor.startEditing=function(){p.apply(this,arguments);n();if(c.cellEditor.isContentEditing()){var a=!1,d=function(){a||(a=!0,window.setTimeout(function(){for(var d=c.getSelectedElement();null!=d&&d.nodeType!=mxConstants.NODETYPE_ELEMENT;)d=d.parentNode;if(null!=d&&(d=mxUtils.getCurrentStyle(d),null!=d&&null!=l.toolbar)){var b=d.fontFamily;"'"==b.charAt(0)&&(b=b.substring(1));"'"==b.charAt(b.length-
+1)&&(b=b.substring(0,b.length-1));l.toolbar.setFontName(b);l.toolbar.setFontSize(parseInt(d.fontSize))}a=!1},0))};mxEvent.addListener(c.cellEditor.textarea,"input",d);mxEvent.addListener(c.cellEditor.textarea,"touchend",d);mxEvent.addListener(c.cellEditor.textarea,"mouseup",d);mxEvent.addListener(c.cellEditor.textarea,"keyup",d);d()}};var y=c.cellEditor.stopEditing;c.cellEditor.stopEditing=function(a,d){y.apply(this,arguments);n()};c.container.setAttribute("tabindex","0");c.container.style.cursor=
+"default";if(window.self===window.top&&null!=c.container.parentNode)try{c.container.focus()}catch(Q){}var x=c.fireMouseEvent;c.fireMouseEvent=function(a,d,b){a==mxEvent.MOUSE_DOWN&&this.container.focus();x.apply(this,arguments)};c.popupMenuHandler.autoExpand=!0;null!=this.menus&&(c.popupMenuHandler.factoryMethod=mxUtils.bind(this,function(a,d,b){this.menus.createPopupMenu(a,d,b)}));mxEvent.addGestureListeners(document,mxUtils.bind(this,function(a){c.popupMenuHandler.hideMenu()}));this.keyHandler=
+this.createKeyHandler(a);this.getKeyHandler=function(){return keyHandler};var u="rounded shadow glass dashed dashPattern comic labelBackgroundColor".split(" "),G="shape edgeStyle curved rounded elbow comic jumpStyle jumpSize".split(" ");this.setDefaultStyle=function(a){var d=c.view.getState(a);if(null!=d){a=a.clone();a.style="";a=c.getCellStyle(a);var b=[],f=[],g;for(g in d.style)a[g]!=d.style[g]&&(b.push(d.style[g]),f.push(g));g=c.getModel().getStyle(d.cell);for(var e=null!=g?g.split(";"):[],l=0;l<
+e.length;l++){var r=e[l],n=r.indexOf("=");0<=n&&(g=r.substring(0,n),r=r.substring(n+1),null!=a[g]&&"none"==r&&(b.push(r),f.push(g)))}c.getModel().isEdge(d.cell)?c.currentEdgeStyle={}:c.currentVertexStyle={};this.fireEvent(new mxEventObject("styleChanged","keys",f,"values",b,"cells",[d.cell]))}};this.clearDefaultStyle=function(){c.currentEdgeStyle=mxUtils.clone(c.defaultEdgeStyle);c.currentVertexStyle=mxUtils.clone(c.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",
+[],"cells",[]))};var z=["fontFamily","fontSize","fontColor"],E="edgeStyle startArrow startFill startSize endArrow endFill endSize".split(" "),r=["startArrow startFill startSize sourcePerimeterSpacing endArrow endFill endSize targetPerimeterSpacing".split(" "),["strokeColor","strokeWidth"],["fillColor","gradientColor"],z,["opacity"],["align"],["html"]];for(a=0;a<r.length;a++)for(b=0;b<r[a].length;b++)u.push(r[a][b]);for(a=0;a<G.length;a++)0>mxUtils.indexOf(u,G[a])&&u.push(G[a]);var C=function(a,d){var b=
+c.getModel();b.beginUpdate();try{if(d)for(var f=b.isEdge(n),g=f?c.currentEdgeStyle:c.currentVertexStyle,f=["fontSize","fontFamily","fontColor"],e=0;e<f.length;e++){var l=g[f[e]];null!=l&&c.setCellStyles(f[e],l,a)}else for(l=0;l<a.length;l++){for(var n=a[l],p=b.getStyle(n),C=null!=p?p.split(";"):[],J=u.slice(),e=0;e<C.length;e++){var y=C[e],k=y.indexOf("=");if(0<=k){var x=y.substring(0,k),Q=mxUtils.indexOf(J,x);0<=Q&&J.splice(Q,1);for(var m=0;m<r.length;m++){var z=r[m];if(0<=mxUtils.indexOf(z,x))for(var t=
+0;t<z.length;t++){var q=mxUtils.indexOf(J,z[t]);0<=q&&J.splice(q,1)}}}}for(var g=(f=b.isEdge(n))?c.currentEdgeStyle:c.currentVertexStyle,O=b.getStyle(n),e=0;e<J.length;e++){var x=J[e],v=g[x];null==v||"shape"==x&&!f||f&&!(0>mxUtils.indexOf(G,x))||(O=mxUtils.setStyle(O,x,v),console.log("here",x,v))}b.setStyle(n,O)}}finally{b.endUpdate()}};c.addListener("cellsInserted",function(a,d){C(d.getProperty("cells"))});c.addListener("textInserted",function(a,d){C(d.getProperty("cells"),!0)});c.connectionHandler.addListener(mxEvent.CONNECT,
+function(a,d){var b=[d.getProperty("cell")];d.getProperty("terminalInserted")&&b.push(d.getProperty("terminal"));C(b)});this.addListener("styleChanged",mxUtils.bind(this,function(a,d){var b=d.getProperty("cells"),f=!1,g=!1;if(0<b.length)for(var e=0;e<b.length&&(f=c.getModel().isVertex(b[e])||f,!(g=c.getModel().isEdge(b[e])||g)||!f);e++);else g=f=!0;for(var b=d.getProperty("keys"),l=d.getProperty("values"),e=0;e<b.length;e++){var r=0<=mxUtils.indexOf(z,b[e]);if("strokeColor"!=b[e]||null!=l[e]&&"none"!=
+l[e])if(0<=mxUtils.indexOf(G,b[e]))g||0<=mxUtils.indexOf(E,b[e])?null==l[e]?delete c.currentEdgeStyle[b[e]]:c.currentEdgeStyle[b[e]]=l[e]:f&&0<=mxUtils.indexOf(u,b[e])&&(null==l[e]?delete c.currentVertexStyle[b[e]]:c.currentVertexStyle[b[e]]=l[e]);else if(0<=mxUtils.indexOf(u,b[e])){if(f||r)null==l[e]?delete c.currentVertexStyle[b[e]]:c.currentVertexStyle[b[e]]=l[e];if(g||r||0<=mxUtils.indexOf(E,b[e]))null==l[e]?delete c.currentEdgeStyle[b[e]]:c.currentEdgeStyle[b[e]]=l[e]}}null!=this.toolbar&&(this.toolbar.setFontName(c.currentVertexStyle.fontFamily||
+Menus.prototype.defaultFont),this.toolbar.setFontSize(c.currentVertexStyle.fontSize||Menus.prototype.defaultFontSize),null!=this.toolbar.edgeStyleMenu&&(this.toolbar.edgeStyleMenu.getElementsByTagName("div")[0].className="orthogonalEdgeStyle"==c.currentEdgeStyle.edgeStyle&&"1"==c.currentEdgeStyle.curved?"geSprite geSprite-curved":"straight"==c.currentEdgeStyle.edgeStyle||"none"==c.currentEdgeStyle.edgeStyle||null==c.currentEdgeStyle.edgeStyle?"geSprite geSprite-straight":"entityRelationEdgeStyle"==
+c.currentEdgeStyle.edgeStyle?"geSprite geSprite-entity":"elbowEdgeStyle"==c.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==c.currentEdgeStyle.elbow?"verticalelbow":"horizontalelbow"):"isometricEdgeStyle"==c.currentEdgeStyle.edgeStyle?"geSprite geSprite-"+("vertical"==c.currentEdgeStyle.elbow?"verticalisometric":"horizontalisometric"):"geSprite geSprite-orthogonal"),null!=this.toolbar.edgeShapeMenu&&(this.toolbar.edgeShapeMenu.getElementsByTagName("div")[0].className="link"==c.currentEdgeStyle.shape?
+"geSprite geSprite-linkedge":"flexArrow"==c.currentEdgeStyle.shape?"geSprite geSprite-arrow":"arrow"==c.currentEdgeStyle.shape?"geSprite geSprite-simplearrow":"geSprite geSprite-connection"),null!=this.toolbar.lineStartMenu&&(this.toolbar.lineStartMenu.getElementsByTagName("div")[0].className=this.getCssClassForMarker("start",c.currentEdgeStyle.shape,c.currentEdgeStyle[mxConstants.STYLE_STARTARROW],mxUtils.getValue(c.currentEdgeStyle,"startFill","1"))),null!=this.toolbar.lineEndMenu&&(this.toolbar.lineEndMenu.getElementsByTagName("div")[0].className=
+this.getCssClassForMarker("end",c.currentEdgeStyle.shape,c.currentEdgeStyle[mxConstants.STYLE_ENDARROW],mxUtils.getValue(c.currentEdgeStyle,"endFill","1"))))}));null!=this.toolbar&&(a=mxUtils.bind(this,function(){var a=c.currentVertexStyle.fontFamily||"Helvetica",d=String(c.currentVertexStyle.fontSize||"12"),b=c.getView().getState(c.getSelectionCell());null!=b&&(a=b.style[mxConstants.STYLE_FONTFAMILY]||a,d=b.style[mxConstants.STYLE_FONTSIZE]||d,10<a.length&&(a=a.substring(0,8)+"..."));this.toolbar.setFontName(a);
+this.toolbar.setFontSize(d)}),c.getSelectionModel().addListener(mxEvent.CHANGE,a),c.getModel().addListener(mxEvent.CHANGE,a));c.addListener(mxEvent.CELLS_ADDED,function(a,d){var b=d.getProperty("cells"),f=d.getProperty("parent");c.getModel().isLayer(f)&&!c.isCellVisible(f)&&null!=b&&0<b.length&&c.getModel().setVisible(f,!0)});this.gestureHandler=mxUtils.bind(this,function(a){null!=this.currentMenu&&mxEvent.getSource(a)!=this.currentMenu.div&&this.hideCurrentMenu()});mxEvent.addGestureListeners(document,
this.gestureHandler);this.resizeHandler=mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){null!=this.editor.graph&&this.refresh()}),0)});mxEvent.addListener(window,"resize",this.resizeHandler);this.orientationChangeHandler=mxUtils.bind(this,function(){this.refresh()});mxEvent.addListener(window,"orientationchange",this.orientationChangeHandler);mxClient.IS_IOS&&!window.navigator.standalone&&(this.scrollHandler=mxUtils.bind(this,function(){window.scrollTo(0,0)}),mxEvent.addListener(window,
-"scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){d.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){d.view.validateBackground()}));d.addListener("gridSizeChanged",mxUtils.bind(this,function(){d.isGridEnabled()&&d.view.validateBackground()}));this.editor.resetGraph();this.init();this.open()};
+"scroll",this.scrollHandler));this.editor.addListener("resetGraphView",mxUtils.bind(this,function(){this.resetScrollbars()}));this.addListener("gridEnabledChanged",mxUtils.bind(this,function(){c.view.validateBackground()}));this.addListener("backgroundColorChanged",mxUtils.bind(this,function(){c.view.validateBackground()}));c.addListener("gridSizeChanged",mxUtils.bind(this,function(){c.isGridEnabled()&&c.view.validateBackground()}));this.editor.resetGraph();this.init();this.open()};
mxUtils.extend(EditorUi,mxEventSource);EditorUi.compactUi=!0;EditorUi.prototype.splitSize=mxClient.IS_TOUCH||mxClient.IS_POINTER?12:8;EditorUi.prototype.menubarHeight=30;EditorUi.prototype.formatEnabled=!0;EditorUi.prototype.formatWidth=240;EditorUi.prototype.toolbarHeight=40;EditorUi.prototype.footerHeight=28;EditorUi.prototype.sidebarFooterHeight=34;EditorUi.prototype.hsplitPosition=640>=screen.width?118:240;EditorUi.prototype.allowAnimation=!0;EditorUi.prototype.lightboxMaxFitScale=2;
EditorUi.prototype.lightboxVerticalDivider=4;EditorUi.prototype.hsplitClickEnabled=!1;
EditorUi.prototype.init=function(){var a=this.editor.graph;mxEvent.addListener(a.container,"keydown",mxUtils.bind(this,function(a){this.onKeyDown(a)}));mxEvent.addListener(a.container,"keypress",mxUtils.bind(this,function(a){this.onKeyPress(a)}));this.addUndoListener();this.addBeforeUnloadListener();a.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));a.getModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(){this.updateActionStates()}));
var b=a.setDefaultParent,e=this;this.editor.graph.setDefaultParent=function(){b.apply(this,arguments);e.updateActionStates()};a.editLink=e.actions.get("editLink").funct;this.updateActionStates();this.initClipboard();this.initCanvas();null!=this.format&&this.format.init()};EditorUi.prototype.onKeyDown=function(a){var b=this.editor.graph;9==a.which&&b.isEnabled()&&!mxEvent.isAltDown(a)&&(b.isEditing()?b.stopEditing(!1):b.selectCell(!mxEvent.isShiftDown(a)),mxEvent.consume(a))};
EditorUi.prototype.onKeyPress=function(a){var b=this.editor.graph;!this.isImmediateEditingEvent(a)||b.isEditing()||b.isSelectionEmpty()||0===a.which||mxEvent.isAltDown(a)||mxEvent.isControlDown(a)||mxEvent.isMetaDown(a)||(b.escape(),b.startEditing(),mxClient.IS_FF&&(b=b.cellEditor,b.textarea.innerHTML=String.fromCharCode(a.which),a=document.createRange(),a.selectNodeContents(b.textarea),a.collapse(!1),b=window.getSelection(),b.removeAllRanges(),b.addRange(a)))};
EditorUi.prototype.isImmediateEditingEvent=function(a){return!0};
-EditorUi.prototype.getCssClassForMarker=function(a,b,e,d){return"flexArrow"==b?null!=e&&e!=mxConstants.NONE?"geSprite geSprite-"+a+"blocktrans":"geSprite geSprite-noarrow":e==mxConstants.ARROW_CLASSIC?"1"==d?"geSprite geSprite-"+a+"classic":"geSprite geSprite-"+a+"classictrans":e==mxConstants.ARROW_CLASSIC_THIN?"1"==d?"geSprite geSprite-"+a+"classicthin":"geSprite geSprite-"+a+"classicthintrans":e==mxConstants.ARROW_OPEN?"geSprite geSprite-"+a+"open":e==mxConstants.ARROW_OPEN_THIN?"geSprite geSprite-"+
-a+"openthin":e==mxConstants.ARROW_BLOCK?"1"==d?"geSprite geSprite-"+a+"block":"geSprite geSprite-"+a+"blocktrans":e==mxConstants.ARROW_BLOCK_THIN?"1"==d?"geSprite geSprite-"+a+"blockthin":"geSprite geSprite-"+a+"blockthintrans":e==mxConstants.ARROW_OVAL?"1"==d?"geSprite geSprite-"+a+"oval":"geSprite geSprite-"+a+"ovaltrans":e==mxConstants.ARROW_DIAMOND?"1"==d?"geSprite geSprite-"+a+"diamond":"geSprite geSprite-"+a+"diamondtrans":e==mxConstants.ARROW_DIAMOND_THIN?"1"==d?"geSprite geSprite-"+a+"thindiamond":
-"geSprite geSprite-"+a+"thindiamondtrans":"openAsync"==e?"geSprite geSprite-"+a+"openasync":"dash"==e?"geSprite geSprite-"+a+"dash":"cross"==e?"geSprite geSprite-"+a+"cross":"async"==e?"1"==d?"geSprite geSprite-"+a+"async":"geSprite geSprite-"+a+"asynctrans":"circle"==e||"circlePlus"==e?"1"==d||"circle"==e?"geSprite geSprite-"+a+"circle":"geSprite geSprite-"+a+"circleplus":"ERone"==e?"geSprite geSprite-"+a+"erone":"ERmandOne"==e?"geSprite geSprite-"+a+"eronetoone":"ERmany"==e?"geSprite geSprite-"+
+EditorUi.prototype.getCssClassForMarker=function(a,b,e,c){return"flexArrow"==b?null!=e&&e!=mxConstants.NONE?"geSprite geSprite-"+a+"blocktrans":"geSprite geSprite-noarrow":e==mxConstants.ARROW_CLASSIC?"1"==c?"geSprite geSprite-"+a+"classic":"geSprite geSprite-"+a+"classictrans":e==mxConstants.ARROW_CLASSIC_THIN?"1"==c?"geSprite geSprite-"+a+"classicthin":"geSprite geSprite-"+a+"classicthintrans":e==mxConstants.ARROW_OPEN?"geSprite geSprite-"+a+"open":e==mxConstants.ARROW_OPEN_THIN?"geSprite geSprite-"+
+a+"openthin":e==mxConstants.ARROW_BLOCK?"1"==c?"geSprite geSprite-"+a+"block":"geSprite geSprite-"+a+"blocktrans":e==mxConstants.ARROW_BLOCK_THIN?"1"==c?"geSprite geSprite-"+a+"blockthin":"geSprite geSprite-"+a+"blockthintrans":e==mxConstants.ARROW_OVAL?"1"==c?"geSprite geSprite-"+a+"oval":"geSprite geSprite-"+a+"ovaltrans":e==mxConstants.ARROW_DIAMOND?"1"==c?"geSprite geSprite-"+a+"diamond":"geSprite geSprite-"+a+"diamondtrans":e==mxConstants.ARROW_DIAMOND_THIN?"1"==c?"geSprite geSprite-"+a+"thindiamond":
+"geSprite geSprite-"+a+"thindiamondtrans":"openAsync"==e?"geSprite geSprite-"+a+"openasync":"dash"==e?"geSprite geSprite-"+a+"dash":"cross"==e?"geSprite geSprite-"+a+"cross":"async"==e?"1"==c?"geSprite geSprite-"+a+"async":"geSprite geSprite-"+a+"asynctrans":"circle"==e||"circlePlus"==e?"1"==c||"circle"==e?"geSprite geSprite-"+a+"circle":"geSprite geSprite-"+a+"circleplus":"ERone"==e?"geSprite geSprite-"+a+"erone":"ERmandOne"==e?"geSprite geSprite-"+a+"eronetoone":"ERmany"==e?"geSprite geSprite-"+
a+"ermany":"ERoneToMany"==e?"geSprite geSprite-"+a+"eronetomany":"ERzeroToOne"==e?"geSprite geSprite-"+a+"eroneopt":"ERzeroToMany"==e?"geSprite geSprite-"+a+"ermanyopt":"geSprite geSprite-noarrow"};EditorUi.prototype.createMenus=function(){return null};
EditorUi.prototype.updatePasteActionStates=function(){var a=this.editor.graph,b=this.actions.get("paste"),e=this.actions.get("pasteHere");b.setEnabled(this.editor.graph.cellEditor.isContentEditing()||!mxClipboard.isEmpty()&&a.isEnabled()&&!a.isCellLocked(a.getDefaultParent()));e.setEnabled(b.isEnabled())};
-EditorUi.prototype.initClipboard=function(){var a=this,b=mxClipboard.cut;mxClipboard.cut=function(d){d.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):b.apply(this,arguments);a.updatePasteActionStates()};var e=mxClipboard.copy;mxClipboard.copy=function(b){b.cellEditor.isContentEditing()?document.execCommand("copy",!1,null):e.apply(this,arguments);a.updatePasteActionStates()};var d=mxClipboard.paste;mxClipboard.paste=function(b){var e=null;b.cellEditor.isContentEditing()?document.execCommand("paste",
-!1,null):e=d.apply(this,arguments);a.updatePasteActionStates();return e};var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);a.updatePasteActionStates()};var m=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(b,d){m.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20;
-EditorUi.prototype.initCanvas=function(){var a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var a=this.graph.getPageLayout(),c=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*c.width),this.scale*(this.translate.y+a.y*c.height),this.scale*a.width*c.width,
-this.scale*a.height*c.height)};a.getPreferredPageSize=function(a,c,b){a=this.getPageLayout();c=this.getPageSize();return new mxRectangle(0,0,a.width*c.width,a.height*c.height)};var b=null,e=this;if(this.editor.isChromelessView()){this.chromelessResize=b=mxUtils.bind(this,function(c,b,f,d){if(null!=a.container){f=null!=f?f:0;d=null!=d?d:0;var e=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),g=mxUtils.hasScrollbars(a.container),l=a.view.translate,r=a.view.scale,n=mxRectangle.fromRectangle(e);
-n.x=n.x/r-l.x;n.y=n.y/r-l.y;n.width/=r;n.height/=r;var l=a.container.scrollTop,p=a.container.scrollLeft,C=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)C+=3;var J=a.container.offsetWidth-C,C=a.container.offsetHeight-C;c=c?Math.max(.3,Math.min(b||1,J/n.width)):r;b=(J-c*n.width)/2/c;var u=0==this.lightboxVerticalDivider?0:(C-c*n.height)/this.lightboxVerticalDivider/c;g&&(b=Math.max(b,0),u=Math.max(u,0));if(g||e.width<J||e.height<C)a.view.scaleAndTranslate(c,
-Math.floor(b-n.x),Math.floor(u-n.y)),a.container.scrollTop=l*c/r,a.container.scrollLeft=p*c/r;else if(0!=f||0!=d)e=a.view.translate,a.view.setTranslate(Math.floor(e.x+f/r),Math.floor(e.y+d/r))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var d=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",d);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",d)});this.editor.addListener("resetGraphView",
-mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(c){a.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(c){a.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var k=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";
-this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left="50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var m=mxUtils.bind(this,function(){var c=mxUtils.getCurrentStyle(a.container);
-this.chromelessToolbar.style.bottom=(null!=c?parseInt(c["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",m);m();var q=0,m=mxUtils.bind(this,function(a,c,b){q++;var f=document.createElement("span");f.style.paddingLeft="8px";f.style.paddingRight="8px";f.style.cursor="pointer";mxEvent.addListener(f,"click",a);null!=b&&f.setAttribute("title",b);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",
-c);f.appendChild(a);this.chromelessToolbar.appendChild(f);return f});null!=k.backBtn&&m(mxUtils.bind(this,function(a){window.location.href=k.backBtn.url;mxEvent.consume(a)}),Editor.backLargeImage,mxResources.get("back",null,"Back"));var t=m(mxUtils.bind(this,function(a){this.actions.get("previousPage").funct();mxEvent.consume(a)}),Editor.previousLargeImage,mxResources.get("previousPage")),v=document.createElement("div");v.style.display="inline-block";v.style.verticalAlign="top";v.style.fontFamily=
-"Helvetica,Arial";v.style.marginTop="8px";v.style.fontSize="14px";v.style.color="#ffffff";this.chromelessToolbar.appendChild(v);var A=m(mxUtils.bind(this,function(a){this.actions.get("nextPage").funct();mxEvent.consume(a)}),Editor.nextLargeImage,mxResources.get("nextPage")),c=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&(v.innerHTML="",mxUtils.write(v,mxUtils.indexOf(this.pages,this.currentPage)+1+" / "+this.pages.length))});t.style.paddingLeft="0px";
-t.style.paddingRight="4px";A.style.paddingLeft="4px";A.style.paddingRight="0px";var f=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(A.style.display="",t.style.display="",v.style.display="inline-block"):(A.style.display="none",t.style.display="none",v.style.display="none");c()});this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",c);m(mxUtils.bind(this,function(a){this.actions.get("zoomOut").funct();mxEvent.consume(a)}),Editor.zoomOutLargeImage,
-mxResources.get("zoomOut")+" (Alt+Mousewheel)");m(mxUtils.bind(this,function(a){this.actions.get("zoomIn").funct();mxEvent.consume(a)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");m(mxUtils.bind(this,function(c){a.isLightboxView()?(1==a.view.scale?this.lightboxFit():a.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(c)}),Editor.actualSizeLargeImage,mxResources.get("fit"));var g=null,n=null,l=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),
+EditorUi.prototype.initClipboard=function(){var a=this,b=mxClipboard.cut;mxClipboard.cut=function(c){c.cellEditor.isContentEditing()?document.execCommand("cut",!1,null):b.apply(this,arguments);a.updatePasteActionStates()};var e=mxClipboard.copy;mxClipboard.copy=function(b){b.cellEditor.isContentEditing()?document.execCommand("copy",!1,null):e.apply(this,arguments);a.updatePasteActionStates()};var c=mxClipboard.paste;mxClipboard.paste=function(b){var e=null;b.cellEditor.isContentEditing()?document.execCommand("paste",
+!1,null):e=c.apply(this,arguments);a.updatePasteActionStates();return e};var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);a.updatePasteActionStates()};var m=this.editor.graph.cellEditor.stopEditing;this.editor.graph.cellEditor.stopEditing=function(b,c){m.apply(this,arguments);a.updatePasteActionStates()};this.updatePasteActionStates()};EditorUi.prototype.lazyZoomDelay=20;
+EditorUi.prototype.initCanvas=function(){var a=this.editor.graph;a.timerAutoScroll=!0;a.getPagePadding=function(){return new mxPoint(Math.max(0,Math.round((a.container.offsetWidth-34)/a.view.scale)),Math.max(0,Math.round((a.container.offsetHeight-34)/a.view.scale)))};a.view.getBackgroundPageBounds=function(){var a=this.graph.getPageLayout(),d=this.graph.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*d.width),this.scale*(this.translate.y+a.y*d.height),this.scale*a.width*d.width,
+this.scale*a.height*d.height)};a.getPreferredPageSize=function(a,d,b){a=this.getPageLayout();d=this.getPageSize();return new mxRectangle(0,0,a.width*d.width,a.height*d.height)};var b=null,e=this;if(this.editor.isChromelessView()){this.chromelessResize=b=mxUtils.bind(this,function(d,b,f,c){if(null!=a.container){f=null!=f?f:0;c=null!=c?c:0;var e=a.pageVisible?a.view.getBackgroundPageBounds():a.getGraphBounds(),g=mxUtils.hasScrollbars(a.container),l=a.view.translate,r=a.view.scale,n=mxRectangle.fromRectangle(e);
+n.x=n.x/r-l.x;n.y=n.y/r-l.y;n.width/=r;n.height/=r;var l=a.container.scrollTop,p=a.container.scrollLeft,C=mxClient.IS_QUIRKS||8<=document.documentMode?20:14;if(8==document.documentMode||9==document.documentMode)C+=3;var J=a.container.offsetWidth-C,C=a.container.offsetHeight-C;d=d?Math.max(.3,Math.min(b||1,J/n.width)):r;b=(J-d*n.width)/2/d;var u=0==this.lightboxVerticalDivider?0:(C-d*n.height)/this.lightboxVerticalDivider/d;g&&(b=Math.max(b,0),u=Math.max(u,0));if(g||e.width<J||e.height<C)a.view.scaleAndTranslate(d,
+Math.floor(b-n.x),Math.floor(u-n.y)),a.container.scrollTop=l*d/r,a.container.scrollLeft=p*d/r;else if(0!=f||0!=c)e=a.view.translate,a.view.setTranslate(Math.floor(e.x+f/r),Math.floor(e.y+c/r))}});this.chromelessWindowResize=mxUtils.bind(this,function(){this.chromelessResize(!1)});var c=mxUtils.bind(this,function(){this.chromelessWindowResize(!1)});mxEvent.addListener(window,"resize",c);this.destroyFunctions.push(function(){mxEvent.removeListener(window,"resize",c)});this.editor.addListener("resetGraphView",
+mxUtils.bind(this,function(){this.chromelessResize(!0)}));this.actions.get("zoomIn").funct=mxUtils.bind(this,function(d){a.zoomIn();this.chromelessResize(!1)});this.actions.get("zoomOut").funct=mxUtils.bind(this,function(d){a.zoomOut();this.chromelessResize(!1)});if("0"!=urlParams.toolbar){var k=JSON.parse(decodeURIComponent(urlParams["toolbar-config"]||"{}"));this.chromelessToolbar=document.createElement("div");this.chromelessToolbar.style.position="fixed";this.chromelessToolbar.style.overflow="hidden";
+this.chromelessToolbar.style.boxSizing="border-box";this.chromelessToolbar.style.whiteSpace="nowrap";this.chromelessToolbar.style.backgroundColor="#000000";this.chromelessToolbar.style.padding="10px 10px 8px 10px";this.chromelessToolbar.style.left="50%";mxClient.IS_VML||(mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"borderRadius","20px"),mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transition","opacity 600ms ease-in-out"));var m=mxUtils.bind(this,function(){var d=mxUtils.getCurrentStyle(a.container);
+this.chromelessToolbar.style.bottom=(null!=d?parseInt(d["margin-bottom"]||0):0)+(null!=this.tabContainer?20+parseInt(this.tabContainer.style.height):20)+"px"});this.editor.addListener("resetGraphView",m);m();var q=0,m=mxUtils.bind(this,function(a,d,b){q++;var f=document.createElement("span");f.style.paddingLeft="8px";f.style.paddingRight="8px";f.style.cursor="pointer";mxEvent.addListener(f,"click",a);null!=b&&f.setAttribute("title",b);a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",
+d);f.appendChild(a);this.chromelessToolbar.appendChild(f);return f});null!=k.backBtn&&m(mxUtils.bind(this,function(a){window.location.href=k.backBtn.url;mxEvent.consume(a)}),Editor.backLargeImage,mxResources.get("back",null,"Back"));var t=m(mxUtils.bind(this,function(a){this.actions.get("previousPage").funct();mxEvent.consume(a)}),Editor.previousLargeImage,mxResources.get("previousPage")),v=document.createElement("div");v.style.display="inline-block";v.style.verticalAlign="top";v.style.fontFamily=
+"Helvetica,Arial";v.style.marginTop="8px";v.style.fontSize="14px";v.style.color="#ffffff";this.chromelessToolbar.appendChild(v);var A=m(mxUtils.bind(this,function(a){this.actions.get("nextPage").funct();mxEvent.consume(a)}),Editor.nextLargeImage,mxResources.get("nextPage")),d=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&(v.innerHTML="",mxUtils.write(v,mxUtils.indexOf(this.pages,this.currentPage)+1+" / "+this.pages.length))});t.style.paddingLeft="0px";
+t.style.paddingRight="4px";A.style.paddingLeft="4px";A.style.paddingRight="0px";var f=mxUtils.bind(this,function(){null!=this.pages&&1<this.pages.length&&null!=this.currentPage?(A.style.display="",t.style.display="",v.style.display="inline-block"):(A.style.display="none",t.style.display="none",v.style.display="none");d()});this.editor.addListener("resetGraphView",f);this.editor.addListener("pageSelected",d);m(mxUtils.bind(this,function(a){this.actions.get("zoomOut").funct();mxEvent.consume(a)}),Editor.zoomOutLargeImage,
+mxResources.get("zoomOut")+" (Alt+Mousewheel)");m(mxUtils.bind(this,function(a){this.actions.get("zoomIn").funct();mxEvent.consume(a)}),Editor.zoomInLargeImage,mxResources.get("zoomIn")+" (Alt+Mousewheel)");m(mxUtils.bind(this,function(d){a.isLightboxView()?(1==a.view.scale?this.lightboxFit():a.zoomTo(1),this.chromelessResize(!1)):this.chromelessResize(!0);mxEvent.consume(d)}),Editor.actualSizeLargeImage,mxResources.get("fit"));var g=null,n=null,l=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),
fadeThead=null);null!=n&&(window.clearTimeout(n),fadeThead2=null);g=window.setTimeout(mxUtils.bind(this,function(){mxUtils.setOpacity(this.chromelessToolbar,0);g=null;n=window.setTimeout(mxUtils.bind(this,function(){this.chromelessToolbar.style.display="none";n=null}),600)}),a||200)}),p=mxUtils.bind(this,function(a){null!=g&&(window.clearTimeout(g),fadeThead=null);null!=n&&(window.clearTimeout(n),fadeThead2=null);this.chromelessToolbar.style.display="";mxUtils.setOpacity(this.chromelessToolbar,a||
-30)});if("1"==urlParams.layers){this.layersDialog=null;var y=m(mxUtils.bind(this,function(c){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog();mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var b=y.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius",
+30)});if("1"==urlParams.layers){this.layersDialog=null;var y=m(mxUtils.bind(this,function(d){if(null!=this.layersDialog)this.layersDialog.parentNode.removeChild(this.layersDialog),this.layersDialog=null;else{this.layersDialog=a.createLayersDialog();mxEvent.addListener(this.layersDialog,"mouseleave",mxUtils.bind(this,function(){this.layersDialog.parentNode.removeChild(this.layersDialog);this.layersDialog=null}));var b=y.getBoundingClientRect();mxUtils.setPrefixedStyle(this.layersDialog.style,"borderRadius",
"5px");this.layersDialog.style.position="fixed";this.layersDialog.style.fontFamily="Helvetica,Arial";this.layersDialog.style.backgroundColor="#000000";this.layersDialog.style.width="160px";this.layersDialog.style.padding="4px 2px 4px 2px";this.layersDialog.style.color="#ffffff";mxUtils.setOpacity(this.layersDialog,70);this.layersDialog.style.left=b.left+"px";this.layersDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";b=mxUtils.getCurrentStyle(this.editor.graph.container);
-this.layersDialog.style.zIndex=b.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(c)}),Editor.layersLargeImage,mxResources.get("layers")),x=a.getModel();x.addListener(mxEvent.CHANGE,function(){y.style.display=1<x.getChildCount(x.root)?"":"none"})}this.addChromelessToolbarItems(m);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||m(mxUtils.bind(this,function(c){null!=this.editor.editButtonFunc?this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):
-a.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(c)}),Editor.editLargeImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(f=0;f<this.lightboxToolbarActions.length;f++){var u=this.lightboxToolbarActions[f];m(u.fn,u.icon,u.tooltip)}null!=k.refreshBtn&&m(mxUtils.bind(this,function(a){k.refreshBtn.url?window.location.href=k.refreshBtn.url:window.location.reload();mxEvent.consume(a)}),Editor.refreshLargeImage,mxResources.get("refresh",null,"Refresh"));null!=k.fullscreenBtn&&
-window.self!==window.top&&m(mxUtils.bind(this,function(c){k.fullscreenBtn.url?a.openLink(k.fullscreenBtn.url):a.openLink(window.location.href);mxEvent.consume(c)}),Editor.fullscreenLargeImage,mxResources.get("openInNewWindow",null,"Open in New Window"));(k.closeBtn&&window.self===window.top||a.lightbox&&("1"==urlParams.close||this.container!=document.body))&&m(mxUtils.bind(this,function(a){"1"==urlParams.close||k.closeBtn?window.close():(this.destroy(),mxEvent.consume(a))}),Editor.closeLargeImage,
+this.layersDialog.style.zIndex=b.zIndex;document.body.appendChild(this.layersDialog)}mxEvent.consume(d)}),Editor.layersLargeImage,mxResources.get("layers")),x=a.getModel();x.addListener(mxEvent.CHANGE,function(){y.style.display=1<x.getChildCount(x.root)?"":"none"})}this.addChromelessToolbarItems(m);null==this.editor.editButtonLink&&null==this.editor.editButtonFunc||m(mxUtils.bind(this,function(d){null!=this.editor.editButtonFunc?this.editor.editButtonFunc():"_blank"==this.editor.editButtonLink?this.editor.editAsNew(this.getEditBlankXml()):
+a.openLink(this.editor.editButtonLink,"editWindow");mxEvent.consume(d)}),Editor.editLargeImage,mxResources.get("edit"));if(null!=this.lightboxToolbarActions)for(f=0;f<this.lightboxToolbarActions.length;f++){var u=this.lightboxToolbarActions[f];m(u.fn,u.icon,u.tooltip)}null!=k.refreshBtn&&m(mxUtils.bind(this,function(a){k.refreshBtn.url?window.location.href=k.refreshBtn.url:window.location.reload();mxEvent.consume(a)}),Editor.refreshLargeImage,mxResources.get("refresh",null,"Refresh"));null!=k.fullscreenBtn&&
+window.self!==window.top&&m(mxUtils.bind(this,function(d){k.fullscreenBtn.url?a.openLink(k.fullscreenBtn.url):a.openLink(window.location.href);mxEvent.consume(d)}),Editor.fullscreenLargeImage,mxResources.get("openInNewWindow",null,"Open in New Window"));(k.closeBtn&&window.self===window.top||a.lightbox&&("1"==urlParams.close||this.container!=document.body))&&m(mxUtils.bind(this,function(a){"1"==urlParams.close||k.closeBtn?window.close():(this.destroy(),mxEvent.consume(a))}),Editor.closeLargeImage,
mxResources.get("close")+" (Escape)");this.chromelessToolbar.style.display="none";mxUtils.setPrefixedStyle(this.chromelessToolbar.style,"transform","translate(-50%,0)");a.container.appendChild(this.chromelessToolbar);mxEvent.addListener(a.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(mxEvent.isShiftDown(a)||p(30),l())}));mxEvent.addListener(this.chromelessToolbar,mxClient.IS_POINTER?"pointermove":"mousemove",function(a){mxEvent.consume(a)});
-mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?l():p(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?l():p(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||p(30)}));var G=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(c,b){this.startX=
-b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,c){},mouseUp:function(c,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<G&&Math.abs(this.scrollTop-a.container.scrollTop)<G&&Math.abs(this.startX-b.getGraphX())<G&&Math.abs(this.startY-b.getGraphY())<G&&(0<parseFloat(e.chromelessToolbar.style.opacity||0)?l():p(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var z=
-a.view.validate;a.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var a=this.graph.getPagePadding(),c=this.graph.getPageSize();this.translate.x=a.x-(this.x0||0)*c.width;this.translate.y=a.y-(this.y0||0)*c.height}z.apply(this,arguments)};var E=a.sizeDidChange;a.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var c=this.getPageLayout(),b=this.getPagePadding(),f=this.getPageSize(),d=Math.ceil(2*b.x+c.width*
-f.width),e=Math.ceil(2*b.y+c.height*f.height),g=a.minimumGraphSize;if(null==g||g.width!=d||g.height!=e)a.minimumGraphSize=new mxRectangle(0,0,d,e);d=b.x-c.x*f.width;b=b.y-c.y*f.height;this.autoTranslate||this.view.translate.x==d&&this.view.translate.y==b?E.apply(this,arguments):(this.autoTranslate=!0,this.view.x0=c.x,this.view.y0=c.y,c=a.view.translate.x,f=a.view.translate.y,a.view.setTranslate(d,b),a.container.scrollLeft+=Math.round((d-c)*a.view.scale),a.container.scrollTop+=Math.round((b-f)*a.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){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"))};
+mxEvent.addListener(this.chromelessToolbar,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?l():p(100)}));mxEvent.addListener(this.chromelessToolbar,"mousemove",mxUtils.bind(this,function(a){mxEvent.isShiftDown(a)?l():p(100);mxEvent.consume(a)}));mxEvent.addListener(this.chromelessToolbar,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||p(30)}));var G=a.getTolerance();a.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(d,b){this.startX=
+b.getGraphX();this.startY=b.getGraphY();this.scrollLeft=a.container.scrollLeft;this.scrollTop=a.container.scrollTop},mouseMove:function(a,d){},mouseUp:function(d,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-a.container.scrollLeft)<G&&Math.abs(this.scrollTop-a.container.scrollTop)<G&&Math.abs(this.startX-b.getGraphX())<G&&Math.abs(this.startY-b.getGraphY())<G&&(0<parseFloat(e.chromelessToolbar.style.opacity||0)?l():p(30))}})}this.editor.editable||this.addChromelessClickHandler()}else if(this.editor.extendCanvas){var z=
+a.view.validate;a.view.validate=function(){if(null!=this.graph.container&&mxUtils.hasScrollbars(this.graph.container)){var a=this.graph.getPagePadding(),d=this.graph.getPageSize();this.translate.x=a.x-(this.x0||0)*d.width;this.translate.y=a.y-(this.y0||0)*d.height}z.apply(this,arguments)};var E=a.sizeDidChange;a.sizeDidChange=function(){if(null!=this.container&&mxUtils.hasScrollbars(this.container)){var d=this.getPageLayout(),b=this.getPagePadding(),f=this.getPageSize(),c=Math.ceil(2*b.x+d.width*
+f.width),e=Math.ceil(2*b.y+d.height*f.height),g=a.minimumGraphSize;if(null==g||g.width!=c||g.height!=e)a.minimumGraphSize=new mxRectangle(0,0,c,e);c=b.x-d.x*f.width;b=b.y-d.y*f.height;this.autoTranslate||this.view.translate.x==c&&this.view.translate.y==b?E.apply(this,arguments):(this.autoTranslate=!0,this.view.x0=d.x,this.view.y0=d.y,d=a.view.translate.x,f=a.view.translate.y,a.view.setTranslate(c,b),a.container.scrollLeft+=Math.round((c-d)*a.view.scale),a.container.scrollTop+=Math.round((b-f)*a.view.scale),
+this.autoTranslate=!1)}}}a.updateZoomTimeout=null;a.cumulativeZoomFactor=1;var r=null;a.lazyZoom=function(d){null!=this.updateZoomTimeout&&window.clearTimeout(this.updateZoomTimeout);d?.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 d=mxUtils.getOffset(a.container),f=0,c=0;null!=r&&(f=a.container.offsetWidth/2-r.x+d.x,c=a.container.offsetHeight/2-r.y+d.y);d=this.view.scale;
+this.zoom(this.cumulativeZoomFactor);this.view.scale!=d&&(null!=b&&e.chromelessResize(!1,null,f*(this.cumulativeZoomFactor-1),c*(this.cumulativeZoomFactor-1)),!mxUtils.hasScrollbars(a.container)||0==f&&0==c||(a.container.scrollLeft-=f*(this.cumulativeZoomFactor-1),a.container.scrollTop-=c*(this.cumulativeZoomFactor-1)));this.cumulativeZoomFactor=1;this.updateZoomTimeout=null}),this.lazyZoomDelay)};mxEvent.addMouseWheelListener(mxUtils.bind(this,function(d,b){if((null==this.dialogs||0==this.dialogs.length)&&
+a.isZoomWheelEvent(d))for(var f=mxEvent.getSource(d);null!=f;){if(f==a.container){r=new mxPoint(mxEvent.getClientX(d),mxEvent.getClientY(d));a.lazyZoom(b);mxEvent.consume(d);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&&0<a.length&&(a="#"+a);this.editor.graph.addClickHandler(a)};EditorUi.prototype.toggleFormatPanel=function(a){null!=this.format&&(this.formatWidth=a||0<this.formatWidth?0:240,this.formatContainer.style.display=a||0<this.formatWidth?"":"none",this.refresh(),this.format.refresh(),this.fireEvent(new mxEventObject("formatWidthChanged")))};
EditorUi.prototype.lightboxFit=function(a){if(this.isDiagramEmpty())this.editor.graph.view.setScale(1);else{var b=urlParams.border,e=60;null!=b&&(e=parseInt(b));this.editor.graph.maxFitScale=this.lightboxMaxFitScale;this.editor.graph.fit(e,null,null,null,null,null,a);this.editor.graph.maxFitScale=null}};EditorUi.prototype.isDiagramEmpty=function(){var a=this.editor.graph.getModel();return 1==a.getChildCount(a.root)&&0==a.getChildCount(a.getChildAt(a.root,0))};
EditorUi.prototype.isSelectionAllowed=function(a){return"SELECT"==mxEvent.getSource(a).nodeName||"INPUT"==mxEvent.getSource(a).nodeName&&mxUtils.isAncestorNode(this.formatContainer,mxEvent.getSource(a))};EditorUi.prototype.addBeforeUnloadListener=function(){window.onbeforeunload=mxUtils.bind(this,function(){if(!this.editor.isChromelessView())return this.onBeforeUnload()})};EditorUi.prototype.onBeforeUnload=function(){if(this.editor.modified)return mxResources.get("allChangesLost")};
-EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var e=mxUtils.parseXml(a);this.editor.setGraphXml(e.documentElement);this.editor.setModified(!1);this.editor.undoManager.clear();null!=b&&(this.editor.setFilename(b),this.updateDocumentTitle())}catch(d){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+d.message)}}))}catch(a){}this.editor.graph.view.validate();this.editor.graph.sizeDidChange();
+EditorUi.prototype.open=function(){try{null!=window.opener&&null!=window.opener.openFile&&window.opener.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var e=mxUtils.parseXml(a);this.editor.setGraphXml(e.documentElement);this.editor.setModified(!1);this.editor.undoManager.clear();null!=b&&(this.editor.setFilename(b),this.updateDocumentTitle())}catch(c){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+c.message)}}))}catch(a){}this.editor.graph.view.validate();this.editor.graph.sizeDidChange();
this.editor.fireEvent(new mxEventObject("resetGraphView"))};EditorUi.prototype.setCurrentMenu=function(a,b){this.currentMenuElt=b;this.currentMenu=a};EditorUi.prototype.resetCurrentMenu=function(){this.currentMenu=this.currentMenuElt=null};EditorUi.prototype.hideCurrentMenu=function(){null!=this.currentMenu&&(this.currentMenu.hideMenu(),this.resetCurrentMenu())};
EditorUi.prototype.updateDocumentTitle=function(){var a=this.editor.getOrCreateFilename();null!=this.editor.appName&&(a+=" - "+this.editor.appName);document.title=a};EditorUi.prototype.createHoverIcons=function(){return new HoverIcons(this.editor.graph)};EditorUi.prototype.redo=function(){try{this.editor.graph.isEditing()?document.execCommand("redo",!1,null):this.editor.undoManager.redo()}catch(a){}};
EditorUi.prototype.undo=function(){try{var a=this.editor.graph;if(a.isEditing()){var b=a.cellEditor.textarea.innerHTML;document.execCommand("undo",!1,null);b==a.cellEditor.textarea.innerHTML&&(a.stopEditing(!0),this.editor.undoManager.undo())}else this.editor.undoManager.undo()}catch(e){}};EditorUi.prototype.canRedo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canRedo()};EditorUi.prototype.canUndo=function(){return this.editor.graph.isEditing()||this.editor.undoManager.canUndo()};
@@ -2138,26 +2137,26 @@ EditorUi.prototype.resetScrollbars=function(){var a=this.editor.graph;if(!this.e
1;b=a.getGraphBounds();0<b.width&&0<b.height&&(b.x>a.container.scrollLeft+.9*a.container.clientWidth&&(a.container.scrollLeft=Math.min(b.x+b.width-a.container.clientWidth,b.x-10)),b.y>a.container.scrollTop+.9*a.container.clientHeight&&(a.container.scrollTop=Math.min(b.y+b.height-a.container.clientHeight,b.y-10)))}else{var b=a.getGraphBounds(),e=Math.max(b.width,a.scrollTileSize.width*a.view.scale);a.container.scrollTop=Math.floor(Math.max(0,b.y-Math.max(20,(a.container.clientHeight-Math.max(b.height,
a.scrollTileSize.height*a.view.scale))/4)));a.container.scrollLeft=Math.floor(Math.max(0,b.x-Math.max(0,(a.container.clientWidth-e)/2)))}else a.pageVisible?(b=a.view.getBackgroundPageBounds(),a.view.setTranslate(Math.floor(Math.max(0,(a.container.clientWidth-b.width)/2)-b.x),Math.floor(Math.max(0,(a.container.clientHeight-b.height)/2)-b.y))):(b=a.getGraphBounds(),a.view.setTranslate(Math.floor(Math.max(0,Math.max(0,(a.container.clientWidth-b.width)/2)-b.x)),Math.floor(Math.max(0,Math.max(20,(a.container.clientHeight-
b.height)/4))-b.y)))};
-EditorUi.prototype.setPageVisible=function(a){var b=this.editor.graph,e=mxUtils.hasScrollbars(b.container),d=0,k=0;e&&(d=b.view.translate.x*b.view.scale-b.container.scrollLeft,k=b.view.translate.y*b.view.scale-b.container.scrollTop);b.pageVisible=a;b.pageBreaksVisible=a;b.preferPageSize=a;b.view.validateBackground();e&&(a=b.getSelectionCells(),b.clearSelection(),b.setSelectionCells(a));b.sizeDidChange();e&&(b.container.scrollLeft=b.view.translate.x*b.view.scale-d,b.container.scrollTop=b.view.translate.y*
-b.view.scale-k);this.fireEvent(new mxEventObject("pageViewChanged"))};function ChangePageSetup(a,b,e,d){this.ui=a;this.previousColor=this.color=b;this.previousImage=this.image=e;this.previousFormat=this.format=d;this.ignoreImage=this.ignoreColor=!1}
+EditorUi.prototype.setPageVisible=function(a){var b=this.editor.graph,e=mxUtils.hasScrollbars(b.container),c=0,k=0;e&&(c=b.view.translate.x*b.view.scale-b.container.scrollLeft,k=b.view.translate.y*b.view.scale-b.container.scrollTop);b.pageVisible=a;b.pageBreaksVisible=a;b.preferPageSize=a;b.view.validateBackground();e&&(a=b.getSelectionCells(),b.clearSelection(),b.setSelectionCells(a));b.sizeDidChange();e&&(b.container.scrollLeft=b.view.translate.x*b.view.scale-c,b.container.scrollTop=b.view.translate.y*
+b.view.scale-k);this.fireEvent(new mxEventObject("pageViewChanged"))};function ChangePageSetup(a,b,e,c){this.ui=a;this.previousColor=this.color=b;this.previousImage=this.image=e;this.previousFormat=this.format=c;this.ignoreImage=this.ignoreColor=!1}
ChangePageSetup.prototype.execute=function(){var a=this.ui.editor.graph;if(!this.ignoreColor){this.color=this.previousColor;var b=a.background;this.ui.setBackgroundColor(this.previousColor);this.previousColor=b}this.ignoreImage||(this.image=this.previousImage,b=a.backgroundImage,this.ui.setBackgroundImage(this.previousImage),this.previousImage=b);null!=this.previousFormat&&(this.format=this.previousFormat,b=a.pageFormat,this.previousFormat.width!=b.width||this.previousFormat.height!=b.height)&&(this.ui.setPageFormat(this.previousFormat),
-this.previousFormat=b);null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.editor.graph.foldingEnabled&&(this.ui.setFoldingEnabled(this.foldingEnabled),this.foldingEnabled=!this.foldingEnabled)};(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.afterDecode=function(a,e,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);return d};mxCodecRegistry.register(a)})();
+this.previousFormat=b);null!=this.foldingEnabled&&this.foldingEnabled!=this.ui.editor.graph.foldingEnabled&&(this.ui.setFoldingEnabled(this.foldingEnabled),this.foldingEnabled=!this.foldingEnabled)};(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.afterDecode=function(a,e,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);return c};mxCodecRegistry.register(a)})();
EditorUi.prototype.setBackgroundColor=function(a){this.editor.graph.background=a;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("backgroundColorChanged"))};EditorUi.prototype.setFoldingEnabled=function(a){this.editor.graph.foldingEnabled=a;this.editor.graph.view.revalidate();this.fireEvent(new mxEventObject("foldingEnabledChanged"))};
EditorUi.prototype.setPageFormat=function(a){this.editor.graph.pageFormat=a;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageFormatChanged"))};EditorUi.prototype.setPageScale=function(a){this.editor.graph.pageScale=a;this.editor.graph.pageVisible?(this.editor.graph.view.validateBackground(),this.editor.graph.sizeDidChange()):this.actions.get("pageView").funct();this.fireEvent(new mxEventObject("pageScaleChanged"))};
EditorUi.prototype.setGridColor=function(a){this.editor.graph.view.gridColor=a;this.editor.graph.view.validateBackground();this.fireEvent(new mxEventObject("gridColorChanged"))};
-EditorUi.prototype.addUndoListener=function(){var a=this.actions.get("undo"),b=this.actions.get("redo"),e=this.editor.undoManager,d=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());b.setEnabled(this.canRedo())});e.addListener(mxEvent.ADD,d);e.addListener(mxEvent.UNDO,d);e.addListener(mxEvent.REDO,d);e.addListener(mxEvent.CLEAR,d);var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);d()};var m=this.editor.graph.cellEditor.stopEditing;
-this.editor.graph.cellEditor.stopEditing=function(a,b){m.apply(this,arguments);d()};d()};
-EditorUi.prototype.updateActionStates=function(){var a=this.editor.graph,b=!a.isSelectionEmpty(),e=!1,d=!1,k=a.getSelectionCells();if(null!=k)for(var m=0;m<k.length;m++){var q=k[m];a.getModel().isEdge(q)&&(d=!0);a.getModel().isVertex(q)&&(e=!0);if(d&&e)break}k="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack lockUnlock solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded sharp strokeColor".split(" ");for(m=
-0;m<k.length;m++)this.actions.get(k[m]).setEnabled(b);this.actions.get("setAsDefaultStyle").setEnabled(1==a.getSelectionCount());this.actions.get("clearWaypoints").setEnabled(!a.isSelectionEmpty());this.actions.get("copySize").setEnabled(1==a.getSelectionCount());this.actions.get("turn").setEnabled(!a.isSelectionEmpty());this.actions.get("curved").setEnabled(d);this.actions.get("rotation").setEnabled(e);this.actions.get("wordWrap").setEnabled(e);this.actions.get("autosize").setEnabled(e);d=e&&1==
-a.getSelectionCount();this.actions.get("group").setEnabled(1<a.getSelectionCount()||d&&!a.isContainer(a.getSelectionCell()));this.actions.get("ungroup").setEnabled(1==a.getSelectionCount()&&(0<a.getModel().getChildCount(a.getSelectionCell())||d&&a.isContainer(a.getSelectionCell())));this.actions.get("removeFromGroup").setEnabled(d&&a.getModel().isVertex(a.getModel().getParent(a.getSelectionCell())));a.view.getState(a.getSelectionCell());this.menus.get("navigation").setEnabled(b||null!=a.view.currentRoot);
+EditorUi.prototype.addUndoListener=function(){var a=this.actions.get("undo"),b=this.actions.get("redo"),e=this.editor.undoManager,c=mxUtils.bind(this,function(){a.setEnabled(this.canUndo());b.setEnabled(this.canRedo())});e.addListener(mxEvent.ADD,c);e.addListener(mxEvent.UNDO,c);e.addListener(mxEvent.REDO,c);e.addListener(mxEvent.CLEAR,c);var k=this.editor.graph.cellEditor.startEditing;this.editor.graph.cellEditor.startEditing=function(){k.apply(this,arguments);c()};var m=this.editor.graph.cellEditor.stopEditing;
+this.editor.graph.cellEditor.stopEditing=function(a,b){m.apply(this,arguments);c()};c()};
+EditorUi.prototype.updateActionStates=function(){var a=this.editor.graph,b=!a.isSelectionEmpty(),e=!1,c=!1,k=a.getSelectionCells();if(null!=k)for(var m=0;m<k.length;m++){var q=k[m];a.getModel().isEdge(q)&&(c=!0);a.getModel().isVertex(q)&&(e=!0);if(c&&e)break}k="cut copy bold italic underline delete duplicate editStyle editTooltip editLink backgroundColor borderColor edit toFront toBack lockUnlock solid dashed pasteSize dotted fillColor gradientColor shadow fontColor formattedText rounded toggleRounded sharp strokeColor".split(" ");for(m=
+0;m<k.length;m++)this.actions.get(k[m]).setEnabled(b);this.actions.get("setAsDefaultStyle").setEnabled(1==a.getSelectionCount());this.actions.get("clearWaypoints").setEnabled(!a.isSelectionEmpty());this.actions.get("copySize").setEnabled(1==a.getSelectionCount());this.actions.get("turn").setEnabled(!a.isSelectionEmpty());this.actions.get("curved").setEnabled(c);this.actions.get("rotation").setEnabled(e);this.actions.get("wordWrap").setEnabled(e);this.actions.get("autosize").setEnabled(e);c=e&&1==
+a.getSelectionCount();this.actions.get("group").setEnabled(1<a.getSelectionCount()||c&&!a.isContainer(a.getSelectionCell()));this.actions.get("ungroup").setEnabled(1==a.getSelectionCount()&&(0<a.getModel().getChildCount(a.getSelectionCell())||c&&a.isContainer(a.getSelectionCell())));this.actions.get("removeFromGroup").setEnabled(c&&a.getModel().isVertex(a.getModel().getParent(a.getSelectionCell())));a.view.getState(a.getSelectionCell());this.menus.get("navigation").setEnabled(b||null!=a.view.currentRoot);
this.actions.get("collapsible").setEnabled(e&&(a.isContainer(a.getSelectionCell())||0<a.model.getChildCount(a.getSelectionCell())));this.actions.get("home").setEnabled(null!=a.view.currentRoot);this.actions.get("exitGroup").setEnabled(null!=a.view.currentRoot);this.actions.get("enterGroup").setEnabled(1==a.getSelectionCount()&&a.isValidRoot(a.getSelectionCell()));b=1==a.getSelectionCount()&&a.isCellFoldable(a.getSelectionCell());this.actions.get("expand").setEnabled(b);this.actions.get("collapse").setEnabled(b);
this.actions.get("editLink").setEnabled(1==a.getSelectionCount());this.actions.get("openLink").setEnabled(1==a.getSelectionCount()&&null!=a.getLinkForCell(a.getSelectionCell()));this.actions.get("guides").setEnabled(a.isEnabled());this.actions.get("grid").setEnabled(!this.editor.chromeless||this.editor.editable);b=a.isEnabled()&&!a.isCellLocked(a.getDefaultParent());this.menus.get("layout").setEnabled(b);this.menus.get("insert").setEnabled(b);this.menus.get("direction").setEnabled(b&&e);this.menus.get("align").setEnabled(b&&
e&&1<a.getSelectionCount());this.menus.get("distribute").setEnabled(b&&e&&1<a.getSelectionCount());this.actions.get("selectVertices").setEnabled(b);this.actions.get("selectEdges").setEnabled(b);this.actions.get("selectAll").setEnabled(b);this.actions.get("selectNone").setEnabled(b);this.updatePasteActionStates()};
-EditorUi.prototype.refresh=function(a){a=null!=a?a:!0;var b=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),e=this.container.clientWidth,d=this.container.clientHeight;this.container==document.body&&(e=document.body.clientWidth||document.documentElement.clientWidth,d=b?document.body.clientHeight||document.documentElement.clientHeight:document.documentElement.clientHeight);var k=0;mxClient.IS_IOS&&!window.navigator.standalone&&window.innerHeight!=document.documentElement.clientHeight&&
+EditorUi.prototype.refresh=function(a){a=null!=a?a:!0;var b=mxClient.IS_IE&&(null==document.documentMode||5==document.documentMode),e=this.container.clientWidth,c=this.container.clientHeight;this.container==document.body&&(e=document.body.clientWidth||document.documentElement.clientWidth,c=b?document.body.clientHeight||document.documentElement.clientHeight:document.documentElement.clientHeight);var k=0;mxClient.IS_IOS&&!window.navigator.standalone&&window.innerHeight!=document.documentElement.clientHeight&&
(k=document.documentElement.clientHeight-window.innerHeight,window.scrollTo(0,0));var m=Math.max(0,Math.min(this.hsplitPosition,e-this.splitSize-20)),q=0;null!=this.menubar&&(this.menubarContainer.style.height=this.menubarHeight+"px",q+=this.menubarHeight);null!=this.toolbar&&(this.toolbarContainer.style.top=this.menubarHeight+"px",this.toolbarContainer.style.height=this.toolbarHeight+"px",q+=this.toolbarHeight);0<q&&!mxClient.IS_QUIRKS&&(q+=1);var t=0;if(null!=this.sidebarFooterContainer){var v=
-this.footerHeight+k,t=Math.max(0,Math.min(d-q-v,this.sidebarFooterHeight));this.sidebarFooterContainer.style.width=m+"px";this.sidebarFooterContainer.style.height=t+"px";this.sidebarFooterContainer.style.bottom=v+"px"}v=null!=this.format?this.formatWidth:0;this.sidebarContainer.style.top=q+"px";this.sidebarContainer.style.width=m+"px";this.formatContainer.style.top=q+"px";this.formatContainer.style.width=v+"px";this.formatContainer.style.display=null!=this.format?"":"none";this.diagramContainer.style.left=
+this.footerHeight+k,t=Math.max(0,Math.min(c-q-v,this.sidebarFooterHeight));this.sidebarFooterContainer.style.width=m+"px";this.sidebarFooterContainer.style.height=t+"px";this.sidebarFooterContainer.style.bottom=v+"px"}v=null!=this.format?this.formatWidth:0;this.sidebarContainer.style.top=q+"px";this.sidebarContainer.style.width=m+"px";this.formatContainer.style.top=q+"px";this.formatContainer.style.width=v+"px";this.formatContainer.style.display=null!=this.format?"":"none";this.diagramContainer.style.left=
null!=this.hsplit.parentNode?m+this.splitSize+"px":"0px";this.diagramContainer.style.top=this.sidebarContainer.style.top;this.footerContainer.style.height=this.footerHeight+"px";this.hsplit.style.top=this.sidebarContainer.style.top;this.hsplit.style.bottom=this.footerHeight+k+"px";this.hsplit.style.left=m+"px";this.footerContainer.style.display=0==this.footerHeight?"none":"";null!=this.tabContainer&&(this.tabContainer.style.left=this.diagramContainer.style.left);b?(this.menubarContainer.style.width=
-e+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width,b=Math.max(0,d-this.footerHeight-this.menubarHeight-this.toolbarHeight),this.sidebarContainer.style.height=b-t+"px",this.formatContainer.style.height=b+"px",this.diagramContainer.style.width=null!=this.hsplit.parentNode?Math.max(0,e-m-this.splitSize-v)+"px":e+"px",this.footerContainer.style.width=this.menubarContainer.style.width,t=Math.max(0,d-this.footerHeight-this.menubarHeight-this.toolbarHeight),null!=this.tabContainer&&
+e+"px",this.toolbarContainer.style.width=this.menubarContainer.style.width,b=Math.max(0,c-this.footerHeight-this.menubarHeight-this.toolbarHeight),this.sidebarContainer.style.height=b-t+"px",this.formatContainer.style.height=b+"px",this.diagramContainer.style.width=null!=this.hsplit.parentNode?Math.max(0,e-m-this.splitSize-v)+"px":e+"px",this.footerContainer.style.width=this.menubarContainer.style.width,t=Math.max(0,c-this.footerHeight-this.menubarHeight-this.toolbarHeight),null!=this.tabContainer&&
(this.tabContainer.style.width=this.diagramContainer.style.width,this.tabContainer.style.bottom=this.footerHeight+k+"px",t-=this.tabContainer.clientHeight),this.diagramContainer.style.height=t+"px",this.hsplit.style.height=t+"px"):(0<this.footerHeight&&(this.footerContainer.style.bottom=k+"px"),this.diagramContainer.style.right=v+"px",e=0,null!=this.tabContainer&&(this.tabContainer.style.bottom=this.footerHeight+k+"px",this.tabContainer.style.right=this.diagramContainer.style.right,e=this.tabContainer.clientHeight),
this.sidebarContainer.style.bottom=this.footerHeight+t+k+"px",this.formatContainer.style.bottom=this.footerHeight+k+"px",this.diagramContainer.style.bottom=this.footerHeight+k+e+"px");a&&this.editor.graph.sizeDidChange()};EditorUi.prototype.createTabContainer=function(){return null};
EditorUi.prototype.createDivs=function(){this.menubarContainer=this.createDiv("geMenubarContainer");this.toolbarContainer=this.createDiv("geToolbarContainer");this.sidebarContainer=this.createDiv("geSidebarContainer");this.formatContainer=this.createDiv("geSidebarContainer geFormatContainer");this.diagramContainer=this.createDiv("geDiagramContainer");this.footerContainer=this.createDiv("geFooterContainer");this.hsplit=this.createDiv("geHsplit");this.hsplit.setAttribute("title",mxResources.get("collapseExpand"));
@@ -2168,120 +2167,120 @@ this.sidebar=this.editor.chromeless?null:this.createSidebar(this.sidebarContaine
this.container.appendChild(this.sidebarFooterContainer);this.container.appendChild(this.diagramContainer);null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer);this.toolbar=this.editor.chromeless?null:this.createToolbar(this.createDiv("geToolbar"));null!=this.toolbar&&(this.toolbarContainer.appendChild(this.toolbar.container),this.container.appendChild(this.toolbarContainer));null!=this.sidebar&&(this.container.appendChild(this.hsplit),this.addSplitHandler(this.hsplit,
!0,0,mxUtils.bind(this,function(a){this.hsplitPosition=a;this.refresh()})))};EditorUi.prototype.createStatusContainer=function(){var a=document.createElement("a");a.className="geItem geStatus";420>screen.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!=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.addSplitHandler=function(a,b,e,c){function k(a){if(null!=q){var f=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a));c(Math.max(0,t+(b?f.x-q.x:q.y-f.y)-e));mxEvent.consume(a);t!=d()&&(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 d=mxUtils.bind(this,function(){var d=parseInt(b?a.style.left:a.style.bottom);b||(d=d+e-this.footerHeight);return d});mxEvent.addGestureListeners(a,function(a){q=new mxPoint(mxEvent.getClientX(a),
+mxEvent.getClientY(a));t=d();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=d();c(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,c,k,m,q,t,v){this.editor.graph.tooltipHandler.hideTooltip();null==this.dialogs&&(this.dialogs=[]);this.dialog=new Dialog(this,a,b,e,c,k,m,q,t,v);this.dialogs.push(this.dialog)};
EditorUi.prototype.hideDialog=function(a,b){if(null!=this.dialogs&&0<this.dialogs.length){var e=this.dialogs.pop();0==e.close(a,b)?this.dialogs.push(e):(this.dialog=0<this.dialogs.length?this.dialogs[this.dialogs.length-1]:null,null==this.dialog&&"hidden"!=this.editor.graph.container.style.visibility&&this.editor.graph.container.focus(),mxUtils.clearSelection(),this.editor.fireEvent(new mxEventObject("hideDialog")))}};
-EditorUi.prototype.pickColor=function(a,b){var e=this.editor.graph,d=e.cellEditor.saveSelection(),k=226+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12)),m=new ColorDialog(this,a||"none",function(a){e.cellEditor.restoreSelection(d);b(a)},function(){e.cellEditor.restoreSelection(d)});this.showDialog(m.container,230,k,!0,!1);m.init()};
+EditorUi.prototype.pickColor=function(a,b){var e=this.editor.graph,c=e.cellEditor.saveSelection(),k=226+17*(Math.ceil(ColorDialog.prototype.presetColors.length/12)+Math.ceil(ColorDialog.prototype.defaultColors.length/12)),m=new ColorDialog(this,a||"none",function(a){e.cellEditor.restoreSelection(c);b(a)},function(){e.cellEditor.restoreSelection(c)});this.showDialog(m.container,230,k,!0,!1);m.init()};
EditorUi.prototype.openFile=function(){window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));this.showDialog((new OpenDialog(this)).container,Editor.useLocalStorage?640:320,Editor.useLocalStorage?480:220,!0,!0,function(){window.openFile=null})};
-EditorUi.prototype.extractGraphModelFromHtml=function(a){var b=null;try{var e=a.indexOf("&lt;mxGraphModel ");if(0<=e){var d=a.lastIndexOf("&lt;/mxGraphModel&gt;");d>e&&(b=a.substring(e,d+21).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}}catch(k){}return b};
+EditorUi.prototype.extractGraphModelFromHtml=function(a){var b=null;try{var e=a.indexOf("&lt;mxGraphModel ");if(0<=e){var c=a.lastIndexOf("&lt;/mxGraphModel&gt;");c>e&&(b=a.substring(e,c+21).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}}catch(k){}return b};
EditorUi.prototype.extractGraphModelFromEvent=function(a){var b=null,e=null;null!=a&&(a=null!=a.dataTransfer?a.dataTransfer:a.clipboardData,null!=a&&(10==document.documentMode||11==document.documentMode?e=a.getData("Text"):(e=0<=mxUtils.indexOf(a.types,"text/html")?a.getData("text/html"):null,mxUtils.indexOf(a.types,null==e||0==e.length)&&(e=a.getData("text/plain"))),null!=e&&(e=Graph.zapGremlins(mxUtils.trim(e)),a=this.extractGraphModelFromHtml(e),null!=a&&(e=a))));null!=e&&this.isCompatibleString(e)&&
(b=e);return b};EditorUi.prototype.isCompatibleString=function(a){return!1};EditorUi.prototype.saveFile=function(a){a||null==this.editor.filename?(a=new FilenameDialog(this,this.editor.getOrCreateFilename(),mxResources.get("save"),mxUtils.bind(this,function(a){this.save(a)}),null,mxUtils.bind(this,function(a){if(null!=a&&0<a.length)return!0;mxUtils.confirm(mxResources.get("invalidName"));return!1})),this.showDialog(a.container,300,100,!0,!0),a.init()):this.save(this.editor.getOrCreateFilename())};
EditorUi.prototype.save=function(a){if(null!=a){this.editor.graph.isEditing()&&this.editor.graph.stopEditing();var b=mxUtils.getXml(this.editor.getGraphXml());try{if(Editor.useLocalStorage){if(null!=localStorage.getItem(a)&&!mxUtils.confirm(mxResources.get("replaceIt",[a])))return;localStorage.setItem(a,b);this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saved"))+" "+new Date)}else if(b.length<MAX_REQUEST_SIZE)(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(a)+"&xml="+encodeURIComponent(b))).simulate(document,
"_blank");else{mxUtils.alert(mxResources.get("drawingTooLarge"));mxUtils.popup(b);return}this.editor.setModified(!1);this.editor.setFilename(a);this.updateDocumentTitle()}catch(e){this.editor.setStatus(mxUtils.htmlEntities(mxResources.get("errorSavingFile")))}}};
-EditorUi.prototype.executeLayout=function(a,b,e){var d=this.editor.graph;if(d.isEnabled()){d.getModel().beginUpdate();try{a()}catch(k){throw k;}finally{this.allowAnimation&&b&&0>navigator.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&&0<m.length){var q=new Image;q.onload=function(){e(m,q.width,q.height)};q.onerror=function(){e(null);mxUtils.alert(mxResources.get("fileNotFound"))};q.src=m}else e(null)};EditorUi.prototype.showLinkDialog=function(a,b,e){a=new LinkDialog(this,a,b,e);this.showDialog(a.container,420,90,!0,!0);a.init()};
+EditorUi.prototype.executeLayout=function(a,b,e){var c=this.editor.graph;if(c.isEnabled()){c.getModel().beginUpdate();try{a()}catch(k){throw k;}finally{this.allowAnimation&&b&&0>navigator.userAgent.indexOf("Camino")?(a=new mxMorphing(c),a.addListener(mxEvent.DONE,mxUtils.bind(this,function(){c.getModel().endUpdate();null!=e&&e()})),a.startAnimation()):(c.getModel().endUpdate(),null!=e&&e())}}};
+EditorUi.prototype.showImageDialog=function(a,b,e,c){c=this.editor.graph.cellEditor;var k=c.saveSelection(),m=mxUtils.prompt(a,b);c.restoreSelection(k);if(null!=m&&0<m.length){var q=new Image;q.onload=function(){e(m,q.width,q.height)};q.onerror=function(){e(null);mxUtils.alert(mxResources.get("fileNotFound"))};q.src=m}else e(null)};EditorUi.prototype.showLinkDialog=function(a,b,e){a=new LinkDialog(this,a,b,e);this.showDialog(a.container,420,90,!0,!0);a.init()};
EditorUi.prototype.showDataDialog=function(a){null!=a&&(a=new EditDataDialog(this,a),this.showDialog(a.container,480,420,!0,!1,null,!1),a.init())};
EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=!0;this.editor.graph.model.execute(a)});var b=mxUtils.prompt(mxResources.get("backgroundImage"),"");if(null!=b&&0<b.length){var e=new Image;e.onload=function(){a(new mxImage(b,e.width,e.height))};e.onerror=function(){a(null);mxUtils.alert(mxResources.get("fileNotFound"))};e.src=b}else a(null)};
EditorUi.prototype.setBackgroundImage=function(a){this.editor.graph.setBackgroundImage(a);this.editor.graph.view.validateBackgroundImage();this.fireEvent(new mxEventObject("backgroundImageChanged"))};EditorUi.prototype.confirm=function(a,b,e){mxUtils.confirm(a)?null!=b&&b():null!=e&&e()};
EditorUi.prototype.createOutline=function(a){var b=new mxOutline(this.editor.graph);b.border=20;mxEvent.addListener(window,"resize",function(){b.update()});this.addListener("pageFormatChanged",function(){b.update()});return b};EditorUi.prototype.altShiftActions={67:"clearWaypoints",65:"connectionArrows",76:"editLink",80:"connectionPoints",84:"editTooltip",86:"pasteSize",88:"copySize"};
-EditorUi.prototype.createKeyHandler=function(a){function b(a,c,b){q.push(function(){if(!d.isSelectionEmpty()&&d.isEnabled())if(c=null!=c?c:1,b){d.getModel().beginUpdate();try{for(var f=d.getSelectionCells(),e=0;e<f.length;e++)if(d.getModel().isVertex(f[e])&&d.isCellResizable(f[e])){var g=d.getCellGeometry(f[e]);null!=g&&(g=g.clone(),37==a?g.width=Math.max(0,g.width-c):38==a?g.height=Math.max(0,g.height-c):39==a?g.width+=c:40==a&&(g.height+=c),d.getModel().setGeometry(f[e],g))}}finally{d.getModel().endUpdate()}}else f=
-d.getSelectionCell(),e=d.model.getParent(f),g=null,1==d.getSelectionCount()&&d.model.isVertex(f)&&null!=d.layoutManager&&!d.isCellLocked(f)&&(g=d.layoutManager.getLayout(e)),null!=g&&g.constructor==mxStackLayout?(g=e.getIndex(f),37==a||38==a?d.model.add(e,f,Math.max(0,g-1)):39!=a&&40!=a||d.model.add(e,f,Math.min(d.model.getChildCount(e),g+1))):(e=f=0,37==a?f=-c:38==a?e=-c:39==a?f=c:40==a&&(e=c),d.moveCells(d.getMovableCells(d.getSelectionCells()),f,e))});null!=t&&window.clearTimeout(t);t=window.setTimeout(function(){if(0<
-q.length){d.getModel().beginUpdate();try{for(var a=0;a<q.length;a++)q[a]();q=[]}finally{d.getModel().endUpdate()}d.scrollCellToVisible(d.getSelectionCell())}},200)}var e=this,d=this.editor.graph,k=new mxKeyHandler(d),m=k.isEventIgnored;k.isEventIgnored=function(a){return(!this.isControlDown(a)||mxEvent.isShiftDown(a)||90!=a.keyCode&&89!=a.keyCode&&188!=a.keyCode&&190!=a.keyCode&&85!=a.keyCode)&&(66!=a.keyCode&&73!=a.keyCode||!this.isControlDown(a)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&
-!mxClient.IS_SF)&&m.apply(this,arguments)};k.isEnabledForEvent=function(a){return!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()&&(null==e.dialogs||0==e.dialogs.length)};k.isControlDown=function(a){return mxEvent.isControlDown(a)||mxClient.IS_MAC&&a.metaKey};var q=[],t=null,v={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},A=k.getFunction;mxKeyHandler.prototype.getFunction=function(a){if(d.isEnabled()){if(mxEvent.isShiftDown(a)&&
-mxEvent.isAltDown(a)){var c=e.actions.get(e.altShiftActions[a.keyCode]);if(null!=c)return c.funct}if(9==a.keyCode&&mxEvent.isAltDown(a))return mxEvent.isShiftDown(a)?function(){d.selectParentCell()}:function(){d.selectChildCell()};if(null!=v[a.keyCode]&&!d.isSelectionEmpty())if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){if(d.model.isVertex(d.getSelectionCell()))return function(){var c=d.connectVertex(d.getSelectionCell(),v[a.keyCode],d.defaultEdgeLength,a,!0);null!=c&&0<c.length&&(1==c.length&&
-d.model.isEdge(c[0])?d.setSelectionCell(d.model.getTerminal(c[0],!1)):d.setSelectionCell(c[c.length-1]),d.scrollCellToVisible(d.getSelectionCell()),null!=e.hoverIcons&&e.hoverIcons.update(d.view.getState(d.getSelectionCell())))}}else return this.isControlDown(a)?function(){b(a.keyCode,mxEvent.isShiftDown(a)?d.gridSize:null,!0)}:function(){b(a.keyCode,mxEvent.isShiftDown(a)?d.gridSize:null)}}return A.apply(this,arguments)};k.bindAction=mxUtils.bind(this,function(a,c,b,d){var f=this.actions.get(b);
-null!=f&&(b=function(){f.isEnabled()&&f.funct()},c?d?k.bindControlShiftKey(a,b):k.bindControlKey(a,b):d?k.bindShiftKey(a,b):k.bindKey(a,b))});var c=k.escape;k.escape=function(a){c.apply(this,arguments)};k.enter=function(){};k.bindControlShiftKey(36,function(){d.exitGroup()});k.bindControlShiftKey(35,function(){d.enterGroup()});k.bindKey(36,function(){d.home()});k.bindKey(35,function(){d.refresh()});k.bindAction(107,!0,"zoomIn");k.bindAction(109,!0,"zoomOut");k.bindAction(80,!0,"print");k.bindAction(79,
-!0,"outline",!0);k.bindAction(112,!1,"about");if(!this.editor.chromeless||this.editor.editable)k.bindControlKey(36,function(){d.isEnabled()&&d.foldCells(!0)}),k.bindControlKey(35,function(){d.isEnabled()&&d.foldCells(!1)}),k.bindControlKey(13,function(){d.isEnabled()&&d.setSelectionCells(d.duplicateCells(d.getSelectionCells(),!1))}),k.bindAction(8,!1,"delete"),k.bindAction(8,!0,"deleteAll"),k.bindAction(46,!1,"delete"),k.bindAction(46,!0,"deleteAll"),k.bindAction(72,!0,"resetView"),k.bindAction(72,
+EditorUi.prototype.createKeyHandler=function(a){function b(a,d,b){q.push(function(){if(!c.isSelectionEmpty()&&c.isEnabled())if(d=null!=d?d:1,b){c.getModel().beginUpdate();try{for(var f=c.getSelectionCells(),e=0;e<f.length;e++)if(c.getModel().isVertex(f[e])&&c.isCellResizable(f[e])){var g=c.getCellGeometry(f[e]);null!=g&&(g=g.clone(),37==a?g.width=Math.max(0,g.width-d):38==a?g.height=Math.max(0,g.height-d):39==a?g.width+=d:40==a&&(g.height+=d),c.getModel().setGeometry(f[e],g))}}finally{c.getModel().endUpdate()}}else f=
+c.getSelectionCell(),e=c.model.getParent(f),g=null,1==c.getSelectionCount()&&c.model.isVertex(f)&&null!=c.layoutManager&&!c.isCellLocked(f)&&(g=c.layoutManager.getLayout(e)),null!=g&&g.constructor==mxStackLayout?(g=e.getIndex(f),37==a||38==a?c.model.add(e,f,Math.max(0,g-1)):39!=a&&40!=a||c.model.add(e,f,Math.min(c.model.getChildCount(e),g+1))):(e=f=0,37==a?f=-d:38==a?e=-d:39==a?f=d:40==a&&(e=d),c.moveCells(c.getMovableCells(c.getSelectionCells()),f,e))});null!=t&&window.clearTimeout(t);t=window.setTimeout(function(){if(0<
+q.length){c.getModel().beginUpdate();try{for(var a=0;a<q.length;a++)q[a]();q=[]}finally{c.getModel().endUpdate()}c.scrollCellToVisible(c.getSelectionCell())}},200)}var e=this,c=this.editor.graph,k=new mxKeyHandler(c),m=k.isEventIgnored;k.isEventIgnored=function(a){return(!this.isControlDown(a)||mxEvent.isShiftDown(a)||90!=a.keyCode&&89!=a.keyCode&&188!=a.keyCode&&190!=a.keyCode&&85!=a.keyCode)&&(66!=a.keyCode&&73!=a.keyCode||!this.isControlDown(a)||this.graph.cellEditor.isContentEditing()&&!mxClient.IS_FF&&
+!mxClient.IS_SF)&&m.apply(this,arguments)};k.isEnabledForEvent=function(a){return!mxEvent.isConsumed(a)&&this.isGraphEvent(a)&&this.isEnabled()&&(null==e.dialogs||0==e.dialogs.length)};k.isControlDown=function(a){return mxEvent.isControlDown(a)||mxClient.IS_MAC&&a.metaKey};var q=[],t=null,v={37:mxConstants.DIRECTION_WEST,38:mxConstants.DIRECTION_NORTH,39:mxConstants.DIRECTION_EAST,40:mxConstants.DIRECTION_SOUTH},A=k.getFunction;mxKeyHandler.prototype.getFunction=function(a){if(c.isEnabled()){if(mxEvent.isShiftDown(a)&&
+mxEvent.isAltDown(a)){var d=e.actions.get(e.altShiftActions[a.keyCode]);if(null!=d)return d.funct}if(9==a.keyCode&&mxEvent.isAltDown(a))return mxEvent.isShiftDown(a)?function(){c.selectParentCell()}:function(){c.selectChildCell()};if(null!=v[a.keyCode]&&!c.isSelectionEmpty())if(mxEvent.isShiftDown(a)&&mxEvent.isAltDown(a)){if(c.model.isVertex(c.getSelectionCell()))return function(){var d=c.connectVertex(c.getSelectionCell(),v[a.keyCode],c.defaultEdgeLength,a,!0);null!=d&&0<d.length&&(1==d.length&&
+c.model.isEdge(d[0])?c.setSelectionCell(c.model.getTerminal(d[0],!1)):c.setSelectionCell(d[d.length-1]),c.scrollCellToVisible(c.getSelectionCell()),null!=e.hoverIcons&&e.hoverIcons.update(c.view.getState(c.getSelectionCell())))}}else return this.isControlDown(a)?function(){b(a.keyCode,mxEvent.isShiftDown(a)?c.gridSize:null,!0)}:function(){b(a.keyCode,mxEvent.isShiftDown(a)?c.gridSize:null)}}return A.apply(this,arguments)};k.bindAction=mxUtils.bind(this,function(a,d,b,c){var f=this.actions.get(b);
+null!=f&&(b=function(){f.isEnabled()&&f.funct()},d?c?k.bindControlShiftKey(a,b):k.bindControlKey(a,b):c?k.bindShiftKey(a,b):k.bindKey(a,b))});var d=k.escape;k.escape=function(a){d.apply(this,arguments)};k.enter=function(){};k.bindControlShiftKey(36,function(){c.exitGroup()});k.bindControlShiftKey(35,function(){c.enterGroup()});k.bindKey(36,function(){c.home()});k.bindKey(35,function(){c.refresh()});k.bindAction(107,!0,"zoomIn");k.bindAction(109,!0,"zoomOut");k.bindAction(80,!0,"print");k.bindAction(79,
+!0,"outline",!0);k.bindAction(112,!1,"about");if(!this.editor.chromeless||this.editor.editable)k.bindControlKey(36,function(){c.isEnabled()&&c.foldCells(!0)}),k.bindControlKey(35,function(){c.isEnabled()&&c.foldCells(!1)}),k.bindControlKey(13,function(){c.isEnabled()&&c.setSelectionCells(c.duplicateCells(c.getSelectionCells(),!1))}),k.bindAction(8,!1,"delete"),k.bindAction(8,!0,"deleteAll"),k.bindAction(46,!1,"delete"),k.bindAction(46,!0,"deleteAll"),k.bindAction(72,!0,"resetView"),k.bindAction(72,
!0,"fitWindow",!0),k.bindAction(74,!0,"fitPage"),k.bindAction(74,!0,"fitTwoPages",!0),k.bindAction(48,!0,"customZoom"),k.bindAction(82,!0,"turn"),k.bindAction(82,!0,"clearDefaultStyle",!0),k.bindAction(83,!0,"save"),k.bindAction(83,!0,"saveAs",!0),k.bindAction(65,!0,"selectAll"),k.bindAction(65,!0,"selectNone",!0),k.bindAction(73,!0,"selectVertices",!0),k.bindAction(69,!0,"selectEdges",!0),k.bindAction(69,!0,"editStyle"),k.bindAction(66,!0,"bold"),k.bindAction(66,!0,"toBack",!0),k.bindAction(70,!0,
"toFront",!0),k.bindAction(68,!0,"duplicate"),k.bindAction(68,!0,"setAsDefaultStyle",!0),k.bindAction(90,!0,"undo"),k.bindAction(89,!0,"autosize",!0),k.bindAction(88,!0,"cut"),k.bindAction(67,!0,"copy"),k.bindAction(86,!0,"paste"),k.bindAction(71,!0,"group"),k.bindAction(77,!0,"editData"),k.bindAction(71,!0,"grid",!0),k.bindAction(73,!0,"italic"),k.bindAction(76,!0,"lockUnlock"),k.bindAction(76,!0,"layers",!0),k.bindAction(80,!0,"formatPanel",!0),k.bindAction(85,!0,"underline"),k.bindAction(85,!0,
-"ungroup",!0),k.bindAction(190,!0,"superscript"),k.bindAction(188,!0,"subscript"),k.bindKey(13,function(){d.isEnabled()&&d.startEditingAtCell()}),k.bindKey(113,function(){d.isEnabled()&&d.startEditingAtCell()});mxClient.IS_WIN?k.bindAction(89,!0,"redo"):k.bindAction(90,!0,"redo",!0);return k};
+"ungroup",!0),k.bindAction(190,!0,"superscript"),k.bindAction(188,!0,"subscript"),k.bindKey(13,function(){c.isEnabled()&&c.startEditingAtCell()}),k.bindKey(113,function(){c.isEnabled()&&c.startEditingAtCell()});mxClient.IS_WIN?k.bindAction(89,!0,"redo"):k.bindAction(90,!0,"redo",!0);return k};
EditorUi.prototype.destroy=function(){null!=this.editor&&(this.editor.destroy(),this.editor=null);null!=this.menubar&&(this.menubar.destroy(),this.menubar=null);null!=this.toolbar&&(this.toolbar.destroy(),this.toolbar=null);null!=this.sidebar&&(this.sidebar.destroy(),this.sidebar=null);null!=this.keyHandler&&(this.keyHandler.destroy(),this.keyHandler=null);null!=this.keydownHandler&&(mxEvent.removeListener(document,"keydown",this.keydownHandler),this.keydownHandler=null);null!=this.keyupHandler&&
(mxEvent.removeListener(document,"keyup",this.keyupHandler),this.keyupHandler=null);null!=this.resizeHandler&&(mxEvent.removeListener(window,"resize",this.resizeHandler),this.resizeHandler=null);null!=this.gestureHandler&&(mxEvent.removeGestureListeners(document,this.gestureHandler),this.gestureHandler=null);null!=this.orientationChangeHandler&&(mxEvent.removeListener(window,"orientationchange",this.orientationChangeHandler),this.orientationChangeHandler=null);null!=this.scrollHandler&&(mxEvent.removeListener(window,
"scroll",this.scrollHandler),this.scrollHandler=null);if(null!=this.destroyFunctions){for(var a=0;a<this.destroyFunctions.length;a++)this.destroyFunctions[a]();this.destroyFunctions=null}for(var b=[this.menubarContainer,this.toolbarContainer,this.sidebarContainer,this.formatContainer,this.diagramContainer,this.footerContainer,this.chromelessToolbar,this.hsplit,this.sidebarFooterContainer,this.layersDialog],a=0;a<b.length;a++)null!=b[a]&&null!=b[a].parentNode&&b[a].parentNode.removeChild(b[a])};"undefined"!==typeof html4&&(html4.ATTRIBS["a::target"]=0,html4.ATTRIBS["source::src"]=0,html4.ATTRIBS["video::src"]=0);Date.prototype.toISOString||function(){function a(a){a=String(a);1===a.length&&(a="0"+a);return a}Date.prototype.toISOString=function(){return this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"."+String((this.getUTCMilliseconds()/1E3).toFixed(3)).slice(2,5)+"Z"}}();
mxConstants.SHADOW_OPACITY=.25;mxConstants.SHADOWCOLOR="#000000";mxConstants.VML_SHADOWCOLOR="#d0d0d0";mxGraph.prototype.pageBreakColor="#c0c0c0";mxGraph.prototype.pageScale=1;(function(){try{if(null!=navigator&&null!=navigator.language){var a=navigator.language.toLowerCase();mxGraph.prototype.pageFormat="en-us"===a||"en-ca"===a||"es-mx"===a?mxConstants.PAGE_FORMAT_LETTER_PORTRAIT:mxConstants.PAGE_FORMAT_A4_PORTRAIT}}catch(b){}})();mxText.prototype.baseSpacingTop=5;
mxText.prototype.baseSpacingBottom=1;mxGraphModel.prototype.ignoreRelativeEdgeParent=!1;mxGraphView.prototype.gridImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhCgAKAJEAAAAAAP///8zMzP///yH5BAEAAAMALAAAAAAKAAoAAAIJ1I6py+0Po2wFADs=":IMAGE_PATH+"/grid.gif";mxGraphView.prototype.gridSteps=4;mxGraphView.prototype.minGridSize=4;mxGraphView.prototype.gridColor="#e0e0e0";mxSvgCanvas2D.prototype.foAltText="[Not supported by viewer]";mxShape.prototype.getConstraints=function(a,b,e){return null};
-Graph=function(a,b,e,d,k){mxGraph.call(this,a,b,e,d);this.themes=k||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);a=this.baseUrl;b=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0<b&&(b=a.indexOf("/",b+2),0<b&&(this.domainUrl=a.substring(0,b)),b=a.lastIndexOf("/"),0<b&&(this.domainPathUrl=a.substring(0,b+1)));this.isHtmlLabel=function(a){var c=this.view.getState(a);a=null!=c?c.style:this.getCellStyle(a);
-return null!=a?"1"==a.html||"wrap"==a[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.edgeMode){var m=null,q=null,t=null,v=null,A=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,c){if("mouseDown"==c.getProperty("eventName")&&this.isEnabled()){var b=c.getProperty("event");if(!mxEvent.isControlDown(b.getEvent())&&!mxEvent.isShiftDown(b.getEvent())){var f=b.getState();null!=f&&this.model.isEdge(f.cell)&&(m=new mxPoint(b.getGraphX(),b.getGraphY()),A=this.isCellSelected(f.cell),t=
-f,q=b,null!=f.text&&null!=f.text.boundingBox&&mxUtils.contains(f.text.boundingBox,b.getGraphX(),b.getGraphY())?v=mxEvent.LABEL_HANDLE:(f=this.selectionCellsHandler.getHandler(f.cell),null!=f&&null!=f.bends&&0<f.bends.length&&(v=f.getHandleForEvent(b))))}}}));this.addMouseListener({mouseDown:function(a,c){},mouseMove:mxUtils.bind(this,function(a,c){var b=this.selectionCellsHandler.handlers.map,f;for(f in b)if(null!=b[f].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isControlDown(c.getEvent())&&
-!mxEvent.isShiftDown(c.getEvent())&&!mxEvent.isAltDown(c.getEvent()))if(f=this.tolerance,null!=m&&null!=t&&null!=q){if(b=t,Math.abs(m.x-c.getGraphX())>f||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&&0<d.bends.length){var e=d.getHandleForEvent(q),g=this.view.getEdgeStyle(b);f=g==mxEdgeStyle.EntityRelation;A||v!=mxEvent.LABEL_HANDLE||(e=v);if(f&&0!=e&&e!=d.bends.length-1&&e!=mxEvent.LABEL_HANDLE)!f||
-null==b.visibleSourceState&&null==b.visibleTargetState||(this.graphHandler.reset(),c.consume());else if(e==mxEvent.LABEL_HANDLE||0==e||null!=b.visibleSourceState||e==d.bends.length-1||null!=b.visibleTargetState)f||e==mxEvent.LABEL_HANDLE||(f=b.absolutePoints,null!=f&&(null==g&&null==e||g==mxEdgeStyle.OrthConnector)&&(e=v,null==e&&(e=new mxRectangle(m.x,m.y),e.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(e,f[0].x,f[0].y)?e=0:mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y)?
-e=d.bends.length-1:null!=g&&(2==f.length||3==f.length&&(0==Math.round(f[0].x-f[1].x)&&0==Math.round(f[1].x-f[2].x)||0==Math.round(f[0].y-f[1].y)&&0==Math.round(f[1].y-f[2].y)))?e=2:(e=mxUtils.findNearestSegment(b,m.x,m.y),e=null==g?mxEvent.VIRTUAL_HANDLE-e:e+1))),null==e&&(e=mxEvent.VIRTUAL_HANDLE)),d.start(c.getGraphX(),c.getGraphX(),e),v=m=q=t=null,A=!1,c.consume(),this.graphHandler.reset()}}}else if(b=c.getState(),null!=b&&this.model.isEdge(b.cell)){d=null;f=b.absolutePoints;if(null!=f)if(e=new mxRectangle(c.getGraphX(),
-c.getGraphY()),e.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=b.text&&null!=b.text.boundingBox&&mxUtils.contains(b.text.boundingBox,c.getGraphX(),c.getGraphY()))d="move";else if(mxUtils.contains(e,f[0].x,f[0].y)||mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y))d="pointer";else if(null!=b.visibleSourceState||null!=b.visibleTargetState)g=this.view.getEdgeStyle(b),d="crosshair",g!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(b)&&(g=mxUtils.findNearestSegment(b,c.getGraphX(),c.getGraphY()),
-g<f.length-1&&0<=g&&(d=0==Math.round(f[g].x-f[g+1].x)?"col-resize":"row-resize"));null!=d&&b.setCursor(d)}}),mouseUp:mxUtils.bind(this,function(a,c){v=m=q=t=null})})}this.cellRenderer.getLabelValue=function(a){var c=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);a.view.graph.isHtmlLabel(a.cell)&&(c=1!=a.style.html?mxUtils.htmlEntities(c,!1):a.view.graph.sanitizeHtml(c));return c};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);
-this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(a,c){return!1};this.alternateEdgeStyle="vertical";null==d&&this.loadStylesheet();var c=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=
-function(){var a=c.apply(this,arguments);if(this.graph.pageVisible){for(var b=[],f=this.graph.pageFormat,d=this.graph.pageScale,e=f.width*d,f=f.height*d,d=this.graph.view.translate,g=this.graph.view.scale,l=this.graph.getPageLayout(),r=0;r<l.width;r++)b.push(new mxRectangle(((l.x+r)*e+d.x)*g,(l.y*f+d.y)*g,e*g,f*g));for(r=0;r<l.height;r++)b.push(new mxRectangle((l.x*e+d.x)*g,((l.y+r)*f+d.y)*g,e*g,f*g));a=b.concat(a)}return a};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=
-function(a,c){return null==a.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(a){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};this.graphHandler.getCells=function(a){for(var c=mxGraphHandler.prototype.getCells.apply(this,arguments),b=[],f=0;f<c.length;f++){var d=this.graph.view.getState(c[f]),d=null!=d?d.style:this.graph.getCellStyle(c[f]);
-"1"==mxUtils.getValue(d,"part","0")?(d=this.graph.model.getParent(c[f]),this.graph.model.isVertex(d)&&0>mxUtils.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);
+Graph=function(a,b,e,c,k){mxGraph.call(this,a,b,e,c);this.themes=k||this.defaultThemes;this.currentEdgeStyle=mxUtils.clone(this.defaultEdgeStyle);this.currentVertexStyle=mxUtils.clone(this.defaultVertexStyle);a=this.baseUrl;b=a.indexOf("//");this.domainPathUrl=this.domainUrl="";0<b&&(b=a.indexOf("/",b+2),0<b&&(this.domainUrl=a.substring(0,b)),b=a.lastIndexOf("/"),0<b&&(this.domainPathUrl=a.substring(0,b+1)));this.isHtmlLabel=function(a){var d=this.view.getState(a);a=null!=d?d.style:this.getCellStyle(a);
+return null!=a?"1"==a.html||"wrap"==a[mxConstants.STYLE_WHITE_SPACE]:!1};if(this.edgeMode){var m=null,q=null,t=null,v=null,A=!1;this.addListener(mxEvent.FIRE_MOUSE_EVENT,mxUtils.bind(this,function(a,d){if("mouseDown"==d.getProperty("eventName")&&this.isEnabled()){var b=d.getProperty("event");if(!mxEvent.isControlDown(b.getEvent())&&!mxEvent.isShiftDown(b.getEvent())){var f=b.getState();null!=f&&this.model.isEdge(f.cell)&&(m=new mxPoint(b.getGraphX(),b.getGraphY()),A=this.isCellSelected(f.cell),t=
+f,q=b,null!=f.text&&null!=f.text.boundingBox&&mxUtils.contains(f.text.boundingBox,b.getGraphX(),b.getGraphY())?v=mxEvent.LABEL_HANDLE:(f=this.selectionCellsHandler.getHandler(f.cell),null!=f&&null!=f.bends&&0<f.bends.length&&(v=f.getHandleForEvent(b))))}}}));this.addMouseListener({mouseDown:function(a,d){},mouseMove:mxUtils.bind(this,function(a,d){var b=this.selectionCellsHandler.handlers.map,f;for(f in b)if(null!=b[f].index)return;if(this.isEnabled()&&!this.panningHandler.isActive()&&!mxEvent.isControlDown(d.getEvent())&&
+!mxEvent.isShiftDown(d.getEvent())&&!mxEvent.isAltDown(d.getEvent()))if(f=this.tolerance,null!=m&&null!=t&&null!=q){if(b=t,Math.abs(m.x-d.getGraphX())>f||Math.abs(m.y-d.getGraphY())>f){this.isCellSelected(b.cell)||this.setSelectionCell(b.cell);var c=this.selectionCellsHandler.getHandler(b.cell);if(null!=c&&null!=c.bends&&0<c.bends.length){var e=c.getHandleForEvent(q),g=this.view.getEdgeStyle(b);f=g==mxEdgeStyle.EntityRelation;A||v!=mxEvent.LABEL_HANDLE||(e=v);if(f&&0!=e&&e!=c.bends.length-1&&e!=mxEvent.LABEL_HANDLE)!f||
+null==b.visibleSourceState&&null==b.visibleTargetState||(this.graphHandler.reset(),d.consume());else if(e==mxEvent.LABEL_HANDLE||0==e||null!=b.visibleSourceState||e==c.bends.length-1||null!=b.visibleTargetState)f||e==mxEvent.LABEL_HANDLE||(f=b.absolutePoints,null!=f&&(null==g&&null==e||g==mxEdgeStyle.OrthConnector)&&(e=v,null==e&&(e=new mxRectangle(m.x,m.y),e.grow(mxEdgeHandler.prototype.handleImage.width/2),mxUtils.contains(e,f[0].x,f[0].y)?e=0:mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y)?
+e=c.bends.length-1:null!=g&&(2==f.length||3==f.length&&(0==Math.round(f[0].x-f[1].x)&&0==Math.round(f[1].x-f[2].x)||0==Math.round(f[0].y-f[1].y)&&0==Math.round(f[1].y-f[2].y)))?e=2:(e=mxUtils.findNearestSegment(b,m.x,m.y),e=null==g?mxEvent.VIRTUAL_HANDLE-e:e+1))),null==e&&(e=mxEvent.VIRTUAL_HANDLE)),c.start(d.getGraphX(),d.getGraphX(),e),v=m=q=t=null,A=!1,d.consume(),this.graphHandler.reset()}}}else if(b=d.getState(),null!=b&&this.model.isEdge(b.cell)){c=null;f=b.absolutePoints;if(null!=f)if(e=new mxRectangle(d.getGraphX(),
+d.getGraphY()),e.grow(mxEdgeHandler.prototype.handleImage.width/2),null!=b.text&&null!=b.text.boundingBox&&mxUtils.contains(b.text.boundingBox,d.getGraphX(),d.getGraphY()))c="move";else if(mxUtils.contains(e,f[0].x,f[0].y)||mxUtils.contains(e,f[f.length-1].x,f[f.length-1].y))c="pointer";else if(null!=b.visibleSourceState||null!=b.visibleTargetState)g=this.view.getEdgeStyle(b),c="crosshair",g!=mxEdgeStyle.EntityRelation&&this.isOrthogonal(b)&&(g=mxUtils.findNearestSegment(b,d.getGraphX(),d.getGraphY()),
+g<f.length-1&&0<=g&&(c=0==Math.round(f[g].x-f[g+1].x)?"col-resize":"row-resize"));null!=c&&b.setCursor(c)}}),mouseUp:mxUtils.bind(this,function(a,d){v=m=q=t=null})})}this.cellRenderer.getLabelValue=function(a){var d=mxCellRenderer.prototype.getLabelValue.apply(this,arguments);a.view.graph.isHtmlLabel(a.cell)&&(d=1!=a.style.html?mxUtils.htmlEntities(d,!1):a.view.graph.sanitizeHtml(d));return d};if("undefined"!==typeof mxVertexHandler){this.setConnectable(!0);this.setDropEnabled(!0);this.setPanning(!0);
+this.setTooltips(!0);this.setAllowLoops(!0);this.allowAutoPanning=!0;this.constrainChildren=this.resetEdgesOnConnect=!1;this.constrainRelativeChildren=!0;this.graphHandler.scrollOnMove=!1;this.graphHandler.scaleGrid=!0;this.connectionHandler.setCreateTarget(!1);this.connectionHandler.insertBeforeSource=!0;this.connectionHandler.isValidSource=function(a,d){return!1};this.alternateEdgeStyle="vertical";null==c&&this.loadStylesheet();var d=this.graphHandler.getGuideStates;this.graphHandler.getGuideStates=
+function(){var a=d.apply(this,arguments);if(this.graph.pageVisible){for(var b=[],f=this.graph.pageFormat,c=this.graph.pageScale,e=f.width*c,f=f.height*c,c=this.graph.view.translate,g=this.graph.view.scale,l=this.graph.getPageLayout(),r=0;r<l.width;r++)b.push(new mxRectangle(((l.x+r)*e+c.x)*g,(l.y*f+c.y)*g,e*g,f*g));for(r=0;r<l.height;r++)b.push(new mxRectangle((l.x*e+c.x)*g,((l.y+r)*f+c.y)*g,e*g,f*g));a=b.concat(a)}return a};mxDragSource.prototype.dragElementZIndex=mxPopupMenu.prototype.zIndex;mxGuide.prototype.getGuideColor=
+function(a,d){return null==a.cell?"#ffa500":mxConstants.GUIDE_COLOR};this.graphHandler.createPreviewShape=function(a){this.previewColor="#000000"==this.graph.background?"#ffffff":mxGraphHandler.prototype.previewColor;return mxGraphHandler.prototype.createPreviewShape.apply(this,arguments)};this.graphHandler.getCells=function(a){for(var d=mxGraphHandler.prototype.getCells.apply(this,arguments),b=[],f=0;f<d.length;f++){var c=this.graph.view.getState(d[f]),c=null!=c?c.style:this.graph.getCellStyle(d[f]);
+"1"==mxUtils.getValue(c,"part","0")?(c=this.graph.model.getParent(d[f]),this.graph.model.isVertex(c)&&0>mxUtils.indexOf(d,c)&&b.push(c)):b.push(d[f])}return b};this.connectionHandler.createTargetVertex=function(a,d){var b=this.graph.view.getState(d),b=null!=b?b.style:this.graph.getCellStyle(d);mxUtils.getValue(b,"part",!1)&&(b=this.graph.model.getParent(d),this.graph.model.isVertex(b)&&(d=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<n||(null==this.currentState||"0"!=mxUtils.getValue(this.currentState.style,
"outlineConnect","1"))&&p.apply(this,arguments)};var y=this.isToggleEvent;this.isToggleEvent=function(a){return y.apply(this,arguments)||mxEvent.isShiftDown(a)};var x=f.isForceRubberbandEvent;f.isForceRubberbandEvent=function(a){return x.apply(this,arguments)||mxUtils.hasScrollbars(this.graph.container)&&mxClient.IS_FF&&mxClient.IS_WIN&&null==a.getState()&&mxEvent.isTouchEvent(a.getEvent())};var u=null;this.panningHandler.addListener(mxEvent.PAN_START,mxUtils.bind(this,function(){this.isEnabled()&&
-(u=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=u)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var G=this.click;this.click=function(a){var c=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);if(this.isEnabled()&&!c||a.isConsumed())return G.apply(this,
-arguments);c=c?a.sourceState.cell:a.getCell();null!=c&&(c=this.getLinkForCell(c),null!=c&&(this.isCustomLink(c)?this.customLinkClicked(c):this.openLink(c)))};this.tooltipHandler.getStateForEvent=function(a){return a.sourceState};this.getCursorForMouseEvent=function(a){var c=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);return this.getCursorForCell(c?a.sourceState.cell:a.getCell())};var z=this.getCursorForCell;this.getCursorForCell=function(a){if(!this.isEnabled()||this.isCellLocked(a)){if(null!=
-this.getLinkForCell(a))return"pointer";if(this.isCellLocked(a))return"default"}return z.apply(this,arguments)};this.selectRegion=function(a,c){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,c);return b};this.getAllCells=function(a,c,b,f,d,e){e=null!=e?e:[];if(0<b||0<f){var g=this.getModel(),l=a+b,r=c+f;null==d&&(d=this.getCurrentRoot(),null==d&&(d=g.getRoot()));if(null!=d)for(var n=g.getChildCount(d),p=0;p<n;p++){var u=g.getChildAt(d,p),k=this.view.getState(u);if(null!=
-k&&this.isCellVisible(u)&&"1"!=mxUtils.getValue(k.style,"locked","0")){var y=mxUtils.getValue(k.style,mxConstants.STYLE_ROTATION)||0;0!=y&&(k=mxUtils.getBoundingBox(k,y));(g.isEdge(u)||g.isVertex(u))&&k.x>=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 E=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,c,b){return this.graph.isCellSelected(a)?!1:E.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<this.getSelectionCount()&&this.isCellSelected(d)&&this.removeSelectionCell(d);r=null;c.consume()}}));this.connectionHandler.selectCells=function(a,c){this.graph.setSelectionCell(c||a)};this.connectionHandler.constraintHandler.isStateIgnored=function(a,c){return c&&a.view.graph.isCellSelected(a.cell)};this.selectionModel.addListener(mxEvent.CHANGE,
+(u=this.container.style.cursor,this.container.style.cursor="move")}));this.panningHandler.addListener(mxEvent.PAN_END,mxUtils.bind(this,function(){this.isEnabled()&&(this.container.style.cursor=u)}));this.popupMenuHandler.autoExpand=!0;this.popupMenuHandler.isSelectOnPopup=function(a){return mxEvent.isMouseEvent(a.getEvent())};var G=this.click;this.click=function(a){var d=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);if(this.isEnabled()&&!d||a.isConsumed())return G.apply(this,
+arguments);d=d?a.sourceState.cell:a.getCell();null!=d&&(d=this.getLinkForCell(d),null!=d&&(this.isCustomLink(d)?this.customLinkClicked(d):this.openLink(d)))};this.tooltipHandler.getStateForEvent=function(a){return a.sourceState};this.getCursorForMouseEvent=function(a){var d=null==a.state&&null!=a.sourceState&&this.isCellLocked(a.sourceState.cell);return this.getCursorForCell(d?a.sourceState.cell:a.getCell())};var z=this.getCursorForCell;this.getCursorForCell=function(a){if(!this.isEnabled()||this.isCellLocked(a)){if(null!=
+this.getLinkForCell(a))return"pointer";if(this.isCellLocked(a))return"default"}return z.apply(this,arguments)};this.selectRegion=function(a,d){var b=this.getAllCells(a.x,a.y,a.width,a.height);this.selectCellsForEvent(b,d);return b};this.getAllCells=function(a,d,b,f,c,e){e=null!=e?e:[];if(0<b||0<f){var g=this.getModel(),l=a+b,r=d+f;null==c&&(c=this.getCurrentRoot(),null==c&&(c=g.getRoot()));if(null!=c)for(var n=g.getChildCount(c),p=0;p<n;p++){var u=g.getChildAt(c,p),k=this.view.getState(u);if(null!=
+k&&this.isCellVisible(u)&&"1"!=mxUtils.getValue(k.style,"locked","0")){var y=mxUtils.getValue(k.style,mxConstants.STYLE_ROTATION)||0;0!=y&&(k=mxUtils.getBoundingBox(k,y));(g.isEdge(u)||g.isVertex(u))&&k.x>=a&&k.y+k.height<=r&&k.y>=d&&k.x+k.width<=l&&e.push(u);this.getAllCells(a,d,b,f,u,e)}}}return e};var E=this.graphHandler.shouldRemoveCellsFromParent;this.graphHandler.shouldRemoveCellsFromParent=function(a,d,b){return this.graph.isCellSelected(a)?!1:E.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,d){if("mouseDown"==d.getProperty("eventName")){var b=d.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,d){if(!mxEvent.isMultiTouchEvent(d)){var b=
+d.getProperty("event"),c=d.getProperty("cell");null==c?(b=mxUtils.convertPoint(this.container,mxEvent.getClientX(b),mxEvent.getClientY(b)),f.start(b.x,b.y)):null!=r?this.addSelectionCells(r):1<this.getSelectionCount()&&this.isCellSelected(c)&&this.removeSelectionCell(c);r=null;d.consume()}}));this.connectionHandler.selectCells=function(a,d){this.graph.setSelectionCell(d||a)};this.connectionHandler.constraintHandler.isStateIgnored=function(a,d){return d&&a.view.graph.isCellSelected(a.cell)};this.selectionModel.addListener(mxEvent.CHANGE,
mxUtils.bind(this,function(){var a=this.connectionHandler.constraintHandler;null!=a.currentFocus&&a.isStateIgnored(a.currentFocus,!0)&&(a.currentFocus=null,a.constraints=null,a.destroyIcons());a.destroyFocusHighlight()}));Graph.touchStyle&&this.initTouch();var C=this.updateMouseEvent;this.updateMouseEvent=function(a){a=C.apply(this,arguments);null!=a.state&&this.isCellLocked(a.getCell())&&(a.state=null);return a}}this.currentTranslate=new mxPoint(0,0)};
Graph.touchStyle=mxClient.IS_TOUCH||mxClient.IS_FF&&mxClient.IS_WIN||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints||null==window.urlParams||"1"==urlParams.touch;Graph.fileSupport=null!=window.File&&null!=window.FileReader&&null!=window.FileList&&(null==window.urlParams||"0"!=urlParams.filesupport);Graph.lineJumpsEnabled=!0;Graph.defaultJumpSize=6;
Graph.createSvgImage=function(a,b,e){e=unescape(encodeURIComponent('<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+a+'px" height="'+b+'px" version="1.1">'+e+"</svg>"));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;e<a.length;e++){var d=a.charCodeAt(e);(32<=d||9==d||10==d||13==d)&&65535!=d&&b.push(a.charAt(e))}return b.join("")};Graph.stringToBytes=function(a){for(var b=Array(a.length),e=0;e<a.length;e++)b[e]=a.charCodeAt(e);return b};Graph.bytesToString=function(a){for(var b=Array(a.length),e=0;e<a.length;e++)b[e]=String.fromCharCode(a[e]);return b.join("")};Graph.compressNode=function(a){return Graph.compress(Graph.zapGremlins(mxUtils.getXml(a)))};
+Graph.zapGremlins=function(a){for(var b=[],e=0;e<a.length;e++){var c=a.charCodeAt(e);(32<=c||9==c||10==c||13==c)&&65535!=c&&b.push(a.charAt(e))}return b.join("")};Graph.stringToBytes=function(a){for(var b=Array(a.length),e=0;e<a.length;e++)b[e]=a.charCodeAt(e);return b};Graph.bytesToString=function(a){for(var b=Array(a.length),e=0;e<a.length;e++)b[e]=String.fromCharCode(a[e]);return b.join("")};Graph.compressNode=function(a){return Graph.compress(Graph.zapGremlins(mxUtils.getXml(a)))};
Graph.compress=function(a,b){if(null==a||0==a.length||"undefined"===typeof pako)return a;var e=Graph.bytesToString(b?pako.deflate(encodeURIComponent(a)):pako.deflateRaw(encodeURIComponent(a)));return window.btoa?btoa(e):Base64.encode(e,!0)};Graph.decompress=function(a,b){if(null==a||0==a.length||"undefined"===typeof pako)return a;var e=window.atob?atob(a):Base64.decode(a,!0);return Graph.zapGremlins(decodeURIComponent(Graph.bytesToString(b?pako.inflate(e):pako.inflateRaw(e))))};
mxUtils.extend(Graph,mxGraph);Graph.prototype.minFitScale=null;Graph.prototype.maxFitScale=null;Graph.prototype.linkPolicy="frame"==urlParams.target?"blank":urlParams.target||"auto";Graph.prototype.linkTarget="frame"==urlParams.target?"_self":"_blank";Graph.prototype.linkRelation="nofollow noopener noreferrer";Graph.prototype.defaultScrollbars=!mxClient.IS_IOS;Graph.prototype.defaultPageVisible=!0;Graph.prototype.lightbox=!1;Graph.prototype.defaultPageBackgroundColor="#ffffff";
Graph.prototype.defaultPageBorderColor="#ffffff";Graph.prototype.scrollTileSize=new mxRectangle(0,0,400,400);Graph.prototype.transparentBackground=!0;Graph.prototype.defaultEdgeLength=80;Graph.prototype.edgeMode=!1;Graph.prototype.connectionArrowsEnabled=!0;Graph.prototype.placeholderPattern=RegExp("%(date{.*}|[^%^{^}]+)%","g");Graph.prototype.absoluteUrlPattern=/^(?:[a-z]+:)?\/\//i;Graph.prototype.defaultThemeName="default";Graph.prototype.defaultThemes={};
Graph.prototype.baseUrl=null!=urlParams.base?decodeURIComponent(urlParams.base):(window!=window.top?document.referrer:document.location.toString()).split("#")[0];Graph.prototype.editAfterInsert=!1;Graph.prototype.builtInProperties=["label","tooltip","placeholders","placeholder"];
-Graph.prototype.init=function(a){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(a,e){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var b=a.view.graph.tolerance,k=!0,m=null,q=mxUtils.bind(this,function(a){k=!0;m=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a))}),t=mxUtils.bind(this,function(a){k=k&&null!=m&&Math.abs(m.x-mxEvent.getClientX(a))<b&&Math.abs(m.y-mxEvent.getClientY(a))<b}),v=mxUtils.bind(this,function(b){if(k)for(var c=mxEvent.getSource(b);null!=
-c&&c!=e.node;){if("a"==c.nodeName.toLowerCase()){a.view.graph.labelLinkClicked(a,c,b);break}c=c.parentNode}});mxEvent.addGestureListeners(e.node,q,t,v);mxEvent.addListener(e.node,"click",function(a){mxEvent.consume(a)})};this.initLayoutManager()};
+Graph.prototype.init=function(a){mxGraph.prototype.init.apply(this,arguments);this.cellRenderer.initializeLabel=function(a,e){mxCellRenderer.prototype.initializeLabel.apply(this,arguments);var b=a.view.graph.tolerance,k=!0,m=null,q=mxUtils.bind(this,function(a){k=!0;m=new mxPoint(mxEvent.getClientX(a),mxEvent.getClientY(a))}),t=mxUtils.bind(this,function(a){k=k&&null!=m&&Math.abs(m.x-mxEvent.getClientX(a))<b&&Math.abs(m.y-mxEvent.getClientY(a))<b}),v=mxUtils.bind(this,function(b){if(k)for(var d=mxEvent.getSource(b);null!=
+d&&d!=e.node;){if("a"==d.nodeName.toLowerCase()){a.view.graph.labelLinkClicked(a,d,b);break}d=d.parentNode}});mxEvent.addGestureListeners(e.node,q,t,v);mxEvent.addListener(e.node,"click",function(a){mxEvent.consume(a)})};this.initLayoutManager()};
(function(){Graph.prototype.useCssTransforms=!1;Graph.prototype.currentScale=1;Graph.prototype.currentTranslate=new mxPoint(0,0);Graph.prototype.isCssTransformsSupported=function(){return this.dialect==mxConstants.DIALECT_SVG&&!mxClient.NO_FO};Graph.prototype.getCellAt=function(a,b,e,q,t,v){this.useCssTransforms&&(a=a/this.currentScale-this.currentTranslate.x,b=b/this.currentScale-this.currentTranslate.y);return this.getScaledCellAt.apply(this,arguments)};Graph.prototype.getScaledCellAt=function(a,
-b,e,q,t,v){q=null!=q?q:!0;t=null!=t?t:!0;null==e&&(e=this.getCurrentRoot(),null==e&&(e=this.getModel().getRoot()));if(null!=e)for(var d=this.model.getChildCount(e)-1;0<=d;d--){var c=this.model.getChildAt(e,d),f=this.getScaledCellAt(a,b,c,q,t,v);if(null!=f)return f;if(this.isCellVisible(c)&&(t&&this.model.isEdge(c)||q&&this.model.isVertex(c))&&(f=this.view.getState(c),null!=f&&(null==v||!v(f,a,b))&&this.intersects(f,a,b)))return c}return null};mxCellHighlight.prototype.getStrokeWidth=function(a){a=
+b,e,q,t,v){q=null!=q?q:!0;t=null!=t?t:!0;null==e&&(e=this.getCurrentRoot(),null==e&&(e=this.getModel().getRoot()));if(null!=e)for(var c=this.model.getChildCount(e)-1;0<=c;c--){var d=this.model.getChildAt(e,c),f=this.getScaledCellAt(a,b,d,q,t,v);if(null!=f)return f;if(this.isCellVisible(d)&&(t&&this.model.isEdge(d)||q&&this.model.isVertex(d))&&(f=this.view.getState(d),null!=f&&(null==v||!v(f,a,b))&&this.intersects(f,a,b)))return d}return null};mxCellHighlight.prototype.getStrokeWidth=function(a){a=
this.strokeWidth;this.graph.useCssTransforms&&(a/=this.graph.currentScale);return a};mxGraphView.prototype.getGraphBounds=function(){var a=this.graphBounds;if(this.graph.useCssTransforms)var b=this.graph.currentTranslate,e=this.graph.currentScale,a=new mxRectangle((a.x+b.x)*e,(a.y+b.y)*e,a.width*e,a.height*e);return a};mxGraphView.prototype.viewStateChanged=function(){this.graph.useCssTransforms?this.validate():this.revalidate();this.graph.sizeDidChange()};var a=mxGraphView.prototype.validate;mxGraphView.prototype.validate=
function(b){this.graph.useCssTransforms&&(this.graph.currentScale=this.scale,this.graph.currentTranslate.x=this.translate.x,this.graph.currentTranslate.y=this.translate.y,this.scale=1,this.translate.x=0,this.translate.y=0);a.apply(this,arguments);this.graph.useCssTransforms&&(this.graph.updateCssTransform(),this.scale=this.graph.currentScale,this.translate.x=this.graph.currentTranslate.x,this.translate.y=this.graph.currentTranslate.y)};Graph.prototype.updateCssTransform=function(){var a=this.view.getDrawPane();
if(null!=a)if(a=a.parentNode,this.useCssTransforms){var b=a.getAttribute("transform");a.setAttribute("transformOrigin","0 0");a.setAttribute("transform","scale("+this.currentScale+","+this.currentScale+")translate("+this.currentTranslate.x+","+this.currentTranslate.y+")");if(b!=a.getAttribute("transform"))try{if(mxClient.IS_EDGE){var e=a.style.display;a.style.display="none";a.getBBox();a.style.display=e}}catch(q){}}else a.removeAttribute("transformOrigin"),a.removeAttribute("transform")};var b=mxGraphView.prototype.validateBackgroundPage;
-mxGraphView.prototype.validateBackgroundPage=function(){var a=this.graph.useCssTransforms,e=this.scale,m=this.translate;a&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);b.apply(this,arguments);a&&(this.scale=e,this.translate=m)};var e=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(a,b,m){var d=this.useCssTransforms,k=this.view.scale,v=this.view.translate;d&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=
-!1);e.apply(this,arguments);d&&(this.view.scale=k,this.view.translate=v,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.labelLinkClicked=function(a,b,e){b=b.getAttribute("href");if(null!=b&&!this.isCustomLink(b)&&mxEvent.isLeftMouseButton(e)&&!mxEvent.isPopupTrigger(e)||mxEvent.isTouchEvent(e)){if(!this.isEnabled()||this.isCellLocked(a.cell))a=this.isBlankLink(b)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(b),a);mxEvent.consume(e)}};
-Graph.prototype.openLink=function(a,b,e){var d=window;try{if("_self"==b&&window!=window.top)window.location.href=a;else if(a.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==a.charAt(this.baseUrl.length)&&"_top"==b&&window==window.top){var k=a.split("#")[1];window.location.hash=="#"+k&&(window.location.hash="");window.location.hash=k}else d=window.open(a,b),null==d||e||(d.opener=null)}catch(m){}return d};Graph.prototype.getLinkTitle=function(a){return a.substring(a.lastIndexOf("/")+1)};
+mxGraphView.prototype.validateBackgroundPage=function(){var a=this.graph.useCssTransforms,e=this.scale,m=this.translate;a&&(this.scale=this.graph.currentScale,this.translate=this.graph.currentTranslate);b.apply(this,arguments);a&&(this.scale=e,this.translate=m)};var e=mxGraph.prototype.updatePageBreaks;mxGraph.prototype.updatePageBreaks=function(a,b,m){var c=this.useCssTransforms,k=this.view.scale,v=this.view.translate;c&&(this.view.scale=1,this.view.translate=new mxPoint(0,0),this.useCssTransforms=
+!1);e.apply(this,arguments);c&&(this.view.scale=k,this.view.translate=v,this.useCssTransforms=!0)}})();Graph.prototype.isLightboxView=function(){return this.lightbox};Graph.prototype.labelLinkClicked=function(a,b,e){b=b.getAttribute("href");if(null!=b&&!this.isCustomLink(b)&&mxEvent.isLeftMouseButton(e)&&!mxEvent.isPopupTrigger(e)||mxEvent.isTouchEvent(e)){if(!this.isEnabled()||this.isCellLocked(a.cell))a=this.isBlankLink(b)?this.linkTarget:"_top",this.openLink(this.getAbsoluteUrl(b),a);mxEvent.consume(e)}};
+Graph.prototype.openLink=function(a,b,e){var c=window;try{if("_self"==b&&window!=window.top)window.location.href=a;else if(a.substring(0,this.baseUrl.length)==this.baseUrl&&"#"==a.charAt(this.baseUrl.length)&&"_top"==b&&window==window.top){var k=a.split("#")[1];window.location.hash=="#"+k&&(window.location.hash="");window.location.hash=k}else c=window.open(a,b),null==c||e||(c.opener=null)}catch(m){}return c};Graph.prototype.getLinkTitle=function(a){return a.substring(a.lastIndexOf("/")+1)};
Graph.prototype.isCustomLink=function(a){return"data:"==a.substring(0,5)};Graph.prototype.customLinkClicked=function(a){return!1};Graph.prototype.isExternalProtocol=function(a){return"mailto:"===a.substring(0,7)};Graph.prototype.isBlankLink=function(a){return!this.isExternalProtocol(a)&&("blank"===this.linkPolicy||"self"!==this.linkPolicy&&!this.isRelativeUrl(a)&&a.substring(0,this.domainUrl.length)!==this.domainUrl)};
Graph.prototype.isRelativeUrl=function(a){return null!=a&&!this.absoluteUrlPattern.test(a)&&"data:"!==a.substring(0,5)&&!this.isExternalProtocol(a)};Graph.prototype.getAbsoluteUrl=function(a){null!=a&&this.isRelativeUrl(a)&&(a="#"==a.charAt(0)?this.baseUrl+a:"/"==a.charAt(0)?this.domainUrl+a:this.domainPathUrl+a);return a};
Graph.prototype.initLayoutManager=function(){this.layoutManager=new mxLayoutManager(this);this.layoutManager.getLayout=function(a){var b=this.graph.view.getState(a);a=null!=b?b.style:this.graph.getCellStyle(a);if(null!=a){if("stackLayout"==a.childLayout)return b=new mxStackLayout(this.graph,!0),b.resizeParentMax="1"==mxUtils.getValue(a,"resizeParentMax","1"),b.horizontal="1"==mxUtils.getValue(a,"horizontalStack","1"),b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),b.resizeLast="1"==mxUtils.getValue(a,
"resizeLast","0"),b.spacing=a.stackSpacing||b.spacing,b.border=a.stackBorder||b.border,b.marginLeft=a.marginLeft||0,b.marginRight=a.marginRight||0,b.marginTop=a.marginTop||0,b.marginBottom=a.marginBottom||0,b.fill=!0,b;if("treeLayout"==a.childLayout)return b=new mxCompactTreeLayout(this.graph),b.horizontal="1"==mxUtils.getValue(a,"horizontalTree","1"),b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),b.groupPadding=mxUtils.getValue(a,"parentPadding",20),b.levelDistance=mxUtils.getValue(a,
"treeLevelDistance",30),b.maintainParentLocation=!0,b.edgeRouting=!1,b.resetEdges=!1,b;if("flowLayout"==a.childLayout)return b=new mxHierarchicalLayout(this.graph,mxUtils.getValue(a,"flowOrientation",mxConstants.DIRECTION_EAST)),b.resizeParent="1"==mxUtils.getValue(a,"resizeParent","1"),b.parentBorder=mxUtils.getValue(a,"parentPadding",20),b.maintainParentLocation=!0,b.intraCellSpacing=mxUtils.getValue(a,"intraCellSpacing",mxHierarchicalLayout.prototype.intraCellSpacing),b.interRankCellSpacing=mxUtils.getValue(a,
"interRankCellSpacing",mxHierarchicalLayout.prototype.interRankCellSpacing),b.interHierarchySpacing=mxUtils.getValue(a,"interHierarchySpacing",mxHierarchicalLayout.prototype.interHierarchySpacing),b.parallelEdgeSpacing=mxUtils.getValue(a,"parallelEdgeSpacing",mxHierarchicalLayout.prototype.parallelEdgeSpacing),b}return null}};Graph.prototype.getPageSize=function(){return this.pageVisible?new mxRectangle(0,0,this.pageFormat.width*this.pageScale,this.pageFormat.height*this.pageScale):this.scrollTileSize};
-Graph.prototype.getPageLayout=function(){var a=this.getPageSize(),b=this.getGraphBounds();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var e=Math.ceil(b.x/this.view.scale-this.view.translate.x),d=Math.ceil(b.y/this.view.scale-this.view.translate.y),k=Math.floor(e/a.width),m=Math.floor(d/a.height);return new mxRectangle(k,m,Math.ceil((e+Math.floor(b.width/this.view.scale))/a.width)-k,Math.ceil((d+Math.floor(b.height/this.view.scale))/a.height)-m)};
+Graph.prototype.getPageLayout=function(){var a=this.getPageSize(),b=this.getGraphBounds();if(0==b.width||0==b.height)return new mxRectangle(0,0,1,1);var e=Math.ceil(b.x/this.view.scale-this.view.translate.x),c=Math.ceil(b.y/this.view.scale-this.view.translate.y),k=Math.floor(e/a.width),m=Math.floor(c/a.height);return new mxRectangle(k,m,Math.ceil((e+Math.floor(b.width/this.view.scale))/a.width)-k,Math.ceil((c+Math.floor(b.height/this.view.scale))/a.height)-m)};
Graph.prototype.sanitizeHtml=function(a,b){return html_sanitize(a,function(a){return null!=a&&"javascript:"!==a.toString().toLowerCase().substring(0,11)?a:null},function(a){return a})};Graph.prototype.updatePlaceholders=function(){var a=!1,b;for(b in this.model.cells){var e=this.model.cells[b];this.isReplacePlaceholders(e)&&(this.view.invalidate(e,!1,!1),a=!0)}a&&this.view.validate()};Graph.prototype.isReplacePlaceholders=function(a){return null!=a.value&&"object"==typeof a.value&&"1"==a.value.getAttribute("placeholders")};
Graph.prototype.isZoomWheelEvent=function(a){return mxEvent.isAltDown(a)||mxEvent.isMetaDown(a)&&mxClient.IS_MAC||mxEvent.isControlDown(a)&&!mxClient.IS_MAC};Graph.prototype.isTransparentClickEvent=function(a){return mxEvent.isAltDown(a)};Graph.prototype.isIgnoreTerminalEvent=function(a){return mxEvent.isShiftDown(a)&&mxEvent.isControlDown(a)};
Graph.prototype.isSplitTarget=function(a,b,e){return!this.model.isEdge(b[0])&&!mxEvent.isAltDown(e)&&!mxEvent.isShiftDown(e)&&mxGraph.prototype.isSplitTarget.apply(this,arguments)};Graph.prototype.getLabel=function(a){var b=mxGraph.prototype.getLabel.apply(this,arguments);null!=b&&this.isReplacePlaceholders(a)&&null==a.getAttribute("placeholder")&&(b=this.replacePlaceholders(a,b));return b};
Graph.prototype.isLabelMovable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return!this.isCellLocked(a)&&(this.model.isEdge(a)&&this.edgeLabelsMovable||this.model.isVertex(a)&&(this.vertexLabelsMovable||"1"==mxUtils.getValue(b,"labelMovable","0")))};Graph.prototype.setGridSize=function(a){this.gridSize=a;this.fireEvent(new mxEventObject("gridSizeChanged"))};
Graph.prototype.getGlobalVariable=function(a){var b=null;"date"==a?b=(new Date).toLocaleDateString():"time"==a?b=(new Date).toLocaleTimeString():"timestamp"==a?b=(new Date).toLocaleString():"date{"==a.substring(0,5)&&(a=a.substring(5,a.length-1),b=this.formatDate(new Date,a));return b};
Graph.prototype.formatDate=function(a,b,e){null==this.dateFormatCache&&(this.dateFormatCache={i18n:{dayNames:"Sun Mon Tue Wed Thu Fri Sat Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),monthNames:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec January February March April May June July August September October November December".split(" ")},masks:{"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",
-shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var d=this.dateFormatCache,k=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,m=/[^-+\dA-Z]/g,q=function(a,c){a=String(a);for(c=c||2;a.length<c;)a="0"+a;return a};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)||
-/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(d.masks[b]||b||d.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),e=!0);var t=e?"getUTC":"get",v=a[t+"Date"](),A=a[t+"Day"](),c=a[t+"Month"](),f=a[t+"FullYear"](),g=a[t+"Hours"](),n=a[t+"Minutes"](),l=a[t+"Seconds"](),t=a[t+"Milliseconds"](),p=e?0:a.getTimezoneOffset(),y={d:v,dd:q(v),ddd:d.i18n.dayNames[A],dddd:d.i18n.dayNames[A+7],m:c+1,mm:q(c+1),mmm:d.i18n.monthNames[c],mmmm:d.i18n.monthNames[c+
+shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"}});var c=this.dateFormatCache,k=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,m=/[^-+\dA-Z]/g,q=function(a,d){a=String(a);for(d=d||2;a.length<d;)a="0"+a;return a};1!=arguments.length||"[object String]"!=Object.prototype.toString.call(a)||
+/\d/.test(a)||(b=a,a=void 0);a=a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");b=String(c.masks[b]||b||c.masks["default"]);"UTC:"==b.slice(0,4)&&(b=b.slice(4),e=!0);var t=e?"getUTC":"get",v=a[t+"Date"](),A=a[t+"Day"](),d=a[t+"Month"](),f=a[t+"FullYear"](),g=a[t+"Hours"](),n=a[t+"Minutes"](),l=a[t+"Seconds"](),t=a[t+"Milliseconds"](),p=e?0:a.getTimezoneOffset(),y={d:v,dd:q(v),ddd:c.i18n.dayNames[A],dddd:c.i18n.dayNames[A+7],m:d+1,mm:q(d+1),mmm:c.i18n.monthNames[d],mmmm:c.i18n.monthNames[d+
12],yy:String(f).slice(2),yyyy:f,h:g%12||12,hh:q(g%12||12),H:g,HH:q(g),M:n,MM:q(n),s:l,ss:q(l),l:q(t,3),L:q(99<t?Math.round(t/10):t),t:12>g?"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:(0<p?"-":"+")+q(100*Math.floor(Math.abs(p)/60)+Math.abs(p)%60,4),S:["th","st","nd","rd"][3<v%10?0:(10!=v%100-v%10)*v%10]};return b.replace(/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,function(a){return a in y?y[a]:a.slice(1,
a.length-1)})};
-Graph.prototype.createLayersDialog=function(){var a=document.createElement("div");a.style.position="absolute";for(var b=this.getModel(),e=b.getChildCount(b.root),d=0;d<e;d++)mxUtils.bind(this,function(d){var e=document.createElement("div");e.style.overflow="hidden";e.style.textOverflow="ellipsis";e.style.padding="2px";e.style.whiteSpace="nowrap";var k=document.createElement("input");k.style.display="inline-block";k.setAttribute("type","checkbox");b.isVisible(d)&&(k.setAttribute("checked","checked"),
-k.defaultChecked=!0);e.appendChild(k);var t=this.convertValueToString(d)||mxResources.get("background")||"Background";e.setAttribute("title",t);mxUtils.write(e,t);a.appendChild(e);mxEvent.addListener(k,"click",function(){null!=k.getAttribute("checked")?k.removeAttribute("checked"):k.setAttribute("checked","checked");b.setVisible(d,k.checked)})})(b.getChildAt(b.root,d));return a};
-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(2<k.length&&"%label%"!=k&&"%tooltip%"!=k){var m=null;if(match.index>d&&"%"==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&&0<a.length){for(var b=[],e=0;e<a.length;e++){var d=this.model.getCell(a[e].id);null!=d&&b.push(d)}this.setSelectionCells(b)}else this.clearSelection()};
+Graph.prototype.createLayersDialog=function(){var a=document.createElement("div");a.style.position="absolute";for(var b=this.getModel(),e=b.getChildCount(b.root),c=0;c<e;c++)mxUtils.bind(this,function(c){var e=document.createElement("div");e.style.overflow="hidden";e.style.textOverflow="ellipsis";e.style.padding="2px";e.style.whiteSpace="nowrap";var k=document.createElement("input");k.style.display="inline-block";k.setAttribute("type","checkbox");b.isVisible(c)&&(k.setAttribute("checked","checked"),
+k.defaultChecked=!0);e.appendChild(k);var t=this.convertValueToString(c)||mxResources.get("background")||"Background";e.setAttribute("title",t);mxUtils.write(e,t);a.appendChild(e);mxEvent.addListener(k,"click",function(){null!=k.getAttribute("checked")?k.removeAttribute("checked"):k.setAttribute("checked","checked");b.setVisible(c,k.checked)})})(b.getChildAt(b.root,c));return a};
+Graph.prototype.replacePlaceholders=function(a,b){var e=[];if(null!=b){for(var c=0;match=this.placeholderPattern.exec(b);){var k=match[0];if(2<k.length&&"%label%"!=k&&"%tooltip%"!=k){var m=null;if(match.index>c&&"%"==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(c,
+match.index)+(null!=m?m:k));c=match.index+k.length}}e.push(b.substring(c))}return e.join("")};Graph.prototype.restoreSelection=function(a){if(null!=a&&0<a.length){for(var b=[],e=0;e<a.length;e++){var c=this.model.getCell(a[e].id);null!=c&&b.push(c)}this.setSelectionCells(b)}else this.clearSelection()};
Graph.prototype.selectCellsForConnectVertex=function(a,b,e){2==a.length&&this.model.isVertex(a[1])?(this.setSelectionCell(a[1]),null!=e&&(mxEvent.isTouchEvent(b)?e.update(e.getState(this.view.getState(a[1]))):e.reset()),this.scrollCellToVisible(a[1])):this.setSelectionCells(a)};
-Graph.prototype.connectVertex=function(a,b,e,d,k,m){m=m?m:!1;var q=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(a.geometry.x,a.geometry.y);b==mxConstants.DIRECTION_NORTH?(q.x+=a.geometry.width/2,q.y-=e):b==mxConstants.DIRECTION_SOUTH?(q.x+=a.geometry.width/2,q.y+=a.geometry.height+e):(q.x=b==mxConstants.DIRECTION_WEST?q.x-e:q.x+(a.geometry.width+e),q.y+=a.geometry.height/2);e=this.view.getState(this.model.getParent(a));
-var t=this.view.scale,v=this.view.translate,A=v.x*t,v=v.y*t;null!=e&&this.model.isVertex(e.cell)&&(A=e.x,v=e.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(q.x+=a.parent.geometry.x,q.y+=a.parent.geometry.y);m=m||mxEvent.isControlDown(d)&&!k?null:this.getCellAt(A+q.x*t,v+q.y*t);this.model.isAncestor(m,a)&&(m=null);for(e=m;null!=e;){if(this.isCellLocked(e)){m=null;break}e=this.model.getParent(e)}null!=m&&(e=this.view.getState(a),t=this.view.getState(m),null!=e&&null!=t&&mxUtils.intersects(e,
-t)&&(m=null));if(k=!mxEvent.isShiftDown(d)||k)b==mxConstants.DIRECTION_NORTH?q.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?q.y+=a.geometry.height/2:q.x=b==mxConstants.DIRECTION_WEST?q.x-a.geometry.width/2:q.x+a.geometry.width/2;null==m||this.isCellConnectable(m)||(e=this.getModel().getParent(m),this.getModel().isVertex(e)&&this.isCellConnectable(e)&&(m=e));if(m==a||this.model.isEdge(m)||!this.isCellConnectable(m))m=null;e=[];this.model.beginUpdate();try{t=m;if(null==t&&k){for(var A=a,c=
-this.getCellGeometry(a);null!=c&&c.relative;)A=this.getModel().getParent(A),c=this.getCellGeometry(A);var f=this.view.getState(A),g=null!=f?f.style:this.getCellStyle(A);if(mxUtils.getValue(g,"part",!1)){var n=this.model.getParent(A);this.model.isVertex(n)&&(A=n)}t=this.duplicateCells([A],!1)[0];c=this.getCellGeometry(t);null!=c&&(c.x=q.x-c.width/2,c.y=q.y-c.height/2)}c=null;null!=this.layoutManager&&(c=this.layoutManager.getLayout(this.model.getParent(a)));var l=mxEvent.isControlDown(d)&&k||null==
-m&&null!=c&&c.constructor==mxStackLayout?null:this.insertEdge(this.model.getParent(a),null,"",a,t,this.createCurrentEdgeStyle());if(null!=l&&this.connectionHandler.insertBeforeSource){var p=null;for(d=a;null!=d.parent&&null!=d.geometry&&d.geometry.relative&&d.parent!=l.parent;)d=this.model.getParent(d);null!=d&&null!=d.parent&&d.parent==l.parent&&(p=d.parent.getIndex(d),this.model.add(d.parent,l,p))}null==m&&null!=t&&null!=c&&null!=a.parent&&c.constructor==mxStackLayout&&b==mxConstants.DIRECTION_WEST&&
+Graph.prototype.connectVertex=function(a,b,e,c,k,m){m=m?m:!1;var q=a.geometry.relative&&null!=a.parent.geometry?new mxPoint(a.parent.geometry.width*a.geometry.x,a.parent.geometry.height*a.geometry.y):new mxPoint(a.geometry.x,a.geometry.y);b==mxConstants.DIRECTION_NORTH?(q.x+=a.geometry.width/2,q.y-=e):b==mxConstants.DIRECTION_SOUTH?(q.x+=a.geometry.width/2,q.y+=a.geometry.height+e):(q.x=b==mxConstants.DIRECTION_WEST?q.x-e:q.x+(a.geometry.width+e),q.y+=a.geometry.height/2);e=this.view.getState(this.model.getParent(a));
+var t=this.view.scale,v=this.view.translate,A=v.x*t,v=v.y*t;null!=e&&this.model.isVertex(e.cell)&&(A=e.x,v=e.y);this.model.isVertex(a.parent)&&a.geometry.relative&&(q.x+=a.parent.geometry.x,q.y+=a.parent.geometry.y);m=m||mxEvent.isControlDown(c)&&!k?null:this.getCellAt(A+q.x*t,v+q.y*t);this.model.isAncestor(m,a)&&(m=null);for(e=m;null!=e;){if(this.isCellLocked(e)){m=null;break}e=this.model.getParent(e)}null!=m&&(e=this.view.getState(a),t=this.view.getState(m),null!=e&&null!=t&&mxUtils.intersects(e,
+t)&&(m=null));if(k=!mxEvent.isShiftDown(c)||k)b==mxConstants.DIRECTION_NORTH?q.y-=a.geometry.height/2:b==mxConstants.DIRECTION_SOUTH?q.y+=a.geometry.height/2:q.x=b==mxConstants.DIRECTION_WEST?q.x-a.geometry.width/2:q.x+a.geometry.width/2;null==m||this.isCellConnectable(m)||(e=this.getModel().getParent(m),this.getModel().isVertex(e)&&this.isCellConnectable(e)&&(m=e));if(m==a||this.model.isEdge(m)||!this.isCellConnectable(m))m=null;e=[];this.model.beginUpdate();try{t=m;if(null==t&&k){for(var A=a,d=
+this.getCellGeometry(a);null!=d&&d.relative;)A=this.getModel().getParent(A),d=this.getCellGeometry(A);var f=this.view.getState(A),g=null!=f?f.style:this.getCellStyle(A);if(mxUtils.getValue(g,"part",!1)){var n=this.model.getParent(A);this.model.isVertex(n)&&(A=n)}t=this.duplicateCells([A],!1)[0];d=this.getCellGeometry(t);null!=d&&(d.x=q.x-d.width/2,d.y=q.y-d.height/2)}d=null;null!=this.layoutManager&&(d=this.layoutManager.getLayout(this.model.getParent(a)));var l=mxEvent.isControlDown(c)&&k||null==
+m&&null!=d&&d.constructor==mxStackLayout?null:this.insertEdge(this.model.getParent(a),null,"",a,t,this.createCurrentEdgeStyle());if(null!=l&&this.connectionHandler.insertBeforeSource){var p=null;for(c=a;null!=c.parent&&null!=c.geometry&&c.geometry.relative&&c.parent!=l.parent;)c=this.model.getParent(c);null!=c&&null!=c.parent&&c.parent==l.parent&&(p=c.parent.getIndex(c),this.model.add(c.parent,l,p))}null==m&&null!=t&&null!=d&&null!=a.parent&&d.constructor==mxStackLayout&&b==mxConstants.DIRECTION_WEST&&
(p=a.parent.getIndex(a),this.model.add(a.parent,t,p));null!=l&&e.push(l);null==m&&null!=t&&e.push(t);null==t&&null!=l&&l.geometry.setTerminalPoint(q,!1);null!=l&&this.fireEvent(new mxEventObject("cellsInserted","cells",[l]))}finally{this.model.endUpdate()}return e};
-Graph.prototype.getIndexableText=function(){var a=document.createElement("div"),b=[],e,d;for(d in this.model.cells)if(e=this.model.cells[d],this.model.isVertex(e)||this.model.isEdge(e))this.isHtmlLabel(e)?(a.innerHTML=this.getLabel(e),e=mxUtils.extractTextWithWhitespace([a])):e=this.getLabel(e),e=mxUtils.trim(e.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<e.length&&b.push(e);return b.join(" ")};
-Graph.prototype.convertValueToString=function(a){if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder")){for(var b=a.getAttribute("placeholder"),e=a,d=null;null==d&&null!=e;)null!=e.value&&"object"==typeof e.value&&(d=e.hasAttribute(b)?null!=e.getAttribute(b)?e.getAttribute(b):"":null),e=this.model.getParent(e);return d||""}return a.value.getAttribute("label")||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};
+Graph.prototype.getIndexableText=function(){var a=document.createElement("div"),b=[],e,c;for(c in this.model.cells)if(e=this.model.cells[c],this.model.isVertex(e)||this.model.isEdge(e))this.isHtmlLabel(e)?(a.innerHTML=this.getLabel(e),e=mxUtils.extractTextWithWhitespace([a])):e=this.getLabel(e),e=mxUtils.trim(e.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")),0<e.length&&b.push(e);return b.join(" ")};
+Graph.prototype.convertValueToString=function(a){if(null!=a.value&&"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder")){for(var b=a.getAttribute("placeholder"),e=a,c=null;null==c&&null!=e;)null!=e.value&&"object"==typeof e.value&&(c=e.hasAttribute(b)?null!=e.getAttribute(b)?e.getAttribute(b):"":null),e=this.model.getParent(e);return c||""}return a.value.getAttribute("label")||""}return mxGraph.prototype.convertValueToString.apply(this,arguments)};
Graph.prototype.getLinksForState=function(a){return null!=a&&null!=a.text&&null!=a.text.node?a.text.node.getElementsByTagName("a"):null};Graph.prototype.getLinkForCell=function(a){return null!=a.value&&"object"==typeof a.value?(a=a.value.getAttribute("link"),null!=a&&"javascript:"===a.toLowerCase().substring(0,11)&&(a=a.substring(11)),a):null};
Graph.prototype.getCellStyle=function(a){var b=mxGraph.prototype.getCellStyle.apply(this,arguments);if(null!=a&&null!=this.layoutManager){var e=this.model.getParent(a);this.model.isVertex(e)&&this.isCellCollapsed(a)&&(e=this.layoutManager.getLayout(e),null!=e&&e.constructor==mxStackLayout&&(b[mxConstants.STYLE_HORIZONTAL]=!e.horizontal))}return b};
-Graph.prototype.updateAlternateBounds=function(a,b,e){if(null!=a&&null!=b&&null!=this.layoutManager&&null!=b.alternateBounds){var d=this.layoutManager.getLayout(this.model.getParent(a));null!=d&&d.constructor==mxStackLayout&&(d.horizontal?b.alternateBounds.height=0:b.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(a){return mxEvent.isShiftDown(a)};
-Graph.prototype.foldCells=function(a,b,e,d,k){b=null!=b?b:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));if(null!=e){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var m=0;m<e.length;m++){var q=this.view.getState(e[m]),t=this.getCellGeometry(e[m]);if(null!=q&&null!=t){var v=Math.round(t.width-q.width/this.view.scale),A=Math.round(t.height-q.height/this.view.scale);if(0!=A||0!=v){var c=this.model.getParent(e[m]),f=this.layoutManager.getLayout(c);
-null==f?null!=k&&this.isMoveCellsEvent(k)&&this.moveSiblings(q,c,v,A):null!=k&&mxEvent.isAltDown(k)||f.constructor!=mxStackLayout||f.resizeLast||this.resizeParentStacks(c,f,v,A)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(e)}};
-Graph.prototype.moveSiblings=function(a,b,e,d){this.model.beginUpdate();try{var k=this.getCellsBeyond(a.x,a.y,b,!0,!0);for(b=0;b<k.length;b++)if(k[b]!=a.cell){var m=this.view.getState(k[b]),q=this.getCellGeometry(k[b]);null!=m&&null!=q&&(q=q.clone(),q.translate(Math.round(e*Math.max(0,Math.min(1,(m.x-a.x)/a.width))),Math.round(d*Math.max(0,Math.min(1,(m.y-a.y)/a.height)))),this.model.setGeometry(k[b],q))}}finally{this.model.endUpdate()}};
-Graph.prototype.resizeParentStacks=function(a,b,e,d){if(null!=this.layoutManager&&null!=b&&b.constructor==mxStackLayout&&!b.resizeLast){this.model.beginUpdate();try{for(var k=b.horizontal;null!=a&&null!=b&&b.constructor==mxStackLayout&&b.horizontal==k&&!b.resizeLast;){var m=this.getCellGeometry(a),q=this.view.getState(a);null!=q&&null!=m&&(m=m.clone(),b.horizontal?m.width+=e+Math.min(0,q.width/this.view.scale-m.width):m.height+=d+Math.min(0,q.height/this.view.scale-m.height),this.model.setGeometry(a,
+Graph.prototype.updateAlternateBounds=function(a,b,e){if(null!=a&&null!=b&&null!=this.layoutManager&&null!=b.alternateBounds){var c=this.layoutManager.getLayout(this.model.getParent(a));null!=c&&c.constructor==mxStackLayout&&(c.horizontal?b.alternateBounds.height=0:b.alternateBounds.width=0)}mxGraph.prototype.updateAlternateBounds.apply(this,arguments)};Graph.prototype.isMoveCellsEvent=function(a){return mxEvent.isShiftDown(a)};
+Graph.prototype.foldCells=function(a,b,e,c,k){b=null!=b?b:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));if(null!=e){this.model.beginUpdate();try{if(mxGraph.prototype.foldCells.apply(this,arguments),null!=this.layoutManager)for(var m=0;m<e.length;m++){var q=this.view.getState(e[m]),t=this.getCellGeometry(e[m]);if(null!=q&&null!=t){var v=Math.round(t.width-q.width/this.view.scale),A=Math.round(t.height-q.height/this.view.scale);if(0!=A||0!=v){var d=this.model.getParent(e[m]),f=this.layoutManager.getLayout(d);
+null==f?null!=k&&this.isMoveCellsEvent(k)&&this.moveSiblings(q,d,v,A):null!=k&&mxEvent.isAltDown(k)||f.constructor!=mxStackLayout||f.resizeLast||this.resizeParentStacks(d,f,v,A)}}}}finally{this.model.endUpdate()}this.isEnabled()&&this.setSelectionCells(e)}};
+Graph.prototype.moveSiblings=function(a,b,e,c){this.model.beginUpdate();try{var k=this.getCellsBeyond(a.x,a.y,b,!0,!0);for(b=0;b<k.length;b++)if(k[b]!=a.cell){var m=this.view.getState(k[b]),q=this.getCellGeometry(k[b]);null!=m&&null!=q&&(q=q.clone(),q.translate(Math.round(e*Math.max(0,Math.min(1,(m.x-a.x)/a.width))),Math.round(c*Math.max(0,Math.min(1,(m.y-a.y)/a.height)))),this.model.setGeometry(k[b],q))}}finally{this.model.endUpdate()}};
+Graph.prototype.resizeParentStacks=function(a,b,e,c){if(null!=this.layoutManager&&null!=b&&b.constructor==mxStackLayout&&!b.resizeLast){this.model.beginUpdate();try{for(var k=b.horizontal;null!=a&&null!=b&&b.constructor==mxStackLayout&&b.horizontal==k&&!b.resizeLast;){var m=this.getCellGeometry(a),q=this.view.getState(a);null!=q&&null!=m&&(m=m.clone(),b.horizontal?m.width+=e+Math.min(0,q.width/this.view.scale-m.width):m.height+=c+Math.min(0,q.height/this.view.scale-m.height),this.model.setGeometry(a,
m));a=this.model.getParent(a);b=this.layoutManager.getLayout(a)}}finally{this.model.endUpdate()}}};Graph.prototype.isContainer=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return this.isSwimlane(a)?"0"!=b.container:"1"==b.container};Graph.prototype.isCellConnectable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return null!=b&&null!=b.connectable?"0"!=b.connectable:mxGraph.prototype.isCellConnectable.apply(this,arguments)};
Graph.prototype.selectAll=function(a){a=a||this.getDefaultParent();this.isCellLocked(a)||mxGraph.prototype.selectAll.apply(this,arguments)};Graph.prototype.selectCells=function(a,b,e){e=e||this.getDefaultParent();this.isCellLocked(e)||mxGraph.prototype.selectCells.apply(this,arguments)};Graph.prototype.getSwimlaneAt=function(a,b,e){e=e||this.getDefaultParent();return this.isCellLocked(e)?null:mxGraph.prototype.getSwimlaneAt.apply(this,arguments)};
Graph.prototype.isCellFoldable=function(a){var b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return this.foldingEnabled&&!this.isCellLocked(a)&&(this.isContainer(a)&&"0"!=b.collapsible||!this.isContainer(a)&&"1"==b.collapsible)};Graph.prototype.reset=function(){this.isEditing()&&this.stopEditing(!0);this.escape();this.isSelectionEmpty()||this.clearSelection()};
Graph.prototype.zoom=function(a,b){a=Math.max(.01,Math.min(this.view.scale*a,160))/this.view.scale;mxGraph.prototype.zoom.apply(this,arguments)};Graph.prototype.zoomIn=function(){.15>this.view.scale?this.zoom((this.view.scale+.01)/this.view.scale):this.zoom(Math.round(this.view.scale*this.zoomFactor*20)/20/this.view.scale)};Graph.prototype.zoomOut=function(){.15>=this.view.scale?this.zoom((this.view.scale-.01)/this.view.scale):this.zoom(Math.round(1/this.zoomFactor*this.view.scale*20)/20/this.view.scale)};
-Graph.prototype.getTooltipForCell=function(a){var b="";if(mxUtils.isNode(a.value)){var e=a.value.getAttribute("tooltip");if(null!=e)null!=e&&this.isReplacePlaceholders(a)&&(e=this.replacePlaceholders(a,e)),b=this.sanitizeHtml(e);else{e=this.builtInProperties;a=a.value.attributes;var d=[];this.isEnabled()&&e.push("link");for(var k=0;k<a.length;k++)0>mxUtils.indexOf(e,a[k].nodeName)&&0<a[k].nodeValue.length&&d.push({name:a[k].nodeName,value:a[k].nodeValue});d.sort(function(a,b){return a.name<b.name?
--1:a.name>b.name?1:0});for(k=0;k<d.length;k++)"link"==d[k].name&&this.isCustomLink(d[k].value)||(b+=("link"!=d[k].name?"<b>"+d[k].name+":</b> ":"")+mxUtils.htmlEntities(d[k].value)+"\n");0<b.length&&(b=b.substring(0,b.length-1),mxClient.IS_SVG&&(b='<div style="max-width:360px;">'+b+"</div>"))}}return b};Graph.prototype.stringToBytes=function(a){return Graph.stringToBytes(a)};Graph.prototype.bytesToString=function(a){return Graph.bytesToString(a)};Graph.prototype.compressNode=function(a){return Graph.compressNode(a)};
+Graph.prototype.getTooltipForCell=function(a){var b="";if(mxUtils.isNode(a.value)){var e=a.value.getAttribute("tooltip");if(null!=e)null!=e&&this.isReplacePlaceholders(a)&&(e=this.replacePlaceholders(a,e)),b=this.sanitizeHtml(e);else{e=this.builtInProperties;a=a.value.attributes;var c=[];this.isEnabled()&&e.push("link");for(var k=0;k<a.length;k++)0>mxUtils.indexOf(e,a[k].nodeName)&&0<a[k].nodeValue.length&&c.push({name:a[k].nodeName,value:a[k].nodeValue});c.sort(function(a,b){return a.name<b.name?
+-1:a.name>b.name?1:0});for(k=0;k<c.length;k++)"link"==c[k].name&&this.isCustomLink(c[k].value)||(b+=("link"!=c[k].name?"<b>"+c[k].name+":</b> ":"")+mxUtils.htmlEntities(c[k].value)+"\n");0<b.length&&(b=b.substring(0,b.length-1),mxClient.IS_SVG&&(b='<div style="max-width:360px;">'+b+"</div>"))}}return b};Graph.prototype.stringToBytes=function(a){return Graph.stringToBytes(a)};Graph.prototype.bytesToString=function(a){return Graph.bytesToString(a)};Graph.prototype.compressNode=function(a){return Graph.compressNode(a)};
Graph.prototype.compress=function(a,b){return Graph.compress(a,b)};Graph.prototype.decompress=function(a,b){return Graph.decompress(a,b)};Graph.prototype.zapGremlins=function(a){return Graph.zapGremlins(a)};HoverIcons=function(a){this.graph=a;this.init()};HoverIcons.prototype.arrowSpacing=2;HoverIcons.prototype.updateDelay=500;HoverIcons.prototype.activationDelay=140;HoverIcons.prototype.currentState=null;HoverIcons.prototype.activeArrow=null;HoverIcons.prototype.inactiveOpacity=15;
HoverIcons.prototype.cssCursor="copy";HoverIcons.prototype.checkCollisions=!0;HoverIcons.prototype.arrowFill="#29b6f2";HoverIcons.prototype.triangleUp=mxClient.IS_SVG?Graph.createSvgImage(18,28,'<path d="m 6 26 L 12 26 L 12 12 L 18 12 L 9 1 L 1 12 L 6 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-up.png",26,14);
HoverIcons.prototype.triangleRight=mxClient.IS_SVG?Graph.createSvgImage(26,18,'<path d="m 1 6 L 14 6 L 14 1 L 26 9 L 14 18 L 14 12 L 1 12 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-right.png",14,26);HoverIcons.prototype.triangleDown=mxClient.IS_SVG?Graph.createSvgImage(18,26,'<path d="m 6 1 L 6 14 L 1 14 L 9 26 L 18 14 L 12 14 L 12 1 z" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'"/>'):new mxImage(IMAGE_PATH+"/triangle-down.png",26,14);
@@ -2291,9 +2290,9 @@ IMAGE_PATH+"/refresh.png",38,38);HoverIcons.prototype.tolerance=mxClient.IS_TOUC
HoverIcons.prototype.init=function(){this.arrowUp=this.createArrow(this.triangleUp,mxResources.get("plusTooltip"));this.arrowRight=this.createArrow(this.triangleRight,mxResources.get("plusTooltip"));this.arrowDown=this.createArrow(this.triangleDown,mxResources.get("plusTooltip"));this.arrowLeft=this.createArrow(this.triangleLeft,mxResources.get("plusTooltip"));this.elts=[this.arrowUp,this.arrowRight,this.arrowDown,this.arrowLeft];this.repaintHandler=mxUtils.bind(this,function(){this.repaint()});this.graph.selectionModel.addListener(mxEvent.CHANGE,
this.repaintHandler);this.graph.model.addListener(mxEvent.CHANGE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE_AND_TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.TRANSLATE,this.repaintHandler);this.graph.view.addListener(mxEvent.SCALE,this.repaintHandler);this.graph.view.addListener(mxEvent.DOWN,this.repaintHandler);this.graph.view.addListener(mxEvent.UP,this.repaintHandler);this.graph.addListener(mxEvent.ROOT,this.repaintHandler);this.graph.addListener(mxEvent.ESCAPE,
mxUtils.bind(this,function(){this.mouseDownPoint=null}));mxEvent.addListener(this.graph.container,"mouseleave",mxUtils.bind(this,function(a){null!=a.relatedTarget&&mxEvent.getSource(a)==this.graph.container&&this.setDisplay("none")}));this.graph.addListener(mxEvent.START_EDITING,mxUtils.bind(this,function(a){this.reset()}));var a=this.graph.click;this.graph.click=mxUtils.bind(this,function(b){a.apply(this.graph,arguments);null==this.currentState||this.graph.isCellSelected(this.currentState.cell)||
-!mxEvent.isTouchEvent(b.getEvent())||this.graph.model.isVertex(b.getCell())||this.reset()});var b=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(a,d){b=!1;var e=d.getEvent();if(this.isResetEvent(e))this.reset();else if(!this.isActive()){var m=this.getState(d.getState());null==m&&mxEvent.isTouchEvent(e)||this.update(m)}this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(a,d){var e=d.getEvent();this.isResetEvent(e)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(e)||
-this.update(this.getState(d.getState()),d.getGraphX(),d.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(b=!0)}),mouseUp:mxUtils.bind(this,function(a,d){var e=d.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.isResetEvent(e)?this.reset():this.isActive()&&!b&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),d):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?
-this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(d.getGraphX(),d.getGraphY())))):mxEvent.isTouchEvent(e)||null!=this.bbox&&mxUtils.contains(this.bbox,d.getGraphX(),d.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(e)||this.reset();b=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(a,b){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isMetaDown(a)||mxEvent.isPopupTrigger(a)&&!mxEvent.isControlDown(a)};
+!mxEvent.isTouchEvent(b.getEvent())||this.graph.model.isVertex(b.getCell())||this.reset()});var b=!1;this.graph.addMouseListener({mouseDown:mxUtils.bind(this,function(a,c){b=!1;var e=c.getEvent();if(this.isResetEvent(e))this.reset();else if(!this.isActive()){var m=this.getState(c.getState());null==m&&mxEvent.isTouchEvent(e)||this.update(m)}this.setDisplay("none")}),mouseMove:mxUtils.bind(this,function(a,c){var e=c.getEvent();this.isResetEvent(e)?this.reset():this.graph.isMouseDown||mxEvent.isTouchEvent(e)||
+this.update(this.getState(c.getState()),c.getGraphX(),c.getGraphY());null!=this.graph.connectionHandler&&null!=this.graph.connectionHandler.shape&&(b=!0)}),mouseUp:mxUtils.bind(this,function(a,c){var e=c.getEvent();mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(e),mxEvent.getClientY(e));this.isResetEvent(e)?this.reset():this.isActive()&&!b&&null!=this.mouseDownPoint?this.click(this.currentState,this.getDirection(),c):this.isActive()?1==this.graph.getSelectionCount()&&this.graph.model.isEdge(this.graph.getSelectionCell())?
+this.reset():this.update(this.getState(this.graph.view.getState(this.graph.getCellAt(c.getGraphX(),c.getGraphY())))):mxEvent.isTouchEvent(e)||null!=this.bbox&&mxUtils.contains(this.bbox,c.getGraphX(),c.getGraphY())?(this.setDisplay(""),this.repaint()):mxEvent.isTouchEvent(e)||this.reset();b=!1;this.resetActiveArrow()})})};HoverIcons.prototype.isResetEvent=function(a,b){return mxEvent.isAltDown(a)||null==this.activeArrow&&mxEvent.isShiftDown(a)||mxEvent.isMetaDown(a)||mxEvent.isPopupTrigger(a)&&!mxEvent.isControlDown(a)};
HoverIcons.prototype.createArrow=function(a,b){var e=null;mxClient.IS_IE&&!mxClient.IS_SVG?(mxClient.IS_IE6&&"CSS1Compat"!=document.compatMode?(e=document.createElement(mxClient.VML_PREFIX+":image"),e.setAttribute("src",a.src),e.style.borderStyle="none"):(e=document.createElement("div"),e.style.backgroundImage="url("+a.src+")",e.style.backgroundPosition="center",e.style.backgroundRepeat="no-repeat"),e.style.width=a.width+4+"px",e.style.height=a.height+4+"px",e.style.display=mxClient.IS_QUIRKS?"inline":
"inline-block"):(e=mxUtils.createImage(a.src),e.style.width=a.width+"px",e.style.height=a.height+"px",e.style.padding=this.tolerance+"px");null!=b&&e.setAttribute("title",b);e.style.position="absolute";e.style.cursor=this.cssCursor;mxEvent.addGestureListeners(e,mxUtils.bind(this,function(a){null==this.currentState||this.isResetEvent(a)||(this.mouseDownPoint=mxUtils.convertPoint(this.graph.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),this.drag(a,this.mouseDownPoint.x,this.mouseDownPoint.y),
this.activeArrow=e,this.setDisplay("none"),mxEvent.consume(a))}));mxEvent.redirectMouseEvents(e,this.graph,this.currentState);mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(a){mxEvent.isMouseEvent(a)&&(null!=this.activeArrow&&this.activeArrow!=e&&mxUtils.setOpacity(this.activeArrow,this.inactiveOpacity),this.graph.connectionHandler.constraintHandler.reset(),mxUtils.setOpacity(e,100),this.activeArrow=e)}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(a){this.graph.isMouseDown||
@@ -2301,121 +2300,121 @@ this.resetActiveArrow()}));return e};HoverIcons.prototype.resetActiveArrow=funct
HoverIcons.prototype.visitNodes=function(a){for(var b=0;b<this.elts.length;b++)null!=this.elts[b]&&a(this.elts[b])};HoverIcons.prototype.removeNodes=function(){this.visitNodes(function(a){null!=a.parentNode&&a.parentNode.removeChild(a)})};HoverIcons.prototype.setDisplay=function(a){this.visitNodes(function(b){b.style.display=a})};HoverIcons.prototype.isActive=function(){return null!=this.activeArrow&&null!=this.currentState};
HoverIcons.prototype.drag=function(a,b,e){this.graph.popupMenuHandler.hideMenu();this.graph.stopEditing(!1);null!=this.currentState&&(this.graph.connectionHandler.start(this.currentState,b,e),this.graph.isMouseTrigger=mxEvent.isMouseEvent(a),this.graph.isMouseDown=!0,b=this.graph.selectionCellsHandler.getHandler(this.currentState.cell),null!=b&&b.setHandlesVisible(!1),b=this.graph.connectionHandler.edgeState,null!=a&&mxEvent.isShiftDown(a)&&mxEvent.isControlDown(a)&&null!=b&&"orthogonalEdgeStyle"===
mxUtils.getValue(b.style,mxConstants.STYLE_EDGE,null)&&(a=this.getDirection(),b.cell.style=mxUtils.setStyle(b.cell.style,"sourcePortConstraint",a),b.style.sourcePortConstraint=a))};HoverIcons.prototype.getStateAt=function(a,b,e){return this.graph.view.getState(this.graph.getCellAt(b,e))};
-HoverIcons.prototype.click=function(a,b,e){var d=e.getEvent(),k=e.getGraphX(),m=e.getGraphY(),k=this.getStateAt(a,k,m);null==k||!this.graph.model.isEdge(k.cell)||mxEvent.isControlDown(d)||k.getVisibleTerminalState(!0)!=a&&k.getVisibleTerminalState(!1)!=a?null!=a&&(a=this.graph.connectVertex(a.cell,b,this.graph.defaultEdgeLength,d),this.graph.selectCellsForConnectVertex(a,d,this),2==a.length&&this.graph.model.isVertex(a[1])?(this.graph.setSelectionCell(a[1]),mxEvent.isTouchEvent(d)?this.update(this.getState(this.graph.view.getState(a[1]))):
+HoverIcons.prototype.click=function(a,b,e){var c=e.getEvent(),k=e.getGraphX(),m=e.getGraphY(),k=this.getStateAt(a,k,m);null==k||!this.graph.model.isEdge(k.cell)||mxEvent.isControlDown(c)||k.getVisibleTerminalState(!0)!=a&&k.getVisibleTerminalState(!1)!=a?null!=a&&(a=this.graph.connectVertex(a.cell,b,this.graph.defaultEdgeLength,c),this.graph.selectCellsForConnectVertex(a,c,this),2==a.length&&this.graph.model.isVertex(a[1])?(this.graph.setSelectionCell(a[1]),mxEvent.isTouchEvent(c)?this.update(this.getState(this.graph.view.getState(a[1]))):
this.reset(),this.graph.scrollCellToVisible(a[1])):this.graph.setSelectionCells(a)):(this.graph.setSelectionCell(k.cell),this.reset());e.consume()};HoverIcons.prototype.reset=function(a){null!=a&&!a||null==this.updateThread||window.clearTimeout(this.updateThread);this.activeArrow=this.currentState=this.mouseDownPoint=null;this.removeNodes();this.bbox=null};
HoverIcons.prototype.repaint=function(){this.bbox=null;if(null!=this.currentState){this.currentState=this.getState(this.currentState);if(null!=this.currentState&&this.graph.model.isVertex(this.currentState.cell)&&this.graph.isCellConnectable(this.currentState.cell)){var a=mxRectangle.fromRectangle(this.currentState);null!=this.currentState.shape&&null!=this.currentState.shape.boundingBox&&(a=mxRectangle.fromRectangle(this.currentState.shape.boundingBox));a.grow(this.graph.tolerance);a.grow(this.arrowSpacing);
var b=this.graph.selectionCellsHandler.getHandler(this.currentState.cell);null!=b&&(a.x-=b.horizontalOffset/2,a.y-=b.verticalOffset/2,a.width+=b.horizontalOffset,a.height+=b.verticalOffset,null!=b.rotationShape&&null!=b.rotationShape.node&&"hidden"!=b.rotationShape.node.style.visibility&&"none"!=b.rotationShape.node.style.display&&null!=b.rotationShape.boundingBox&&a.add(b.rotationShape.boundingBox));this.arrowUp.style.left=Math.round(this.currentState.getCenterX()-this.triangleUp.width/2-this.tolerance)+
"px";this.arrowUp.style.top=Math.round(a.y-this.triangleUp.height-this.tolerance)+"px";mxUtils.setOpacity(this.arrowUp,this.inactiveOpacity);this.arrowRight.style.left=Math.round(a.x+a.width-this.tolerance)+"px";this.arrowRight.style.top=Math.round(this.currentState.getCenterY()-this.triangleRight.height/2-this.tolerance)+"px";mxUtils.setOpacity(this.arrowRight,this.inactiveOpacity);this.arrowDown.style.left=this.arrowUp.style.left;this.arrowDown.style.top=Math.round(a.y+a.height-this.tolerance)+
-"px";mxUtils.setOpacity(this.arrowDown,this.inactiveOpacity);this.arrowLeft.style.left=Math.round(a.x-this.triangleLeft.width-this.tolerance)+"px";this.arrowLeft.style.top=this.arrowRight.style.top;mxUtils.setOpacity(this.arrowLeft,this.inactiveOpacity);if(this.checkCollisions){var b=this.graph.getCellAt(a.x+a.width+this.triangleRight.width/2,this.currentState.getCenterY()),e=this.graph.getCellAt(a.x-this.triangleLeft.width/2,this.currentState.getCenterY()),d=this.graph.getCellAt(this.currentState.getCenterX(),
-a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenterX(),a.y+a.height+this.triangleDown.height/2);null!=b&&b==e&&e==d&&d==a&&(a=d=e=b=null);var k=this.graph.getCellGeometry(this.currentState.cell),m=mxUtils.bind(this,function(a,b){var d=this.graph.model.isVertex(a)&&this.graph.getCellGeometry(a);null!=a&&!this.graph.model.isAncestor(a,this.currentState.cell)&&(null==d||null==k||d.height<6*k.height&&d.width<6*k.width)?b.style.visibility="hidden":b.style.visibility="visible"});
-m(b,this.arrowRight);m(e,this.arrowLeft);m(d,this.arrowUp);m(a,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",
+"px";mxUtils.setOpacity(this.arrowDown,this.inactiveOpacity);this.arrowLeft.style.left=Math.round(a.x-this.triangleLeft.width-this.tolerance)+"px";this.arrowLeft.style.top=this.arrowRight.style.top;mxUtils.setOpacity(this.arrowLeft,this.inactiveOpacity);if(this.checkCollisions){var b=this.graph.getCellAt(a.x+a.width+this.triangleRight.width/2,this.currentState.getCenterY()),e=this.graph.getCellAt(a.x-this.triangleLeft.width/2,this.currentState.getCenterY()),c=this.graph.getCellAt(this.currentState.getCenterX(),
+a.y-this.triangleUp.height/2),a=this.graph.getCellAt(this.currentState.getCenterX(),a.y+a.height+this.triangleDown.height/2);null!=b&&b==e&&e==c&&c==a&&(a=c=e=b=null);var k=this.graph.getCellGeometry(this.currentState.cell),m=mxUtils.bind(this,function(a,b){var c=this.graph.model.isVertex(a)&&this.graph.getCellGeometry(a);null!=a&&!this.graph.model.isAncestor(a,this.currentState.cell)&&(null==c||null==k||c.height<6*k.height&&c.width<6*k.width)?b.style.visibility="hidden":b.style.visibility="visible"});
+m(b,this.arrowRight);m(e,this.arrowLeft);m(c,this.arrowUp);m(a,this.arrowDown)}else this.arrowLeft.style.visibility="visible",this.arrowRight.style.visibility="visible",this.arrowUp.style.visibility="visible",this.arrowDown.style.visibility="visible";this.graph.tooltipHandler.isEnabled()?(this.arrowLeft.setAttribute("title",mxResources.get("plusTooltip")),this.arrowRight.setAttribute("title",mxResources.get("plusTooltip")),this.arrowUp.setAttribute("title",mxResources.get("plusTooltip")),this.arrowDown.setAttribute("title",
mxResources.get("plusTooltip"))):(this.arrowLeft.removeAttribute("title"),this.arrowRight.removeAttribute("title"),this.arrowUp.removeAttribute("title"),this.arrowDown.removeAttribute("title"))}else this.reset();null!=this.currentState&&(this.bbox=this.computeBoundingBox(),null!=this.bbox&&this.bbox.grow(10))}};
HoverIcons.prototype.computeBoundingBox=function(){var a=this.graph.model.isEdge(this.currentState.cell)?null:mxRectangle.fromRectangle(this.currentState);this.visitNodes(function(b){null!=b.parentNode&&(b=new mxRectangle(b.offsetLeft,b.offsetTop,b.offsetWidth,b.offsetHeight),null==a?a=b:a.add(b))});return a};
HoverIcons.prototype.getState=function(a){if(null!=a)if(a=a.cell,this.graph.getModel().contains(a)){if(this.graph.getModel().isVertex(a)&&!this.graph.isCellConnectable(a)){var b=this.graph.getModel().getParent(a);this.graph.getModel().isVertex(b)&&this.graph.isCellConnectable(b)&&(a=b)}if(this.graph.isCellLocked(a)||this.graph.model.isEdge(a))a=null;a=this.graph.view.getState(a);null!=a&&null==a.style&&(a=null)}else a=null;return a};
-HoverIcons.prototype.update=function(a,b,e){if(this.graph.connectionArrowsEnabled){var d=null;this.prev!=a||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=a,d=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=a&&(this.updateThread=window.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=a,this.update(a,b,e))}),this.updateDelay+10))):null!=this.startTime&&(d=(new Date).getTime()-this.startTime);
-this.setDisplay("");null!=this.currentState&&this.currentState!=a&&d<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,b,e)?this.reset(!1):(null!=this.currentState||d>this.activationDelay)&&this.currentState!=a&&(d>this.updateDelay&&null!=a||null==this.bbox||null==b||null==e||!mxUtils.contains(this.bbox,b,e))&&(null!=a&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(a),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=a&&this.graph.connectionHandler.constraintHandler.reset()):
+HoverIcons.prototype.update=function(a,b,e){if(this.graph.connectionArrowsEnabled){var c=null;this.prev!=a||this.isActive()?(this.startTime=(new Date).getTime(),this.prev=a,c=0,null!=this.updateThread&&window.clearTimeout(this.updateThread),null!=a&&(this.updateThread=window.setTimeout(mxUtils.bind(this,function(){this.isActive()||this.graph.isMouseDown||this.graph.panningHandler.isActive()||(this.prev=a,this.update(a,b,e))}),this.updateDelay+10))):null!=this.startTime&&(c=(new Date).getTime()-this.startTime);
+this.setDisplay("");null!=this.currentState&&this.currentState!=a&&c<this.activationDelay&&null!=this.bbox&&!mxUtils.contains(this.bbox,b,e)?this.reset(!1):(null!=this.currentState||c>this.activationDelay)&&this.currentState!=a&&(c>this.updateDelay&&null!=a||null==this.bbox||null==b||null==e||!mxUtils.contains(this.bbox,b,e))&&(null!=a&&this.graph.isEnabled()?(this.removeNodes(),this.setCurrentState(a),this.repaint(),this.graph.connectionHandler.constraintHandler.currentFocus!=a&&this.graph.connectionHandler.constraintHandler.reset()):
this.reset())}else this.reset()};HoverIcons.prototype.setCurrentState=function(a){"eastwest"!=a.style.portConstraint&&(this.graph.container.appendChild(this.arrowUp),this.graph.container.appendChild(this.arrowDown));this.graph.container.appendChild(this.arrowRight);this.graph.container.appendChild(this.arrowLeft);this.currentState=a};
-(function(){var a=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){a.apply(this,arguments);this.validEdges=[]};var b=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(a,d){var c=this.getState(a);null!=c&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&!c.invalid&&this.updateLineJumps(c)&&this.graph.cellRenderer.redraw(c,!1,this.isRendering());c=b.apply(this,arguments);null!=
-c&&this.graph.model.isEdge(c.cell)&&null!=c.style&&1!=c.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(c);return c};var e=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(a,b){return e.apply(this,arguments)||null!=a.routedPoints&&null!=b.routedPoints&&!mxUtils.equalPoints(b.routedPoints,a.routedPoints)};var d=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(a){d.apply(this,arguments);this.graph.model.isEdge(a.cell)&&
-1!=a.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var b=a.absolutePoints;if(Graph.lineJumpsEnabled){var c=null!=a.routedPoints,f=null;if(null!=b&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var d=function(c,b,d){var e=new mxPoint(b,d);e.type=c;f.push(e);e=null!=a.routedPoints?a.routedPoints[f.length-1]:null;return null==e||e.type!=c||e.x!=b||e.y!=d},e=.5*this.scale,c=!1,f=[],l=0;l<b.length-1;l++){for(var p=
-b[l+1],k=b[l],x=[],u=b[l+2];l<b.length-2&&mxUtils.ptSegDistSq(k.x,k.y,u.x,u.y,p.x,p.y)<1*this.scale*this.scale;)p=u,l++,u=b[l+2];for(var c=d(0,k.x,k.y)||c,t=0;t<this.validEdges.length;t++){var z=this.validEdges[t],m=z.absolutePoints;if(null!=m&&mxUtils.intersects(a,z)&&"1"!=z.style.noJump)for(z=0;z<m.length-1;z++){for(var r=m[z+1],C=m[z],u=m[z+2];z<m.length-2&&mxUtils.ptSegDistSq(C.x,C.y,u.x,u.y,r.x,r.y)<1*this.scale*this.scale;)r=u,z++,u=m[z+2];u=mxUtils.intersection(k.x,k.y,p.x,p.y,C.x,C.y,r.x,
-r.y);if(null!=u&&(Math.abs(u.x-C.x)>e||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;r<x.length;r++)if(x[r].distSq>u.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(z=0;z<x.length;z++)c=d(1,x[z].x,x[z].y)||c}u=b[b.length-1];c=d(0,u.x,u.y)||c}a.routedPoints=f;return c}return!1};var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,
-b,c){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)k.apply(this,arguments);else{var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,d=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),l,p=!0,y=null,x=null;l=[];var u=null;a.begin();for(var t=
-0;t<this.state.routedPoints.length;t++){var z=this.state.routedPoints[t],m=new mxPoint(z.x/this.scale,z.y/this.scale);0==t?m=b[0]:t==this.state.routedPoints.length-1&&(m=b[b.length-1]);var r=!1;if(null!=y&&1==z.type){var C=this.state.routedPoints[t+1],z=C.x/this.scale-m.x,C=C.y/this.scale-m.y,z=z*z+C*C;null==u&&(u=new mxPoint(m.x-y.x,m.y-y.y),x=Math.sqrt(u.x*u.x+u.y*u.y),u.x=u.x*d/x,u.y=u.y*d/x);z>d*d&&0<x&&(z=y.x-m.x,C=y.y-m.y,z=z*z+C*C,z>d*d&&(r=new mxPoint(m.x-u.x,m.y-u.y),z=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(z.x-u.y*l,z.y+u.x*l),a.lineTo(z.x,z.y)):"arc"==e?(l*=1.3,a.curveTo(r.x-u.y*l,r.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],r=!0))}else u=null;r||(l.push(m),y=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<a.length;e++){var g=this.graph.getConnectionPoint(b,a[e]);if(null!=g){var p=(g.x-d.x)*(g.x-d.x)+(g.y-d.y)*(g.y-d.y);if(null==
-f||p<f)c=g,f=p}}null!=c&&(d=c)}return d};var q=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(a,b,c){var f=q.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=c.state&&(f=c.state.view.graph.replacePlaceholders(c.state.cell,f));return f};var t=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(a){if(null!=a.style&&"undefined"!==typeof pako){var b=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=
-b&&"stencil("==b.substring(0,8))try{var c=b.substring(8,b.length-1),f=mxUtils.parseXml(Graph.decompress(c));return new mxShape(new mxStencil(f.documentElement))}catch(g){null!=window.console&&console.log("Error in shape: "+g)}}return t.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];
-mxStencilRegistry.getStencil=function(a){var b=mxStencilRegistry.stencils[a];if(null==b&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var e=mxStencilRegistry.getBasenameForStencil(a);if(null!=e){b=mxStencilRegistry.libraries[e];if(null!=b){if(null==mxStencilRegistry.packages[e]){for(var d=0;d<b.length;d++){var k=b[d];if(".xml"==k.toLowerCase().substring(k.length-4,k.length))mxStencilRegistry.loadStencilSet(k,null);else if(".js"==k.toLowerCase().substring(k.length-3,k.length))try{if(mxStencilRegistry.allowEval){var m=
+(function(){var a=mxGraphView.prototype.resetValidationState;mxGraphView.prototype.resetValidationState=function(){a.apply(this,arguments);this.validEdges=[]};var b=mxGraphView.prototype.validateCellState;mxGraphView.prototype.validateCellState=function(a,c){var d=this.getState(a);null!=d&&this.graph.model.isEdge(d.cell)&&null!=d.style&&1!=d.style[mxConstants.STYLE_CURVED]&&!d.invalid&&this.updateLineJumps(d)&&this.graph.cellRenderer.redraw(d,!1,this.isRendering());d=b.apply(this,arguments);null!=
+d&&this.graph.model.isEdge(d.cell)&&null!=d.style&&1!=d.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(d);return d};var e=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(a,b){return e.apply(this,arguments)||null!=a.routedPoints&&null!=b.routedPoints&&!mxUtils.equalPoints(b.routedPoints,a.routedPoints)};var c=mxGraphView.prototype.updateCellState;mxGraphView.prototype.updateCellState=function(a){c.apply(this,arguments);this.graph.model.isEdge(a.cell)&&
+1!=a.style[mxConstants.STYLE_CURVED]&&this.updateLineJumps(a)};mxGraphView.prototype.updateLineJumps=function(a){var b=a.absolutePoints;if(Graph.lineJumpsEnabled){var d=null!=a.routedPoints,f=null;if(null!=b&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var c=function(d,b,c){var e=new mxPoint(b,c);e.type=d;f.push(e);e=null!=a.routedPoints?a.routedPoints[f.length-1]:null;return null==e||e.type!=d||e.x!=b||e.y!=c},e=.5*this.scale,d=!1,f=[],l=0;l<b.length-1;l++){for(var p=
+b[l+1],k=b[l],x=[],u=b[l+2];l<b.length-2&&mxUtils.ptSegDistSq(k.x,k.y,u.x,u.y,p.x,p.y)<1*this.scale*this.scale;)p=u,l++,u=b[l+2];for(var d=c(0,k.x,k.y)||d,t=0;t<this.validEdges.length;t++){var z=this.validEdges[t],m=z.absolutePoints;if(null!=m&&mxUtils.intersects(a,z)&&"1"!=z.style.noJump)for(z=0;z<m.length-1;z++){for(var r=m[z+1],C=m[z],u=m[z+2];z<m.length-2&&mxUtils.ptSegDistSq(C.x,C.y,u.x,u.y,r.x,r.y)<1*this.scale*this.scale;)r=u,z++,u=m[z+2];u=mxUtils.intersection(k.x,k.y,p.x,p.y,C.x,C.y,r.x,
+r.y);if(null!=u&&(Math.abs(u.x-C.x)>e||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;r<x.length;r++)if(x[r].distSq>u.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(z=0;z<x.length;z++)d=c(1,x[z].x,x[z].y)||d}u=b[b.length-1];d=c(0,u.x,u.y)||d}a.routedPoints=f;return d}return!1};var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,
+b,d){this.routedPoints=null!=this.state?this.state.routedPoints:null;if(this.outline||null==this.state||null==this.style||null==this.state.routedPoints||0==this.state.routedPoints.length)k.apply(this,arguments);else{var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2,c=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,"jumpStyle","none"),l,p=!0,y=null,x=null;l=[];var u=null;a.begin();for(var t=
+0;t<this.state.routedPoints.length;t++){var z=this.state.routedPoints[t],m=new mxPoint(z.x/this.scale,z.y/this.scale);0==t?m=b[0]:t==this.state.routedPoints.length-1&&(m=b[b.length-1]);var r=!1;if(null!=y&&1==z.type){var C=this.state.routedPoints[t+1],z=C.x/this.scale-m.x,C=C.y/this.scale-m.y,z=z*z+C*C;null==u&&(u=new mxPoint(m.x-y.x,m.y-y.y),x=Math.sqrt(u.x*u.x+u.y*u.y),u.x=u.x*c/x,u.y=u.y*c/x);z>c*c&&0<x&&(z=y.x-m.x,C=y.y-m.y,z=z*z+C*C,z>c*c&&(r=new mxPoint(m.x-u.x,m.y-u.y),z=new mxPoint(m.x+u.x,
+m.y+u.y),l.push(r),this.addPoints(a,l,d,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(z.x-u.y*l,z.y+u.x*l),a.lineTo(z.x,z.y)):"arc"==e?(l*=1.3,a.curveTo(r.x-u.y*l,r.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],r=!0))}else u=null;r||(l.push(m),y=m)}this.addPoints(a,l,d,f,!1,null,p);a.stroke()}};var m=mxGraphView.prototype.updateFloatingTerminalPoint;mxGraphView.prototype.updateFloatingTerminalPoint=
+function(a,b,d,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 c=this.getNextPoint(a,d,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),c=mxUtils.getRotatedPoint(c,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);c=this.getPerimeterPoint(b,c,0==l&&e,k);0!=l&&(k=Math.cos(l),x=Math.sin(l),c=mxUtils.getRotatedPoint(c,k,x,p));a.setAbsoluteTerminalPoint(this.snapToAnchorPoint(a,b,d,f,c),f)}};mxGraphView.prototype.snapToAnchorPoint=function(a,b,d,f,c){if(null!=b&&null!=a){a=this.graph.getAllConnectionConstraints(b);f=d=null;if(null!=a)for(var e=0;e<a.length;e++){var g=this.graph.getConnectionPoint(b,a[e]);if(null!=g){var p=(g.x-c.x)*(g.x-c.x)+(g.y-c.y)*(g.y-c.y);if(null==
+f||p<f)d=g,f=p}}null!=d&&(c=d)}return c};var q=mxStencil.prototype.evaluateTextAttribute;mxStencil.prototype.evaluateTextAttribute=function(a,b,d){var f=q.apply(this,arguments);"1"==a.getAttribute("placeholders")&&null!=d.state&&(f=d.state.view.graph.replacePlaceholders(d.state.cell,f));return f};var t=mxCellRenderer.prototype.createShape;mxCellRenderer.prototype.createShape=function(a){if(null!=a.style&&"undefined"!==typeof pako){var b=mxUtils.getValue(a.style,mxConstants.STYLE_SHAPE,null);if(null!=
+b&&"stencil("==b.substring(0,8))try{var d=b.substring(8,b.length-1),f=mxUtils.parseXml(Graph.decompress(d));return new mxShape(new mxStencil(f.documentElement))}catch(g){null!=window.console&&console.log("Error in shape: "+g)}}return t.apply(this,arguments)}})();mxStencilRegistry.libraries={};mxStencilRegistry.dynamicLoading=!0;mxStencilRegistry.allowEval=!0;mxStencilRegistry.packages=[];
+mxStencilRegistry.getStencil=function(a){var b=mxStencilRegistry.stencils[a];if(null==b&&null==mxCellRenderer.defaultShapes[a]&&mxStencilRegistry.dynamicLoading){var e=mxStencilRegistry.getBasenameForStencil(a);if(null!=e){b=mxStencilRegistry.libraries[e];if(null!=b){if(null==mxStencilRegistry.packages[e]){for(var c=0;c<b.length;c++){var k=b[c];if(".xml"==k.toLowerCase().substring(k.length-4,k.length))mxStencilRegistry.loadStencilSet(k,null);else if(".js"==k.toLowerCase().substring(k.length-3,k.length))try{if(mxStencilRegistry.allowEval){var m=
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.length&&"mxgraph"==a[0]))for(var b=a[1],e=2;e<a.length-1;e++)b+="/"+a[e];return b};
-mxStencilRegistry.loadStencilSet=function(a,b,e,d){var k=mxStencilRegistry.packages[a];if(null!=e&&e||null==k){var m=!1;if(null==k)try{if(d){mxStencilRegistry.loadStencil(a,mxUtils.bind(this,function(d){null!=d&&null!=d.documentElement&&(mxStencilRegistry.packages[a]=d,m=!0,mxStencilRegistry.parseStencilSet(d.documentElement,b,m))}));return}k=mxStencilRegistry.loadStencil(a);mxStencilRegistry.packages[a]=k;m=!0}catch(q){null!=window.console&&console.log("error in loadStencilSet:",a,q)}null!=k&&null!=
+mxStencilRegistry.loadStencilSet=function(a,b,e,c){var k=mxStencilRegistry.packages[a];if(null!=e&&e||null==k){var m=!1;if(null==k)try{if(c){mxStencilRegistry.loadStencil(a,mxUtils.bind(this,function(c){null!=c&&null!=c.documentElement&&(mxStencilRegistry.packages[a]=c,m=!0,mxStencilRegistry.parseStencilSet(c.documentElement,b,m))}));return}k=mxStencilRegistry.loadStencil(a);mxStencilRegistry.packages[a]=k;m=!0}catch(q){null!=window.console&&console.log("error in loadStencilSet:",a,q)}null!=k&&null!=
k.documentElement&&mxStencilRegistry.parseStencilSet(k.documentElement,b,m)}};mxStencilRegistry.loadStencil=function(a,b){if(null!=b)mxUtils.get(a,mxUtils.bind(this,function(a){b(200<=a.getStatus()&&299>=a.getStatus()?a.getXml():null)}));else return mxUtils.load(a).getXml()};mxStencilRegistry.parseStencilSets=function(a){for(var b=0;b<a.length;b++)mxStencilRegistry.parseStencilSet(mxUtils.parseXml(a[b]).documentElement)};
-mxStencilRegistry.parseStencilSet=function(a,b,e){if("stencils"==a.nodeName)for(var d=a.firstChild;null!=d;)"shapes"==d.nodeName&&mxStencilRegistry.parseStencilSet(d,b,e),d=d.nextSibling;else{e=null!=e?e:!0;var d=a.firstChild,k="";a=a.getAttribute("name");for(null!=a&&(k=a+".");null!=d;){if(d.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=d.getAttribute("name"),null!=a)){var k=k.toLowerCase(),m=a.replace(/ /g,"_");e&&mxStencilRegistry.addStencil(k+m.toLowerCase(),new mxStencil(d));if(null!=b){var q=d.getAttribute("w"),
-t=d.getAttribute("h"),q=null==q?80:parseInt(q,10),t=null==t?80:parseInt(t,10);b(k,m,a,q,t)}}d=d.nextSibling}}};
+mxStencilRegistry.parseStencilSet=function(a,b,e){if("stencils"==a.nodeName)for(var c=a.firstChild;null!=c;)"shapes"==c.nodeName&&mxStencilRegistry.parseStencilSet(c,b,e),c=c.nextSibling;else{e=null!=e?e:!0;var c=a.firstChild,k="";a=a.getAttribute("name");for(null!=a&&(k=a+".");null!=c;){if(c.nodeType==mxConstants.NODETYPE_ELEMENT&&(a=c.getAttribute("name"),null!=a)){var k=k.toLowerCase(),m=a.replace(/ /g,"_");e&&mxStencilRegistry.addStencil(k+m.toLowerCase(),new mxStencil(c));if(null!=b){var q=c.getAttribute("w"),
+t=c.getAttribute("h"),q=null==q?80:parseInt(q,10),t=null==t?80:parseInt(t,10);b(k,m,a,q,t)}}c=c.nextSibling}}};
"undefined"!=typeof mxVertexHandler&&function(){function a(){var a=document.createElement("div");a.className="geHint";a.style.whiteSpace="nowrap";a.style.position="absolute";return a}mxConstants.HANDLE_FILLCOLOR="#29b6f2";mxConstants.HANDLE_STROKECOLOR="#0088cf";mxConstants.VERTEX_SELECTION_COLOR="#00a8ff";mxConstants.OUTLINE_COLOR="#00a8ff";mxConstants.OUTLINE_HANDLE_FILLCOLOR="#99ccff";mxConstants.OUTLINE_HANDLE_STROKECOLOR="#00a8ff";mxConstants.CONNECT_HANDLE_FILLCOLOR="#cee7ff";mxConstants.EDGE_SELECTION_COLOR=
"#00a8ff";mxConstants.DEFAULT_VALID_COLOR="#00a8ff";mxConstants.LABEL_HANDLE_FILLCOLOR="#cee7ff";mxConstants.GUIDE_COLOR="#0088cf";mxConstants.HIGHLIGHT_OPACITY=30;mxConstants.HIGHLIGHT_SIZE=5;mxEdgeHandler.prototype.snapToTerminals=!0;mxGraphHandler.prototype.guidesEnabled=!0;mxRubberband.prototype.fadeOut=!0;mxGuide.prototype.isEnabledForEvent=function(a){return!mxEvent.isAltDown(a)};var b=mxConnectionHandler.prototype.isCreateTarget;mxConnectionHandler.prototype.isCreateTarget=function(a){return mxEvent.isControlDown(a)||
b.apply(this,arguments)};mxConstraintHandler.prototype.createHighlightShape=function(){var a=new mxEllipse(null,this.highlightColor,this.highlightColor,0);a.opacity=mxConstants.HIGHLIGHT_OPACITY;return a};mxConnectionHandler.prototype.livePreview=!0;mxConnectionHandler.prototype.cursor="crosshair";mxConnectionHandler.prototype.createEdgeState=function(a){a=this.graph.createCurrentEdgeStyle();a=this.graph.createEdge(null,null,null,null,null,a);a=new mxCellState(this.graph.view,a,this.graph.getCellStyle(a));
-for(var c in this.graph.currentEdgeStyle)a.style[c]=this.graph.currentEdgeStyle[c];return a};var e=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var a=e.apply(this,arguments);a.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return a};mxConnectionHandler.prototype.updatePreview=function(a){};var d=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=d.apply(this,arguments),c=a.getCell;
-a.getCell=mxUtils.bind(this,function(a){var b=c.apply(this,arguments);this.error=null;return b});return a};mxConnectionHandler.prototype.isCellEnabled=function(a){return!this.graph.isCellLocked(a)};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){var a="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";";null!=this.currentEdgeStyle.shape&&
+for(var d in this.graph.currentEdgeStyle)a.style[d]=this.graph.currentEdgeStyle[d];return a};var e=mxConnectionHandler.prototype.createShape;mxConnectionHandler.prototype.createShape=function(){var a=e.apply(this,arguments);a.isDashed="1"==this.graph.currentEdgeStyle[mxConstants.STYLE_DASHED];return a};mxConnectionHandler.prototype.updatePreview=function(a){};var c=mxConnectionHandler.prototype.createMarker;mxConnectionHandler.prototype.createMarker=function(){var a=c.apply(this,arguments),d=a.getCell;
+a.getCell=mxUtils.bind(this,function(a){var b=d.apply(this,arguments);this.error=null;return b});return a};mxConnectionHandler.prototype.isCellEnabled=function(a){return!this.graph.isCellLocked(a)};Graph.prototype.defaultVertexStyle={};Graph.prototype.defaultEdgeStyle={edgeStyle:"orthogonalEdgeStyle",rounded:"0",jettySize:"auto",orthogonalLoop:"1"};Graph.prototype.createCurrentEdgeStyle=function(){var a="edgeStyle="+(this.currentEdgeStyle.edgeStyle||"none")+";";null!=this.currentEdgeStyle.shape&&
(a+="shape="+this.currentEdgeStyle.shape+";");null!=this.currentEdgeStyle.curved&&(a+="curved="+this.currentEdgeStyle.curved+";");null!=this.currentEdgeStyle.rounded&&(a+="rounded="+this.currentEdgeStyle.rounded+";");null!=this.currentEdgeStyle.comic&&(a+="comic="+this.currentEdgeStyle.comic+";");null!=this.currentEdgeStyle.jumpStyle&&(a+="jumpStyle="+this.currentEdgeStyle.jumpStyle+";");null!=this.currentEdgeStyle.jumpSize&&(a+="jumpSize="+this.currentEdgeStyle.jumpSize+";");null!=this.currentEdgeStyle.orthogonalLoop?
a+="orthogonalLoop="+this.currentEdgeStyle.orthogonalLoop+";":null!=Graph.prototype.defaultEdgeStyle.orthogonalLoop&&(a+="orthogonalLoop="+Graph.prototype.defaultEdgeStyle.orthogonalLoop+";");null!=this.currentEdgeStyle.jettySize?a+="jettySize="+this.currentEdgeStyle.jettySize+";":null!=Graph.prototype.defaultEdgeStyle.jettySize&&(a+="jettySize="+Graph.prototype.defaultEdgeStyle.jettySize+";");"elbowEdgeStyle"==this.currentEdgeStyle.edgeStyle&&null!=this.currentEdgeStyle.elbow&&(a+="elbow="+this.currentEdgeStyle.elbow+
-";");return a=null!=this.currentEdgeStyle.html?a+("html="+this.currentEdgeStyle.html+";"):a+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var a=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=a&&(new mxCodec(a.ownerDocument)).decode(a,this.getStylesheet())};Graph.prototype.importGraphModel=function(a,c,b,f){c=null!=c?
-c:0;b=null!=b?b:0;var d=new mxCodec(a.ownerDocument),e=new mxGraphModel;d.decode(a,e);a=[];d=e.getChildren(this.cloneCell(e.root,this.isCloneInvalidEdges()));if(null!=d){d=d.slice();this.model.beginUpdate();try{if(1!=d.length||this.isCellLocked(this.getDefaultParent()))for(e=0;e<d.length;e++)a=a.concat(this.model.getChildren(this.moveCells([d[e]],c,b,!1,this.model.getRoot())[0]));else a=this.moveCells(e.getChildren(d[0]),c,b,!1,this.getDefaultParent());if(f){this.isGridEnabled()&&(c=this.snap(c),
-b=this.snap(b));var g=this.getBoundingBoxFromGeometry(a,!0);null!=g&&this.moveCells(a,c-g.x,b-g.y)}}finally{this.model.endUpdate()}}return a};Graph.prototype.getAllConnectionConstraints=function(a,c){if(null!=a){var b=mxUtils.getValue(a.style,"points",null);if(null!=b){var f=[];try{for(var d=JSON.parse(b),b=0;b<d.length;b++){var e=d[b];f.push(new mxConnectionConstraint(new mxPoint(e[0],e[1]),2<e.length?"0"!=e[2]:!0,null,3<e.length?e[3]:0,4<e.length?e[4]:0))}}catch(K){}return f}if(null!=a.shape){e=
-a.shape.direction;d=a.shape.bounds;b=a.shape.scale;f=d.width/b;d=d.height/b;if(e==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH)e=f,f=d,d=e;b=a.shape.getConstraints(a.style,f,d);if(null!=b)return b;if(null!=a.shape.stencil&&null!=a.shape.stencil.constraints)return a.shape.stencil.constraints;if(null!=a.shape.constraints)return a.shape.constraints}}return null};Graph.prototype.flipEdge=function(a){if(null!=a){var c=this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);null!=c&&
-(c=mxUtils.getValue(c,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL,this.setCellStyles(mxConstants.STYLE_ELBOW,c,[a]))}};Graph.prototype.isValidRoot=function(a){for(var c=this.model.getChildCount(a),b=0,f=0;f<c;f++){var d=this.model.getChildAt(a,f);this.model.isVertex(d)&&(d=this.getCellGeometry(d),null==d||d.relative||b++)}return 0<b||this.isContainer(a)};Graph.prototype.isValidDropTarget=function(a){var c=
-this.view.getState(a),c=null!=c?c.style:this.getCellStyle(a);return"1"!=mxUtils.getValue(c,"part","0")&&(this.isContainer(a)||mxGraph.prototype.isValidDropTarget.apply(this,arguments)&&"0"!=mxUtils.getValue(c,"dropTarget","1"))};Graph.prototype.createGroupCell=function(){var a=mxGraph.prototype.createGroupCell.apply(this,arguments);a.setStyle("group");return a};Graph.prototype.isExtendParentsOnAdd=function(a){var c=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(c&&null!=a&&null!=
-this.layoutManager){var b=this.model.getParent(a);null!=b&&(b=this.layoutManager.getLayout(b),null!=b&&b.constructor==mxStackLayout&&(c=!1))}return c};Graph.prototype.getPreferredSizeForCell=function(a){var c=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=c&&(c.width+=10,c.height+=4,this.gridEnabled&&(c.width=this.snap(c.width),c.height=this.snap(c.height)));return c};Graph.prototype.turnShapes=function(a){var c=this.getModel(),b=[];c.beginUpdate();try{for(var f=0;f<a.length;f++){var d=
-a[f];if(c.isEdge(d)){var e=c.getTerminal(d,!0),g=c.getTerminal(d,!1);c.setTerminal(d,g,!0);c.setTerminal(d,e,!1);var l=c.getGeometry(d);if(null!=l){l=l.clone();null!=l.points&&l.points.reverse();var r=l.getTerminalPoint(!0),n=l.getTerminalPoint(!1);l.setTerminalPoint(r,!1);l.setTerminalPoint(n,!0);c.setGeometry(d,l);var p=this.view.getState(d),u=this.view.getState(e),J=this.view.getState(g);if(null!=p){var k=null!=u?this.getConnectionConstraint(p,u,!0):null,y=null!=J?this.getConnectionConstraint(p,
-J,!1):null;this.setConnectionConstraint(d,e,!0,y);this.setConnectionConstraint(d,g,!1,k)}b.push(d)}}else if(c.isVertex(d)&&(l=this.getCellGeometry(d),null!=l)){l=l.clone();l.x+=l.width/2-l.height/2;l.y+=l.height/2-l.width/2;var C=l.width;l.width=l.height;l.height=C;c.setGeometry(d,l);var x=this.view.getState(d);if(null!=x){var B=x.style[mxConstants.STYLE_DIRECTION]||"east";"east"==B?B="south":"south"==B?B="west":"west"==B?B="north":"north"==B&&(B="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,
-B,[d])}b.push(d)}}}finally{c.endUpdate()}return b};Graph.prototype.stencilHasPlaceholders=function(a){if(null!=a&&null!=a.fgNode)for(a=a.fgNode.firstChild;null!=a;){if("text"==a.nodeName&&"1"==a.getAttribute("placeholders"))return!0;a=a.nextSibling}return!1};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var c=this.model.getDescendants(a.cell);if(0<c.length)for(var b=
-0;b<c.length;b++){var f=this.view.getState(c[b]);null!=f&&null!=f.shape&&null!=f.shape.stencil&&this.stencilHasPlaceholders(f.shape.stencil)?this.removeStateForCell(c[b]):this.isReplacePlaceholders(c[b])&&this.view.invalidate(c[b],!1,!1)}}};Graph.prototype.replaceElement=function(a,c){for(var b=a.ownerDocument.createElement(null!=c?c:"span"),f=Array.prototype.slice.call(a.attributes);attr=f.pop();)b.setAttribute(attr.nodeName,attr.nodeValue);b.innerHTML=a.innerHTML;a.parentNode.replaceChild(b,a)};
-Graph.prototype.updateLabelElements=function(a,c,b){a=null!=a?a:this.getSelectionCells();for(var f=document.createElement("div"),d=0;d<a.length;d++)if(this.isHtmlLabel(a[d])){var e=this.convertValueToString(a[d]);if(null!=e&&0<e.length){f.innerHTML=e;for(var g=f.getElementsByTagName(null!=b?b:"*"),l=0;l<g.length;l++)c(g[l]);f.innerHTML!=e&&this.cellLabelChanged(a[d],f.innerHTML)}}};Graph.prototype.cellLabelChanged=function(a,c,b){c=Graph.zapGremlins(c);this.model.beginUpdate();try{if(null!=a.value&&
-"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var f=a.getAttribute("placeholder"),d=a;null!=d;){if(d==this.model.getRoot()||null!=d.value&&"object"==typeof d.value&&d.hasAttribute(f)){this.setAttributeForCell(d,f,c);break}d=this.model.getParent(d)}var e=a.value.cloneNode(!0);e.setAttribute("label",c);c=e}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var c=
-new mxDictionary,b=0;b<a.length;b++)c.put(a[b],!0);for(var f=[],b=0;b<a.length;b++){var d=this.model.getParent(a[b]);null==d||c.get(d)||(c.put(d,!0),f.push(d))}for(b=0;b<f.length;b++)if(d=this.view.getState(f[b]),null!=d&&(this.model.isEdge(d.cell)||this.model.isVertex(d.cell))&&this.isCellDeletable(d.cell)){var e=mxUtils.getValue(d.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(d.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(e==mxConstants.NONE&&g==mxConstants.NONE){e=
-!0;for(g=0;g<this.model.getChildCount(d.cell)&&e;g++)c.get(this.model.getChildAt(d.cell,g))||(e=!1);e&&a.push(d.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var c=[],b=0;b<a.length;b++)if(this.isCellDeletable(a[b])){var f=this.view.getState(a[b]);if(null!=f){var d=mxUtils.getValue(f.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),f=mxUtils.getValue(f.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);d==mxConstants.NONE&&
-f==mxConstants.NONE&&c.push(a[b])}}a=c;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,c){this.setAttributeForCell(a,"link",c)};Graph.prototype.setTooltipForCell=function(a,c){this.setAttributeForCell(a,"tooltip",c)};Graph.prototype.setAttributeForCell=function(a,c,b){var f;null!=a.value&&"object"==typeof a.value?f=a.value.cloneNode(!0):(f=mxUtils.createXmlDocument().createElement("UserObject"),f.setAttribute("label",a.value||""));null!=b&&
-0<b.length?f.setAttribute(c,b):f.removeAttribute(c);this.model.setValue(a,f)};Graph.prototype.getDropTarget=function(a,c,b,f){this.getModel();if(mxEvent.isAltDown(c))return null;for(var d=0;d<a.length;d++)if(this.model.isEdge(this.model.getParent(a[d])))return null;return mxGraph.prototype.getDropTarget.apply(this,arguments)};Graph.prototype.click=function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,
-c){if(this.isEnabled()){var b=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(c)){var f=this.model.isEdge(c)?this.view.getState(c):null,d=mxEvent.getSource(a);this.firstClickState!=f||this.firstClickSource!=d||null!=f&&null!=f.text&&null!=f.text.node&&(mxUtils.contains(f.text.boundingBox,b.x,b.y)||mxUtils.isAncestorNode(f.text.node,mxEvent.getSource(a)))||(null!=f||this.isCellLocked(this.getDefaultParent()))&&(null==f||this.isCellLocked(f.cell))||
-!(null!=f||mxClient.IS_VML&&d==this.view.getCanvas()||mxClient.IS_SVG&&d==this.view.getCanvas().ownerSVGElement)||(c=this.addText(b.x,b.y,f))}mxGraph.prototype.dblClick.call(this,a,c)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),c=this.container.scrollLeft/this.view.scale-this.view.translate.x,b=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible)var f=this.getPageLayout(),d=this.getPageSize(),c=Math.max(c,f.x*d.width),b=Math.max(b,f.y*d.height);
-return new mxPoint(this.snap(c+a),this.snap(b+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,c=this.getGraphBounds(),b=this.getInsertPoint(),f=this.snap(Math.round(Math.max(b.x,c.x/a.scale-a.translate.x+(0==c.width?2*this.gridSize:0)))),a=this.snap(Math.round(Math.max(b.y,(c.y+c.height)/a.scale-a.translate.y+2*this.gridSize)));return new mxPoint(f,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,c,b){var f=new mxCell;f.value="Text";
-f.style="text;html=1;resizable=0;points=[];";f.geometry=new mxGeometry(0,0,0,0);f.vertex=!0;if(null!=b){f.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";f.geometry.relative=!0;f.connectable=!1;var d=this.view.getRelativePoint(b,a,c);f.geometry.x=Math.round(1E4*d.x)/1E4;f.geometry.y=Math.round(d.y);f.geometry.offset=new mxPoint(0,0);var d=this.view.getPoint(b,f.geometry),e=this.view.scale;f.geometry.offset=new mxPoint(Math.round((a-d.x)/e),Math.round((c-d.y)/e))}else f.style+=
-"autosize=1;align=left;verticalAlign=top;spacingTop=-4;",d=this.view.translate,f.geometry.width=40,f.geometry.height=20,f.geometry.x=Math.round(a/this.view.scale)-d.x,f.geometry.y=Math.round(c/this.view.scale)-d.y;this.getModel().beginUpdate();try{this.addCells([f],null!=b?b.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[f])),this.autoSizeCell(f)}finally{this.getModel().endUpdate()}return f};Graph.prototype.addClickHandler=function(a,c,b){var f=mxUtils.bind(this,function(){var a=
-this.container.getElementsByTagName("a");if(null!=a)for(var b=0;b<a.length;b++){var f=this.getAbsoluteUrl(a[b].getAttribute("href"));null!=f&&(a[b].setAttribute("rel",this.linkRelation),a[b].setAttribute("href",f),null!=c&&mxEvent.addGestureListeners(a[b],null,null,c))}});this.model.addListener(mxEvent.CHANGE,f);f();var d=this.container.style.cursor,e=this.getTolerance(),g=this,l={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(g,a,4):null,startX:0,
-startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){var c=a.sourceState;if(null==c||null==g.getLinkForCell(c.cell))a=g.getCellAt(a.getGraphX(),a.getGraphY(),null,null,null,function(a,c,b){return null==g.getLinkForCell(a.cell)}),c=g.view.getState(a);c!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=c,null!=this.currentState&&this.activate(this.currentState))},mouseDown:function(a,c){this.startX=c.getGraphX();this.startY=c.getGraphY();this.scrollLeft=g.container.scrollLeft;
-this.scrollTop=g.container.scrollTop;null==this.currentLink&&"auto"==g.container.style.overflow&&(g.container.style.cursor="move");this.updateCurrentState(c)},mouseMove:function(a,c){if(g.isMouseDown){if(null!=this.currentLink){var b=Math.abs(this.startX-c.getGraphX()),f=Math.abs(this.startY-c.getGraphY());(b>e||f>e)&&this.clear()}}else{for(b=c.getSource();null!=b&&"a"!=b.nodeName.toLowerCase();)b=b.parentNode;null!=b?this.clear():(null!=g.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&
-g.tooltipHandler.reset(c,!0,this.currentState),(null==this.currentState||c.getState()!=this.currentState&&null!=c.sourceState||!g.intersects(this.currentState,c.getGraphX(),c.getGraphY()))&&this.updateCurrentState(c))}},mouseUp:function(a,f){for(var d=f.getSource(),l=f.getEvent();null!=d&&"a"!=d.nodeName.toLowerCase();)d=d.parentNode;null==d&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<e&&(null==f.sourceState||!f.isSource(f.sourceState.control))&&
-((mxEvent.isLeftMouseButton(l)||mxEvent.isMiddleMouseButton(l))&&!mxEvent.isPopupTrigger(l)||mxEvent.isTouchEvent(l))&&(null!=this.currentLink?(d=g.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&d||null==c||c(l,this.currentLink),mxEvent.isConsumed(l)||(l=mxEvent.isMiddleMouseButton(l)?"_blank":d?g.linkTarget:"_top",g.openLink(this.currentLink,l),f.consume())):null!=b&&!f.isConsumed()&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<
-e&&Math.abs(this.startX-f.getGraphX())<e&&Math.abs(this.startY-f.getGraphY())<e&&b(f.getEvent()));this.clear()},activate:function(a){this.currentLink=g.getAbsoluteUrl(g.getLinkForCell(a.cell));null!=this.currentLink&&(g.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(a))},clear:function(){null!=g.container&&(g.container.style.cursor=d);this.currentLink=this.currentState=null;null!=this.highlight&&this.highlight.hide();null!=g.tooltipHandler&&g.tooltipHandler.hide()}};
-g.click=function(a){};g.addMouseListener(l);mxEvent.addListener(document,"mouseleave",function(a){l.clear()})};Graph.prototype.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();c=null!=c?c:!0;a=this.model.getTopmostCells(a);var b=this.getModel(),f=this.gridSize,d=[];b.beginUpdate();try{for(var e=this.cloneCells(a,!1,null,!0),g=0;g<a.length;g++){var l=b.getParent(a[g]),r=this.moveCells([e[g]],f,f,!1)[0];d.push(r);if(c)b.add(l,e[g]);else{var n=l.getIndex(a[g]);b.add(l,e[g],n+1)}}}finally{b.endUpdate()}return d};
-Graph.prototype.insertImage=function(a,c,b){if(null!=a&&null!=this.cellEditor.textarea){for(var f=this.cellEditor.textarea.getElementsByTagName("img"),d=[],e=0;e<f.length;e++)d.push(f[e]);document.execCommand("insertimage",!1,a);a=this.cellEditor.textarea.getElementsByTagName("img");if(a.length==d.length+1)for(e=a.length-1;0<=e;e--)if(0==e||a[e]!=d[e-1]){a[e].setAttribute("width",c);a[e].setAttribute("height",b);break}}};Graph.prototype.insertLink=function(a){if(null!=this.cellEditor.textarea)if(0==
-a.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var c=this.cellEditor.textarea.getElementsByTagName("a"),b=[],f=0;f<c.length;f++)b.push(c[f]);document.execCommand("createlink",!1,mxUtils.trim(a));c=this.cellEditor.textarea.getElementsByTagName("a");if(c.length==b.length+1)for(f=c.length-1;0<=f;f--)if(c[f]!=b[f-1]){for(c=c[f].getElementsByTagName("a");0<c.length;){for(b=c[0].parentNode;null!=c[0].firstChild;)b.insertBefore(c[0].firstChild,c[0]);b.removeChild(c[0])}break}}else document.execCommand("createlink",
-!1,mxUtils.trim(a))};Graph.prototype.isCellResizable=function(a){var c=mxGraph.prototype.isCellResizable.apply(this,arguments),b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return c||"0"!=mxUtils.getValue(b,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==b[mxConstants.STYLE_WHITE_SPACE]};Graph.prototype.distributeCells=function(a,c){null==c&&(c=this.getSelectionCells());if(null!=c&&1<c.length){for(var b=[],f=null,d=null,e=0;e<c.length;e++)if(this.getModel().isVertex(c[e])){var g=this.view.getState(c[e]);
-if(null!=g){var l=a?g.getCenterX():g.getCenterY(),f=null!=f?Math.max(f,l):l,d=null!=d?Math.min(d,l):l;b.push(g)}}if(2<b.length){b.sort(function(c,b){return a?c.x-b.x:c.y-b.y});g=this.view.translate;l=this.view.scale;d=d/l-(a?g.x:g.y);f=f/l-(a?g.x:g.y);this.getModel().beginUpdate();try{for(var r=(f-d)/(b.length-1),f=d,e=1;e<b.length-1;e++){var n=this.view.getState(this.model.getParent(b[e].cell)),p=this.getCellGeometry(b[e].cell),f=f+r;null!=p&&null!=n&&(p=p.clone(),a?p.x=Math.round(f-p.width/2)-n.origin.x:
-p.y=Math.round(f-p.height/2)-n.origin.y,this.getModel().setGeometry(b[e].cell,p))}}finally{this.getModel().endUpdate()}}}return c};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.encodeCells=function(a){for(var c=this.cloneCells(a),b=new mxDictionary,f=0;f<a.length;f++)b.put(a[f],!0);for(f=0;f<c.length;f++){var d=this.view.getState(a[f]);if(null!=d){var e=this.getCellGeometry(c[f]);null==e||!e.relative||this.model.isEdge(a[f])||
-b.get(this.model.getParent(a[f]))||(e.relative=!1,e.x=d.x/d.view.scale-d.view.translate.x,e.y=d.y/d.view.scale-d.view.translate.y)}}b=new mxCodec;d=new mxGraphModel;e=d.getChildAt(d.getRoot(),0);for(f=0;f<a.length;f++)d.add(e,c[f]);return b.encode(d)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,c){return this.getLinkForCell(a.cell)});return a};Graph.prototype.getSvg=function(a,c,b,f,d,e,g,l,r,n){var p=this.useCssTransforms;
-p&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{c=null!=c?c:1;b=null!=b?b:0;d=null!=d?d:!0;e=null!=e?e:!0;g=null!=g?g:!0;var u=e||f?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==u)throw Error(mxResources.get("drawingEmpty"));var k=this.view.scale,y=mxUtils.createXmlDocument(),C=null!=y.createElementNS?y.createElementNS(mxConstants.NS_SVG,"svg"):y.createElement("svg");null!=a&&(null!=C.style?C.style.backgroundColor=a:C.setAttribute("style",
-"background-color:"+a));null==y.createElementNS?(C.setAttribute("xmlns",mxConstants.NS_SVG),C.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):C.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=c/k;var x=Math.max(1,Math.ceil(u.width*a)+2*b)+(n?5:0),B=Math.max(1,Math.ceil(u.height*a)+2*b)+(n?5:0);C.setAttribute("version","1.1");C.setAttribute("width",x+"px");C.setAttribute("height",B+"px");C.setAttribute("viewBox",(d?"-0.5 -0.5":"0 0")+" "+x+" "+B);y.appendChild(C);
-var z=null!=y.createElementNS?y.createElementNS(mxConstants.NS_SVG,"g"):y.createElement("g");C.appendChild(z);var m=this.createSvgCanvas(z);m.foOffset=d?-.5:0;m.textOffset=d?-.5:0;m.imageOffset=d?-.5:0;m.translate(Math.floor((b/c-u.x)/k),Math.floor((b/c-u.y)/k));var t=document.createElement("textarea"),H=m.createAlternateContent;m.createAlternateContent=function(a,c,b,f,d,e,g,l,r,n,p,u,k){var y=this.state;if(null!=this.foAltText&&(0==f||0!=y.fontSize&&e.length<5*f/y.fontSize)){var C=this.createElement("text");
-C.setAttribute("x",Math.round(f/2));C.setAttribute("y",Math.round((d+y.fontSize)/2));C.setAttribute("fill",y.fontColor||"black");C.setAttribute("text-anchor","middle");C.setAttribute("font-size",Math.round(y.fontSize)+"px");C.setAttribute("font-family",y.fontFamily);(y.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&C.setAttribute("font-weight","bold");(y.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&C.setAttribute("font-style","italic");(y.fontStyle&mxConstants.FONT_UNDERLINE)==
-mxConstants.FONT_UNDERLINE&&C.setAttribute("text-decoration","underline");try{return t.innerHTML=e,C.textContent=t.value,C}catch(oa){return H.apply(this,arguments)}}else return H.apply(this,arguments)};var J=this.backgroundImage;if(null!=J){c=k/c;var q=this.view.translate,G=new mxRectangle(q.x*c,q.y*c,J.width*c,J.height*c);mxUtils.intersects(u,G)&&m.image(q.x,q.y,J.width,J.height,J.src,!0)}m.scale(a);m.textEnabled=g;l=null!=l?l:this.createSvgImageExport();var I=l.drawCellState;l.drawCellState=function(a,
-c){for(var b=a.view.graph,f=b.isCellSelected(a.cell),d=b.model.getParent(a.cell);!e&&!f&&null!=d;)f=b.isCellSelected(d),d=b.model.getParent(d);(e||f)&&I.apply(this,arguments)};l.drawState(this.getView().getState(this.model.root),m);this.updateSvgLinks(C,r,!0);return C}finally{p&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.updateSvgLinks=function(a,c,b){a=a.getElementsByTagName("a");for(var f=0;f<a.length;f++){var d=a[f].getAttribute("href");null==d&&(d=
-a[f].getAttribute("xlink:href"));null!=d&&(null!=c&&/^https?:\/\//.test(d)?a[f].setAttribute("target",c):b&&this.isCustomLink(d)&&a[f].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(a){return new mxSvgCanvas2D(a)};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var c=window.getSelection();c.getRangeAt&&c.rangeCount&&(a=c.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());
-return a};Graph.prototype.getParentByName=function(a,c,b){for(;null!=a&&a.nodeName!=c;){if(a==b)return null;a=a.parentNode}return a};Graph.prototype.selectNode=function(a){var c=null;if(window.getSelection){if(c=window.getSelection(),c.getRangeAt&&c.rangeCount){var b=document.createRange();b.selectNode(a);c.removeAllRanges();c.addRange(b)}}else(c=document.selection)&&"Control"!=c.type&&(a=c.createRange(),a.collapse(!0),b=c.createRange(),b.setEndPoint("StartToStart",a),b.select())};Graph.prototype.insertRow=
-function(a,c){for(var b=a.tBodies[0],f=b.rows[0].cells,d=0,e=0;e<f.length;e++)var g=f[e].getAttribute("colspan"),d=d+(null!=g?parseInt(g):1);b=b.insertRow(c);for(e=0;e<d;e++)mxUtils.br(b.insertCell(-1));return b.cells[0]};Graph.prototype.deleteRow=function(a,c){a.tBodies[0].deleteRow(c)};Graph.prototype.insertColumn=function(a,c){var b=a.tHead;if(null!=b)for(var f=0;f<b.rows.length;f++){var d=document.createElement("th");b.rows[f].appendChild(d);mxUtils.br(d)}b=a.tBodies[0];for(f=0;f<b.rows.length;f++)d=
-b.rows[f].insertCell(c),mxUtils.br(d);return b.rows[0].cells[0<=c?c:b.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(a,c){if(0<=c)for(var b=a.tBodies[0].rows,f=0;f<b.length;f++)b[f].cells.length>c&&b[f].deleteCell(c)};Graph.prototype.pasteHtmlAtCaret=function(a){var c;if(window.getSelection){if(c=window.getSelection(),c.getRangeAt&&c.rangeCount){c=c.getRangeAt(0);c.deleteContents();var b=document.createElement("div");b.innerHTML=a;a=document.createDocumentFragment();for(var f;f=b.firstChild;)lastNode=
-a.appendChild(f);c.insertNode(a)}}else(c=document.selection)&&"Control"!=c.type&&c.createRange().pasteHTML(a)};Graph.prototype.createLinkForHint=function(a,c){function b(a,c){a.length>c&&(a=a.substring(0,Math.round(c/2))+"..."+a.substring(a.length-Math.round(c/4)));return a}a=null!=a?a:"javascript:void(0);";if(null==c||0==c.length)c=this.isCustomLink(a)?this.getLinkTitle(a):a;var f=document.createElement("a");f.setAttribute("rel",this.linkRelation);f.setAttribute("href",this.getAbsoluteUrl(a));f.setAttribute("title",
-b(this.isCustomLink(a)?this.getLinkTitle(a):a,80));null!=this.linkTarget&&f.setAttribute("target",this.linkTarget);mxUtils.write(f,b(c,40));this.isCustomLink(a)&&mxEvent.addListener(f,"click",mxUtils.bind(this,function(c){this.customLinkClicked(a);mxEvent.consume(c)}));return f};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,c){this.popupMenuHandler.hideMenu()});
-var a=this.updateMouseEvent;this.updateMouseEvent=function(c){c=a.apply(this,arguments);if(mxEvent.isTouchEvent(c.getEvent())&&null==c.getState()){var b=this.getCellAt(c.graphX,c.graphY);null!=b&&this.isSwimlane(b)&&this.hitsSwimlaneContent(b,c.graphX,c.graphY)||(c.state=this.view.getState(b),null!=c.state&&null!=c.state.shape&&(this.container.style.cursor=c.state.shape.node.style.cursor))}null==c.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return c};var c=!1,b=!1,f=!1,d=
-this.fireMouseEvent;this.fireMouseEvent=function(a,e,g){a==mxEvent.MOUSE_DOWN&&(e=this.updateMouseEvent(e),c=this.isCellSelected(e.getCell()),b=this.isSelectionEmpty(),f=this.popupMenuHandler.isMenuShowing());d.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(a,d){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==d.getState()||!d.isSource(d.getState().control))&&(this.popupMenuHandler.popupTrigger||!f&&!mxEvent.isMouseEvent(d.getEvent())&&
-(b&&null==d.getCell()&&this.isSelectionEmpty()||c&&this.isCellSelected(d.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell);return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var a=window.getSelection();if(a.getRangeAt&&a.rangeCount){for(var c=[],b=0,f=a.rangeCount;b<f;++b)c.push(a.getRangeAt(b));return c}}else if(document.selection&&
-document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(a){try{if(a)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var c=0,b=a.length;c<b;++c)sel.addRange(a[c])}else document.selection&&a.select&&a.select()}catch(ea){}};var k=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(a){null!=a.text&&(a.text.replaceLinefeeds="0"!=mxUtils.getValue(a.style,"nl2Br",
-"1"));k.apply(this,arguments)};var m=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(a,c){this.isKeepFocusEvent(a)||!mxEvent.isAltDown(a.getEvent())?m.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var q=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(a,c){q.apply(this,
-arguments);var b=this.graph.view.getState(a);this.textarea.className=null!=b&&1==b.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(a);var b=this.graph.getModel().getParent(a),f=this.graph.getCellGeometry(a);this.graph.getModel().isEdge(b)&&null!=f&&f.relative||this.graph.getModel().isEdge(a)?mxClient.IS_QUIRKS?this.textarea.style.border="gray dotted 1px":this.textarea.style.outline=mxClient.IS_IE||
-mxClient.IS_IE11||mxClient.IS_FF&&mxClient.IS_WIN?"gray dotted 1px":"":mxClient.IS_QUIRKS&&(this.textarea.style.outline="none",this.textarea.style.border="")};var t=mxCellEditor.prototype.installListeners;mxCellEditor.prototype.installListeners=function(a){function c(a,b){b.originalNode=a;a=a.firstChild;for(var f=b.firstChild;null!=a&&null!=f;)c(a,f),a=a.nextSibling,f=f.nextSibling;return b}function b(a,c){if(null!=a)if(c.originalNode!=a)f(a);else for(a=a.firstChild,c=c.firstChild;null!=a;){var d=
-a.nextSibling;null==c?f(a):(b(a,c),c=c.nextSibling);a=d}}function f(a){for(var c=a.firstChild;null!=c;){var b=c.nextSibling;f(c);c=b}1==a.nodeType&&("BR"===a.nodeName||null!=a.firstChild)||3==a.nodeType&&0!=mxUtils.trim(mxUtils.getTextContent(a)).length?(3==a.nodeType&&mxUtils.setTextContent(a,mxUtils.getTextContent(a).replace(/\n|\r/g,"")),1==a.nodeType&&(a.removeAttribute("style"),a.removeAttribute("class"),a.removeAttribute("width"),a.removeAttribute("cellpadding"),a.removeAttribute("cellspacing"),
-a.removeAttribute("border"))):a.parentNode.removeChild(a)}t.apply(this,arguments);mxClient.IS_QUIRKS||7===document.documentMode||8===document.documentMode||mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(a){var f=c(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){b(this.textarea,f)}),0)}))};mxCellEditor.prototype.toggleViewMode=function(){var a=this.graph.view.getState(this.editingCell);if(null!=a){var c=null!=a&&"0"!=mxUtils.getValue(a.style,
-"nl2Br","1"),b=this.saveSelection();if(this.codeViewMode){l=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<l.length&&"\n"==l.charAt(l.length-1)&&(l=l.substring(0,l.length-1));l=this.graph.sanitizeHtml(c?l.replace(/\n/g,"<br/>"):l,!0);this.textarea.className="mxCellEditor geContentEditable";var f=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),d=mxUtils.getValue(a.style,
-mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),e=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,g=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,a=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;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=a?"underline":"";this.textarea.style.fontWeight=e?"bold":"normal";this.textarea.style.fontStyle=g?"italic":"";this.textarea.style.fontFamily=c;this.textarea.style.textAlign=d;this.textarea.style.padding="0px";this.textarea.innerHTML!=l&&(this.textarea.innerHTML=l,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));this.codeViewMode=
-!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerHTML="");var l=mxUtils.htmlEntities(this.textarea.innerHTML);mxClient.IS_QUIRKS||8==document.documentMode||(l=mxUtils.replaceTrailingNewlines(l,"<div><br></div>"));l=this.graph.sanitizeHtml(c?l.replace(/\n/g,"").replace(/&lt;br\s*.?&gt;/g,"<br>"):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 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<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/b)+(this.textarea.offsetHeight-
+";");return a=null!=this.currentEdgeStyle.html?a+("html="+this.currentEdgeStyle.html+";"):a+"html=1;"};Graph.prototype.getPagePadding=function(){return new mxPoint(0,0)};Graph.prototype.loadStylesheet=function(){var a=null!=this.themes?this.themes[this.defaultThemeName]:mxStyleRegistry.dynamicLoading?mxUtils.load(STYLE_PATH+"/default.xml").getDocumentElement():null;null!=a&&(new mxCodec(a.ownerDocument)).decode(a,this.getStylesheet())};Graph.prototype.importGraphModel=function(a,d,b,f){d=null!=d?
+d:0;b=null!=b?b:0;var c=new mxCodec(a.ownerDocument),e=new mxGraphModel;c.decode(a,e);a=[];c=e.getChildren(this.cloneCell(e.root,this.isCloneInvalidEdges()));if(null!=c){c=c.slice();this.model.beginUpdate();try{if(1!=c.length||this.isCellLocked(this.getDefaultParent()))for(e=0;e<c.length;e++)a=a.concat(this.model.getChildren(this.moveCells([c[e]],d,b,!1,this.model.getRoot())[0]));else a=this.moveCells(e.getChildren(c[0]),d,b,!1,this.getDefaultParent());if(f){this.isGridEnabled()&&(d=this.snap(d),
+b=this.snap(b));var g=this.getBoundingBoxFromGeometry(a,!0);null!=g&&this.moveCells(a,d-g.x,b-g.y)}}finally{this.model.endUpdate()}}return a};Graph.prototype.getAllConnectionConstraints=function(a,d){if(null!=a){var b=mxUtils.getValue(a.style,"points",null);if(null!=b){var f=[];try{for(var c=JSON.parse(b),b=0;b<c.length;b++){var e=c[b];f.push(new mxConnectionConstraint(new mxPoint(e[0],e[1]),2<e.length?"0"!=e[2]:!0,null,3<e.length?e[3]:0,4<e.length?e[4]:0))}}catch(K){}return f}if(null!=a.shape){e=
+a.shape.direction;c=a.shape.bounds;b=a.shape.scale;f=c.width/b;c=c.height/b;if(e==mxConstants.DIRECTION_NORTH||e==mxConstants.DIRECTION_SOUTH)e=f,f=c,c=e;b=a.shape.getConstraints(a.style,f,c);if(null!=b)return b;if(null!=a.shape.stencil&&null!=a.shape.stencil.constraints)return a.shape.stencil.constraints;if(null!=a.shape.constraints)return a.shape.constraints}}return null};Graph.prototype.flipEdge=function(a){if(null!=a){var d=this.view.getState(a),d=null!=d?d.style:this.getCellStyle(a);null!=d&&
+(d=mxUtils.getValue(d,mxConstants.STYLE_ELBOW,mxConstants.ELBOW_HORIZONTAL)==mxConstants.ELBOW_HORIZONTAL?mxConstants.ELBOW_VERTICAL:mxConstants.ELBOW_HORIZONTAL,this.setCellStyles(mxConstants.STYLE_ELBOW,d,[a]))}};Graph.prototype.isValidRoot=function(a){for(var d=this.model.getChildCount(a),b=0,f=0;f<d;f++){var c=this.model.getChildAt(a,f);this.model.isVertex(c)&&(c=this.getCellGeometry(c),null==c||c.relative||b++)}return 0<b||this.isContainer(a)};Graph.prototype.isValidDropTarget=function(a){var d=
+this.view.getState(a),d=null!=d?d.style:this.getCellStyle(a);return"1"!=mxUtils.getValue(d,"part","0")&&(this.isContainer(a)||mxGraph.prototype.isValidDropTarget.apply(this,arguments)&&"0"!=mxUtils.getValue(d,"dropTarget","1"))};Graph.prototype.createGroupCell=function(){var a=mxGraph.prototype.createGroupCell.apply(this,arguments);a.setStyle("group");return a};Graph.prototype.isExtendParentsOnAdd=function(a){var d=mxGraph.prototype.isExtendParentsOnAdd.apply(this,arguments);if(d&&null!=a&&null!=
+this.layoutManager){var b=this.model.getParent(a);null!=b&&(b=this.layoutManager.getLayout(b),null!=b&&b.constructor==mxStackLayout&&(d=!1))}return d};Graph.prototype.getPreferredSizeForCell=function(a){var d=mxGraph.prototype.getPreferredSizeForCell.apply(this,arguments);null!=d&&(d.width+=10,d.height+=4,this.gridEnabled&&(d.width=this.snap(d.width),d.height=this.snap(d.height)));return d};Graph.prototype.turnShapes=function(a){var d=this.getModel(),b=[];d.beginUpdate();try{for(var f=0;f<a.length;f++){var c=
+a[f];if(d.isEdge(c)){var e=d.getTerminal(c,!0),g=d.getTerminal(c,!1);d.setTerminal(c,g,!0);d.setTerminal(c,e,!1);var l=d.getGeometry(c);if(null!=l){l=l.clone();null!=l.points&&l.points.reverse();var r=l.getTerminalPoint(!0),n=l.getTerminalPoint(!1);l.setTerminalPoint(r,!1);l.setTerminalPoint(n,!0);d.setGeometry(c,l);var p=this.view.getState(c),u=this.view.getState(e),J=this.view.getState(g);if(null!=p){var k=null!=u?this.getConnectionConstraint(p,u,!0):null,y=null!=J?this.getConnectionConstraint(p,
+J,!1):null;this.setConnectionConstraint(c,e,!0,y);this.setConnectionConstraint(c,g,!1,k)}b.push(c)}}else if(d.isVertex(c)&&(l=this.getCellGeometry(c),null!=l)){l=l.clone();l.x+=l.width/2-l.height/2;l.y+=l.height/2-l.width/2;var C=l.width;l.width=l.height;l.height=C;d.setGeometry(c,l);var x=this.view.getState(c);if(null!=x){var B=x.style[mxConstants.STYLE_DIRECTION]||"east";"east"==B?B="south":"south"==B?B="west":"west"==B?B="north":"north"==B&&(B="east");this.setCellStyles(mxConstants.STYLE_DIRECTION,
+B,[c])}b.push(c)}}}finally{d.endUpdate()}return b};Graph.prototype.stencilHasPlaceholders=function(a){if(null!=a&&null!=a.fgNode)for(a=a.fgNode.firstChild;null!=a;){if("text"==a.nodeName&&"1"==a.getAttribute("placeholders"))return!0;a=a.nextSibling}return!1};Graph.prototype.processChange=function(a){mxGraph.prototype.processChange.apply(this,arguments);if(a instanceof mxValueChange&&null!=a.cell&&null!=a.cell.value&&"object"==typeof a.cell.value){var d=this.model.getDescendants(a.cell);if(0<d.length)for(var b=
+0;b<d.length;b++){var f=this.view.getState(d[b]);null!=f&&null!=f.shape&&null!=f.shape.stencil&&this.stencilHasPlaceholders(f.shape.stencil)?this.removeStateForCell(d[b]):this.isReplacePlaceholders(d[b])&&this.view.invalidate(d[b],!1,!1)}}};Graph.prototype.replaceElement=function(a,d){for(var b=a.ownerDocument.createElement(null!=d?d:"span"),f=Array.prototype.slice.call(a.attributes);attr=f.pop();)b.setAttribute(attr.nodeName,attr.nodeValue);b.innerHTML=a.innerHTML;a.parentNode.replaceChild(b,a)};
+Graph.prototype.updateLabelElements=function(a,d,b){a=null!=a?a:this.getSelectionCells();for(var f=document.createElement("div"),c=0;c<a.length;c++)if(this.isHtmlLabel(a[c])){var e=this.convertValueToString(a[c]);if(null!=e&&0<e.length){f.innerHTML=e;for(var g=f.getElementsByTagName(null!=b?b:"*"),l=0;l<g.length;l++)d(g[l]);f.innerHTML!=e&&this.cellLabelChanged(a[c],f.innerHTML)}}};Graph.prototype.cellLabelChanged=function(a,d,b){d=Graph.zapGremlins(d);this.model.beginUpdate();try{if(null!=a.value&&
+"object"==typeof a.value){if(this.isReplacePlaceholders(a)&&null!=a.getAttribute("placeholder"))for(var f=a.getAttribute("placeholder"),c=a;null!=c;){if(c==this.model.getRoot()||null!=c.value&&"object"==typeof c.value&&c.hasAttribute(f)){this.setAttributeForCell(c,f,d);break}c=this.model.getParent(c)}var e=a.value.cloneNode(!0);e.setAttribute("label",d);d=e}mxGraph.prototype.cellLabelChanged.apply(this,arguments)}finally{this.model.endUpdate()}};Graph.prototype.cellsRemoved=function(a){if(null!=a){for(var d=
+new mxDictionary,b=0;b<a.length;b++)d.put(a[b],!0);for(var f=[],b=0;b<a.length;b++){var c=this.model.getParent(a[b]);null==c||d.get(c)||(d.put(c,!0),f.push(c))}for(b=0;b<f.length;b++)if(c=this.view.getState(f[b]),null!=c&&(this.model.isEdge(c.cell)||this.model.isVertex(c.cell))&&this.isCellDeletable(c.cell)){var e=mxUtils.getValue(c.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),g=mxUtils.getValue(c.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);if(e==mxConstants.NONE&&g==mxConstants.NONE){e=
+!0;for(g=0;g<this.model.getChildCount(c.cell)&&e;g++)d.get(this.model.getChildAt(c.cell,g))||(e=!1);e&&a.push(c.cell)}}}mxGraph.prototype.cellsRemoved.apply(this,arguments)};Graph.prototype.removeCellsAfterUngroup=function(a){for(var d=[],b=0;b<a.length;b++)if(this.isCellDeletable(a[b])){var c=this.view.getState(a[b]);if(null!=c){var f=mxUtils.getValue(c.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),c=mxUtils.getValue(c.style,mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);f==mxConstants.NONE&&
+c==mxConstants.NONE&&d.push(a[b])}}a=d;mxGraph.prototype.removeCellsAfterUngroup.apply(this,arguments)};Graph.prototype.setLinkForCell=function(a,d){this.setAttributeForCell(a,"link",d)};Graph.prototype.setTooltipForCell=function(a,d){this.setAttributeForCell(a,"tooltip",d)};Graph.prototype.setAttributeForCell=function(a,d,b){var c;null!=a.value&&"object"==typeof a.value?c=a.value.cloneNode(!0):(c=mxUtils.createXmlDocument().createElement("UserObject"),c.setAttribute("label",a.value||""));null!=b&&
+0<b.length?c.setAttribute(d,b):c.removeAttribute(d);this.model.setValue(a,c)};Graph.prototype.getDropTarget=function(a,d,b,c){this.getModel();if(mxEvent.isAltDown(d))return null;for(var f=0;f<a.length;f++)if(this.model.isEdge(this.model.getParent(a[f])))return null;return mxGraph.prototype.getDropTarget.apply(this,arguments)};Graph.prototype.click=function(a){mxGraph.prototype.click.call(this,a);this.firstClickState=a.getState();this.firstClickSource=a.getSource()};Graph.prototype.dblClick=function(a,
+d){if(this.isEnabled()){var b=mxUtils.convertPoint(this.container,mxEvent.getClientX(a),mxEvent.getClientY(a));if(null!=a&&!this.model.isVertex(d)){var c=this.model.isEdge(d)?this.view.getState(d):null,f=mxEvent.getSource(a);this.firstClickState!=c||this.firstClickSource!=f||null!=c&&null!=c.text&&null!=c.text.node&&(mxUtils.contains(c.text.boundingBox,b.x,b.y)||mxUtils.isAncestorNode(c.text.node,mxEvent.getSource(a)))||(null!=c||this.isCellLocked(this.getDefaultParent()))&&(null==c||this.isCellLocked(c.cell))||
+!(null!=c||mxClient.IS_VML&&f==this.view.getCanvas()||mxClient.IS_SVG&&f==this.view.getCanvas().ownerSVGElement)||(d=this.addText(b.x,b.y,c))}mxGraph.prototype.dblClick.call(this,a,d)}};Graph.prototype.getInsertPoint=function(){var a=this.getGridSize(),d=this.container.scrollLeft/this.view.scale-this.view.translate.x,b=this.container.scrollTop/this.view.scale-this.view.translate.y;if(this.pageVisible)var c=this.getPageLayout(),f=this.getPageSize(),d=Math.max(d,c.x*f.width),b=Math.max(b,c.y*f.height);
+return new mxPoint(this.snap(d+a),this.snap(b+a))};Graph.prototype.getFreeInsertPoint=function(){var a=this.view,d=this.getGraphBounds(),b=this.getInsertPoint(),c=this.snap(Math.round(Math.max(b.x,d.x/a.scale-a.translate.x+(0==d.width?2*this.gridSize:0)))),a=this.snap(Math.round(Math.max(b.y,(d.y+d.height)/a.scale-a.translate.y+2*this.gridSize)));return new mxPoint(c,a)};Graph.prototype.isMouseInsertPoint=function(){return!1};Graph.prototype.addText=function(a,d,b){var c=new mxCell;c.value="Text";
+c.style="text;html=1;resizable=0;points=[];";c.geometry=new mxGeometry(0,0,0,0);c.vertex=!0;if(null!=b){c.style+="align=center;verticalAlign=middle;labelBackgroundColor=#ffffff;";c.geometry.relative=!0;c.connectable=!1;var f=this.view.getRelativePoint(b,a,d);c.geometry.x=Math.round(1E4*f.x)/1E4;c.geometry.y=Math.round(f.y);c.geometry.offset=new mxPoint(0,0);var f=this.view.getPoint(b,c.geometry),e=this.view.scale;c.geometry.offset=new mxPoint(Math.round((a-f.x)/e),Math.round((d-f.y)/e))}else c.style+=
+"autosize=1;align=left;verticalAlign=top;spacingTop=-4;",f=this.view.translate,c.geometry.width=40,c.geometry.height=20,c.geometry.x=Math.round(a/this.view.scale)-f.x,c.geometry.y=Math.round(d/this.view.scale)-f.y;this.getModel().beginUpdate();try{this.addCells([c],null!=b?b.cell:null),this.fireEvent(new mxEventObject("textInserted","cells",[c])),this.autoSizeCell(c)}finally{this.getModel().endUpdate()}return c};Graph.prototype.addClickHandler=function(a,d,b){var c=mxUtils.bind(this,function(){var a=
+this.container.getElementsByTagName("a");if(null!=a)for(var b=0;b<a.length;b++){var c=this.getAbsoluteUrl(a[b].getAttribute("href"));null!=c&&(a[b].setAttribute("rel",this.linkRelation),a[b].setAttribute("href",c),null!=d&&mxEvent.addGestureListeners(a[b],null,null,d))}});this.model.addListener(mxEvent.CHANGE,c);c();var f=this.container.style.cursor,e=this.getTolerance(),g=this,l={currentState:null,currentLink:null,highlight:null!=a&&""!=a&&a!=mxConstants.NONE?new mxCellHighlight(g,a,4):null,startX:0,
+startY:0,scrollLeft:0,scrollTop:0,updateCurrentState:function(a){var d=a.sourceState;if(null==d||null==g.getLinkForCell(d.cell))a=g.getCellAt(a.getGraphX(),a.getGraphY(),null,null,null,function(a,d,b){return null==g.getLinkForCell(a.cell)}),d=g.view.getState(a);d!=this.currentState&&(null!=this.currentState&&this.clear(),this.currentState=d,null!=this.currentState&&this.activate(this.currentState))},mouseDown:function(a,d){this.startX=d.getGraphX();this.startY=d.getGraphY();this.scrollLeft=g.container.scrollLeft;
+this.scrollTop=g.container.scrollTop;null==this.currentLink&&"auto"==g.container.style.overflow&&(g.container.style.cursor="move");this.updateCurrentState(d)},mouseMove:function(a,d){if(g.isMouseDown){if(null!=this.currentLink){var b=Math.abs(this.startX-d.getGraphX()),c=Math.abs(this.startY-d.getGraphY());(b>e||c>e)&&this.clear()}}else{for(b=d.getSource();null!=b&&"a"!=b.nodeName.toLowerCase();)b=b.parentNode;null!=b?this.clear():(null!=g.tooltipHandler&&null!=this.currentLink&&null!=this.currentState&&
+g.tooltipHandler.reset(d,!0,this.currentState),(null==this.currentState||d.getState()!=this.currentState&&null!=d.sourceState||!g.intersects(this.currentState,d.getGraphX(),d.getGraphY()))&&this.updateCurrentState(d))}},mouseUp:function(a,c){for(var f=c.getSource(),l=c.getEvent();null!=f&&"a"!=f.nodeName.toLowerCase();)f=f.parentNode;null==f&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<e&&(null==c.sourceState||!c.isSource(c.sourceState.control))&&
+((mxEvent.isLeftMouseButton(l)||mxEvent.isMiddleMouseButton(l))&&!mxEvent.isPopupTrigger(l)||mxEvent.isTouchEvent(l))&&(null!=this.currentLink?(f=g.isBlankLink(this.currentLink),"data:"!==this.currentLink.substring(0,5)&&f||null==d||d(l,this.currentLink),mxEvent.isConsumed(l)||(l=mxEvent.isMiddleMouseButton(l)?"_blank":f?g.linkTarget:"_top",g.openLink(this.currentLink,l),c.consume())):null!=b&&!c.isConsumed()&&Math.abs(this.scrollLeft-g.container.scrollLeft)<e&&Math.abs(this.scrollTop-g.container.scrollTop)<
+e&&Math.abs(this.startX-c.getGraphX())<e&&Math.abs(this.startY-c.getGraphY())<e&&b(c.getEvent()));this.clear()},activate:function(a){this.currentLink=g.getAbsoluteUrl(g.getLinkForCell(a.cell));null!=this.currentLink&&(g.container.style.cursor="pointer",null!=this.highlight&&this.highlight.highlight(a))},clear:function(){null!=g.container&&(g.container.style.cursor=f);this.currentLink=this.currentState=null;null!=this.highlight&&this.highlight.hide();null!=g.tooltipHandler&&g.tooltipHandler.hide()}};
+g.click=function(a){};g.addMouseListener(l);mxEvent.addListener(document,"mouseleave",function(a){l.clear()})};Graph.prototype.duplicateCells=function(a,d){a=null!=a?a:this.getSelectionCells();d=null!=d?d:!0;a=this.model.getTopmostCells(a);var b=this.getModel(),c=this.gridSize,f=[];b.beginUpdate();try{for(var e=this.cloneCells(a,!1,null,!0),g=0;g<a.length;g++){var l=b.getParent(a[g]),r=this.moveCells([e[g]],c,c,!1)[0];f.push(r);if(d)b.add(l,e[g]);else{var n=l.getIndex(a[g]);b.add(l,e[g],n+1)}}}finally{b.endUpdate()}return f};
+Graph.prototype.insertImage=function(a,d,b){if(null!=a&&null!=this.cellEditor.textarea){for(var c=this.cellEditor.textarea.getElementsByTagName("img"),f=[],e=0;e<c.length;e++)f.push(c[e]);document.execCommand("insertimage",!1,a);a=this.cellEditor.textarea.getElementsByTagName("img");if(a.length==f.length+1)for(e=a.length-1;0<=e;e--)if(0==e||a[e]!=f[e-1]){a[e].setAttribute("width",d);a[e].setAttribute("height",b);break}}};Graph.prototype.insertLink=function(a){if(null!=this.cellEditor.textarea)if(0==
+a.length)document.execCommand("unlink",!1);else if(mxClient.IS_FF){for(var d=this.cellEditor.textarea.getElementsByTagName("a"),b=[],c=0;c<d.length;c++)b.push(d[c]);document.execCommand("createlink",!1,mxUtils.trim(a));d=this.cellEditor.textarea.getElementsByTagName("a");if(d.length==b.length+1)for(c=d.length-1;0<=c;c--)if(d[c]!=b[c-1]){for(d=d[c].getElementsByTagName("a");0<d.length;){for(b=d[0].parentNode;null!=d[0].firstChild;)b.insertBefore(d[0].firstChild,d[0]);b.removeChild(d[0])}break}}else document.execCommand("createlink",
+!1,mxUtils.trim(a))};Graph.prototype.isCellResizable=function(a){var d=mxGraph.prototype.isCellResizable.apply(this,arguments),b=this.view.getState(a),b=null!=b?b.style:this.getCellStyle(a);return d||"0"!=mxUtils.getValue(b,mxConstants.STYLE_RESIZABLE,"1")&&"wrap"==b[mxConstants.STYLE_WHITE_SPACE]};Graph.prototype.distributeCells=function(a,d){null==d&&(d=this.getSelectionCells());if(null!=d&&1<d.length){for(var b=[],c=null,f=null,e=0;e<d.length;e++)if(this.getModel().isVertex(d[e])){var g=this.view.getState(d[e]);
+if(null!=g){var l=a?g.getCenterX():g.getCenterY(),c=null!=c?Math.max(c,l):l,f=null!=f?Math.min(f,l):l;b.push(g)}}if(2<b.length){b.sort(function(d,b){return a?d.x-b.x:d.y-b.y});g=this.view.translate;l=this.view.scale;f=f/l-(a?g.x:g.y);c=c/l-(a?g.x:g.y);this.getModel().beginUpdate();try{for(var r=(c-f)/(b.length-1),c=f,e=1;e<b.length-1;e++){var n=this.view.getState(this.model.getParent(b[e].cell)),p=this.getCellGeometry(b[e].cell),c=c+r;null!=p&&null!=n&&(p=p.clone(),a?p.x=Math.round(c-p.width/2)-n.origin.x:
+p.y=Math.round(c-p.height/2)-n.origin.y,this.getModel().setGeometry(b[e].cell,p))}}finally{this.getModel().endUpdate()}}}return d};Graph.prototype.isCloneEvent=function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.encodeCells=function(a){for(var d=this.cloneCells(a),b=new mxDictionary,c=0;c<a.length;c++)b.put(a[c],!0);for(c=0;c<d.length;c++){var f=this.view.getState(a[c]);if(null!=f){var e=this.getCellGeometry(d[c]);null==e||!e.relative||this.model.isEdge(a[c])||
+b.get(this.model.getParent(a[c]))||(e.relative=!1,e.x=f.x/f.view.scale-f.view.translate.x,e.y=f.y/f.view.scale-f.view.translate.y)}}b=new mxCodec;f=new mxGraphModel;e=f.getChildAt(f.getRoot(),0);for(c=0;c<a.length;c++)f.add(e,d[c]);return b.encode(f)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,d){return this.getLinkForCell(a.cell)});return a};Graph.prototype.getSvg=function(a,d,b,c,f,e,g,l,r,n){var p=this.useCssTransforms;
+p&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{d=null!=d?d:1;b=null!=b?b:0;f=null!=f?f:!0;e=null!=e?e:!0;g=null!=g?g:!0;var u=e||c?this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==u)throw Error(mxResources.get("drawingEmpty"));var k=this.view.scale,y=mxUtils.createXmlDocument(),C=null!=y.createElementNS?y.createElementNS(mxConstants.NS_SVG,"svg"):y.createElement("svg");null!=a&&(null!=C.style?C.style.backgroundColor=a:C.setAttribute("style",
+"background-color:"+a));null==y.createElementNS?(C.setAttribute("xmlns",mxConstants.NS_SVG),C.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):C.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",mxConstants.NS_XLINK);a=d/k;var x=Math.max(1,Math.ceil(u.width*a)+2*b)+(n?5:0),B=Math.max(1,Math.ceil(u.height*a)+2*b)+(n?5:0);C.setAttribute("version","1.1");C.setAttribute("width",x+"px");C.setAttribute("height",B+"px");C.setAttribute("viewBox",(f?"-0.5 -0.5":"0 0")+" "+x+" "+B);y.appendChild(C);
+var z=null!=y.createElementNS?y.createElementNS(mxConstants.NS_SVG,"g"):y.createElement("g");C.appendChild(z);var m=this.createSvgCanvas(z);m.foOffset=f?-.5:0;m.textOffset=f?-.5:0;m.imageOffset=f?-.5:0;m.translate(Math.floor((b/d-u.x)/k),Math.floor((b/d-u.y)/k));var t=document.createElement("textarea"),H=m.createAlternateContent;m.createAlternateContent=function(a,d,b,c,f,e,g,l,r,n,p,u,k){var y=this.state;if(null!=this.foAltText&&(0==c||0!=y.fontSize&&e.length<5*c/y.fontSize)){var C=this.createElement("text");
+C.setAttribute("x",Math.round(c/2));C.setAttribute("y",Math.round((f+y.fontSize)/2));C.setAttribute("fill",y.fontColor||"black");C.setAttribute("text-anchor","middle");C.setAttribute("font-size",Math.round(y.fontSize)+"px");C.setAttribute("font-family",y.fontFamily);(y.fontStyle&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD&&C.setAttribute("font-weight","bold");(y.fontStyle&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC&&C.setAttribute("font-style","italic");(y.fontStyle&mxConstants.FONT_UNDERLINE)==
+mxConstants.FONT_UNDERLINE&&C.setAttribute("text-decoration","underline");try{return t.innerHTML=e,C.textContent=t.value,C}catch(oa){return H.apply(this,arguments)}}else return H.apply(this,arguments)};var J=this.backgroundImage;if(null!=J){d=k/d;var q=this.view.translate,G=new mxRectangle(q.x*d,q.y*d,J.width*d,J.height*d);mxUtils.intersects(u,G)&&m.image(q.x,q.y,J.width,J.height,J.src,!0)}m.scale(a);m.textEnabled=g;l=null!=l?l:this.createSvgImageExport();var I=l.drawCellState;l.drawCellState=function(a,
+d){for(var b=a.view.graph,c=b.isCellSelected(a.cell),f=b.model.getParent(a.cell);!e&&!c&&null!=f;)c=b.isCellSelected(f),f=b.model.getParent(f);(e||c)&&I.apply(this,arguments)};l.drawState(this.getView().getState(this.model.root),m);this.updateSvgLinks(C,r,!0);return C}finally{p&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.updateSvgLinks=function(a,d,b){a=a.getElementsByTagName("a");for(var c=0;c<a.length;c++){var f=a[c].getAttribute("href");null==f&&(f=
+a[c].getAttribute("xlink:href"));null!=f&&(null!=d&&/^https?:\/\//.test(f)?a[c].setAttribute("target",d):b&&this.isCustomLink(f)&&a[c].setAttribute("href","javascript:void(0);"))}};Graph.prototype.createSvgCanvas=function(a){return new mxSvgCanvas2D(a)};Graph.prototype.getSelectedElement=function(){var a=null;if(window.getSelection){var d=window.getSelection();d.getRangeAt&&d.rangeCount&&(a=d.getRangeAt(0).commonAncestorContainer)}else document.selection&&(a=document.selection.createRange().parentElement());
+return a};Graph.prototype.getParentByName=function(a,d,b){for(;null!=a&&a.nodeName!=d;){if(a==b)return null;a=a.parentNode}return a};Graph.prototype.selectNode=function(a){var d=null;if(window.getSelection){if(d=window.getSelection(),d.getRangeAt&&d.rangeCount){var b=document.createRange();b.selectNode(a);d.removeAllRanges();d.addRange(b)}}else(d=document.selection)&&"Control"!=d.type&&(a=d.createRange(),a.collapse(!0),b=d.createRange(),b.setEndPoint("StartToStart",a),b.select())};Graph.prototype.insertRow=
+function(a,d){for(var b=a.tBodies[0],c=b.rows[0].cells,f=0,e=0;e<c.length;e++)var g=c[e].getAttribute("colspan"),f=f+(null!=g?parseInt(g):1);b=b.insertRow(d);for(e=0;e<f;e++)mxUtils.br(b.insertCell(-1));return b.cells[0]};Graph.prototype.deleteRow=function(a,d){a.tBodies[0].deleteRow(d)};Graph.prototype.insertColumn=function(a,d){var b=a.tHead;if(null!=b)for(var c=0;c<b.rows.length;c++){var f=document.createElement("th");b.rows[c].appendChild(f);mxUtils.br(f)}b=a.tBodies[0];for(c=0;c<b.rows.length;c++)f=
+b.rows[c].insertCell(d),mxUtils.br(f);return b.rows[0].cells[0<=d?d:b.rows[0].cells.length-1]};Graph.prototype.deleteColumn=function(a,d){if(0<=d)for(var b=a.tBodies[0].rows,c=0;c<b.length;c++)b[c].cells.length>d&&b[c].deleteCell(d)};Graph.prototype.pasteHtmlAtCaret=function(a){var d;if(window.getSelection){if(d=window.getSelection(),d.getRangeAt&&d.rangeCount){d=d.getRangeAt(0);d.deleteContents();var b=document.createElement("div");b.innerHTML=a;a=document.createDocumentFragment();for(var c;c=b.firstChild;)lastNode=
+a.appendChild(c);d.insertNode(a)}}else(d=document.selection)&&"Control"!=d.type&&d.createRange().pasteHTML(a)};Graph.prototype.createLinkForHint=function(a,d){function b(a,d){a.length>d&&(a=a.substring(0,Math.round(d/2))+"..."+a.substring(a.length-Math.round(d/4)));return a}a=null!=a?a:"javascript:void(0);";if(null==d||0==d.length)d=this.isCustomLink(a)?this.getLinkTitle(a):a;var c=document.createElement("a");c.setAttribute("rel",this.linkRelation);c.setAttribute("href",this.getAbsoluteUrl(a));c.setAttribute("title",
+b(this.isCustomLink(a)?this.getLinkTitle(a):a,80));null!=this.linkTarget&&c.setAttribute("target",this.linkTarget);mxUtils.write(c,b(d,40));this.isCustomLink(a)&&mxEvent.addListener(c,"click",mxUtils.bind(this,function(d){this.customLinkClicked(a);mxEvent.consume(d)}));return c};Graph.prototype.initTouch=function(){this.connectionHandler.marker.isEnabled=function(){return null!=this.graph.connectionHandler.first};this.addListener(mxEvent.START_EDITING,function(a,d){this.popupMenuHandler.hideMenu()});
+var a=this.updateMouseEvent;this.updateMouseEvent=function(d){d=a.apply(this,arguments);if(mxEvent.isTouchEvent(d.getEvent())&&null==d.getState()){var b=this.getCellAt(d.graphX,d.graphY);null!=b&&this.isSwimlane(b)&&this.hitsSwimlaneContent(b,d.graphX,d.graphY)||(d.state=this.view.getState(b),null!=d.state&&null!=d.state.shape&&(this.container.style.cursor=d.state.shape.node.style.cursor))}null==d.getState()&&this.isEnabled()&&(this.container.style.cursor="default");return d};var d=!1,b=!1,c=!1,f=
+this.fireMouseEvent;this.fireMouseEvent=function(a,e,g){a==mxEvent.MOUSE_DOWN&&(e=this.updateMouseEvent(e),d=this.isCellSelected(e.getCell()),b=this.isSelectionEmpty(),c=this.popupMenuHandler.isMenuShowing());f.apply(this,arguments)};this.popupMenuHandler.mouseUp=mxUtils.bind(this,function(a,f){this.popupMenuHandler.popupTrigger=!this.isEditing()&&this.isEnabled()&&(null==f.getState()||!f.isSource(f.getState().control))&&(this.popupMenuHandler.popupTrigger||!c&&!mxEvent.isMouseEvent(f.getEvent())&&
+(b&&null==f.getCell()&&this.isSelectionEmpty()||d&&this.isCellSelected(f.getCell())));mxPopupMenuHandler.prototype.mouseUp.apply(this.popupMenuHandler,arguments)})};mxCellEditor.prototype.isContentEditing=function(){var a=this.graph.view.getState(this.editingCell);return null!=a&&1==a.style.html};mxCellEditor.prototype.saveSelection=function(){if(window.getSelection){var a=window.getSelection();if(a.getRangeAt&&a.rangeCount){for(var d=[],b=0,c=a.rangeCount;b<c;++b)d.push(a.getRangeAt(b));return d}}else if(document.selection&&
+document.selection.createRange)return document.selection.createRange();return null};mxCellEditor.prototype.restoreSelection=function(a){try{if(a)if(window.getSelection){sel=window.getSelection();sel.removeAllRanges();for(var d=0,b=a.length;d<b;++d)sel.addRange(a[d])}else document.selection&&a.select&&a.select()}catch(ea){}};var k=mxCellRenderer.prototype.initializeLabel;mxCellRenderer.prototype.initializeLabel=function(a){null!=a.text&&(a.text.replaceLinefeeds="0"!=mxUtils.getValue(a.style,"nl2Br",
+"1"));k.apply(this,arguments)};var m=mxConstraintHandler.prototype.update;mxConstraintHandler.prototype.update=function(a,d){this.isKeepFocusEvent(a)||!mxEvent.isAltDown(a.getEvent())?m.apply(this,arguments):this.reset()};mxGuide.prototype.createGuideShape=function(a){return new mxPolyline([],mxConstants.GUIDE_COLOR,mxConstants.GUIDE_STROKEWIDTH)};mxCellEditor.prototype.escapeCancelsEditing=!1;var q=mxCellEditor.prototype.startEditing;mxCellEditor.prototype.startEditing=function(a,d){q.apply(this,
+arguments);var b=this.graph.view.getState(a);this.textarea.className=null!=b&&1==b.style.html?"mxCellEditor geContentEditable":"mxCellEditor mxPlainTextEditor";this.codeViewMode=!1;this.switchSelectionState=null;this.graph.setSelectionCell(a);var b=this.graph.getModel().getParent(a),c=this.graph.getCellGeometry(a);this.graph.getModel().isEdge(b)&&null!=c&&c.relative||this.graph.getModel().isEdge(a)?mxClient.IS_QUIRKS?this.textarea.style.border="gray dotted 1px":this.textarea.style.outline=mxClient.IS_IE||
+mxClient.IS_IE11||mxClient.IS_FF&&mxClient.IS_WIN?"gray dotted 1px":"":mxClient.IS_QUIRKS&&(this.textarea.style.outline="none",this.textarea.style.border="")};var t=mxCellEditor.prototype.installListeners;mxCellEditor.prototype.installListeners=function(a){function d(a,b){b.originalNode=a;a=a.firstChild;for(var c=b.firstChild;null!=a&&null!=c;)d(a,c),a=a.nextSibling,c=c.nextSibling;return b}function b(a,d){if(null!=a)if(d.originalNode!=a)c(a);else for(a=a.firstChild,d=d.firstChild;null!=a;){var f=
+a.nextSibling;null==d?c(a):(b(a,d),d=d.nextSibling);a=f}}function c(a){for(var d=a.firstChild;null!=d;){var b=d.nextSibling;c(d);d=b}1==a.nodeType&&("BR"===a.nodeName||null!=a.firstChild)||3==a.nodeType&&0!=mxUtils.trim(mxUtils.getTextContent(a)).length?(3==a.nodeType&&mxUtils.setTextContent(a,mxUtils.getTextContent(a).replace(/\n|\r/g,"")),1==a.nodeType&&(a.removeAttribute("style"),a.removeAttribute("class"),a.removeAttribute("width"),a.removeAttribute("cellpadding"),a.removeAttribute("cellspacing"),
+a.removeAttribute("border"))):a.parentNode.removeChild(a)}t.apply(this,arguments);mxClient.IS_QUIRKS||7===document.documentMode||8===document.documentMode||mxEvent.addListener(this.textarea,"paste",mxUtils.bind(this,function(a){var c=d(this.textarea,this.textarea.cloneNode(!0));window.setTimeout(mxUtils.bind(this,function(){b(this.textarea,c)}),0)}))};mxCellEditor.prototype.toggleViewMode=function(){var a=this.graph.view.getState(this.editingCell);if(null!=a){var d=null!=a&&"0"!=mxUtils.getValue(a.style,
+"nl2Br","1"),b=this.saveSelection();if(this.codeViewMode){l=mxUtils.extractTextWithWhitespace(this.textarea.childNodes);0<l.length&&"\n"==l.charAt(l.length-1)&&(l=l.substring(0,l.length-1));l=this.graph.sanitizeHtml(d?l.replace(/\n/g,"<br/>"):l,!0);this.textarea.className="mxCellEditor geContentEditable";var c=mxUtils.getValue(a.style,mxConstants.STYLE_FONTSIZE,mxConstants.DEFAULT_FONTSIZE),d=mxUtils.getValue(a.style,mxConstants.STYLE_FONTFAMILY,mxConstants.DEFAULT_FONTFAMILY),f=mxUtils.getValue(a.style,
+mxConstants.STYLE_ALIGN,mxConstants.ALIGN_LEFT),e=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD,g=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC,a=(mxUtils.getValue(a.style,mxConstants.STYLE_FONTSTYLE,0)&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?Math.round(c*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;
+this.textarea.style.fontSize=Math.round(c)+"px";this.textarea.style.textDecoration=a?"underline":"";this.textarea.style.fontWeight=e?"bold":"normal";this.textarea.style.fontStyle=g?"italic":"";this.textarea.style.fontFamily=d;this.textarea.style.textAlign=f;this.textarea.style.padding="0px";this.textarea.innerHTML!=l&&(this.textarea.innerHTML=l,0==this.textarea.innerHTML.length&&(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length));this.codeViewMode=
+!1}else{this.clearOnChange&&this.textarea.innerHTML==this.getEmptyLabelText()&&(this.clearOnChange=!1,this.textarea.innerHTML="");var l=mxUtils.htmlEntities(this.textarea.innerHTML);mxClient.IS_QUIRKS||8==document.documentMode||(l=mxUtils.replaceTrailingNewlines(l,"<div><br></div>"));l=this.graph.sanitizeHtml(d?l.replace(/\n/g,"").replace(/&lt;br\s*.?&gt;/g,"<br>"):l,!0);this.textarea.className="mxCellEditor mxPlainTextEditor";var c=mxConstants.DEFAULT_FONTSIZE;this.textarea.style.lineHeight=mxConstants.ABSOLUTE_LINE_HEIGHT?
+Math.round(c*mxConstants.LINE_HEIGHT)+"px":mxConstants.LINE_HEIGHT;this.textarea.style.fontSize=Math.round(c)+"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 v=mxCellEditor.prototype.resize;mxCellEditor.prototype.resize=function(a,d){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 c=null!=a.text?a.text.margin:null;null==c&&(c=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+=c.x*this.bounds.width;this.bounds.y+=c.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<this.textarea.offsetHeight&&(this.textarea.style.height=Math.round(this.bounds.height/b)+(this.textarea.offsetHeight-
this.textarea.clientHeight)+"px",this.bounds.height=parseInt(this.textarea.style.height)*b);this.textarea.clientWidth<this.textarea.offsetWidth&&(this.textarea.style.width=Math.round(this.bounds.width/b)+(this.textarea.offsetWidth-this.textarea.clientWidth)+"px",this.bounds.width=parseInt(this.textarea.style.width)*b);this.textarea.style.left=Math.round(this.bounds.x)+"px";this.textarea.style.top=Math.round(this.bounds.y)+"px";mxClient.IS_VML?this.textarea.style.zoom=b:mxUtils.setPrefixedStyle(this.textarea.style,
-"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,"<br/>"));return b=this.graph.sanitizeHtml(b,!0)};
-mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(a){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);var c=this.graph.sanitizeHtml(this.textarea.innerHTML,!0);return c="1"==mxUtils.getValue(a.style,"nl2Br","1")?c.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"):c.replace(/\r\n/g,"").replace(/\n/g,"")};var 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=
-function(a){var c=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*c+20,30)};var f=mxGraphHandler.prototype.moveCells;mxGraphHandler.prototype.moveCells=function(a,c,b,d,e,g){mxEvent.isAltDown(g)&&(e=null);f.apply(this,arguments)};mxGraphHandler.prototype.updateHint=function(c){if(null!=this.shape){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var b=this.graph.view.translate,f=this.graph.view.scale;c=this.roundLength((this.bounds.x+this.currentDx)/
-f-b.x);b=this.roundLength((this.bounds.y+this.currentDy)/f-b.y);this.hint.innerHTML=c+", "+b;this.hint.style.left=this.shape.bounds.x+Math.round((this.shape.bounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.shape.bounds.y+this.shape.bounds.height+12+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(this.hint.parentNode.removeChild(this.hint),this.hint=null)};mxVertexHandler.prototype.isRecursiveResize=function(a,c){return!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&
-!mxEvent.isControlDown(c.getEvent())&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null)};mxVertexHandler.prototype.isCenteredEvent=function(a,c){return!(!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null))&&mxEvent.isControlDown(c.getEvent())||mxEvent.isMetaDown(c.getEvent())};
-var g=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var a=new mxPoint(0,0),c=this.tolerance;this.graph.cellEditor.getEditingCell()==this.state.cell&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(c/=2,a.x=this.sizers[0].bounds.width+c,a.y=this.sizers[0].bounds.height+c):a=g.apply(this,arguments);return a};mxVertexHandler.prototype.updateHint=function(c){this.index!=mxEvent.LABEL_HANDLE&&(null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint)),
-this.index==mxEvent.ROTATION_HANDLE?this.hint.innerHTML=this.currentAlpha+"&deg;":(c=this.state.view.scale,this.hint.innerHTML=this.roundLength(this.bounds.width/c)+" x "+this.roundLength(this.bounds.height/c)),c=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),null==c&&(c=this.bounds),this.hint.style.left=c.x+Math.round((c.width-this.hint.clientWidth)/2)+"px",this.hint.style.top=c.y+c.height+12+"px",null!=this.linkHint&&
-(this.linkHint.style.display="none"))};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(c,b){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var f=this.graph.view.translate,d=this.graph.view.scale,e=this.roundLength(b.x/d-f.x),f=this.roundLength(b.y/d-f.y);this.hint.innerHTML=e+", "+f;this.hint.style.visibility=
-"visible";if(this.isSource||this.isTarget)null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(e=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*e.x)+"%, "+Math.round(100*e.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(c.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(c.getGraphY(),b.y)+this.state.view.graph.gridSize+"px";null!=this.linkHint&&
+"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,d){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetInitialValue.apply(this,arguments);var b=this.graph.getEditingValue(a.cell,d);"1"==mxUtils.getValue(a.style,"nl2Br","1")&&(b=b.replace(/\n/g,"<br/>"));return b=this.graph.sanitizeHtml(b,!0)};
+mxCellEditorGetCurrentValue=mxCellEditor.prototype.getCurrentValue;mxCellEditor.prototype.getCurrentValue=function(a){if("0"==mxUtils.getValue(a.style,"html","0"))return mxCellEditorGetCurrentValue.apply(this,arguments);var d=this.graph.sanitizeHtml(this.textarea.innerHTML,!0);return d="1"==mxUtils.getValue(a.style,"nl2Br","1")?d.replace(/\r\n/g,"<br/>").replace(/\n/g,"<br/>"):d.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 d=mxCellEditor.prototype.applyValue;mxCellEditor.prototype.applyValue=function(a,b){this.graph.getModel().beginUpdate();try{if(d.apply(this,arguments),this.graph.isCellDeletable(a.cell)&&0==this.graph.model.getChildCount(a.cell)){var c=mxUtils.getValue(a.style,mxConstants.STYLE_STROKECOLOR,mxConstants.NONE),f=mxUtils.getValue(a.style,
+mxConstants.STYLE_FILLCOLOR,mxConstants.NONE);""==b&&c==mxConstants.NONE&&f==mxConstants.NONE&&this.graph.removeCells([a.cell],!1)}}finally{this.graph.getModel().endUpdate()}};mxCellEditor.prototype.getBackgroundColor=function(a){var d=null;if(this.graph.getModel().isEdge(a.cell)||this.graph.getModel().isEdge(this.graph.getModel().getParent(a.cell)))d=mxUtils.getValue(a.style,mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,null),d==mxConstants.NONE&&(d=null);return d};mxCellEditor.prototype.getMinimumSize=
+function(a){var d=this.graph.getView().scale;return new mxRectangle(0,0,null==a.text?30:a.text.size*d+20,30)};var f=mxGraphHandler.prototype.moveCells;mxGraphHandler.prototype.moveCells=function(a,d,b,c,e,g){mxEvent.isAltDown(g)&&(e=null);f.apply(this,arguments)};mxGraphHandler.prototype.updateHint=function(d){if(null!=this.shape){null==this.hint&&(this.hint=a(),this.graph.container.appendChild(this.hint));var b=this.graph.view.translate,c=this.graph.view.scale;d=this.roundLength((this.bounds.x+this.currentDx)/
+c-b.x);b=this.roundLength((this.bounds.y+this.currentDy)/c-b.y);this.hint.innerHTML=d+", "+b;this.hint.style.left=this.shape.bounds.x+Math.round((this.shape.bounds.width-this.hint.clientWidth)/2)+"px";this.hint.style.top=this.shape.bounds.y+this.shape.bounds.height+12+"px"}};mxGraphHandler.prototype.removeHint=function(){null!=this.hint&&(this.hint.parentNode.removeChild(this.hint),this.hint=null)};mxVertexHandler.prototype.isRecursiveResize=function(a,d){return!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&
+!mxEvent.isControlDown(d.getEvent())&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null)};mxVertexHandler.prototype.isCenteredEvent=function(a,d){return!(!this.graph.isSwimlane(a.cell)&&0<this.graph.model.getChildCount(a.cell)&&!this.graph.isCellCollapsed(a.cell)&&"1"==mxUtils.getValue(a.style,"recursiveResize","1")&&null==mxUtils.getValue(a.style,"childLayout",null))&&mxEvent.isControlDown(d.getEvent())||mxEvent.isMetaDown(d.getEvent())};
+var g=mxVertexHandler.prototype.getHandlePadding;mxVertexHandler.prototype.getHandlePadding=function(){var a=new mxPoint(0,0),d=this.tolerance;this.graph.cellEditor.getEditingCell()==this.state.cell&&null!=this.sizers&&0<this.sizers.length&&null!=this.sizers[0]?(d/=2,a.x=this.sizers[0].bounds.width+d,a.y=this.sizers[0].bounds.height+d):a=g.apply(this,arguments);return a};mxVertexHandler.prototype.updateHint=function(d){this.index!=mxEvent.LABEL_HANDLE&&(null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint)),
+this.index==mxEvent.ROTATION_HANDLE?this.hint.innerHTML=this.currentAlpha+"&deg;":(d=this.state.view.scale,this.hint.innerHTML=this.roundLength(this.bounds.width/d)+" x "+this.roundLength(this.bounds.height/d)),d=mxUtils.getBoundingBox(this.bounds,null!=this.currentAlpha?this.currentAlpha:this.state.style[mxConstants.STYLE_ROTATION]||"0"),null==d&&(d=this.bounds),this.hint.style.left=d.x+Math.round((d.width-this.hint.clientWidth)/2)+"px",this.hint.style.top=d.y+d.height+12+"px",null!=this.linkHint&&
+(this.linkHint.style.display="none"))};mxVertexHandler.prototype.removeHint=function(){mxGraphHandler.prototype.removeHint.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.display="")};mxEdgeHandler.prototype.updateHint=function(d,b){null==this.hint&&(this.hint=a(),this.state.view.graph.container.appendChild(this.hint));var c=this.graph.view.translate,f=this.graph.view.scale,e=this.roundLength(b.x/f-c.x),c=this.roundLength(b.y/f-c.y);this.hint.innerHTML=e+", "+c;this.hint.style.visibility=
+"visible";if(this.isSource||this.isTarget)null!=this.constraintHandler.currentConstraint&&null!=this.constraintHandler.currentFocus?(e=this.constraintHandler.currentConstraint.point,this.hint.innerHTML="["+Math.round(100*e.x)+"%, "+Math.round(100*e.y)+"%]"):this.marker.hasValidState()&&(this.hint.style.visibility="hidden");this.hint.style.left=Math.round(d.getGraphX()-this.hint.clientWidth/2)+"px";this.hint.style.top=Math.max(d.getGraphY(),b.y)+this.state.view.graph.gridSize+"px";null!=this.linkHint&&
(this.linkHint.style.display="none")};mxEdgeHandler.prototype.removeHint=mxVertexHandler.prototype.removeHint;HoverIcons.prototype.mainHandle=mxClient.IS_SVG?Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'" stroke-width="1"/>'):new mxImage(IMAGE_PATH+"/handle-main.png",17,17);HoverIcons.prototype.secondaryHandle=mxClient.IS_SVG?Graph.createSvgImage(16,16,'<path d="m 8 3 L 13 8 L 8 13 L 3 8 z" stroke="#fff" fill="#fca000"/>'):new mxImage(IMAGE_PATH+
"/handle-secondary.png",17,17);HoverIcons.prototype.fixedHandle=mxClient.IS_SVG?Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'" stroke-width="1"/><path d="m 7 7 L 11 11 M 7 11 L 11 7" stroke="#fff"/>'):new mxImage(IMAGE_PATH+"/handle-fixed.png",17,17);HoverIcons.prototype.terminalHandle=mxClient.IS_SVG?Graph.createSvgImage(18,18,'<circle cx="9" cy="9" r="5" stroke="#fff" fill="'+HoverIcons.prototype.arrowFill+'" stroke-width="1"/><circle cx="9" cy="9" r="2" stroke="#fff" fill="transparent"/>'):
new mxImage(IMAGE_PATH+"/handle-terminal.png",17,17);HoverIcons.prototype.rotationHandle=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAAVCAYAAACkCdXRAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAA6ZJREFUeNqM001IY1cUB/D/fYmm2sbR2lC1zYlgoRG6MpEyBlpxM9iFIGKFIm3s0lCKjOByhCLZCFqLBF1YFVJdSRbdFHRhBbULtRuFVBTzYRpJgo2mY5OX5N9Fo2TG+eiFA/dd3vvd8+65ByTxshARTdf1JySp6/oTEdFe9T5eg5lIcnBwkCSZyWS+exX40oyur68/KxaLf5Okw+H4X+A9JBaLfUySZ2dnnJqaosPhIAACeC34DJRKpb7IZrMcHx+nwWCgUopGo/EOKwf9fn/1CzERUevr6+9ls1mOjIwQAH0+H4PBIKPR6D2ofAQCgToRUeVYJUkuLy8TANfW1kiS8/PzCy84Mw4MDBAAZ2dnmc/nub+/X0MSEBF1cHDwMJVKsaGhgV6vl+l0mqOjo1+KyKfl1dze3l4NBoM/PZ+diFSLiIKIGBOJxA9bW1sEwNXVVSaTyQMRaRaRxrOzs+9J8ujoaE5EPhQRq67rcZ/PRwD0+/3Udf03EdEgIqZisZibnJykwWDg4eEhd3Z2xkXELCJvPpdBrYjUiEhL+Xo4HH4sIhUaAKNSqiIcDsNkMqG+vh6RSOQQQM7tdhsAQCkFAHC73UUATxcWFqypVApmsxnDw8OwWq2TADQNgAYAFosF+XweyWQSdru9BUBxcXFRB/4rEgDcPouIIx6P4+bmBi0tLSCpAzBqAIqnp6c/dnZ2IpfLYXNzE62traMADACKNputpr+/v8lms9UAKAAwiMjXe3t7KBQKqKurQy6Xi6K0i2l6evpROp1mbW0t29vbGY/Hb8/IVIqq2zlJXl1dsaOjg2azmefn5wwEAl+JSBVExCgi75PkzMwMlVJsbGxkIpFgPp8PX15ePopEIs3JZPITXdf/iEajbGpqolKKExMT1HWdHo/nIxGpgIgoEXnQ3d39kCTHxsYIgC6Xi3NzcwyHw8xkMozFYlxaWmJbWxuVUuzt7WUul6PX6/1cRN4WEe2uA0SkaWVl5XGpRVhdXU0A1DSNlZWVdz3qdDrZ09PDWCzG4+Pjn0XEWvp9KJKw2WwKwBsA3gHQHAqFfr24uMDGxgZ2d3cRiUQAAHa7HU6nE319fTg5Ofmlq6vrGwB/AngaCoWK6rbsNptNA1AJoA7Aux6Pp3NoaMhjsVg+QNmIRqO/u1yubwFEASRKUAEA7rASqABUAKgC8KAUb5XWCOAfAFcA/gJwDSB7C93DylCtdM8qABhLc5TumV6KQigUeubjfwcAHkQJ94ndWeYAAAAASUVORK5CYII=":
@@ -2425,182 +2424,182 @@ HoverIcons.prototype.refreshTarget,Sidebar.prototype.roundDrop=HoverIcons.protot
HoverIcons.prototype.triangleDown.src,(new Image).src=HoverIcons.prototype.triangleLeft.src,(new Image).src=HoverIcons.prototype.refreshTarget.src,(new Image).src=HoverIcons.prototype.roundDrop.src);mxVertexHandler.prototype.rotationEnabled=!0;mxVertexHandler.prototype.manageSizers=!0;mxVertexHandler.prototype.livePreview=!0;mxRubberband.prototype.defaultOpacity=30;mxConnectionHandler.prototype.outlineConnect=!0;mxCellHighlight.prototype.keepOnTop=!0;mxVertexHandler.prototype.parentHighlightEnabled=
!0;mxVertexHandler.prototype.rotationHandleVSpacing=-20;mxEdgeHandler.prototype.parentHighlightEnabled=!0;mxEdgeHandler.prototype.dblClickRemoveEnabled=!0;mxEdgeHandler.prototype.straightRemoveEnabled=!0;mxEdgeHandler.prototype.virtualBendsEnabled=!0;mxEdgeHandler.prototype.mergeRemoveEnabled=!0;mxEdgeHandler.prototype.manageLabelHandle=!0;mxEdgeHandler.prototype.outlineConnect=!0;mxEdgeHandler.prototype.isAddVirtualBendEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.isCustomHandleEvent=
function(a){return!mxEvent.isShiftDown(a.getEvent())};if(Graph.touchStyle){if(mxClient.IS_TOUCH||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)mxShape.prototype.svgStrokeTolerance=18,mxVertexHandler.prototype.tolerance=12,mxEdgeHandler.prototype.tolerance=12,Graph.prototype.tolerance=12,mxVertexHandler.prototype.rotationHandleVSpacing=-24,mxConstraintHandler.prototype.getTolerance=function(a){return mxEvent.isMouseEvent(a.getEvent())?4:this.graph.getTolerance()};mxPanningHandler.prototype.isPanningTrigger=
-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())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)}}else mxPanningHandler.prototype.isPanningTrigger=function(a){var c=
-a.getEvent();return mxEvent.isLeftMouseButton(c)&&(this.useLeftButtonForPanning&&null==a.getState()||mxEvent.isControlDown(c)&&!mxEvent.isShiftDown(c))||this.usePopupTrigger&&mxEvent.isPopupTrigger(c)};mxRubberband.prototype.isSpaceEvent=function(a){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&mxEvent.isControlDown(a.getEvent())&&mxEvent.isShiftDown(a.getEvent())};mxRubberband.prototype.mouseUp=function(a,c){var b=null!=this.div&&"none"!=this.div.style.display,
-f=null,d=null,e=null,g=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(f=this.first.x,d=this.first.y,e=(this.currentX-f)/this.graph.view.scale,g=(this.currentY-d)/this.graph.view.scale,mxEvent.isAltDown(c.getEvent())||(e=this.graph.snap(e),g=this.graph.snap(g),this.graph.isGridEnabled()||(Math.abs(e)<this.graph.tolerance&&(e=0),Math.abs(g)<this.graph.tolerance&&(g=0))));this.reset();if(b){if(mxEvent.isAltDown(c.getEvent())&&this.graph.isToggleEvent(c.getEvent())){var e=new mxRectangle(this.x,
-this.y,this.width,this.height),l=this.graph.getCells(e.x,e.y,e.width,e.height);this.graph.removeSelectionCells(l)}else if(this.isSpaceEvent(c)){this.graph.model.beginUpdate();try{for(l=this.graph.getCellsBeyond(f,d,this.graph.getDefaultParent(),!0,!0),b=0;b<l.length;b++)if(this.graph.isCellMovable(l[b])){var r=this.graph.view.getState(l[b]),n=this.graph.getCellGeometry(l[b]);null!=r&&null!=n&&(n=n.clone(),n.translate(e,g),this.graph.model.setGeometry(l[b],n))}}finally{this.graph.model.endUpdate()}}else e=
-new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(e,c.getEvent());c.consume()}};mxRubberband.prototype.mouseMove=function(a,c){if(!c.isConsumed()&&null!=this.first){var b=mxUtils.getScrollOrigin(this.graph.container),f=mxUtils.getOffset(this.graph.container);b.x-=f.x;b.y-=f.y;var f=c.getX()+b.x,b=c.getY()+b.y,d=this.first.x-f,e=this.first.y-b,g=this.graph.tolerance;if(null!=this.div||Math.abs(d)>g||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.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=f-this.width),this.y<this.first.y&&(this.y=b-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor=
+function(a){var d=a.getEvent();return null==a.getState()&&!mxEvent.isMouseEvent(d)||mxEvent.isPopupTrigger(d)&&(null==a.getState()||mxEvent.isControlDown(d)||mxEvent.isShiftDown(d))};var n=mxGraphHandler.prototype.mouseDown;mxGraphHandler.prototype.mouseDown=function(a,d){n.apply(this,arguments);mxEvent.isTouchEvent(d.getEvent())&&this.graph.isCellSelected(d.getCell())&&1<this.graph.getSelectionCount()&&(this.delayedSelection=!1)}}else mxPanningHandler.prototype.isPanningTrigger=function(a){var d=
+a.getEvent();return mxEvent.isLeftMouseButton(d)&&(this.useLeftButtonForPanning&&null==a.getState()||mxEvent.isControlDown(d)&&!mxEvent.isShiftDown(d))||this.usePopupTrigger&&mxEvent.isPopupTrigger(d)};mxRubberband.prototype.isSpaceEvent=function(a){return this.graph.isEnabled()&&!this.graph.isCellLocked(this.graph.getDefaultParent())&&mxEvent.isControlDown(a.getEvent())&&mxEvent.isShiftDown(a.getEvent())};mxRubberband.prototype.mouseUp=function(a,d){var b=null!=this.div&&"none"!=this.div.style.display,
+c=null,f=null,e=null,g=null;null!=this.first&&null!=this.currentX&&null!=this.currentY&&(c=this.first.x,f=this.first.y,e=(this.currentX-c)/this.graph.view.scale,g=(this.currentY-f)/this.graph.view.scale,mxEvent.isAltDown(d.getEvent())||(e=this.graph.snap(e),g=this.graph.snap(g),this.graph.isGridEnabled()||(Math.abs(e)<this.graph.tolerance&&(e=0),Math.abs(g)<this.graph.tolerance&&(g=0))));this.reset();if(b){if(mxEvent.isAltDown(d.getEvent())&&this.graph.isToggleEvent(d.getEvent())){var e=new mxRectangle(this.x,
+this.y,this.width,this.height),l=this.graph.getCells(e.x,e.y,e.width,e.height);this.graph.removeSelectionCells(l)}else if(this.isSpaceEvent(d)){this.graph.model.beginUpdate();try{for(l=this.graph.getCellsBeyond(c,f,this.graph.getDefaultParent(),!0,!0),b=0;b<l.length;b++)if(this.graph.isCellMovable(l[b])){var r=this.graph.view.getState(l[b]),n=this.graph.getCellGeometry(l[b]);null!=r&&null!=n&&(n=n.clone(),n.translate(e,g),this.graph.model.setGeometry(l[b],n))}}finally{this.graph.model.endUpdate()}}else e=
+new mxRectangle(this.x,this.y,this.width,this.height),this.graph.selectRegion(e,d.getEvent());d.consume()}};mxRubberband.prototype.mouseMove=function(a,d){if(!d.isConsumed()&&null!=this.first){var b=mxUtils.getScrollOrigin(this.graph.container),c=mxUtils.getOffset(this.graph.container);b.x-=c.x;b.y-=c.y;var c=d.getX()+b.x,b=d.getY()+b.y,f=this.first.x-c,e=this.first.y-b,g=this.graph.tolerance;if(null!=this.div||Math.abs(f)>g||Math.abs(e)>g)null==this.div&&(this.div=this.createShape()),mxUtils.clearSelection(),
+this.update(c,b),this.isSpaceEvent(d)?(c=this.x+this.width,b=this.y+this.height,f=this.graph.view.scale,mxEvent.isAltDown(d.getEvent())||(this.width=this.graph.snap(this.width/f)*f,this.height=this.graph.snap(this.height/f)*f,this.graph.isGridEnabled()||(this.width<this.graph.tolerance&&(this.width=0),this.height<this.graph.tolerance&&(this.height=0)),this.x<this.first.x&&(this.x=c-this.width),this.y<this.first.y&&(this.y=b-this.height)),this.div.style.borderStyle="dashed",this.div.style.backgroundColor=
"white",this.div.style.left=this.x+"px",this.div.style.top=this.y+"px",this.div.style.width=Math.max(0,this.width)+"px",this.div.style.height=this.graph.container.clientHeight+"px",this.div.style.borderWidth=0>=this.width?"0px 1px 0px 0px":"0px 1px 0px 1px",null==this.secondDiv&&(this.secondDiv=this.div.cloneNode(!0),this.div.parentNode.appendChild(this.secondDiv)),this.secondDiv.style.left=this.x+"px",this.secondDiv.style.top=this.y+"px",this.secondDiv.style.width=this.graph.container.clientWidth+
-"px",this.secondDiv.style.height=Math.max(0,this.height)+"px",this.secondDiv.style.borderWidth=0>=this.height?"1px 0px 0px 0px":"1px 0px 1px 0px"):(this.div.style.backgroundColor="",this.div.style.borderWidth="",this.div.style.borderStyle="",null!=this.secondDiv&&(this.secondDiv.parentNode.removeChild(this.secondDiv),this.secondDiv=null)),c.consume()}};var 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(),y=0,x=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,c,b,f){x.apply(this,arguments);b!=this.currentTerminalState?(p=(new Date).getTime(),y=0):y=(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<y||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&u.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,c){var b=null!=a&&0==a,f=this.state.getVisibleTerminalState(b),d=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,
-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 G=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 G.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 E=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))):E.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()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.rotateClick=function(){this.state.view.graph.turnShapes([this.state.cell])};var C=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,c){C.apply(this,arguments);null!=this.graph.graphHandler.first&&null!=this.rotationShape&&null!=
-this.rotationShape.node&&(this.rotationShape.node.style.display="none")};var Q=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(a,c){Q.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var O=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){O.apply(this,arguments);var a=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",
-mxResources.get("rotateTooltip"));var c=mxUtils.bind(this,function(){null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.specialHandle&&(this.specialHandle.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none");this.redrawHandles()});this.selectionHandler=mxUtils.bind(this,function(a,b){c()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,
-this.selectionHandler);this.changeHandler=mxUtils.bind(this,function(a,b){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));c()});this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);this.editingHandler=mxUtils.bind(this,function(a,c){this.redrawHandles()});this.graph.addListener(mxEvent.EDITING_STOPPED,this.editingHandler);var b=this.graph.getLinkForCell(this.state.cell),f=this.graph.getLinksForState(this.state);this.updateLinkHint(b,
-f);if(null!=b||null!=f&&0<f.length)a=!0;a&&this.redrawHandles()};mxVertexHandler.prototype.updateLinkHint=function(c,b){if(null==c&&(null==b||0==b.length)||1<this.graph.getSelectionCount())null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=c||null!=b&&0<b.length){null==this.linkHint&&(this.linkHint=a(),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint));
-this.linkHint.innerHTML="";if(null!=c&&(this.linkHint.appendChild(this.graph.createLinkForHint(c)),this.graph.isEnabled()&&"function"===typeof this.graph.editLink)){var f=document.createElement("img");f.setAttribute("src",Editor.editImage);f.setAttribute("title",mxResources.get("editLink"));f.setAttribute("width","11");f.setAttribute("height","11");f.style.marginLeft="10px";f.style.marginBottom="-1px";f.style.cursor="pointer";this.linkHint.appendChild(f);mxEvent.addListener(f,"click",mxUtils.bind(this,
-function(a){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(a)}));f=document.createElement("img");f.setAttribute("src",Dialog.prototype.clearImage);f.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));f.setAttribute("width","13");f.setAttribute("height","10");f.style.marginLeft="4px";f.style.marginBottom="-1px";f.style.cursor="pointer";this.linkHint.appendChild(f);mxEvent.addListener(f,"click",mxUtils.bind(this,function(a){this.graph.setLinkForCell(this.state.cell,
-null);mxEvent.consume(a)}))}if(null!=b)for(f=0;f<b.length;f++){var d=document.createElement("div");d.style.marginTop=null!=c||0<f?"6px":"0px";d.appendChild(this.graph.createLinkForHint(b[f].getAttribute("href"),mxUtils.getTextContent(b[f])));this.linkHint.appendChild(d)}}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var M=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){M.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,
-function(){return this.state.view.graph.connectionHandler.isEnabled()});var a=mxUtils.bind(this,function(){null!=this.linkHint&&(this.linkHint.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.labelShape&&(this.labelShape.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none")});this.selectionHandler=mxUtils.bind(this,function(c,b){a()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionHandler);
-this.changeHandler=mxUtils.bind(this,function(c,b){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));a();this.redrawHandles()});this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);var c=this.graph.getLinkForCell(this.state.cell),b=this.graph.getLinksForState(this.state);if(null!=c||null!=b&&0<b.length)this.updateLinkHint(c,b),this.redrawHandles()};var H=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){H.apply(this,
-arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var B=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){B.apply(this);if(null!=this.state&&null!=this.linkHint){var a=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),c=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),b=mxUtils.getBoundingBox(c,this.state.style[mxConstants.STYLE_ROTATION]||
-"0",a),a=null!=b?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,c=null!=this.state.text?this.state.text.boundingBox:null;null==b&&(b=this.state);b=b.y+b.height;null!=c&&(b=Math.max(b,c.y+c.height));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(b+this.verticalOffset/2+6+this.state.view.graph.tolerance)+"px"}};var I=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=
+"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)),d.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(),y=0,x=mxEdgeHandler.prototype.updatePreviewState;mxEdgeHandler.prototype.updatePreviewState=function(a,d,b,c){x.apply(this,arguments);b!=this.currentTerminalState?(p=(new Date).getTime(),y=0):y=(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<y||(null==this.currentTerminalState||"0"!=mxUtils.getValue(this.currentTerminalState.style,"outlineConnect","1"))&&u.apply(this,arguments)};mxVertexHandler.prototype.isCustomHandleEvent=function(a){return!mxEvent.isShiftDown(a.getEvent())};mxEdgeHandler.prototype.createHandleShape=function(a,d){var b=null!=a&&0==a,c=this.state.getVisibleTerminalState(b),f=null!=a&&(0==a||a>=this.state.absolutePoints.length-1||this.constructor==mxElbowEdgeHandler&&2==a)?this.graph.getConnectionConstraint(this.state,
+c,b):null,b=null!=(null!=f?this.graph.getConnectionPoint(this.state.getVisibleTerminalState(b),f):null)?this.fixedHandleImage:null!=f&&null!=c?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 G=mxVertexHandler.prototype.createSizerShape;
+mxVertexHandler.prototype.createSizerShape=function(a,d,b){this.handleImage=d==mxEvent.ROTATION_HANDLE?HoverIcons.prototype.rotationHandle:d==mxEvent.LABEL_HANDLE?this.secondaryHandleImage:this.handleImage;return G.apply(this,arguments)};var z=mxGraphHandler.prototype.getBoundingBox;mxGraphHandler.prototype.getBoundingBox=function(a){if(null!=a&&1==a.length){var d=this.graph.getModel(),b=d.getParent(a[0]),c=this.graph.getCellGeometry(a[0]);if(d.isEdge(b)&&null!=c&&c.relative&&(d=this.graph.view.getState(a[0]),
+null!=d&&2>d.width&&2>d.height&&null!=d.text&&null!=d.text.boundingBox))return mxRectangle.fromRectangle(d.text.boundingBox)}return z.apply(this,arguments)};var E=mxVertexHandler.prototype.getSelectionBounds;mxVertexHandler.prototype.getSelectionBounds=function(a){var d=this.graph.getModel(),b=d.getParent(a.cell),c=this.graph.getCellGeometry(a.cell);return d.isEdge(b)&&null!=c&&c.relative&&2>a.width&&2>a.height&&null!=a.text&&null!=a.text.boundingBox?(d=a.text.unrotatedBoundingBox||a.text.boundingBox,
+new mxRectangle(Math.round(d.x),Math.round(d.y),Math.round(d.width),Math.round(d.height))):E.apply(this,arguments)};var r=mxVertexHandler.prototype.mouseDown;mxVertexHandler.prototype.mouseDown=function(a,d){var b=this.graph.getModel(),c=b.getParent(this.state.cell),f=this.graph.getCellGeometry(this.state.cell);(this.getHandleForEvent(d)==mxEvent.ROTATION_HANDLE||!b.isEdge(c)||null==f||!f.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()<mxGraphHandler.prototype.maxCells)};mxVertexHandler.prototype.rotateClick=function(){this.state.view.graph.turnShapes([this.state.cell])};var C=mxVertexHandler.prototype.mouseMove;mxVertexHandler.prototype.mouseMove=function(a,d){C.apply(this,arguments);null!=this.graph.graphHandler.first&&null!=this.rotationShape&&null!=
+this.rotationShape.node&&(this.rotationShape.node.style.display="none")};var Q=mxVertexHandler.prototype.mouseUp;mxVertexHandler.prototype.mouseUp=function(a,d){Q.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var O=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){O.apply(this,arguments);var a=!1;null!=this.rotationShape&&this.rotationShape.node.setAttribute("title",
+mxResources.get("rotateTooltip"));var d=mxUtils.bind(this,function(){null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.specialHandle&&(this.specialHandle.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none");this.redrawHandles()});this.selectionHandler=mxUtils.bind(this,function(a,b){d()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,
+this.selectionHandler);this.changeHandler=mxUtils.bind(this,function(a,b){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));d()});this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);this.editingHandler=mxUtils.bind(this,function(a,d){this.redrawHandles()});this.graph.addListener(mxEvent.EDITING_STOPPED,this.editingHandler);var b=this.graph.getLinkForCell(this.state.cell),c=this.graph.getLinksForState(this.state);this.updateLinkHint(b,
+c);if(null!=b||null!=c&&0<c.length)a=!0;a&&this.redrawHandles()};mxVertexHandler.prototype.updateLinkHint=function(d,b){if(null==d&&(null==b||0==b.length)||1<this.graph.getSelectionCount())null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=d||null!=b&&0<b.length){null==this.linkHint&&(this.linkHint=a(),this.linkHint.style.padding="6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint));
+this.linkHint.innerHTML="";if(null!=d&&(this.linkHint.appendChild(this.graph.createLinkForHint(d)),this.graph.isEnabled()&&"function"===typeof this.graph.editLink)){var c=document.createElement("img");c.setAttribute("src",Editor.editImage);c.setAttribute("title",mxResources.get("editLink"));c.setAttribute("width","11");c.setAttribute("height","11");c.style.marginLeft="10px";c.style.marginBottom="-1px";c.style.cursor="pointer";this.linkHint.appendChild(c);mxEvent.addListener(c,"click",mxUtils.bind(this,
+function(a){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(a)}));c=document.createElement("img");c.setAttribute("src",Dialog.prototype.clearImage);c.setAttribute("title",mxResources.get("removeIt",[mxResources.get("link")]));c.setAttribute("width","13");c.setAttribute("height","10");c.style.marginLeft="4px";c.style.marginBottom="-1px";c.style.cursor="pointer";this.linkHint.appendChild(c);mxEvent.addListener(c,"click",mxUtils.bind(this,function(a){this.graph.setLinkForCell(this.state.cell,
+null);mxEvent.consume(a)}))}if(null!=b)for(c=0;c<b.length;c++){var f=document.createElement("div");f.style.marginTop=null!=d||0<c?"6px":"0px";f.appendChild(this.graph.createLinkForHint(b[c].getAttribute("href"),mxUtils.getTextContent(b[c])));this.linkHint.appendChild(f)}}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var M=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){M.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,
+function(){return this.state.view.graph.connectionHandler.isEnabled()});var a=mxUtils.bind(this,function(){null!=this.linkHint&&(this.linkHint.style.display=1==this.graph.getSelectionCount()?"":"none");null!=this.labelShape&&(this.labelShape.node.style.display=this.graph.isEnabled()&&this.graph.getSelectionCount()<this.graph.graphHandler.maxCells?"":"none")});this.selectionHandler=mxUtils.bind(this,function(d,b){a()});this.graph.getSelectionModel().addListener(mxEvent.CHANGE,this.selectionHandler);
+this.changeHandler=mxUtils.bind(this,function(d,b){this.updateLinkHint(this.graph.getLinkForCell(this.state.cell),this.graph.getLinksForState(this.state));a();this.redrawHandles()});this.graph.getModel().addListener(mxEvent.CHANGE,this.changeHandler);var d=this.graph.getLinkForCell(this.state.cell),b=this.graph.getLinksForState(this.state);if(null!=d||null!=b&&0<b.length)this.updateLinkHint(d,b),this.redrawHandles()};var H=mxConnectionHandler.prototype.init;mxConnectionHandler.prototype.init=function(){H.apply(this,
+arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,function(){return this.graph.connectionHandler.isEnabled()})};var B=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){B.apply(this);if(null!=this.state&&null!=this.linkHint){var a=new mxPoint(this.state.getCenterX(),this.state.getCenterY()),d=new mxRectangle(this.state.x,this.state.y-22,this.state.width+24,this.state.height+22),b=mxUtils.getBoundingBox(d,this.state.style[mxConstants.STYLE_ROTATION]||
+"0",a),a=null!=b?mxUtils.getBoundingBox(this.state,this.state.style[mxConstants.STYLE_ROTATION]||"0"):this.state,d=null!=this.state.text?this.state.text.boundingBox:null;null==b&&(b=this.state);b=b.y+b.height;null!=d&&(b=Math.max(b,d.y+d.height));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(b+this.verticalOffset/2+6+this.state.view.graph.tolerance)+"px"}};var I=mxVertexHandler.prototype.reset;mxVertexHandler.prototype.reset=
function(){I.apply(this,arguments);null!=this.rotationShape&&null!=this.rotationShape.node&&(this.rotationShape.node.style.display=1==this.graph.getSelectionCount()?"":"none")};var S=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(){S.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=
null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null);null!=this.editingHandler&&(this.graph.removeListener(this.editingHandler),this.editingHandler=null)};var V=mxEdgeHandler.prototype.redrawHandles;mxEdgeHandler.prototype.redrawHandles=function(){if(null!=this.marker&&(V.apply(this),null!=this.state&&null!=this.linkHint)){var a=this.state;null!=this.state.text&&null!=this.state.text.bounds&&(a=new mxRectangle(a.x,a.y,a.width,a.height),
a.add(this.state.text.bounds));this.linkHint.style.left=Math.max(0,Math.round(a.x+(a.width-this.linkHint.clientWidth)/2))+"px";this.linkHint.style.top=Math.round(a.y+a.height+6+this.state.view.graph.tolerance)+"px"}};var U=mxEdgeHandler.prototype.reset;mxEdgeHandler.prototype.reset=function(){U.apply(this,arguments);null!=this.linkHint&&(this.linkHint.style.visibility="")};var X=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){X.apply(this,arguments);null!=this.linkHint&&
-(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function e(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function m(){mxActor.call(this)}function q(){mxCylinder.call(this)}function t(){mxActor.call(this)}function v(){mxActor.call(this)}function A(){mxActor.call(this)}function c(){mxActor.call(this)}function f(){mxActor.call(this)}function g(){mxActor.call(this)}function n(){mxActor.call(this)}function l(a,c){this.canvas=
-a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=c;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,l.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,l.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,l.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,l.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;
+(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.selectionHandler&&(this.graph.getSelectionModel().removeListener(this.selectionHandler),this.selectionHandler=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function a(){mxCylinder.call(this)}function b(){mxActor.call(this)}function e(){mxCylinder.call(this)}function c(){mxCylinder.call(this)}function k(){mxCylinder.call(this)}function m(){mxActor.call(this)}function q(){mxCylinder.call(this)}function t(){mxActor.call(this)}function v(){mxActor.call(this)}function A(){mxActor.call(this)}function d(){mxActor.call(this)}function f(){mxActor.call(this)}function g(){mxActor.call(this)}function n(){mxActor.call(this)}function l(a,d){this.canvas=
+a;this.canvas.setLineJoin("round");this.canvas.setLineCap("round");this.defaultVariation=d;this.originalLineTo=this.canvas.lineTo;this.canvas.lineTo=mxUtils.bind(this,l.prototype.lineTo);this.originalMoveTo=this.canvas.moveTo;this.canvas.moveTo=mxUtils.bind(this,l.prototype.moveTo);this.originalClose=this.canvas.close;this.canvas.close=mxUtils.bind(this,l.prototype.close);this.originalQuadTo=this.canvas.quadTo;this.canvas.quadTo=mxUtils.bind(this,l.prototype.quadTo);this.originalCurveTo=this.canvas.curveTo;
this.canvas.curveTo=mxUtils.bind(this,l.prototype.curveTo);this.originalArcTo=this.canvas.arcTo;this.canvas.arcTo=mxUtils.bind(this,l.prototype.arcTo)}function p(){mxRectangleShape.call(this)}function y(){mxRectangleShape.call(this)}function x(){mxActor.call(this)}function u(){mxActor.call(this)}function G(){mxActor.call(this)}function z(){mxRectangleShape.call(this)}function E(){mxRectangleShape.call(this)}function r(){mxCylinder.call(this)}function C(){mxShape.call(this)}function Q(){mxShape.call(this)}
function O(){mxEllipse.call(this)}function M(){mxShape.call(this)}function H(){mxShape.call(this)}function B(){mxRectangleShape.call(this)}function I(){mxShape.call(this)}function S(){mxShape.call(this)}function V(){mxShape.call(this)}function U(){mxShape.call(this)}function X(){mxShape.call(this)}function J(){mxCylinder.call(this)}function aa(){mxDoubleEllipse.call(this)}function la(){mxDoubleEllipse.call(this)}function ea(){mxArrowConnector.call(this);this.spacing=0}function Y(){mxArrowConnector.call(this);
this.spacing=0}function ba(){mxActor.call(this)}function K(){mxRectangleShape.call(this)}function L(){mxActor.call(this)}function ha(){mxActor.call(this)}function N(){mxActor.call(this)}function R(){mxActor.call(this)}function ia(){mxActor.call(this)}function fa(){mxActor.call(this)}function F(){mxActor.call(this)}function ja(){mxActor.call(this)}function P(){mxActor.call(this)}function ca(){mxActor.call(this)}function ga(){mxEllipse.call(this)}function W(){mxEllipse.call(this)}function Z(){mxEllipse.call(this)}
-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))))),
-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),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;e<g;e++){var r=(Math.random()-.5)*D;this.originalLineTo.call(this.canvas,l*e+this.lastX-r*d,b*e+this.lastY-r*f)}this.originalLineTo.call(this.canvas,a,c)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=c};l.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};
+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,d,b,c,f,e,g,l,r,n){g+=r;var D=c.clone();c.x-=f*(2*g+r);c.y-=e*(2*g+r);f*=g+r;e*=g+r;return function(){a.ellipse(D.x-f-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,d,b,c,f){var e=Math.max(0,Math.min(c,Math.min(f,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(d,b);a.begin();a.moveTo(0,0);a.lineTo(c-e,0);a.lineTo(c,
+e);a.lineTo(c,f);a.lineTo(e,f);a.lineTo(0,f-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(c-e,0),a.lineTo(c,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,f),a.lineTo(0,f-e),a.close(),a.fill()),a.begin(),a.moveTo(e,f),a.lineTo(e,e),a.lineTo(0,
+0),a.moveTo(e,e),a.lineTo(c,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,d,b,c,f){d=Math.min(c,f/xa);a.translate((c-d)/2,(f-d)/2+d/4);a.moveTo(0,.25*d);a.lineTo(.5*
+d,d*na);a.lineTo(d,.25*d);a.lineTo(.5*d,(.5-na)*d);a.lineTo(0,.25*d);a.close();a.end()};mxCellRenderer.registerShape("isoRectangle",b);mxUtils.extend(e,mxCylinder);e.prototype.size=20;e.prototype.redrawPath=function(a,d,b,c,f,e){d=Math.min(c,f/(.5+xa));e?(a.moveTo(0,.25*d),a.lineTo(.5*d,(.5-na)*d),a.lineTo(d,.25*d),a.moveTo(.5*d,(.5-na)*d),a.lineTo(.5*d,(1-na)*d)):(a.translate((c-d)/2,(f-d)/2),a.moveTo(0,.25*d),a.lineTo(.5*d,d*na),a.lineTo(d,.25*d),a.lineTo(d,.75*d),a.lineTo(.5*d,(1-na)*d),a.lineTo(0,
+.75*d),a.close());a.end()};mxCellRenderer.registerShape("isoCube",e);mxUtils.extend(c,mxCylinder);c.prototype.redrawPath=function(a,d,b,c,f,e){d=Math.min(f/2,Math.round(f/8)+this.strokewidth-1);if(e&&null!=this.fill||!e&&null==this.fill)a.moveTo(0,d),a.curveTo(0,2*d,c,2*d,c,d),e||(a.stroke(),a.begin()),a.translate(0,d/2),a.moveTo(0,d),a.curveTo(0,2*d,c,2*d,c,d),e||(a.stroke(),a.begin()),a.translate(0,d/2),a.moveTo(0,d),a.curveTo(0,2*d,c,2*d,c,d),e||(a.stroke(),a.begin()),a.translate(0,-d);e||(a.moveTo(0,
+d),a.curveTo(0,-d/3,c,-d/3,c,d),a.lineTo(c,f-d),a.curveTo(c,f+d/3,0,f+d/3,0,f-d),a.close())};c.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",c);mxUtils.extend(k,mxCylinder);k.prototype.size=30;k.prototype.darkOpacity=0;k.prototype.paintVertexShape=function(a,d,b,c,f){var e=Math.max(0,Math.min(c,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))))),
+D=Math.max(-1,Math.min(1,parseFloat(mxUtils.getValue(this.style,"darkOpacity",this.darkOpacity))));a.translate(d,b);a.begin();a.moveTo(0,0);a.lineTo(c-e,0);a.lineTo(c,e);a.lineTo(c,f);a.lineTo(0,f);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(c-e,0),a.lineTo(c-e,e),a.lineTo(c,e),a.close(),a.fill()),a.begin(),a.moveTo(c-e,0),a.lineTo(c-e,e),a.lineTo(c,e),a.end(),a.stroke())};
+mxCellRenderer.registerShape("note",k);mxUtils.extend(m,mxActor);m.prototype.redrawPath=function(a,d,b,c,f){a.moveTo(0,0);a.quadTo(c/2,.5*f,c,0);a.quadTo(.5*c,f/2,c,f);a.quadTo(c/2,.5*f,0,f);a.quadTo(.5*c,f/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,d,b,c,f,e){d=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth))));
+b=Math.max(0,Math.min(f,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(d,b)):(a.moveTo(c-d,b),a.lineTo(c,b)):("left"==D?(a.moveTo(0,0),a.lineTo(d,0),a.lineTo(d,b),a.lineTo(c,b)):(a.moveTo(0,b),a.lineTo(c-d,b),a.lineTo(c-d,0),a.lineTo(c,0)),a.lineTo(c,f),a.lineTo(0,f),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,d,b,c,f){d=Math.max(0,Math.min(c,Math.min(f,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(d,0),new mxPoint(c,0),new mxPoint(c,f),new mxPoint(0,f),new mxPoint(0,d)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("card",t);mxUtils.extend(v,mxActor);v.prototype.size=.4;v.prototype.redrawPath=
+function(a,d,b,c,f){d=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,d/2);a.quadTo(c/4,1.4*d,c/2,d/2);a.quadTo(3*c/4,d*(1-1.4),c,d/2);a.lineTo(c,f-d/2);a.quadTo(3*c/4,f-1.4*d,c/2,f-d/2);a.quadTo(c/4,f-d*(1-1.4),0,f-d/2);a.lineTo(0,d/2);a.close();a.end()};v.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var d=mxUtils.getValue(this.style,"size",this.size),b=a.width,c=a.height;if(null==this.direction||this.direction==
+mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)return d*=c,new mxRectangle(a.x,a.y+d,b,c-2*d);d*=b;return new mxRectangle(a.x+d,a.y,b-2*d,c)}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,d,b,c,f){d=f*Math.max(0,
+Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(0,0);a.lineTo(c,0);a.lineTo(c,f-d/2);a.quadTo(3*c/4,f-1.4*d,c/2,f-d/2);a.quadTo(c/4,f-d*(1-1.4),0,f-d/2);a.lineTo(0,d/2);a.close();a.end()};mxCellRenderer.registerShape("document",A);var Ia=mxCylinder.prototype.getCylinderSize;mxCylinder.prototype.getCylinderSize=function(a,d,b,c){var f=mxUtils.getValue(this.style,"size");return null!=f?c*Math.max(0,Math.min(1,f)):Ia.apply(this,arguments)};mxCylinder.prototype.getLabelMargins=
+function(a){if(mxUtils.getValue(this.style,"boundedLbl",!1)){var d=2*mxUtils.getValue(this.style,"size",.15);return new mxRectangle(0,Math.min(this.maxHeight*this.scale,a.height*d),0,0)}return null};mxUtils.extend(d,mxActor);d.prototype.size=.2;d.prototype.isRoundable=function(){return!0};d.prototype.redrawPath=function(a,d,b,c,f){d=c*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,f),new mxPoint(d,0),new mxPoint(c,0),new mxPoint(c-d,f)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("parallelogram",d);mxUtils.extend(f,mxActor);f.prototype.size=.2;f.prototype.isRoundable=function(){return!0};f.prototype.redrawPath=function(a,d,b,c,f){d=c*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,
+f),new mxPoint(d,0),new mxPoint(c-d,0),new mxPoint(c,f)],this.isRounded,b,!0)};mxCellRenderer.registerShape("trapezoid",f);mxUtils.extend(g,mxActor);g.prototype.size=.5;g.prototype.redrawPath=function(a,d,b,c,f){a.setFillColor(null);d=c*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(c,0),new mxPoint(d,0),new mxPoint(d,f/2),new mxPoint(0,f/2),new mxPoint(d,
+f/2),new mxPoint(d,f),new mxPoint(c,f)],this.isRounded,b,!1);a.end()};mxCellRenderer.registerShape("curlyBracket",g);mxUtils.extend(n,mxActor);n.prototype.redrawPath=function(a,d,b,c,f){a.setStrokeWidth(1);a.setFillColor(this.stroke);d=c/5;a.rect(0,0,d,f);a.fillAndStroke();a.rect(2*d,0,d,f);a.fillAndStroke();a.rect(4*d,0,d,f);a.fillAndStroke()};mxCellRenderer.registerShape("parallelMarker",n);l.prototype.moveTo=function(a,d){this.originalMoveTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=
+d;this.firstX=a;this.firstY=d};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,d,b,c){this.originalQuadTo.apply(this.canvas,arguments);this.lastX=b;this.lastY=c};l.prototype.curveTo=function(a,d,b,c,f,e){this.originalCurveTo.apply(this.canvas,arguments);this.lastX=f;this.lastY=e};l.prototype.arcTo=function(a,d,b,c,
+f,e,g){this.originalArcTo.apply(this.canvas,arguments);this.lastX=e;this.lastY=g};l.prototype.lineTo=function(a,d){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},c=Math.abs(a-this.lastX),f=Math.abs(d-this.lastY),e=Math.sqrt(c*c+f*f);if(2>e){this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=d;return}var g=Math.round(e/10),D=this.defaultVariation;5>g&&(g=5,D/=3);for(var l=b(a-this.lastX)*c/g,b=b(d-this.lastY)*f/g,
+c=c/e,f=f/e,e=0;e<g;e++){var r=(Math.random()-.5)*D;this.originalLineTo.call(this.canvas,l*e+this.lastX-r*f,b*e+this.lastY-r*c)}this.originalLineTo.call(this.canvas,a,d)}else this.originalLineTo.apply(this.canvas,arguments);this.lastX=a;this.lastY=d};l.prototype.destroy=function(){this.canvas.lineTo=this.originalLineTo;this.canvas.moveTo=this.originalMoveTo;this.canvas.close=this.originalClose;this.canvas.quadTo=this.originalQuadTo;this.canvas.curveTo=this.originalCurveTo;this.canvas.arcTo=this.originalArcTo};
var Ja=mxShape.prototype.paint;mxShape.prototype.defaultJiggle=1.5;mxShape.prototype.paint=function(a){null!=this.style&&"0"!=mxUtils.getValue(this.style,"comic","0")&&null==a.handHiggle&&(a.handJiggle=new l(a,mxUtils.getValue(this.style,"jiggle",this.defaultJiggle)));Ja.apply(this,arguments);null!=a.handJiggle&&(a.handJiggle.destroy(),delete a.handJiggle)};mxRhombus.prototype.defaultJiggle=2;var Ka=mxRectangleShape.prototype.isHtmlAllowed;mxRectangleShape.prototype.isHtmlAllowed=function(){return(null==
-this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&Ka.apply(this,arguments)};var La=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(a,c,b,f,d){if(null==a.handJiggle)La.apply(this,arguments);else{var e=!0;null!=this.style&&(e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(e||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)e||null!=this.fill&&this.fill!=mxConstants.NONE||
-(a.pointerEvents=!1),a.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?e=Math.min(f/2,Math.min(d/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.min(f*e,d*e)),a.moveTo(c+e,b),a.lineTo(c+f-e,b),a.quadTo(c+f,b,c+f,b+e),a.lineTo(c+f,b+d-e),a.quadTo(c+f,b+d,c+f-e,b+d),a.lineTo(c+e,b+d),a.quadTo(c,b+d,c,b+d-e),
-a.lineTo(c,b+e),a.quadTo(c,b,c+e,b)):(a.moveTo(c,b),a.lineTo(c+f,b),a.lineTo(c+f,b+d),a.lineTo(c,b+d),a.lineTo(c,b)),a.close(),a.end(),a.fillAndStroke()}};var Ma=mxRectangleShape.prototype.paintForeground;mxRectangleShape.prototype.paintForeground=function(a,c,b,f,d){null==a.handJiggle&&Ma.apply(this,arguments)};mxUtils.extend(p,mxRectangleShape);p.prototype.size=.1;p.prototype.isHtmlAllowed=function(){return!1};p.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,
-!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var c=a.width,b=a.height;a=new mxRectangle(a.x,a.y,c,b);var f=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,f=Math.max(f,Math.min(c*d,b*d));a.x+=Math.round(f);a.width-=Math.round(2*f)}return a};p.prototype.paintForeground=
-function(a,c,b,f,d){var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(f*g,d*g));e=Math.round(e);a.begin();a.moveTo(c+e,b);a.lineTo(c+e,b+d);a.moveTo(c+f-e,b);a.lineTo(c+f-e,b+d);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",p);mxUtils.extend(y,
-mxRectangleShape);y.prototype.paintBackground=function(a,c,b,f,d){a.setFillColor(mxConstants.NONE);a.rect(c,b,f,d);a.fill()};y.prototype.paintForeground=function(a,c,b,f,d){};mxCellRenderer.registerShape("transparent",y);mxUtils.extend(x,mxHexagon);x.prototype.size=30;x.prototype.position=.5;x.prototype.position2=.5;x.prototype.base=20;x.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};x.prototype.isRoundable=
-function(){return!0};x.prototype.redrawPath=function(a,c,b,f,d){c=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),g=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),l=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"base",this.base))));
-this.addPoints(a,[new mxPoint(0,0),new mxPoint(f,0),new mxPoint(f,d-b),new mxPoint(Math.min(f,e+l),d-b),new mxPoint(g,d),new mxPoint(Math.max(0,e),d-b),new mxPoint(0,d-b)],this.isRounded,c,!0,[4])};mxCellRenderer.registerShape("callout",x);mxUtils.extend(u,mxActor);u.prototype.size=.2;u.prototype.fixedSize=20;u.prototype.isRoundable=function(){return!0};u.prototype.redrawPath=function(a,c,b,f,d){c="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,
-"size",this.fixedSize)))):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,0),new mxPoint(f-c,0),new mxPoint(f,d/2),new mxPoint(f-c,d),new mxPoint(0,d),new mxPoint(c,d/2)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("step",u);mxUtils.extend(G,mxHexagon);G.prototype.size=.25;G.prototype.isRoundable=function(){return!0};G.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(c,0),new mxPoint(f-c,0),new mxPoint(f,.5*d),new mxPoint(f-c,d),new mxPoint(c,d),new mxPoint(0,.5*d)],this.isRounded,b,!0)};mxCellRenderer.registerShape("hexagon",G);mxUtils.extend(z,mxRectangleShape);z.prototype.isHtmlAllowed=function(){return!1};z.prototype.paintForeground=function(a,
-c,b,f,d){var e=Math.min(f/5,d/5)+1;a.begin();a.moveTo(c+f/2,b+e);a.lineTo(c+f/2,b+d-e);a.moveTo(c+e,b+d/2);a.lineTo(c+f-e,b+d/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",z);var Fa=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+
-c,a.y+c,a.width-2*c,a.height-2*c)}return a};mxRhombus.prototype.paintVertexShape=function(a,c,b,f,d){Fa.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var e=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=e;b+=e;f-=2*e;d-=2*e;0<f&&0<d&&(a.setShadow(!1),Fa.apply(this,[a,c,b,f,d]))}};mxUtils.extend(E,mxRectangleShape);E.prototype.isHtmlAllowed=function(){return!1};E.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var c=(Math.max(2,
-this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+c,a.y+c,a.width-2*c,a.height-2*c)}return a};E.prototype.paintForeground=function(a,c,b,f,d){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var e=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);c+=e;b+=e;f-=2*e;d-=2*e;0<f&&0<d&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var e=0,g;do{g=mxCellRenderer.defaultShapes[this.style["symbol"+
-e]];if(null!=g){var l=this.style["symbol"+e+"Align"],D=this.style["symbol"+e+"VerticalAlign"],r=this.style["symbol"+e+"Width"],n=this.style["symbol"+e+"Height"],p=this.style["symbol"+e+"Spacing"]||0,u=this.style["symbol"+e+"VSpacing"]||p,k=this.style["symbol"+e+"ArcSpacing"];null!=k&&(k*=this.getArcSize(f+this.strokewidth,d+this.strokewidth),p+=k,u+=k);var k=c,y=b,k=l==mxConstants.ALIGN_CENTER?k+(f-r)/2:l==mxConstants.ALIGN_RIGHT?k+(f-r-p):k+p,y=D==mxConstants.ALIGN_MIDDLE?y+(d-n)/2:D==mxConstants.ALIGN_BOTTOM?
-y+(d-n-u):y+u;a.save();l=new g;l.style=this.style;g.prototype.paintVertexShape.call(l,a,k,y,r,n);a.restore()}e++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",E);mxUtils.extend(r,mxCylinder);r.prototype.redrawPath=function(a,c,b,f,d,e){e?(a.moveTo(0,0),a.lineTo(f/2,d/2),a.lineTo(f,0),a.end()):(a.moveTo(0,0),a.lineTo(f,0),a.lineTo(f,d),a.lineTo(0,d),a.close())};mxCellRenderer.registerShape("message",r);mxUtils.extend(C,mxShape);
-C.prototype.paintBackground=function(a,c,b,f,d){a.translate(c,b);a.ellipse(f/4,0,f/2,d/4);a.fillAndStroke();a.begin();a.moveTo(f/2,d/4);a.lineTo(f/2,2*d/3);a.moveTo(f/2,d/3);a.lineTo(0,d/3);a.moveTo(f/2,d/3);a.lineTo(f,d/3);a.moveTo(f/2,2*d/3);a.lineTo(0,d);a.moveTo(f/2,2*d/3);a.lineTo(f,d);a.end();a.stroke()};mxCellRenderer.registerShape("umlActor",C);mxUtils.extend(Q,mxShape);Q.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};Q.prototype.paintBackground=function(a,
-c,b,f,d){a.translate(c,b);a.begin();a.moveTo(0,d/4);a.lineTo(0,3*d/4);a.end();a.stroke();a.begin();a.moveTo(0,d/2);a.lineTo(f/6,d/2);a.end();a.stroke();a.ellipse(f/6,0,5*f/6,d);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",Q);mxUtils.extend(O,mxEllipse);O.prototype.paintVertexShape=function(a,c,b,f,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+f/8,b+d);a.lineTo(c+7*f/8,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",O);mxUtils.extend(M,
-mxShape);M.prototype.paintVertexShape=function(a,c,b,f,d){a.translate(c,b);a.begin();a.moveTo(f,0);a.lineTo(0,d);a.moveTo(0,0);a.lineTo(f,d);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",M);mxUtils.extend(H,mxShape);H.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+a.height/8,a.width,7*a.height/8)};H.prototype.paintBackground=function(a,c,b,f,d){a.translate(c,b);a.begin();a.moveTo(3*f/8,d/8*1.1);a.lineTo(5*f/8,0);a.end();a.stroke();a.ellipse(0,d/8,f,7*d/8);a.fillAndStroke()};
-H.prototype.paintForeground=function(a,c,b,f,d){a.begin();a.moveTo(3*f/8,d/8*1.1);a.lineTo(5*f/8,d/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",H);mxUtils.extend(B,mxRectangleShape);B.prototype.size=40;B.prototype.isHtmlAllowed=function(){return!1};B.prototype.getLabelBounds=function(a){var c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(a.x,a.y,a.width,c)};B.prototype.paintBackground=function(a,c,b,f,
-d){var e=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),g=mxUtils.getValue(this.style,"participant");null==g||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,a,c,b,f,e):(g=this.state.view.graph.cellRenderer.getShape(g),null!=g&&g!=B&&(g=new g,g.apply(this.state),a.save(),g.paintVertexShape(a,c,b,f,e),a.restore()));e<d&&(a.setDashed(!0),a.begin(),a.moveTo(c+f/2,b+e),a.lineTo(c+f/2,b+d),a.end(),a.stroke())};B.prototype.paintForeground=function(a,
-c,b,f,d){var e=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,a,c,b,f,Math.min(d,e))};mxCellRenderer.registerShape("umlLifeline",B);mxUtils.extend(I,mxShape);I.prototype.width=60;I.prototype.height=30;I.prototype.corner=10;I.prototype.getLabelMargins=function(a){return new mxRectangle(0,0,a.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),a.height-parseFloat(mxUtils.getValue(this.style,
-"height",this.height)*this.scale))};I.prototype.paintBackground=function(a,c,b,f,d){var e=this.corner,g=Math.min(f,Math.max(e,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),l=Math.min(d,Math.max(1.5*e,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),D=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);D!=mxConstants.NONE&&(a.setFillColor(D),a.rect(c,b,f,d),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=
-mxConstants.NONE?(this.getGradientBounds(a,c,b,f,d),a.setGradient(this.fill,this.gradient,c,b,f,d,this.gradientDirection)):a.setFillColor(this.fill);a.begin();a.moveTo(c,b);a.lineTo(c+g,b);a.lineTo(c+g,b+Math.max(0,l-1.5*e));a.lineTo(c+Math.max(0,g-e),b+l);a.lineTo(c,b+l);a.close();a.fillAndStroke();a.begin();a.moveTo(c+g,b);a.lineTo(c+f,b);a.lineTo(c+f,b+d);a.lineTo(c,b+d);a.lineTo(c,b+l);a.stroke()};mxCellRenderer.registerShape("umlFrame",I);mxPerimeter.LifelinePerimeter=function(a,c,b,f){f=B.prototype.size;
-null!=c&&(f=mxUtils.getValue(c.style,"size",f)*c.view.scale);c=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;b.x<a.getCenterX()&&(c=-1*(c+1));return new mxPoint(a.getCenterX()+c,Math.min(a.y+a.height,Math.max(a.y+f,b.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(a,c,b,f){f=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);
-mxPerimeter.BackbonePerimeter=function(a,c,b,f){f=parseFloat(c.style[mxConstants.STYLE_STROKEWIDTH]||1)*c.view.scale/2-1;null!=c.style.backboneSize&&(f+=parseFloat(c.style.backboneSize)*c.view.scale/2-1);if("south"==c.style[mxConstants.STYLE_DIRECTION]||"north"==c.style[mxConstants.STYLE_DIRECTION])return b.x<a.getCenterX()&&(f=-1*(f+1)),new mxPoint(a.getCenterX()+f,Math.min(a.y+a.height,Math.max(a.y,b.y)));b.y<a.getCenterY()&&(f=-1*(f+1));return new mxPoint(Math.min(a.x+a.width,Math.max(a.x,b.x)),
-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;
+this.style||"0"==mxUtils.getValue(this.style,"comic","0"))&&Ka.apply(this,arguments)};var La=mxRectangleShape.prototype.paintBackground;mxRectangleShape.prototype.paintBackground=function(a,d,b,c,f){if(null==a.handJiggle)La.apply(this,arguments);else{var e=!0;null!=this.style&&(e="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(e||null!=this.fill&&this.fill!=mxConstants.NONE||null!=this.stroke&&this.stroke!=mxConstants.NONE)e||null!=this.fill&&this.fill!=mxConstants.NONE||
+(a.pointerEvents=!1),a.begin(),this.isRounded?("1"==mxUtils.getValue(this.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?e=Math.min(c/2,Math.min(f/2,mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2)):(e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.min(c*e,f*e)),a.moveTo(d+e,b),a.lineTo(d+c-e,b),a.quadTo(d+c,b,d+c,b+e),a.lineTo(d+c,b+f-e),a.quadTo(d+c,b+f,d+c-e,b+f),a.lineTo(d+e,b+f),a.quadTo(d,b+f,d,b+f-e),
+a.lineTo(d,b+e),a.quadTo(d,b,d+e,b)):(a.moveTo(d,b),a.lineTo(d+c,b),a.lineTo(d+c,b+f),a.lineTo(d,b+f),a.lineTo(d,b)),a.close(),a.end(),a.fillAndStroke()}};var Ma=mxRectangleShape.prototype.paintForeground;mxRectangleShape.prototype.paintForeground=function(a,d,b,c,f){null==a.handJiggle&&Ma.apply(this,arguments)};mxUtils.extend(p,mxRectangleShape);p.prototype.size=.1;p.prototype.isHtmlAllowed=function(){return!1};p.prototype.getLabelBounds=function(a){if(mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,
+!0)==(null==this.direction||this.direction==mxConstants.DIRECTION_EAST||this.direction==mxConstants.DIRECTION_WEST)){var d=a.width,b=a.height;a=new mxRectangle(a.x,a.y,d,b);var c=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var f=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,c=Math.max(c,Math.min(d*f,b*f));a.x+=Math.round(c);a.width-=Math.round(2*c)}return a};p.prototype.paintForeground=
+function(a,d,b,c,f){var e=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));if(this.isRounded)var g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(c*g,f*g));e=Math.round(e);a.begin();a.moveTo(d+e,b);a.lineTo(d+e,b+f);a.moveTo(d+c-e,b);a.lineTo(d+c-e,b+f);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("process",p);mxUtils.extend(y,
+mxRectangleShape);y.prototype.paintBackground=function(a,d,b,c,f){a.setFillColor(mxConstants.NONE);a.rect(d,b,c,f);a.fill()};y.prototype.paintForeground=function(a,d,b,c,f){};mxCellRenderer.registerShape("transparent",y);mxUtils.extend(x,mxHexagon);x.prototype.size=30;x.prototype.position=.5;x.prototype.position2=.5;x.prototype.base=20;x.prototype.getLabelMargins=function(){return new mxRectangle(0,0,0,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale)};x.prototype.isRoundable=
+function(){return!0};x.prototype.redrawPath=function(a,d,b,c,f){d=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));var e=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position",this.position)))),g=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2)))),l=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,"base",this.base))));
+this.addPoints(a,[new mxPoint(0,0),new mxPoint(c,0),new mxPoint(c,f-b),new mxPoint(Math.min(c,e+l),f-b),new mxPoint(g,f),new mxPoint(Math.max(0,e),f-b),new mxPoint(0,f-b)],this.isRounded,d,!0,[4])};mxCellRenderer.registerShape("callout",x);mxUtils.extend(u,mxActor);u.prototype.size=.2;u.prototype.fixedSize=20;u.prototype.isRoundable=function(){return!0};u.prototype.redrawPath=function(a,d,b,c,f){d="0"!=mxUtils.getValue(this.style,"fixedSize","0")?Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,
+"size",this.fixedSize)))):c*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,0),new mxPoint(c-d,0),new mxPoint(c,f/2),new mxPoint(c-d,f),new mxPoint(0,f),new mxPoint(d,f/2)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("step",u);mxUtils.extend(G,mxHexagon);G.prototype.size=.25;G.prototype.isRoundable=function(){return!0};G.prototype.redrawPath=
+function(a,d,b,c,f){d=c*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(d,0),new mxPoint(c-d,0),new mxPoint(c,.5*f),new mxPoint(c-d,f),new mxPoint(d,f),new mxPoint(0,.5*f)],this.isRounded,b,!0)};mxCellRenderer.registerShape("hexagon",G);mxUtils.extend(z,mxRectangleShape);z.prototype.isHtmlAllowed=function(){return!1};z.prototype.paintForeground=function(a,
+d,b,c,f){var e=Math.min(c/5,f/5)+1;a.begin();a.moveTo(d+c/2,b+e);a.lineTo(d+c/2,b+f-e);a.moveTo(d+e,b+f/2);a.lineTo(d+c-e,b+f/2);a.end();a.stroke();mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("plus",z);var Fa=mxRhombus.prototype.paintVertexShape;mxRhombus.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var d=(2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+
+d,a.y+d,a.width-2*d,a.height-2*d)}return a};mxRhombus.prototype.paintVertexShape=function(a,d,b,c,f){Fa.apply(this,arguments);if(!this.outline&&1==this.style["double"]){var e=2*Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);d+=e;b+=e;c-=2*e;f-=2*e;0<c&&0<f&&(a.setShadow(!1),Fa.apply(this,[a,d,b,c,f]))}};mxUtils.extend(E,mxRectangleShape);E.prototype.isHtmlAllowed=function(){return!1};E.prototype.getLabelBounds=function(a){if(1==this.style["double"]){var d=(Math.max(2,
+this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0))*this.scale;return new mxRectangle(a.x+d,a.y+d,a.width-2*d,a.height-2*d)}return a};E.prototype.paintForeground=function(a,d,b,c,f){if(null!=this.style){if(!this.outline&&1==this.style["double"]){var e=Math.max(2,this.strokewidth+1)+parseFloat(this.style[mxConstants.STYLE_MARGIN]||0);d+=e;b+=e;c-=2*e;f-=2*e;0<c&&0<f&&mxRectangleShape.prototype.paintBackground.apply(this,arguments)}a.setDashed(!1);var e=0,g;do{g=mxCellRenderer.defaultShapes[this.style["symbol"+
+e]];if(null!=g){var l=this.style["symbol"+e+"Align"],D=this.style["symbol"+e+"VerticalAlign"],r=this.style["symbol"+e+"Width"],n=this.style["symbol"+e+"Height"],p=this.style["symbol"+e+"Spacing"]||0,u=this.style["symbol"+e+"VSpacing"]||p,k=this.style["symbol"+e+"ArcSpacing"];null!=k&&(k*=this.getArcSize(c+this.strokewidth,f+this.strokewidth),p+=k,u+=k);var k=d,y=b,k=l==mxConstants.ALIGN_CENTER?k+(c-r)/2:l==mxConstants.ALIGN_RIGHT?k+(c-r-p):k+p,y=D==mxConstants.ALIGN_MIDDLE?y+(f-n)/2:D==mxConstants.ALIGN_BOTTOM?
+y+(f-n-u):y+u;a.save();l=new g;l.style=this.style;g.prototype.paintVertexShape.call(l,a,k,y,r,n);a.restore()}e++}while(null!=g)}mxRectangleShape.prototype.paintForeground.apply(this,arguments)};mxCellRenderer.registerShape("ext",E);mxUtils.extend(r,mxCylinder);r.prototype.redrawPath=function(a,d,b,c,f,e){e?(a.moveTo(0,0),a.lineTo(c/2,f/2),a.lineTo(c,0),a.end()):(a.moveTo(0,0),a.lineTo(c,0),a.lineTo(c,f),a.lineTo(0,f),a.close())};mxCellRenderer.registerShape("message",r);mxUtils.extend(C,mxShape);
+C.prototype.paintBackground=function(a,d,b,c,f){a.translate(d,b);a.ellipse(c/4,0,c/2,f/4);a.fillAndStroke();a.begin();a.moveTo(c/2,f/4);a.lineTo(c/2,2*f/3);a.moveTo(c/2,f/3);a.lineTo(0,f/3);a.moveTo(c/2,f/3);a.lineTo(c,f/3);a.moveTo(c/2,2*f/3);a.lineTo(0,f);a.moveTo(c/2,2*f/3);a.lineTo(c,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlActor",C);mxUtils.extend(Q,mxShape);Q.prototype.getLabelMargins=function(a){return new mxRectangle(a.width/6,0,0,0)};Q.prototype.paintBackground=function(a,
+d,b,c,f){a.translate(d,b);a.begin();a.moveTo(0,f/4);a.lineTo(0,3*f/4);a.end();a.stroke();a.begin();a.moveTo(0,f/2);a.lineTo(c/6,f/2);a.end();a.stroke();a.ellipse(c/6,0,5*c/6,f);a.fillAndStroke()};mxCellRenderer.registerShape("umlBoundary",Q);mxUtils.extend(O,mxEllipse);O.prototype.paintVertexShape=function(a,d,b,c,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(d+c/8,b+f);a.lineTo(d+7*c/8,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("umlEntity",O);mxUtils.extend(M,
+mxShape);M.prototype.paintVertexShape=function(a,d,b,c,f){a.translate(d,b);a.begin();a.moveTo(c,0);a.lineTo(0,f);a.moveTo(0,0);a.lineTo(c,f);a.end();a.stroke()};mxCellRenderer.registerShape("umlDestroy",M);mxUtils.extend(H,mxShape);H.prototype.getLabelBounds=function(a){return new mxRectangle(a.x,a.y+a.height/8,a.width,7*a.height/8)};H.prototype.paintBackground=function(a,d,b,c,f){a.translate(d,b);a.begin();a.moveTo(3*c/8,f/8*1.1);a.lineTo(5*c/8,0);a.end();a.stroke();a.ellipse(0,f/8,c,7*f/8);a.fillAndStroke()};
+H.prototype.paintForeground=function(a,d,b,c,f){a.begin();a.moveTo(3*c/8,f/8*1.1);a.lineTo(5*c/8,f/4);a.end();a.stroke()};mxCellRenderer.registerShape("umlControl",H);mxUtils.extend(B,mxRectangleShape);B.prototype.size=40;B.prototype.isHtmlAllowed=function(){return!1};B.prototype.getLabelBounds=function(a){var d=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.style,"size",this.size))*this.scale));return new mxRectangle(a.x,a.y,a.width,d)};B.prototype.paintBackground=function(a,d,b,c,
+f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size)))),g=mxUtils.getValue(this.style,"participant");null==g||null==this.state?mxRectangleShape.prototype.paintBackground.call(this,a,d,b,c,e):(g=this.state.view.graph.cellRenderer.getShape(g),null!=g&&g!=B&&(g=new g,g.apply(this.state),a.save(),g.paintVertexShape(a,d,b,c,e),a.restore()));e<f&&(a.setDashed(!0),a.begin(),a.moveTo(d+c/2,b+e),a.lineTo(d+c/2,b+f),a.end(),a.stroke())};B.prototype.paintForeground=function(a,
+d,b,c,f){var e=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"size",this.size))));mxRectangleShape.prototype.paintForeground.call(this,a,d,b,c,Math.min(f,e))};mxCellRenderer.registerShape("umlLifeline",B);mxUtils.extend(I,mxShape);I.prototype.width=60;I.prototype.height=30;I.prototype.corner=10;I.prototype.getLabelMargins=function(a){return new mxRectangle(0,0,a.width-parseFloat(mxUtils.getValue(this.style,"width",this.width)*this.scale),a.height-parseFloat(mxUtils.getValue(this.style,
+"height",this.height)*this.scale))};I.prototype.paintBackground=function(a,d,b,c,f){var e=this.corner,g=Math.min(c,Math.max(e,parseFloat(mxUtils.getValue(this.style,"width",this.width)))),l=Math.min(f,Math.max(1.5*e,parseFloat(mxUtils.getValue(this.style,"height",this.height)))),D=mxUtils.getValue(this.style,mxConstants.STYLE_SWIMLANE_FILLCOLOR,mxConstants.NONE);D!=mxConstants.NONE&&(a.setFillColor(D),a.rect(d,b,c,f),a.fill());null!=this.fill&&this.fill!=mxConstants.NONE&&this.gradient&&this.gradient!=
+mxConstants.NONE?(this.getGradientBounds(a,d,b,c,f),a.setGradient(this.fill,this.gradient,d,b,c,f,this.gradientDirection)):a.setFillColor(this.fill);a.begin();a.moveTo(d,b);a.lineTo(d+g,b);a.lineTo(d+g,b+Math.max(0,l-1.5*e));a.lineTo(d+Math.max(0,g-e),b+l);a.lineTo(d,b+l);a.close();a.fillAndStroke();a.begin();a.moveTo(d+g,b);a.lineTo(d+c,b);a.lineTo(d+c,b+f);a.lineTo(d,b+f);a.lineTo(d,b+l);a.stroke()};mxCellRenderer.registerShape("umlFrame",I);mxPerimeter.LifelinePerimeter=function(a,d,b,c){c=B.prototype.size;
+null!=d&&(c=mxUtils.getValue(d.style,"size",c)*d.view.scale);d=parseFloat(d.style[mxConstants.STYLE_STROKEWIDTH]||1)*d.view.scale/2-1;b.x<a.getCenterX()&&(d=-1*(d+1));return new mxPoint(a.getCenterX()+d,Math.min(a.y+a.height,Math.max(a.y+c,b.y)))};mxStyleRegistry.putValue("lifelinePerimeter",mxPerimeter.LifelinePerimeter);mxPerimeter.OrthogonalPerimeter=function(a,d,b,c){c=!0;return mxPerimeter.RectanglePerimeter.apply(this,arguments)};mxStyleRegistry.putValue("orthogonalPerimeter",mxPerimeter.OrthogonalPerimeter);
+mxPerimeter.BackbonePerimeter=function(a,d,b,c){c=parseFloat(d.style[mxConstants.STYLE_STROKEWIDTH]||1)*d.view.scale/2-1;null!=d.style.backboneSize&&(c+=parseFloat(d.style.backboneSize)*d.view.scale/2-1);if("south"==d.style[mxConstants.STYLE_DIRECTION]||"north"==d.style[mxConstants.STYLE_DIRECTION])return b.x<a.getCenterX()&&(c=-1*(c+1)),new mxPoint(a.getCenterX()+c,Math.min(a.y+a.height,Math.max(a.y,b.y)));b.y<a.getCenterY()&&(c=-1*(c+1));return new mxPoint(Math.min(a.x+a.width,Math.max(a.x,b.x)),
+a.getCenterY()+c)};mxStyleRegistry.putValue("backbonePerimeter",mxPerimeter.BackbonePerimeter);mxPerimeter.CalloutPerimeter=function(a,d,b,c){return mxPerimeter.RectanglePerimeter(mxUtils.getDirectedBounds(a,new mxRectangle(0,0,0,Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(d.style,"size",x.prototype.size))*d.view.scale))),d.style),d,b,c)};mxStyleRegistry.putValue("calloutPerimeter",mxPerimeter.CalloutPerimeter);mxPerimeter.ParallelogramPerimeter=function(a,b,c,f){var e=d.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.x<g||f.x>g+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.x<g||b.x>g+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.x<g||b.x>g+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=G.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.x<e||b.x>e+
-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,r=.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,r),a.lineTo(g,r),a.lineTo(g,r+c),a.lineTo(b,r+c)):(a.moveTo(b,0),a.lineTo(f,0),a.lineTo(f,d),a.lineTo(b,d),
-a.lineTo(b,r+c),a.lineTo(0,r+c),a.lineTo(0,r),a.lineTo(b,r),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<f&&0<d&&(a.ellipse(c+e,b+e,f-2*e,d-2*e),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&(a.ellipse(c,b,f,d),a.stroke())};mxCellRenderer.registerShape("endState",
+l+r),new mxPoint(g+e,l)]);r=a.getCenterX();a=a.getCenterY();a=new mxPoint(r,a);f&&(c.x<g||c.x>g+D?a.y=c.y:a.x=c.x);return mxUtils.getPerimeterPoint(l,a,c)};mxStyleRegistry.putValue("parallelogramPerimeter",mxPerimeter.ParallelogramPerimeter);mxPerimeter.TrapezoidPerimeter=function(a,d,b,c){var e=f.prototype.size;null!=d&&(e=mxUtils.getValue(d.style,"size",e));var g=a.x,l=a.y,r=a.width,D=a.height;d=null!=d?mxUtils.getValue(d.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;
+d==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)]):d==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)]):d==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);c&&(b.x<g||b.x>g+r?a.y=b.y:a.x=b.x);return mxUtils.getPerimeterPoint(l,a,b)};mxStyleRegistry.putValue("trapezoidPerimeter",mxPerimeter.TrapezoidPerimeter);mxPerimeter.StepPerimeter=function(a,d,b,c){var f="0"!=mxUtils.getValue(d.style,"fixedSize","0"),e=f?u.prototype.fixedSize:u.prototype.size;null!=d&&(e=mxUtils.getValue(d.style,
+"size",e));var g=a.x,l=a.y,r=a.width,D=a.height,n=a.getCenterX();a=a.getCenterY();d=null!=d?mxUtils.getValue(d.style,mxConstants.STYLE_DIRECTION,mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;d==mxConstants.DIRECTION_EAST?(f=f?Math.max(0,Math.min(r,e)):r*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(g+r-f,l),new mxPoint(g+r,a),new mxPoint(g+r-f,l+D),new mxPoint(g,l+D),new mxPoint(g+f,a),new mxPoint(g,l)]):d==mxConstants.DIRECTION_WEST?(f=f?Math.max(0,Math.min(r,e)):r*Math.max(0,
+Math.min(1,e)),l=[new mxPoint(g+f,l),new mxPoint(g+r,l),new mxPoint(g+r-f,a),new mxPoint(g+r,l+D),new mxPoint(g+f,l+D),new mxPoint(g,a),new mxPoint(g+f,l)]):d==mxConstants.DIRECTION_NORTH?(f=f?Math.max(0,Math.min(D,e)):D*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l+f),new mxPoint(n,l),new mxPoint(g+r,l+f),new mxPoint(g+r,l+D),new mxPoint(n,l+D-f),new mxPoint(g,l+D),new mxPoint(g,l+f)]):(f=f?Math.max(0,Math.min(D,e)):D*Math.max(0,Math.min(1,e)),l=[new mxPoint(g,l),new mxPoint(n,l+f),new mxPoint(g+
+r,l),new mxPoint(g+r,l+D-f),new mxPoint(n,l+D),new mxPoint(g,l+D-f),new mxPoint(g,l)]);n=new mxPoint(n,a);c&&(b.x<g||b.x>g+r?n.y=b.y:n.x=b.x);return mxUtils.getPerimeterPoint(l,n,b)};mxStyleRegistry.putValue("stepPerimeter",mxPerimeter.StepPerimeter);mxPerimeter.HexagonPerimeter2=function(a,d,b,c){var f=G.prototype.size;null!=d&&(f=mxUtils.getValue(d.style,"size",f));var e=a.x,g=a.y,l=a.width,r=a.height,D=a.getCenterX();a=a.getCenterY();d=null!=d?mxUtils.getValue(d.style,mxConstants.STYLE_DIRECTION,
+mxConstants.DIRECTION_EAST):mxConstants.DIRECTION_EAST;d==mxConstants.DIRECTION_NORTH||d==mxConstants.DIRECTION_SOUTH?(f=r*Math.max(0,Math.min(1,f)),g=[new mxPoint(D,g),new mxPoint(e+l,g+f),new mxPoint(e+l,g+r-f),new mxPoint(D,g+r),new mxPoint(e,g+r-f),new mxPoint(e,g+f),new mxPoint(D,g)]):(f=l*Math.max(0,Math.min(1,f)),g=[new mxPoint(e+f,g),new mxPoint(e+l-f,g),new mxPoint(e+l,a),new mxPoint(e+l-f,g+r),new mxPoint(e+f,g+r),new mxPoint(e,a),new mxPoint(e+f,g)]);D=new mxPoint(D,a);c&&(b.x<e||b.x>e+
+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,d,b,c,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size));a.translate(d,b);a.ellipse((c-e)/2,0,e,e);a.fillAndStroke();a.begin();a.moveTo(c/2,e);a.lineTo(c/2,f);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,d,b,c,f){var e=parseFloat(mxUtils.getValue(this.style,"size",this.size)),g=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(d,b);a.begin();a.moveTo(c/2,e+g);a.lineTo(c/2,f);a.end();a.stroke();a.begin();a.moveTo((c-e)/2-g,e/2);a.quadTo((c-e)/2-g,e+g,c/2,e+g);a.quadTo((c+e)/2+g,e+g,(c+e)/2+g,e/2);a.end();a.stroke()};mxCellRenderer.registerShape("requires",V);mxUtils.extend(U,mxShape);U.prototype.paintBackground=
+function(a,d,b,c,f){a.translate(d,b);a.begin();a.moveTo(0,0);a.quadTo(c,0,c,f/2);a.quadTo(c,f,0,f);a.end();a.stroke()};mxCellRenderer.registerShape("requiredInterface",U);mxUtils.extend(X,mxShape);X.prototype.inset=2;X.prototype.paintBackground=function(a,d,b,c,f){var e=parseFloat(mxUtils.getValue(this.style,"inset",this.inset))+this.strokewidth;a.translate(d,b);a.ellipse(0,e,c-2*e,f-2*e);a.fillAndStroke();a.begin();a.moveTo(c/2,0);a.quadTo(c,0,c,f/2);a.quadTo(c,f,c/2,f);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,d,b,c,f,e){var g=parseFloat(mxUtils.getValue(this.style,"jettyWidth",this.jettyWidth));d=parseFloat(mxUtils.getValue(this.style,"jettyHeight",this.jettyHeight));b=g/2;var g=b+g/2,l=.3*f-d/2,r=.7*f-d/2;e?(a.moveTo(b,l),a.lineTo(g,l),a.lineTo(g,l+d),a.lineTo(b,l+d),a.moveTo(b,r),a.lineTo(g,r),a.lineTo(g,r+d),a.lineTo(b,r+d)):(a.moveTo(b,0),a.lineTo(c,0),a.lineTo(c,f),a.lineTo(b,f),
+a.lineTo(b,r+d),a.lineTo(0,r+d),a.lineTo(0,r),a.lineTo(b,r),a.lineTo(b,l+d),a.lineTo(0,l+d),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,d,b,c,f){var e=Math.min(4,Math.min(c/5,f/5));0<c&&0<f&&(a.ellipse(d+e,b+e,c-2*e,f-2*e),a.fillAndStroke());a.setShadow(!1);this.outerStroke&&(a.ellipse(d,b,c,f),a.stroke())};mxCellRenderer.registerShape("endState",
aa);mxUtils.extend(la,aa);la.prototype.outerStroke=!1;mxCellRenderer.registerShape("startState",la);mxUtils.extend(ea,mxArrowConnector);ea.prototype.defaultWidth=4;ea.prototype.isOpenEnded=function(){return!0};ea.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};ea.prototype.isArrowRounded=function(){return this.isRounded};mxCellRenderer.registerShape("link",ea);mxUtils.extend(Y,mxArrowConnector);Y.prototype.defaultWidth=
10;Y.prototype.defaultArrowWidth=20;Y.prototype.getStartArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"startWidth",this.defaultArrowWidth)};Y.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Y.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",Y);mxUtils.extend(ba,mxActor);
-ba.prototype.size=30;ba.prototype.isRoundable=function(){return!0};ba.prototype.redrawPath=function(a,c,b,f,d){c=Math.min(d,parseFloat(mxUtils.getValue(this.style,"size",this.size)));b=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,d),new mxPoint(0,c),new mxPoint(f,0),new mxPoint(f,d)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("manualInput",ba);mxUtils.extend(K,mxRectangleShape);K.prototype.dx=20;K.prototype.dy=20;
-K.prototype.isHtmlAllowed=function(){return!1};K.prototype.paintForeground=function(a,c,b,f,d){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var e=0;if(this.isRounded)var g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(f*g,d*g));g=Math.max(e,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));e=Math.max(e,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.begin();a.moveTo(c,
-b+e);a.lineTo(c+f,b+e);a.end();a.stroke();a.begin();a.moveTo(c+g,b);a.lineTo(c+g,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("internalStorage",K);mxUtils.extend(L,mxActor);L.prototype.dx=20;L.prototype.dy=20;L.prototype.redrawPath=function(a,c,b,f,d){c=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var e=mxUtils.getValue(this.style,
-mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(f,0),new mxPoint(f,b),new mxPoint(c,b),new mxPoint(c,d),new mxPoint(0,d)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("corner",L);mxUtils.extend(ha,mxActor);ha.prototype.redrawPath=function(a,c,b,f,d){a.moveTo(0,0);a.lineTo(0,d);a.end();a.moveTo(f,0);a.lineTo(f,d);a.end();a.moveTo(0,d/2);a.lineTo(f,d/2);a.end()};mxCellRenderer.registerShape("crossbar",ha);mxUtils.extend(N,mxActor);N.prototype.dx=
-20;N.prototype.dy=20;N.prototype.redrawPath=function(a,c,b,f,d){c=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(f,0),new mxPoint(f,b),new mxPoint((f+c)/2,b),new mxPoint((f+c)/2,d),new mxPoint((f-c)/
-2,d),new mxPoint((f-c)/2,b),new mxPoint(0,b)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("tee",N);mxUtils.extend(R,mxActor);R.prototype.arrowWidth=.3;R.prototype.arrowSize=.2;R.prototype.redrawPath=function(a,c,b,f,d){var e=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));b=(d-e)/2;var e=b+e,g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,
-mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,b),new mxPoint(f-c,b),new mxPoint(f-c,0),new mxPoint(f,d/2),new mxPoint(f-c,d),new mxPoint(f-c,e),new mxPoint(0,e)],this.isRounded,g,!0);a.end()};mxCellRenderer.registerShape("singleArrow",R);mxUtils.extend(ia,mxActor);ia.prototype.redrawPath=function(a,c,b,f,d){var e=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",R.prototype.arrowWidth))));c=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",
-R.prototype.arrowSize))));b=(d-e)/2;var e=b+e,g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,d/2),new mxPoint(c,0),new mxPoint(c,b),new mxPoint(f-c,b),new mxPoint(f-c,0),new mxPoint(f,d/2),new mxPoint(f-c,d),new mxPoint(f-c,e),new mxPoint(c,e),new mxPoint(c,d)],this.isRounded,g,!0);a.end()};mxCellRenderer.registerShape("doubleArrow",ia);mxUtils.extend(fa,mxActor);fa.prototype.size=.1;fa.prototype.redrawPath=function(a,c,b,f,d){c=
-f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(c,0);a.lineTo(f,0);a.quadTo(f-2*c,d/2,f,d);a.lineTo(c,d);a.quadTo(c-2*c,d/2,c,0);a.close();a.end()};mxCellRenderer.registerShape("dataStorage",fa);mxUtils.extend(F,mxActor);F.prototype.redrawPath=function(a,c,b,f,d){a.moveTo(0,0);a.quadTo(f,0,f,d/2);a.quadTo(f,d,0,d);a.close();a.end()};mxCellRenderer.registerShape("or",F);mxUtils.extend(ja,mxActor);ja.prototype.redrawPath=function(a,c,b,f,d){a.moveTo(0,0);
-a.quadTo(f,0,f,d/2);a.quadTo(f,d,0,d);a.quadTo(f/2,d/2,0,0);a.close();a.end()};mxCellRenderer.registerShape("xor",ja);mxUtils.extend(P,mxActor);P.prototype.size=20;P.prototype.isRoundable=function(){return!0};P.prototype.redrawPath=function(a,c,b,f,d){c=Math.min(f/2,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-c,0),new mxPoint(f,.8*c),new mxPoint(f,
-d),new mxPoint(0,d),new mxPoint(0,.8*c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("loopLimit",P);mxUtils.extend(ca,mxActor);ca.prototype.size=.375;ca.prototype.isRoundable=function(){return!0};ca.prototype.redrawPath=function(a,c,b,f,d){c=d*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,0),new mxPoint(f,0),new mxPoint(f,d-c),new mxPoint(f/
-2,d),new mxPoint(0,d-c)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("offPageConnector",ca);mxUtils.extend(ga,mxEllipse);ga.prototype.paintVertexShape=function(a,c,b,f,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(c+f/2,b+d);a.lineTo(c+f,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("tapeData",ga);mxUtils.extend(W,mxEllipse);W.prototype.paintVertexShape=function(a,c,b,f,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);
-a.begin();a.moveTo(c,b+d/2);a.lineTo(c+f,b+d/2);a.end();a.stroke();a.begin();a.moveTo(c+f/2,b);a.lineTo(c+f/2,b+d);a.end();a.stroke()};mxCellRenderer.registerShape("orEllipse",W);mxUtils.extend(Z,mxEllipse);Z.prototype.paintVertexShape=function(a,c,b,f,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();a.moveTo(c+.145*f,b+.145*d);a.lineTo(c+.855*f,b+.855*d);a.end();a.stroke();a.begin();a.moveTo(c+.855*f,b+.145*d);a.lineTo(c+.145*f,b+.855*d);a.end();a.stroke()};
-mxCellRenderer.registerShape("sumEllipse",Z);mxUtils.extend(wa,mxRhombus);wa.prototype.paintVertexShape=function(a,c,b,f,d){mxRhombus.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();a.moveTo(c,b+d/2);a.lineTo(c+f,b+d/2);a.end();a.stroke()};mxCellRenderer.registerShape("sortShape",wa);mxUtils.extend(ua,mxEllipse);ua.prototype.paintVertexShape=function(a,c,b,f,d){a.begin();a.moveTo(c,b);a.lineTo(c+f,b);a.lineTo(c+f/2,b+d/2);a.close();a.fillAndStroke();a.begin();a.moveTo(c,
-b+d);a.lineTo(c+f,b+d);a.lineTo(c+f/2,b+d/2);a.close();a.fillAndStroke()};mxCellRenderer.registerShape("collate",ua);mxUtils.extend(pa,mxEllipse);pa.prototype.paintVertexShape=function(a,c,b,f,d){var e=b+d-5;a.begin();a.moveTo(c,b);a.lineTo(c,b+d);a.moveTo(c,e);a.lineTo(c+10,e-5);a.moveTo(c,e);a.lineTo(c+10,e+5);a.moveTo(c,e);a.lineTo(c+f,e);a.moveTo(c+f,b);a.lineTo(c+f,b+d);a.moveTo(c+f,e);a.lineTo(c+f-10,e-5);a.moveTo(c+f,e);a.lineTo(c+f-10,e+5);a.end();a.stroke()};mxCellRenderer.registerShape("dimension",
-pa);mxUtils.extend(ta,mxEllipse);ta.prototype.paintVertexShape=function(a,c,b,f,d){this.outline||a.setStrokeColor(null);mxRectangleShape.prototype.paintBackground.apply(this,arguments);null!=this.style&&(a.setStrokeColor(this.stroke),a.rect(c,b,f,d),a.fill(),a.begin(),a.moveTo(c,b),"1"==mxUtils.getValue(this.style,"top","1")?a.lineTo(c+f,b):a.moveTo(c+f,b),"1"==mxUtils.getValue(this.style,"right","1")?a.lineTo(c+f,b+d):a.moveTo(c+f,b+d),"1"==mxUtils.getValue(this.style,"bottom","1")?a.lineTo(c,b+
-d):a.moveTo(c,b+d),"1"==mxUtils.getValue(this.style,"left","1")&&a.lineTo(c,b-this.strokewidth/2),a.end(),a.stroke())};mxCellRenderer.registerShape("partialRectangle",ta);mxUtils.extend(va,mxEllipse);va.prototype.paintVertexShape=function(a,c,b,f,d){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();"vertical"==mxUtils.getValue(this.style,"line")?(a.moveTo(c+f/2,b),a.lineTo(c+f/2,b+d)):(a.moveTo(c,b+d/2),a.lineTo(c+f,b+d/2));a.end();a.stroke()};mxCellRenderer.registerShape("lineEllipse",
-va);mxUtils.extend(ma,mxActor);ma.prototype.redrawPath=function(a,c,b,f,d){c=Math.min(f,d/2);a.moveTo(0,0);a.lineTo(f-c,0);a.quadTo(f,0,f,d/2);a.quadTo(f,d,f-c,d);a.lineTo(0,d);a.close();a.end()};mxCellRenderer.registerShape("delay",ma);mxUtils.extend(ra,mxActor);ra.prototype.size=.2;ra.prototype.redrawPath=function(a,c,b,f,d){c=Math.min(d,f);var e=Math.max(0,Math.min(c,c*parseFloat(mxUtils.getValue(this.style,"size",this.size))));c=(d-e)/2;b=c+e;var g=(f-e)/2,e=g+e;a.moveTo(0,c);a.lineTo(g,c);a.lineTo(g,
-0);a.lineTo(e,0);a.lineTo(e,c);a.lineTo(f,c);a.lineTo(f,b);a.lineTo(e,b);a.lineTo(e,d);a.lineTo(g,d);a.lineTo(g,b);a.lineTo(0,b);a.close();a.end()};mxCellRenderer.registerShape("cross",ra);mxUtils.extend(ka,mxActor);ka.prototype.size=.25;ka.prototype.redrawPath=function(a,c,b,f,d){c=Math.min(f,d/2);b=Math.min(f-c,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*f);a.moveTo(0,d/2);a.lineTo(b,0);a.lineTo(f-c,0);a.quadTo(f,0,f,d/2);a.quadTo(f,d,f-c,d);a.lineTo(b,d);a.close();a.end()};
-mxCellRenderer.registerShape("display",ka);mxUtils.extend(da,mxConnector);da.prototype.origPaintEdgeShape=da.prototype.paintEdgeShape;da.prototype.paintEdgeShape=function(a,c,b){for(var f=[],d=0;d<c.length;d++)f.push(mxUtils.clone(c[d]));var d=a.state.dashed,e=a.state.fixDash;da.prototype.origPaintEdgeShape.apply(this,[a,f,b]);3<=a.state.strokeWidth&&(f=mxUtils.getValue(this.style,"fillColor",null),null!=f&&(a.setStrokeColor(f),a.setStrokeWidth(a.state.strokeWidth-2),a.setDashed(d,e),da.prototype.origPaintEdgeShape.apply(this,
-[a,c,b])))};mxCellRenderer.registerShape("filledEdge",da);"undefined"!==typeof StyleFormatPanel&&function(){var a=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var c=this.format.getSelectionState(),b=a.apply(this,arguments);"umlFrame"==c.style.shape&&b.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return b}}();mxMarker.addMarker("dash",function(a,c,b,f,d,e,g,l,r,n){var p=d*(g+r+1),u=e*(g+r+1);return function(){a.begin();
-a.moveTo(f.x-p/2-u/2,f.y-u/2+p/2);a.lineTo(f.x+u/2-3*p/2,f.y-3*u/2-p/2);a.stroke()}});mxMarker.addMarker("cross",function(a,c,b,f,d,e,g,l,r,n){var p=d*(g+r+1),u=e*(g+r+1);return function(){a.begin();a.moveTo(f.x-p/2-u/2,f.y-u/2+p/2);a.lineTo(f.x+u/2-3*p/2,f.y-3*u/2-p/2);a.moveTo(f.x-p/2+u/2,f.y-u/2-p/2);a.lineTo(f.x-u/2-3*p/2,f.y-3*u/2+p/2);a.stroke()}});mxMarker.addMarker("circle",sa);mxMarker.addMarker("circlePlus",function(a,c,b,f,d,e,g,l,r,n){var p=f.clone(),u=sa.apply(this,arguments),k=d*(g+
-2*r),y=e*(g+2*r);return function(){u.apply(this,arguments);a.begin();a.moveTo(p.x-d*r,p.y-e*r);a.lineTo(p.x-2*k+d*r,p.y-2*y+e*r);a.moveTo(p.x-k-y+e*r,p.y-y+k-d*r);a.lineTo(p.x+y-k-e*r,p.y-y-k+d*r);a.stroke()}});mxMarker.addMarker("async",function(a,c,b,f,d,e,g,l,r,n){c=d*r*1.118;b=e*r*1.118;d*=g+r;e*=g+r;var p=f.clone();p.x-=c;p.y-=b;f.x+=1*-d-c;f.y+=1*-e-b;return function(){a.begin();a.moveTo(p.x,p.y);l?a.lineTo(p.x-d-e/2,p.y-e+d/2):a.lineTo(p.x+e/2-d,p.y-e-d/2);a.lineTo(p.x-d,p.y-e);a.close();n?
-a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(c,b,f,d,e,g,l,r,p,n){e*=l+p;g*=l+p;var u=d.clone();return function(){c.begin();c.moveTo(u.x,u.y);r?c.lineTo(u.x-e-g/a,u.y-g+e/a):c.lineTo(u.x+g/a-e,u.y-g-e/a);c.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var Ga=function(a,c,b){return ya(a,["width"],c,function(c,f,d,e,g){g=a.shape.getEdgeWidth()*a.view.scale+b;return new mxPoint(e.x+f*c/4+d*g/2,e.y+d*c/4-f*g/2)},function(c,f,d,e,g,
-l){c=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));a.style.width=Math.round(2*c)/a.view.scale-b})},ya=function(a,c,b,f,d){return T(a,c,function(c){var d=a.absolutePoints,e=d.length-1;c=a.view.translate;var g=a.view.scale,l=b?d[0]:d[e],d=b?d[1]:d[e-1],e=d.x-l.x,r=d.y-l.y,p=Math.sqrt(e*e+r*r),l=f.call(this,p,e/p,r/p,l,d);return new mxPoint(l.x/g-c.x,l.y/g-c.y)},function(c,f,e){var g=a.absolutePoints,l=g.length-1;c=a.view.translate;var r=a.view.scale,p=b?g[0]:g[l],g=b?g[1]:g[l-1],l=g.x-p.x,
-n=g.y-p.y,u=Math.sqrt(l*l+n*n);f.x=(f.x+c.x)*r;f.y=(f.y+c.y)*r;d.call(this,u,l/u,n/u,p,g,f,e)})},oa=function(a){return function(c){return[T(c,["arrowWidth","arrowSize"],function(c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",R.prototype.arrowWidth))),f=Math.max(0,Math.min(a,mxUtils.getValue(this.state.style,"arrowSize",R.prototype.arrowSize)));return new mxPoint(c.x+(1-f)*c.width,c.y+(1-b)*c.height/2)},function(c,b){this.state.style.arrowWidth=Math.max(0,Math.min(1,
-Math.abs(c.y+c.height/2-b.y)/c.height*2));this.state.style.arrowSize=Math.max(0,Math.min(a,(c.x+c.width-b.x)/c.width))})]}},Ea=function(a,c,b){return function(f){var d=[T(f,["size"],function(b){var f=Math.max(0,Math.min(b.width,Math.min(b.height,parseFloat(mxUtils.getValue(this.state.style,"size",c)))))*a;return new mxPoint(b.x+f,b.y+f)},function(c,b){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(c.width,b.x-c.x),Math.min(c.height,b.y-c.y)))/a)})];b&&mxUtils.getValue(f.style,mxConstants.STYLE_ROUNDED,
-!1)&&d.push(qa(f));return d}},Aa=function(a,c,b,f,d){b=null!=b?b:1;return function(e){var g=[T(e,["size"],function(c){var b=null!=d?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,f=parseFloat(mxUtils.getValue(this.state.style,"size",b?d:a));return new mxPoint(c.x+Math.max(0,Math.min(c.width,f*(b?1:c.width))),c.getCenterY())},function(a,c,f){var g=null!=d?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null;a=g?c.x-a.x:Math.max(0,Math.min(b,(c.x-a.x)/a.width));g&&!mxEvent.isAltDown(f.getEvent())&&
-(a=e.view.graph.snap(a));this.state.style.size=a},null,f)];c&&mxUtils.getValue(e.style,mxConstants.STYLE_ROUNDED,!1)&&g.push(qa(e));return g}},Ha=function(a){return function(c){var b=[T(c,["size"],function(c){var b=Math.max(0,Math.min(a,parseFloat(mxUtils.getValue(this.state.style,"size",f.prototype.size))));return new mxPoint(c.x+b*c.width*.75,c.y+c.height/4)},function(c,b){this.state.style.size=Math.max(0,Math.min(a,(b.x-c.x)/(.75*c.width)))},null,!0)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,
-!1)&&b.push(qa(c));return b}},za=function(){return function(a){var c=[];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(qa(a));return c}},qa=function(a,c){return T(a,[mxConstants.STYLE_ARCSIZE],function(b){var f=null!=c?c:b.height/8;if("1"==mxUtils.getValue(a.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var d=mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(b.x+b.width-Math.min(b.width/2,d),b.y+f)}d=Math.max(0,parseFloat(mxUtils.getValue(a.style,
-mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(b.x+b.width-Math.min(Math.max(b.width/2,b.height/2),Math.min(b.width,b.height)*d),b.y+f)},function(c,b,f){"1"==mxUtils.getValue(a.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(c.width,2*(c.x+c.width-b.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(c.width-b.x+c.x)/Math.min(c.width,c.height))))})},
-T=function(a,c,b,f,d,e){var g=new mxHandle(a,null,mxVertexHandler.prototype.secondaryHandleImage);g.execute=function(){for(var a=0;a<c.length;a++)this.copyStyle(c[a])};g.getPosition=b;g.setPosition=f;g.ignoreGrid=null!=d?d:!0;if(e){var l=g.positionChanged;g.positionChanged=function(){l.apply(this,arguments);a.view.invalidate(this.state.cell);a.view.validate()}}return g},Ba={link:function(a){return[Ga(a,!0,10),Ga(a,!1,10)]},flexArrow:function(a){var c=a.view.graph.gridSize/a.view.scale,b=[];mxUtils.getValue(a.style,
-mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(ya(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,f,d,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(d.x+b*(e+a.shape.strokewidth*a.view.scale)+f*c/2,d.y+f*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,f,d,e,g,l,r){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,
-e.y,g.x,g.y,l.x,l.y));f=mxUtils.ptLineDist(e.x,e.y,e.x+d,e.y-f,l.x,l.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(f-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(r.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(r.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=
-a.style[mxConstants.STYLE_ENDSIZE])})),b.push(ya(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(c,b,f,d,e){c=(a.shape.getStartArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(d.x+b*(e+a.shape.strokewidth*a.view.scale)+f*c/2,d.y+f*(e+a.shape.strokewidth*a.view.scale)-b*c/2)},function(b,f,d,e,g,l,r){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,
-g.y,l.x,l.y));f=mxUtils.ptLineDist(e.x,e.y,e.x+d,e.y-f,l.x,l.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(f-a.shape.strokewidth)/3)/100/a.view.scale;a.style.startWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(r.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(r.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<
-c/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(a.style.startWidth)-parseFloat(a.style.endWidth))<c&&(a.style.startWidth=a.style.endWidth))})));mxUtils.getValue(a.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(ya(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,f,d,e){c=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/
-5)*a.view.scale;return new mxPoint(d.x+b*(e+a.shape.strokewidth*a.view.scale)-f*c/2,d.y+f*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,f,d,e,g,l,r){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));f=mxUtils.ptLineDist(e.x,e.y,e.x+d,e.y-f,l.x,l.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(f-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(r.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);
-mxEvent.isAltDown(r.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE])})),b.push(ya(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(c,b,f,d,e){c=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(d.x+
-b*(e+a.shape.strokewidth*a.view.scale)-f*c/2,d.y+f*(e+a.shape.strokewidth*a.view.scale)+b*c/2)},function(b,f,d,e,g,l,r){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));f=mxUtils.ptLineDist(e.x,e.y,e.x+d,e.y-f,l.x,l.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(f-a.shape.strokewidth)/3)/100/a.view.scale;a.style.endWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(r.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],
-a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(r.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<c/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(a.style.endWidth)-parseFloat(a.style.startWidth))<c&&(a.style.endWidth=a.style.startWidth))})));return b},swimlane:function(a){var c=[T(a,[mxConstants.STYLE_STARTSIZE],function(c){var b=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,
-mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(c.getCenterX(),c.y+Math.max(0,Math.min(c.height,b))):new mxPoint(c.x+Math.max(0,Math.min(c.width,b)),c.getCenterY())},function(c,b){a.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(c.height,b.y-c.y))):Math.round(Math.max(0,Math.min(c.width,b.x-c.x)))})];if(mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED)){var b=
-parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));c.push(qa(a,b/2))}return c},label:za(),ext:za(),rectangle:za(),triangle:za(),rhombus:za(),umlLifeline:function(a){return[T(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",B.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))},!1)]},umlFrame:function(a){return[T(a,
-["width","height"],function(a){var c=Math.max(I.prototype.corner,Math.min(a.width,mxUtils.getValue(this.state.style,"width",I.prototype.width))),b=Math.max(1.5*I.prototype.corner,Math.min(a.height,mxUtils.getValue(this.state.style,"height",I.prototype.height)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.width=Math.round(Math.max(I.prototype.corner,Math.min(a.width,c.x-a.x)));this.state.style.height=Math.round(Math.max(1.5*I.prototype.corner,Math.min(a.height,c.y-a.y)))},!1)]},
-process:function(a){var c=[T(a,["size"],function(a){var c=Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.state.style,"size",p.prototype.size))));return new mxPoint(a.x+a.width*c,a.y+a.height/4)},function(a,c){this.state.style.size=Math.max(0,Math.min(.5,(c.x-a.x)/a.width))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(qa(a));return c},cross:function(a){return[T(a,["size"],function(a){var c=Math.min(a.width,a.height),c=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,
-"size",ra.prototype.size)))*c/2;return new mxPoint(a.getCenterX()-c,a.getCenterY()-c)},function(a,c){var b=Math.min(a.width,a.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,a.getCenterY()-c.y)/b*2,Math.max(0,a.getCenterX()-c.x)/b*2)))})]},note:function(a){return[T(a,["size"],function(a){var c=Math.max(0,Math.min(a.width,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",k.prototype.size)))));return new mxPoint(a.x+a.width-c,a.y+c)},function(a,c){this.state.style.size=
-Math.round(Math.max(0,Math.min(Math.min(a.width,a.x+a.width-c.x),Math.min(a.height,c.y-a.y))))})]},manualInput:function(a){var c=[T(a,["size"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",ba.prototype.size)));return new mxPoint(a.x+a.width/4,a.y+3*c/4)},function(a,c){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,4*(c.y-a.y)/3)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(qa(a));return c},dataStorage:function(a){return[T(a,
-["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",fa.prototype.size))));return new mxPoint(a.x+(1-c)*a.width,a.getCenterY())},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.x+a.width-c.x)/a.width))})]},callout:function(a){var c=[T(a,["size","position"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",x.prototype.size))),b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",x.prototype.position)));
-mxUtils.getValue(this.state.style,"base",x.prototype.base);return new mxPoint(a.x+b*a.width,a.y+a.height-c)},function(a,c){mxUtils.getValue(this.state.style,"base",x.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(a.height,a.y+a.height-c.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(c.x-a.x)/a.width)))/100}),T(a,["position2"],function(a){var c=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",x.prototype.position2)));return new mxPoint(a.x+
-c*a.width,a.y+a.height)},function(a,c){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(c.x-a.x)/a.width)))/100}),T(a,["base"],function(a){var c=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",x.prototype.size))),b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",x.prototype.position))),f=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"base",x.prototype.base)));return new mxPoint(a.x+Math.min(a.width,b*a.width+f),a.y+a.height-
-c)},function(a,c){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",x.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(a.width,c.x-a.x-b*a.width)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(qa(a));return c},internalStorage:function(a){var c=[T(a,["dx","dy"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",K.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",
-K.prototype.dy)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,c.x-a.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&c.push(qa(a));return c},corner:function(a){return[T(a,["dx","dy"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",L.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",
-L.prototype.dy)));return new mxPoint(a.x+c,a.y+b)},function(a,c){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,c.x-a.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},tee:function(a){return[T(a,["dx","dy"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",N.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",N.prototype.dy)));return new mxPoint(a.x+(a.width+c)/2,a.y+b)},function(a,c){this.state.style.dx=
-Math.round(Math.max(0,2*Math.min(a.width/2,c.x-a.x-a.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},singleArrow:oa(1),doubleArrow:oa(.5),folder:function(a){return[T(a,["tabWidth","tabHeight"],function(a){var c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"tabWidth",q.prototype.tabWidth))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"tabHeight",q.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==
-mxConstants.ALIGN_RIGHT&&(c=a.width-c);return new mxPoint(a.x+c,a.y+b)},function(a,c){var b=Math.max(0,Math.min(a.width,c.x-a.x));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(b=a.width-b);this.state.style.tabWidth=Math.round(b);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(a.height,c.y-a.y)))})]},document:function(a){return[T(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",A.prototype.size))));
-return new mxPoint(a.x+3*a.width/4,a.y+(1-c)*a.height)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.y+a.height-c.y)/a.height))})]},tape:function(a){return[T(a,["size"],function(a){var c=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",v.prototype.size))));return new mxPoint(a.getCenterX(),a.y+c*a.height/2)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(c.y-a.y)/a.height*2))})]},offPageConnector:function(a){return[T(a,["size"],function(a){var c=
-Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",ca.prototype.size))));return new mxPoint(a.getCenterX(),a.y+(1-c)*a.height)},function(a,c){this.state.style.size=Math.max(0,Math.min(1,(a.y+a.height-c.y)/a.height))})]},step:Aa(u.prototype.size,!0,null,!0,u.prototype.fixedSize),hexagon:Aa(G.prototype.size,!0,.5,!0),curlyBracket:Aa(g.prototype.size,!1),display:Aa(ka.prototype.size,!1),cube:Ea(1,a.prototype.size,!1),card:Ea(.5,t.prototype.size,!0),loopLimit:Ea(.5,P.prototype.size,
+ba.prototype.size=30;ba.prototype.isRoundable=function(){return!0};ba.prototype.redrawPath=function(a,d,b,c,f){d=Math.min(f,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,f),new mxPoint(0,d),new mxPoint(c,0),new mxPoint(c,f)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("manualInput",ba);mxUtils.extend(K,mxRectangleShape);K.prototype.dx=20;K.prototype.dy=20;
+K.prototype.isHtmlAllowed=function(){return!1};K.prototype.paintForeground=function(a,d,b,c,f){mxRectangleShape.prototype.paintForeground.apply(this,arguments);var e=0;if(this.isRounded)var g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)/100,e=Math.max(e,Math.min(c*g,f*g));g=Math.max(e,Math.min(c,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));e=Math.max(e,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.begin();a.moveTo(d,
+b+e);a.lineTo(d+c,b+e);a.end();a.stroke();a.begin();a.moveTo(d+g,b);a.lineTo(d+g,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("internalStorage",K);mxUtils.extend(L,mxActor);L.prototype.dx=20;L.prototype.dy=20;L.prototype.redrawPath=function(a,d,b,c,f){d=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var e=mxUtils.getValue(this.style,
+mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(c,0),new mxPoint(c,b),new mxPoint(d,b),new mxPoint(d,f),new mxPoint(0,f)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("corner",L);mxUtils.extend(ha,mxActor);ha.prototype.redrawPath=function(a,d,b,c,f){a.moveTo(0,0);a.lineTo(0,f);a.end();a.moveTo(c,0);a.lineTo(c,f);a.end();a.moveTo(0,f/2);a.lineTo(c,f/2);a.end()};mxCellRenderer.registerShape("crossbar",ha);mxUtils.extend(N,mxActor);N.prototype.dx=
+20;N.prototype.dy=20;N.prototype.redrawPath=function(a,d,b,c,f){d=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));b=Math.max(0,Math.min(f,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var e=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,0),new mxPoint(c,0),new mxPoint(c,b),new mxPoint((c+d)/2,b),new mxPoint((c+d)/2,f),new mxPoint((c-d)/
+2,f),new mxPoint((c-d)/2,b),new mxPoint(0,b)],this.isRounded,e,!0);a.end()};mxCellRenderer.registerShape("tee",N);mxUtils.extend(R,mxActor);R.prototype.arrowWidth=.3;R.prototype.arrowSize=.2;R.prototype.redrawPath=function(a,d,b,c,f){var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));b=(f-e)/2;var e=b+e,g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,
+mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,b),new mxPoint(c-d,b),new mxPoint(c-d,0),new mxPoint(c,f/2),new mxPoint(c-d,f),new mxPoint(c-d,e),new mxPoint(0,e)],this.isRounded,g,!0);a.end()};mxCellRenderer.registerShape("singleArrow",R);mxUtils.extend(ia,mxActor);ia.prototype.redrawPath=function(a,d,b,c,f){var e=f*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",R.prototype.arrowWidth))));d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",
+R.prototype.arrowSize))));b=(f-e)/2;var e=b+e,g=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(a,[new mxPoint(0,f/2),new mxPoint(d,0),new mxPoint(d,b),new mxPoint(c-d,b),new mxPoint(c-d,0),new mxPoint(c,f/2),new mxPoint(c-d,f),new mxPoint(c-d,e),new mxPoint(d,e),new mxPoint(d,f)],this.isRounded,g,!0);a.end()};mxCellRenderer.registerShape("doubleArrow",ia);mxUtils.extend(fa,mxActor);fa.prototype.size=.1;fa.prototype.redrawPath=function(a,d,b,c,f){d=
+c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"size",this.size))));a.moveTo(d,0);a.lineTo(c,0);a.quadTo(c-2*d,f/2,c,f);a.lineTo(d,f);a.quadTo(d-2*d,f/2,d,0);a.close();a.end()};mxCellRenderer.registerShape("dataStorage",fa);mxUtils.extend(F,mxActor);F.prototype.redrawPath=function(a,d,b,c,f){a.moveTo(0,0);a.quadTo(c,0,c,f/2);a.quadTo(c,f,0,f);a.close();a.end()};mxCellRenderer.registerShape("or",F);mxUtils.extend(ja,mxActor);ja.prototype.redrawPath=function(a,d,b,c,f){a.moveTo(0,0);
+a.quadTo(c,0,c,f/2);a.quadTo(c,f,0,f);a.quadTo(c/2,f/2,0,0);a.close();a.end()};mxCellRenderer.registerShape("xor",ja);mxUtils.extend(P,mxActor);P.prototype.size=20;P.prototype.isRoundable=function(){return!0};P.prototype.redrawPath=function(a,d,b,c,f){d=Math.min(c/2,Math.min(f,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(d,0),new mxPoint(c-d,0),new mxPoint(c,.8*d),new mxPoint(c,
+f),new mxPoint(0,f),new mxPoint(0,.8*d)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("loopLimit",P);mxUtils.extend(ca,mxActor);ca.prototype.size=.375;ca.prototype.isRoundable=function(){return!0};ca.prototype.redrawPath=function(a,d,b,c,f){d=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,0),new mxPoint(c,0),new mxPoint(c,f-d),new mxPoint(c/
+2,f),new mxPoint(0,f-d)],this.isRounded,b,!0);a.end()};mxCellRenderer.registerShape("offPageConnector",ca);mxUtils.extend(ga,mxEllipse);ga.prototype.paintVertexShape=function(a,d,b,c,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.begin();a.moveTo(d+c/2,b+f);a.lineTo(d+c,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("tapeData",ga);mxUtils.extend(W,mxEllipse);W.prototype.paintVertexShape=function(a,d,b,c,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);
+a.begin();a.moveTo(d,b+f/2);a.lineTo(d+c,b+f/2);a.end();a.stroke();a.begin();a.moveTo(d+c/2,b);a.lineTo(d+c/2,b+f);a.end();a.stroke()};mxCellRenderer.registerShape("orEllipse",W);mxUtils.extend(Z,mxEllipse);Z.prototype.paintVertexShape=function(a,d,b,c,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();a.moveTo(d+.145*c,b+.145*f);a.lineTo(d+.855*c,b+.855*f);a.end();a.stroke();a.begin();a.moveTo(d+.855*c,b+.145*f);a.lineTo(d+.145*c,b+.855*f);a.end();a.stroke()};
+mxCellRenderer.registerShape("sumEllipse",Z);mxUtils.extend(wa,mxRhombus);wa.prototype.paintVertexShape=function(a,d,b,c,f){mxRhombus.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();a.moveTo(d,b+f/2);a.lineTo(d+c,b+f/2);a.end();a.stroke()};mxCellRenderer.registerShape("sortShape",wa);mxUtils.extend(ua,mxEllipse);ua.prototype.paintVertexShape=function(a,d,b,c,f){a.begin();a.moveTo(d,b);a.lineTo(d+c,b);a.lineTo(d+c/2,b+f/2);a.close();a.fillAndStroke();a.begin();a.moveTo(d,
+b+f);a.lineTo(d+c,b+f);a.lineTo(d+c/2,b+f/2);a.close();a.fillAndStroke()};mxCellRenderer.registerShape("collate",ua);mxUtils.extend(pa,mxEllipse);pa.prototype.paintVertexShape=function(a,d,b,c,f){var e=b+f-5;a.begin();a.moveTo(d,b);a.lineTo(d,b+f);a.moveTo(d,e);a.lineTo(d+10,e-5);a.moveTo(d,e);a.lineTo(d+10,e+5);a.moveTo(d,e);a.lineTo(d+c,e);a.moveTo(d+c,b);a.lineTo(d+c,b+f);a.moveTo(d+c,e);a.lineTo(d+c-10,e-5);a.moveTo(d+c,e);a.lineTo(d+c-10,e+5);a.end();a.stroke()};mxCellRenderer.registerShape("dimension",
+pa);mxUtils.extend(ta,mxEllipse);ta.prototype.paintVertexShape=function(a,d,b,c,f){this.outline||a.setStrokeColor(null);mxRectangleShape.prototype.paintBackground.apply(this,arguments);null!=this.style&&(a.setStrokeColor(this.stroke),a.rect(d,b,c,f),a.fill(),a.begin(),a.moveTo(d,b),"1"==mxUtils.getValue(this.style,"top","1")?a.lineTo(d+c,b):a.moveTo(d+c,b),"1"==mxUtils.getValue(this.style,"right","1")?a.lineTo(d+c,b+f):a.moveTo(d+c,b+f),"1"==mxUtils.getValue(this.style,"bottom","1")?a.lineTo(d,b+
+f):a.moveTo(d,b+f),"1"==mxUtils.getValue(this.style,"left","1")&&a.lineTo(d,b-this.strokewidth/2),a.end(),a.stroke())};mxCellRenderer.registerShape("partialRectangle",ta);mxUtils.extend(va,mxEllipse);va.prototype.paintVertexShape=function(a,d,b,c,f){mxEllipse.prototype.paintVertexShape.apply(this,arguments);a.setShadow(!1);a.begin();"vertical"==mxUtils.getValue(this.style,"line")?(a.moveTo(d+c/2,b),a.lineTo(d+c/2,b+f)):(a.moveTo(d,b+f/2),a.lineTo(d+c,b+f/2));a.end();a.stroke()};mxCellRenderer.registerShape("lineEllipse",
+va);mxUtils.extend(ma,mxActor);ma.prototype.redrawPath=function(a,d,b,c,f){d=Math.min(c,f/2);a.moveTo(0,0);a.lineTo(c-d,0);a.quadTo(c,0,c,f/2);a.quadTo(c,f,c-d,f);a.lineTo(0,f);a.close();a.end()};mxCellRenderer.registerShape("delay",ma);mxUtils.extend(ra,mxActor);ra.prototype.size=.2;ra.prototype.redrawPath=function(a,d,b,c,f){d=Math.min(f,c);var e=Math.max(0,Math.min(d,d*parseFloat(mxUtils.getValue(this.style,"size",this.size))));d=(f-e)/2;b=d+e;var g=(c-e)/2,e=g+e;a.moveTo(0,d);a.lineTo(g,d);a.lineTo(g,
+0);a.lineTo(e,0);a.lineTo(e,d);a.lineTo(c,d);a.lineTo(c,b);a.lineTo(e,b);a.lineTo(e,f);a.lineTo(g,f);a.lineTo(g,b);a.lineTo(0,b);a.close();a.end()};mxCellRenderer.registerShape("cross",ra);mxUtils.extend(ka,mxActor);ka.prototype.size=.25;ka.prototype.redrawPath=function(a,d,b,c,f){d=Math.min(c,f/2);b=Math.min(c-d,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*c);a.moveTo(0,f/2);a.lineTo(b,0);a.lineTo(c-d,0);a.quadTo(c,0,c,f/2);a.quadTo(c,f,c-d,f);a.lineTo(b,f);a.close();a.end()};
+mxCellRenderer.registerShape("display",ka);mxUtils.extend(da,mxConnector);da.prototype.origPaintEdgeShape=da.prototype.paintEdgeShape;da.prototype.paintEdgeShape=function(a,d,b){for(var c=[],f=0;f<d.length;f++)c.push(mxUtils.clone(d[f]));var f=a.state.dashed,e=a.state.fixDash;da.prototype.origPaintEdgeShape.apply(this,[a,c,b]);3<=a.state.strokeWidth&&(c=mxUtils.getValue(this.style,"fillColor",null),null!=c&&(a.setStrokeColor(c),a.setStrokeWidth(a.state.strokeWidth-2),a.setDashed(f,e),da.prototype.origPaintEdgeShape.apply(this,
+[a,d,b])))};mxCellRenderer.registerShape("filledEdge",da);"undefined"!==typeof StyleFormatPanel&&function(){var a=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var d=this.format.getSelectionState(),b=a.apply(this,arguments);"umlFrame"==d.style.shape&&b.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"#ffffff"});return b}}();mxMarker.addMarker("dash",function(a,d,b,c,f,e,g,l,r,n){var p=f*(g+r+1),u=e*(g+r+1);return function(){a.begin();
+a.moveTo(c.x-p/2-u/2,c.y-u/2+p/2);a.lineTo(c.x+u/2-3*p/2,c.y-3*u/2-p/2);a.stroke()}});mxMarker.addMarker("cross",function(a,d,b,c,f,e,g,l,r,n){var p=f*(g+r+1),u=e*(g+r+1);return function(){a.begin();a.moveTo(c.x-p/2-u/2,c.y-u/2+p/2);a.lineTo(c.x+u/2-3*p/2,c.y-3*u/2-p/2);a.moveTo(c.x-p/2+u/2,c.y-u/2-p/2);a.lineTo(c.x-u/2-3*p/2,c.y-3*u/2+p/2);a.stroke()}});mxMarker.addMarker("circle",sa);mxMarker.addMarker("circlePlus",function(a,d,b,c,f,e,g,l,r,n){var p=c.clone(),u=sa.apply(this,arguments),k=f*(g+
+2*r),y=e*(g+2*r);return function(){u.apply(this,arguments);a.begin();a.moveTo(p.x-f*r,p.y-e*r);a.lineTo(p.x-2*k+f*r,p.y-2*y+e*r);a.moveTo(p.x-k-y+e*r,p.y-y+k-f*r);a.lineTo(p.x+y-k-e*r,p.y-y-k+f*r);a.stroke()}});mxMarker.addMarker("async",function(a,d,b,c,f,e,g,l,r,n){d=f*r*1.118;b=e*r*1.118;f*=g+r;e*=g+r;var p=c.clone();p.x-=d;p.y-=b;c.x+=1*-f-d;c.y+=1*-e-b;return function(){a.begin();a.moveTo(p.x,p.y);l?a.lineTo(p.x-f-e/2,p.y-e+f/2):a.lineTo(p.x+e/2-f,p.y-e-f/2);a.lineTo(p.x-f,p.y-e);a.close();n?
+a.fillAndStroke():a.stroke()}});mxMarker.addMarker("openAsync",function(a){a=null!=a?a:2;return function(d,b,c,f,e,g,l,r,p,n){e*=l+p;g*=l+p;var u=f.clone();return function(){d.begin();d.moveTo(u.x,u.y);r?d.lineTo(u.x-e-g/a,u.y-g+e/a):d.lineTo(u.x+g/a-e,u.y-g-e/a);d.stroke()}}}(2));if("undefined"!==typeof mxVertexHandler){var Ga=function(a,d,b){return ya(a,["width"],d,function(d,c,f,e,g){g=a.shape.getEdgeWidth()*a.view.scale+b;return new mxPoint(e.x+c*d/4+f*g/2,e.y+f*d/4-c*g/2)},function(d,c,f,e,g,
+l){d=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));a.style.width=Math.round(2*d)/a.view.scale-b})},ya=function(a,d,b,c,f){return T(a,d,function(d){var f=a.absolutePoints,e=f.length-1;d=a.view.translate;var g=a.view.scale,l=b?f[0]:f[e],f=b?f[1]:f[e-1],e=f.x-l.x,r=f.y-l.y,p=Math.sqrt(e*e+r*r),l=c.call(this,p,e/p,r/p,l,f);return new mxPoint(l.x/g-d.x,l.y/g-d.y)},function(d,c,e){var g=a.absolutePoints,l=g.length-1;d=a.view.translate;var r=a.view.scale,p=b?g[0]:g[l],g=b?g[1]:g[l-1],l=g.x-p.x,
+n=g.y-p.y,u=Math.sqrt(l*l+n*n);c.x=(c.x+d.x)*r;c.y=(c.y+d.y)*r;f.call(this,u,l/u,n/u,p,g,c,e)})},oa=function(a){return function(d){return[T(d,["arrowWidth","arrowSize"],function(d){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"arrowWidth",R.prototype.arrowWidth))),c=Math.max(0,Math.min(a,mxUtils.getValue(this.state.style,"arrowSize",R.prototype.arrowSize)));return new mxPoint(d.x+(1-c)*d.width,d.y+(1-b)*d.height/2)},function(d,b){this.state.style.arrowWidth=Math.max(0,Math.min(1,
+Math.abs(d.y+d.height/2-b.y)/d.height*2));this.state.style.arrowSize=Math.max(0,Math.min(a,(d.x+d.width-b.x)/d.width))})]}},Ea=function(a,d,b){return function(c){var f=[T(c,["size"],function(b){var c=Math.max(0,Math.min(b.width,Math.min(b.height,parseFloat(mxUtils.getValue(this.state.style,"size",d)))))*a;return new mxPoint(b.x+c,b.y+c)},function(d,b){this.state.style.size=Math.round(Math.max(0,Math.min(Math.min(d.width,b.x-d.x),Math.min(d.height,b.y-d.y)))/a)})];b&&mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,
+!1)&&f.push(qa(c));return f}},Aa=function(a,d,b,c,f){b=null!=b?b:1;return function(e){var g=[T(e,["size"],function(d){var b=null!=f?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null,c=parseFloat(mxUtils.getValue(this.state.style,"size",b?f:a));return new mxPoint(d.x+Math.max(0,Math.min(d.width,c*(b?1:d.width))),d.getCenterY())},function(a,d,c){var g=null!=f?"0"!=mxUtils.getValue(this.state.style,"fixedSize","0"):null;a=g?d.x-a.x:Math.max(0,Math.min(b,(d.x-a.x)/a.width));g&&!mxEvent.isAltDown(c.getEvent())&&
+(a=e.view.graph.snap(a));this.state.style.size=a},null,c)];d&&mxUtils.getValue(e.style,mxConstants.STYLE_ROUNDED,!1)&&g.push(qa(e));return g}},Ha=function(a){return function(d){var b=[T(d,["size"],function(d){var b=Math.max(0,Math.min(a,parseFloat(mxUtils.getValue(this.state.style,"size",f.prototype.size))));return new mxPoint(d.x+b*d.width*.75,d.y+d.height/4)},function(d,b){this.state.style.size=Math.max(0,Math.min(a,(b.x-d.x)/(.75*d.width)))},null,!0)];mxUtils.getValue(d.style,mxConstants.STYLE_ROUNDED,
+!1)&&b.push(qa(d));return b}},za=function(){return function(a){var d=[];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&d.push(qa(a));return d}},qa=function(a,d){return T(a,[mxConstants.STYLE_ARCSIZE],function(b){var c=null!=d?d:b.height/8;if("1"==mxUtils.getValue(a.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)){var f=mxUtils.getValue(a.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;return new mxPoint(b.x+b.width-Math.min(b.width/2,f),b.y+c)}f=Math.max(0,parseFloat(mxUtils.getValue(a.style,
+mxConstants.STYLE_ARCSIZE,100*mxConstants.RECTANGLE_ROUNDING_FACTOR)))/100;return new mxPoint(b.x+b.width-Math.min(Math.max(b.width/2,b.height/2),Math.min(b.width,b.height)*f),b.y+c)},function(d,b,c){"1"==mxUtils.getValue(a.style,mxConstants.STYLE_ABSOLUTE_ARCSIZE,0)?this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.max(0,Math.min(d.width,2*(d.x+d.width-b.x)))):this.state.style[mxConstants.STYLE_ARCSIZE]=Math.round(Math.min(50,Math.max(0,100*(d.width-b.x+d.x)/Math.min(d.width,d.height))))})},
+T=function(a,d,b,c,f,e){var g=new mxHandle(a,null,mxVertexHandler.prototype.secondaryHandleImage);g.execute=function(){for(var a=0;a<d.length;a++)this.copyStyle(d[a])};g.getPosition=b;g.setPosition=c;g.ignoreGrid=null!=f?f:!0;if(e){var l=g.positionChanged;g.positionChanged=function(){l.apply(this,arguments);a.view.invalidate(this.state.cell);a.view.validate()}}return g},Ba={link:function(a){return[Ga(a,!0,10),Ga(a,!1,10)]},flexArrow:function(a){var d=a.view.graph.gridSize/a.view.scale,b=[];mxUtils.getValue(a.style,
+mxConstants.STYLE_STARTARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(ya(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(d,b,c,f,e){d=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+c*d/2,f.y+c*(e+a.shape.strokewidth*a.view.scale)-b*d/2)},function(b,c,f,e,g,l,r){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,
+e.y,g.x,g.y,l.x,l.y));c=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-c,l.x,l.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(c-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(r.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]);mxEvent.isAltDown(r.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<d/6&&(a.style[mxConstants.STYLE_STARTSIZE]=
+a.style[mxConstants.STYLE_ENDSIZE])})),b.push(ya(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!0,function(d,b,c,f,e){d=(a.shape.getStartArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)+c*d/2,f.y+c*(e+a.shape.strokewidth*a.view.scale)-b*d/2)},function(b,c,f,e,g,l,r){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,
+g.y,l.x,l.y));c=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-c,l.x,l.y);a.style[mxConstants.STYLE_STARTSIZE]=Math.round(100*(c-a.shape.strokewidth)/3)/100/a.view.scale;a.style.startWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(r.getEvent())&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE],a.style.endWidth=a.style.startWidth);mxEvent.isAltDown(r.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_STARTSIZE])-parseFloat(a.style[mxConstants.STYLE_ENDSIZE]))<
+d/6&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]),Math.abs(parseFloat(a.style.startWidth)-parseFloat(a.style.endWidth))<d&&(a.style.startWidth=a.style.endWidth))})));mxUtils.getValue(a.style,mxConstants.STYLE_ENDARROW,mxConstants.NONE)!=mxConstants.NONE&&(b.push(ya(a,["width",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(d,b,c,f,e){d=(a.shape.getEdgeWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/
+5)*a.view.scale;return new mxPoint(f.x+b*(e+a.shape.strokewidth*a.view.scale)-c*d/2,f.y+c*(e+a.shape.strokewidth*a.view.scale)+b*d/2)},function(b,c,f,e,g,l,r){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));c=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-c,l.x,l.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(c-a.shape.strokewidth)/3)/100/a.view.scale;a.style.width=Math.round(2*b)/a.view.scale;mxEvent.isControlDown(r.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE]);
+mxEvent.isAltDown(r.getEvent())||Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<d/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE])})),b.push(ya(a,["startWidth","endWidth",mxConstants.STYLE_STARTSIZE,mxConstants.STYLE_ENDSIZE],!1,function(d,b,c,f,e){d=(a.shape.getEndArrowWidth()-a.shape.strokewidth)*a.view.scale;e=3*mxUtils.getNumber(a.style,mxConstants.STYLE_ENDSIZE,mxConstants.ARROW_SIZE/5)*a.view.scale;return new mxPoint(f.x+
+b*(e+a.shape.strokewidth*a.view.scale)-c*d/2,f.y+c*(e+a.shape.strokewidth*a.view.scale)+b*d/2)},function(b,c,f,e,g,l,r){b=Math.sqrt(mxUtils.ptSegDistSq(e.x,e.y,g.x,g.y,l.x,l.y));c=mxUtils.ptLineDist(e.x,e.y,e.x+f,e.y-c,l.x,l.y);a.style[mxConstants.STYLE_ENDSIZE]=Math.round(100*(c-a.shape.strokewidth)/3)/100/a.view.scale;a.style.endWidth=Math.max(0,Math.round(2*b)-a.shape.getEdgeWidth())/a.view.scale;mxEvent.isControlDown(r.getEvent())&&(a.style[mxConstants.STYLE_STARTSIZE]=a.style[mxConstants.STYLE_ENDSIZE],
+a.style.startWidth=a.style.endWidth);mxEvent.isAltDown(r.getEvent())||(Math.abs(parseFloat(a.style[mxConstants.STYLE_ENDSIZE])-parseFloat(a.style[mxConstants.STYLE_STARTSIZE]))<d/6&&(a.style[mxConstants.STYLE_ENDSIZE]=a.style[mxConstants.STYLE_STARTSIZE]),Math.abs(parseFloat(a.style.endWidth)-parseFloat(a.style.startWidth))<d&&(a.style.endWidth=a.style.startWidth))})));return b},swimlane:function(a){var d=[T(a,[mxConstants.STYLE_STARTSIZE],function(d){var b=parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,
+mxConstants.DEFAULT_STARTSIZE));return 1==mxUtils.getValue(a.style,mxConstants.STYLE_HORIZONTAL,1)?new mxPoint(d.getCenterX(),d.y+Math.max(0,Math.min(d.height,b))):new mxPoint(d.x+Math.max(0,Math.min(d.width,b)),d.getCenterY())},function(d,b){a.style[mxConstants.STYLE_STARTSIZE]=1==mxUtils.getValue(this.state.style,mxConstants.STYLE_HORIZONTAL,1)?Math.round(Math.max(0,Math.min(d.height,b.y-d.y))):Math.round(Math.max(0,Math.min(d.width,b.x-d.x)))})];if(mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED)){var b=
+parseFloat(mxUtils.getValue(a.style,mxConstants.STYLE_STARTSIZE,mxConstants.DEFAULT_STARTSIZE));d.push(qa(a,b/2))}return d},label:za(),ext:za(),rectangle:za(),triangle:za(),rhombus:za(),umlLifeline:function(a){return[T(a,["size"],function(a){var d=Math.max(0,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",B.prototype.size))));return new mxPoint(a.getCenterX(),a.y+d)},function(a,d){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,d.y-a.y)))},!1)]},umlFrame:function(a){return[T(a,
+["width","height"],function(a){var d=Math.max(I.prototype.corner,Math.min(a.width,mxUtils.getValue(this.state.style,"width",I.prototype.width))),b=Math.max(1.5*I.prototype.corner,Math.min(a.height,mxUtils.getValue(this.state.style,"height",I.prototype.height)));return new mxPoint(a.x+d,a.y+b)},function(a,d){this.state.style.width=Math.round(Math.max(I.prototype.corner,Math.min(a.width,d.x-a.x)));this.state.style.height=Math.round(Math.max(1.5*I.prototype.corner,Math.min(a.height,d.y-a.y)))},!1)]},
+process:function(a){var d=[T(a,["size"],function(a){var d=Math.max(0,Math.min(.5,parseFloat(mxUtils.getValue(this.state.style,"size",p.prototype.size))));return new mxPoint(a.x+a.width*d,a.y+a.height/4)},function(a,d){this.state.style.size=Math.max(0,Math.min(.5,(d.x-a.x)/a.width))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&d.push(qa(a));return d},cross:function(a){return[T(a,["size"],function(a){var d=Math.min(a.width,a.height),d=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,
+"size",ra.prototype.size)))*d/2;return new mxPoint(a.getCenterX()-d,a.getCenterY()-d)},function(a,d){var b=Math.min(a.width,a.height);this.state.style.size=Math.max(0,Math.min(1,Math.min(Math.max(0,a.getCenterY()-d.y)/b*2,Math.max(0,a.getCenterX()-d.x)/b*2)))})]},note:function(a){return[T(a,["size"],function(a){var d=Math.max(0,Math.min(a.width,Math.min(a.height,parseFloat(mxUtils.getValue(this.state.style,"size",k.prototype.size)))));return new mxPoint(a.x+a.width-d,a.y+d)},function(a,d){this.state.style.size=
+Math.round(Math.max(0,Math.min(Math.min(a.width,a.x+a.width-d.x),Math.min(a.height,d.y-a.y))))})]},manualInput:function(a){var d=[T(a,["size"],function(a){var d=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",ba.prototype.size)));return new mxPoint(a.x+a.width/4,a.y+3*d/4)},function(a,d){this.state.style.size=Math.round(Math.max(0,Math.min(a.height,4*(d.y-a.y)/3)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&d.push(qa(a));return d},dataStorage:function(a){return[T(a,
+["size"],function(a){var d=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",fa.prototype.size))));return new mxPoint(a.x+(1-d)*a.width,a.getCenterY())},function(a,d){this.state.style.size=Math.max(0,Math.min(1,(a.x+a.width-d.x)/a.width))})]},callout:function(a){var d=[T(a,["size","position"],function(a){var d=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",x.prototype.size))),b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",x.prototype.position)));
+mxUtils.getValue(this.state.style,"base",x.prototype.base);return new mxPoint(a.x+b*a.width,a.y+a.height-d)},function(a,d){mxUtils.getValue(this.state.style,"base",x.prototype.base);this.state.style.size=Math.round(Math.max(0,Math.min(a.height,a.y+a.height-d.y)));this.state.style.position=Math.round(100*Math.max(0,Math.min(1,(d.x-a.x)/a.width)))/100}),T(a,["position2"],function(a){var d=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position2",x.prototype.position2)));return new mxPoint(a.x+
+d*a.width,a.y+a.height)},function(a,d){this.state.style.position2=Math.round(100*Math.max(0,Math.min(1,(d.x-a.x)/a.width)))/100}),T(a,["base"],function(a){var d=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"size",x.prototype.size))),b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",x.prototype.position))),c=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"base",x.prototype.base)));return new mxPoint(a.x+Math.min(a.width,b*a.width+c),a.y+a.height-
+d)},function(a,d){var b=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",x.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(a.width,d.x-a.x-b*a.width)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&d.push(qa(a));return d},internalStorage:function(a){var d=[T(a,["dx","dy"],function(a){var d=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",K.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",
+K.prototype.dy)));return new mxPoint(a.x+d,a.y+b)},function(a,d){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,d.x-a.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,d.y-a.y)))})];mxUtils.getValue(a.style,mxConstants.STYLE_ROUNDED,!1)&&d.push(qa(a));return d},corner:function(a){return[T(a,["dx","dy"],function(a){var d=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",L.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",
+L.prototype.dy)));return new mxPoint(a.x+d,a.y+b)},function(a,d){this.state.style.dx=Math.round(Math.max(0,Math.min(a.width,d.x-a.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,d.y-a.y)))})]},tee:function(a){return[T(a,["dx","dy"],function(a){var d=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"dx",N.prototype.dx))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"dy",N.prototype.dy)));return new mxPoint(a.x+(a.width+d)/2,a.y+b)},function(a,d){this.state.style.dx=
+Math.round(Math.max(0,2*Math.min(a.width/2,d.x-a.x-a.width/2)));this.state.style.dy=Math.round(Math.max(0,Math.min(a.height,d.y-a.y)))})]},singleArrow:oa(1),doubleArrow:oa(.5),folder:function(a){return[T(a,["tabWidth","tabHeight"],function(a){var d=Math.max(0,Math.min(a.width,mxUtils.getValue(this.state.style,"tabWidth",q.prototype.tabWidth))),b=Math.max(0,Math.min(a.height,mxUtils.getValue(this.state.style,"tabHeight",q.prototype.tabHeight)));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==
+mxConstants.ALIGN_RIGHT&&(d=a.width-d);return new mxPoint(a.x+d,a.y+b)},function(a,d){var b=Math.max(0,Math.min(a.width,d.x-a.x));mxUtils.getValue(this.state.style,"tabPosition",q.prototype.tabPosition)==mxConstants.ALIGN_RIGHT&&(b=a.width-b);this.state.style.tabWidth=Math.round(b);this.state.style.tabHeight=Math.round(Math.max(0,Math.min(a.height,d.y-a.y)))})]},document:function(a){return[T(a,["size"],function(a){var d=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",A.prototype.size))));
+return new mxPoint(a.x+3*a.width/4,a.y+(1-d)*a.height)},function(a,d){this.state.style.size=Math.max(0,Math.min(1,(a.y+a.height-d.y)/a.height))})]},tape:function(a){return[T(a,["size"],function(a){var d=Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",v.prototype.size))));return new mxPoint(a.getCenterX(),a.y+d*a.height/2)},function(a,d){this.state.style.size=Math.max(0,Math.min(1,(d.y-a.y)/a.height*2))})]},offPageConnector:function(a){return[T(a,["size"],function(a){var d=
+Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.state.style,"size",ca.prototype.size))));return new mxPoint(a.getCenterX(),a.y+(1-d)*a.height)},function(a,d){this.state.style.size=Math.max(0,Math.min(1,(a.y+a.height-d.y)/a.height))})]},step:Aa(u.prototype.size,!0,null,!0,u.prototype.fixedSize),hexagon:Aa(G.prototype.size,!0,.5,!0),curlyBracket:Aa(g.prototype.size,!1),display:Aa(ka.prototype.size,!1),cube:Ea(1,a.prototype.size,!1),card:Ea(.5,t.prototype.size,!0),loopLimit:Ea(.5,P.prototype.size,
!0),trapezoid:Ha(.5),parallelogram:Ha(1)};Graph.createHandle=T;Graph.handleFactory=Ba;mxVertexHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()&&this.graph.isCellRotatable(this.state.cell)){var a=this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a=mxConstants.SHAPE_RECTANGLE);a=Ba[a];null==a&&null!=this.state.shape&&this.state.shape.isRoundable()&&(a=Ba[mxConstants.SHAPE_RECTANGLE]);if(null!=a)return a(this.state)}return null};
mxEdgeHandler.prototype.createCustomHandles=function(){if(1==this.state.view.graph.getSelectionCount()){var a=this.state.style.shape;null==mxCellRenderer.defaultShapes[a]&&null==mxStencilRegistry.getStencil(a)&&(a=mxConstants.SHAPE_CONNECTOR);a=Ba[a];if(null!=a)return a(this.state)}return null}}else Graph.createHandle=function(){},Graph.handleFactory={};var Ca=new mxPoint(1,0),Da=new mxPoint(1,0),oa=mxUtils.toRadians(-30),Ca=mxUtils.getRotatedPoint(Ca,Math.cos(oa),Math.sin(oa)),oa=mxUtils.toRadians(-150),
-Da=mxUtils.getRotatedPoint(Da,Math.cos(oa),Math.sin(oa));mxEdgeStyle.IsometricConnector=function(a,c,b,f,d){var e=a.view;f=null!=f&&0<f.length?f[0]:null;var g=a.absolutePoints,l=g[0],g=g[g.length-1];null!=f&&(f=e.transformControlPoint(a,f));null==l&&null!=c&&(l=new mxPoint(c.getCenterX(),c.getCenterY()));null==g&&null!=b&&(g=new mxPoint(b.getCenterX(),b.getCenterY()));var r=Ca.x,p=Ca.y,n=Da.x,u=Da.y,k="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=l){a=function(a,c,
-b){a-=y.x;var f=c-y.y;c=(u*a-n*f)/(r*u-p*n);a=(p*a-r*f)/(p*n-r*u);k?(b&&(y=new mxPoint(y.x+r*c,y.y+p*c),d.push(y)),y=new mxPoint(y.x+n*a,y.y+u*a)):(b&&(y=new mxPoint(y.x+n*a,y.y+u*a),d.push(y)),y=new mxPoint(y.x+r*c,y.y+p*c));d.push(y)};var y=l;null==f&&(f=new mxPoint(l.x+(g.x-l.x)/2,l.y+(g.y-l.y)/2));a(f.x,f.y,!0);a(g.x,g.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Na=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,c){if(c==
-mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Na.apply(this,arguments)};b.prototype.constraints=[];e.prototype.getConstraints=function(a,c,b){a=[];var f=Math.tan(mxUtils.toRadians(30)),d=(.5-f)/2,f=Math.min(c,b/(.5+f));c=(c-f)/2;b=(b-f)/2;a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,b+.25*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+.5*f,b+f*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+f,
-b+.25*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+f,b+.75*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c+.5*f,b+(1-d)*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,b+.75*f));return a};x.prototype.getConstraints=function(a,c,b){a=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var f=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",
-this.position));var d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,
-0),!1,null,c,.5*(b-f)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,b-f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b));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)));c>=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,
+Da=mxUtils.getRotatedPoint(Da,Math.cos(oa),Math.sin(oa));mxEdgeStyle.IsometricConnector=function(a,d,b,c,f){var e=a.view;c=null!=c&&0<c.length?c[0]:null;var g=a.absolutePoints,l=g[0],g=g[g.length-1];null!=c&&(c=e.transformControlPoint(a,c));null==l&&null!=d&&(l=new mxPoint(d.getCenterX(),d.getCenterY()));null==g&&null!=b&&(g=new mxPoint(b.getCenterX(),b.getCenterY()));var r=Ca.x,p=Ca.y,n=Da.x,u=Da.y,k="horizontal"==mxUtils.getValue(a.style,"elbow","horizontal");if(null!=g&&null!=l){a=function(a,d,
+b){a-=y.x;var c=d-y.y;d=(u*a-n*c)/(r*u-p*n);a=(p*a-r*c)/(p*n-r*u);k?(b&&(y=new mxPoint(y.x+r*d,y.y+p*d),f.push(y)),y=new mxPoint(y.x+n*a,y.y+u*a)):(b&&(y=new mxPoint(y.x+n*a,y.y+u*a),f.push(y)),y=new mxPoint(y.x+r*d,y.y+p*d));f.push(y)};var y=l;null==c&&(c=new mxPoint(l.x+(g.x-l.x)/2,l.y+(g.y-l.y)/2));a(c.x,c.y,!0);a(g.x,g.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var Na=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(a,d){if(d==
+mxEdgeStyle.IsometricConnector){var b=new mxElbowEdgeHandler(a);b.snapToTerminals=!1;return b}return Na.apply(this,arguments)};b.prototype.constraints=[];e.prototype.getConstraints=function(a,d,b){a=[];var c=Math.tan(mxUtils.toRadians(30)),f=(.5-c)/2,c=Math.min(d,b/(.5+c));d=(d-c)/2;b=(b-c)/2;a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b+.25*c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d+.5*c,b+c*f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d+c,
+b+.25*c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d+c,b+.75*c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d+.5*c,b+(1-f)*c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b+.75*c));return a};x.prototype.getConstraints=function(a,d,b){a=[];mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE);var c=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"size",this.size))));parseFloat(mxUtils.getValue(this.style,"position",
+this.position));var f=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"position2",this.position2))));parseFloat(mxUtils.getValue(this.style,"base",this.base));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.25,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.75,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,d,.5*(b-c)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,b-c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,b-c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b-c)));d>=2*c&&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),
-!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};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,
+mxRectangleShape.prototype.constraints;mxSwimlane.prototype.constraints=mxRectangleShape.prototype.constraints;z.prototype.constraints=mxRectangleShape.prototype.constraints;k.prototype.getConstraints=function(a,d,b){a=[];var c=Math.max(0,Math.min(d,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*(d-c),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),
+!1,null,d-c,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d-.5*c,.5*c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,.5*(b+c)));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));d>=2*c&&a.push(new mxConnectionConstraint(new mxPoint(.5,
+0),!1));return a};t.prototype.getConstraints=function(a,d,b){a=[];var c=Math.max(0,Math.min(d,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*(d+c),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*c,.5*c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,c));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,0,.5*(b+c)));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));d>=2*c&&a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));return a};a.prototype.getConstraints=function(a,d,b){a=[];var c=Math.max(0,Math.min(d,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*(d-c),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d-c,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d-.5*c,.5*c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,.5*(b+c)));a.push(new mxConnectionConstraint(new mxPoint(1,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d+c),b));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,c,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*c,b-.5*c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,b-c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b-c)));return a};q.prototype.getConstraints=function(a,d,b){a=[];var c=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"tabWidth",this.tabWidth)))),f=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*c,0)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,0)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,f)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d+c),f))):(a.push(new mxConnectionConstraint(new mxPoint(1,0),!1)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d-.5*c,0)),a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,d-c,0)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d-c,f)),a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d-c),f)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,.25*(b-f)+f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,.5*(b-f)+f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,.75*(b-f)+f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,
+null,d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.25*(b-f)+f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*(b-f)+f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.75*(b-f)+f));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,
+function(a,d,b){a=[];var c=Math.min(d,b/2),f=Math.min(d-c,Math.max(0,parseFloat(mxUtils.getValue(this.style,"size",this.size)))*d);a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1,null));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(f+d-c),0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d-c,0));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1,null));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,d-c,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(f+d-c),b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,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)];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,
@@ -2611,102 +2610,103 @@ function(a,c,b){a=[];var f=Math.min(c,b/2),d=Math.min(c-f,Math.max(0,parseFloat(
[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,
1),!0),new mxConnectionConstraint(new mxPoint(1,.5),!0)];mxHexagon.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.375,0),!0),new mxConnectionConstraint(new mxPoint(.5,0),!0),new mxConnectionConstraint(new mxPoint(.625,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(.375,1),!0),new mxConnectionConstraint(new mxPoint(.5,1),!0),new mxConnectionConstraint(new mxPoint(.625,1),!0)];mxCloud.prototype.constraints=[new mxConnectionConstraint(new mxPoint(.25,.25),!1),new mxConnectionConstraint(new mxPoint(.4,.1),!1),new mxConnectionConstraint(new mxPoint(.16,.55),!1),new mxConnectionConstraint(new mxPoint(.07,.4),!1),new mxConnectionConstraint(new mxPoint(.31,.8),!1),new mxConnectionConstraint(new mxPoint(.13,.77),!1),new mxConnectionConstraint(new mxPoint(.8,
-.8),!1),new mxConnectionConstraint(new mxPoint(.55,.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)];c.prototype.constraints=mxRectangleShape.prototype.constraints;f.prototype.constraints=mxRectangleShape.prototype.constraints;A.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)];mxArrow.prototype.constraints=null;N.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,
-"dx",this.dx)))),d=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.75*c+.25*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,.5*(c+f),.5*(b+d)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c+f),b));a.push(new mxConnectionConstraint(new mxPoint(.5,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,.5*(c-f),.5*(b+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,.25*c-.25*f,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,.5*d));return a};L.prototype.getConstraints=function(a,c,b){a=[];var f=Math.max(0,Math.min(c,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),d=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,
-0),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,.5*d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c,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,f,d));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,.5*(b+d)));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));a.push(new mxConnectionConstraint(new mxPoint(0,
+.8),!1),new mxConnectionConstraint(new mxPoint(.55,.95),!1),new mxConnectionConstraint(new mxPoint(.875,.5),!1),new mxConnectionConstraint(new mxPoint(.96,.7),!1),new mxConnectionConstraint(new mxPoint(.625,.2),!1),new mxConnectionConstraint(new mxPoint(.88,.25),!1)];d.prototype.constraints=mxRectangleShape.prototype.constraints;f.prototype.constraints=mxRectangleShape.prototype.constraints;A.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)];mxArrow.prototype.constraints=null;N.prototype.getConstraints=function(a,d,b){a=[];var c=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,
+"dx",this.dx)))),f=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,0),!1));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,.75*d+.25*c,f));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,.5*(d+c),f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d+c),.5*(b+f)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d+c),b));a.push(new mxConnectionConstraint(new mxPoint(.5,1),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d-c),b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d-c),.5*(b+f)));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d-c),f));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,.25*d-.25*c,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*f));return a};L.prototype.getConstraints=function(a,d,b){a=[];var c=Math.max(0,Math.min(d,parseFloat(mxUtils.getValue(this.style,"dx",this.dx)))),f=Math.max(0,Math.min(b,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1));a.push(new mxConnectionConstraint(new mxPoint(.5,0),!1));a.push(new mxConnectionConstraint(new mxPoint(1,
+0),!1));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,.5*(d+c),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(0,0),!1,null,c,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*c,b));a.push(new mxConnectionConstraint(new mxPoint(0,
.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,1),!1));return a};ha.prototype.constraints=[new mxConnectionConstraint(new mxPoint(0,0),!1),new mxConnectionConstraint(new mxPoint(0,.5),!1),new mxConnectionConstraint(new mxPoint(0,1),!1),new mxConnectionConstraint(new mxPoint(.25,.5),!1),new mxConnectionConstraint(new mxPoint(.5,.5),!1),new mxConnectionConstraint(new mxPoint(.75,.5),!1),new mxConnectionConstraint(new mxPoint(1,0),!1),new mxConnectionConstraint(new mxPoint(1,.5),!1),new mxConnectionConstraint(new mxPoint(1,
-1),!1)];R.prototype.getConstraints=function(a,c,b){a=[];var f=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize)))),f=(b-f)/2;a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,f));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-d,0));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(c-d),b-f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,b-f));return a};ia.prototype.getConstraints=function(a,c,b){a=[];var f=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",R.prototype.arrowWidth)))),d=c*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
-"arrowSize",R.prototype.arrowSize)))),f=(b-f)/2;a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*c,f));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-d,0));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,c-d,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*c,b-f));a.push(new mxConnectionConstraint(new mxPoint(0,
-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};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)];R.prototype.getConstraints=function(a,d,b){a=[];var c=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth)))),f=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize)))),c=(b-c)/2;a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d-f),c));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,d-f,0));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d-f,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d-f),b-c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,b-c));return a};ia.prototype.getConstraints=function(a,d,b){a=[];var c=b*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",R.prototype.arrowWidth)))),f=d*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,
+"arrowSize",R.prototype.arrowSize)))),c=(b-c)/2;a.push(new mxConnectionConstraint(new mxPoint(0,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,0));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*d,c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d-f,0));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d-f,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*d,b-c));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,f,b));return a};ra.prototype.getConstraints=function(a,d,b){a=[];var c=Math.min(b,d),f=Math.max(0,Math.min(c,c*parseFloat(mxUtils.getValue(this.style,"size",this.size)))),c=(b-f)/2,e=c+f,g=(d-f)/2,f=g+f;a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,.5*c));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,f,0));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,f,.5*c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,g,b-.5*c));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,f,b));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,b-.5*c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,f,e));a.push(new mxConnectionConstraint(new mxPoint(0,
+0),!1,null,.5*(d+f),c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,c));a.push(new mxConnectionConstraint(new mxPoint(1,.5),!1));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,d,e));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,.5*(d+f),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,c));a.push(new mxConnectionConstraint(new mxPoint(0,0),!1,null,0,c));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,c));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&&0<b.length){var e=d.model.getParents(b);d.removeCells(b,a);if(null!=e){a=[];for(b=0;b<e.length;b++)d.model.contains(e[b])&&(d.model.isVertex(e[b])||d.model.isEdge(e[b]))&&a.push(e[b]);d.setSelectionCells(a)}}}var b=this.editorUi,e=b.editor,d=e.graph,k=function(){return Action.prototype.isEnabled.apply(this,arguments)&&d.isEnabled()};this.addAction("new...",function(){d.openLink(b.getUrl())});
-this.addAction("open...",function(){window.openNew=!0;window.openKey="open";b.openFile()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){b.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var d=mxUtils.parseXml(a);e.graph.setSelectionCells(e.graph.importGraphModel(d.documentElement))}catch(c){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+c.message)}}));b.showDialog((new OpenDialog(this)).container,
+Actions.prototype.init=function(){function a(a){c.escape();var b=c.getDeletableCells(c.getSelectionCells());if(null!=b&&0<b.length){var e=c.model.getParents(b);c.removeCells(b,a);if(null!=e){a=[];for(b=0;b<e.length;b++)c.model.contains(e[b])&&(c.model.isVertex(e[b])||c.model.isEdge(e[b]))&&a.push(e[b]);c.setSelectionCells(a)}}}var b=this.editorUi,e=b.editor,c=e.graph,k=function(){return Action.prototype.isEnabled.apply(this,arguments)&&c.isEnabled()};this.addAction("new...",function(){c.openLink(b.getUrl())});
+this.addAction("open...",function(){window.openNew=!0;window.openKey="open";b.openFile()});this.addAction("import...",function(){window.openNew=!1;window.openKey="import";window.openFile=new OpenFile(mxUtils.bind(this,function(){b.hideDialog()}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){try{var c=mxUtils.parseXml(a);e.graph.setSelectionCells(e.graph.importGraphModel(c.documentElement))}catch(d){mxUtils.alert(mxResources.get("invalidOrMissingFile")+": "+d.message)}}));b.showDialog((new OpenDialog(this)).container,
320,220,!0,!0,function(){window.openFile=null})}).isEnabled=k;this.addAction("save",function(){b.saveFile(!1)},null,null,Editor.ctrlKey+"+S").isEnabled=k;this.addAction("saveAs...",function(){b.saveFile(!0)},null,null,Editor.ctrlKey+"+Shift+S").isEnabled=k;this.addAction("export...",function(){b.showDialog((new ExportDialog(b)).container,300,230,!0,!0)});this.addAction("editDiagram...",function(){var a=new EditDiagramDialog(b);b.showDialog(a.container,620,420,!0,!1);a.init()});this.addAction("pageSetup...",
-function(){b.showDialog((new PageSetupDialog(b)).container,320,220,!0,!0)}).isEnabled=k;this.addAction("print...",function(){b.showDialog((new PrintDialog(b)).container,300,180,!0,!0)},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(d,null,10,10)});this.addAction("undo",function(){b.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){b.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",
-function(){mxClipboard.cut(d)},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){mxClipboard.copy(d)},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&mxClipboard.paste(d)},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(a){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){d.getModel().beginUpdate();try{var b=mxClipboard.paste(d);if(null!=b){a=!0;for(var e=0;e<b.length&&
-a;e++)a=a&&d.model.isEdge(b[e]);var c=d.view.translate,f=d.view.scale,g=c.x,n=c.y,c=null;if(1==b.length&&a){var l=d.getCellGeometry(b[0]);null!=l&&(c=l.getTerminalPoint(!0))}c=null!=c?c:d.getBoundingBoxFromGeometry(b,a);if(null!=c){var p=Math.round(d.snap(d.popupMenuHandler.triggerX/f-g)),k=Math.round(d.snap(d.popupMenuHandler.triggerY/f-n));d.cellsMoved(b,p-c.x,k-c.y)}}}finally{d.getModel().endUpdate()}}});this.addAction("copySize",function(a){a=d.getSelectionCell();d.isEnabled()&&null!=a&&d.getModel().isVertex(a)&&
-(a=d.getCellGeometry(a),null!=a&&(b.copiedSize=new mxRectangle(a.x,a.y,a.width,a.height)))},null,null,"Alt+Shit+X");this.addAction("pasteSize",function(a){if(d.isEnabled()&&!d.isSelectionEmpty()&&null!=b.copiedSize){d.getModel().beginUpdate();try{var e=d.getSelectionCells();for(a=0;a<e.length;a++)if(d.getModel().isVertex(e[a])){var k=d.getCellGeometry(e[a]);null!=k&&(k=k.clone(),k.width=b.copiedSize.width,k.height=b.copiedSize.height,d.getModel().setGeometry(e[a],k))}}finally{d.getModel().endUpdate()}}},
-null,null,"Alt+Shit+V");this.addAction("delete",function(b){a(null!=b&&mxEvent.isShiftDown(b))},null,null,"Delete");this.addAction("deleteAll",function(){a(!0)},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){d.setSelectionCells(d.duplicateCells())},null,null,Editor.ctrlKey+"+D");this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(){d.turnShapes(d.getSelectionCells())},null,null,Editor.ctrlKey+"+R"));this.addAction("selectVertices",
-function(){d.selectVertices()},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){d.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",function(){d.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){d.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A");this.addAction("lockUnlock",function(){if(!d.isSelectionEmpty()){d.getModel().beginUpdate();try{var a=d.isCellMovable(d.getSelectionCell())?1:0;d.toggleCellStyles(mxConstants.STYLE_MOVABLE,
-a);d.toggleCellStyles(mxConstants.STYLE_RESIZABLE,a);d.toggleCellStyles(mxConstants.STYLE_ROTATABLE,a);d.toggleCellStyles(mxConstants.STYLE_DELETABLE,a);d.toggleCellStyles(mxConstants.STYLE_EDITABLE,a);d.toggleCellStyles("connectable",a)}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("home",function(){d.home()},null,null,"Home");this.addAction("exitGroup",function(){d.exitGroup()},null,null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){d.enterGroup()},
-null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){d.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){d.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){d.orderCells(!1)},null,null,Editor.ctrlKey+"+Shift+F");this.addAction("toBack",function(){d.orderCells(!0)},null,null,Editor.ctrlKey+"+Shift+B");this.addAction("group",function(){1==d.getSelectionCount()?d.setCellStyles("container","1"):d.setSelectionCell(d.groupCells(null,
-0))},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){1==d.getSelectionCount()&&0==d.getModel().getChildCount(d.getSelectionCell())?d.setCellStyles("container","0"):d.setSelectionCells(d.ungroupCells())},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){d.removeCellsFromParent()});this.addAction("edit",function(){d.isEnabled()&&d.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var a=d.getSelectionCell()||d.getModel().getRoot();
-b.showDataDialog(a)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),e="";if(mxUtils.isNode(d.value)){var c=d.value.getAttribute("tooltip");null!=c&&(e=c)}e=new TextareaDialog(b,mxResources.get("editTooltip")+":",e,function(c){a.setTooltipForCell(d,c)});b.showDialog(e.container,320,200,!0,!0);e.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var a=d.getLinkForCell(d.getSelectionCell());
-null!=a&&d.openLink(a)});this.addAction("editLink...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var d=a.getSelectionCell(),e=a.getLinkForCell(d)||"";b.showLinkDialog(e,mxResources.get("apply"),function(c){c=mxUtils.trim(c);a.setLinkForCell(d,0<c.length?c:null)})}},null,null,"Alt+Shift+L");this.put("insertImage",new Action(mxResources.get("image")+"...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&(d.clearSelection(),b.actions.get("image").funct())})).isEnabled=
-k;this.put("insertLink",new Action(mxResources.get("link")+"...",function(){d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())&&b.showLinkDialog("",mxResources.get("insert"),function(a,b){a=mxUtils.trim(a);if(0<a.length){var e=null,c=d.getLinkTitle(a);null!=b&&0<b.length&&(e=b[0].iconUrl,c=b[0].name||b[0].type,c=c.charAt(0).toUpperCase()+c.substring(1),30<c.length&&(c=c.substring(0,30)+"..."));var f=d.getFreeInsertPoint(),e=new mxCell(c,new mxGeometry(f.x,f.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+
-(null!=e?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+e:"spacing=10;"));e.vertex=!0;d.setLinkForCell(e,a);d.cellSizeUpdated(e,!0);d.getModel().beginUpdate();try{e=d.addCell(e),d.fireEvent(new mxEventObject("cellsInserted","cells",[e]))}finally{d.getModel().endUpdate()}d.setSelectionCell(e);d.scrollCellToVisible(d.getSelectionCell())}})})).isEnabled=k;this.addAction("link...",mxUtils.bind(this,function(){var a=b.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var d=
-a.getSelectedElement(),e=a.getParentByName(d,"A",a.cellEditor.textarea),c="";if(null==e&&null!=d&&null!=d.getElementsByTagName)for(var f=d.getElementsByTagName("a"),g=0;g<f.length&&null==e;g++)f[g].textContent==d.textContent&&(e=f[g]);null!=e&&"A"==e.nodeName&&(c=e.getAttribute("href")||"",a.selectNode(e));var n=a.cellEditor.saveSelection();b.showLinkDialog(c,mxResources.get("apply"),mxUtils.bind(this,function(c){a.cellEditor.restoreSelection(n);null!=c&&a.insertLink(c)}))}else a.isSelectionEmpty()?
-this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=k;this.addAction("autosize",function(){var a=d.getSelectionCells();if(null!=a){d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var e=a[b];if(d.getModel().getChildCount(e))d.updateGroupBounds([e],20);else{var c=d.view.getState(e),f=d.getCellGeometry(e);d.getModel().isVertex(e)&&null!=c&&null!=c.text&&null!=f&&d.isWrapping(e)?(f=f.clone(),f.height=c.text.boundingBox.height/d.view.scale,d.getModel().setGeometry(e,f)):
-d.updateCellSize(e)}}}finally{d.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=d.getView().getState(d.getSelectionCell());if(null!=a){var e="1";d.stopEditing();d.getModel().beginUpdate();try{if("1"==a.style.html){var e=null,k=d.convertValueToString(a.cell);"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(k=k.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));var c=document.createElement("div");c.innerHTML=k;k=mxUtils.extractTextWithWhitespace(c.childNodes);
-d.cellLabelChanged(a.cell,k)}else k=mxUtils.htmlEntities(d.convertValueToString(a.cell),!1),"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(k=k.replace(/\n/g,"<br/>")),d.cellLabelChanged(a.cell,d.sanitizeHtml(k));d.setCellStyles("html",e);b.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=e?e:"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("wordWrap",function(){var a=d.getView().getState(d.getSelectionCell()),b="wrap";d.stopEditing();
-null!=a&&"wrap"==a.style[mxConstants.STYLE_WHITE_SPACE]&&(b=null);d.setCellStyles(mxConstants.STYLE_WHITE_SPACE,b)});this.addAction("rotation",function(){var a="0",e=d.getView().getState(d.getSelectionCell());null!=e&&(a=e.style[mxConstants.STYLE_ROTATION]||a);a=new FilenameDialog(b,a,mxResources.get("apply"),function(a){null!=a&&0<a.length&&d.setCellStyles(mxConstants.STYLE_ROTATION,a)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");b.showDialog(a.container,375,80,!0,!0);
-a.init()});this.addAction("resetView",function(){d.zoomTo(1);b.resetScrollbars()},null,null,Editor.ctrlKey+"+H");this.addAction("zoomIn",function(a){d.zoomIn()},null,null,Editor.ctrlKey+" + (Numpad) / Alt+Mousewheel");this.addAction("zoomOut",function(a){d.zoomOut()},null,null,Editor.ctrlKey+" - (Numpad) / Alt+Mousewheel");this.addAction("fitWindow",function(){d.fit()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();
-var a=d.pageFormat,b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/a.width/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=a.y*d.view.scale-1,d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2)-1)}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();var a=d.pageFormat,
-b=d.pageScale;d.zoomTo(Math.floor(20*Math.min((d.container.clientWidth-10)/(2*a.width)/b,(d.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(d.container)&&(a=d.getPagePadding(),d.container.scrollTop=Math.min(a.y,(d.container.scrollHeight-d.container.clientHeight)/2),d.container.scrollLeft=Math.min(a.x,(d.container.scrollWidth-d.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){d.pageVisible||this.get("pageView").funct();
-d.zoomTo(Math.floor(20*(d.container.clientWidth-10)/d.pageFormat.width/d.pageScale)/20);if(mxUtils.hasScrollbars(d.container)){var a=d.getPagePadding();d.container.scrollLeft=Math.min(a.x*d.view.scale,(d.container.scrollWidth-d.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*d.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&
-0<a&&d.zoomTo(a/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*d.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var m=null,m=this.addAction("grid",
-function(){d.setGridEnabled(!d.isGridEnabled());b.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");m.setToggleAction(!0);m.setSelectedCallback(function(){return d.isGridEnabled()});m.setEnabled(!1);m=this.addAction("guides",function(){d.graphHandler.guidesEnabled=!d.graphHandler.guidesEnabled;b.fireEvent(new mxEventObject("guidesEnabledChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.graphHandler.guidesEnabled});m.setEnabled(!1);
-m=this.addAction("tooltips",function(){d.tooltipHandler.setEnabled(!d.tooltipHandler.isEnabled())});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.tooltipHandler.isEnabled()});m=this.addAction("collapseExpand",function(){var a=new ChangePageSetup(b);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!d.foldingEnabled;d.model.execute(a)});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.foldingEnabled});m.isEnabled=k;m=this.addAction("scrollbars",function(){b.setScrollbars(!b.hasScrollbars())});
-m.setToggleAction(!0);m.setSelectedCallback(function(){return d.scrollbars});m=this.addAction("pageView",mxUtils.bind(this,function(){b.setPageVisible(!d.pageVisible)}));m.setToggleAction(!0);m.setSelectedCallback(function(){return d.pageVisible});m=this.addAction("connectionArrows",function(){d.connectionArrowsEnabled=!d.connectionArrowsEnabled;b.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");m.setToggleAction(!0);m.setSelectedCallback(function(){return d.connectionArrowsEnabled});
-m=this.addAction("connectionPoints",function(){d.setConnectable(!d.connectionHandler.isEnabled());b.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(function(){return d.connectionHandler.isEnabled()});m=this.addAction("copyConnect",function(){d.connectionHandler.setCreateTarget(!d.connectionHandler.isCreateTarget());b.fireEvent(new mxEventObject("copyConnectChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return d.connectionHandler.isCreateTarget()});
-m.isEnabled=k;m=this.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.editor.autosave});m.isEnabled=k;m.visible=!1;this.addAction("help",function(){var a="";mxResources.isLanguageSupported(mxClient.language)&&(a="_"+mxClient.language);d.openLink(RESOURCES_PATH+"/help"+a+".html")});var q=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){q||(b.showDialog((new AboutDialog(b)).container,
-320,280,!0,!0,function(){q=!1}),q=!0)},null,null,"F1"));m=mxUtils.bind(this,function(a,b,e,c){return this.addAction(a,function(){if(null!=e&&d.cellEditor.isContentEditing())e();else{d.stopEditing(!1);d.getModel().beginUpdate();try{d.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,b),(b&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontWeight=null;"B"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?
-d.updateLabelElements(d.getSelectionCells(),function(a){a.style.fontStyle=null;"I"==a.nodeName&&d.replaceElement(a)}):(b&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&d.updateLabelElements(d.getSelectionCells(),function(a){a.style.textDecoration=null;"U"==a.nodeName&&d.replaceElement(a)})}finally{d.getModel().endUpdate()}}},null,null,c)});m("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");m("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",
+function(){b.showDialog((new PageSetupDialog(b)).container,320,220,!0,!0)}).isEnabled=k;this.addAction("print...",function(){b.showDialog((new PrintDialog(b)).container,300,180,!0,!0)},null,"sprite-print",Editor.ctrlKey+"+P");this.addAction("preview",function(){mxUtils.show(c,null,10,10)});this.addAction("undo",function(){b.undo()},null,"sprite-undo",Editor.ctrlKey+"+Z");this.addAction("redo",function(){b.redo()},null,"sprite-redo",mxClient.IS_WIN?Editor.ctrlKey+"+Y":Editor.ctrlKey+"+Shift+Z");this.addAction("cut",
+function(){mxClipboard.cut(c)},null,"sprite-cut",Editor.ctrlKey+"+X");this.addAction("copy",function(){mxClipboard.copy(c)},null,"sprite-copy",Editor.ctrlKey+"+C");this.addAction("paste",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&mxClipboard.paste(c)},!1,"sprite-paste",Editor.ctrlKey+"+V");this.addAction("pasteHere",function(a){if(c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())){c.getModel().beginUpdate();try{var b=mxClipboard.paste(c);if(null!=b){a=!0;for(var e=0;e<b.length&&
+a;e++)a=a&&c.model.isEdge(b[e]);var d=c.view.translate,f=c.view.scale,g=d.x,n=d.y,d=null;if(1==b.length&&a){var l=c.getCellGeometry(b[0]);null!=l&&(d=l.getTerminalPoint(!0))}d=null!=d?d:c.getBoundingBoxFromGeometry(b,a);if(null!=d){var p=Math.round(c.snap(c.popupMenuHandler.triggerX/f-g)),k=Math.round(c.snap(c.popupMenuHandler.triggerY/f-n));c.cellsMoved(b,p-d.x,k-d.y)}}}finally{c.getModel().endUpdate()}}});this.addAction("copySize",function(a){a=c.getSelectionCell();c.isEnabled()&&null!=a&&c.getModel().isVertex(a)&&
+(a=c.getCellGeometry(a),null!=a&&(b.copiedSize=new mxRectangle(a.x,a.y,a.width,a.height)))},null,null,"Alt+Shit+X");this.addAction("pasteSize",function(a){if(c.isEnabled()&&!c.isSelectionEmpty()&&null!=b.copiedSize){c.getModel().beginUpdate();try{var e=c.getSelectionCells();for(a=0;a<e.length;a++)if(c.getModel().isVertex(e[a])){var k=c.getCellGeometry(e[a]);null!=k&&(k=k.clone(),k.width=b.copiedSize.width,k.height=b.copiedSize.height,c.getModel().setGeometry(e[a],k))}}finally{c.getModel().endUpdate()}}},
+null,null,"Alt+Shit+V");this.addAction("delete",function(b){a(null!=b&&mxEvent.isShiftDown(b))},null,null,"Delete");this.addAction("deleteAll",function(){a(!0)},null,null,Editor.ctrlKey+"+Delete");this.addAction("duplicate",function(){c.setSelectionCells(c.duplicateCells())},null,null,Editor.ctrlKey+"+D");this.put("turn",new Action(mxResources.get("turn")+" / "+mxResources.get("reverse"),function(){c.turnShapes(c.getSelectionCells())},null,null,Editor.ctrlKey+"+R"));this.addAction("selectVertices",
+function(){c.selectVertices()},null,null,Editor.ctrlKey+"+Shift+I");this.addAction("selectEdges",function(){c.selectEdges()},null,null,Editor.ctrlKey+"+Shift+E");this.addAction("selectAll",function(){c.selectAll(null,!0)},null,null,Editor.ctrlKey+"+A");this.addAction("selectNone",function(){c.clearSelection()},null,null,Editor.ctrlKey+"+Shift+A");this.addAction("lockUnlock",function(){if(!c.isSelectionEmpty()){c.getModel().beginUpdate();try{var a=c.isCellMovable(c.getSelectionCell())?1:0;c.toggleCellStyles(mxConstants.STYLE_MOVABLE,
+a);c.toggleCellStyles(mxConstants.STYLE_RESIZABLE,a);c.toggleCellStyles(mxConstants.STYLE_ROTATABLE,a);c.toggleCellStyles(mxConstants.STYLE_DELETABLE,a);c.toggleCellStyles(mxConstants.STYLE_EDITABLE,a);c.toggleCellStyles("connectable",a)}finally{c.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+L");this.addAction("home",function(){c.home()},null,null,"Home");this.addAction("exitGroup",function(){c.exitGroup()},null,null,Editor.ctrlKey+"+Shift+Home");this.addAction("enterGroup",function(){c.enterGroup()},
+null,null,Editor.ctrlKey+"+Shift+End");this.addAction("collapse",function(){c.foldCells(!0)},null,null,Editor.ctrlKey+"+Home");this.addAction("expand",function(){c.foldCells(!1)},null,null,Editor.ctrlKey+"+End");this.addAction("toFront",function(){c.orderCells(!1)},null,null,Editor.ctrlKey+"+Shift+F");this.addAction("toBack",function(){c.orderCells(!0)},null,null,Editor.ctrlKey+"+Shift+B");this.addAction("group",function(){1==c.getSelectionCount()?c.setCellStyles("container","1"):c.setSelectionCell(c.groupCells(null,
+0))},null,null,Editor.ctrlKey+"+G");this.addAction("ungroup",function(){1==c.getSelectionCount()&&0==c.getModel().getChildCount(c.getSelectionCell())?c.setCellStyles("container","0"):c.setSelectionCells(c.ungroupCells())},null,null,Editor.ctrlKey+"+Shift+U");this.addAction("removeFromGroup",function(){c.removeCellsFromParent()});this.addAction("edit",function(){c.isEnabled()&&c.startEditingAtCell()},null,null,"F2/Enter");this.addAction("editData...",function(){var a=c.getSelectionCell()||c.getModel().getRoot();
+b.showDataDialog(a)},null,null,Editor.ctrlKey+"+M");this.addAction("editTooltip...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var c=a.getSelectionCell(),e="";if(mxUtils.isNode(c.value)){var d=c.value.getAttribute("tooltip");null!=d&&(e=d)}e=new TextareaDialog(b,mxResources.get("editTooltip")+":",e,function(d){a.setTooltipForCell(c,d)});b.showDialog(e.container,320,200,!0,!0);e.init()}},null,null,"Alt+Shift+T");this.addAction("openLink",function(){var a=c.getLinkForCell(c.getSelectionCell());
+null!=a&&c.openLink(a)});this.addAction("editLink...",function(){var a=b.editor.graph;if(a.isEnabled()&&!a.isSelectionEmpty()){var c=a.getSelectionCell(),e=a.getLinkForCell(c)||"";b.showLinkDialog(e,mxResources.get("apply"),function(d){d=mxUtils.trim(d);a.setLinkForCell(c,0<d.length?d:null)})}},null,null,"Alt+Shift+L");this.put("insertImage",new Action(mxResources.get("image")+"...",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&(c.clearSelection(),b.actions.get("image").funct())})).isEnabled=
+k;this.put("insertLink",new Action(mxResources.get("link")+"...",function(){c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())&&b.showLinkDialog("",mxResources.get("insert"),function(a,b){a=mxUtils.trim(a);if(0<a.length){var e=null,d=c.getLinkTitle(a);null!=b&&0<b.length&&(e=b[0].iconUrl,d=b[0].name||b[0].type,d=d.charAt(0).toUpperCase()+d.substring(1),30<d.length&&(d=d.substring(0,30)+"..."));var f=c.getFreeInsertPoint(),e=new mxCell(d,new mxGeometry(f.x,f.y,100,40),"fontColor=#0000EE;fontStyle=4;rounded=1;overflow=hidden;"+
+(null!=e?"shape=label;imageWidth=16;imageHeight=16;spacingLeft=26;align=left;image="+e:"spacing=10;"));e.vertex=!0;c.setLinkForCell(e,a);c.cellSizeUpdated(e,!0);c.getModel().beginUpdate();try{e=c.addCell(e),c.fireEvent(new mxEventObject("cellsInserted","cells",[e]))}finally{c.getModel().endUpdate()}c.setSelectionCell(e);c.scrollCellToVisible(c.getSelectionCell())}})})).isEnabled=k;this.addAction("link...",mxUtils.bind(this,function(){var a=b.editor.graph;if(a.isEnabled())if(a.cellEditor.isContentEditing()){var c=
+a.getSelectedElement(),e=a.getParentByName(c,"A",a.cellEditor.textarea),d="";if(null==e&&null!=c&&null!=c.getElementsByTagName)for(var f=c.getElementsByTagName("a"),g=0;g<f.length&&null==e;g++)f[g].textContent==c.textContent&&(e=f[g]);null!=e&&"A"==e.nodeName&&(d=e.getAttribute("href")||"",a.selectNode(e));var n=a.cellEditor.saveSelection();b.showLinkDialog(d,mxResources.get("apply"),mxUtils.bind(this,function(d){a.cellEditor.restoreSelection(n);null!=d&&a.insertLink(d)}))}else a.isSelectionEmpty()?
+this.get("insertLink").funct():this.get("editLink").funct()})).isEnabled=k;this.addAction("autosize",function(){var a=c.getSelectionCells();if(null!=a){c.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var e=a[b];if(c.getModel().getChildCount(e))c.updateGroupBounds([e],20);else{var d=c.view.getState(e),f=c.getCellGeometry(e);c.getModel().isVertex(e)&&null!=d&&null!=d.text&&null!=f&&c.isWrapping(e)?(f=f.clone(),f.height=d.text.boundingBox.height/c.view.scale,c.getModel().setGeometry(e,f)):
+c.updateCellSize(e)}}}finally{c.getModel().endUpdate()}}},null,null,Editor.ctrlKey+"+Shift+Y");this.addAction("formattedText",function(){var a=c.getView().getState(c.getSelectionCell());if(null!=a){var e="1";c.stopEditing();c.getModel().beginUpdate();try{if("1"==a.style.html){var e=null,k=c.convertValueToString(a.cell);"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(k=k.replace(/\n/g,"").replace(/<br\s*.?>/g,"\n"));var d=document.createElement("div");d.innerHTML=k;k=mxUtils.extractTextWithWhitespace(d.childNodes);
+c.cellLabelChanged(a.cell,k)}else k=mxUtils.htmlEntities(c.convertValueToString(a.cell),!1),"0"!=mxUtils.getValue(a.style,"nl2Br","1")&&(k=k.replace(/\n/g,"<br/>")),c.cellLabelChanged(a.cell,c.sanitizeHtml(k));c.setCellStyles("html",e);b.fireEvent(new mxEventObject("styleChanged","keys",["html"],"values",[null!=e?e:"0"],"cells",c.getSelectionCells()))}finally{c.getModel().endUpdate()}}});this.addAction("wordWrap",function(){var a=c.getView().getState(c.getSelectionCell()),b="wrap";c.stopEditing();
+null!=a&&"wrap"==a.style[mxConstants.STYLE_WHITE_SPACE]&&(b=null);c.setCellStyles(mxConstants.STYLE_WHITE_SPACE,b)});this.addAction("rotation",function(){var a="0",e=c.getView().getState(c.getSelectionCell());null!=e&&(a=e.style[mxConstants.STYLE_ROTATION]||a);a=new FilenameDialog(b,a,mxResources.get("apply"),function(a){null!=a&&0<a.length&&c.setCellStyles(mxConstants.STYLE_ROTATION,a)},mxResources.get("enterValue")+" ("+mxResources.get("rotation")+" 0-360)");b.showDialog(a.container,375,80,!0,!0);
+a.init()});this.addAction("resetView",function(){c.zoomTo(1);b.resetScrollbars()},null,null,Editor.ctrlKey+"+H");this.addAction("zoomIn",function(a){c.zoomIn()},null,null,Editor.ctrlKey+" + (Numpad) / Alt+Mousewheel");this.addAction("zoomOut",function(a){c.zoomOut()},null,null,Editor.ctrlKey+" - (Numpad) / Alt+Mousewheel");this.addAction("fitWindow",function(){c.fit()},null,null,Editor.ctrlKey+"+Shift+H");this.addAction("fitPage",mxUtils.bind(this,function(){c.pageVisible||this.get("pageView").funct();
+var a=c.pageFormat,b=c.pageScale;c.zoomTo(Math.floor(20*Math.min((c.container.clientWidth-10)/a.width/b,(c.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(c.container)&&(a=c.getPagePadding(),c.container.scrollTop=a.y*c.view.scale-1,c.container.scrollLeft=Math.min(a.x*c.view.scale,(c.container.scrollWidth-c.container.clientWidth)/2)-1)}),null,null,Editor.ctrlKey+"+J");this.addAction("fitTwoPages",mxUtils.bind(this,function(){c.pageVisible||this.get("pageView").funct();var a=c.pageFormat,
+b=c.pageScale;c.zoomTo(Math.floor(20*Math.min((c.container.clientWidth-10)/(2*a.width)/b,(c.container.clientHeight-10)/a.height/b))/20);mxUtils.hasScrollbars(c.container)&&(a=c.getPagePadding(),c.container.scrollTop=Math.min(a.y,(c.container.scrollHeight-c.container.clientHeight)/2),c.container.scrollLeft=Math.min(a.x,(c.container.scrollWidth-c.container.clientWidth)/2))}),null,null,Editor.ctrlKey+"+Shift+J");this.addAction("fitPageWidth",mxUtils.bind(this,function(){c.pageVisible||this.get("pageView").funct();
+c.zoomTo(Math.floor(20*(c.container.clientWidth-10)/c.pageFormat.width/c.pageScale)/20);if(mxUtils.hasScrollbars(c.container)){var a=c.getPagePadding();c.container.scrollLeft=Math.min(a.x*c.view.scale,(c.container.scrollWidth-c.container.clientWidth)/2)}}));this.put("customZoom",new Action(mxResources.get("custom")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*c.getView().getScale()),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&
+0<a&&c.zoomTo(a/100)}),mxResources.get("zoom")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}),null,null,Editor.ctrlKey+"+0"));this.addAction("pageScale...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.editorUi,parseInt(100*c.pageScale),mxResources.get("apply"),mxUtils.bind(this,function(a){a=parseInt(a);!isNaN(a)&&0<a&&b.setPageScale(a/100)}),mxResources.get("pageScale")+" (%)");this.editorUi.showDialog(a.container,300,80,!0,!0);a.init()}));var m=null,m=this.addAction("grid",
+function(){c.setGridEnabled(!c.isGridEnabled());b.fireEvent(new mxEventObject("gridEnabledChanged"))},null,null,Editor.ctrlKey+"+Shift+G");m.setToggleAction(!0);m.setSelectedCallback(function(){return c.isGridEnabled()});m.setEnabled(!1);m=this.addAction("guides",function(){c.graphHandler.guidesEnabled=!c.graphHandler.guidesEnabled;b.fireEvent(new mxEventObject("guidesEnabledChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return c.graphHandler.guidesEnabled});m.setEnabled(!1);
+m=this.addAction("tooltips",function(){c.tooltipHandler.setEnabled(!c.tooltipHandler.isEnabled())});m.setToggleAction(!0);m.setSelectedCallback(function(){return c.tooltipHandler.isEnabled()});m=this.addAction("collapseExpand",function(){var a=new ChangePageSetup(b);a.ignoreColor=!0;a.ignoreImage=!0;a.foldingEnabled=!c.foldingEnabled;c.model.execute(a)});m.setToggleAction(!0);m.setSelectedCallback(function(){return c.foldingEnabled});m.isEnabled=k;m=this.addAction("scrollbars",function(){b.setScrollbars(!b.hasScrollbars())});
+m.setToggleAction(!0);m.setSelectedCallback(function(){return c.scrollbars});m=this.addAction("pageView",mxUtils.bind(this,function(){b.setPageVisible(!c.pageVisible)}));m.setToggleAction(!0);m.setSelectedCallback(function(){return c.pageVisible});m=this.addAction("connectionArrows",function(){c.connectionArrowsEnabled=!c.connectionArrowsEnabled;b.fireEvent(new mxEventObject("connectionArrowsChanged"))},null,null,"Alt+Shift+A");m.setToggleAction(!0);m.setSelectedCallback(function(){return c.connectionArrowsEnabled});
+m=this.addAction("connectionPoints",function(){c.setConnectable(!c.connectionHandler.isEnabled());b.fireEvent(new mxEventObject("connectionPointsChanged"))},null,null,"Alt+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(function(){return c.connectionHandler.isEnabled()});m=this.addAction("copyConnect",function(){c.connectionHandler.setCreateTarget(!c.connectionHandler.isCreateTarget());b.fireEvent(new mxEventObject("copyConnectChanged"))});m.setToggleAction(!0);m.setSelectedCallback(function(){return c.connectionHandler.isCreateTarget()});
+m.isEnabled=k;m=this.addAction("autosave",function(){b.editor.setAutosave(!b.editor.autosave)});m.setToggleAction(!0);m.setSelectedCallback(function(){return b.editor.autosave});m.isEnabled=k;m.visible=!1;this.addAction("help",function(){var a="";mxResources.isLanguageSupported(mxClient.language)&&(a="_"+mxClient.language);c.openLink(RESOURCES_PATH+"/help"+a+".html")});var q=!1;this.put("about",new Action(mxResources.get("about")+" Graph Editor...",function(){q||(b.showDialog((new AboutDialog(b)).container,
+320,280,!0,!0,function(){q=!1}),q=!0)},null,null,"F1"));m=mxUtils.bind(this,function(a,b,e,d){return this.addAction(a,function(){if(null!=e&&c.cellEditor.isContentEditing())e();else{c.stopEditing(!1);c.getModel().beginUpdate();try{c.toggleCellStyleFlags(mxConstants.STYLE_FONTSTYLE,b),(b&mxConstants.FONT_BOLD)==mxConstants.FONT_BOLD?c.updateLabelElements(c.getSelectionCells(),function(a){a.style.fontWeight=null;"B"==a.nodeName&&c.replaceElement(a)}):(b&mxConstants.FONT_ITALIC)==mxConstants.FONT_ITALIC?
+c.updateLabelElements(c.getSelectionCells(),function(a){a.style.fontStyle=null;"I"==a.nodeName&&c.replaceElement(a)}):(b&mxConstants.FONT_UNDERLINE)==mxConstants.FONT_UNDERLINE&&c.updateLabelElements(c.getSelectionCells(),function(a){a.style.textDecoration=null;"U"==a.nodeName&&c.replaceElement(a)})}finally{c.getModel().endUpdate()}}},null,null,d)});m("bold",mxConstants.FONT_BOLD,function(){document.execCommand("bold",!1,null)},Editor.ctrlKey+"+B");m("italic",mxConstants.FONT_ITALIC,function(){document.execCommand("italic",
!1,null)},Editor.ctrlKey+"+I");m("underline",mxConstants.FONT_UNDERLINE,function(){document.execCommand("underline",!1,null)},Editor.ctrlKey+"+U");this.addAction("fontColor...",function(){b.menus.pickColor(mxConstants.STYLE_FONTCOLOR,"forecolor","000000")});this.addAction("strokeColor...",function(){b.menus.pickColor(mxConstants.STYLE_STROKECOLOR)});this.addAction("fillColor...",function(){b.menus.pickColor(mxConstants.STYLE_FILLCOLOR)});this.addAction("gradientColor...",function(){b.menus.pickColor(mxConstants.STYLE_GRADIENTCOLOR)});
-this.addAction("backgroundColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")});this.addAction("borderColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)});this.addAction("vertical",function(){b.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){b.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,
-null),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dashed",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,
-mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("dotted",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_DASHED,"1"),d.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("sharp",
-function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("rounded",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),d.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged",
-"keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!d.isSelectionEmpty()&&d.isEnabled()){d.getModel().beginUpdate();try{var a=d.getSelectionCells(),e=d.view.getState(a[0]),k=null!=e?e.style:d.getCellStyle(a[0]),c="1"==mxUtils.getValue(k,mxConstants.STYLE_ROUNDED,"0")?"0":"1";d.setCellStyles(mxConstants.STYLE_ROUNDED,c);d.setCellStyles(mxConstants.STYLE_CURVED,
-null);b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[c,"0"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}}});this.addAction("curved",function(){d.getModel().beginUpdate();try{d.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),d.setCellStyles(mxConstants.STYLE_CURVED,"1"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});
-this.addAction("collapsible",function(){var a=d.view.getState(d.getSelectionCell()),e="1";null!=a&&null!=d.getFoldingImage(a)&&(e="0");d.setCellStyles("collapsible",e);b.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[e],"cells",d.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var a=d.getSelectionCells();if(null!=a&&0<a.length){var b=d.getModel(),b=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",b.getStyle(a[0])||"",
-function(b){null!=b&&d.setCellStyle(mxUtils.trim(b),a)},null,null,400,220);this.editorUi.showDialog(b.container,420,300,!0,!0);b.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){d.isEnabled()&&!d.isSelectionEmpty()&&b.setDefaultStyle(d.getSelectionCell())},null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){d.isEnabled()&&b.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var a=d.getSelectionCell();
-if(null!=a&&d.getModel().isEdge(a)){var b=e.graph.selectionCellsHandler.getHandler(a);if(b instanceof mxEdgeHandler){for(var k=d.view.translate,c=d.view.scale,f=k.x,k=k.y,a=d.getModel().getParent(a),g=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=g;)f+=g.x,k+=g.y,a=d.getModel().getParent(a),g=d.getCellGeometry(a);f=Math.round(d.snap(d.popupMenuHandler.triggerX/c-f));c=Math.round(d.snap(d.popupMenuHandler.triggerY/c-k));b.addPointAt(b.state,f,c)}}});this.addAction("removeWaypoint",function(){var a=
-b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=d.getSelectionCells();if(null!=a){a=d.addAllEdges(a);d.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var e=a[b];if(d.getModel().isEdge(e)){var c=d.getCellGeometry(e);null!=c&&(c=c.clone(),c.points=null,d.getModel().setGeometry(e,c))}}}finally{d.getModel().endUpdate()}}},null,null,"Alt+Shift+C");m=this.addAction("subscript",mxUtils.bind(this,
-function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");m=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",e=d.getView().getState(d.getSelectionCell()),k="";null!=
-e&&(k=e.style[mxConstants.STYLE_IMAGE]||k);var c=d.cellEditor.saveSelection();b.showImageDialog(a,k,function(a,b,e){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(c),d.insertImage(a,b,e);else{var f=d.getSelectionCells();if(null!=a&&(0<a.length||0<f.length)){var g=null;d.getModel().beginUpdate();try{if(0==f.length){var n=d.getFreeInsertPoint(),g=f=[d.insertVertex(d.getDefaultParent(),null,"",n.x,n.y,b,e,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];
-d.fireEvent(new mxEventObject("cellsInserted","cells",g))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,f);var k=d.view.getState(f[0]),u=null!=k?k.style:d.getCellStyle(f[0]);"image"!=u[mxConstants.STYLE_SHAPE]&&"label"!=u[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",f):0==a.length&&d.setCellStyles(mxConstants.STYLE_SHAPE,null,f);if(1==d.getSelectionCount()&&null!=b&&null!=e){var m=f[0],z=d.getModel().getGeometry(m);null!=z&&(z=z.clone(),z.width=b,z.height=e,
-d.getModel().setGeometry(m,z))}}finally{d.getModel().endUpdate()}null!=g&&(d.setSelectionCells(g),d.scrollCellToVisible(g[0]))}}},d.cellEditor.isContentEditing(),!d.cellEditor.isContentEditing())}}).isEnabled=k;m=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(b,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",
+this.addAction("backgroundColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BACKGROUNDCOLOR,"backcolor")});this.addAction("borderColor...",function(){b.menus.pickColor(mxConstants.STYLE_LABEL_BORDERCOLOR)});this.addAction("vertical",function(){b.menus.toggleStyle(mxConstants.STYLE_HORIZONTAL,!0)});this.addAction("shadow",function(){b.menus.toggleStyle(mxConstants.STYLE_SHADOW)});this.addAction("solid",function(){c.getModel().beginUpdate();try{c.setCellStyles(mxConstants.STYLE_DASHED,
+null),c.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",[null,null],"cells",c.getSelectionCells()))}finally{c.getModel().endUpdate()}});this.addAction("dashed",function(){c.getModel().beginUpdate();try{c.setCellStyles(mxConstants.STYLE_DASHED,"1"),c.setCellStyles(mxConstants.STYLE_DASH_PATTERN,null),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,
+mxConstants.STYLE_DASH_PATTERN],"values",["1",null],"cells",c.getSelectionCells()))}finally{c.getModel().endUpdate()}});this.addAction("dotted",function(){c.getModel().beginUpdate();try{c.setCellStyles(mxConstants.STYLE_DASHED,"1"),c.setCellStyles(mxConstants.STYLE_DASH_PATTERN,"1 4"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mxConstants.STYLE_DASH_PATTERN],"values",["1","1 4"],"cells",c.getSelectionCells()))}finally{c.getModel().endUpdate()}});this.addAction("sharp",
+function(){c.getModel().beginUpdate();try{c.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),c.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","0"],"cells",c.getSelectionCells()))}finally{c.getModel().endUpdate()}});this.addAction("rounded",function(){c.getModel().beginUpdate();try{c.setCellStyles(mxConstants.STYLE_ROUNDED,"1"),c.setCellStyles(mxConstants.STYLE_CURVED,"0"),b.fireEvent(new mxEventObject("styleChanged",
+"keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["1","0"],"cells",c.getSelectionCells()))}finally{c.getModel().endUpdate()}});this.addAction("toggleRounded",function(){if(!c.isSelectionEmpty()&&c.isEnabled()){c.getModel().beginUpdate();try{var a=c.getSelectionCells(),e=c.view.getState(a[0]),k=null!=e?e.style:c.getCellStyle(a[0]),d="1"==mxUtils.getValue(k,mxConstants.STYLE_ROUNDED,"0")?"0":"1";c.setCellStyles(mxConstants.STYLE_ROUNDED,d);c.setCellStyles(mxConstants.STYLE_CURVED,
+null);b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[d,"0"],"cells",c.getSelectionCells()))}finally{c.getModel().endUpdate()}}});this.addAction("curved",function(){c.getModel().beginUpdate();try{c.setCellStyles(mxConstants.STYLE_ROUNDED,"0"),c.setCellStyles(mxConstants.STYLE_CURVED,"1"),b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",["0","1"],"cells",c.getSelectionCells()))}finally{c.getModel().endUpdate()}});
+this.addAction("collapsible",function(){var a=c.view.getState(c.getSelectionCell()),e="1";null!=a&&null!=c.getFoldingImage(a)&&(e="0");c.setCellStyles("collapsible",e);b.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[e],"cells",c.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var a=c.getSelectionCells();if(null!=a&&0<a.length){var b=c.getModel(),b=new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",b.getStyle(a[0])||"",
+function(b){null!=b&&c.setCellStyle(mxUtils.trim(b),a)},null,null,400,220);this.editorUi.showDialog(b.container,420,300,!0,!0);b.init()}}),null,null,Editor.ctrlKey+"+E");this.addAction("setAsDefaultStyle",function(){c.isEnabled()&&!c.isSelectionEmpty()&&b.setDefaultStyle(c.getSelectionCell())},null,null,Editor.ctrlKey+"+Shift+D");this.addAction("clearDefaultStyle",function(){c.isEnabled()&&b.clearDefaultStyle()},null,null,Editor.ctrlKey+"+Shift+R");this.addAction("addWaypoint",function(){var a=c.getSelectionCell();
+if(null!=a&&c.getModel().isEdge(a)){var b=e.graph.selectionCellsHandler.getHandler(a);if(b instanceof mxEdgeHandler){for(var k=c.view.translate,d=c.view.scale,f=k.x,k=k.y,a=c.getModel().getParent(a),g=c.getCellGeometry(a);c.getModel().isVertex(a)&&null!=g;)f+=g.x,k+=g.y,a=c.getModel().getParent(a),g=c.getCellGeometry(a);f=Math.round(c.snap(c.popupMenuHandler.triggerX/d-f));d=Math.round(c.snap(c.popupMenuHandler.triggerY/d-k));b.addPointAt(b.state,f,d)}}});this.addAction("removeWaypoint",function(){var a=
+b.actions.get("removeWaypoint");null!=a.handler&&a.handler.removePoint(a.handler.state,a.index)});this.addAction("clearWaypoints",function(){var a=c.getSelectionCells();if(null!=a){a=c.addAllEdges(a);c.getModel().beginUpdate();try{for(var b=0;b<a.length;b++){var e=a[b];if(c.getModel().isEdge(e)){var d=c.getCellGeometry(e);null!=d&&(d=d.clone(),d.points=null,c.getModel().setGeometry(e,d))}}}finally{c.getModel().endUpdate()}}},null,null,"Alt+Shift+C");m=this.addAction("subscript",mxUtils.bind(this,
+function(){c.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");m=this.addAction("superscript",mxUtils.bind(this,function(){c.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");this.addAction("image...",function(){if(c.isEnabled()&&!c.isCellLocked(c.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",e=c.getView().getState(c.getSelectionCell()),k="";null!=
+e&&(k=e.style[mxConstants.STYLE_IMAGE]||k);var d=c.cellEditor.saveSelection();b.showImageDialog(a,k,function(a,b,e){if(c.cellEditor.isContentEditing())c.cellEditor.restoreSelection(d),c.insertImage(a,b,e);else{var f=c.getSelectionCells();if(null!=a&&(0<a.length||0<f.length)){var g=null;c.getModel().beginUpdate();try{if(0==f.length){var n=c.getFreeInsertPoint(),g=f=[c.insertVertex(c.getDefaultParent(),null,"",n.x,n.y,b,e,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];
+c.fireEvent(new mxEventObject("cellsInserted","cells",g))}c.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,f);var k=c.view.getState(f[0]),u=null!=k?k.style:c.getCellStyle(f[0]);"image"!=u[mxConstants.STYLE_SHAPE]&&"label"!=u[mxConstants.STYLE_SHAPE]?c.setCellStyles(mxConstants.STYLE_SHAPE,"image",f):0==a.length&&c.setCellStyles(mxConstants.STYLE_SHAPE,null,f);if(1==c.getSelectionCount()&&null!=b&&null!=e){var m=f[0],z=c.getModel().getGeometry(m);null!=z&&(z=z.clone(),z.width=b,z.height=e,
+c.getModel().setGeometry(m,z))}}finally{c.getModel().endUpdate()}null!=g&&(c.setSelectionCells(g),c.scrollCellToVisible(g[0]))}}},c.cellEditor.isContentEditing(),!c.cellEditor.isContentEditing())}}).isEnabled=k;m=this.addAction("layers",mxUtils.bind(this,function(){null==this.layersWindow?(this.layersWindow=new LayersWindow(b,document.body.offsetWidth-280,120,220,180),this.layersWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.addListener("hide",
function(){b.fireEvent(new mxEventObject("layers"))}),this.layersWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("layers"))):this.layersWindow.window.setVisible(!this.layersWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+L");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.layersWindow&&this.layersWindow.window.isVisible()}));m=this.addAction("formatPanel",mxUtils.bind(this,function(){b.toggleFormatPanel()}),null,null,Editor.ctrlKey+
"+Shift+P");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return 0<b.formatWidth}));m=this.addAction("outline",mxUtils.bind(this,function(){null==this.outlineWindow?(this.outlineWindow=new OutlineWindow(b,document.body.offsetWidth-260,100,180,180),this.outlineWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.addListener("hide",function(){b.fireEvent(new mxEventObject("outline"))}),this.outlineWindow.window.setVisible(!0),
b.fireEvent(new mxEventObject("outline"))):this.outlineWindow.window.setVisible(!this.outlineWindow.window.isVisible())}),null,null,Editor.ctrlKey+"+Shift+O");m.setToggleAction(!0);m.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.outlineWindow&&this.outlineWindow.window.isVisible()}))};
-Actions.prototype.addAction=function(a,b,e,d,k){var m;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),m=mxResources.get(a)+"..."):m=mxResources.get(a);return this.put(a,new Action(m,b,e,d,k))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};function Action(a,b,e,d,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=e?e:!0;this.iconCls=d;this.shortcut=k;this.visible=!0}
+Actions.prototype.addAction=function(a,b,e,c,k){var m;"..."==a.substring(a.length-3)?(a=a.substring(0,a.length-3),m=mxResources.get(a)+"..."):m=mxResources.get(a);return this.put(a,new Action(m,b,e,c,k))};Actions.prototype.put=function(a,b){return this.actions[a]=b};Actions.prototype.get=function(a){return this.actions[a]};function Action(a,b,e,c,k){mxEventSource.call(this);this.label=a;this.funct=this.createFunction(b);this.enabled=null!=e?e:!0;this.iconCls=c;this.shortcut=k;this.visible=!0}
mxUtils.extend(Action,mxEventSource);Action.prototype.createFunction=function(a){return a};Action.prototype.setEnabled=function(a){this.enabled!=a&&(this.enabled=a,this.fireEvent(new mxEventObject("stateChanged")))};Action.prototype.isEnabled=function(){return this.enabled};Action.prototype.setToggleAction=function(a){this.toggleAction=a};Action.prototype.setSelectedCallback=function(a){this.selectedCallback=a};Action.prototype.isSelected=function(){return this.selectedCallback()};DrawioFile=function(a,b){mxEventSource.call(this);this.ui=a;this.shadowData=this.data=b||"";this.shadowPages=null;this.stats={opened:0,merged:0,fileMerged:0,fileReloaded:0,conflicts:0,timeouts:0,saved:0,closed:0,destroyed:0,joined:0,checksumErrors:0,bytesSent:0,bytesReceived:0,msgSent:0,msgReceived:0,cacheHits:0,cacheMiss:0,cacheFail:0}};DrawioFile.SYNC=urlParams.sync||"auto";DrawioFile.LAST_WRITE_WINS=!0;mxUtils.extend(DrawioFile,mxEventSource);DrawioFile.prototype.allChangesSavedKey="allChangesSaved";
DrawioFile.prototype.autosaveDelay=1500;DrawioFile.prototype.maxAutosaveDelay=3E4;DrawioFile.prototype.autosaveThread=null;DrawioFile.prototype.lastAutosave=null;DrawioFile.prototype.modified=!1;DrawioFile.prototype.data=null;DrawioFile.prototype.shadowData=null;DrawioFile.prototype.shadowPages=null;DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveRevision=null;DrawioFile.prototype.maxAutosaveRevisionDelay=0;DrawioFile.prototype.inConflictState=!1;
DrawioFile.prototype.invalidChecksum=!1;DrawioFile.prototype.errorReportsEnabled=!1;DrawioFile.prototype.reportEnabled=!0;DrawioFile.prototype.getSize=function(){return null!=this.data?this.data.length:0};DrawioFile.prototype.synchronizeFile=function(a,b){this.savingFile?null!=b&&b({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(a,b):this.updateFile(a,b)};
-DrawioFile.prototype.updateFile=function(a,b,e,d){null!=e&&e()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=b&&b():this.getLatestVersion(mxUtils.bind(this,function(k){try{null!=e&&e()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=b&&b():null!=k?this.mergeFile(k,a,b,d):this.reloadFile(a,b))}catch(m){null!=b&&b(m)}}),b))};
-DrawioFile.prototype.mergeFile=function(a,b,e,d){var k=!0;try{this.stats.fileMerged++;var m=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),q=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=q&&0<q.length){this.shadowPages=q;this.backupPatch=this.isModified()?this.ui.diffPages(m,this.ui.pages):null;var t=[this.ui.diffPages(null!=d?d:m,this.shadowPages)];if(!this.ignorePatches(t)){var v=this.ui.patchPages(m,
-t[0]);d={};var A=this.ui.getHashValueForPages(v,d),m={},c=this.ui.getHashValueForPages(this.shadowPages,m);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",t,"checksum",c==A,A);if(null!=A&&A!=c){var f=this.compressReportData(this.getAnonymizedXmlForPages(q)),g=this.compressReportData(this.getAnonymizedXmlForPages(v)),n=this.ui.hashValue(a.getCurrentEtag()),l=this.ui.hashValue(this.getCurrentEtag());this.checksumError(e,t,"Shadow Details: "+JSON.stringify(d)+
-"\nChecksum: "+A+"\nCurrent: "+c+"\nCurrent Details: "+JSON.stringify(m)+"\nFrom: "+n+"\nTo: "+l+"\n\nFile Data:\n"+f+"\nPatched Shadow:\n"+g,null,"mergeFile");return}this.patch(t,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw k=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=b&&b()}catch(x){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();
+DrawioFile.prototype.updateFile=function(a,b,e,c){null!=e&&e()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=b&&b():this.getLatestVersion(mxUtils.bind(this,function(k){try{null!=e&&e()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=b&&b():null!=k?this.mergeFile(k,a,b,c):this.reloadFile(a,b))}catch(m){null!=b&&b(m)}}),b))};
+DrawioFile.prototype.mergeFile=function(a,b,e,c){var k=!0;try{this.stats.fileMerged++;var m=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),q=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=q&&0<q.length){this.shadowPages=q;this.backupPatch=this.isModified()?this.ui.diffPages(m,this.ui.pages):null;var t=[this.ui.diffPages(null!=c?c:m,this.shadowPages)];if(!this.ignorePatches(t)){var v=this.ui.patchPages(m,
+t[0]);c={};var A=this.ui.getHashValueForPages(v,c),m={},d=this.ui.getHashValueForPages(this.shadowPages,m);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",t,"checksum",d==A,A);if(null!=A&&A!=d){var f=this.compressReportData(this.getAnonymizedXmlForPages(q)),g=this.compressReportData(this.getAnonymizedXmlForPages(v)),n=this.ui.hashValue(a.getCurrentEtag()),l=this.ui.hashValue(this.getCurrentEtag());this.checksumError(e,t,"Shadow Details: "+JSON.stringify(c)+
+"\nChecksum: "+A+"\nCurrent: "+d+"\nCurrent Details: "+JSON.stringify(m)+"\nFrom: "+n+"\nTo: "+l+"\n\nFile Data:\n"+f+"\nPatched Shadow:\n"+g,null,"mergeFile");return}this.patch(t,DrawioFile.LAST_WRITE_WINS?this.backupPatch:null)}}else throw k=!1,Error(mxResources.get("notADiagramFile"));this.inConflictState=this.invalidChecksum=!1;this.setDescriptor(a.getDescriptor());this.descriptorChanged();this.backupPatch=null;null!=b&&b()}catch(x){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();
null!=e&&e(x);try{if(k)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,x);else{var p=this.getCurrentUser(),y=null!=p?p.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),y,x)}}catch(u){}}};
-DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var b=new mxCodec(mxUtils.createXmlDocument()),e=b.document.createElement("mxfile");if(null!=a)for(var d=0;d<a.length;d++){var k=b.encode(new mxGraphModel(a[d].root));"1"!=urlParams.dev&&(k=this.ui.anonymizeNode(k,!0));k.setAttribute("id",a[d].getId());a[d].viewState&&this.ui.editor.graph.saveViewState(a[d].viewState,k,!0);e.appendChild(k)}return mxUtils.getPrettyXml(e)};
+DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var b=new mxCodec(mxUtils.createXmlDocument()),e=b.document.createElement("mxfile");if(null!=a)for(var c=0;c<a.length;c++){var k=b.encode(new mxGraphModel(a[c].root));"1"!=urlParams.dev&&(k=this.ui.anonymizeNode(k,!0));k.setAttribute("id",a[c].getId());a[c].viewState&&this.ui.editor.graph.saveViewState(a[c].viewState,k,!0);e.appendChild(k)}return mxUtils.getPrettyXml(e)};
DrawioFile.prototype.compressReportData=function(a,b,e){b=null!=b?b:1E4;null!=e&&null!=a&&a.length>e?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;a<b.length;a++)this.ui.anonymizePatch(b[a]);var m=mxUtils.bind(this,function(a){var d=this.compressReportData(JSON.stringify(b,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)),
-25E3):"n/a";this.sendErrorReport("Checksum Error in "+k,(null!=e?e:"")+"\n\nPatches:\n"+d+(null!=a?"\n\nRemote:\n"+a:""),null,7E4)});null==d?m(null):this.getLatestVersion(mxUtils.bind(this,function(a){null!=a&&a.getCurrentEtag()==d?m(a):m(null)}),function(){})}else{var q=this.getCurrentUser(),t=null!=q?q.id:"unknown";EditorUi.logError("Checksum Error in "+k,null,this.getMode()+"."+this.getId(),t)}}catch(v){}};
-DrawioFile.prototype.sendErrorReport=function(a,b,e,d){try{var k=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages),25E3),m=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),q=this.getCurrentUser(),t=null!=q?this.ui.hashValue(q.id):"unknown",v=null!=this.sync?this.sync.clientId:"no sync",A=this.getTitle(),c=A.lastIndexOf("."),q="xml";0<c&&(q=A.substring(c));var f=null!=e?e.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+":\n\nBrowser="+
+DrawioFile.prototype.checksumError=function(a,b,e,c,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;a<b.length;a++)this.ui.anonymizePatch(b[a]);var m=mxUtils.bind(this,function(a){var c=this.compressReportData(JSON.stringify(b,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)),
+25E3):"n/a";this.sendErrorReport("Checksum Error in "+k,(null!=e?e:"")+"\n\nPatches:\n"+c+(null!=a?"\n\nRemote:\n"+a:""),null,7E4)});null==c?m(null):this.getLatestVersion(mxUtils.bind(this,function(a){null!=a&&a.getCurrentEtag()==c?m(a):m(null)}),function(){})}else{var q=this.getCurrentUser(),t=null!=q?q.id:"unknown";EditorUi.logError("Checksum Error in "+k,null,this.getMode()+"."+this.getId(),t)}}catch(v){}};
+DrawioFile.prototype.sendErrorReport=function(a,b,e,c){try{var k=this.compressReportData(this.getAnonymizedXmlForPages(this.shadowPages),25E3),m=this.compressReportData(this.getAnonymizedXmlForPages(this.ui.pages),25E3),q=this.getCurrentUser(),t=null!=q?this.ui.hashValue(q.id):"unknown",v=null!=this.sync?this.sync.clientId:"no sync",A=this.getTitle(),d=A.lastIndexOf("."),q="xml";0<d&&(q=A.substring(d));var f=null!=e?e.stack:Error().stack;EditorUi.sendReport(a+" "+(new Date).toISOString()+":\n\nBrowser="+
navigator.userAgent+"\nFile="+this.ui.hashValue(this.getId())+" ("+this.getMode()+")"+(this.isModified()?" modified":"")+"\nSize/Type="+this.getSize()+" ("+q+")\nUser="+t+" ("+v+")\nPrefix="+this.ui.editor.graph.model.prefix+"\nSync="+DrawioFile.SYNC+(null!=this.sync?(this.sync.enabled?" enabled":"")+(this.sync.isConnected()?" connected":""):"")+"\nPlugins="+(null!=mxSettings.settings?mxSettings.getPlugins():"null")+"\n\nStats:\n"+JSON.stringify(this.stats,null,2)+(null!=b?"\n\n"+b:"")+(null!=e?"\n\nError: "+
-e.message:"")+"\n\nStack:\n"+f+"\n\nShadow:\n"+k+"\n\nData:\n"+m,d)}catch(g){}};
-DrawioFile.prototype.reloadFile=function(a,b){try{this.ui.spinner.stop();var e=mxUtils.bind(this,function(){this.stats.fileReloaded++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),e=this.ui.editor.graph.getSelectionCells(),m=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(m,b,e);null!=this.backupPatch&&this.patch([this.backupPatch]);var d=this.ui.getCurrentFile();null!=d&&(d.stats=
-this.stats);null!=a&&a()}}),!0)});this.isModified()&&null==this.backupPatch?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.handleFileSuccess("manual"==DrawioFile.SYNC)}),e,mxResources.get("cancel"),mxResources.get("discardChanges")):e()}catch(d){null!=b&&b(d)}};DrawioFile.prototype.copyFile=function(a,b){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};
+e.message:"")+"\n\nStack:\n"+f+"\n\nShadow:\n"+k+"\n\nData:\n"+m,c)}catch(g){}};
+DrawioFile.prototype.reloadFile=function(a,b){try{this.ui.spinner.stop();var e=mxUtils.bind(this,function(){this.stats.fileReloaded++;this.reportEnabled=!1;var b=this.ui.editor.graph.getViewState(),e=this.ui.editor.graph.getSelectionCells(),m=this.ui.currentPage;this.ui.loadFile(this.getHash(),!0,null,mxUtils.bind(this,function(){if(null==this.ui.fileLoadedError){this.ui.restoreViewState(m,b,e);null!=this.backupPatch&&this.patch([this.backupPatch]);var c=this.ui.getCurrentFile();null!=c&&(c.stats=
+this.stats);null!=a&&a()}}),!0)});this.isModified()&&null==this.backupPatch?this.ui.confirm(mxResources.get("allChangesLost"),mxUtils.bind(this,function(){this.handleFileSuccess("manual"==DrawioFile.SYNC)}),e,mxResources.get("cancel"),mxResources.get("discardChanges")):e()}catch(c){null!=b&&b(c)}};DrawioFile.prototype.copyFile=function(a,b){this.ui.editor.editAsNew(this.ui.getFileData(!0),this.ui.getCopyFilename(this))};
DrawioFile.prototype.ignorePatches=function(a){for(var b=!0,e=0;e<a.length&&b;e++)b=b&&0==Object.keys(a[e]).length;return b};
-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;c<a.length;c++)this.ui.pages=this.ui.patchPages(this.ui.pages,a[c],!0,b,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{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!=
+DrawioFile.prototype.patch=function(a,b){var e=this.ui.editor.undoManager,c=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 d=
+0;d<a.length;d++)this.ui.pages=this.ui.patchPages(this.ui.pages,a[d],!0,b,this.isModified());0==this.ui.pages.length&&this.ui.pages.push(this.ui.createPage());0>mxUtils.indexOf(this.ui.pages,this.ui.currentPage)&&this.ui.selectPage(this.ui.pages[0],!0)}finally{m.container.style.visibility="";m.model.endUpdate();m.cellRenderer.redraw=A;this.changeListenerEnabled=q;e.history=c;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};
+DrawioFile.prototype.save=function(a,b,e,c,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,c){};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};
DrawioFile.prototype.isRenamable=function(){return!1};DrawioFile.prototype.rename=function(a,b,e){};DrawioFile.prototype.isMovable=function(){return!1};DrawioFile.prototype.move=function(a,b,e){};DrawioFile.prototype.getHash=function(){return""};DrawioFile.prototype.getId=function(){return""};DrawioFile.prototype.isEditable=function(){return!this.ui.editor.isChromelessView()||this.ui.editor.editable};DrawioFile.prototype.getUi=function(){return this.ui};DrawioFile.prototype.getTitle=function(){return""};
DrawioFile.prototype.setData=function(a){this.data=a};DrawioFile.prototype.getData=function(){return this.data};DrawioFile.prototype.open=function(){this.stats.opened++;var a=this.getData();null!=a&&(this.ui.setFileData(a),this.isModified()||(this.shadowData=mxUtils.getXml(this.ui.getXmlFileData()),this.shadowPages=null));this.installListeners();this.isSyncSupported()&&this.startSync()};DrawioFile.prototype.isSyncSupported=function(){return!1};DrawioFile.prototype.isRevisionHistorySupported=function(){return!1};
-DrawioFile.prototype.getRevisions=function(a,b){a(null)};DrawioFile.prototype.loadDescriptor=function(a,b){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,b){this.loadDescriptor(mxUtils.bind(this,function(b){a(b)}),b)};DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.sync.start())};
-DrawioFile.prototype.isConflict=function(){return!1};DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(a){return null};DrawioFile.prototype.getCurrentUser=function(){return null};DrawioFile.prototype.getLatestVersion=function(a,b){a(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};
-DrawioFile.prototype.setCurrentEtag=function(a){this.setDescriptorEtag(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())};DrawioFile.prototype.getDescriptor=function(){return null};DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorEtag=function(a,b){};DrawioFile.prototype.getDescriptorEtag=function(a){return null};DrawioFile.prototype.getDescriptorSecret=function(a){return null};
+DrawioFile.prototype.getRevisions=function(a,b){a(null)};DrawioFile.prototype.loadDescriptor=function(a,b){a(null)};DrawioFile.prototype.loadPatchDescriptor=function(a,b){this.loadDescriptor(mxUtils.bind(this,function(b){a(b)}),b)};DrawioFile.prototype.patchDescriptor=function(a,b){this.setDescriptorEtag(a,this.getDescriptorEtag(b))};
+DrawioFile.prototype.startSync=function(){"auto"!=DrawioFile.SYNC||"1"==urlParams.stealth||"1"!=urlParams.rt&&this.ui.editor.chromeless&&!this.ui.editor.editable||(null==this.sync&&(this.sync=new DrawioFileSync(this)),this.sync.start())};DrawioFile.prototype.isConflict=function(){return!1};DrawioFile.prototype.getChannelId=function(){return Graph.compress(this.getHash()).replace(/[\/ +]/g,"_")};DrawioFile.prototype.getChannelKey=function(a){return null};DrawioFile.prototype.getCurrentUser=function(){return null};
+DrawioFile.prototype.getLatestVersion=function(a,b){a(null)};DrawioFile.prototype.getLastModifiedDate=function(){return new Date};DrawioFile.prototype.setCurrentEtag=function(a){this.setDescriptorEtag(this.getDescriptor(),a)};DrawioFile.prototype.getCurrentEtag=function(){return this.getDescriptorEtag(this.getDescriptor())};DrawioFile.prototype.getDescriptor=function(){return null};DrawioFile.prototype.setDescriptor=function(){};DrawioFile.prototype.setDescriptorEtag=function(a,b){};
+DrawioFile.prototype.getDescriptorEtag=function(a){return null};DrawioFile.prototype.getDescriptorSecret=function(a){return null};
DrawioFile.prototype.installListeners=function(){null==this.changeListener&&(this.changeListener=mxUtils.bind(this,function(a,b){var e=null!=b?b.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=e&&e.ignoreEdit||this.fileChanged()}),this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener),this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener),this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener),this.ui.addListener("pageFormatChanged",
this.changeListener),this.ui.addListener("pageScaleChanged",this.changeListener),this.ui.addListener("backgroundColorChanged",this.changeListener),this.ui.addListener("backgroundImageChanged",this.changeListener),this.ui.addListener("foldingEnabledChanged",this.changeListener),this.ui.addListener("mathEnabledChanged",this.changeListener),this.ui.addListener("gridEnabledChanged",this.changeListener),this.ui.addListener("guidesEnabledChanged",this.changeListener),this.ui.addListener("pageViewChanged",
this.changeListener))};DrawioFile.prototype.addAllSavedStatus=function(a){null!=this.ui.statusContainer&&this.ui.getCurrentFile()==this&&(a=null!=a?a:mxUtils.htmlEntities(mxResources.get(this.allChangesSavedKey)),this.ui.editor.setStatus('<div title="'+a+'">'+a+"</div>"),a=this.ui.statusContainer.getElementsByTagName("div"),0<a.length&&this.isRevisionHistorySupported()&&(a[0].style.cursor="pointer",a[0].style.textDecoration="underline",mxEvent.addListener(a[0],"click",mxUtils.bind(this,function(){this.ui.actions.get("revisionHistory").funct()}))))};
@@ -2719,26 +2719,26 @@ DrawioFile.prototype.showRefreshDialog=function(a,b,e){null==e&&(e=mxResources.g
b)}),null,mxResources.get("synchronize"),mxUtils.bind(this,function(){this.reloadFile(a,b)}),mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150))};
DrawioFile.prototype.showCopyDialog=function(a,b,e){this.invalidChecksum=this.inConflictState=!1;this.addUnsavedStatus();this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedOverwriteDialog"),mxResources.get("makeCopy"),mxUtils.bind(this,function(){this.copyFile(a,b)}),null,mxResources.get("overwrite"),e,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog()}),360,150)};
DrawioFile.prototype.showConflictDialog=function(a,b){this.ui.showError(mxResources.get("externalChanges"),mxResources.get("fileChangedSyncDialog"),mxResources.get("overwrite"),a,null,mxResources.get("synchronize"),b,mxResources.get("cancel"),mxUtils.bind(this,function(){this.ui.hideDialog();this.handleFileError(null,!1)}),340,150)};
-DrawioFile.prototype.redirectToNewApp=function(a){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var b=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),e=mxUtils.bind(this,function(){var d=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==b?window.location.reload():window.location.href=b});null==a&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),
-mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),d,mxResources.get("cancel"),mxResources.get("discardChanges")):d()});null!=a?this.isModified()?this.ui.confirm(mxResources.get("redirectToNewApp"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1;a()}),e,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(mxResources.get("redirectToNewApp"),e,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;a()})):this.ui.alert(mxResources.get("redirectToNewApp"),
+DrawioFile.prototype.redirectToNewApp=function(a){this.ui.spinner.stop();if(!this.redirectDialogShowing){this.redirectDialogShowing=!0;var b=window.location.protocol+"//"+window.location.host+"/"+this.ui.getSearch("create title mode url drive splash state".split(" "))+"#"+this.getHash(),e=mxUtils.bind(this,function(){var c=mxUtils.bind(this,function(){this.redirectDialogShowing=!1;window.location.href==b?window.location.reload():window.location.href=b});null==a&&this.isModified()?this.ui.confirm(mxResources.get("allChangesLost"),
+mxUtils.bind(this,function(){this.redirectDialogShowing=!1}),c,mxResources.get("cancel"),mxResources.get("discardChanges")):c()});null!=a?this.isModified()?this.ui.confirm(mxResources.get("redirectToNewApp"),mxUtils.bind(this,function(){this.redirectDialogShowing=!1;a()}),e,mxResources.get("cancel"),mxResources.get("discardChanges")):this.ui.confirm(mxResources.get("redirectToNewApp"),e,mxUtils.bind(this,function(){this.redirectDialogShowing=!1;a()})):this.ui.alert(mxResources.get("redirectToNewApp"),
e)}};DrawioFile.prototype.handleFileSuccess=function(a){this.ui.spinner.stop();this.ui.getCurrentFile()==this&&(this.isModified()?this.fileChanged():a?(this.addAllSavedStatus(),null!=this.sync&&(this.sync.resetUpdateStatusThread(),this.sync.remoteFileChanged&&(this.sync.remoteFileChanged=!1,this.sync.fileChangedNotify()))):this.ui.editor.setStatus(""))};
DrawioFile.prototype.handleFileError=function(a,b){this.ui.spinner.stop();if(this.ui.getCurrentFile()==this)if(this.inConflictState)this.handleConflictError(a,b);else if(this.isModified()&&this.addUnsavedStatus(a),b)this.ui.handleError(a,null!=a?mxResources.get("errorSavingFile"):null);else if(!this.isModified()){var e=null!=a?null!=a.error?a.error.message:a.message:null;null!=e&&60<e.length&&(e=e.substring(0,60)+"...");this.ui.editor.setStatus('<div class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+
mxUtils.htmlEntities(mxResources.get("error"))+(null!=e?" ("+mxUtils.htmlEntities(e)+")":"")+"</div>")}};
-DrawioFile.prototype.handleConflictError=function(a,b){var e=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),d=mxUtils.bind(this,function(a){this.handleFileError(a,!0)}),k=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&(this.ui.editor.setStatus(""),this.save(!0,e,d,null,!0,this.constructor==GitHubFile&&null!=a?a.commitMessage:null))}),m=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&this.synchronizeFile(mxUtils.bind(this,
-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.handleConflictError=function(a,b){var e=mxUtils.bind(this,function(){this.handleFileSuccess(!0)}),c=mxUtils.bind(this,function(a){this.handleFileError(a,!0)}),k=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&(this.ui.editor.setStatus(""),this.save(!0,e,c,null,!0,this.constructor==GitHubFile&&null!=a?a.commitMessage:null))}),m=mxUtils.bind(this,function(){this.ui.spinner.spin(document.body,mxResources.get("updatingDocument"))&&this.synchronizeFile(mxUtils.bind(this,
+function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.save(!0,e,c,null,null,this.constructor==GitHubFile&&null!=a?a.commitMessage:null)}),c)});"none"==DrawioFile.SYNC?this.showCopyDialog(e,c,k):this.invalidChecksum?this.showRefreshDialog(e,c,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,
+c)}),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(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(),
+DrawioFile.prototype.fileSaved=function(a,b,e,c){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,c,a)}catch(q){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=c&&c(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.lastAutosave<b?a:0;this.clearAutosave();var k=window.setTimeout(mxUtils.bind(this,function(){this.lastAutosave=null;this.autosaveThread==k&&(this.autosaveThread=null);if(this.isModified()&&this.isAutosaveNow()){var a=this.isAutosaveRevision();a&&(this.lastAutosaveRevision=(new Date).getTime());this.save(a,mxUtils.bind(this,function(a){this.autosaveCompleted();
-null!=e&&e(a)}),mxUtils.bind(this,function(a){null!=d&&d(a)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=e&&e(null)}),a);this.autosaveThread=k};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};
+DrawioFile.prototype.autosave=function(a,b,e,c){null==this.lastAutosave&&(this.lastAutosave=(new Date).getTime());a=(new Date).getTime()-this.lastAutosave<b?a:0;this.clearAutosave();var k=window.setTimeout(mxUtils.bind(this,function(){this.lastAutosave=null;this.autosaveThread==k&&(this.autosaveThread=null);if(this.isModified()&&this.isAutosaveNow()){var a=this.isAutosaveRevision();a&&(this.lastAutosaveRevision=(new Date).getTime());this.save(a,mxUtils.bind(this,function(a){this.autosaveCompleted();
+null!=e&&e(a)}),mxUtils.bind(this,function(a){null!=c&&c(a)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=e&&e(null)}),a);this.autosaveThread=k};DrawioFile.prototype.isAutosaveNow=function(){return!0};DrawioFile.prototype.autosaveCompleted=function(){};DrawioFile.prototype.clearAutosave=function(){null!=this.autosaveThread&&(window.clearTimeout(this.autosaveThread),this.autosaveThread=null)};
DrawioFile.prototype.isAutosaveRevision=function(){var a=(new Date).getTime();return null==this.lastAutosaveRevision||a-this.lastAutosaveRevision>this.maxAutosaveRevisionDelay};DrawioFile.prototype.descriptorChanged=function(){this.fireEvent(new mxEventObject("descriptorChanged"))};DrawioFile.prototype.contentChanged=function(){this.fireEvent(new mxEventObject("contentChanged"))};
-DrawioFile.prototype.close=function(a){this.updateFileData();this.stats.closed++;this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,b){if(null!=a&&null!=b){var e=a.lastIndexOf("."),d=0<e?a.substring(e):"",e=b.lastIndexOf(".");return d===(0<e?b.substring(e):"")}return a==b};
+DrawioFile.prototype.close=function(a){this.updateFileData();this.stats.closed++;this.isAutosave()&&this.isModified()&&this.save(this.isAutosaveRevision(),null,null,a);this.destroy()};DrawioFile.prototype.hasSameExtension=function(a,b){if(null!=a&&null!=b){var e=a.lastIndexOf("."),c=0<e?a.substring(e):"",e=b.lastIndexOf(".");return c===(0<e?b.substring(e):"")}return a==b};
DrawioFile.prototype.removeListeners=function(){null!=this.changeListener&&(this.ui.editor.graph.model.removeListener(this.changeListener),this.ui.editor.graph.removeListener(this.changeListener),this.ui.removeListener(this.changeListener),this.changeListener=null)};
DrawioFile.prototype.destroy=function(){this.stats.destroyed++;try{if(!this.ui.isOffline()&&this.reportEnabled&&("auto"==DrawioFile.SYNC||"manual"==DrawioFile.SYNC)){var a=this.getCurrentUser(),b=null!=a?a.id:"unknown";EditorUi.logEvent({category:"RT-END-"+DrawioFile.SYNC,action:"file-"+this.getId()+"-mode-"+this.getMode()+"-size-"+this.getSize()+"-user-"+b+(null!=this.sync?"-client-"+this.sync.clientId:""),label:this.stats})}}catch(e){}this.clearAutosave();this.removeListeners();null!=this.sync&&
-(this.sync.destroy(),this.sync=null)};LocalFile=function(a,b,e,d){DrawioFile.call(this,a,b);this.title=e;this.mode=d?null:App.MODE_DEVICE};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return!1};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.save=function(a,b,e){this.saveAs(this.title,b,e)};LocalFile.prototype.saveAs=function(a,b,e){this.saveFile(a,!1,b,e)};
-LocalFile.prototype.saveFile=function(a,b,e,d){this.title=a;this.updateFileData();b=this.getData();var k=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),m=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,k?"image/png":"text/xml",k);else if(b.length<MAX_REQUEST_SIZE){var d=a.lastIndexOf("."),d=0<d?a.substring(d+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+d+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+
-(k?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=e&&e()});k?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(a)}),d,this.ui.getCurrentFile()!=this?this.getData():null):m(b)};LocalFile.prototype.rename=function(a,b,e){this.title=a;this.descriptorChanged();null!=b&&b()};
+(this.sync.destroy(),this.sync=null)};LocalFile=function(a,b,e,c){DrawioFile.call(this,a,b);this.title=e;this.mode=c?null:App.MODE_DEVICE};mxUtils.extend(LocalFile,DrawioFile);LocalFile.prototype.isAutosave=function(){return!1};LocalFile.prototype.getMode=function(){return this.mode};LocalFile.prototype.getTitle=function(){return this.title};LocalFile.prototype.isRenamable=function(){return!0};LocalFile.prototype.save=function(a,b,e){this.saveAs(this.title,b,e)};LocalFile.prototype.saveAs=function(a,b,e){this.saveFile(a,!1,b,e)};
+LocalFile.prototype.saveFile=function(a,b,e,c){this.title=a;this.updateFileData();b=this.getData();var k=this.ui.useCanvasForExport&&/(\.png)$/i.test(this.getTitle()),m=mxUtils.bind(this,function(b){if(this.ui.isOfflineApp()||this.ui.isLocalFileSave())this.ui.doSaveLocalFile(b,a,k?"image/png":"text/xml",k);else if(b.length<MAX_REQUEST_SIZE){var c=a.lastIndexOf("."),c=0<c?a.substring(c+1):"xml";(new mxXmlRequest(SAVE_URL,"format="+c+"&xml="+encodeURIComponent(b)+"&filename="+encodeURIComponent(a)+
+(k?"&binary=1":""))).simulate(document,"_blank")}else this.ui.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}));this.setModified(!1);this.contentChanged();null!=e&&e()});k?this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){m(a)}),c,this.ui.getCurrentFile()!=this?this.getData():null):m(b)};LocalFile.prototype.rename=function(a,b,e){this.title=a;this.descriptorChanged();null!=b&&b()};
LocalFile.prototype.open=function(){this.ui.setFileData(this.getData());this.installListeners()};(function(){Editor.prototype.appName="draw.io";Editor.prototype.fileExtensions=[{ext:"html",title:"filetypeHtml"},{ext:"png",title:"filetypePng"},{ext:"svg",title:"filetypeSvg"}];Editor.closeImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAApVBMVEUAAAD////k5OT///8AAAB1dXXMzMz9/f39/f37+/v5+fn+/v7///9iYmJaWlqFhYWnp6ejo6OHh4f////////////////7+/v5+fnx8fH///8AAAD///8bGxv7+/v5+fkoKCghISFDQ0MYGBjh4eHY2Njb29tQUFBvb29HR0c/Pz82NjYrKyu/v78SEhLu7u7s7OzV1dVVVVU7OzsVFRXAv78QEBBzqehMAAAAG3RSTlMAA/7p/vz5xZlrTiPL/v78+/v7+OXd2TYQDs8L70ZbAAABKUlEQVQoz3VS13LCMBBUXHChd8iukDslQChJ/v/TchaG4cXS+OSb1c7trU7V60OpdRz2ZtNZL4zXNlcN8BEtSG6+NxIXkeRPoBuQ1cjvZ31/VJFB10ISli6diYfH8iYO3WUNCcNlB0gTrXOtkxTo0O1aKKiBBMhhv2MNBQKoiA5wxlZo0JDzD3AYKbWacyj3fs01wxey0pyEP+R8pWKWXoqtIZ0DDg5pbki9krEKOa6LVDQsdoXEsi46Zqh69KFz7B1u7Hb2yDV8firXDKBlZ4UFiswKGRhXTS93/ECK7yxnJ3+S3y/ThpO+cfSD017nqa18aasabU0/t7d+tk0/1oMEJ1NaD67iwdF68OabFSLn+eHb0+vjy+uk8br9fdrftH0O2menfd7+AQfYM/lNjoDHAAAAAElFTkSuQmCC":
IMAGE_PATH+"/delete.png";Editor.plusImage=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MDdCMTdENjVCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MDdCMTdENjZCOEM4MTFFNDlCRjVBNDdCODU5NjNBNUMiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDowN0IxN0Q2M0I4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDowN0IxN0Q2NEI4QzgxMUU0OUJGNUE0N0I4NTk2M0E1QyIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PtjrjmgAAAAtSURBVHjaYvz//z8DMigvLwcLdHZ2MiKLMzEQCaivkLGsrOw/dU0cAr4GCDAARQsQbTFrv10AAAAASUVORK5CYII=":
IMAGE_PATH+"/plus.png";Editor.spinImage=mxClient.IS_SVG?"data:image/gif;base64,R0lGODlhDAAMAPUxAEVriVp7lmCAmmGBm2OCnGmHn3OPpneSqYKbr4OcsIScsI2kto6kt46lt5KnuZmtvpquvpuvv56ywaCzwqK1xKu7yay9yq+/zLHAzbfF0bjG0bzJ1LzK1MDN18jT28nT3M3X3tHa4dTc49Xd5Njf5dng5t3k6d/l6uDm6uru8e7x8/Dz9fT29/b4+Pj5+fj5+vr6+v///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAkKADEAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAADAAMAAAGR8CYcEgsOgYAIax4CCQuQldrCBEsiK8VS2hoFGOrlJDA+cZQwkLnqyoJFZKviSS0ICrE0ec0jDAwIiUeGyBFGhMPFBkhZo1BACH5BAkKAC4ALAAAAAAMAAwAhVB0kFR3k1V4k2CAmmWEnW6Lo3KOpXeSqH2XrIOcsISdsImhtIqhtJCmuJGnuZuwv52wwJ+ywZ+ywqm6yLHBzbLCzrXEz7fF0LnH0rrI0r7L1b/M1sXR2cfT28rV3czW3s/Z4Nfe5Nvi6ODm6uLn6+Ln7OLo7OXq7efs7+zw8u/y9PDy9PX3+Pr7+////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZDQJdwSCxGDAIAoVFkFBwYSyIwGE4OkCJxIdG6WkJEx8sSKj7elfBB0a5SQg1EQ0SVVMPKhDM6iUIkRR4ZFxsgJl6JQQAh+QQJCgAxACwAAAAADAAMAIVGa4lcfZdjgpxkg51nhp5ui6N3kqh5lKqFnbGHn7KIoLOQp7iRp7mSqLmTqbqarr6br7+fssGitcOitcSuvsuuv8uwwMyzw861xNC5x9K6x9K/zNbDztjE0NnG0drJ1NzQ2eDS2+LT2+LV3ePZ4Oba4ebb4ufc4+jm6+7t8PLt8PPt8fPx8/Xx9PX09vf19/j3+Pn///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CYcEgsUhQFggFSjCQmnE1jcBhqGBXiIuAQSi7FGEIgfIzCFoCXFCZiPO0hKBMiwl7ET6eUYqlWLkUnISImKC1xbUEAIfkECQoAMgAsAAAAAAwADACFTnKPT3KPVHaTYoKcb4yjcY6leZSpf5mtgZuvh5+yiqG0i6K1jqW3kae5nrHBnrLBn7LCoLPCobTDqbrIqrvIs8LOtMPPtcPPtcTPuMbRucfSvcrUvsvVwMzWxdHaydTcytXdzNbezdff0drh2ODl2+Ln3eTp4Obq4ujs5Ont5uvu6O3w6u7w6u7x7/L09vj5+vr7+vv7////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkdAmXBILHIcicOCUqxELKKPxKAYgiYd4oMAEWo8RVmjIMScwhmBcJMKXwLCECmMGAhPI1QRwBiaSixCMDFhLSorLi8wYYxCQQAh+QQJCgAxACwAAAAADAAMAIVZepVggJphgZtnhp5vjKN2kah3kqmBmq+KobSLorWNpLaRp7mWq7ybr7+gs8KitcSktsWnuManucexwM2ywc63xtG6yNO9ytS+ytW/zNbDz9jH0tvL1d3N197S2+LU3OPU3ePV3eTX3+Xa4efb4ufd5Onl6u7r7vHs7/Lt8PLw8/Xy9Pby9fb09ff2+Pn3+Pn6+vr///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGSMCYcEgseiwSR+RS7GA4JFGF8RiWNiEiJTERgkjFGAQh/KTCGoJwpApnBkITKrwoCFWnFlEhaAxXLC9CBwAGRS4wQgELYY1CQQAh+QQJCgAzACwAAAAADAAMAIVMcI5SdZFhgZtti6JwjaR4k6mAma6Cm6+KobSLorWLo7WNo7aPpredsMCescGitMOitcSmuMaqu8ixwc2zws63xdC4xtG5x9K9ytXAzdfCztjF0NnF0drK1d3M1t7P2N/P2eDT2+LX3+Xe5Onh5+vi5+vj6Ozk6e3n7O/o7O/q7vHs7/Lt8PPu8fPx8/X3+Pn6+vv7+/v8/Pz///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRcCZcEgsmkIbTOZTLIlGqZNnchm2SCgiJ6IRqljFmQUiXIVnoITQde4chC9Y+LEQxmTFRkFSNFAqDAMIRQoCAAEEDmeLQQAh+QQJCgAwACwAAAAADAAMAIVXeZRefplff5lhgZtph59yjqV2kaeAmq6FnbGFnrGLorWNpLaQp7mRqLmYrb2essGgs8Klt8apusitvcquv8u2xNC7yNO8ydS8ytTAzdfBzdfM1t7N197Q2eDU3OPX3+XZ4ObZ4ebc4+jf5erg5erg5uvp7fDu8fPv8vTz9fb09vf19/j3+Pn4+fn5+vr6+/v///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRUCYcEgspkwjEKhUVJ1QsBNp0xm2VixiSOMRvlxFGAcTJook5eEHIhQcwpWIkAFQECkNy9AQWFwyEAkPRQ4FAwQIE2llQQAh+QQJCgAvACwAAAAADAAMAIVNcY5SdZFigptph6BvjKN0kKd8lquAmq+EnbGGn7KHn7ONpLaOpbearr+csMCdscCescGhtMOnuMauvsuzws60w862xdC9ytW/y9a/zNbCztjG0drH0tvK1N3M1t7N19/U3ePb4uff5urj6Ozk6e3l6u7m6u7o7PDq7vDt8PPv8vTw8vTw8/X19vf6+vv///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGQ8CXcEgsvlytVUplJLJIpSEDUESFTELBwSgCCQEV42kjDFiMo4uQsDB2MkLHoEHUTD7DRAHC8VAiZ0QSCgYIDxhNiUEAOw==":
@@ -2761,47 +2761,47 @@ dispName:"Rhombus"},{val:"trianglePerimeter",dispName:"Triangle"},{val:"hexagonP
{name:"jiggle",dispName:"Jiggle",type:"float",min:0,defVal:1.5,isVisible:function(a){return"1"==mxUtils.getValue(a.style,"comic","0")}},{name:"autosize",dispName:"Autosize",type:"bool",defVal:!1},{name:"collapsible",dispName:"Collapsible",type:"bool",defVal:!1},{name:"container",dispName:"Container",type:"bool",defVal:!1},{name:"recursiveResize",dispName:"Resize Children",type:"bool",defVal:!0},{name:"part",dispName:"Part",type:"bool",defVal:!1},{name:"editable",dispName:"Editable",type:"bool",defVal:!0},
{name:"backgroundOutline",dispName:"Background Outline",type:"bool",defVal:!1},{name:"movable",dispName:"Movable",type:"bool",defVal:!0},{name:"resizable",dispName:"Resizable",type:"bool",defVal:!0},{name:"resizeWidth",dispName:"Resize Width",type:"bool",defVal:!1},{name:"resizeHeight",dispName:"Resize Height",type:"bool",defVal:!1},{name:"rotatable",dispName:"Rotatable",type:"bool",defVal:!0},{name:"cloneable",dispName:"Cloneable",type:"bool",defVal:!0},{name:"deletable",dispName:"Deletable",type:"bool",
defVal:!0}];Editor.defaultCsvValue='##\n## Example CSV import. Use ## for comments and # for configuration. Paste CSV below.\n## The following names are reserved and should not be used (or ignored):\n## id, tooltip, placeholder(s), link and label (see below)\n##\n#\n## Node label with placeholders and HTML.\n## Default is \'%name_of_first_column%\'.\n#\n# label: %name%<br><i style="color:gray;">%position%</i><br><a href="mailto:%email%">Email</a>\n#\n## Node style (placeholders are replaced once).\n## Default is the current style for nodes.\n#\n# style: label;image=%image%;whiteSpace=wrap;html=1;rounded=1;fillColor=%fill%;strokeColor=%stroke%;\n#\n## Parent style for nodes with child nodes (placeholders are replaced once).\n#\n# parentstyle: swimlane;whiteSpace=wrap;html=1;childLayout=stackLayout;horizontal=1;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;\n#\n## Uses the given column name as the identity for cells (updates existing cells).\n## Default is no identity (empty value or -).\n#\n# identity: -\n#\n## Uses the given column name as the parent reference for cells. Default is no parent (empty or -).\n## The identity above is used for resolving the reference so it must be specified.\n#\n# parent: -\n#\n## Adds a prefix to the identity of cells to make sure they do not collide with existing cells (whose\n## IDs are numbers from 0..n, sometimes with a GUID prefix in the context of realtime collaboration).\n## Default is csvimport-.\n#\n# namespace: csvimport-\n#\n## Connections between rows ("from": source colum, "to": target column).\n## Label, style and invert are optional. Defaults are \'\', current style and false.\n## In addition to label, an optional fromlabel and tolabel can be used to name the column\n## that contains the text for the label in the edges source or target (invert ignored).\n## The label is concatenated in the form fromlabel + label + tolabel if all are defined.\n## The target column may contain a comma-separated list of values.\n## Multiple connect entries are allowed.\n#\n# connect: {"from": "manager", "to": "name", "invert": true, "label": "manages", \\\n# "style": "curved=1;endArrow=blockThin;endFill=1;fontSize=11;"}\n# connect: {"from": "refs", "to": "id", "style": "curved=1;fontSize=11;"}\n#\n## Node x-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# left: \n#\n## Node y-coordinate. Possible value is a column name. Default is empty. Layouts will\n## override this value.\n#\n# top: \n#\n## Node width. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the width. Default is auto.\n#\n# width: auto\n#\n## Node height. Possible value is a number (in px), auto or an @ sign followed by a column\n## name that contains the value for the height. Default is auto.\n#\n# height: auto\n#\n## Padding for autosize. Default is 0.\n#\n# padding: -12\n#\n## Comma-separated list of ignored columns for metadata. (These can be\n## used for connections and styles but will not be added as metadata.)\n#\n# ignore: id,image,fill,stroke\n#\n## Column to be renamed to link attribute (used as link).\n#\n# link: url\n#\n## Spacing between nodes. Default is 40.\n#\n# nodespacing: 40\n#\n## Spacing between levels of hierarchical layouts. Default is 100.\n#\n# levelspacing: 100\n#\n## Spacing between parallel edges. Default is 40.\n#\n# edgespacing: 40\n#\n## Name of layout. Possible values are auto, none, verticaltree, horizontaltree,\n## verticalflow, horizontalflow, organic, circle. Default is auto.\n#\n# layout: auto\n#\n## ---- CSV below this line. First line are column names. ----\nname,position,id,location,manager,email,fill,stroke,refs,url,image\nEvan Miller,CFO,emi,Office 1,,me@example.com,#dae8fc,#6c8ebf,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-9-2-128.png\nEdward Morrison,Brand Manager,emo,Office 2,Evan Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-10-3-128.png\nRon Donovan,System Admin,rdo,Office 3,Evan Miller,me@example.com,#d5e8d4,#82b366,"emo,tva",https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-2-128.png\nTessa Valet,HR Director,tva,Office 4,Evan Miller,me@example.com,#d5e8d4,#82b366,,https://www.draw.io,https://cdn3.iconfinder.com/data/icons/user-avatars-1/512/users-3-128.png\n';
-Editor.shadowOptionEnabled=!0;Editor.config=null;Editor.configVersion=null;Editor.prototype.timeout=25E3;Editor.configure=function(a,c){if(null!=a){Editor.config=a;Editor.configVersion=a.version;Menus.prototype.defaultFonts=a.defaultFonts||Menus.prototype.defaultFonts;ColorDialog.prototype.presetColors=a.presetColors||ColorDialog.prototype.presetColors;ColorDialog.prototype.defaultColors=a.defaultColors||ColorDialog.prototype.defaultColors;StyleFormatPanel.prototype.defaultColorSchemes=a.defaultColorSchemes||
+Editor.shadowOptionEnabled=!0;Editor.config=null;Editor.configVersion=null;Editor.prototype.timeout=25E3;Editor.configure=function(a,d){if(null!=a){Editor.config=a;Editor.configVersion=a.version;Menus.prototype.defaultFonts=a.defaultFonts||Menus.prototype.defaultFonts;ColorDialog.prototype.presetColors=a.presetColors||ColorDialog.prototype.presetColors;ColorDialog.prototype.defaultColors=a.defaultColors||ColorDialog.prototype.defaultColors;StyleFormatPanel.prototype.defaultColorSchemes=a.defaultColorSchemes||
StyleFormatPanel.prototype.defaultColorSchemes;Graph.prototype.defaultEdgeLength=a.defaultEdgeLength||Graph.prototype.defaultEdgeLength;null!=a.templateFile&&(EditorUi.templateFile=a.templateFile);a.customFonts&&(Menus.prototype.defaultFonts=a.customFonts.concat(Menus.prototype.defaultFonts));a.customPresetColors&&(ColorDialog.prototype.presetColors=a.customPresetColors.concat(ColorDialog.prototype.presetColors));null!=a.customColorSchemes&&(StyleFormatPanel.prototype.defaultColorSchemes=a.customColorSchemes.concat(StyleFormatPanel.prototype.defaultColorSchemes));
-if(null!=a.css){var b=document.createElement("style");b.setAttribute("type","text/css");b.appendChild(document.createTextNode(a.css));var f=document.getElementsByTagName("script")[0];f.parentNode.insertBefore(b,f)}null!=a.libraries&&(Sidebar.prototype.customEntries=a.libraries);null!=a.enabledLibraries&&(Sidebar.prototype.enabledLibraries=a.enabledLibraries);null!=a.defaultLibraries&&(Sidebar.prototype.defaultEntries=a.defaultLibraries);null!=a.defaultCustomLibraries&&(Editor.defaultCustomLibraries=
+if(null!=a.css){var b=document.createElement("style");b.setAttribute("type","text/css");b.appendChild(document.createTextNode(a.css));var c=document.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}null!=a.libraries&&(Sidebar.prototype.customEntries=a.libraries);null!=a.enabledLibraries&&(Sidebar.prototype.enabledLibraries=a.enabledLibraries);null!=a.defaultLibraries&&(Sidebar.prototype.defaultEntries=a.defaultLibraries);null!=a.defaultCustomLibraries&&(Editor.defaultCustomLibraries=
a.defaultCustomLibraries);null!=a.enableCustomLibraries&&(Editor.enableCustomLibraries=a.enableCustomLibraries);null!=a.defaultVertexStyle&&(Graph.prototype.defaultVertexStyle=a.defaultVertexStyle);null!=a.defaultEdgeStyle&&(Graph.prototype.defaultEdgeStyle=a.defaultEdgeStyle);a.emptyDiagramXml&&(EditorUi.prototype.emptyDiagramXml=a.emptyDiagramXml);a.thumbWidth&&(Sidebar.prototype.thumbWidth=a.thumbWidth);a.thumbHeight&&(Sidebar.prototype.thumbHeight=a.thumbHeight);a.emptyLibraryXml&&(EditorUi.prototype.emptyLibraryXml=
-a.emptyLibraryXml);a.sidebarWidth&&(EditorUi.prototype.hsplitPosition=a.sidebarWidth);a.fontCss&&(b=document.createElement("style"),b.setAttribute("type","text/css"),b.appendChild(document.createTextNode(a.fontCss)),f=document.getElementsByTagName("script")[0],f.parentNode.insertBefore(b,f),Editor.prototype.fontCss=a.fontCss);if(null!=a.plugins&&!c)for(App.initPluginCallback(),b=0;b<a.plugins.length;b++)mxscript(a.plugins[b])}};Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
-Editor.GUID_LENGTH=20;Editor.guid=function(a){a=null!=a?a:Editor.GUID_LENGTH;for(var c=[],b=0;b<a;b++)c.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return c.join("")};Editor.prototype.useForeignObjectForMath=!1;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;var a=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(c){c=null!=c&&"mxlibrary"!=c.nodeName?this.extractGraphModel(c):null;if(null!=c){var b=
-c.getElementsByTagName("parsererror");if(null!=b&&0<b.length){var b=b[0],f=b.getElementsByTagName("div");null!=f&&0<f.length&&(b=f[0]);throw{message:mxUtils.getTextContent(b)};}if("mxGraphModel"==c.nodeName){b=c.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=b&&""!=b)b!=this.graph.currentStyle&&(f=null!=this.graph.themes?this.graph.themes[b]:mxUtils.load(STYLE_PATH+"/"+b+".xml").getDocumentElement(),null!=f&&(d=new mxCodec(f.ownerDocument),d.decode(f,this.graph.getStylesheet())));
-else if(f=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement(),null!=f){var d=new mxCodec(f.ownerDocument);d.decode(f,this.graph.getStylesheet())}this.graph.currentStyle=b;this.graph.mathEnabled="1"==urlParams.math||"1"==c.getAttribute("math");b=c.getAttribute("backgroundImage");null!=b?(b=JSON.parse(b),this.graph.setBackgroundImage(new mxImage(b.src,b.width,b.height))):this.graph.setBackgroundImage(null);mxClient.NO_FO=this.graph.mathEnabled&&
-!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==c.getAttribute("shadow"),!1)}a.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var b=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var c=b.apply(this,
-arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&c.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&c.setAttribute("backgroundImage",JSON.stringify(this.graph.backgroundImage));c.setAttribute("math",this.graph.mathEnabled?"1":"0");c.setAttribute("shadow",this.graph.shadowVisible?"1":"0");return c};Editor.prototype.isDataSvg=function(a){try{var c=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=c&&(null!=c&&"<"!=
-c.charAt(0)&&"%"!=c.charAt(0)&&(c=unescape(window.atob?atob(c):Base64.decode(cont,c))),null!=c&&"%"==c.charAt(0)&&(c=decodeURIComponent(c)),null!=c&&0<c.length)){var b=mxUtils.parseXml(c).documentElement;return"mxfile"==b.nodeName||"mxGraphModel"==b.nodeName}}catch(O){}return!1};Editor.prototype.extractGraphModel=function(a,c){if(null!=a&&"undefined"!==typeof pako){var b=a.ownerDocument.getElementsByTagName("div"),f=[];if(null!=b&&0<b.length)for(var d=0;d<b.length;d++)if("mxgraph"==b[d].getAttribute("class")){f.push(b[d]);
-break}0<f.length&&(b=f[0].getAttribute("data-mxgraph"),null!=b?(f=JSON.parse(b),null!=f&&null!=f.xml&&(f=mxUtils.parseXml(f.xml),a=f.documentElement)):(f=f[0].getElementsByTagName("div"),0<f.length&&(b=mxUtils.getTextContent(f[0]),b=Graph.decompress(b),0<b.length&&(f=mxUtils.parseXml(b),a=f.documentElement))))}if(null!=a&&"svg"==a.nodeName)if(b=a.getAttribute("content"),null!=b&&"<"!=b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&
-(b=decodeURIComponent(b)),null!=b&&0<b.length)a=mxUtils.parseXml(b).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==a||c||(f=null,"diagram"==a.nodeName?f=a:"mxfile"==a.nodeName&&(b=a.getElementsByTagName("diagram"),0<b.length&&(f=b[Math.max(0,Math.min(b.length-1,urlParams.page||0))])),null!=f&&(b=Graph.decompress(mxUtils.getTextContent(f)),null!=b&&0<b.length&&(a=mxUtils.parseXml(b).documentElement)));null==a||"mxGraphModel"==a.nodeName||c&&"mxfile"==a.nodeName||(a=null);
-return a};var e=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();e.apply(this,arguments)};var d=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=
-function(){d.apply(this,arguments);mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath&&null!=Editor.MathJaxRender?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(a,c){a=null!=a?a:"https://math.draw.io/current/MathJax.js?config=TeX-MML-AM_HTMLorMML";Editor.mathJaxQueue=[];Editor.doMathJaxRender=function(a){window.setTimeout(function(){"hidden"!=
-a.style.visibility&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,a])},0)};window.MathJax={skipStartupTypeset:!0,showMathMenu:!1,messageStyle:"none",AuthorInit:function(){MathJax.Hub.Config(c||{jax:["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS"],extensions:["tex2jax.js","mml2jax.js","asciimath2jax.js"],"HTML-CSS":{imageFont:null},TeX:{extensions:["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]},tex2jax:{ignoreClass:"mxCellEditor"},asciimath2jax:{ignoreClass:"mxCellEditor"}});
+a.emptyLibraryXml);a.sidebarWidth&&(EditorUi.prototype.hsplitPosition=a.sidebarWidth);a.fontCss&&(b=document.createElement("style"),b.setAttribute("type","text/css"),b.appendChild(document.createTextNode(a.fontCss)),c=document.getElementsByTagName("script")[0],c.parentNode.insertBefore(b,c),Editor.prototype.fontCss=a.fontCss);if(null!=a.plugins&&!d)for(App.initPluginCallback(),b=0;b<a.plugins.length;b++)mxscript(a.plugins[b])}};Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
+Editor.GUID_LENGTH=20;Editor.guid=function(a){a=null!=a?a:Editor.GUID_LENGTH;for(var d=[],b=0;b<a;b++)d.push(Editor.GUID_ALPHABET.charAt(Math.floor(Math.random()*Editor.GUID_ALPHABET.length)));return d.join("")};Editor.prototype.useForeignObjectForMath=!1;Editor.prototype.editButtonLink=null!=urlParams.edit?decodeURIComponent(urlParams.edit):null;var a=Editor.prototype.setGraphXml;Editor.prototype.setGraphXml=function(d){d=null!=d&&"mxlibrary"!=d.nodeName?this.extractGraphModel(d):null;if(null!=d){var b=
+d.getElementsByTagName("parsererror");if(null!=b&&0<b.length){var b=b[0],c=b.getElementsByTagName("div");null!=c&&0<c.length&&(b=c[0]);throw{message:mxUtils.getTextContent(b)};}if("mxGraphModel"==d.nodeName){b=d.getAttribute("style")||"default-style2";if("1"==urlParams.embed||null!=b&&""!=b)b!=this.graph.currentStyle&&(c=null!=this.graph.themes?this.graph.themes[b]:mxUtils.load(STYLE_PATH+"/"+b+".xml").getDocumentElement(),null!=c&&(f=new mxCodec(c.ownerDocument),f.decode(c,this.graph.getStylesheet())));
+else if(c=null!=this.graph.themes?this.graph.themes["default-old"]:mxUtils.load(STYLE_PATH+"/default-old.xml").getDocumentElement(),null!=c){var f=new mxCodec(c.ownerDocument);f.decode(c,this.graph.getStylesheet())}this.graph.currentStyle=b;this.graph.mathEnabled="1"==urlParams.math||"1"==d.getAttribute("math");b=d.getAttribute("backgroundImage");null!=b?(b=JSON.parse(b),this.graph.setBackgroundImage(new mxImage(b.src,b.width,b.height))):this.graph.setBackgroundImage(null);mxClient.NO_FO=this.graph.mathEnabled&&
+!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();this.graph.setShadowVisible("1"==d.getAttribute("shadow"),!1)}a.apply(this,arguments)}else throw{message:mxResources.get("notADiagramFile")||"Invalid data",toString:function(){return this.message}};};var b=Editor.prototype.getGraphXml;Editor.prototype.getGraphXml=function(a){a=null!=a?a:!0;var d=b.apply(this,
+arguments);null!=this.graph.currentStyle&&"default-style2"!=this.graph.currentStyle&&d.setAttribute("style",this.graph.currentStyle);null!=this.graph.backgroundImage&&d.setAttribute("backgroundImage",JSON.stringify(this.graph.backgroundImage));d.setAttribute("math",this.graph.mathEnabled?"1":"0");d.setAttribute("shadow",this.graph.shadowVisible?"1":"0");return d};Editor.prototype.isDataSvg=function(a){try{var d=mxUtils.parseXml(a).documentElement.getAttribute("content");if(null!=d&&(null!=d&&"<"!=
+d.charAt(0)&&"%"!=d.charAt(0)&&(d=unescape(window.atob?atob(d):Base64.decode(cont,d))),null!=d&&"%"==d.charAt(0)&&(d=decodeURIComponent(d)),null!=d&&0<d.length)){var b=mxUtils.parseXml(d).documentElement;return"mxfile"==b.nodeName||"mxGraphModel"==b.nodeName}}catch(O){}return!1};Editor.prototype.extractGraphModel=function(a,d){if(null!=a&&"undefined"!==typeof pako){var b=a.ownerDocument.getElementsByTagName("div"),c=[];if(null!=b&&0<b.length)for(var f=0;f<b.length;f++)if("mxgraph"==b[f].getAttribute("class")){c.push(b[f]);
+break}0<c.length&&(b=c[0].getAttribute("data-mxgraph"),null!=b?(c=JSON.parse(b),null!=c&&null!=c.xml&&(c=mxUtils.parseXml(c.xml),a=c.documentElement)):(c=c[0].getElementsByTagName("div"),0<c.length&&(b=mxUtils.getTextContent(c[0]),b=Graph.decompress(b),0<b.length&&(c=mxUtils.parseXml(b),a=c.documentElement))))}if(null!=a&&"svg"==a.nodeName)if(b=a.getAttribute("content"),null!=b&&"<"!=b.charAt(0)&&"%"!=b.charAt(0)&&(b=unescape(window.atob?atob(b):Base64.decode(cont,b))),null!=b&&"%"==b.charAt(0)&&
+(b=decodeURIComponent(b)),null!=b&&0<b.length)a=mxUtils.parseXml(b).documentElement;else throw{message:mxResources.get("notADiagramFile")};null==a||d||(c=null,"diagram"==a.nodeName?c=a:"mxfile"==a.nodeName&&(b=a.getElementsByTagName("diagram"),0<b.length&&(c=b[Math.max(0,Math.min(b.length-1,urlParams.page||0))])),null!=c&&(b=Graph.decompress(mxUtils.getTextContent(c)),null!=b&&0<b.length&&(a=mxUtils.parseXml(b).documentElement)));null==a||"mxGraphModel"==a.nodeName||d&&"mxfile"==a.nodeName||(a=null);
+return a};var e=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();e.apply(this,arguments)};var c=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=
+function(){c.apply(this,arguments);mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath&&null!=Editor.MathJaxRender?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform()};Editor.initMath=function(a,d){a=null!=a?a:"https://math.draw.io/current/MathJax.js?config=TeX-MML-AM_HTMLorMML";Editor.mathJaxQueue=[];Editor.doMathJaxRender=function(a){window.setTimeout(function(){"hidden"!=
+a.style.visibility&&MathJax.Hub.Queue(["Typeset",MathJax.Hub,a])},0)};window.MathJax={skipStartupTypeset:!0,showMathMenu:!1,messageStyle:"none",AuthorInit:function(){MathJax.Hub.Config(d||{jax:["input/TeX","input/MathML","input/AsciiMath","output/HTML-CSS"],extensions:["tex2jax.js","mml2jax.js","asciimath2jax.js"],"HTML-CSS":{imageFont:null},TeX:{extensions:["AMSmath.js","AMSsymbols.js","noErrors.js","noUndefined.js"]},tex2jax:{ignoreClass:"mxCellEditor"},asciimath2jax:{ignoreClass:"mxCellEditor"}});
MathJax.Hub.Register.StartupHook("Begin",function(){for(var a=0;a<Editor.mathJaxQueue.length;a++)Editor.doMathJaxRender(Editor.mathJaxQueue[a])})}};Editor.MathJaxRender=function(a){"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?Editor.doMathJaxRender(a):Editor.mathJaxQueue.push(a)};Editor.MathJaxClear=function(){Editor.mathJaxQueue=[]};var b=Editor.prototype.init;Editor.prototype.init=function(){b.apply(this,arguments);this.graph.addListener(mxEvent.SIZE,mxUtils.bind(this,function(a,
-c){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)}))};var f=document.getElementsByTagName("script");if(null!=f&&0<f.length){var d=document.createElement("script");d.type="text/javascript";d.src=a;f[0].parentNode.appendChild(d)}};Editor.prototype.csvToArray=function(a){if(!/^\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*(?:,\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*)*$/.test(a))return null;
-var c=[];a.replace(/(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s][^'\\]*)*)'|"([^"\\]*(?:\\[\S\s][^"\\]*)*)"|([^,'"\s\\]*(?:\s+[^,'"\s\\]+)*))\s*(?:,|$)/g,function(a,b,f,d){void 0!==b?c.push(b.replace(/\\'/g,"'")):void 0!==f?c.push(f.replace(/\\"/g,'"')):void 0!==d&&c.push(d);return""});/,\s*$/.test(a)&&c.push("");return c};Editor.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&
-this.corsRegExp.test(a)||"https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0,23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};Editor.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var c=a.convert,b=this;a.convert=function(f){if(null!=f){var d="http://"==f.substring(0,7)||"https://"==
-f.substring(0,8);d&&!navigator.onLine?f=EditorUi.prototype.svgBrokenImage.src:!d||f.substring(0,a.baseUrl.length)==a.baseUrl||EditorUi.prototype.crossOriginImages&&b.isCorsEnabledForUrl(f)?"chrome-extension://"!=f.substring(0,19)&&(f=c.apply(this,arguments)):f=PROXY_URL+"?url="+encodeURIComponent(f)}return f};return a};Editor.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.prototype.convertImageToDataUri=function(a,c){if(/(\.svg)$/i.test(a))mxUtils.get(a,
-mxUtils.bind(this,function(a){c(this.createSvgDataUri(a.getText()))}),function(){c(EditorUi.prototype.svgBrokenImage.src)});else{var b=new Image;EditorUi.prototype.crossOriginImages&&(b.crossOrigin="anonymous");b.onload=function(){var a=document.createElement("canvas"),f=a.getContext("2d");a.height=b.height;a.width=b.width;f.drawImage(b,0,0);try{c(a.toDataURL())}catch(H){c(EditorUi.prototype.svgBrokenImage.src)}};b.onerror=function(){c(EditorUi.prototype.svgBrokenImage.src)};b.src=a}};Editor.prototype.convertImages=
-function(a,c,b,f){null==f&&(f=this.createImageUrlConverter());var d=0,e=b||{};b=mxUtils.bind(this,function(b,g){for(var l=a.getElementsByTagName(b),p=0;p<l.length;p++)mxUtils.bind(this,function(b){var l=f.convert(b.getAttribute(g));if(null!=l&&"data:"!=l.substring(0,5)){var p=e[l];null==p?(d++,this.convertImageToDataUri(l,function(f){null!=f&&(e[l]=f,b.setAttribute(g,f));d--;0==d&&c(a)})):b.setAttribute(g,p)}else null!=l&&b.setAttribute(g,l)})(l[p])});b("image","xlink:href");b("img","src");0==d&&
-c(a)};Editor.prototype.base64Encode=function(a){for(var c="",b=0,f=a.length,d,e,g;b<f;){d=a.charCodeAt(b++)&255;if(b==f){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4);c+="==";break}e=a.charCodeAt(b++);if(b==f){c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<
-4|(e&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2);c+="=";break}g=a.charCodeAt(b++);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(d>>2);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((d&3)<<4|(e&240)>>4);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2|(g&192)>>6);c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return c};
-Editor.prototype.loadUrl=function(a,c,b,f,d,e){try{var g=f||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);d=null!=d?d:!0;var l=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=c){var f=a.getText();if(g){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),
-d=0;d<a.length;d++)f[d]=String.fromCharCode(a[d]);f=f.join("")}e=null!=e?e:"data:image/png;base64,";f=e+this.base64Encode(f)}c(f)}}else null!=b&&b({code:App.ERROR_UNKNOWN},a)}),function(){null!=b&&b({code:App.ERROR_UNKNOWN})},g,this.timeout,function(){d&&null!=b&&b({code:App.ERROR_TIMEOUT,retry:l})})});l()}catch(S){null!=b&&b(S)}};Editor.prototype.loadFonts=function(a){if(null!=this.fontCss&&null==this.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$",
-"g"),"")},b=this.fontCss.split("url("),f=0,d={},e=mxUtils.bind(this,function(){if(0==f){for(var e=[b[0]],g=1;g<b.length;g++){var l=b[g].indexOf(")");e.push('url("');e.push(d[c(b[g].substring(0,l))]);e.push('"'+b[g].substring(l))}this.resolvedFontCss=e.join("");a()}});if(0<b.length)for(var g=1;g<b.length;g++){var l=b[g].indexOf(")"),p=null,n=b[g].indexOf("format(",l);0<n&&(p=c(b[g].substring(n+7,b[g].indexOf(")",n))));mxUtils.bind(this,function(a){if(null==d[a]){d[a]=a;f++;var c="application/x-font-ttf";
-if("svg"==p||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==p||"embedded-opentype"==p||/(\.otf)($|\?)/i.test(a))c="application/x-font-opentype";else if("woff"==p||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==p||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==p||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==p||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&&
-(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){d[a]=c;f--;e()}),mxUtils.bind(this,function(a){f--;e()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[g].substring(0,l)),p)}}else a()};Editor.prototype.convertMath=function(a,c,b,f){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(c),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,function(){f()}))}),0)):f()};Editor.prototype.isExportToCanvas=
-function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=function(a,c,b,f,d,e,g,l,p,n,u,k,y,x){e=null!=e?e:!0;k=null!=k?k:this.graph;y=null!=y?y:0;var r=p?null:k.background;r==mxConstants.NONE&&(r=null);null==r&&(r=f);null==r&&0==p&&(r=this.graph.defaultPageBackgroundColor);this.convertImages(k.getSvg(r,null,null,x,null,null!=g?g:!0,null,null,null,n),mxUtils.bind(this,function(b){var f=new Image;f.onload=mxUtils.bind(this,function(){try{var g=
-document.createElement("canvas"),p=parseInt(b.getAttribute("width")),n=parseInt(b.getAttribute("height"));l=null!=l?l:1;null!=c&&(l=e?Math.min(1,Math.min(3*c/(4*n),c/p)):c/p);p=Math.ceil(l*p)+2*y;n=Math.ceil(l*n)+2*y;g.setAttribute("width",p);g.setAttribute("height",n);var u=g.getContext("2d");null!=r&&(u.beginPath(),u.rect(0,0,p,n),u.fillStyle=r,u.fill());u.scale(l,l);mxClient.IS_SF?window.setTimeout(function(){u.drawImage(f,y/l,y/l);a(g)},0):(u.drawImage(f,y/l,y/l),a(g))}catch(R){null!=d&&d(R)}});
-f.onerror=function(a){null!=d&&d(a)};try{n&&this.graph.addSvgShadow(b);var g=mxUtils.bind(this,function(){if(null!=this.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.resolvedFontCss;b.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(k,b,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(b))}))});this.loadFonts(g)}catch(K){null!=d&&d(K)}}),b,u)};Editor.prototype.writeGraphModelToPng=function(a,c,b,f,
-d){function e(a,c){var b=p;p+=c;return a.substring(b,p)}function g(a){a=e(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function l(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var 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&&
+d){null!=this.graph.container&&this.graph.mathEnabled&&Editor.MathJaxRender(this.graph.container)}))};var c=document.getElementsByTagName("script");if(null!=c&&0<c.length){var f=document.createElement("script");f.type="text/javascript";f.src=a;c[0].parentNode.appendChild(f)}};Editor.prototype.csvToArray=function(a){if(!/^\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*(?:,\s*(?:'[^'\\]*(?:\\[\S\s][^'\\]*)*'|"[^"\\]*(?:\\[\S\s][^"\\]*)*"|[^,'"\s\\]*(?:\s+[^,'"\s\\]+)*)\s*)*$/.test(a))return null;
+var d=[];a.replace(/(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s][^'\\]*)*)'|"([^"\\]*(?:\\[\S\s][^"\\]*)*)"|([^,'"\s\\]*(?:\s+[^,'"\s\\]+)*))\s*(?:,|$)/g,function(a,b,c,f){void 0!==b?d.push(b.replace(/\\'/g,"'")):void 0!==c?d.push(c.replace(/\\"/g,'"')):void 0!==f&&d.push(f);return""});/,\s*$/.test(a)&&d.push("");return d};Editor.prototype.isCorsEnabledForUrl=function(a){null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&
+this.corsRegExp.test(a)||"https://raw.githubusercontent.com/"===a.substring(0,34)||"https://cdn.rawgit.com/"===a.substring(0,23)||"https://rawgit.com/"===a.substring(0,19)||/^https?:\/\/[^\/]*\.iconfinder.com\//.test(a)||/^https?:\/\/[^\/]*\.draw\.io\/proxy/.test(a)||/^https?:\/\/[^\/]*\.github\.io\//.test(a)};Editor.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var d=a.convert,b=this;a.convert=function(c){if(null!=c){var f="http://"==c.substring(0,7)||"https://"==
+c.substring(0,8);f&&!navigator.onLine?c=EditorUi.prototype.svgBrokenImage.src:!f||c.substring(0,a.baseUrl.length)==a.baseUrl||EditorUi.prototype.crossOriginImages&&b.isCorsEnabledForUrl(c)?"chrome-extension://"!=c.substring(0,19)&&(c=d.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c)}return c};return a};Editor.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};Editor.prototype.convertImageToDataUri=function(a,d){if(/(\.svg)$/i.test(a))mxUtils.get(a,
+mxUtils.bind(this,function(a){d(this.createSvgDataUri(a.getText()))}),function(){d(EditorUi.prototype.svgBrokenImage.src)});else{var b=new Image;EditorUi.prototype.crossOriginImages&&(b.crossOrigin="anonymous");b.onload=function(){var a=document.createElement("canvas"),c=a.getContext("2d");a.height=b.height;a.width=b.width;c.drawImage(b,0,0);try{d(a.toDataURL())}catch(H){d(EditorUi.prototype.svgBrokenImage.src)}};b.onerror=function(){d(EditorUi.prototype.svgBrokenImage.src)};b.src=a}};Editor.prototype.convertImages=
+function(a,d,b,c){null==c&&(c=this.createImageUrlConverter());var f=0,e=b||{};b=mxUtils.bind(this,function(b,g){for(var l=a.getElementsByTagName(b),p=0;p<l.length;p++)mxUtils.bind(this,function(b){var l=c.convert(b.getAttribute(g));if(null!=l&&"data:"!=l.substring(0,5)){var p=e[l];null==p?(f++,this.convertImageToDataUri(l,function(c){null!=c&&(e[l]=c,b.setAttribute(g,c));f--;0==f&&d(a)})):b.setAttribute(g,p)}else null!=l&&b.setAttribute(g,l)})(l[p])});b("image","xlink:href");b("img","src");0==f&&
+d(a)};Editor.prototype.base64Encode=function(a){for(var d="",b=0,c=a.length,f,e,g;b<c;){f=a.charCodeAt(b++)&255;if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4);d+="==";break}e=a.charCodeAt(b++);if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<
+4|(e&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2);d+="=";break}g=a.charCodeAt(b++);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((f&3)<<4|(e&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&15)<<2|(g&192)>>6);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(g&63)}return d};
+Editor.prototype.loadUrl=function(a,d,b,c,f,e){try{var g=c||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a);f=null!=f?f:!0;var l=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=d){var c=a.getText();if(g){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var c=Array(a.length),
+f=0;f<a.length;f++)c[f]=String.fromCharCode(a[f]);c=c.join("")}e=null!=e?e:"data:image/png;base64,";c=e+this.base64Encode(c)}d(c)}}else null!=b&&b({code:App.ERROR_UNKNOWN},a)}),function(){null!=b&&b({code:App.ERROR_UNKNOWN})},g,this.timeout,function(){f&&null!=b&&b({code:App.ERROR_TIMEOUT,retry:l})})});l()}catch(S){null!=b&&b(S)}};Editor.prototype.loadFonts=function(a){if(null!=this.fontCss&&null==this.resolvedFontCss){var d=function(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$",
+"g"),"")},b=this.fontCss.split("url("),c=0,f={},e=mxUtils.bind(this,function(){if(0==c){for(var e=[b[0]],g=1;g<b.length;g++){var l=b[g].indexOf(")");e.push('url("');e.push(f[d(b[g].substring(0,l))]);e.push('"'+b[g].substring(l))}this.resolvedFontCss=e.join("");a()}});if(0<b.length)for(var g=1;g<b.length;g++){var l=b[g].indexOf(")"),p=null,n=b[g].indexOf("format(",l);0<n&&(p=d(b[g].substring(n+7,b[g].indexOf(")",n))));mxUtils.bind(this,function(a){if(null==f[a]){f[a]=a;c++;var d="application/x-font-ttf";
+if("svg"==p||/(\.svg)($|\?)/i.test(a))d="image/svg+xml";else if("otf"==p||"embedded-opentype"==p||/(\.otf)($|\?)/i.test(a))d="application/x-font-opentype";else if("woff"==p||/(\.woff)($|\?)/i.test(a))d="application/font-woff";else if("woff2"==p||/(\.woff2)($|\?)/i.test(a))d="application/font-woff2";else if("eot"==p||/(\.eot)($|\?)/i.test(a))d="application/vnd.ms-fontobject";else if("sfnt"==p||/(\.sfnt)($|\?)/i.test(a))d="application/font-sfnt";var b=a;/^https?:\/\//.test(b)&&!this.isCorsEnabledForUrl(b)&&
+(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(d){f[a]=d;c--;e()}),mxUtils.bind(this,function(a){c--;e()}),!0,null,"data:"+d+";charset=utf-8;base64,")}})(d(b[g].substring(0,l)),p)}}else a()};Editor.prototype.convertMath=function(a,d,b,c){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(d),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,function(){c()}))}),0)):c()};Editor.prototype.isExportToCanvas=
+function(){return mxClient.IS_CHROMEAPP||!this.graph.mathEnabled&&this.useCanvasForExport};Editor.prototype.exportToCanvas=function(a,d,b,c,f,e,g,l,p,n,u,k,y,x){e=null!=e?e:!0;k=null!=k?k:this.graph;y=null!=y?y:0;var r=p?null:k.background;r==mxConstants.NONE&&(r=null);null==r&&(r=c);null==r&&0==p&&(r=this.graph.defaultPageBackgroundColor);this.convertImages(k.getSvg(r,null,null,x,null,null!=g?g:!0,null,null,null,n),mxUtils.bind(this,function(b){var c=new Image;c.onload=mxUtils.bind(this,function(){try{var g=
+document.createElement("canvas"),p=parseInt(b.getAttribute("width")),n=parseInt(b.getAttribute("height"));l=null!=l?l:1;null!=d&&(l=e?Math.min(1,Math.min(3*d/(4*n),d/p)):d/p);p=Math.ceil(l*p)+2*y;n=Math.ceil(l*n)+2*y;g.setAttribute("width",p);g.setAttribute("height",n);var u=g.getContext("2d");null!=r&&(u.beginPath(),u.rect(0,0,p,n),u.fillStyle=r,u.fill());u.scale(l,l);mxClient.IS_SF?window.setTimeout(function(){u.drawImage(c,y/l,y/l);a(g)},0):(u.drawImage(c,y/l,y/l),a(g))}catch(R){null!=f&&f(R)}});
+c.onerror=function(a){null!=f&&f(a)};try{n&&this.graph.addSvgShadow(b);var g=mxUtils.bind(this,function(){if(null!=this.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.resolvedFontCss;b.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(k,b,!0,mxUtils.bind(this,function(){c.src=this.createSvgDataUri(mxUtils.getXml(b))}))});this.loadFonts(g)}catch(K){null!=f&&f(K)}}),b,u)};Editor.prototype.writeGraphModelToPng=function(a,d,b,c,
+f){function e(a,d){var b=p;p+=d;return a.substring(b,p)}function g(a){a=e(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function l(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var p=0;if(e(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=f&&f();else if(e(a,4),"IHDR"!=e(a,4))null!=f&&f();else{e(a,17);f=a.substring(0,p);do{var n=g(a);
+if("IDAT"==e(a,4)){f=a.substring(0,p-8);b=b+String.fromCharCode(0)+("zTXt"==d?String.fromCharCode(0):"")+c;c=4294967295;c=EditorUi.prototype.updateCRC(c,d,0,4);c=EditorUi.prototype.updateCRC(c,b,0,b.length);f+=l(b.length)+d+b+l(c^4294967295);f+=a.substring(p-8,a.length);break}f+=a.substring(p-8,p-4+n);e(a,n);e(a,4)}while(n);return"data:image/png;base64,"+(window.btoa?btoa(f):Base64.encode(f,!0))}};if(window.ColorDialog){FilenameDialog.filenameHelpLink="https://desk.draw.io/support/solutions/articles/16000091426";
+var k=ColorDialog.addRecentColor;ColorDialog.addRecentColor=function(a,d){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,d){var b=null;null!=a.editor.graph.getModel().getParent(d)?b=d.getId():null!=a.currentPage&&
(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=
+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 d=this.editorUi,b=d.editor.graph,c=this.createOption(mxResources.get("shadow"),function(){return b.shadowVisible},function(a){var c=new ChangePageSetup(d);c.ignoreColor=!0;c.ignoreImage=
+!0;c.shadowVisible=a;b.model.execute(c)},{install:function(a){this.listener=function(){a(b.shadowVisible)};d.addListener("shadowVisibleChanged",this.listener)},destroy:function(){d.removeListener(this.listener)}});Editor.shadowOptionEnabled||(c.getElementsByTagName("input")[0].setAttribute("disabled","disabled"),mxUtils.setOpacity(c,60));a.appendChild(c)}return a};var A=DiagramFormatPanel.prototype.addOptions;DiagramFormatPanel.prototype.addOptions=function(a){a=A.apply(this,arguments);var d=this.editorUi,
+b=d.editor.graph;if(b.isEnabled()){var c=d.getCurrentFile();null!=c&&c.isAutosaveOptional()&&(c=this.createOption(mxResources.get("autosave"),function(){return d.editor.autosave},function(a){d.editor.setAutosave(a)},{install:function(a){this.listener=function(){a(d.editor.autosave)};d.editor.addListener("autosaveChanged",this.listener)},destroy:function(){d.editor.removeListener(this.listener)}}),a.appendChild(c))}if(this.isMathOptionVisible()&&b.isEnabled()&&"undefined"!==typeof MathJax){c=this.createOption(mxResources.get("mathematicalTypesetting"),
+function(){return b.mathEnabled},function(a){d.actions.get("mathematicalTypesetting").funct()},{install:function(a){this.listener=function(){a(b.mathEnabled)};d.addListener("mathEnabledChanged",this.listener)},destroy:function(){d.removeListener(this.listener)}});c.style.paddingTop="5px";a.appendChild(c);var f=d.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000032875");f.style.position="relative";f.style.marginLeft="6px";f.style.top="2px";c.appendChild(f)}return a};mxCellRenderer.prototype.defaultVertexShape.prototype.customProperties=
[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"absoluteArcSize",dispName:"Abs. Arc Size",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.link.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:4}];mxCellRenderer.defaultShapes.flexArrow.prototype.customProperties=[{name:"width",dispName:"Width",type:"float",min:0,defVal:10},{name:"startWidth",dispName:"Start Width",type:"float",min:0,defVal:20},{name:"endWidth",
dispName:"End Width",type:"float",min:0,defVal:20}];mxCellRenderer.defaultShapes.process.prototype.customProperties=[{name:"size",dispName:"Indent",type:"float",min:0,max:.5,defVal:.1}];mxCellRenderer.defaultShapes.rhombus.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,max:50,defVal:mxConstants.LINE_ARCSIZE},{name:"double",dispName:"Double",type:"bool",defVal:!1}];mxCellRenderer.defaultShapes.partialRectangle.prototype.customProperties=[{name:"top",dispName:"Top Line",
type:"bool",defVal:!0},{name:"bottom",dispName:"Bottom Line",type:"bool",defVal:!0},{name:"left",dispName:"Left Line",type:"bool",defVal:!0},{name:"right",dispName:"Right Line",type:"bool",defVal:!0}];mxCellRenderer.defaultShapes.parallelogram.prototype.customProperties=[{name:"arcSize",dispName:"Arc Size",type:"float",min:0,defVal:mxConstants.LINE_ARCSIZE},{name:"size",dispName:"Slope Angle",type:"float",min:0,max:1,defVal:.2}];mxCellRenderer.defaultShapes.hexagon.prototype.customProperties=[{name:"arcSize",
@@ -2822,57 +2822,57 @@ type:"float",min:0,defVal:20},{name:"dy",dispName:"Width2",type:"float",min:0,de
{fill:"#008a00",stroke:"#005700",font:"#ffffff"},{fill:"#1ba1e2",stroke:"#006EAF",font:"#ffffff"},{fill:"#0050ef",stroke:"#001DBC",font:"#ffffff"},{fill:"#6a00ff",stroke:"#3700CC",font:"#ffffff"},{fill:"#aa00ff",stroke:"#7700CC",font:"#ffffff"},{fill:"#d80073",stroke:"#A50040",font:"#ffffff"},{fill:"#a20025",stroke:"#6F0000",font:"#ffffff"}],[{fill:"#e51400",stroke:"#B20000",font:"#ffffff"},{fill:"#fa6800",stroke:"#C73500",font:"#ffffff"},{fill:"#f0a30a",stroke:"#BD7000",font:"#ffffff"},{fill:"#e3c800",
stroke:"#B09500",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"}],[{fill:"",stroke:""},{fill:mxConstants.NONE,stroke:""},{fill:"#fad7ac",stroke:"#b46504"},{fill:"#fad9d5",stroke:"#ae4132"},{fill:"#b0e3e6",stroke:"#0e8088"},{fill:"#b1ddf0",stroke:"#10739e"},{fill:"#d0cee2",stroke:"#56517e"},{fill:"#bac8d3",stroke:"#23445d"}],[{fill:"",stroke:""},
{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"}],[{fill:"",stroke:""},{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,c,b){if(null!=c){var f=function(a){if(null!=a)if(b)for(var f=0;f<a.length;f++)c[a[f].name]=a[f];else for(var d in c){for(var e=!1,f=0;f<a.length;f++)if(a[f].name==d&&a[f].type==c[d].type){e=!0;break}e||delete c[d]}},d=this.editorUi.editor.graph.view.getState(a);null!=d&&
-null!=d.shape&&(d.shape.commonCustomPropAdded||(d.shape.commonCustomPropAdded=!0,d.shape.customProperties=d.shape.customProperties||[],d.cell.vertex?Array.prototype.push.apply(d.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(d.shape.customProperties,Editor.commonEdgeProperties)),f(d.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{f(JSON.parse(a))}catch(H){}}};var c=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=
-this.format.createSelectionState();"image"!=a.style.shape&&this.container.appendChild(this.addStyles(this.createPanel()));c.apply(this,arguments);if(Editor.enableCustomProperties){for(var b={},f=a.vertices,d=a.edges,e=0;e<f.length;e++)this.findCommonProperties(f[e],b,0==e);for(e=0;e<d.length;e++)this.findCommonProperties(d[e],b,0==f.length&&0==e);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(b).length&&this.container.appendChild(this.addProperties(this.createPanel(),b,a))}};var f=
-StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var c=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));c.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";c.style.marginRight="2px";a.appendChild(c);c=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("pasteStyle").funct()}));
-c.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");c.style.marginBottom="2px";c.style.width="100px";a.appendChild(c);mxUtils.br(a);return 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<g.length?null!=f?g.splice(f,1):g[b.index]=c:g.push(c);null!=b.size&&g.length>b.size&&(g=g.slice(0,b.size));c=g.join(",");null!=b.countProperty&&(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;a<b.dependentProps.length;a++){var p=b.dependentPropsDefVal[a],n=b.dependentPropsVals[a];if(n.length>c)n=n.slice(0,c);else for(var k=
-n.length;k<c;k++)n.push(p);n=n.join(",");u.setCellStyles(b.dependentProps[a],n,u.getSelectionCells());d.push(b.dependentProps[a]);e.push(n)}r.editorUi.fireEvent(new mxEventObject("styleChanged","keys",d,"values",e,"cells",u.getSelectionCells()))}finally{u.getModel().endUpdate()}}function d(c,b,f){var d=mxUtils.getOffset(a,!0),e=mxUtils.getOffset(c,!0);b.style.position="absolute";b.style.left=e.x-d.x+"px";b.style.top=e.y-d.y+"px";b.style.width=c.offsetWidth+"px";b.style.height=c.offsetHeight-(f?4:
-0)+"px";b.style.zIndex=5}function e(a,c,b){var d=document.createElement("div");d.style.width="32px";d.style.height="4px";d.style.margin="2px";d.style.border="1px solid black";d.style.background=c&&"none"!=c?c:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(r,function(e){this.editorUi.pickColor(c,function(c){d.style.background="none"==c?"url('"+Dialog.prototype.noColorImage+"')":c;f(a,c,b)});mxEvent.consume(e)}));btn.style.height="12px";btn.style.width="40px";btn.className=
-"geColorBtn";btn.appendChild(d);return btn}function g(a,c,b,d,e,g,l){null!=c&&(c=c.split(","),k.push({name:a,values:c,type:b,defVal:d,countProperty:e,parentRow:g,isDeletable:!0,flipBkg:l}));btn=mxUtils.button("+",mxUtils.bind(r,function(c){for(var p=g,r=0;null!=p.nextSibling;)if(p.nextSibling.getAttribute("data-pName")==a)p=p.nextSibling,r++;else break;var u={type:b,parentRow:g,index:r,isDeletable:!0,defVal:d,countProperty:e},r=n(a,"",u,0==r%2,l);f(a,d,u);p.parentNode.insertBefore(r,p.nextSibling);
-mxEvent.consume(c)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function l(a,c,b,f,d,e,g){if(0<d){var l=Array(d);c=null!=c?c.split(","):[];for(var p=0;p<d;p++)l[p]=null!=c[p]?c[p]:null!=f?f:"";k.push({name:a,values:l,type:b,defVal:f,parentRow:e,flipBkg:g,size:d})}return document.createElement("div")}function p(a,c,b){var d=document.createElement("input");d.type="checkbox";d.checked="1"==c;mxEvent.addListener(d,"change",function(){f(a,d.checked?"1":"0",b)});
-return d}function n(c,b,n,u,k){var y=n.dispName,x=n.type,m=document.createElement("tr");m.className="gePropRow"+(k?"Dark":"")+(u?"Alt":"")+" gePropNonHeaderRow";m.setAttribute("data-pName",c);m.setAttribute("data-pValue",b);u=!1;null!=n.index&&(m.setAttribute("data-index",n.index),y=(null!=y?y:"")+"["+n.index+"]",u=!0);var z=document.createElement("td");z.className="gePropRowCell";z.innerHTML=mxUtils.htmlEntities(mxResources.get(y,null,y));u&&(z.style.textAlign="right");m.appendChild(z);z=document.createElement("td");
-z.className="gePropRowCell";if("color"==x)z.appendChild(e(c,b,n));else if("bool"==x||"boolean"==x)z.appendChild(p(c,b,n));else if("enum"==x){var B=n.enumList;for(k=0;k<B.length;k++)if(y=B[k],y.val==b){z.innerHTML=mxUtils.htmlEntities(mxResources.get(y.dispName,null,y.dispName));break}mxEvent.addListener(z,"click",mxUtils.bind(r,function(){var e=document.createElement("select");d(z,e);for(var g=0;g<B.length;g++){var l=B[g],p=document.createElement("option");p.value=mxUtils.htmlEntities(l.val);p.innerHTML=
-mxUtils.htmlEntities(mxResources.get(l.dispName,null,l.dispName));e.appendChild(p)}e.value=b;a.appendChild(e);mxEvent.addListener(e,"change",function(){var a=mxUtils.htmlEntities(e.value);f(c,a,n)});e.focus();mxEvent.addListener(e,"blur",function(){a.removeChild(e)})}))}else"dynamicArr"==x?z.appendChild(g(c,b,n.subType,n.subDefVal,n.countProperty,m,k)):"staticArr"==x?z.appendChild(l(c,b,n.subType,n.subDefVal,n.size,m,k)):(z.innerHTML=b,mxEvent.addListener(z,"click",mxUtils.bind(r,function(){function e(){var a=
-g.value,a=0==a.length&&"string"!=x?0:a;n.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",x="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=n.min&&a<n.min?a=n.min:null!=n.max&&a>n.max&&(a=n.max);a=mxUtils.htmlEntities(("int"==x?parseInt(a):a)+"");f(c,a,n)}var g=document.createElement("input");d(z,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",z.appendChild(k));m.appendChild(z);return m}var r=this,u=this.editorUi.editor.graph,k=[];a.style.position="relative";a.style.padding="0";var y=document.createElement("table");
-y.style.whiteSpace="nowrap";y.style.width="100%";var x=document.createElement("tr");x.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"));x.style.cursor="pointer";var q=function(){var c=y.querySelectorAll(".gePropNonHeaderRow"),b;if(r.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;f<c.length;f++)c[f].style.display=b};mxEvent.addListener(x,"click",function(){r.editorUi.propertiesCollapsed=!r.editorUi.propertiesCollapsed;q()});x.appendChild(m);m=document.createElement("th");m.className="gePropHeaderCell";m.innerHTML=mxResources.get("value");x.appendChild(m);y.appendChild(x);var C=!1,G=!1,E;for(E in c)if(x=
-c[E],"function"!=typeof x.isVisible||x.isVisible(b)){var t=null!=b.style[E]?mxUtils.htmlEntities(b.style[E]+""):x.defVal;if("separator"==x.type)G=!G;else{if("staticArr"==x.type)x.size=parseInt(b.style[x.sizeProperty]||c[x.sizeProperty].defVal)||0;else if(null!=x.dependentProps){for(var v=x.dependentProps,Q=[],A=[],m=0;m<v.length;m++){var F=b.style[v[m]];A.push(c[v[m]].subDefVal);Q.push(null!=F?F.split(","):[])}x.dependentPropsDefVal=A;x.dependentPropsVals=Q}y.appendChild(n(E,t,x,C,G));C=!C}}for(m=
-0;m<k.length;m++)for(x=k[m],c=x.parentRow,b=0;b<x.values.length;b++)E=n(x.name,x.values[b],{type:x.type,parentRow:x.parentRow,isDeletable:x.isDeletable,index:b,defVal:x.defVal,countProperty:x.countProperty,size:x.size},0==b%2,x.flipBkg),c.parentNode.insertBefore(E,c.nextSibling),c=E;a.appendChild(y);q();return a};StyleFormatPanel.prototype.addStyles=function(a){function c(a){function c(a){var c=mxUtils.button("",function(c){f.getModel().beginUpdate();try{var b=f.getSelectionCells();for(c=0;c<b.length;c++){for(var d=
-f.getModel().getStyle(b[c]),g=0;g<e.length;g++)d=mxUtils.removeStylename(d,e[g]);var l=f.getModel().isVertex(b[c])?f.defaultVertexStyle:f.defaultEdgeStyle;null!=a?(d=mxUtils.setStyle(d,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(l,mxConstants.STYLE_GRADIENTCOLOR,null)),d=""==a.fill?mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(l,mxConstants.STYLE_FILLCOLOR,null)),d=""==a.stroke?mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,
-null):mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(l,mxConstants.STYLE_STROKECOLOR,null)),f.getModel().isVertex(b[c])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(l,mxConstants.STYLE_FONTCOLOR,null)))):(d=mxUtils.setStyle(d,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(l,mxConstants.STYLE_FILLCOLOR,"#ffffff")),d=mxUtils.setStyle(d,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(l,mxConstants.STYLE_STROKECOLOR,"#000000")),d=mxUtils.setStyle(d,
-mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(l,mxConstants.STYLE_GRADIENTCOLOR,null)),f.getModel().isVertex(b[c])&&(d=mxUtils.setStyle(d,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(l,mxConstants.STYLE_FONTCOLOR,null))));f.getModel().setStyle(b[c],d)}}finally{f.getModel().endUpdate()}});c.className="geStyleButton";c.style.width="36px";c.style.height="30px";c.style.margin="0px 6px 6px 0px";if(null!=a)null!=a.gradient?mxClient.IS_IE&&(mxClient.IS_QUIRKS||10>document.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?c.style.background="url('"+Dialog.prototype.noColorImage+"')":c.style.backgroundColor=""==a.fill?mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#000000":"#ffffff"):a.fill||mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==
-uiTheme?"#000000":"#ffffff"),c.style.border=a.stroke==mxConstants.NONE?"1px solid transparent":""==a.stroke?"1px solid "+mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#000000":"#ffffff"):"1px solid "+(a.stroke||mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#000000":"#ffffff"));else{var b=mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"#ffffff"),g=mxUtils.getValue(f.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,
-"#000000");c.style.backgroundColor=b;c.style.border="1px solid "+g}d.appendChild(c)}d.innerHTML="";for(var b=0;b<a.length;b++)0<b&&0==mxUtils.mod(b,4)&&mxUtils.br(d),c(a[b])}function b(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var f=this.editorUi.editor.graph,d=document.createElement("div");d.style.whiteSpace="nowrap";d.style.paddingLeft="24px";d.style.paddingRight="20px";a.style.paddingLeft="16px";
-a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(d);var e="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" ");null==this.editorUi.currentScheme&&(this.editorUi.currentScheme=0);var g=document.createElement("div");g.style.cssText="position:absolute;left:10px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";
-mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));var l=document.createElement("div");l.style.cssText="position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";
-1<this.defaultColorSchemes.length&&(a.appendChild(g),a.appendChild(l));mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);c(this.defaultColorSchemes[this.editorUi.currentScheme])}));b(g);b(l);c(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var c=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&&
-(b=mxUtils.button(mxResources.get("editStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("editStyle").funct()})),b.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),b.style.width="202px",b.style.marginBottom="2px",a.appendChild(b));var f=this.editorUi.editor.graph,d=f.view.getState(f.getSelectionCell());1==f.getSelectionCount()&&null!=d&&null!=d.shape&&null!=d.shape.stencil?(c=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,
-function(a){this.editorUi.actions.get("editShape").funct()})),c.setAttribute("title",mxResources.get("editShape")),c.style.marginBottom="2px",null==b?c.style.width="202px":(b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c)):c.image&&(c=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,function(a){this.editorUi.actions.get("image").funct()})),c.setAttribute("title",mxResources.get("editImage")),c.style.marginBottom="2px",null==b?c.style.width="202px":
-(b.style.width="100px",c.style.width="100px",c.style.marginLeft="2px"),a.appendChild(c));return a}}Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="dropShadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize=
-"3";Graph.prototype.edgeMode="move"!=urlParams.edge;var g=Graph.prototype.init;Graph.prototype.init=function(){function a(a){c=a;try{if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)c=document.createEventObject(a),c.type=a.type,c.canBubble=a.canBubble,c.cancelable=a.cancelable,c.view=a.view,c.detail=a.detail,c.screenX=a.screenX,c.screenY=a.screenY,c.clientX=a.clientX,c.clientY=a.clientY,c.ctrlKey=a.ctrlKey,c.altKey=a.altKey,c.shiftKey=a.shiftKey,c.metaKey=a.metaKey,c.button=
-a.button,c.relatedTarget=a.relatedTarget}catch(H){}}g.apply(this,arguments);var c=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){c=null});this.isMouseInsertPoint=function(){return null!=c};var b=this.getInsertPoint;this.getInsertPoint=function(){return null!=c?this.getPointForEvent(c):b.apply(this,arguments)};var f=this.layoutManager.getLayout;this.layoutManager.getLayout=function(a){var c=
-this.graph.view.getState(a),c=null!=c?c.style:this.graph.getCellStyle(a);if(null!=c){if("undefined"!=typeof mxRackContainer&&"rack"==c.childLayout){var b=new mxStackLayout(this.graph,!1);b.setChildGeometry=function(a,c){c.height=Math.max(c.height,20);if(1<c.height/20){var b=c.height%20;c.height+=10<b?20-b:-b}this.graph.getModel().setGeometry(a,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 y=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){y.apply(this,arguments);if(mxClient.IS_GC&&null!=this.getDrawPane()){var a=this.getDrawPane().parentNode;!this.graph.mathEnabled||mxClient.NO_FO||
+stroke:"#36393d"},{fill:"#ffff88",stroke:"#36393d"},{fill:"#cdeb8b",stroke:"#36393d"},{fill:"#ffcccc",stroke:"#36393d"}]];StyleFormatPanel.prototype.customColorSchemes=null;StyleFormatPanel.prototype.findCommonProperties=function(a,d,b){if(null!=d){var c=function(a){if(null!=a)if(b)for(var c=0;c<a.length;c++)d[a[c].name]=a[c];else for(var f in d){for(var e=!1,c=0;c<a.length;c++)if(a[c].name==f&&a[c].type==d[f].type){e=!0;break}e||delete d[f]}},f=this.editorUi.editor.graph.view.getState(a);null!=f&&
+null!=f.shape&&(f.shape.commonCustomPropAdded||(f.shape.commonCustomPropAdded=!0,f.shape.customProperties=f.shape.customProperties||[],f.cell.vertex?Array.prototype.push.apply(f.shape.customProperties,Editor.commonVertexProperties):Array.prototype.push.apply(f.shape.customProperties,Editor.commonEdgeProperties)),c(f.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{c(JSON.parse(a))}catch(H){}}};var d=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=
+this.format.createSelectionState();"image"!=a.style.shape&&this.container.appendChild(this.addStyles(this.createPanel()));d.apply(this,arguments);if(Editor.enableCustomProperties){for(var b={},c=a.vertices,f=a.edges,e=0;e<c.length;e++)this.findCommonProperties(c[e],b,0==e);for(e=0;e<f.length;e++)this.findCommonProperties(f[e],b,0==c.length&&0==e);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(b).length&&this.container.appendChild(this.addProperties(this.createPanel(),b,a))}};var f=
+StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(a){var d=mxUtils.button(mxResources.get("copyStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("copyStyle").funct()}));d.setAttribute("title",mxResources.get("copyStyle")+" ("+this.editorUi.actions.get("copyStyle").shortcut+")");d.style.marginBottom="2px";d.style.width="100px";d.style.marginRight="2px";a.appendChild(d);d=mxUtils.button(mxResources.get("pasteStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("pasteStyle").funct()}));
+d.setAttribute("title",mxResources.get("pasteStyle")+" ("+this.editorUi.actions.get("pasteStyle").shortcut+")");d.style.marginBottom="2px";d.style.width="100px";a.appendChild(d);mxUtils.br(a);return f.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,d,b){function c(a,d,b,c){u.getModel().beginUpdate();try{var f=[],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<g.length?null!=c?g.splice(c,1):g[b.index]=d:g.push(d);null!=b.size&&g.length>b.size&&(g=g.slice(0,b.size));d=g.join(",");null!=b.countProperty&&(u.setCellStyles(b.countProperty,g.length,u.getSelectionCells()),f.push(b.countProperty),e.push(g.length))}u.setCellStyles(a,d,u.getSelectionCells());f.push(a);e.push(d);if(null!=b.dependentProps)for(a=0;a<b.dependentProps.length;a++){var p=b.dependentPropsDefVal[a],n=b.dependentPropsVals[a];if(n.length>d)n=n.slice(0,d);else for(var k=
+n.length;k<d;k++)n.push(p);n=n.join(",");u.setCellStyles(b.dependentProps[a],n,u.getSelectionCells());f.push(b.dependentProps[a]);e.push(n)}r.editorUi.fireEvent(new mxEventObject("styleChanged","keys",f,"values",e,"cells",u.getSelectionCells()))}finally{u.getModel().endUpdate()}}function f(d,b,c){var f=mxUtils.getOffset(a,!0),e=mxUtils.getOffset(d,!0);b.style.position="absolute";b.style.left=e.x-f.x+"px";b.style.top=e.y-f.y+"px";b.style.width=d.offsetWidth+"px";b.style.height=d.offsetHeight-(c?4:
+0)+"px";b.style.zIndex=5}function e(a,d,b){var f=document.createElement("div");f.style.width="32px";f.style.height="4px";f.style.margin="2px";f.style.border="1px solid black";f.style.background=d&&"none"!=d?d:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(r,function(e){this.editorUi.pickColor(d,function(d){f.style.background="none"==d?"url('"+Dialog.prototype.noColorImage+"')":d;c(a,d,b)});mxEvent.consume(e)}));btn.style.height="12px";btn.style.width="40px";btn.className=
+"geColorBtn";btn.appendChild(f);return btn}function g(a,d,b,f,e,g,l){null!=d&&(d=d.split(","),k.push({name:a,values:d,type:b,defVal:f,countProperty:e,parentRow:g,isDeletable:!0,flipBkg:l}));btn=mxUtils.button("+",mxUtils.bind(r,function(d){for(var p=g,r=0;null!=p.nextSibling;)if(p.nextSibling.getAttribute("data-pName")==a)p=p.nextSibling,r++;else break;var u={type:b,parentRow:g,index:r,isDeletable:!0,defVal:f,countProperty:e},r=n(a,"",u,0==r%2,l);c(a,f,u);p.parentNode.insertBefore(r,p.nextSibling);
+mxEvent.consume(d)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function l(a,d,b,c,f,e,g){if(0<f){var l=Array(f);d=null!=d?d.split(","):[];for(var p=0;p<f;p++)l[p]=null!=d[p]?d[p]:null!=c?c:"";k.push({name:a,values:l,type:b,defVal:c,parentRow:e,flipBkg:g,size:f})}return document.createElement("div")}function p(a,d,b){var f=document.createElement("input");f.type="checkbox";f.checked="1"==d;mxEvent.addListener(f,"change",function(){c(a,f.checked?"1":"0",b)});
+return f}function n(d,b,n,u,k){var y=n.dispName,x=n.type,m=document.createElement("tr");m.className="gePropRow"+(k?"Dark":"")+(u?"Alt":"")+" gePropNonHeaderRow";m.setAttribute("data-pName",d);m.setAttribute("data-pValue",b);u=!1;null!=n.index&&(m.setAttribute("data-index",n.index),y=(null!=y?y:"")+"["+n.index+"]",u=!0);var z=document.createElement("td");z.className="gePropRowCell";z.innerHTML=mxUtils.htmlEntities(mxResources.get(y,null,y));u&&(z.style.textAlign="right");m.appendChild(z);z=document.createElement("td");
+z.className="gePropRowCell";if("color"==x)z.appendChild(e(d,b,n));else if("bool"==x||"boolean"==x)z.appendChild(p(d,b,n));else if("enum"==x){var B=n.enumList;for(k=0;k<B.length;k++)if(y=B[k],y.val==b){z.innerHTML=mxUtils.htmlEntities(mxResources.get(y.dispName,null,y.dispName));break}mxEvent.addListener(z,"click",mxUtils.bind(r,function(){var e=document.createElement("select");f(z,e);for(var g=0;g<B.length;g++){var l=B[g],p=document.createElement("option");p.value=mxUtils.htmlEntities(l.val);p.innerHTML=
+mxUtils.htmlEntities(mxResources.get(l.dispName,null,l.dispName));e.appendChild(p)}e.value=b;a.appendChild(e);mxEvent.addListener(e,"change",function(){var a=mxUtils.htmlEntities(e.value);c(d,a,n)});e.focus();mxEvent.addListener(e,"blur",function(){a.removeChild(e)})}))}else"dynamicArr"==x?z.appendChild(g(d,b,n.subType,n.subDefVal,n.countProperty,m,k)):"staticArr"==x?z.appendChild(l(d,b,n.subType,n.subDefVal,n.size,m,k)):(z.innerHTML=b,mxEvent.addListener(z,"click",mxUtils.bind(r,function(){function e(){var a=
+g.value,a=0==a.length&&"string"!=x?0:a;n.allowAuto&&("auto"==a.trim().toLowerCase()?(a="auto",x="string"):(a=parseFloat(a),a=isNaN(a)?0:a));null!=n.min&&a<n.min?a=n.min:null!=n.max&&a>n.max&&(a=n.max);a=mxUtils.htmlEntities(("int"==x?parseInt(a):a)+"");c(d,a,n)}var g=document.createElement("input");f(z,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){c(d,"",n,n.index);mxEvent.consume(a)})),k.style.height="16px",k.style.width="25px",k.style["float"]="right",k.className="geColorBtn",z.appendChild(k));m.appendChild(z);return m}var r=this,u=this.editorUi.editor.graph,k=[];a.style.position="relative";a.style.padding="0";var y=document.createElement("table");
+y.style.whiteSpace="nowrap";y.style.width="100%";var x=document.createElement("tr");x.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"));x.style.cursor="pointer";var q=function(){var d=y.querySelectorAll(".gePropNonHeaderRow"),b;if(r.editorUi.propertiesCollapsed){z.src=Sidebar.prototype.collapsedImage;b="none";for(var c=a.childNodes.length-
+1;0<=c;c--)try{var f=a.childNodes[c],e=f.nodeName.toUpperCase();"INPUT"!=e&&"SELECT"!=e||a.removeChild(f)}catch(Z){}}else z.src=Sidebar.prototype.expandedImage,b="";for(c=0;c<d.length;c++)d[c].style.display=b};mxEvent.addListener(x,"click",function(){r.editorUi.propertiesCollapsed=!r.editorUi.propertiesCollapsed;q()});x.appendChild(m);m=document.createElement("th");m.className="gePropHeaderCell";m.innerHTML=mxResources.get("value");x.appendChild(m);y.appendChild(x);var C=!1,G=!1,E;for(E in d)if(x=
+d[E],"function"!=typeof x.isVisible||x.isVisible(b)){var t=null!=b.style[E]?mxUtils.htmlEntities(b.style[E]+""):x.defVal;if("separator"==x.type)G=!G;else{if("staticArr"==x.type)x.size=parseInt(b.style[x.sizeProperty]||d[x.sizeProperty].defVal)||0;else if(null!=x.dependentProps){for(var v=x.dependentProps,Q=[],A=[],m=0;m<v.length;m++){var F=b.style[v[m]];A.push(d[v[m]].subDefVal);Q.push(null!=F?F.split(","):[])}x.dependentPropsDefVal=A;x.dependentPropsVals=Q}y.appendChild(n(E,t,x,C,G));C=!C}}for(m=
+0;m<k.length;m++)for(x=k[m],d=x.parentRow,b=0;b<x.values.length;b++)E=n(x.name,x.values[b],{type:x.type,parentRow:x.parentRow,isDeletable:x.isDeletable,index:b,defVal:x.defVal,countProperty:x.countProperty,size:x.size},0==b%2,x.flipBkg),d.parentNode.insertBefore(E,d.nextSibling),d=E;a.appendChild(y);q();return a};StyleFormatPanel.prototype.addStyles=function(a){function d(a){function d(a){var d=mxUtils.button("",function(d){c.getModel().beginUpdate();try{var b=c.getSelectionCells();for(d=0;d<b.length;d++){for(var f=
+c.getModel().getStyle(b[d]),g=0;g<e.length;g++)f=mxUtils.removeStylename(f,e[g]);var l=c.getModel().isVertex(b[d])?c.defaultVertexStyle:c.defaultEdgeStyle;null!=a?(f=mxUtils.setStyle(f,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(l,mxConstants.STYLE_GRADIENTCOLOR,null)),f=""==a.fill?mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(l,mxConstants.STYLE_FILLCOLOR,null)),f=""==a.stroke?mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,
+null):mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,a.stroke||mxUtils.getValue(l,mxConstants.STYLE_STROKECOLOR,null)),c.getModel().isVertex(b[d])&&(f=mxUtils.setStyle(f,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(l,mxConstants.STYLE_FONTCOLOR,null)))):(f=mxUtils.setStyle(f,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(l,mxConstants.STYLE_FILLCOLOR,"#ffffff")),f=mxUtils.setStyle(f,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(l,mxConstants.STYLE_STROKECOLOR,"#000000")),f=mxUtils.setStyle(f,
+mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(l,mxConstants.STYLE_GRADIENTCOLOR,null)),c.getModel().isVertex(b[d])&&(f=mxUtils.setStyle(f,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(l,mxConstants.STYLE_FONTCOLOR,null))));c.getModel().setStyle(b[d],f)}}finally{c.getModel().endUpdate()}});d.className="geStyleButton";d.style.width="36px";d.style.height="30px";d.style.margin="0px 6px 6px 0px";if(null!=a)null!=a.gradient?mxClient.IS_IE&&(mxClient.IS_QUIRKS||10>document.documentMode)?d.style.filter=
+"progid:DXImageTransform.Microsoft.Gradient(StartColorStr='"+a.fill+"', EndColorStr='"+a.gradient+"', GradientType=0)":d.style.backgroundImage="linear-gradient("+a.fill+" 0px,"+a.gradient+" 100%)":a.fill==mxConstants.NONE?d.style.background="url('"+Dialog.prototype.noColorImage+"')":d.style.backgroundColor=""==a.fill?mxUtils.getValue(c.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==uiTheme?"#000000":"#ffffff"):a.fill||mxUtils.getValue(c.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"dark"==
+uiTheme?"#000000":"#ffffff"),d.style.border=a.stroke==mxConstants.NONE?"1px solid transparent":""==a.stroke?"1px solid "+mxUtils.getValue(c.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#000000":"#ffffff"):"1px solid "+(a.stroke||mxUtils.getValue(c.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,"dark"!=uiTheme?"#000000":"#ffffff"));else{var b=mxUtils.getValue(c.defaultVertexStyle,mxConstants.STYLE_FILLCOLOR,"#ffffff"),g=mxUtils.getValue(c.defaultVertexStyle,mxConstants.STYLE_STROKECOLOR,
+"#000000");d.style.backgroundColor=b;d.style.border="1px solid "+g}f.appendChild(d)}f.innerHTML="";for(var b=0;b<a.length;b++)0<b&&0==mxUtils.mod(b,4)&&mxUtils.br(f),d(a[b])}function b(a){mxEvent.addListener(a,"mouseenter",function(){a.style.opacity="1"});mxEvent.addListener(a,"mouseleave",function(){a.style.opacity="0.5"})}var c=this.editorUi.editor.graph,f=document.createElement("div");f.style.whiteSpace="nowrap";f.style.paddingLeft="24px";f.style.paddingRight="20px";a.style.paddingLeft="16px";
+a.style.paddingBottom="6px";a.style.position="relative";a.appendChild(f);var e="plain-gray plain-blue plain-green plain-turquoise plain-orange plain-yellow plain-red plain-pink plain-purple gray blue green turquoise orange yellow red pink purple".split(" ");null==this.editorUi.currentScheme&&(this.editorUi.currentScheme=0);var g=document.createElement("div");g.style.cssText="position:absolute;left:10px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ4eHh3d3d1dXVxcXF2dnZ2dnZ2dnZxcXF2dnYmb3w1AAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADRJREFUCNdjwACMAmBKaiGYs2oJmLPKAZ3DabU8AMRTXpUKopislqFyVzCAuUZgikkBZjoAcMYLnp53P/UAAAAASUVORK5CYII=);";
+mxEvent.addListener(g,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme-1,this.defaultColorSchemes.length);d(this.defaultColorSchemes[this.editorUi.currentScheme])}));var l=document.createElement("div");l.style.cssText="position:absolute;left:202px;top:8px;bottom:8px;width:20px;margin:4px;opacity:0.5;background-repeat:no-repeat;background-position:center center;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYBuwCcAAAACnRSTlMAfCTkhhvb7cQSPH2JPgAAADZJREFUCNdjQAOMAmBKaiGY8loF5rKswsZlrVo8AUiFrTICcbIWK8A5DF1gDoMymMPApIAwHwCS0Qx/U7qCBQAAAABJRU5ErkJggg==);";
+1<this.defaultColorSchemes.length&&(a.appendChild(g),a.appendChild(l));mxEvent.addListener(l,"click",mxUtils.bind(this,function(){this.editorUi.currentScheme=mxUtils.mod(this.editorUi.currentScheme+1,this.defaultColorSchemes.length);d(this.defaultColorSchemes[this.editorUi.currentScheme])}));b(g);b(l);d(this.defaultColorSchemes[this.editorUi.currentScheme]);return a};StyleFormatPanel.prototype.addEditOps=function(a){var d=this.format.getSelectionState(),b=null;1==this.editorUi.editor.graph.getSelectionCount()&&
+(b=mxUtils.button(mxResources.get("editStyle"),mxUtils.bind(this,function(a){this.editorUi.actions.get("editStyle").funct()})),b.setAttribute("title",mxResources.get("editStyle")+" ("+this.editorUi.actions.get("editStyle").shortcut+")"),b.style.width="202px",b.style.marginBottom="2px",a.appendChild(b));var c=this.editorUi.editor.graph,f=c.view.getState(c.getSelectionCell());1==c.getSelectionCount()&&null!=f&&null!=f.shape&&null!=f.shape.stencil?(d=mxUtils.button(mxResources.get("editShape"),mxUtils.bind(this,
+function(a){this.editorUi.actions.get("editShape").funct()})),d.setAttribute("title",mxResources.get("editShape")),d.style.marginBottom="2px",null==b?d.style.width="202px":(b.style.width="100px",d.style.width="100px",d.style.marginLeft="2px"),a.appendChild(d)):d.image&&(d=mxUtils.button(mxResources.get("editImage"),mxUtils.bind(this,function(a){this.editorUi.actions.get("image").funct()})),d.setAttribute("title",mxResources.get("editImage")),d.style.marginBottom="2px",null==b?d.style.width="202px":
+(b.style.width="100px",d.style.width="100px",d.style.marginLeft="2px"),a.appendChild(d));return a}}Graph.prototype.defaultThemeName="default-style2";Graph.prototype.lastPasteXml=null;Graph.prototype.pasteCounter=0;Graph.prototype.defaultScrollbars="0"!=urlParams.sb;Graph.prototype.defaultPageVisible="0"!=urlParams.pv;Graph.prototype.shadowId="dropShadow";Graph.prototype.svgShadowColor="#3D4574";Graph.prototype.svgShadowOpacity="0.4";Graph.prototype.svgShadowBlur="1.7";Graph.prototype.svgShadowSize=
+"3";Graph.prototype.edgeMode="move"!=urlParams.edge;var g=Graph.prototype.init;Graph.prototype.init=function(){function a(a){d=a;try{if(mxClient.IS_QUIRKS||7==document.documentMode||8==document.documentMode)d=document.createEventObject(a),d.type=a.type,d.canBubble=a.canBubble,d.cancelable=a.cancelable,d.view=a.view,d.detail=a.detail,d.screenX=a.screenX,d.screenY=a.screenY,d.clientX=a.clientX,d.clientY=a.clientY,d.ctrlKey=a.ctrlKey,d.altKey=a.altKey,d.shiftKey=a.shiftKey,d.metaKey=a.metaKey,d.button=
+a.button,d.relatedTarget=a.relatedTarget}catch(H){}}g.apply(this,arguments);var d=null;mxEvent.addListener(this.container,"mouseenter",a);mxEvent.addListener(this.container,"mousemove",a);mxEvent.addListener(this.container,"mouseleave",function(a){d=null});this.isMouseInsertPoint=function(){return null!=d};var b=this.getInsertPoint;this.getInsertPoint=function(){return null!=d?this.getPointForEvent(d):b.apply(this,arguments)};var c=this.layoutManager.getLayout;this.layoutManager.getLayout=function(a){var d=
+this.graph.view.getState(a),d=null!=d?d.style:this.graph.getCellStyle(a);if(null!=d){if("undefined"!=typeof mxRackContainer&&"rack"==d.childLayout){var b=new mxStackLayout(this.graph,!1);b.setChildGeometry=function(a,d){d.height=Math.max(d.height,20);if(1<d.height/20){var b=d.height%20;d.height+=10<b?20-b:-b}this.graph.getModel().setGeometry(a,d)};b.fill=!0;b.unitSize=mxRackContainer.unitSize|20;b.marginLeft=d.marginLeft||0;b.marginRight=d.marginRight||0;b.marginTop=d.marginTop||0;b.marginBottom=
+d.marginBottom||0;b.resizeParent=!1;return b}if("undefined"!=typeof mxTableLayout&&"tableLayout"==d.childLayout)return b=new mxTableLayout(this.graph),b.rows=d.tableRows||2,b.columns=d.tableColumns||2,b.colPercentages=d.colPercentages,b.rowPercentages=d.rowPercentages,b.equalColumns="1"==mxUtils.getValue(d,"equalColumns",b.colPercentages?"0":"1"),b.equalRows="1"==mxUtils.getValue(d,"equalRows",b.rowPercentages?"0":"1"),b.resizeParent="1"==mxUtils.getValue(d,"resizeParent","1"),b.border=d.tableBorder||
+b.border,b.marginLeft=d.marginLeft||0,b.marginRight=d.marginRight||0,b.marginTop=d.marginTop||0,b.marginBottom=d.marginBottom||0,b.autoAddCol="1"==mxUtils.getValue(d,"autoAddCol","0"),b.autoAddRow="1"==mxUtils.getValue(d,"autoAddRow",b.autoAddCol?"0":"1"),b.colWidths=d.colWidths||"100",b.rowHeights=d.rowHeights||"50",b}return c.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 d=this.themes["default-style2"];(new mxCodec(d.ownerDocument)).decode(d,this.getStylesheet());this.refresh()}d=n.apply(this,arguments);null!=a&&(this.stylesheet=a,this.refresh());return d};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 d=p.apply(this,arguments);if(null==d){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&&(d=this.globalUrlVars[a])}return d};var y=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=function(){y.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<a.actions.length;c++)if(null!=a.actions[c].open)if(this.isCustomLink(a.actions[c].open)){if(!this.customLinkClicked(a.actions[c].open))return}else this.openLink(a.actions[c].open);
-this.model.beginUpdate();try{for(c=0;c<a.actions.length;c++)this.handleLinkAction(a.actions[c])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(a){var c=[];null!=a.select&&this.isEnabled()&&(c=this.getCellsForAction(a.select),this.setSelectionCells(c));null!=a.highlight&&(c=this.getCellsForAction(a.highlight),this.highlightCells(c,a.highlight.color,a.highlight.duration,a.highlight.opacity));null!=a.toggle&&this.toggleCells(this.getCellsForAction(a.toggle));null!=a.show&&
-this.setCellsVisible(this.getCellsForAction(a.show),!0);null!=a.hide&&this.setCellsVisible(this.getCellsForAction(a.hide),!1);null!=a.scroll&&(c=this.getCellsForAction(a.scroll));0<c.length&&this.scrollCellToVisible(c[0])};Graph.prototype.getCellsForAction=function(a){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags))};Graph.prototype.getCellsById=function(a){var c=[];if(null!=a)for(var b=0;b<a.length;b++)if("*"==a[b])var f=this.getDefaultParent(),c=c.concat(this.model.filterDescendants(function(a){return a!=
-f},f));else{var d=this.model.getCell(a[b]);null!=d&&c.push(d)}return c};Graph.prototype.getCellsForTags=function(a,c,b){var f=[];if(null!=a){c=null!=c?c:this.model.getDescendants(this.model.getRoot());b=null!=b?b:"tags";for(var d=0;d<c.length;d++)if(this.model.isVertex(c[d])||this.model.isEdge(c[d])){var e=null!=c[d].value&&"object"==typeof c[d].value?mxUtils.trim(c[d].value.getAttribute(b)||""):"",g=!0;if(0<e.length)for(var e=e.toLowerCase().split(" "),l=0;l<a.length&&g;l++)var p=mxUtils.trim(a[l]).toLowerCase(),
-g=g&&(0==p.length||0<=mxUtils.indexOf(e,p));else g=0==a.length;g&&f.push(c[d])}}return f};Graph.prototype.toggleCells=function(a){this.model.beginUpdate();try{for(var c=0;c<a.length;c++)this.model.setVisible(a[c],!this.model.isVisible(a[c]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(a,c){this.model.beginUpdate();try{for(var b=0;b<a.length;b++)this.model.setVisible(a[b],c)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(a,c,b,f){for(var d=0;d<
-a.length;d++)this.highlightCell(a[d],c,b,f)};Graph.prototype.highlightCell=function(a,c,b,f){c=null!=c?c:mxConstants.DEFAULT_VALID_COLOR;b=null!=b?b:1E3;a=this.view.getState(a);if(null!=a){var d=Math.max(5,mxUtils.getValue(a.style,mxConstants.STYLE_STROKEWIDTH,1)+4),e=new mxCellHighlight(this,c,d,!1);null!=f&&(e.opacity=f);e.highlight(a);window.setTimeout(function(){null!=e.shape&&(mxUtils.setPrefixedStyle(e.shape.node.style,"transition","all 1200ms ease-in-out"),e.shape.node.style.opacity=0);window.setTimeout(function(){e.destroy()},
-1200)},b)}};Graph.prototype.addSvgShadow=function(a,c,b){b=null!=b?b:!1;var f=a.ownerDocument,d=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"filter"):f.createElement("filter");d.setAttribute("id",this.shadowId);var e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):f.createElement("feGaussianBlur");e.setAttribute("in","SourceAlpha");e.setAttribute("stdDeviation",this.svgShadowBlur);e.setAttribute("result","blur");d.appendChild(e);e=null!=f.createElementNS?
-f.createElementNS(mxConstants.NS_SVG,"feOffset"):f.createElement("feOffset");e.setAttribute("in","blur");e.setAttribute("dx",this.svgShadowSize);e.setAttribute("dy",this.svgShadowSize);e.setAttribute("result","offsetBlur");d.appendChild(e);e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feFlood"):f.createElement("feFlood");e.setAttribute("flood-color",this.svgShadowColor);e.setAttribute("flood-opacity",this.svgShadowOpacity);e.setAttribute("result","offsetColor");d.appendChild(e);
-e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feComposite"):f.createElement("feComposite");e.setAttribute("in","offsetColor");e.setAttribute("in2","offsetBlur");e.setAttribute("operator","in");e.setAttribute("result","offsetBlur");d.appendChild(e);e=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"feBlend"):f.createElement("feBlend");e.setAttribute("in","SourceGraphic");e.setAttribute("in2","offsetBlur");d.appendChild(e);e=a.getElementsByTagName("defs");0==e.length?
-(f=null!=f.createElementNS?f.createElementNS(mxConstants.NS_SVG,"defs"):f.createElement("defs"),null!=a.firstChild?a.insertBefore(f,a.firstChild):a.appendChild(f)):f=e[0];f.appendChild(d);b||(c=null!=c?c:a.getElementsByTagName("g")[0],null!=c&&(c.setAttribute("filter","url(#"+this.shadowId+")"),isNaN(parseInt(a.getAttribute("width")))||(a.setAttribute("width",parseInt(a.getAttribute("width"))+6),a.setAttribute("height",parseInt(a.getAttribute("height"))+6),c=a.getAttribute("viewBox"),null!=c&&0<c.length&&
-(c=c.split(" "),3<c.length&&(w=parseFloat(c[2])+6,h=parseFloat(c[3])+6,a.setAttribute("viewBox",c[0]+" "+c[1]+" "+w+" "+h))))));return d};Graph.prototype.setShadowVisible=function(a,c){mxClient.IS_SVG&&(c=null!=c?c:!0,(this.shadowVisible=a)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),c&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var a=
-this.model.getChildCount(this.model.root),c,b=0;do c=this.model.getChildAt(this.model.root,b);while(b++<a&&"1"==mxUtils.getValue(this.getCellStyle(c),"locked","0"));null!=c&&this.setDefaultParent(c)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/bpmn/mxBpmnShape2.js",
+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 d=0;d<a.actions.length;d++)if(null!=a.actions[d].open)if(this.isCustomLink(a.actions[d].open)){if(!this.customLinkClicked(a.actions[d].open))return}else this.openLink(a.actions[d].open);
+this.model.beginUpdate();try{for(d=0;d<a.actions.length;d++)this.handleLinkAction(a.actions[d])}finally{this.model.endUpdate()}}};Graph.prototype.handleLinkAction=function(a){var d=[];null!=a.select&&this.isEnabled()&&(d=this.getCellsForAction(a.select),this.setSelectionCells(d));null!=a.highlight&&(d=this.getCellsForAction(a.highlight),this.highlightCells(d,a.highlight.color,a.highlight.duration,a.highlight.opacity));null!=a.toggle&&this.toggleCells(this.getCellsForAction(a.toggle));null!=a.show&&
+this.setCellsVisible(this.getCellsForAction(a.show),!0);null!=a.hide&&this.setCellsVisible(this.getCellsForAction(a.hide),!1);null!=a.scroll&&(d=this.getCellsForAction(a.scroll));0<d.length&&this.scrollCellToVisible(d[0])};Graph.prototype.getCellsForAction=function(a){return this.getCellsById(a.cells).concat(this.getCellsForTags(a.tags))};Graph.prototype.getCellsById=function(a){var d=[];if(null!=a)for(var b=0;b<a.length;b++)if("*"==a[b])var c=this.getDefaultParent(),d=d.concat(this.model.filterDescendants(function(a){return a!=
+c},c));else{var f=this.model.getCell(a[b]);null!=f&&d.push(f)}return d};Graph.prototype.getCellsForTags=function(a,d,b){var c=[];if(null!=a){d=null!=d?d:this.model.getDescendants(this.model.getRoot());b=null!=b?b:"tags";for(var f=0;f<d.length;f++)if(this.model.isVertex(d[f])||this.model.isEdge(d[f])){var e=null!=d[f].value&&"object"==typeof d[f].value?mxUtils.trim(d[f].value.getAttribute(b)||""):"",g=!0;if(0<e.length)for(var e=e.toLowerCase().split(" "),l=0;l<a.length&&g;l++)var p=mxUtils.trim(a[l]).toLowerCase(),
+g=g&&(0==p.length||0<=mxUtils.indexOf(e,p));else g=0==a.length;g&&c.push(d[f])}}return c};Graph.prototype.toggleCells=function(a){this.model.beginUpdate();try{for(var d=0;d<a.length;d++)this.model.setVisible(a[d],!this.model.isVisible(a[d]))}finally{this.model.endUpdate()}};Graph.prototype.setCellsVisible=function(a,d){this.model.beginUpdate();try{for(var b=0;b<a.length;b++)this.model.setVisible(a[b],d)}finally{this.model.endUpdate()}};Graph.prototype.highlightCells=function(a,d,b,c){for(var f=0;f<
+a.length;f++)this.highlightCell(a[f],d,b,c)};Graph.prototype.highlightCell=function(a,d,b,c){d=null!=d?d:mxConstants.DEFAULT_VALID_COLOR;b=null!=b?b:1E3;a=this.view.getState(a);if(null!=a){var f=Math.max(5,mxUtils.getValue(a.style,mxConstants.STYLE_STROKEWIDTH,1)+4),e=new mxCellHighlight(this,d,f,!1);null!=c&&(e.opacity=c);e.highlight(a);window.setTimeout(function(){null!=e.shape&&(mxUtils.setPrefixedStyle(e.shape.node.style,"transition","all 1200ms ease-in-out"),e.shape.node.style.opacity=0);window.setTimeout(function(){e.destroy()},
+1200)},b)}};Graph.prototype.addSvgShadow=function(a,d,b){b=null!=b?b:!1;var c=a.ownerDocument,f=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"filter"):c.createElement("filter");f.setAttribute("id",this.shadowId);var e=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"feGaussianBlur"):c.createElement("feGaussianBlur");e.setAttribute("in","SourceAlpha");e.setAttribute("stdDeviation",this.svgShadowBlur);e.setAttribute("result","blur");f.appendChild(e);e=null!=c.createElementNS?
+c.createElementNS(mxConstants.NS_SVG,"feOffset"):c.createElement("feOffset");e.setAttribute("in","blur");e.setAttribute("dx",this.svgShadowSize);e.setAttribute("dy",this.svgShadowSize);e.setAttribute("result","offsetBlur");f.appendChild(e);e=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"feFlood"):c.createElement("feFlood");e.setAttribute("flood-color",this.svgShadowColor);e.setAttribute("flood-opacity",this.svgShadowOpacity);e.setAttribute("result","offsetColor");f.appendChild(e);
+e=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"feComposite"):c.createElement("feComposite");e.setAttribute("in","offsetColor");e.setAttribute("in2","offsetBlur");e.setAttribute("operator","in");e.setAttribute("result","offsetBlur");f.appendChild(e);e=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"feBlend"):c.createElement("feBlend");e.setAttribute("in","SourceGraphic");e.setAttribute("in2","offsetBlur");f.appendChild(e);e=a.getElementsByTagName("defs");0==e.length?
+(c=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"defs"):c.createElement("defs"),null!=a.firstChild?a.insertBefore(c,a.firstChild):a.appendChild(c)):c=e[0];c.appendChild(f);b||(d=null!=d?d:a.getElementsByTagName("g")[0],null!=d&&(d.setAttribute("filter","url(#"+this.shadowId+")"),isNaN(parseInt(a.getAttribute("width")))||(a.setAttribute("width",parseInt(a.getAttribute("width"))+6),a.setAttribute("height",parseInt(a.getAttribute("height"))+6),d=a.getAttribute("viewBox"),null!=d&&0<d.length&&
+(d=d.split(" "),3<d.length&&(w=parseFloat(d[2])+6,h=parseFloat(d[3])+6,a.setAttribute("viewBox",d[0]+" "+d[1]+" "+w+" "+h))))));return f};Graph.prototype.setShadowVisible=function(a,d){mxClient.IS_SVG&&(d=null!=d?d:!0,(this.shadowVisible=a)?this.view.getDrawPane().setAttribute("filter","url(#"+this.shadowId+")"):this.view.getDrawPane().removeAttribute("filter"),d&&this.fireEvent(new mxEventObject("shadowVisibleChanged")))};Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var a=
+this.model.getChildCount(this.model.root),d,b=0;do d=this.model.getChildAt(this.model.root,b);while(b++<a&&"1"==mxUtils.getValue(this.getCellStyle(d),"locked","0"));null!=d&&this.setDefaultParent(d)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+"/mxAtlassian.js"];mxStencilRegistry.libraries.bpmn=[SHAPES_PATH+"/bpmn/mxBpmnShape2.js",
STENCIL_PATH+"/bpmn.xml"];mxStencilRegistry.libraries.dfd=[SHAPES_PATH+"/mxDFD.js"];mxStencilRegistry.libraries.er=[SHAPES_PATH+"/er/mxER.js"];mxStencilRegistry.libraries.flowchart=[SHAPES_PATH+"/mxFlowchart.js",STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mockup/mxMockupiOS.js"];mxStencilRegistry.libraries.rackGeneral=[SHAPES_PATH+"/rack/mxRack.js",STENCIL_PATH+"/rack/general.xml"];mxStencilRegistry.libraries.rackF5=[STENCIL_PATH+"/rack/f5.xml"];mxStencilRegistry.libraries.lean_mapping=
[SHAPES_PATH+"/mxLeanMap.js",STENCIL_PATH+"/lean_mapping.xml"];mxStencilRegistry.libraries.basic=[SHAPES_PATH+"/mxBasic.js",STENCIL_PATH+"/basic.xml"];mxStencilRegistry.libraries.ios7icons=[STENCIL_PATH+"/ios7/icons.xml"];mxStencilRegistry.libraries.ios7ui=[SHAPES_PATH+"/ios7/mxIOS7Ui.js",STENCIL_PATH+"/ios7/misc.xml"];mxStencilRegistry.libraries.android=[SHAPES_PATH+"/mxAndroid.js",STENCIL_PATH+"/android/android.xml"];mxStencilRegistry.libraries["electrical/transmission"]=[SHAPES_PATH+"/mxElectrical.js",
STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries["electrical/logic_gates"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/logic_gates.xml"];mxStencilRegistry.libraries["electrical/abstract"]=[SHAPES_PATH+"/mxElectrical.js",STENCIL_PATH+"/electrical/abstract.xml"];mxStencilRegistry.libraries.infographic=[SHAPES_PATH+"/mxInfographic.js"];mxStencilRegistry.libraries["mockup/buttons"]=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries["mockup/containers"]=
@@ -2880,15 +2880,15 @@ STENCIL_PATH+"/electrical/transmission.xml"];mxStencilRegistry.libraries["electr
[SHAPES_PATH+"/mockup/mxMockupNavigation.js",STENCIL_PATH+"/mockup/misc.xml"];mxStencilRegistry.libraries["mockup/text"]=[SHAPES_PATH+"/mockup/mxMockupText.js"];mxStencilRegistry.libraries.floorplan=[SHAPES_PATH+"/mxFloorplan.js",STENCIL_PATH+"/floorplan.xml"];mxStencilRegistry.libraries.bootstrap=[SHAPES_PATH+"/mxBootstrap.js",STENCIL_PATH+"/bootstrap.xml"];mxStencilRegistry.libraries.gmdl=[SHAPES_PATH+"/mxGmdl.js",STENCIL_PATH+"/gmdl.xml"];mxStencilRegistry.libraries.gcp2=[SHAPES_PATH+"/mxGCP2.js",
STENCIL_PATH+"/gcp2.xml"];mxStencilRegistry.libraries.cabinets=[SHAPES_PATH+"/mxCabinets.js",STENCIL_PATH+"/cabinets.xml"];mxStencilRegistry.libraries.archimate=[SHAPES_PATH+"/mxArchiMate.js"];mxStencilRegistry.libraries.archimate3=[SHAPES_PATH+"/mxArchiMate3.js"];mxStencilRegistry.libraries.sysml=[SHAPES_PATH+"/mxSysML.js"];mxStencilRegistry.libraries.eip=[SHAPES_PATH+"/mxEip.js",STENCIL_PATH+"/eip.xml"];mxStencilRegistry.libraries.networks=[SHAPES_PATH+"/mxNetworks.js",STENCIL_PATH+"/networks.xml"];
mxStencilRegistry.libraries.aws3d=[SHAPES_PATH+"/mxAWS3D.js",STENCIL_PATH+"/aws3d.xml"];mxStencilRegistry.libraries.aws4=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.aws4b=[SHAPES_PATH+"/mxAWS4.js",STENCIL_PATH+"/aws4.xml"];mxStencilRegistry.libraries.veeam=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam.xml"];mxStencilRegistry.libraries.pid2inst=[SHAPES_PATH+"/pid2/mxPidInstruments.js"];mxStencilRegistry.libraries.pid2misc=
-[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var c=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?c="mxgraph.er":"sysML"==a.substring(0,5)&&(c="mxgraph.sysml"));return c};var u=mxMarker.createMarker;mxMarker.createMarker=function(a,c,b,f,d,e,g,l,p,n){if(null!=b&&null==mxMarker.markers[b]){var k=
-this.getPackageForType(b);null!=k&&mxStencilRegistry.getStencil(k)}return u.apply(this,arguments)};PrintDialog.prototype.create=function(a,c){function b(){r.value=Math.max(1,Math.min(l,Math.max(parseInt(r.value),parseInt(y.value))));y.value=Math.max(1,Math.min(l,Math.min(parseInt(r.value),parseInt(y.value))))}function f(c){function b(c,b,d){var e=c.getGraphBounds(),g=0,l=0,n=ga.get(),p=1/c.pageScale,u=q.checked;if(u)var p=parseInt(P.value),k=parseInt(ca.value),p=Math.min(n.height*k/(e.height/c.view.scale),
-n.width*p/(e.width/c.view.scale));else p=parseInt(z.value)/(100*c.pageScale),isNaN(p)&&(f=1/c.pageScale,z.value="100 %");n=mxRectangle.fromRectangle(n);n.width=Math.ceil(n.width*f);n.height=Math.ceil(n.height*f);p*=f;!u&&c.pageVisible?(e=c.getPageLayout(),g-=e.x*n.width,l-=e.y*n.height):u=!0;if(null==b){b=PrintDialog.createPrintPreview(c,p,n,0,g,l,u);b.pageSelector=!1;b.mathEnabled=!1;c=a.getCurrentFile();null!=c&&(b.title=c.getTitle());var y=b.writeHead;b.writeHead=function(c){y.apply(this,arguments);
-null!=a.editor.fontCss&&(c.writeln('<style type="text/css">'),c.writeln(a.editor.fontCss),c.writeln("</style>"))};if("undefined"!==typeof MathJax){var x=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=x.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=y.value,g=r.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 x=k;x<=l;x++){var m=a.pages[x],e=m==a.currentPage?d:null;if(null==e){var e=a.createTemporaryGraph(d.getStylesheet()),
+[SHAPES_PATH+"/pid2/mxPidMisc.js",STENCIL_PATH+"/pid/misc.xml"];mxStencilRegistry.libraries.pid2valves=[SHAPES_PATH+"/pid2/mxPidValves.js"];mxStencilRegistry.libraries.pidFlowSensors=[STENCIL_PATH+"/pid/flow_sensors.xml"];mxMarker.getPackageForType=function(a){var d=null;null!=a&&0<a.length&&("ER"==a.substring(0,2)?d="mxgraph.er":"sysML"==a.substring(0,5)&&(d="mxgraph.sysml"));return d};var u=mxMarker.createMarker;mxMarker.createMarker=function(a,d,b,c,f,e,g,l,p,n){if(null!=b&&null==mxMarker.markers[b]){var k=
+this.getPackageForType(b);null!=k&&mxStencilRegistry.getStencil(k)}return u.apply(this,arguments)};PrintDialog.prototype.create=function(a,d){function b(){r.value=Math.max(1,Math.min(l,Math.max(parseInt(r.value),parseInt(y.value))));y.value=Math.max(1,Math.min(l,Math.min(parseInt(r.value),parseInt(y.value))))}function c(d){function b(d,b,f){var e=d.getGraphBounds(),g=0,l=0,n=ga.get(),p=1/d.pageScale,u=q.checked;if(u)var p=parseInt(P.value),k=parseInt(ca.value),p=Math.min(n.height*k/(e.height/d.view.scale),
+n.width*p/(e.width/d.view.scale));else p=parseInt(z.value)/(100*d.pageScale),isNaN(p)&&(c=1/d.pageScale,z.value="100 %");n=mxRectangle.fromRectangle(n);n.width=Math.ceil(n.width*c);n.height=Math.ceil(n.height*c);p*=c;!u&&d.pageVisible?(e=d.getPageLayout(),g-=e.x*n.width,l-=e.y*n.height):u=!0;if(null==b){b=PrintDialog.createPrintPreview(d,p,n,0,g,l,u);b.pageSelector=!1;b.mathEnabled=!1;d=a.getCurrentFile();null!=d&&(b.title=d.getTitle());var y=b.writeHead;b.writeHead=function(d){y.apply(this,arguments);
+null!=a.editor.fontCss&&(d.writeln('<style type="text/css">'),d.writeln(a.editor.fontCss),d.writeln("</style>"))};if("undefined"!==typeof MathJax){var x=b.renderPage;b.renderPage=function(a,d,b,c,f,e){var g=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;var l=x.apply(this,arguments);mxClient.NO_FO=g;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:l.className="geDisableMathJax";return l}}b.open(null,null,f,!0)}else{n=
+d.background;if(null==n||""==n||n==mxConstants.NONE)n="#ffffff";b.backgroundColor=n;b.autoOrigin=u;b.appendGraph(d,p,g,l,f,!0)}return b}var c=parseInt(W.value)/100;isNaN(c)&&(c=1,W.value="100 %");var c=.75*c,e=y.value,g=r.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 x=k;x<=l;x++){var m=a.pages[x],e=m==a.currentPage?f:null;if(null==e){var e=a.createTemporaryGraph(f.getStylesheet()),
g=!0,k=!1,G=null,B=null;null==m.viewState&&null==m.root&&a.updatePageRoot(m);null!=m.viewState&&(g=m.viewState.pageVisible,k=m.viewState.mathEnabled,G=m.viewState.background,B=m.viewState.backgroundImage);e.background=G;e.backgroundImage=null!=B?new mxImage(B.src,B.width,B.height):null;e.pageVisible=g;e.mathEnabled=k;var E=e.getGlobalVariable;e.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?x+1:E.apply(this,arguments)};document.body.appendChild(e.container);a.updatePageRoot(m);
-e.model.setRoot(m.root)}n=b(e,n,x!=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('<script type="text/x-mathjax-config">'),l.writeln("MathJax.Hub.Config({"),l.writeln("showMathMenu: false,"),l.writeln('messageStyle: "none",'),l.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),l.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),
-l.writeln('"HTML-CSS": {'),l.writeln("imageFont: null"),l.writeln("},"),l.writeln("TeX: {"),l.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),l.writeln("},"),l.writeln("tex2jax: {"),l.writeln('\tignoreClass: "geDisableMathJax"'),l.writeln("},"),l.writeln("asciimath2jax: {"),l.writeln('\tignoreClass: "geDisableMathJax"'),l.writeln("}"),l.writeln("});"),c&&(l.writeln("MathJax.Hub.Queue(function () {"),l.writeln("window.print();"),l.writeln("});")),l.writeln("\x3c/script>"),
-l.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>')),n.closeDocument(),!n.mathEnabled&&c&&PrintDialog.printPreview(n))}var d=a.editor.graph,e=document.createElement("div"),g=document.createElement("h3");g.style.width="100%";g.style.textAlign="center";g.style.marginTop="0px";mxUtils.write(g,c||mxResources.get("print"));e.appendChild(g);var l=1,p=1,n=document.createElement("div");n.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";
+e.model.setRoot(m.root)}n=b(e,n,x!=l);e!=f&&e.container.parentNode.removeChild(e.container)}}else n=b(f);null==n?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(n.mathEnabled&&(l=n.wnd.document,l.writeln('<script type="text/x-mathjax-config">'),l.writeln("MathJax.Hub.Config({"),l.writeln("showMathMenu: false,"),l.writeln('messageStyle: "none",'),l.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/HTML-CSS"],'),l.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),
+l.writeln('"HTML-CSS": {'),l.writeln("imageFont: null"),l.writeln("},"),l.writeln("TeX: {"),l.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),l.writeln("},"),l.writeln("tex2jax: {"),l.writeln('\tignoreClass: "geDisableMathJax"'),l.writeln("},"),l.writeln("asciimath2jax: {"),l.writeln('\tignoreClass: "geDisableMathJax"'),l.writeln("}"),l.writeln("});"),d&&(l.writeln("MathJax.Hub.Queue(function () {"),l.writeln("window.print();"),l.writeln("});")),l.writeln("\x3c/script>"),
+l.writeln('<script type="text/javascript" src="https://math.draw.io/current/MathJax.js">\x3c/script>')),n.closeDocument(),!n.mathEnabled&&d&&PrintDialog.printPreview(n))}var f=a.editor.graph,e=document.createElement("div"),g=document.createElement("h3");g.style.width="100%";g.style.textAlign="center";g.style.marginTop="0px";mxUtils.write(g,d||mxResources.get("print"));e.appendChild(g);var l=1,p=1,n=document.createElement("div");n.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";
var u=document.createElement("input");u.style.cssText="margin-right:8px;margin-bottom:8px;";u.setAttribute("value","all");u.setAttribute("type","radio");u.setAttribute("name","pages-printdialog");n.appendChild(u);g=document.createElement("span");mxUtils.write(g,mxResources.get("printAllPages"));n.appendChild(g);mxUtils.br(n);var k=u.cloneNode(!0);u.setAttribute("checked","checked");k.setAttribute("value","range");n.appendChild(k);g=document.createElement("span");mxUtils.write(g,mxResources.get("pages")+
":");n.appendChild(g);var y=document.createElement("input");y.style.cssText="margin:0 8px 0 8px;";y.setAttribute("value","1");y.setAttribute("type","number");y.setAttribute("min","1");y.style.width="50px";n.appendChild(y);g=document.createElement("span");mxUtils.write(g,mxResources.get("to"));n.appendChild(g);var r=y.cloneNode(!0);n.appendChild(r);mxEvent.addListener(y,"focus",function(){k.checked=!0});mxEvent.addListener(r,"focus",function(){k.checked=!0});mxEvent.addListener(y,"change",b);mxEvent.addListener(r,
"change",b);if(null!=a.pages&&(l=a.pages.length,null!=a.currentPage))for(g=0;g<a.pages.length;g++)if(a.currentPage==a.pages[g]){p=g+1;y.value=p;r.value=p;break}y.setAttribute("max",l);r.setAttribute("max",l);1<l&&e.appendChild(n);var x=document.createElement("div");x.style.marginBottom="10px";var m=document.createElement("input");m.style.marginRight="8px";m.setAttribute("value","adjust");m.setAttribute("type","radio");m.setAttribute("name","printZoom");x.appendChild(m);g=document.createElement("span");
@@ -2897,346 +2897,347 @@ g.appendChild(q);n.appendChild(g);x=document.createElement("table");x.style.disp
"1");P.setAttribute("min","1");P.setAttribute("type","number");P.style.width="40px";v.appendChild(P);g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsAcross"));A.appendChild(g);mxUtils.write(fa,mxResources.get("fitToBy"));var ca=P.cloneNode(!0);F.appendChild(ca);mxEvent.addListener(P,"focus",function(){q.checked=!0});mxEvent.addListener(ca,"focus",function(){q.checked=!0});g=document.createElement("span");mxUtils.write(g,mxResources.get("fitToSheetsDown"));ja.appendChild(g);
E.appendChild(C);E.appendChild(v);E.appendChild(A);t.appendChild(fa);t.appendChild(F);t.appendChild(ja);G.appendChild(E);G.appendChild(t);x.appendChild(G);n.appendChild(x);e.appendChild(n);n=document.createElement("div");g=document.createElement("div");g.style.fontWeight="bold";g.style.marginBottom="12px";mxUtils.write(g,mxResources.get("paperSize"));n.appendChild(g);g=document.createElement("div");g.style.marginBottom="12px";var ga=PageSetupDialog.addPageFormatPanel(g,"printdialog",a.editor.graph.pageFormat||
mxConstants.PAGE_FORMAT_A4_PORTRAIT);n.appendChild(g);g=document.createElement("span");mxUtils.write(g,mxResources.get("pageScale"));n.appendChild(g);var W=document.createElement("input");W.style.cssText="margin:0 8px 0 8px;";W.setAttribute("value","100 %");W.style.width="60px";n.appendChild(W);e.appendChild(n);g=document.createElement("div");g.style.cssText="text-align:right;margin:48px 0 0 0;";n=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});n.className="geBtn";a.editor.cancelFirst&&
-g.appendChild(n);a.isOffline()||(x=mxUtils.button(mxResources.get("help"),function(){d.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),x.className="geBtn",g.appendChild(x));PrintDialog.previewEnabled&&(x=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();f(!1)}),x.className="geBtn",g.appendChild(x));x=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();f(!0)});x.className="geBtn gePrimaryBtn";g.appendChild(x);
+g.appendChild(n);a.isOffline()||(x=mxUtils.button(mxResources.get("help"),function(){f.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),x.className="geBtn",g.appendChild(x));PrintDialog.previewEnabled&&(x=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();c(!1)}),x.className="geBtn",g.appendChild(x));x=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?"print":"ok"),function(){a.hideDialog();c(!0)});x.className="geBtn gePrimaryBtn";g.appendChild(x);
a.editor.cancelFirst||g.appendChild(n);e.appendChild(g);this.container=e};var G=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=
this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(G.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),this.shadowVisible=!this.shadowVisible))};Editor.prototype.useCanvasForExport=!1;try{var z=
document.createElement("canvas"),E=new Image;E.onload=function(){try{z.getContext("2d").drawImage(E,0,0);var a=z.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(C){}};E.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(r){}})();
-var ErrorDialog=function(a,b,e,d,k,m,q,t,v,A,c){v=null!=v?v:!0;var f=document.createElement("div");f.style.textAlign="center";if(null!=b){var g=document.createElement("div");g.style.padding="0px";g.style.margin="0px";g.style.fontSize="18px";g.style.paddingBottom="16px";g.style.marginBottom="10px";g.style.borderBottom="1px solid #c0c0c0";g.style.color="gray";g.style.whiteSpace="nowrap";g.style.textOverflow="ellipsis";g.style.overflow="hidden";mxUtils.write(g,b);g.setAttribute("title",b);f.appendChild(g)}b=
-document.createElement("div");b.style.lineHeight="1.2em";b.style.padding="6px";b.innerHTML=e;f.appendChild(b);e=document.createElement("div");e.style.marginTop="12px";e.style.textAlign="center";null!=m&&(b=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();m()}),b.className="geBtn",e.appendChild(b),e.style.textAlign="center");null!=A&&(A=mxUtils.button(A,function(){null!=c&&c()}),A.className="geBtn",e.appendChild(A));var n=mxUtils.button(d,function(){v&&a.hideDialog();null!=k&&k()});
-n.className="geBtn";e.appendChild(n);null!=q&&(d=mxUtils.button(q,function(){v&&a.hideDialog();null!=t&&t()}),d.className="geBtn gePrimaryBtn",e.appendChild(d));this.init=function(){n.focus()};f.appendChild(e);this.container=f};
-(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,e,d){d.ui=a.ui;return e};a.afterDecode=function(a,e,d){d.previousColor=d.color;d.previousImage=d.image;d.previousFormat=d.format;null!=d.foldingEnabled&&(d.foldingEnabled=!d.foldingEnabled);null!=d.mathEnabled&&(d.mathEnabled=!d.mathEnabled);null!=d.shadowVisible&&(d.shadowVisible=!d.shadowVisible);return d};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="@DRAWIO-VERSION@";EditorUi.compactUi="atlas"!=uiTheme;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,d,e,l){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,d,e,l);else if(EditorUi.enableLogging)try{if(a!=
-EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&null!=a&&0>a.indexOf("DocumentClosedError")){EditorUi.lastErrorMessage=a;var c=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";l=null!=l?l:Error(a);(new Image).src=f+"/log?severity="+c+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+
-encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(d)+(null!=e?":colno:"+encodeURIComponent(e):"")+(null!=l&&null!=l.stack?"&stack="+encodeURIComponent(l.stack):"")}}catch(x){}};EditorUi.logEvent=function(a){if("1"==urlParams.dev)EditorUi.debug("logEvent",a);else if(EditorUi.enableLogging)try{var c=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):
+var ErrorDialog=function(a,b,e,c,k,m,q,t,v,A,d){v=null!=v?v:!0;var f=document.createElement("div");f.style.textAlign="center";if(null!=b){var g=document.createElement("div");g.style.padding="0px";g.style.margin="0px";g.style.fontSize="18px";g.style.paddingBottom="16px";g.style.marginBottom="10px";g.style.borderBottom="1px solid #c0c0c0";g.style.color="gray";g.style.whiteSpace="nowrap";g.style.textOverflow="ellipsis";g.style.overflow="hidden";mxUtils.write(g,b);g.setAttribute("title",b);f.appendChild(g)}b=
+document.createElement("div");b.style.lineHeight="1.2em";b.style.padding="6px";b.innerHTML=e;f.appendChild(b);e=document.createElement("div");e.style.marginTop="12px";e.style.textAlign="center";null!=m&&(b=mxUtils.button(mxResources.get("tryAgain"),function(){a.hideDialog();m()}),b.className="geBtn",e.appendChild(b),e.style.textAlign="center");null!=A&&(A=mxUtils.button(A,function(){null!=d&&d()}),A.className="geBtn",e.appendChild(A));var n=mxUtils.button(c,function(){v&&a.hideDialog();null!=k&&k()});
+n.className="geBtn";e.appendChild(n);null!=q&&(c=mxUtils.button(q,function(){v&&a.hideDialog();null!=t&&t()}),c.className="geBtn gePrimaryBtn",e.appendChild(c));this.init=function(){n.focus()};f.appendChild(e);this.container=f};
+(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,e,c){c.ui=a.ui;return e};a.afterDecode=function(a,e,c){c.previousColor=c.color;c.previousImage=c.image;c.previousFormat=c.format;null!=c.foldingEnabled&&(c.foldingEnabled=!c.foldingEnabled);null!=c.mathEnabled&&(c.mathEnabled=!c.mathEnabled);null!=c.shadowVisible&&(c.shadowVisible=!c.shadowVisible);return c};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="@DRAWIO-VERSION@";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,e,l){if("1"==urlParams.dev)EditorUi.debug("logError",a,b,c,e,l);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 d=0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE",f=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";l=null!=l?l:Error(a);(new Image).src=f+"/log?severity="+d+"&v="+encodeURIComponent(EditorUi.VERSION)+"&msg=clientError:"+
+encodeURIComponent(a)+":url:"+encodeURIComponent(window.location.href)+":lnum:"+encodeURIComponent(c)+(null!=e?":colno:"+encodeURIComponent(e):"")+(null!=l&&null!=l.stack?"&stack="+encodeURIComponent(l.stack):"")}}catch(x){}};EditorUi.logEvent=function(a){if("1"==urlParams.dev)EditorUi.debug("logEvent",a);else if(EditorUi.enableLogging)try{var d=null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=d+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):
"")}catch(g){}};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(g){}};EditorUi.debug=function(){try{if(null!=window.console&&"1"==urlParams.dev){for(var a=[(new Date).toISOString()],b=0;b<arguments.length;b++)a.push(arguments[b]);
console.log.apply(console,a)}}catch(g){}};EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":"https://rt.draw.io/cache";EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.prototype.emptyDiagramXml='<mxGraphModel><root><mxCell id="0"/><mxCell id="1" parent="0"/></root></mxGraphModel>';
EditorUi.prototype.emptyLibraryXml="<mxlibrary>[]</mxlibrary>";EditorUi.prototype.mode=null;EditorUi.prototype.timeout=25E3;EditorUi.prototype.sidebarFooterHeight=38;EditorUi.prototype.defaultCustomShapeStyle="shape=stencil(tZRtTsQgEEBPw1+DJR7AoN6DbWftpAgE0Ortd/jYRGq72R+YNE2YgTePloEJGWblgA18ZuKFDcMj5/Sm8boZq+BgjCX4pTyqk6ZlKROitwusOMXKQDODx5iy4pXxZ5qTHiFHawxB0JrQZH7lCabQ0Fr+XWC1/E8zcsT/gAi+Subo2/3Mh6d/oJb5nU1b5tW7r2knautaa3T+U32o7f7vZwpJkaNDLORJjcu7t59m2jXxqX9un+tt022acsfmoKaQZ+vhhswZtS6Ne/ThQGt0IV0N3Yyv6P3CeT9/tHO0XFI5cAE=);whiteSpace=wrap;html=1;";
EditorUi.prototype.svgBrokenImage=Graph.createSvgImage(10,10,'<rect x="0" y="0" width="10" height="10" stroke="#000" fill="transparent"/><path d="m 0 0 L 10 10 L 0 10 L 10 0" stroke="#000" fill="transparent"/>');EditorUi.prototype.crossOriginImages=!mxClient.IS_IE;EditorUi.prototype.maxBackgroundSize=1600;EditorUi.prototype.maxImageSize=520;EditorUi.prototype.resampleThreshold=1E5;EditorUi.prototype.maxImageBytes=1E6;EditorUi.prototype.maxBackgroundBytes=25E5;EditorUi.prototype.currentFile=null;EditorUi.prototype.printPdfExport=
-!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(l){}try{var b=document.createElement("canvas"),d=new Image;d.onload=function(){try{b.getContext("2d").drawImage(d,
-0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(p){}};d.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(l){}try{b=document.createElement("canvas");b.width=b.height=1;var e=
-b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==e.match("image/jpeg")}catch(l){}})();EditorUi.prototype.openLink=function(a,b,d){return this.editor.graph.openLink(a,b,d)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,d){localStorage.setItem(a,b);null!=d&&d()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};EditorUi.prototype.setMathEnabled=
+!1;EditorUi.prototype.pdfPageExport=!0;EditorUi.prototype.formatEnabled="0"!=urlParams.format;EditorUi.prototype.insertTemplateEnabled=!0;EditorUi.prototype.closableScratchpad=!0;(function(){EditorUi.prototype.useCanvasForExport=!1;EditorUi.prototype.jpgSupported=!1;try{var a=document.createElement("canvas");EditorUi.prototype.canvasSupported=!(!a.getContext||!a.getContext("2d"))}catch(l){}try{var b=document.createElement("canvas"),c=new Image;c.onload=function(){try{b.getContext("2d").drawImage(c,
+0,0);var a=b.toDataURL("image/png");EditorUi.prototype.useCanvasForExport=null!=a&&6<a.length}catch(p){}};c.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(l){}try{b=document.createElement("canvas");b.width=b.height=1;var e=
+b.toDataURL("image/jpeg");EditorUi.prototype.jpgSupported=null!==e.match("image/jpeg")}catch(l){}})();EditorUi.prototype.openLink=function(a,b,c){return this.editor.graph.openLink(a,b,c)};EditorUi.prototype.showSplash=function(a){};EditorUi.prototype.getLocalData=function(a,b){b(localStorage.getItem(a))};EditorUi.prototype.setLocalData=function(a,b,c){localStorage.setItem(a,b);null!=c&&c()};EditorUi.prototype.removeLocalData=function(a,b){localStorage.removeItem(a);b()};EditorUi.prototype.setMathEnabled=
function(a){this.editor.graph.mathEnabled=a;this.editor.updateGraphComponents();this.editor.graph.refresh();this.fireEvent(new mxEventObject("mathEnabledChanged"))};EditorUi.prototype.isMathEnabled=function(a){return this.editor.graph.mathEnabled};EditorUi.prototype.isAppCache=function(){return"1"==urlParams.appcache||this.isOfflineApp()};EditorUi.prototype.isOfflineApp=function(){return"1"==urlParams.offline};EditorUi.prototype.isOffline=function(){return this.isOfflineApp()||!navigator.onLine||
-"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,d){d=null!=d?d:24;var c=new Spinner({lines:12,length:d,width:Math.round(d/3),radius:Math.round(d/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),f=c.spin;c.spin=function(d,e){var g=!1;this.active||(f.call(this,d),this.active=!0,null!=e&&(g=document.createElement("div"),g.style.position="absolute",g.style.whiteSpace="nowrap",g.style.background="#4B4243",g.style.color="white",
+"1"==urlParams.stealth};EditorUi.prototype.createSpinner=function(a,b,c){c=null!=c?c:24;var d=new Spinner({lines:12,length:c,width:Math.round(c/3),radius:Math.round(c/2),rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,zIndex:2E9}),f=d.spin;d.spin=function(c,e){var g=!1;this.active||(f.call(this,c),this.active=!0,null!=e&&(g=document.createElement("div"),g.style.position="absolute",g.style.whiteSpace="nowrap",g.style.background="#4B4243",g.style.color="white",
g.style.fontFamily="Helvetica, Arial",g.style.fontSize="9pt",g.style.padding="6px",g.style.paddingLeft="10px",g.style.paddingRight="10px",g.style.zIndex=2E9,g.style.left=Math.max(0,a)+"px",g.style.top=Math.max(0,b+70)+"px",mxUtils.setPrefixedStyle(g.style,"borderRadius","6px"),mxUtils.setPrefixedStyle(g.style,"transform","translate(-50%,-50%)"),"dark"!=uiTheme&&mxUtils.setPrefixedStyle(g.style,"boxShadow","2px 2px 3px 0px #ddd"),"..."!=e.substring(e.length-3,e.length)&&"!"!=e.charAt(e.length-1)&&
-(e+="..."),g.innerHTML=e,d.appendChild(g),c.status=g,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(g.style.left=Math.round(Math.max(0,a-g.offsetWidth/2))+"px",g.style.top=Math.round(Math.max(0,b+70-g.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(d,e)}));this.stop();return a}),g=!0);return g};var e=c.stop;c.stop=function(){e.call(this);this.active=!1;null!=c.status&&(c.status.parentNode.removeChild(c.status),
-c.status=null)};c.pause=function(){return function(){}};return c};EditorUi.parsePng=function(a,b,d){function c(a,c){var b=e;e+=c;return a.substring(b,e)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=d&&d();else if(c(a,4),"IHDR"!=c(a,4))null!=d&&d();else{c(a,17);do{d=f(a);var g=c(a,4);if(null!=b&&b(e-8,g,d))break;value=c(a,d);c(a,4);if("IEND"==g)break}while(d)}};
-EditorUi.prototype.isCompatibleString=function(a){try{var c=mxUtils.parseXml(a),b=this.editor.extractGraphModel(c.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(n){}return!1};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(c){var b=a.apply(this,arguments);if(null==b)try{var d=c.indexOf("&lt;mxfile ");if(0<=d){var e=c.lastIndexOf("&lt;/mxfile&gt;");e>d&&(b=c.substring(d,e+15).replace(/&gt;/g,">").replace(/&lt;/g,
-"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var l=mxUtils.parseXml(c),p=this.editor.extractGraphModel(l.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!=p?mxUtils.getXml(p):""}catch(y){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var c=a.indexOf('<meta charset="utf-8">');0<=c&&(a=a.slice(0,c)+'<meta charset="utf-8"/>'+a.slice(c+23-1,a.length));a=Graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=
-function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a){c=this.editor.graph;c.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,d=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<d.length||1==d.length&&d[0].hasAttribute("name")){this.fileNode=a;this.pages=null!=this.pages?this.pages:[];for(var e=d.length-1;0<=e;e--){var p=this.updatePageRoot(new DiagramPage(d[e]));
-null==p.getName()&&p.setName(mxResources.get("pageWithNumber",[e+1]));c.model.execute(new ChangePage(this,p,0==e?p:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),c.model.execute(new ChangePage(this,this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=
-this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)c.model.execute(new ChangePage(this,b[e],null))}finally{c.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,d,e,l,p,k,x,u,m){b=null!=b?b:this.editor.graph;l=null!=l?l:!1;u=null!=u?u:!0;var c,f=null;null==d||d.getMode()==App.MODE_DEVICE||d.getMode()==App.MODE_BROWSER?c="_blank":f=c=e;if(null==a)return"";var g=a;if("mxfile"!=g.nodeName.toLowerCase()){var n=Graph.zapGremlins(mxUtils.getXml(a)),g=Graph.compress(n);if(Graph.decompress(g)!=
-n)return n;n=a.ownerDocument.createElement("diagram");n.setAttribute("id",Editor.guid());mxUtils.setTextContent(n,g);g=a.ownerDocument.createElement("mxfile");g.appendChild(n)}m?(g=g.cloneNode(!0),g.removeAttribute("userAgent"),g.removeAttribute("version"),g.removeAttribute("editor"),g.removeAttribute("type")):(g.removeAttribute("userAgent"),g.removeAttribute("version"),g.removeAttribute("editor"),g.removeAttribute("type"),g.setAttribute("modified",(new Date).toISOString()),g.setAttribute("host",
-window.location.hostname),g.setAttribute("agent",navigator.userAgent),g.setAttribute("version",EditorUi.VERSION),g.setAttribute("etag",Editor.guid()),a=null!=d?d.getMode():this.mode,null!=a&&g.setAttribute("type",a));a=mxUtils.getXml(g);if(!p&&!l&&(k||null!=d&&/(\.html)$/i.test(d.getTitle())))a=this.getHtml2(mxUtils.getXml(g),b,null!=d?d.getTitle():null,c,f);else if(p||!l&&null!=d&&/(\.svg)$/i.test(d.getTitle()))null==d||d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER||(e=null),a=this.getEmbeddedSvg(a,
-b,e,null,x,u,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var c=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(c=Graph.compressNode(c),mxUtils.setTextContent(this.currentPage.node,c),c=this.fileNode.cloneNode(!1),b)c.appendChild(this.currentPage.node);else for(var f=0;f<this.pages.length;f++){if(this.currentPage!=this.pages[f]&&this.pages[f].needsUpdate){var d=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(this.pages[f].root));
-this.editor.graph.saveViewState(this.pages[f].viewState,d);mxUtils.setTextContent(this.pages[f].node,Graph.compressNode(d));delete this.pages[f].needsUpdate}c.appendChild(this.pages[f].node)}return c};EditorUi.prototype.anonymizeString=function(a,b){for(var c=[],f=0;f<a.length;f++){var d=a.charAt(f);0<=EditorUi.ignoredAnonymizedChars.indexOf(d)?c.push(d):isNaN(parseInt(d))?d.toLowerCase()!=d?c.push(String.fromCharCode(65+Math.round(25*Math.random()))):d.toUpperCase()!=d?c.push(String.fromCharCode(97+
-Math.round(25*Math.random()))):/\s/.test(d)?c.push(" "):c.push("?"):c.push(b?"0":Math.round(9*Math.random()))}return c.join("")};EditorUi.prototype.anonymizePatch=function(a){if(null!=a[EditorUi.DIFF_INSERT])for(var c=0;c<a[EditorUi.DIFF_INSERT].length;c++)try{var b=mxUtils.parseXml(a[EditorUi.DIFF_INSERT][c].data).documentElement.cloneNode(!1);null!=b.getAttribute("name")&&b.setAttribute("name",this.anonymizeString(b.getAttribute("name")));a[EditorUi.DIFF_INSERT][c].data=mxUtils.getXml(b)}catch(p){a[EditorUi.DIFF_INSERT][c].data=
-p.message}if(null!=a[EditorUi.DIFF_UPDATE]){for(var d in a[EditorUi.DIFF_UPDATE]){var e=a[EditorUi.DIFF_UPDATE][d];null!=e.name&&(e.name=this.anonymizeString(e.name));null!=e.cells&&(c=mxUtils.bind(this,function(a){var c=e.cells[a];if(null!=c){for(var b in c)null!=c[b].value&&(c[b].value="["+c[b].value.length+"]"),null!=c[b].xmlValue&&(c[b].xmlValue="["+c[b].xmlValue.length+"]"),null!=c[b].style&&(c[b].style="["+c[b].style.length+"]"),0==Object.keys(c[b]).length&&delete c[b];0==Object.keys(c).length&&
-delete e.cells[a]}}),c(EditorUi.DIFF_INSERT),c(EditorUi.DIFF_UPDATE),0==Object.keys(e.cells).length&&delete e.cells);0==Object.keys(e).length&&delete a[EditorUi.DIFF_UPDATE][d]}0==Object.keys(a[EditorUi.DIFF_UPDATE]).length&&delete a[EditorUi.DIFF_UPDATE]}return a};EditorUi.prototype.anonymizeAttributes=function(a,b){if(null!=a.attributes)for(var c=0;c<a.attributes.length;c++)"as"!=a.attributes[c].name&&a.setAttribute(a.attributes[c].name,this.anonymizeString(a.attributes[c].value,b));if(null!=a.childNodes)for(c=
-0;c<a.childNodes.length;c++)this.anonymizeAttributes(a.childNodes[c],b)};EditorUi.prototype.anonymizeNode=function(a,b){for(var c=a.getElementsByTagName("mxCell"),f=0;f<c.length;f++)null!=c[f].getAttribute("value")&&c[f].setAttribute("value","["+c[f].getAttribute("value").length+"]"),null!=c[f].getAttribute("xmlValue")&&c[f].setAttribute("xmlValue","["+c[f].getAttribute("xmlValue").length+"]"),null!=c[f].getAttribute("style")&&c[f].setAttribute("style","["+c[f].getAttribute("style").length+"]"),null!=
-c[f].parentNode&&"root"!=c[f].parentNode.nodeName&&null!=c[f].parentNode.parentNode&&(c[f].setAttribute("id",c[f].parentNode.getAttribute("id")),c[f].parentNode.parentNode.replaceChild(c[f],c[f].parentNode));return a};EditorUi.prototype.synchronizeCurrentFile=function(a){var c=this.getCurrentFile();null!=c&&(c.savingFile?this.handleError({message:mxResources.get("busy")}):!a&&c.invalidChecksum?c.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(c.clearAutosave(),
-this.editor.setStatus(""),a?c.reloadFile(mxUtils.bind(this,function(){c.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){c.handleFileError(a,!0)})):c.synchronizeFile(mxUtils.bind(this,function(){c.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){c.handleFileError(a,!0)}))))};EditorUi.prototype.getFileData=function(a,b,d,e,l,p,k,x,u){l=null!=l?l:!0;k=null!=k?k:this.getXmlFileData(l,null!=p?p:!1);u=null!=u?u:this.getCurrentFile();p=this.editor.graph;
-if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=u&&/(\.svg)$/i.test(u.getTitle()))){p=this.createTemporaryGraph(p.getStylesheet());var c=p.getGlobalVariable,f=this.pages[0];p.getGlobalVariable=function(a){return"page"==a?f.getName():"pagenumber"==a?1:c.apply(this,arguments)};document.body.appendChild(p.container);p.model.setRoot(f.root)}a=this.createFileData(k,p,u,window.location.href,a,b,d,e,l,x);p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);return a};
-EditorUi.prototype.getHtml=function(a,b,d,e,l,p){p=null!=p?p:!0;var c=null,f=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=b){var c=p?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),g=b.view.scale;p=Math.floor(c.x/g-b.view.translate.x);g=Math.floor(c.y/g-b.view.translate.y);c=b.background;null==l&&(b=this.getBasenames().join(";"),0<b.length&&(f=EditorUi.drawHost+"/embed.js?s="+b));a.setAttribute("x0",p);a.setAttribute("y0",g)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom",
-"1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=e&&a.setAttribute("edit",e));null!=l&&(l=l.replace(/&/g,"&amp;"));a=null!=a?Graph.zapGremlins(mxUtils.getXml(a)):"";e=Graph.compress(a);Graph.decompress(e)!=a&&(e=encodeURIComponent(a));return(null==l?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=l?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+
-(null==l?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=l?'<meta http-equiv="refresh" content="0;URL=\''+l+"'\"/>\n":"")+"</head>\n<body"+(null==l&&null!=c&&c!=mxConstants.NONE?' style="background-color:'+c+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+e+"</div>\n</div>\n"+(null==l?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+
-l+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,d,e,l){b=EditorUi.drawHost+"/js/viewer.min.js";null!=l&&(l=l.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(a),toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==l?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
-"")+"<!DOCTYPE html>\n<html"+(null!=l?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==l?null!=d?"<title>"+mxUtils.htmlEntities(d)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=l?'<meta http-equiv="refresh" content="0;URL=\''+l+"'\"/>\n":"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==l?'<script type="text/javascript" src="'+
-b+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+l+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(a){a=this.validateFileData(a);this.pages=this.fileNode=this.currentPage=null;a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var c=null!=a?a.getElementsByTagName("parsererror"):null;if(null!=c&&0<c.length)throw a=mxResources.get("invalidOrMissingFile"),
-c=c[0].getElementsByTagName("div"),0<c.length&&(a=mxUtils.getTextContent(c[0])),Error(a);c=null!=a?this.editor.extractGraphModel(a,!0):null;null!=c&&(a=c);if(null!=a&&"mxfile"==a.nodeName&&(c=a.getElementsByTagName("diagram"),"0"!=urlParams.pages||1<c.length||1==c.length&&c[0].hasAttribute("name"))){var b=null;this.fileNode=a;this.pages=[];for(a=0;a<c.length;a++){null==c[a].getAttribute("id")&&c[a].setAttribute("id",a);var d=new DiagramPage(c[a]);null==d.getName()&&d.setName(mxResources.get("pageWithNumber",
-[a+1]));this.pages.push(d);null!=urlParams["page-id"]&&d.getId()==urlParams["page-id"]&&(b=d)}this.currentPage=null!=b?b:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];a=this.currentPage.node}"0"!=urlParams.pages&&null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(a);
-null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(a){var c=this.getCurrentFile(),c=null!=c&&null!=c.getTitle()?c.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(c)||/(\.html)$/i.test(c)||/(\.svg)$/i.test(c)||/(\.png)$/i.test(c)||/(\.drawio)$/i.test(c))c=c.substring(0,c.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&
-(c=c+"-"+this.currentPage.getName());return c};EditorUi.prototype.downloadFile=function(a,b,d,e,l,p,k){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var c=this.getBaseFilename(!l),f=c+"."+a;if("xml"==a){var g='<?xml version="1.0" encoding="UTF-8"?>\n'+(b?mxUtils.getXml(this.editor.getGraphXml(e)):this.getFileData(!0,null,null,null,e,l));this.saveData(f,a,g,"text/xml")}else if("html"==a)g=this.getHtml2(this.getFileData(!0),this.editor.graph,c),this.saveData(f,a,g,"text/html");else if("svg"!=
-a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?f=c+".png":"jpeg"==a&&(f=c+".jpg"),this.saveRequest(f,a,mxUtils.bind(this,function(c,b){try{var f=this.editor.graph.pageVisible;null!=p&&(this.editor.graph.pageVisible=p);var d=this.createDownloadRequest(c,a,e,b,k,l);this.editor.graph.pageVisible=f;return d}catch(B){this.handleError(B)}}));else{var n=null,y=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},
-mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(n)}))});if("svg"==a){var m=this.editor.graph.background;if(k||m==mxConstants.NONE)m=null;var q=this.editor.graph.getSvg(m,null,null,null,null,e);d&&this.editor.graph.addSvgShadow(q);this.convertImages(q,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();y('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else f=
-c+".svg",n=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();y(a)}),e)}}catch(Q){this.handleError(Q)}};EditorUi.prototype.createDownloadRequest=function(a,b,d,e,l,p){var c=this.editor.graph.getGraphBounds();d=this.getFileData(!0,null,null,null,d,0==p?!1:"xmlpng"!=b);var f="",g="";if(c.width*c.height>MAX_AREA||d.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};c="0";"pdf"==b&&0==p&&(g="&allPages=1");if("xmlpng"==b&&(c="1",b="png",null!=this.pages&&
-null!=this.currentPage))for(p=0;p<this.pages.length;p++)if(this.pages[p]==this.currentPage){f="&from="+p;break}p=this.editor.graph.background;"png"==b&&l&&(p=mxConstants.NONE);return new mxXmlRequest(EXPORT_URL,"format="+b+f+g+"&bg="+(null!=p?p:mxConstants.NONE)+"&base64="+e+"&embedXml="+c+"&xml="+encodeURIComponent(d)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,d){var c=window.location.hash,
-f=mxUtils.bind(this,function(f){var d=null!=a.data?a.data:"";null!=f&&0<f.length&&(0<d.length&&(d+="\n"),d+=f);f=new LocalFile(this,"csv"!=a.format&&0<d.length?d:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);f.getHash=function(){return c};this.fileLoaded(f);"csv"==a.format&&this.importCsv(d,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var e=null!=a.interval?
-parseInt(a.interval):6E4,g=null,l=mxUtils.bind(this,function(){var c=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){c===this.currentPage&&(200<=a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),p()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),p=mxUtils.bind(this,function(){window.clearTimeout(g);g=window.setTimeout(l,
-e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){p();l()}));p();l()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var e=a.url;/^https?:\/\//.test(e)&&!this.editor.isCorsEnabledForUrl(e)&&(e=PROXY_URL+"?url="+encodeURIComponent(e));this.loadUrl(e,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=d&&d(a)}))}else f("")};EditorUi.prototype.updateDiagram=function(a){function c(a){var c=new mxCellOverlay(a.image||e.warningImage,a.tooltip,a.align,a.valign,
-a.offset);c.addListener(mxEvent.CLICK,function(c,b){d.alert(a.tooltip)});return c}var b=null,d=this;if(null!=a&&0<a.length&&(b=mxUtils.parseXml(a),a=null!=b?b.documentElement:null,null!=a&&"updates"==a.nodeName)){var e=this.editor.graph,p=e.getModel();p.beginUpdate();var k=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var m=p.getCell(a.getAttribute("id"));if(null!=m){try{var u=a.getAttribute("value");if(null!=u){var q=mxUtils.parseXml(u).documentElement;if(null!=q)if("1"==q.getAttribute("replace-value"))p.setValue(m,
-q);else for(var z=q.attributes,E=0;E<z.length;E++)e.setAttributeForCell(m,z[E].nodeName,0<z[E].nodeValue.length?z[E].nodeValue:null)}}catch(I){null!=window.console&&console.log("Error in value for "+m.id+": "+I)}try{var r=a.getAttribute("style");null!=r&&e.model.setStyle(m,r)}catch(I){null!=window.console&&console.log("Error in style for "+m.id+": "+I)}try{var t=a.getAttribute("icon");if(null!=t){var v=0<t.length?JSON.parse(t):null;null!=v&&v.append||e.removeCellOverlays(m);null!=v&&e.addCellOverlay(m,
-c(v))}}catch(I){null!=window.console&&console.log("Error in icon for "+m.id+": "+I)}try{var A=a.getAttribute("geometry");if(null!=A){var A=JSON.parse(A),M=e.getCellGeometry(m);if(null!=M){M=M.clone();for(key in A){var H=parseFloat(A[key]);"dx"==key?M.x+=H:"dy"==key?M.y+=H:"dw"==key?M.width+=H:"dh"==key?M.height+=H:M[key]=parseFloat(A[key])}e.model.setGeometry(m,M)}}}catch(I){null!=window.console&&console.log("Error in icon for "+m.id+": "+I)}}}else if("model"==a.nodeName){for(var B=a.firstChild;null!=
-B&&B.nodeType!=mxConstants.NODETYPE_ELEMENT;)B=B.nextSibling;null!=B&&(new mxCodec(a.firstChild)).decode(B,p)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(e.view.scale=parseFloat(a.getAttribute("scale"))),a.hasAttribute("dx")||a.hasAttribute("dy"))e.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(k=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{p.endUpdate()}null!=
-k&&this.chromelessResize&&this.chromelessResize(!0,k)}return b};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,f="",d=c.lastIndexOf(".");0<=d&&(f=c.substring(d),c=c.substring(0,d));if(b)var e=new Date,d=e.getFullYear(),k=e.getMonth()+1,m=e.getDate(),u=e.getHours(),q=e.getMinutes(),e=e.getSeconds(),c=c+(" "+(d+"-"+k+"-"+m+"-"+u+"-"+q+"-"+e));return c=mxResources.get("copyOf",[c])+f};EditorUi.prototype.fileLoaded=function(a,b){var c=
-this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var f=!1;this.hideDialog();null!=c&&(c.removeListener(this.descriptorChangedListener),c.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=c&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!b&&null!=window.location.hash&&0<window.location.hash.length&&
-(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename")));this.editor.setStatus("");this.updateUi();b||this.showSplash()});if(null!=a)try{mxClient.IS_SF&&"min"==uiTheme&&(this.diagramContainer.style.visibility="");this.openingFile=!0;this.setCurrentFile(a);a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();
-delete this.openingFile;this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();a.isEditable()?a.isModified()?(a.addUnsavedStatus(),null!=a.backupPatch&&a.patch([a.backupPatch])):this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</span>");!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"));f=!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(y){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(y){}}catch(y){this.fileLoadedError=y;null!=window.console&&console.log("error in fileLoaded:",a,y);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!=y&&null!=y.message?":err:"+
-encodeURIComponent(y.message):"")+(null!=y&&null!=y.stack?"&stack="+encodeURIComponent(y.stack):"")}catch(x){}var e=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=c?this.fileLoaded(c):d()});b?e():this.handleError(y,mxResources.get("errorLoadingFile"),e,!0)}else d();return f};EditorUi.prototype.getHashValueForPages=function(a,b){var c=0,f=new mxGraphModel,d=new mxCodec;null!=b&&
-(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0);for(var e=0;e<a.length;e++){this.updatePageRoot(a[e]);var k=a[e].node.cloneNode(!1);k.removeAttribute("name");f.root=a[e].root;var m=d.encode(f);this.editor.graph.saveViewState(a[e].viewState,m,!0);m.removeAttribute("pageWidth");m.removeAttribute("pageHeight");k.appendChild(m);null!=b&&(b.eltCount+=k.getElementsByTagName("*").length,b.nodeCount+=k.getElementsByTagName("mxCell").length);c=(c<<5)-c+this.hashValue(k,function(a,c,b,f){return!f||
-"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=c&&"y"!=c&&"width"!=c&&"height"!=c?f&&"mxCell"==a.nodeName&&"previous"==c?null:b:Math.round(b)},b)<<0}return c};EditorUi.prototype.hashValue=function(a,b,d){var c=0;if(null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(c^=this.hashValue(a.nodeName,b,d));if(null!=a.attributes){null!=d&&(d.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var e=
-a.attributes[f].name,g=null!=b?b(a,e,a.attributes[f].value,!0):a.attributes[f].value;null!=g&&(c^=this.hashValue(e,b,d)+this.hashValue(g,b,d))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)c=(c<<5)-c+this.hashValue(a.childNodes[f],b,d)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=d&&(d.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;c^=b}return c};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};
-EditorUi.prototype.saveLibrary=function(a,b,d,e,l,p,k){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var c=
-mxUtils.createXmlDocument(),b=c.createElement("mxlibrary");mxUtils.setTextContent(b,JSON.stringify(a));c.appendChild(b);return mxUtils.getXml(c)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var c=this.sidebar.palettes[a];if(null!=c){for(var b=0;b<c.length;b++)c[b].parentNode.removeChild(c[b]);
-delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var c=this.sidebar.container;if(null==a){var b=this.sidebar.palettes["L.scratchpad"];null==b&&(b=this.sidebar.palettes.search);null!=b&&(a=b[b.length-1].nextSibling)}a=null!=a?a:c.firstChild.nextSibling.nextSibling;var b=c.lastChild,d=b.previousSibling;c.insertBefore(b,a);c.insertBefore(d,b)};EditorUi.prototype.loadLibrary=function(a){var c=mxUtils.parseXml(a.getData());if("mxlibrary"==c.documentElement.nodeName){var b=
-JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,d){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:
-null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(c,b){0==c.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),f.className="geDropTarget",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f)):this.addLibraryEntries(c,b)});if(null!=this.sidebar&&null!=b)for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b=
-"shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var c=this.stringToCells(Graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),
-d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var u=k.parentNode.previousSibling;d=u.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&u.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var m=document.createElement("div");m.style.position="absolute";m.style.right="0px";m.style.top="0px";m.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(m.style.backgroundColor="inherit");u.style.position="relative";var z=document.createElement("img");
-z.setAttribute("src",Dialog.prototype.closeImage);z.setAttribute("title",mxResources.get("close"));z.setAttribute("valign","absmiddle");z.setAttribute("border","0");z.style.margin="0 3px";var q=null;if(".scratchpad"!=a.title||this.closableScratchpad)m.appendChild(z),mxEvent.addListener(z,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=q?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):
-b();mxEvent.consume(c)}}));if(a.isEditable()){var r=this.editor.graph,t=null,v=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(c)}),A=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t),t=z.cloneNode(!1),t.setAttribute("src",Editor.spinImage),t.setAttribute("title",mxResources.get("saving")),t.style.cursor="default",t.style.marginRight="2px",t.style.marginTop="-2px",m.insertBefore(t,
-m.firstChild),u.style.paddingRight=18*m.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=t&&null!=t.parentNode&&(t.parentNode.removeChild(t),u.style.paddingRight=18*m.childNodes.length+"px")})):null==q&&(q=z.cloneNode(!1),q.setAttribute("src",IMAGE_PATH+"/download.png"),q.setAttribute("title",mxResources.get("save")),m.insertBefore(q,m.firstChild),mxEvent.addListener(q,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==
-LocalLibrary,!0,function(){null==q||a.isModified()||(u.style.paddingRight=18*m.childNodes.length+"px",q.parentNode.removeChild(q),q=null)});mxEvent.consume(c)})),u.style.paddingRight=18*m.childNodes.length+"px")}),M=mxUtils.bind(this,function(a,c,d,e){a=r.cloneCells(mxUtils.sortCells(r.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var l=r.getCellGeometry(a[g]);null!=l&&l.translate(-c.x,-c.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),
-w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);A(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),H=mxUtils.bind(this,function(a){if(r.isSelectionEmpty())r.getRubberband().isActive()?(r.getRubberband().execute(a),r.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=r.getSelectionCells(),b=r.view.getBounds(c),d=r.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=r.view.translate.x;
-b.y-=r.view.translate.y;M(c,b)}mxEvent.consume(a)});mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){r.isMouseDown&&null!=r.panningManager&&null!=r.graphHandler.shape&&(r.graphHandler.shape.node.style.visibility="hidden",k.style.backgroundColor="#f1f3f4",k.style.cursor="copy",r.panningManager.stop(),r.autoScroll=!1,null!=r.graphHandler.guide&&r.graphHandler.guide.setVisible(!1),null!=r.graphHandler.hint&&(r.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),
-mxUtils.bind(this,function(a){r.isMouseDown&&null!=r.panningManager&&null!=r.graphHandler&&(k.style.backgroundColor="",k.style.cursor="default",this.sidebar.showTooltips=!0,r.panningManager.stop(),r.graphHandler.reset(),r.isMouseDown=!1,r.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){r.isMouseDown&&null!=r.graphHandler.shape&&(r.graphHandler.shape.node.style.visibility="visible",k.style.backgroundColor="",k.style.cursor="",r.autoScroll=
-!0,null!=r.graphHandler.guide&&r.graphHandler.guide.setVisible(!0),null!=r.graphHandler.hint&&(r.graphHandler.hint.style.visibility="visible"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){k.style.backgroundColor="#f1f3f4";a.dataTransfer.dropEffect="copy";k.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.cursor="";k.style.backgroundColor="";0<a.dataTransfer.files.length&&
-this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,l,p,n,u,m,y){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,p,n),c)],c[0].vertex=!0,M(c,new mxRectangle(0,0,p,n),a,mxEvent.isAltDown(a)?null:u.substring(0,u.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var r=
-!1,z=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var l=JSON.parse(mxUtils.getTextContent(g.documentElement));e(l,k);b=b.concat(l);A(a);this.spinner.stop();r=!0}catch(F){}else if("mxfile"==g.documentElement.nodeName)try{for(var p=g.documentElement.getElementsByTagName("diagram"),g=0;g<p.length;g++){var l=mxUtils.getTextContent(p[g]),n=this.stringToCells(Graph.decompress(l)),u=this.editor.graph.getBoundingBoxFromGeometry(n);
-M(n,new mxRectangle(0,0,u.width,u.height),a)}r=!0}catch(F){null!=window.console&&console.log("error in drop handler:",F)}}r||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=y&&null!=u&&(/(\.v(dx|sdx?))($|\?)/i.test(u)||/(\.vs(x|sx?))($|\?)/i.test(u))?this.importVisio(y,function(a){z(a,"text/xml")},null,u):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,
-u)&&null!=y?this.parseFile(y,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?z(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):z(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){k.style.cursor="";k.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));z=z.cloneNode(!1);z.setAttribute("src",
-Editor.editImage);z.setAttribute("title",mxResources.get("edit"));m.insertBefore(z,m.firstChild);mxEvent.addListener(z,"click",v);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&v(a)});d=z.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));m.insertBefore(d,m.firstChild);mxEvent.addListener(d,"click",H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",
-mxResources.get("help")),d.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),m.insertBefore(d,m.firstChild))}u.appendChild(m);u.style.paddingRight=18*m.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var c=0;c<a.length;c++){var d=a[c],f=d.data;if(null!=f){var f=this.convertDataUri(f),e="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";
-"fixed"==d.aspect&&(e+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(e+"image="+f,d.w,d.h,"",d.title||"",!1,!1,!0))}else null!=d.xml&&(f=this.stringToCells(Graph.decompress(d.xml)),0<f.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(f,d.w,d.h,d.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=function(a){return null!=a?a[mxLanguage]||a.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.offline||EditorUi.isElectronApp||("1"==urlParams.savesidebar&&
-(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.createFooter=function(){return document.getElementById("geFooter")});EditorUi.initTheme=function(){"atlas"==uiTheme?(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=
-3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor=
-"black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",
-Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))};EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display=
-"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var c=document.getElementById("geFooter");null!=c&&(this.footerHeight=a,c.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,d,e,l){a=new ImageDialog(this,a,b,d,e,l);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=
-!0;this.editor.graph.model.execute(a)});var c=new BackgroundImageDialog(this,mxUtils.bind(this,function(c){a(c)}));this.showDialog(c.container,360,200,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(a,b,d,e,l){a=new LibraryDialog(this,a,b,d,e,l);this.showDialog(a.container,640,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};var b=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(a){var c=
-b.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(a){this.editor.graph.isSelectionEmpty()&&c.refresh()}));return c};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer geSidebarFooter");a.style.position="absolute";a.style.overflow="hidden";var b=document.createElement("a");b.className="geTitle";b.style.color="#188038";b.style.height="100%";b.style.paddingTop="9px";b.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';
-mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,d,e){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=
-b){var g=mxUtils.htmlEntities(mxResources.get("unknownError")),n=mxResources.get("ok"),k=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(n=mxResources.get("cancel"),k=function(){c();f.retry()}),404==f.code||404==f.status||403==f.code){var g=403==f.code?null!=f.message?mxUtils.htmlEntities(f.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")),m=window.location.hash;if(null!=m&&"#G"==m.substring(0,2)&&null!=
-a&&null!=a.error&&null!=a.error.errors&&0<a.error.errors.length&&"fileAccess"==a.error.errors[0].reason){m=m.substring(2);this.showError(b,g,mxResources.get("cancel"),null,k,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+m)}),null,null,380);return}}else null!=f.message?g=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error?g=mxUtils.htmlEntities(f.response.error):"undefined"!==window.App&&(f.code==
-App.ERROR_TIMEOUT?g=mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY&&(g=mxUtils.htmlEntities(mxResources.get("busy"))));this.showError(b,g,n,d,k,null,null,null,null,null,null,null,e?d:null)}else null!=d&&d()};EditorUi.prototype.showError=function(a,b,d,e,l,p,k,m,u,q,z,E,r){a=new ErrorDialog(this,a,b,d||mxResources.get("ok"),e,l,p,k,E,m,u);this.showDialog(a.container,q||340,z||(null!=b&&120<b.length?180:150),!0,!1,r);a.init()};EditorUi.prototype.alert=function(a,b){var c=new ErrorDialog(this,
-null,a,mxResources.get("ok"),b);this.showDialog(c.container,340,100,!0,!1);c.init()};EditorUi.prototype.confirm=function(a,b,d,e,l,p){var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};a=new ConfirmDialog(this,a,function(){c();null!=b&&b()},function(){c();null!=d&&d()},e,l);this.showDialog(a.container,340,90,!0,p);a.init()};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=
-function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,d){var c=a.toDataURL("image/"+d);if(6>=c.length||c==a.cloneNode(!1).toDataURL("image/"+d))throw{message:"Invalid image"};null!=b&&(c=this.writeGraphModelToPng(c,"zTXt","mxGraphModel",atob(Graph.compress(b))));return c};EditorUi.prototype.saveCanvas=
-function(a,b,d){var c="jpeg"==d?"jpg":d,f=this.getBaseFilename()+"."+c;a=this.createImageDataUri(a,b,d);this.saveData(f,c,a.substring(a.lastIndexOf(",")+1),"image/"+d,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=
-function(a,b){var c=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));c.textarea.style.width="600px";c.textarea.style.height="380px";this.showDialog(c.container,620,460,!0,!0);c.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=function(a,b,d,e,l){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,d):new Blob([a],{type:d}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)d=window.open("about:blank","_blank"),null==d?mxUtils.popup(a,
-!0):(d.document.write(a),d.document.close(),d.document.execCommand("SaveAs",!0,b),d.close());else{var c=document.createElement("a"),f=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof c.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),f=65==(g?parseInt(g[2],10):!1)?!1:f;if(f||this.isOffline()){c.href=URL.createObjectURL(e?this.base64ToBlob(a,d):new Blob([a],{type:d}));f?c.download=b:c.setAttribute("target","_blank");document.body.appendChild(c);
-try{window.setTimeout(function(){URL.revokeObjectURL(c.href)},0),c.click(),c.parentNode.removeChild(c)}catch(u){}}else this.createEchoRequest(a,b,d,e,l).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,d,e,l,p){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,a+(null!=d?"&mime="+d:"")+(null!=l?"&format="+l:"")+(null!=p?"&base64="+p:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&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),k=0;k<f;++k){for(var m=1024*k,u=Math.min(m+1024,d),q=Array(u-m),z=0;m<u;++z,++m)q[z]=c[m].charCodeAt(0);e[k]=new Uint8Array(q)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,d,e,l,p,k){p=null!=p?p:!1;k=null!=k?k:"vsdx"!=l&&(!mxClient.IS_IOS||!navigator.standalone);l=this.getServiceCount(p);b=new CreateDialog(this,b,mxUtils.bind(this,function(c,b){try{if("_blank"==b)if(null==d||"image/"!=d.substring(0,6)||
-"image/svg"==d.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,!1)),f.document.close())}else this.openInNewWindow(a,d,e);else b==App.MODE_DEVICE||"download"==b?this.doSaveLocalFile(a,c,d,e):null!=c&&0<c.length&&this.pickFolder(b,mxUtils.bind(this,function(f){try{this.exportFile(a,c,d,e,b,f)}catch(E){this.handleError(E)}}))}catch(z){this.handleError(z)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),
-mxResources.get("download"),!1,p,k,null,1<l,4<l&&(!p||6>l)?3:4,a,d,e);this.showDialog(b.container,420,1==l?160:4<l?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,d){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var c=window.open("about:blank");null==c||null==c.document?mxUtils.popup(a,!0):("image/svg+xml"==b?c.document.write("<html>"+a+"</html>"):c.document.write('<html><img src="data:'+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+
-'"/></html>'),c.document.close())}else c=window.open("data:"+b+(d?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null!=c&&null!=c.document||mxUtils.popup(a,!0)};var e=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var c=a(mxUtils.bind(this,function(a){var b=mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",b);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),
-this.exportDialog=null)});if(null!=this.exportDialog)b.apply(this);else{this.exportDialog=document.createElement("div");var d=c.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign="center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding=
-"4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=d.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";d=mxUtils.getCurrentStyle(this.editor.graph.container);this.exportDialog.style.zIndex=d.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog);
-this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var c=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";a.style.cursor="pointer";a.style.backgroundColor="white";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",c);this.exportDialog.appendChild(a);
-mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(c.substring(c.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}e.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,
-d,e,l){this.isLocalFileSave()?this.saveLocalFile(d,a,e,l,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,c){return this.createEchoRequest(d,a,e,l,b,c)}),d,l,e)};EditorUi.prototype.saveRequest=function(a,b,d,e,l,p,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var c=this.getServiceCount(!1);a=new CreateDialog(this,a,mxUtils.bind(this,function(a,c){if("_blank"==c||null!=a&&0<a.length){var f=d("_blank"==c?null:a,c==App.MODE_DEVICE||"download"==c||null==c||"_blank"==c?"0":"1");null!=f&&(c==
-App.MODE_DEVICE||"download"==c||"_blank"==c?f.simulate(document,"_blank"):this.pickFolder(c,mxUtils.bind(this,function(d){p=null!=p?p:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,p,!0,c,d)}catch(r){this.handleError(r)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,p,!0,c,d)}catch(r){this.handleError(r)}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<c,4<c?3:4,e,p,l);this.showDialog(a.container,380,1==c?160:4<c?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,d,e,l,p){};EditorUi.prototype.pickFolder=function(a,b,d){b(null)};EditorUi.prototype.exportSvg=function(a,b,d,e,l,p,k,
-m,u,q){if(this.spinner.spin(document.body,mxResources.get("export"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;c=b?null:this.editor.graph.background;c==mxConstants.NONE&&(c=null);null==c&&0==b&&(c="#ffffff");var f=this.editor.graph.getSvg(c,a,k,m,null,d,null,null,"blank"==q?"_blank":"self"==q?"_top":null);e&&this.editor.graph.addSvgShadow(f);var g=this.getBaseFilename()+".svg",n=mxUtils.bind(this,function(a){this.spinner.stop();l&&a.setAttribute("content",this.getFileData(!0,null,
-null,null,d,u));if(null!=this.editor.fontCss){var c=a.ownerDocument,c=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"style"):c.createElement("style");c.setAttribute("type","text/css");mxUtils.setTextContent(c,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(c)}var b='<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",b,"image/svg+xml"):
-this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){p?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,n,this.thumbImageCache)):n(f)}))}};EditorUi.prototype.addRadiobox=function(a,b,d,e,l,p,k){return this.addCheckbox(a,d,e,l,p,k,!0,b)};EditorUi.prototype.addCheckbox=function(a,b,d,e,l,p,k,m){p=null!=p?p:!0;var c=document.createElement("input");
-c.style.marginRight="8px";c.style.marginTop="16px";c.setAttribute("type",k?"radio":"checkbox");k="geCheckbox-"+Editor.guid();c.id=k;null!=m&&c.setAttribute("name",m);d&&(c.setAttribute("checked","checked"),c.defaultChecked=!0);e&&c.setAttribute("disabled","disabled");p&&(a.appendChild(c),d=document.createElement("label"),mxUtils.write(d,b),d.setAttribute("for",k),a.appendChild(d),l||mxUtils.br(a));return c};EditorUi.prototype.addEditButton=function(a,b){var c=this.addCheckbox(a,mxResources.get("edit")+
-":",!0,null,!0);c.style.marginLeft="24px";var d=this.getCurrentFile(),f="";null!=d&&d.getMode()!=App.MODE_DEVICE&&d.getMode()!=App.MODE_BROWSER&&(f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";e.className="geBtn";d=document.createElement("option");d.setAttribute("value","blank");mxUtils.write(d,mxResources.get("makeCopy"));e.appendChild(d);d=document.createElement("option");d.setAttribute("value","custom");mxUtils.write(d,
-mxResources.get("custom")+"...");e.appendChild(d);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"==e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(c,"change",mxUtils.bind(this,function(){c.checked&&(null==b||b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled",
-"disabled")}));mxUtils.br(a);return{getLink:function(){return c.checked?"blank"===e.value?"_blank":f:null},getEditInput:function(){return c},getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function c(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=e&&e!=mxConstants.NONE?"border:1px solid black;background-color:"+e:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+
-"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var d=document.createElement("select");d.style.width="100px";d.style.marginLeft="8px";d.style.marginRight="10px";d.className="geBtn";var f=document.createElement("option");f.setAttribute("value","auto");mxUtils.write(f,mxResources.get("automatic"));d.appendChild(f);f=document.createElement("option");f.setAttribute("value","blank");mxUtils.write(f,mxResources.get("openInNewWindow"));d.appendChild(f);f=document.createElement("option");
-f.setAttribute("value","self");mxUtils.write(f,mxResources.get("openInThisWindow"));d.appendChild(f);b&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),d.appendChild(f));a.appendChild(d);mxUtils.write(a,mxResources.get("borderColor")+":");var e="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(e||"none",function(a){e=a;c()});mxEvent.consume(a)}));c();k.style.padding=
-mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return e},getTarget:function(){return d.value},focus:function(){d.focus()}}};EditorUi.prototype.createLink=function(a,b,d,e,l,p,k,m){var c=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+
-a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=l&&0<l.length&&f.push("edit="+encodeURIComponent(l)),p&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));d&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&f.push("page-id="+this.currentPage.getId());a=!0;null!=k?d="#U"+encodeURIComponent(k):(c=this.getCurrentFile(),m||null==c||c.constructor!=window.DriveFile?d="#R"+encodeURIComponent(d?this.getFileData(!0,
-null,null,null,null,null,null,!0):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(d="#"+c.getHash(),a=!1));a&&null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(c.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+d};EditorUi.prototype.createHtml=function(a,b,d,e,l,k,m,x,u,q,z){this.getBasenames();
-var c={};""!=l&&l!=mxConstants.NONE&&(c.highlight=l);"auto"!==e&&(c.target=e);u||(c.lightbox=!1);c.nav=this.editor.graph.foldingEnabled;d=parseInt(d);isNaN(d)||100==d||(c.zoom=d/100);d=[];m&&(d.push("pages"),c.resize=!0,null!=this.pages&&null!=this.currentPage&&(c.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(d.push("zoom"),c.resize=!0);x&&d.push("layers");0<d.length&&(u&&d.push("lightbox"),c.toolbar=d.join(" "));null!=q&&0<q.length&&(c.edit=q);null!=a?c.url=a:c.xml=this.getFileData(!0,
-null,null,null,null,!m);b='<div class="mxgraph" style="'+(k?"max-width:100%;":"")+(""!=d?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(c))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";z(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":EditorUi.drawHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.drawHost+
-"/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var g=document.createElement("div");g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText=
-"margin-right:8px;margin-top:8px;margin-bottom:8px;";k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","type-embedhtmldialog");f=k.cloneNode(!0);f.setAttribute("value","copy");g.appendChild(f);var n=document.createElement("span");mxUtils.write(n,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(n);mxUtils.br(g);g.appendChild(k);n=document.createElement("span");mxUtils.write(n,mxResources.get("publicDiagramUrl"));g.appendChild(n);var m=this.getCurrentFile();
-null==d&&null!=m&&m.constructor==window.DriveFile&&(n=document.createElement("a"),n.style.paddingLeft="12px",n.style.color="gray",n.setAttribute("href","javascript:void(0);"),mxUtils.write(n,mxResources.get("share")),g.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(m.getId())})));f.setAttribute("checked","checked");null==d&&k.setAttribute("disabled","disabled");c.appendChild(g);var z=this.addLinkSection(c),q=this.addCheckbox(c,
-mxResources.get("zoom"),!0,null,!0);mxUtils.write(c,":");var r=document.createElement("input");r.setAttribute("type","text");r.style.marginRight="16px";r.style.width="60px";r.style.marginLeft="4px";r.style.marginRight="12px";r.value="100%";c.appendChild(r);var t=this.addCheckbox(c,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,v=v=this.addCheckbox(c,mxResources.get("allPages"),g,!g),A=this.addCheckbox(c,mxResources.get("layers"),!0),M=this.addCheckbox(c,mxResources.get("lightbox"),
-!0),H=this.addEditButton(c,M),B=H.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(M,"change",function(){M.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&M.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,c,mxUtils.bind(this,function(){e(k.checked?d:null,q.checked,r.value,z.getTarget(),z.getColor(),t.checked,v.checked,A.checked,M.checked,H.getLink())}),null,a,
-b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,d,e,l,k){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(f);var g=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=g&&g.constructor==window.DriveFile&&
-!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));p.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(g.getId())}));n.style.marginTop=
-"12px";n.className="geBtn";p.appendChild(n);c.appendChild(p);n=document.createElement("a");n.style.paddingLeft="12px";n.style.color="gray";n.style.fontSize="11px";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("check"));p.appendChild(n);mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,null,
-mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var m=null,r=null;if(null!=d||null!=e)a+=30,mxUtils.write(c,mxResources.get("width")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",c.appendChild(m),mxUtils.write(c,mxResources.get("height")+":"),
-r=document.createElement("input"),r.setAttribute("type","text"),r.style.width="50px",r.style.marginLeft="6px",r.style.marginBottom="10px",r.value=e+"px",c.appendChild(r),mxUtils.br(c);var q=this.addLinkSection(c,k);d=null!=this.pages&&1<this.pages.length;var t=null;if(null==g||g.constructor!=window.DriveFile||b)t=this.addCheckbox(c,mxResources.get("allPages"),d,!d);var v=this.addCheckbox(c,mxResources.get("lightbox"),!0),A=this.addEditButton(c,v),H=A.getEditInput(),B=this.addCheckbox(c,mxResources.get("layers"),
-!0);B.style.marginLeft=H.style.marginLeft;B.style.marginBottom="16px";B.style.marginTop="8px";mxEvent.addListener(v,"change",function(){v.checked?(B.removeAttribute("disabled"),H.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&v.checked?A.getEditSelect().removeAttribute("disabled"):A.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,function(){l(q.getTarget(),q.getColor(),null==t?
-!0:t.checked,v.checked,A.getLink(),B.checked,null!=m?m.value:null,null!=r?r.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,254+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,d,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,
-mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(f);var g=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),!0),f=this.editor.graph,n=e?null:this.addCheckbox(c,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=n&&(n.style.marginBottom="16px");a=new CustomDialog(this,c,
-mxUtils.bind(this,function(){d(!g.checked,null!=k?k.checked:!1,null!=n?n.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,d,e,l,k,m,q){m=null!=m?m:!0;var c=document.createElement("div");c.style.whiteSpace="nowrap";var f=this.editor.graph,g="jpeg"==q?196:300,p=document.createElement("h3");mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";c.appendChild(p);mxUtils.write(c,mxResources.get("zoom")+
-":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";c.appendChild(n);mxUtils.write(c,mxResources.get("borderWidth")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.marginRight="16px";y.style.width="60px";y.style.marginLeft="4px";y.value=this.lastExportBorder||"0";c.appendChild(y);mxUtils.br(c);var x=this.addCheckbox(c,
-mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=q),t=this.addCheckbox(c,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),v=document.createElement("input");v.style.marginTop="16px";v.style.marginRight="8px";v.style.marginLeft="24px";v.setAttribute("disabled","disabled");v.setAttribute("type","checkbox");k&&(c.appendChild(v),mxUtils.write(c,mxResources.get("crop")),mxUtils.br(c),g+=26,mxEvent.addListener(t,"change",function(){t.checked?v.removeAttribute("disabled"):v.setAttribute("disabled",
-"disabled")}));f.isSelectionEmpty()||(v.setAttribute("checked","checked"),v.defaultChecked=!0);var H=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible),B=document.createElement("input");B.style.marginTop="16px";B.style.marginRight="8px";B.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||B.setAttribute("disabled","disabled");b&&(c.appendChild(B),mxUtils.write(c,mxResources.get("embedImages")),mxUtils.br(c),g+=26);var I=this.addCheckbox(c,mxResources.get("includeCopyOfMyDiagram"),
-m,null,null,"jpeg"!=q),A=null!=this.pages&&1<this.pages.length,V=this.addCheckbox(c,A?mxResources.get("allPages"):"",A,!A,null,"jpeg"!=q);V.style.marginLeft="24px";V.style.marginBottom="16px";A||(V.style.display="none");mxEvent.addListener(I,"change",function(){I.checked&&A?V.removeAttribute("disabled"):V.setAttribute("disabled","disabled")});m&&A||V.setAttribute("disabled","disabled");var U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="8px";U.style.marginRight="10px";
-U.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));U.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));U.appendChild(a);a=document.createElement("option");a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));U.appendChild(a);"svg"==q&&(mxUtils.write(c,mxResources.get("links")+":"),c.appendChild(U),mxUtils.br(c),
-mxUtils.br(c),g+=26);d=new CustomDialog(this,c,mxUtils.bind(this,function(){this.lastExportBorder=y.value;this.lastExportZoom=n.value;l(n.value,x.checked,!t.checked,H.checked,I.checked,B.checked,y.value,v.checked,!V.checked,U.value)}),null,d,e);this.showDialog(d.container,340,g,!0,!0);n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,d,e,l){var c=document.createElement("div");
-c.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";c.appendChild(g)}var k=this.addCheckbox(c,mxResources.get("fit"),!0),n=this.addCheckbox(c,mxResources.get("shadow"),f.shadowVisible&&e,!e),m=this.addCheckbox(c,d),q=this.addCheckbox(c,mxResources.get("lightbox"),!0),r=this.addEditButton(c,q),t=r.getEditInput(),v=1<f.model.getChildCount(f.model.getRoot()),
-A=this.addCheckbox(c,mxResources.get("layers"),v,!v);A.style.marginLeft=t.style.marginLeft;A.style.marginBottom="12px";A.style.marginTop="8px";mxEvent.addListener(q,"change",function(){q.checked?(v&&A.removeAttribute("disabled"),t.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));t.checked&&q.checked?r.getEditSelect().removeAttribute("disabled"):r.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,c,mxUtils.bind(this,
-function(){a(k.checked,n.checked,m.checked,q.checked,r.getLink(),A.checked)}),null,mxResources.get("embed"),l);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,d,e,l,k,m,q){function c(c){var b=" ",g="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
-EditorUi.drawHost+"/?client=1&lightbox=1"+(l?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",g+="cursor:pointer;");a&&(g+="max-width:100%;");var p="";d&&(p=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');m('<img src="'+c+'"'+p+(""!=g?' style="'+g+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");c(a)}),null,null,null,
-mxUtils.bind(this,function(a){q({message:mxResources.get("unknownError")})}),null,!0,d?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var g="";d&&(g="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var p=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+g+"&xml="+encodeURIComponent(b));p.send(mxUtils.bind(this,function(){200<=p.getStatus()&&299>=p.getStatus()?c("data:image/png;base64,"+p.getText()):q({message:mxResources.get("unknownError")})}))}else q({message:mxResources.get("drawingTooLarge")})};
-EditorUi.prototype.createEmbedSvg=function(a,b,d,e,l,k,m){var c=this.editor.graph.getSvg(),f=c.getElementsByTagName("a");if(null!=f)for(var g=0;g<f.length;g++){var p=f[g].getAttribute("href");null!=p&&"#"==p.charAt(0)&&"_blank"==f[g].getAttribute("target")&&f[g].removeAttribute("target")}e&&c.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(c);if(d){var n=" ",r="";e&&(n="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
-EditorUi.drawHost+"/?client=1&lightbox=1"+(l?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",r+="cursor:pointer;");a&&(r+="max-width:100%;");this.convertImages(c,mxUtils.bind(this,function(a){m('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=r?' style="'+r+'"':"")+n+"/>")}))}else r="",e&&(c.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+
-EditorUi.drawHost+"/?client=1&lightbox=1"+(l?"&edit=_blank":"")+(k?"&layers=1":"")+"');}}})(this);"),r+="cursor:pointer;"),a&&(a=parseInt(c.getAttribute("width")),b=parseInt(c.getAttribute("height")),c.setAttribute("viewBox","-0.5 -0.5 "+a+" "+b),r+="max-width:100%;max-height:"+b+"px;",c.removeAttribute("height")),""!=r&&c.setAttribute("style",r),m(mxUtils.getXml(c))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var c=Math.floor(a/31536E3);if(1<c)return c+" "+mxResources.get("years");
-c=Math.floor(a/2592E3);if(1<c)return c+" "+mxResources.get("months");c=Math.floor(a/86400);if(1<c)return c+" "+mxResources.get("days");c=Math.floor(a/3600);if(1<c)return c+" "+mxResources.get("hours");c=Math.floor(a/60);return 1<c?c+" "+mxResources.get("minutes"):1==c?c+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,d,e){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(b),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,
-function(){e()}))}),0)):e()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var c=null;if("diagram"==a.nodeName)c=a;else if("mxfile"==a.nodeName){var d=a.getElementsByTagName("diagram");if(0<d.length){var c=d[0],f=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?c.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:f.apply(this,arguments)}}}null!=c&&(d=Graph.decompress(mxUtils.getTextContent(c)),null!=d&&0<d.length&&(a=mxUtils.parseXml(d).documentElement))}d=
-this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(p){}finally{this.editor.graph=d}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,d){try{var c=this.editor.graph,f=null;if(null!=d&&0<d.length)c=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(c.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(d).documentElement,!0),c),f=d;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var c=this.createTemporaryGraph(c.getStylesheet()),
-e=c.getGlobalVariable,g=this.pages[0];c.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:e.apply(this,arguments)};document.body.appendChild(c.container);c.model.setRoot(g.root)}this.exportToCanvas(mxUtils.bind(this,function(d){try{null==f&&(f=this.getFileData(!0));var e=d.toDataURL("image/png"),e=this.writeGraphModelToPng(e,"zTXt","mxGraphModel",atob(Graph.compress(f)));a(e.substring(e.lastIndexOf(",")+1));c!=this.editor.graph&&c.container.parentNode.removeChild(c.container)}catch(G){null!=
-b&&b(G)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,c.shadowVisible,null,c)}catch(x){null!=b&&b(x)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,d,e,l,k,m){m=b.background;m==mxConstants.NONE&&(m=null);k=b.getSvg(m,null,null,null,null,k);b.shadowVisible&&b.addSvgShadow(k);null!=a&&k.setAttribute("content",a);null!=d&&k.setAttribute("resource",d);if(null!=l)this.convertImages(k,mxUtils.bind(this,function(a){l((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
-mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(k)};EditorUi.prototype.exportImage=function(a,b,d,e,l,k,m,q,u){u=null!=u?u:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var c=this.editor.graph.isSelectionEmpty();d=null!=d?d:c;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();
-try{this.saveCanvas(a,l?this.getFileData(!0,null,null,null,d,q):null,u)}catch(E){"Invalid image"==E.message?this.downloadFile(u):this.handleError(E)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,d,a||1,b,e,null,null,k,m)}catch(z){this.spinner.stop(),this.handleError(z)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var c=function(a){return a.replace(RegExp("^[\\s\"']+","g"),
-"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),d=0,e={},k=mxUtils.bind(this,function(){if(0==d){for(var f=[b[0]],g=1;g<b.length;g++){var l=b[g].indexOf(")");f.push('url("');f.push(e[c(b[g].substring(0,l))]);f.push('"'+b[g].substring(l))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var m=1;m<b.length;m++){var q=b[m].indexOf(")"),u=null,t=b[m].indexOf("format(",q);0<t&&(u=c(b[m].substring(t+7,b[m].indexOf(")",t))));mxUtils.bind(this,function(a){if(null==
-e[a]){e[a]=a;d++;var c="application/x-font-ttf";if("svg"==u||/(\.svg)($|\?)/i.test(a))c="image/svg+xml";else if("otf"==u||"embedded-opentype"==u||/(\.otf)($|\?)/i.test(a))c="application/x-font-opentype";else if("woff"==u||/(\.woff)($|\?)/i.test(a))c="application/font-woff";else if("woff2"==u||/(\.woff2)($|\?)/i.test(a))c="application/font-woff2";else if("eot"==u||/(\.eot)($|\?)/i.test(a))c="application/vnd.ms-fontobject";else if("sfnt"==u||/(\.sfnt)($|\?)/i.test(a))c="application/font-sfnt";var b=
-a;/^https?:\/\//.test(b)&&!this.editor.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(c){e[a]=c;d--;k()}),mxUtils.bind(this,function(a){d--;k()}),!0,null,"data:"+c+";charset=utf-8;base64,")}})(c(b[m].substring(0,q)),u)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,d,e,l,k,m,q,u,t,z,E,r,v){k=null!=k?k:!0;E=null!=E?E:this.editor.graph;r=null!=r?r:0;var c=u?null:E.background;c==mxConstants.NONE&&(c=null);null==c&&(c=e);null==
-c&&0==u&&(c="#ffffff");this.convertImages(E.getSvg(c,null,null,v,null,null!=m?m:!0,null,null,null,t),mxUtils.bind(this,function(d){var f=new Image;f.onload=mxUtils.bind(this,function(){try{var e=document.createElement("canvas"),g=parseInt(d.getAttribute("width")),p=parseInt(d.getAttribute("height"));q=null!=q?q:1;null!=b&&(q=k?Math.min(1,Math.min(3*b/(4*p),b/g)):b/g);g=Math.ceil(q*g)+2*r;p=Math.ceil(q*p)+2*r;e.setAttribute("width",g);e.setAttribute("height",p);var m=e.getContext("2d");null!=c&&(m.beginPath(),
-m.rect(0,0,g,p),m.fillStyle=c,m.fill());m.scale(q,q);mxClient.IS_SF?window.setTimeout(function(){m.drawImage(f,r/q,r/q);a(e)},0):(m.drawImage(f,r/q,r/q),a(e))}catch(U){null!=l&&l(U)}});f.onerror=function(a){null!=l&&l(a)};try{t&&this.editor.graph.addSvgShadow(d);var e=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;d.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(E,
-d,!0,mxUtils.bind(this,function(){f.src=this.createSvgDataUri(mxUtils.getXml(d))}))});this.loadFonts(e)}catch(B){null!=l&&l(B)}}),d,z)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,d=this;a.convert=function(c){if(null!=c){var f="http://"==c.substring(0,7)||"https://"==c.substring(0,8);f&&!navigator.onLine?c=d.svgBrokenImage.src:!f||c.substring(0,a.baseUrl.length)==a.baseUrl||d.crossOriginImages&&d.editor.isCorsEnabledForUrl(c)?"chrome-extension://"!=
-c.substring(0,19)&&(c=b.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c)}return c};return a};EditorUi.prototype.convertImages=function(a,b,d,e){null==e&&(e=this.createImageUrlConverter());var c=0,f=d||{};d=mxUtils.bind(this,function(d,g){for(var l=a.getElementsByTagName(d),k=0;k<l.length;k++)mxUtils.bind(this,function(d){var l=e.convert(d.getAttribute(g));if(null!=l&&"data:"!=l.substring(0,5)){var k=f[l];null==k?(c++,this.convertImageToDataUri(l,function(e){null!=e&&(f[l]=e,d.setAttribute(g,
-e));c--;0==c&&b(a)})):d.setAttribute(g,k)}else null!=l&&d.setAttribute(g,l)})(l[k])});d("image","xlink:href");d("img","src");0==c&&b(a)};EditorUi.prototype.loadUrl=function(a,b,d,e,l,k,m){try{var c=!m&&(e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a));l=null!=l?l:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var f=a.getText();if(c){if((9==document.documentMode||10==document.documentMode)&&
-"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var f=Array(a.length),e=0;e<a.length;e++)f[e]=String.fromCharCode(a[e]);f=f.join("")}k=null!=k?k:"data:image/png;base64,";f=k+this.base64Encode(f)}b(f)}}else null!=d&&d({message:mxResources.get("error")+" "+a.getStatus()},a)}),function(a){null!=d&&d({message:mxResources.get("error")+" "+a.getStatus()})},c,this.timeout,function(){l&&null!=d&&d({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(G){null!=
-d&&d(G)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(this.svgBrokenImage.src)});else{var c=new Image,d=this;this.crossOriginImages&&(c.crossOrigin="anonymous");c.onload=function(){var a=document.createElement("canvas"),f=a.getContext("2d");a.height=c.height;a.width=c.width;f.drawImage(c,
-0,0);try{b(a.toDataURL())}catch(y){b(d.svgBrokenImage.src)}};c.onerror=function(){b(d.svgBrokenImage.src)};c.src=a}};EditorUi.prototype.importXml=function(a,b,d,e,l){b=null!=b?b:0;d=null!=d?d:0;var c=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){f.model.beginUpdate();try{var g=mxUtils.parseXml(a),k=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=k&&"mxfile"==k.nodeName&&null!=this.pages){var m=k.getElementsByTagName("diagram");if(1==m.length)k=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(m[0]))).documentElement;
-else if(1<m.length)for(a=0,null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(k=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(m[0]))).documentElement,e=!1,a=1);a<m.length;a++){m[a].removeAttribute("id");var n=this.updatePageRoot(new DiagramPage(m[a])),q=this.pages.length;null==n.getName()&&n.setName(mxResources.get("pageWithNumber",[q+1]));f.model.execute(new ChangePage(this,n,n,q,!0))}}null!=k&&"mxGraphModel"===k.nodeName&&(c=f.importGraphModel(k,b,d,e))}finally{f.model.endUpdate()}}}catch(r){if(l)throw r;
-this.handleError(r)}return c};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};EditorUi.prototype.importVisio=function(a,b,d,e){e=null!=e?e:a.name;d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(this.isRemoteVisioFormat(e)&&null!=VSD_CONVERT_URL){var c=new FormData;c.append("file1",a,e);var f=new XMLHttpRequest;f.open("POST",VSD_CONVERT_URL);
-f.responseType="blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{f.response.name=e,this.doImportVisio(f.response,b,d)}catch(x){d(x)}else d({})});f.send(c)}else try{this.doImportVisio(a,b,d)}catch(x){d(x)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?c():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",c))};EditorUi.prototype.importGraphML=function(a,b,d){d=null!=d?d:mxUtils.bind(this,function(a){this.handleError(a)});
-var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(a,b,d)}catch(l){d(l)}});this.doImportGraphML||this.loadingExtensions||this.isOffline()?c():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",c))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()||this.handleError({message:mxResources.get("unknownError")})}catch(f){this.handleError(f)}});
-"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,b,d){var c=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter)try{b(LucidImporter.importState(JSON.parse(a)))}catch(l){d(l)}else d({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline()?
-window.setTimeout(c,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",c):mxscript("js/extensions.min.js",c))};EditorUi.prototype.insertAsPreText=function(a,b,d){var c=this.editor.graph,f=null;c.getModel().beginUpdate();try{f=c.insertVertex(null,null,"<pre>"+a+"</pre>",b,d,1,1,"text;html=1;align=center;verticalAlign=middle;"),c.updateCellSize(f,!0)}finally{c.getModel().endUpdate()}return f};EditorUi.prototype.insertTextAt=function(a,b,d,e,l,k,m){k=null!=k?k:!0;
-m=null!=m?m:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,d,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(l||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var c=this.editor.graph;if("data:image/png;base64,"==
-a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,d,k,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),g=this.importXml(f,b,d,k,!0),0<g.length)return g}catch(z){}this.loadImage(a,mxUtils.bind(this,function(f){if("data:"==a.substring(0,5))this.resizeImage(f,
-a,mxUtils.bind(this,function(a,f,e){c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),f,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),m,this.maxImageSize);else{var e=Math.min(1,Math.min(this.maxImageSize/f.width,this.maxImageSize/f.height)),g=Math.round(f.width*e);f=Math.round(f.height*e);c.setSelectionCell(c.insertVertex(null,null,"",c.snap(b),c.snap(d),g,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
-a+";"))}}),mxUtils.bind(this,function(){var f=null;c.getModel().beginUpdate();try{f=c.insertVertex(c.getDefaultParent(),null,a,c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.updateCellSize(f),c.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{c.getModel().endUpdate()}c.setSelectionCell(f)}))}else{a=Graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,d,k);if(0<a.length)if(this.isLucidChartData(a))this.convertLucidChart(a,mxUtils.bind(this,
-function(a){this.editor.graph.setSelectionCells(this.importXml(a,b,d,k))}),mxUtils.bind(this,function(a){this.handleError(a)}));else{c=this.editor.graph;l=null;c.getModel().beginUpdate();try{l=c.insertVertex(c.getDefaultParent(),null,"",c.snap(b),c.snap(d),1,1,"text;"+(e?"html=1;":"")),c.fireEvent(new mxEventObject("textInserted","cells",[l])),"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a)),l.value=a,c.updateCellSize(l),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(l.value)&&
-c.setLinkForCell(l,l.value),l.geometry.width+=c.gridSize,l.geometry.height+=c.gridSize}finally{c.getModel().endUpdate()}return[l]}}return[]};EditorUi.prototype.formatFileSize=function(a){var c=-1;do a/=1024,c++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[c]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var c=a.indexOf(";");0<c&&(a=a.substring(0,c)+a.substring(a.indexOf(",",c+1)))}return a};EditorUi.prototype.isRemoteFileFormat=
-function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.isLucidChartData=function(a){return null!=a&&'{"state":"{\\"Properties\\":'==a.substring(0,26)};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){var c=document.createElement("input");c.setAttribute("type","file");mxEvent.addListener(c,"change",mxUtils.bind(this,function(){null!=c.files&&
-this.importFiles(c.files,null,null,this.maxImageSize)}));c.click()}else{window.openNew=!1;window.openKey="import";if(!b){var d=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){if(null!=b&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(b)){var c=new Blob([a],{type:"application/octet-stream"});this.importVisio(c,mxUtils.bind(this,function(a){this.importXml(a,
-0,0,!0)}),null,b)}else this.editor.graph.setSelectionCells(this.importXml(a,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var f=this.dialog,e=f.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=d;e.apply(f,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(a,b,d,e,l,k,m,q,u,t,z){t=null!=t?t:!0;var c=!1,f=null,g=mxUtils.bind(this,
-function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,m)):b=this.importXml(a,d,e,t);null!=q&&q(b)});"image"==b.substring(0,5)?(u=!1,"image/png"==b.substring(0,9)&&(b=z?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,d,e,t),u=!0)),u||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),t&&f.isGridEnabled()&&(d=f.snap(d),e=f.snap(e)),f=[f.insertVertex(null,null,"",d,e,l,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
-a+";")])):/(\.*<graphml )/.test(a)?(c=!0,this.importGraphML(a,g)):null!=u&&null!=m&&(/(\.v(dx|sdx?))($|\?)/i.test(m)||/(\.vs(x|sx?))($|\?)/i.test(m))?(c=!0,this.importVisio(u,g)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,m)?(c=!0,this.parseFile(null!=u?u:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(a.responseText):null!=q&&q(null))}),m)):/(\.v(sd|dx))($|\?)/i.test(m)||/(\.vs(s|x))($|\?)/i.test(m)||
-(f=this.insertTextAt(this.validateFileData(a),d,e,!0,null,t));c||null==q||q(f);return f};EditorUi.prototype.base64Encode=function(a){for(var b="",c=0,d=a.length,e,k,m;c<d;){e=a.charCodeAt(c++)&255;if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}k=a.charCodeAt(c++);if(c==d){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);
-b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(k&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2);b+="=";break}m=a.charCodeAt(c++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(k&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2|(m&192)>>6);b+=
-"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m&63)}return b};EditorUi.prototype.importFiles=function(a,b,d,e,l,k,m,q,u,t,z,v){b=null!=b?b:0;d=null!=d?d:0;e=null!=e?e:this.maxImageSize;t=null!=t?t:this.maxImageBytes;var c=null!=b&&null!=d,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=z||this.resampleThreshold,n=0;n<a.length;n++)if("image/"==a[n].type.substring(0,6)&&a[n].size>p){g=!0;break}var y=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;
-l=null!=l?l:mxUtils.bind(this,function(a,b,d,f,e,g,l,k,m){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,l)),null):this.importFile(a,b,d,f,e,g,l,k,m,c,v)});k=null!=k?k:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=a.length,u=n,r=[],y=mxUtils.bind(this,function(a,b){r[a]=b;if(0==--u){this.spinner.stop();if(null!=q)q(r);else{var c=[];g.getModel().beginUpdate();
-try{for(var d=0;d<r.length;d++){var f=r[d]();null!=f&&(c=c.concat(f))}}finally{g.getModel().endUpdate()}}k(c)}}),x=0;x<n;x++)mxUtils.bind(this,function(c){var k=a[c];if(null!=k){var n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==m||m(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var n=a.target.result,u=n.indexOf(","),r=decodeURIComponent(escape(atob(n.substring(u+1)))),q=mxUtils.parseXml(r),r=q.getElementsByTagName("svg");if(0<r.length){var r=r[0],
-x=v?null:r.getAttribute("content");null!=x&&"<"!=x.charAt(0)&&"%"!=x.charAt(0)&&(x=unescape(window.atob?atob(x):Base64.decode(x,!0)));null!=x&&"%"==x.charAt(0)&&(x=decodeURIComponent(x));null==x||"<mxfile "!==x.substring(0,8)&&"<mxGraphModel "!==x.substring(0,14)?y(c,mxUtils.bind(this,function(){try{if(n.substring(0,u+1),null!=q){var a=q.getElementsByTagName("svg");if(0<a.length){var f=a[0],m=parseFloat(f.getAttribute("width")),r=parseFloat(f.getAttribute("height")),z=f.getAttribute("viewBox");if(null==
-z||0==z.length)f.setAttribute("viewBox","0 0 "+m+" "+r);else if(isNaN(m)||isNaN(r)){var y=z.split(" ");3<y.length&&(m=parseFloat(y[2]),r=parseFloat(y[3]))}n=this.createSvgDataUri(mxUtils.getXml(f));var t=Math.min(1,Math.min(e/Math.max(1,m)),e/Math.max(1,r)),x=l(n,k.type,b+c*p,d+c*p,Math.max(1,Math.round(m*t)),Math.max(1,Math.round(r*t)),k.name);if(isNaN(m)||isNaN(r)){var B=new Image;B.onload=mxUtils.bind(this,function(){m=Math.max(1,B.width);r=Math.max(1,B.height);x[0].geometry.width=m;x[0].geometry.height=
-r;f.setAttribute("viewBox","0 0 "+m+" "+r);n=this.createSvgDataUri(mxUtils.getXml(f));var a=n.indexOf(";");0<a&&(n=n.substring(0,a)+n.substring(n.indexOf(",",a+1)));g.setCellStyles("image",n,[x[0]])});B.src=this.createSvgDataUri(mxUtils.getXml(f))}return x}}}catch(ua){}return null})):y(c,mxUtils.bind(this,function(){return l(x,"text/xml",b+c*p,d+c*p,0,0,k.name)}))}else y(c,mxUtils.bind(this,function(){return null}))}else{r=!1;if("image/png"==k.type){var B=v?null:this.extractGraphModelFromPng(a.target.result);
-if(null!=B&&0<B.length){var H=new Image;H.src=a.target.result;y(c,mxUtils.bind(this,function(){return l(B,"text/xml",b+c*p,d+c*p,H.width,H.height,k.name)}));r=!0}}r||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,
-a.target.result,mxUtils.bind(this,function(g,m,n){y(c,mxUtils.bind(this,function(){if(null!=g&&g.length<t){var r=f&&this.isResampleImage(a.target.result,z)?Math.min(1,Math.min(e/m,e/n)):1;return l(g,k.type,b+c*p,d+c*p,Math.round(m*r),Math.round(n*r),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,z)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else l(a.target.result,k.type,b+c*p,d+c*p,240,160,k.name,
-function(a){y(c,function(){return a})})});/(\.v(dx|sdx?))($|\?)/i.test(k.name)||/(\.vs(x|sx?))($|\?)/i.test(k.name)?l(null,k.type,b+c*p,d+c*p,240,160,k.name,function(a){y(c,function(){return a})},k):"image"==k.type.substring(0,5)?n.readAsDataURL(k):n.readAsText(k)}})(x)});g?this.confirmImageResize(function(a){f=a;y()},u):y()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var c=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},d=isLocalStorage||mxClient.IS_CHROMEAPP?
-mxSettings.getResizeImages():null,f=function(d,f){if(d||b)mxSettings.setResizeImages(d?f:null),mxSettings.save();c();a(f)};null==d||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){f(a,!0)},function(a){f(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||
-mxClient.IS_CHROMEAPP?220:200,!0,!0):f(!1,d)};EditorUi.prototype.parseFile=function(a,b,d){d=null!=d?d:a.name;var c=new FormData;c.append("format","xml");c.append("upfile",a,d);var f=new XMLHttpRequest;f.open("POST",OPEN_URL);f.onreadystatechange=function(){b(f)};f.send(c)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,d,e,l,k){l=null!=l?l:this.maxImageSize;var c=Math.max(1,a.width),f=Math.max(1,a.height);
-if(e&&this.isResampleImage(b,k))try{var g=Math.max(c/l,f/l);if(1<g){var m=Math.round(c/g),p=Math.round(f/g),n=document.createElement("canvas");n.width=m;n.height=p;n.getContext("2d").drawImage(a,0,0,m,p);var r=n.toDataURL();if(r.length<b.length){var q=document.createElement("canvas");q.width=m;q.height=p;var t=q.toDataURL();r!==t&&(b=r,c=m,f=p)}}}catch(O){}d(b,c,f)};EditorUi.prototype.crcTable=[];for(var d=0;256>d;d++)for(var k=d,m=0;8>m;m++)k=1==(k&1)?3988292384^k>>>1:k>>>1,EditorUi.prototype.crcTable[d]=
-k;EditorUi.prototype.updateCRC=function(a,b,d,e){for(var c=0;c<e;c++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(d+c))&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var b=-1,c=0;c<a.length;c++)b=b>>>8^this.crcTable[(b^a.charCodeAt(c))&255];return(b^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,d,e,l){function c(a,b){var c=k;k+=b;return a.substring(c,k)}function f(a){a=c(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<
-8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var k=0;if(c(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=l&&l();else if(c(a,4),"IHDR"!=c(a,4))null!=l&&l();else{c(a,17);l=a.substring(0,k);do{var m=f(a);if("IDAT"==c(a,4)){l=a.substring(0,k-8);d=d+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;
-e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,d,0,d.length);l+=g(d.length)+b+d+g(e^4294967295);l+=a.substring(k-8,a.length);break}l+=a.substring(k-8,k-4+m);c(a,m);c(a,4)}while(m);return"data:image/png;base64,"+(window.btoa?btoa(l):Base64.encode(l,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var c=a.substring(a.indexOf(",")+1),d=window.atob&&!mxClient.IS_SF?atob(c):Base64.decode(c,!0);EditorUi.parsePng(d,mxUtils.bind(this,function(a,c,f){a=d.substring(a+8,a+8+f);"zTXt"==
-c?(f=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,f)&&(a=Graph.bytesToString(pako.inflateRaw(a.substring(f+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==c&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==c)return!0}))}catch(l){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,d){var c=new Image;c.onload=function(){b(c)};
-null!=d&&(c.onerror=d);c.src=a};var q=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(b){return a.getLinkTitle(b)};b.customLinkClicked=function(b){var c=!1;try{a.handleCustomLink(b),c=!0}catch(B){a.handleError(B)}return c};var d=this.clearDefaultStyle;this.clearDefaultStyle=
-function(){d.apply(this,arguments)};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var e=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.pages.length;c++)if(a.pages[c]==a.currentPage){0<c&&(b+=(0<b.length?"&":"?")+"page="+c);break}"1"==urlParams.dev&&(b+=(0<b.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this,
-arguments)};var l=b.addClickHandler;b.addClickHandler=function(a,c,d){var f=c;c=function(a,c){if(null==c){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(c=d.getAttribute("href"))}null!=c&&b.isCustomLink(c)&&(mxEvent.isTouchEvent(a)||!mxEvent.isPopupTrigger(a))&&b.customLinkClicked(c)&&mxEvent.consume(a);null!=f&&f(a,c)};l.call(this,a,c,d)};q.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(b.view.canvas.ownerSVGElement,null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,
-360,null!=a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var k=b.getGlobalVariable;b.getGlobalVariable=function(b){return"page"==b&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==b?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:k.apply(this,arguments)};var m=b.labelLinkClicked;b.labelLinkClicked=function(a,c,d){var f=c.getAttribute("href");if(null==f||!b.isCustomLink(f)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))m.apply(this,
-arguments);else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(f),b.getRubberband().reset();mxEvent.consume(d)}};this.editor.getOrCreateFilename=function(){var b=a.defaultFilename,c=a.getCurrentFile();null!=c&&(b=null!=c.getTitle()?c.getTitle():b);return b};var t=this.actions.get("print");t.setEnabled(!mxClient.IS_IOS||!navigator.standalone);t.visible=t.isEnabled();if(!this.editor.chromeless||this.editor.editable){var u=function(){window.setTimeout(function(){v.innerHTML="&nbsp;";
-v.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,"insertEllipse",!0);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(this.altShiftActions[83]="synchronize");mxClient.IS_IE||
-b.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var c=a.clipboardData||a.originalEvent.clipboardData,d=!1,f=0;f<c.types.length;f++)if("text/"===c.types[f].substring(0,5)){d=!0;break}if(!d){var e=c.items;for(index in e){var g=e[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],0,0,this.maxImageSize,function(a,c,d,f,e,g){b.insertImage(a,e,g)},function(){},function(a){return"image/"==a.type.substring(0,
-6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var l=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],l.x,l.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(J){}}),!1);var v=document.createElement("div");v.style.position="absolute";v.style.whiteSpace="nowrap";v.style.overflow="hidden";v.style.display="block";v.contentEditable=!0;mxUtils.setOpacity(v,0);v.style.width="1px";v.style.height="1px";v.innerHTML="&nbsp;";var z=!1;this.keyHandler.bindControlKey(88,null);
-this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var c=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==c.nodeName||"TEXTAREA"==c.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||z||(v.style.left=b.container.scrollLeft+10+"px",v.style.top=b.container.scrollTop+10+"px",b.container.appendChild(v),
-z=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){v.focus();document.execCommand("selectAll",!1,null)},0):(v.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var c=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!z||224!=c&&17!=c&&91!=c||(z=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),v.parentNode.removeChild(v),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(v,
-"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(v),u())}));mxEvent.addListener(v,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(v,!0),u())}));mxEvent.addListener(v,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(v.innerHTML="&nbsp;",v.focus(),window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,v);v.innerHTML="&nbsp;"}),0))}),!0);var E=this.isSelectionAllowed;this.isSelectionAllowed=
-function(a){return mxEvent.getSource(a)==v?!0:E.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,c=b.cellEditor.text2,d=null;null!=c&&(mxEvent.addListener(c,"dragleave",function(a){null!=d&&(d.parentNode.removeChild(d),d=null);a.stopPropagation();a.preventDefault()}),
-mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null==d&&(!mxClient.IS_IE||10<document.documentMode)&&(d=this.highlightElement(c));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=d&&(d.parentNode.removeChild(d),d=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,function(a,c,d,f,e,g){b.insertImage(a,e,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=
-0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var c=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(c)?this.loadImage(decodeURIComponent(c),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var f=this.maxImageSize,f=Math.min(1,Math.min(f/Math.max(1,d)),f/Math.max(1,a));b.insertImage(decodeURIComponent(c),d*f,a*f)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=
-mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==typeof mxRuler){t=document.createElement("div");t.style.position="absolute";t.style.top="95px";t.style.left="250px";t.style.width="2000px";t.style.height="30px";t.style.background=
-"whiteSmoke";document.body.appendChild(t);var r=document.createElement("div");r.style.position="absolute";r.style.top="125px";r.style.left="220px";r.style.width="30px";r.style.height="1000px";r.style.background="whiteSmoke";document.body.appendChild(r);var A=document.createElement("div");A.style.position="absolute";A.style.top="95px";A.style.left="220px";A.style.width="30px";A.style.height="30px";A.style.background="whiteSmoke";document.body.appendChild(A);this.vRuler=new mxRuler(this.editor.graph,
-r,!0);this.hRuler=new mxRuler(this.editor.graph,t,!1)}if("1"==urlParams.styledev){t=document.getElementById("geFooter");null!=t&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,
-function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),t.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var c=this.editor.graph.getSelectionCell(),c=this.editor.graph.getModel().getStyle(c);this.styleInput.value=c||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var Q=this.isSelectionAllowed;
-this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:Q.apply(this,arguments)}}t=document.getElementById("geInfo");null!=t&&t.parentNode.removeChild(t);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var O=null;mxEvent.addListener(b.container,"dragleave",function(a){b.isEnabled()&&(null!=O&&(O.parentNode.removeChild(O),O=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==
-O&&(!mxClient.IS_IE||10<document.documentMode)&&(O=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=O&&(O.parentNode.removeChild(O),O=null);if(b.isEnabled()){var c=mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=b.view.translate,f=b.view.scale,e=c.x/f-d.x,g=c.y/f-d.y;mxEvent.isAltDown(a)&&(g=e=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,
-e,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var l=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,c=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=c)b.setSelectionCells(this.importXml(c,e,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var k=a.dataTransfer.getData("text/html"),c=document.createElement("div");c.innerHTML=k;var m=null,d=c.getElementsByTagName("img");
-null!=d&&1==d.length?(k=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(m=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(k=c[0].getAttribute("href")));var p=!0,n=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(k,e,g,!0,m,null,p))});m&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){p=a;n()},mxEvent.isControlDown(a)):n()}else null!=l&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)?this.loadImage(decodeURIComponent(l),mxUtils.bind(this,
-function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",e,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+l+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(l,e,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),
-e,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();this.editUpdateListener=mxUtils.bind(this,function(a,b){var c=b.getProperty("edit");null!=c&&this.updateEditReferences(c)});this.editor.undoManager.addListener(mxEvent.BEFORE_UNDO,this.editUpdateListener);this.editor.undoManager.addListener(mxEvent.BEFORE_REDO,this.editUpdateListener);"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(a){var b=Graph.prototype.getLinkTitle.apply(this,
-arguments);if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");0<c&&(b=this.getPageById(a.substring(c+1)),b=null!=b?b.getName():mxResources.get("pageNotFound"))}else"data:"==a.substring(0,5)&&(b=mxResources.get("action"));return b};EditorUi.prototype.handleCustomLink=function(a){if("data:page/id,"==a.substring(0,13)){var b=a.indexOf(",");if(a=this.getPageById(a.substring(b+1)))this.selectPage(a);else throw Error(mxResources.get("pageNotFound")||"Page not found");}else this.editor.graph.handleCustomLink(a)};
-EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",
-mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);
-mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),
-mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML="";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),f=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(f));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=f,c.pasteCounter=0);a.focus();
-document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.convertLucidChart(d,mxUtils.bind(this,function(a){var b=this.editor.graph;b.setSelectionCells(this.importXml(a,0,0));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,
-function(a){this.handleError(a)})),mxEvent.consume(a))}else{var d=this.editor.graph,f=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),e=!1;try{var k=f.lastIndexOf("%3E");0<=k&&k<f.length-3&&(f=f.substring(0,k+3))}catch(u){}try{var c=b.getElementsByTagName("span"),m=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(f);this.isCompatibleString(m)&&(e=!0,f=m)}catch(u){}d.lastPasteXml==f?d.pasteCounter++:(d.lastPasteXml=
-f,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=f&&0<f.length&&(e||this.isCompatibleString(f)?d.setSelectionCells(this.importXml(f,c,c)):(e=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==f&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(f,e.x+c,e.y+c,!0))),!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(u){}}}}};
-EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),
-mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:
-a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==
-c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":
-"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var k=document.documentElement;d=(e.clientWidth||k.clientWidth)-3;e=Math.max(e.clientHeight||0,k.clientHeight)-3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;k=document.createElement("div");k.style.zIndex=mxPopupMenu.prototype.zIndex+
-2;k.style.border="3px dotted rgb(254, 137, 12)";k.style.pointerEvents="none";k.style.position="absolute";k.style.top=b+"px";k.style.left=c+"px";k.style.width=Math.max(0,d-3)+"px";k.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(k):document.body.appendChild(k);return k};EditorUi.prototype.stringToCells=function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),
-d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){try{var d=c.target.result,f=a.name;if(null!=f&&0<f.length){!this.useCanvasForExport&&/(\.png)$/i.test(f)&&(f=f.substring(0,f.length-4)+".xml");var e=
-mxUtils.bind(this,function(a){f=0<=f.lastIndexOf(".")?f.substring(0,f.lastIndexOf("."))+".xml":f+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,f))}catch(z){this.handleError(z,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,f,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(f)||/(\.vs(x|sx?))($|\?)/i.test(f))this.importVisio(a,mxUtils.bind(this,
-function(a){this.spinner.stop();e(a)}));else if(/(\.*<graphml )/.test(d))this.importGraphML(d,mxUtils.bind(this,function(a){this.spinner.stop();e(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,f))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?e(a.responseText):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));
-else if(this.isLucidChartData(d))/(\.json)$/i.test(f)&&(f=f.substring(0,f.length-5)+".xml"),this.convertLucidChart(d,mxUtils.bind(this,function(a){this.spinner.stop();this.openLocalFile(a,f,b)}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));else if("<mxlibrary"==c.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,
-c.target.result,a.name))}catch(G){this.handleError(G,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(d=this.extractGraphModelFromPng(d)),this.spinner.stop(),this.openLocalFile(d,f,b)}}catch(G){this.handleError(G)}});c.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?c.readAsDataURL(a):c.readAsText(a)})(a[c])};EditorUi.prototype.openLocalFile=function(a,
-b,d){var c=this.getCurrentFile(),f=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var c=mxUtils.parseXml(a);null!=c&&(this.editor.setGraphXml(c.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,d))});if(null!=a&&0<a.length)null==c||!c.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?f():(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=c&&c.isModified()?
-this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=c&&c.isModified()?this.confirm(mxResources.get("allChangesLost"),null,f,mxResources.get("cancel"),mxResources.get("discardChanges")):f()})));else throw Error(mxResources.get("notADiagramFile"));};EditorUi.prototype.getBasenames=
-function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],d;for(d in a)b.push(d);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function c(a){if(null!=a){var c=a.lastIndexOf(".");0<c&&(a=a.substring(c+1,a.length));null==b[a]&&(b[a]=!0)}}var d=this.editor.graph,f=d.getCellStyle(a);c(mxStencilRegistry.getBasenameForStencil(f[mxConstants.STYLE_SHAPE]));
-d.model.isEdge(a)&&(c(mxMarker.getPackageForType(f[mxConstants.STYLE_STARTARROW])),c(mxMarker.getPackageForType(f[mxConstants.STYLE_ENDARROW])));for(var f=d.model.getChildCount(a),e=0;e<f;e++)this.addBasenamesForCell(d.model.getChildAt(a,e),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=
-a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden");a||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&&this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1),null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);
-(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,d){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));
-this.editor.undoManager.clear();this.editor.modified=null!=d?d:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=
-function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,bounds:b.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:b.view.scale,page:b.view.getBackgroundPageBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,c=!1,d=!1,e=null,k=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});
-this.editor.graph.model.addListener(mxEvent.CHANGE,k);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){if(f.source==(window.opener||window.parent)){var g=f.data,l=mxUtils.bind(this,function(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/png;base64,"==a.substring(0,22)?a=this.extractGraphModelFromPng(a):"data:image/svg+xml;base64,"==a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&
-("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=Graph.decompress(a)))}catch(S){}return a});if("json"==urlParams.proto){try{g=JSON.parse(g)}catch(I){g=null}if(null==g)return;if("dialog"==g.action){this.showError(null!=g.titleKey?mxResources.get(g.titleKey):g.title,null!=g.messageKey?mxResources.get(g.messageKey):g.message,null!=g.buttonKey?mxResources.get(g.buttonKey):g.button);null!=g.modified&&(this.editor.modified=g.modified);return}if("prompt"==g.action){this.spinner.stop();l=new FilenameDialog(this,
-g.defaultValue||"",null!=g.okKey?mxResources.get(g.okKey):null,function(a){null!=a&&m.postMessage(JSON.stringify({event:"prompt",value:a,message:g}),"*")},null!=g.titleKey?mxResources.get(g.titleKey):g.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==g.action){var k=l(g.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",[g.name||this.defaultFilename]),k,mxUtils.bind(this,function(){this.hideDialog();m.postMessage(JSON.stringify({event:"draft",
-result:"edit",message:g}),"*")}),mxUtils.bind(this,function(){this.hideDialog();m.postMessage(JSON.stringify({event:"draft",result:"discard",message:g}),"*")}),g.editKey?mxResources.get(g.editKey):null,g.discardKey?mxResources.get(g.discardKey):null,g.ignore?mxUtils.bind(this,function(){this.hideDialog();m.postMessage(JSON.stringify({event:"draft",result:"ignore",message:g}),"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));
-try{l.init()}catch(I){m.postMessage(JSON.stringify({event:"draft",error:I.toString(),message:g}),"*")}return}if("template"==g.action){this.spinner.stop();l=1==g.enableRecent;k=1==g.enableSearch;l=new NewDialog(this,!1,null!=g.callback,mxUtils.bind(this,function(b,c){b=b||this.emptyDiagramXml;null!=g.callback?m.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,name:c}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,
-null,null,null,null,l?mxUtils.bind(this,function(a){this.remoteInvoke("getRecentDiagrams",null,null,a,function(){a(null,"Network Error!")})}):null,k?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):null,function(a,b,c){m.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:c}),"*")});this.showDialog(l.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("textContent"==
-g.action){l=this.getDiagramTextContent();m.postMessage(JSON.stringify({event:"textContent",data:l,message:g}),"*");return}if("status"==g.action){null!=g.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(g.messageKey))):null!=g.message&&this.editor.setStatus(mxUtils.htmlEntities(g.message));null!=g.modified&&(this.editor.modified=g.modified);return}if("spinner"==g.action){var p=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||g.show?this.spinner.spin(document.body,
-p):this.spinner.stop();return}if("export"==g.action){if("png"==g.format||"xmlpng"==g.format){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var n=null!=g.xml?g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();var b=this.createLoadMessage("export");b.format=g.format;b.message=g;b.data=a;b.xml=encodeURIComponent(n);
-m.postMessage(JSON.stringify(b),"*")}),y=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==g.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(Graph.compress(n))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),v=q.getGlobalVariable,x=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?x.getName():
-"pagenumber"==a?1:v.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(x.root)}this.exportToCanvas(mxUtils.bind(this,function(a){y(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){y(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==g.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+
-a.getText()):y(null)}),mxUtils.bind(this,function(){y(null)}))}}else{null!=g.xml&&0<g.xml.length&&this.setFileData(g.xml);p=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),p.xml=mxUtils.getXml(l),p.data=this.getFileData(null,null,!0,null,null,null,l),p.format=g.format;else if("html"==g.format)n=this.editor.getGraphXml(),p.data=this.getHtml(n,this.editor.graph),p.xml=mxUtils.getXml(n),p.format=
-g.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);p.xml=this.getFileData(!0);p.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==g.format?this.getEmbeddedSvg(p.xml,this.editor.graph,null,!0,mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=
-this.createSvgDataUri(a);m.postMessage(JSON.stringify(p),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(mxUtils.getXml(a));m.postMessage(JSON.stringify(p),"*")}));return}l="xmlsvg"==g.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));p.data=this.createSvgDataUri(l)}m.postMessage(JSON.stringify(p),"*")}return}if("load"==
-g.action)d=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px",this.buttonContainer.style.right="25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight=
-"38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(k),this.embedFilenameSpan=k),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):g.xml;else{"remoteInvokeReady"==g.action?this.handleRemoteInvokeReady(m):"remoteInvoke"==g.action?this.handleRemoteInvoke(g):"remoteInvokeResponse"==g.action?this.handleRemoteInvokeResponse(g):m.postMessage(JSON.stringify({error:"unknownMessage",
-data:JSON.stringify(g)}),"*");return}}var B=mxUtils.bind(this,function(f,g){c=!0;try{a(f,g)}catch(U){this.handleError(U)}c=!1;null!=urlParams.modified&&this.editor.setStatus("");var l=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=l();d&&null==b&&(b=mxUtils.bind(this,function(a,b){var d=l();if(d!=e&&!c){var f=this.createLoadMessage("autosave");f.xml=d;d=JSON.stringify(f);(window.opener||
-window.parent).postMessage(d,"*")}e=d}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",b),this.addListener("guidesEnabledChanged",
-b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||m.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")});null!=g&&"function"===typeof g.substring&&"data:application/vnd.visio;base64,"==g.substring(0,34)?(l="0M8R4KGxGuE"==g.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(g.substring(g.indexOf(",")+1)),function(a){B(a,f)},mxUtils.bind(this,function(a){this.handleError(a)}),l)):null!=g&&"function"===typeof g.substring&&
-!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(g,"")?this.parseFile(new Blob([g],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&B(a.responseText,f)}),""):null!=g&&"function"===typeof g.substring&&this.isLucidChartData(g)?this.convertLucidChart(g,mxUtils.bind(this,function(a){B(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(g=l(g),B(g,f))}}));var m=
-window.opener||window.parent,k="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";m.postMessage(k,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",
-mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft="6px",b.style.padding=
-"4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));a.appendChild(b);
-this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};EditorUi.prototype.importCsv=
-function(a,b){try{var c=a.split("\n"),d=[];if(0<c.length){var f={},e=null,k=null,m=null,q=null,t="",z="auto",v="auto",r=null,A=null,Q=40,O=40,M=100,H=0,B=this.editor.graph;B.getGraphBounds();for(var I=function(){null!=b?b(W):(B.setSelectionCells(W),B.scrollCellToVisible(B.getSelectionCell()))},S=B.getFreeInsertPoint(),V=S.x,U=S.y,S=U,X=null,J="auto",q=null,aa=[],la=null,ea=null,Y=0;Y<c.length&&"#"==c[Y].charAt(0);){a=c[Y];for(Y++;Y<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[Y].charAt(0);)a=a.substring(0,
-a.length-1)+mxUtils.trim(c[Y].substring(1)),Y++;if("#"!=a.charAt(1)){var ba=a.indexOf(":");if(0<ba){var K=mxUtils.trim(a.substring(1,ba)),L=mxUtils.trim(a.substring(ba+1));"label"==K?X=B.sanitizeHtml(L):"style"==K?e=L:"parentstyle"==K?k=L:"identity"==K&&0<L.length&&"-"!=L?m=L:"parent"==K&&0<L.length&&"-"!=L?q=L:"namespace"==K&&0<L.length&&"-"!=L?t=L:"width"==K?z=L:"height"==K?v=L:"left"==K&&0<L.length?r=L:"top"==K&&0<L.length?A=L:"ignore"==K?ea=L.split(","):"connect"==K?aa.push(JSON.parse(L)):"link"==
-K?la=L:"padding"==K?H=parseFloat(L):"edgespacing"==K?Q=parseFloat(L):"nodespacing"==K?O=parseFloat(L):"levelspacing"==K?M=parseFloat(L):"layout"==K&&(J=L)}}}var ha=this.editor.csvToArray(c[Y]),K=ba=null;if(null!=m||null!=q)for(var N=0;N<ha.length;N++)m==ha[N]&&(ba=N),q==ha[N]&&(K=N);null==X&&(X="%"+ha[0]+"%");if(null!=aa)for(var R=0;R<aa.length;R++)null==f[aa[R].to]&&(f[aa[R].to]={});B.model.beginUpdate();try{for(N=Y+1;N<c.length;N++){var ia=this.editor.csvToArray(c[N]);if(null==ia){var fa=40<c[N].length?
-c[N].substring(0,40)+"...":c[N];throw Error(N+" ("+fa+") "+mxResources.get("containsValidationErrors"));}if(ia.length==ha.length){var F=null,ja=null!=ba?t+ia[ba]:null;null!=ja&&(F=B.model.getCell(ja));null==F&&(F=new mxCell(X,new mxGeometry(V,S,0,0),e||"whiteSpace=wrap;html=1;"),F.vertex=!0,F.id=ja);for(var P=0;P<ia.length;P++)B.setAttributeForCell(F,ha[P],ia[P]);B.setAttributeForCell(F,"placeholders","1");F.style=B.replacePlaceholders(F,F.style);for(R=0;R<aa.length;R++)f[aa[R].to][F.getAttribute(aa[R].to)]=
+(e+="..."),g.innerHTML=e,c.appendChild(g),d.status=g,mxClient.IS_VML&&(null==document.documentMode||8>=document.documentMode)&&(g.style.left=Math.round(Math.max(0,a-g.offsetWidth/2))+"px",g.style.top=Math.round(Math.max(0,b+70-g.offsetHeight/2))+"px")),this.pause=mxUtils.bind(this,function(){var a=function(){};this.active&&(a=mxUtils.bind(this,function(){this.spin(c,e)}));this.stop();return a}),g=!0);return g};var e=d.stop;d.stop=function(){e.call(this);this.active=!1;null!=d.status&&(d.status.parentNode.removeChild(d.status),
+d.status=null)};d.pause=function(){return function(){}};return d};EditorUi.parsePng=function(a,b,c){function d(a,d){var b=e;e+=d;return a.substring(b,e)}function f(a){a=d(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}var e=0;if(d(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=c&&c();else if(d(a,4),"IHDR"!=d(a,4))null!=c&&c();else{d(a,17);do{c=f(a);var g=d(a,4);if(null!=b&&b(e-8,g,c))break;value=d(a,c);d(a,4);if("IEND"==g)break}while(c)}};
+EditorUi.prototype.isCompatibleString=function(a){try{var d=mxUtils.parseXml(a),b=this.editor.extractGraphModel(d.documentElement,!0);return null!=b&&0==b.getElementsByTagName("parsererror").length}catch(n){}return!1};EditorUi.prototype.isVisioData=function(a){return 8<a.length&&208==a.charCodeAt(0)&&207==a.charCodeAt(1)&&17==a.charCodeAt(2)&&224==a.charCodeAt(3)&&161==a.charCodeAt(4)&&177==a.charCodeAt(5)&&26==a.charCodeAt(6)&&225==a.charCodeAt(7)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&
+4==a.charCodeAt(3)||80==a.charCodeAt(0)&&75==a.charCodeAt(1)&&3==a.charCodeAt(2)&&6==a.charCodeAt(3)};EditorUi.prototype.isPngData=function(a){return 8<a.length&&137==a.charCodeAt(0)&&80==a.charCodeAt(1)&&78==a.charCodeAt(2)&&71==a.charCodeAt(3)&&13==a.charCodeAt(4)&&10==a.charCodeAt(5)&&26==a.charCodeAt(6)&&10==a.charCodeAt(7)};var a=EditorUi.prototype.extractGraphModelFromHtml;EditorUi.prototype.extractGraphModelFromHtml=function(d){var b=a.apply(this,arguments);if(null==b)try{var c=d.indexOf("&lt;mxfile ");
+if(0<=c){var e=d.lastIndexOf("&lt;/mxfile&gt;");e>c&&(b=d.substring(c,e+15).replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var l=mxUtils.parseXml(d),p=this.editor.extractGraphModel(l.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!=p?mxUtils.getXml(p):""}catch(y){}return b};EditorUi.prototype.validateFileData=function(a){if(null!=a&&0<a.length){var d=a.indexOf('<meta charset="utf-8">');0<=d&&(a=a.slice(0,d)+'<meta charset="utf-8"/>'+
+a.slice(d+23-1,a.length));a=Graph.zapGremlins(a)}return a};EditorUi.prototype.replaceFileData=function(a){a=this.validateFileData(a);a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var d=null!=a?this.editor.extractGraphModel(a,!0):null;null!=d&&(a=d);if(null!=a){d=this.editor.graph;d.model.beginUpdate();try{var b=null!=this.pages?this.pages.slice():null,c=a.getElementsByTagName("diagram");if("0"!=urlParams.pages||1<c.length||1==c.length&&c[0].hasAttribute("name")){this.fileNode=a;this.pages=
+null!=this.pages?this.pages:[];for(var e=c.length-1;0<=e;e--){var p=this.updatePageRoot(new DiagramPage(c[e]));null==p.getName()&&p.setName(mxResources.get("pageWithNumber",[e+1]));d.model.execute(new ChangePage(this,p,0==e?p:null,0))}}else"0"!=urlParams.pages&&null==this.fileNode&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),d.model.execute(new ChangePage(this,
+this.currentPage,this.currentPage,0))),this.editor.setGraphXml(a),null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root);if(null!=b)for(e=0;e<b.length;e++)d.model.execute(new ChangePage(this,b[e],null))}finally{d.model.endUpdate()}}};EditorUi.prototype.createFileData=function(a,b,c,e,l,p,k,x,u,m){b=null!=b?b:this.editor.graph;l=null!=l?l:!1;u=null!=u?u:!0;var d,f=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?d="_blank":f=d=e;if(null==a)return"";var g=
+a;if("mxfile"!=g.nodeName.toLowerCase()){var n=Graph.zapGremlins(mxUtils.getXml(a)),g=Graph.compress(n);if(Graph.decompress(g)!=n)return n;n=a.ownerDocument.createElement("diagram");n.setAttribute("id",Editor.guid());mxUtils.setTextContent(n,g);g=a.ownerDocument.createElement("mxfile");g.appendChild(n)}m?(g=g.cloneNode(!0),g.removeAttribute("userAgent"),g.removeAttribute("version"),g.removeAttribute("editor"),g.removeAttribute("type")):(g.removeAttribute("userAgent"),g.removeAttribute("version"),
+g.removeAttribute("editor"),g.removeAttribute("type"),g.setAttribute("modified",(new Date).toISOString()),g.setAttribute("host",window.location.hostname),g.setAttribute("agent",navigator.userAgent),g.setAttribute("version",EditorUi.VERSION),g.setAttribute("etag",Editor.guid()),a=null!=c?c.getMode():this.mode,null!=a&&g.setAttribute("type",a));a=mxUtils.getXml(g);if(!p&&!l&&(k||null!=c&&/(\.html)$/i.test(c.getTitle())))a=this.getHtml2(mxUtils.getXml(g),b,null!=c?c.getTitle():null,d,f);else if(p||!l&&
+null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER||(e=null),a=this.getEmbeddedSvg(a,b,e,null,x,u,f);return a};EditorUi.prototype.getXmlFileData=function(a,b){a=null!=a?a:!0;b=null!=b?b:!1;var d=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(d=Graph.compressNode(d),mxUtils.setTextContent(this.currentPage.node,d),d=this.fileNode.cloneNode(!1),b)d.appendChild(this.currentPage.node);else for(var c=0;c<this.pages.length;c++){if(this.currentPage!=
+this.pages[c]&&this.pages[c].needsUpdate){var f=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(this.pages[c].root));this.editor.graph.saveViewState(this.pages[c].viewState,f);mxUtils.setTextContent(this.pages[c].node,Graph.compressNode(f));delete this.pages[c].needsUpdate}d.appendChild(this.pages[c].node)}return d};EditorUi.prototype.anonymizeString=function(a,b){for(var d=[],c=0;c<a.length;c++){var f=a.charAt(c);0<=EditorUi.ignoredAnonymizedChars.indexOf(f)?d.push(f):isNaN(parseInt(f))?
+f.toLowerCase()!=f?d.push(String.fromCharCode(65+Math.round(25*Math.random()))):f.toUpperCase()!=f?d.push(String.fromCharCode(97+Math.round(25*Math.random()))):/\s/.test(f)?d.push(" "):d.push("?"):d.push(b?"0":Math.round(9*Math.random()))}return d.join("")};EditorUi.prototype.anonymizePatch=function(a){if(null!=a[EditorUi.DIFF_INSERT])for(var d=0;d<a[EditorUi.DIFF_INSERT].length;d++)try{var b=mxUtils.parseXml(a[EditorUi.DIFF_INSERT][d].data).documentElement.cloneNode(!1);null!=b.getAttribute("name")&&
+b.setAttribute("name",this.anonymizeString(b.getAttribute("name")));a[EditorUi.DIFF_INSERT][d].data=mxUtils.getXml(b)}catch(p){a[EditorUi.DIFF_INSERT][d].data=p.message}if(null!=a[EditorUi.DIFF_UPDATE]){for(var c in a[EditorUi.DIFF_UPDATE]){var e=a[EditorUi.DIFF_UPDATE][c];null!=e.name&&(e.name=this.anonymizeString(e.name));null!=e.cells&&(d=mxUtils.bind(this,function(a){var d=e.cells[a];if(null!=d){for(var b in d)null!=d[b].value&&(d[b].value="["+d[b].value.length+"]"),null!=d[b].xmlValue&&(d[b].xmlValue=
+"["+d[b].xmlValue.length+"]"),null!=d[b].style&&(d[b].style="["+d[b].style.length+"]"),0==Object.keys(d[b]).length&&delete d[b];0==Object.keys(d).length&&delete e.cells[a]}}),d(EditorUi.DIFF_INSERT),d(EditorUi.DIFF_UPDATE),0==Object.keys(e.cells).length&&delete e.cells);0==Object.keys(e).length&&delete a[EditorUi.DIFF_UPDATE][c]}0==Object.keys(a[EditorUi.DIFF_UPDATE]).length&&delete a[EditorUi.DIFF_UPDATE]}return a};EditorUi.prototype.anonymizeAttributes=function(a,b){if(null!=a.attributes)for(var d=
+0;d<a.attributes.length;d++)"as"!=a.attributes[d].name&&a.setAttribute(a.attributes[d].name,this.anonymizeString(a.attributes[d].value,b));if(null!=a.childNodes)for(d=0;d<a.childNodes.length;d++)this.anonymizeAttributes(a.childNodes[d],b)};EditorUi.prototype.anonymizeNode=function(a,b){for(var d=a.getElementsByTagName("mxCell"),c=0;c<d.length;c++)null!=d[c].getAttribute("value")&&d[c].setAttribute("value","["+d[c].getAttribute("value").length+"]"),null!=d[c].getAttribute("xmlValue")&&d[c].setAttribute("xmlValue",
+"["+d[c].getAttribute("xmlValue").length+"]"),null!=d[c].getAttribute("style")&&d[c].setAttribute("style","["+d[c].getAttribute("style").length+"]"),null!=d[c].parentNode&&"root"!=d[c].parentNode.nodeName&&null!=d[c].parentNode.parentNode&&(d[c].setAttribute("id",d[c].parentNode.getAttribute("id")),d[c].parentNode.parentNode.replaceChild(d[c],d[c].parentNode));return a};EditorUi.prototype.synchronizeCurrentFile=function(a){var d=this.getCurrentFile();null!=d&&(d.savingFile?this.handleError({message:mxResources.get("busy")}):
+!a&&d.invalidChecksum?d.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(d.clearAutosave(),this.editor.setStatus(""),a?d.reloadFile(mxUtils.bind(this,function(){d.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){d.handleFileError(a,!0)})):d.synchronizeFile(mxUtils.bind(this,function(){d.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(a){d.handleFileError(a,!0)}))))};EditorUi.prototype.getFileData=
+function(a,b,c,e,l,p,k,x,u){l=null!=l?l:!0;k=null!=k?k:this.getXmlFileData(l,null!=p?p:!1);u=null!=u?u:this.getCurrentFile();p=this.editor.graph;if(null!=this.pages&&this.currentPage!=this.pages[0]&&(b||!a&&null!=u&&/(\.svg)$/i.test(u.getTitle()))){p=this.createTemporaryGraph(p.getStylesheet());var d=p.getGlobalVariable,f=this.pages[0];p.getGlobalVariable=function(a){return"page"==a?f.getName():"pagenumber"==a?1:d.apply(this,arguments)};document.body.appendChild(p.container);p.model.setRoot(f.root)}a=
+this.createFileData(k,p,u,window.location.href,a,b,c,e,l,x);p!=this.editor.graph&&p.container.parentNode.removeChild(p.container);return a};EditorUi.prototype.getHtml=function(a,b,c,e,l,p){p=null!=p?p:!0;var d=null,f=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=b){var d=p?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),g=b.view.scale;p=Math.floor(d.x/g-b.view.translate.x);g=Math.floor(d.y/g-b.view.translate.y);d=b.background;null==l&&(b=this.getBasenames().join(";"),0<b.length&&
+(f=EditorUi.drawHost+"/embed.js?s="+b));a.setAttribute("x0",p);a.setAttribute("y0",g)}null!=a&&(a.setAttribute("pan","1"),a.setAttribute("zoom","1"),a.setAttribute("resize","0"),a.setAttribute("fit","0"),a.setAttribute("border","20"),a.setAttribute("links","1"),null!=e&&a.setAttribute("edit",e));null!=l&&(l=l.replace(/&/g,"&amp;"));a=null!=a?Graph.zapGremlins(mxUtils.getXml(a)):"";e=Graph.compress(a);Graph.decompress(e)!=a&&(e=encodeURIComponent(a));return(null==l?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':
+"")+"<!DOCTYPE html>\n<html"+(null!=l?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==l?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=l?'<meta http-equiv="refresh" content="0;URL=\''+l+"'\"/>\n":"")+"</head>\n<body"+(null==l&&null!=d&&d!=mxConstants.NONE?' style="background-color:'+d+';">':">")+'\n<div class="mxgraph" style="position:relative;overflow:auto;width:100%;">\n<div style="width:1px;height:1px;overflow:hidden;">'+e+
+"</div>\n</div>\n"+(null==l?'<script type="text/javascript" src="'+f+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+l+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.getHtml2=function(a,b,c,e,l){b=EditorUi.drawHost+"/js/viewer.min.js";null!=l&&(l=l.replace(/&/g,"&amp;"));a={highlight:"#0000ff",nav:this.editor.graph.foldingEnabled,resize:!0,xml:Graph.zapGremlins(a),
+toolbar:"pages zoom layers lightbox"};null!=this.pages&&null!=this.currentPage&&(a.page=mxUtils.indexOf(this.pages,this.currentPage));return(null==l?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=l?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+(null==l?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>Draw.io Diagram</title>\n")+(null!=l?'<meta http-equiv="refresh" content="0;URL=\''+l+"'\"/>\n":
+"")+'<meta charset="utf-8"/>\n</head>\n<body>\n<div class="mxgraph" style="max-width:100%;border:1px solid transparent;" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(a))+'"></div>\n'+(null==l?'<script type="text/javascript" src="'+b+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+l+'" target="_blank"><img border="0" src="'+EditorUi.drawHost+'/images/drawlogo128.png"/></a>')+"\n</body>\n</html>\n"};EditorUi.prototype.setFileData=function(a){a=
+this.validateFileData(a);this.pages=this.fileNode=this.currentPage=null;a=null!=a&&0<a.length?mxUtils.parseXml(a).documentElement:null;var d=null!=a?a.getElementsByTagName("parsererror"):null;if(null!=d&&0<d.length)throw a=mxResources.get("invalidOrMissingFile"),d=d[0].getElementsByTagName("div"),0<d.length&&(a=mxUtils.getTextContent(d[0])),Error(a);d=null!=a?this.editor.extractGraphModel(a,!0):null;null!=d&&(a=d);if(null!=a&&"mxfile"==a.nodeName&&(d=a.getElementsByTagName("diagram"),"0"!=urlParams.pages||
+1<d.length||1==d.length&&d[0].hasAttribute("name"))){var b=null;this.fileNode=a;this.pages=[];for(a=0;a<d.length;a++){null==d[a].getAttribute("id")&&d[a].setAttribute("id",a);var c=new DiagramPage(d[a]);null==c.getName()&&c.setName(mxResources.get("pageWithNumber",[a+1]));this.pages.push(c);null!=urlParams["page-id"]&&c.getId()==urlParams["page-id"]&&(b=c)}this.currentPage=null!=b?b:this.pages[Math.max(0,Math.min(this.pages.length-1,urlParams.page||0))];a=this.currentPage.node}"0"!=urlParams.pages&&
+null==this.fileNode&&null!=a&&(this.fileNode=a.ownerDocument.createElement("mxfile"),this.currentPage=new DiagramPage(a.ownerDocument.createElement("diagram")),this.currentPage.setName(mxResources.get("pageWithNumber",[1])),this.pages=[this.currentPage]);this.editor.setGraphXml(a);null!=this.currentPage&&(this.currentPage.root=this.editor.graph.model.root)};EditorUi.prototype.getBaseFilename=function(a){var d=this.getCurrentFile(),d=null!=d&&null!=d.getTitle()?d.getTitle():this.defaultFilename;if(/(\.xml)$/i.test(d)||
+/(\.html)$/i.test(d)||/(\.svg)$/i.test(d)||/(\.png)$/i.test(d)||/(\.drawio)$/i.test(d))d=d.substring(0,d.lastIndexOf("."));!a&&null!=this.pages&&1<this.pages.length&&null!=this.currentPage&&null!=this.currentPage.node.getAttribute("name")&&0<this.currentPage.getName().length&&(d=d+"-"+this.currentPage.getName());return d};EditorUi.prototype.downloadFile=function(a,b,c,e,l,p,k){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var d=this.getBaseFilename(!l),f=d+"."+a;if("xml"==a){var g='<?xml version="1.0" encoding="UTF-8"?>\n'+
+(b?mxUtils.getXml(this.editor.getGraphXml(e)):this.getFileData(!0,null,null,null,e,l));this.saveData(f,a,g,"text/xml")}else if("html"==a)g=this.getHtml2(this.getFileData(!0),this.editor.graph,d),this.saveData(f,a,g,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?f=d+".png":"jpeg"==a&&(f=d+".jpg"),this.saveRequest(f,a,mxUtils.bind(this,function(d,b){try{var c=this.editor.graph.pageVisible;null!=p&&(this.editor.graph.pageVisible=p);
+var f=this.createDownloadRequest(d,a,e,b,k,l);this.editor.graph.pageVisible=c;return f}catch(B){this.handleError(B)}}));else{var n=null,y=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(f,"svg",a,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(n)}))});if("svg"==a){var m=this.editor.graph.background;if(k||m==mxConstants.NONE)m=null;var q=this.editor.graph.getSvg(m,null,null,null,
+null,e);c&&this.editor.graph.addSvgShadow(q);this.convertImages(q,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();y('<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a))})))}else f=d+".svg",n=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();y(a)}),e)}}catch(Q){this.handleError(Q)}};EditorUi.prototype.createDownloadRequest=function(a,b,c,e,l,p){var d=
+this.editor.graph.getGraphBounds();c=this.getFileData(!0,null,null,null,c,0==p?!1:"xmlpng"!=b);var f="",g="";if(d.width*d.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};d="0";"pdf"==b&&0==p&&(g="&allPages=1");if("xmlpng"==b&&(d="1",b="png",null!=this.pages&&null!=this.currentPage))for(p=0;p<this.pages.length;p++)if(this.pages[p]==this.currentPage){f="&from="+p;break}p=this.editor.graph.background;"png"==b&&l&&(p=mxConstants.NONE);return new mxXmlRequest(EXPORT_URL,
+"format="+b+f+g+"&bg="+(null!=p?p:mxConstants.NONE)+"&base64="+e+"&embedXml="+d+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var d=window.location.hash,f=mxUtils.bind(this,function(c){var f=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<f.length&&(f+="\n"),f+=c);c=new LocalFile(this,"csv"!=a.format&&0<f.length?f:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):
+this.defaultFilename,!0);c.getHash=function(){return d};this.fileLoaded(c);"csv"==a.format&&this.importCsv(f,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var e=null!=a.interval?parseInt(a.interval):6E4,g=null,l=mxUtils.bind(this,function(){var d=this.currentPage;mxUtils.post(a.update,"xml="+encodeURIComponent(mxUtils.getXml(this.editor.getGraphXml())),mxUtils.bind(this,function(a){d===this.currentPage&&(200<=
+a.getStatus()&&300>=a.getStatus()?(this.updateDiagram(a.getText()),p()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),p=mxUtils.bind(this,function(){window.clearTimeout(g);g=window.setTimeout(l,e)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){p();l()}));p();l()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var e=a.url;/^https?:\/\//.test(e)&&!this.editor.isCorsEnabledForUrl(e)&&(e=PROXY_URL+
+"?url="+encodeURIComponent(e));this.loadUrl(e,mxUtils.bind(this,function(a){f(a)}),mxUtils.bind(this,function(a){null!=c&&c(a)}))}else f("")};EditorUi.prototype.updateDiagram=function(a){function d(a){var d=new mxCellOverlay(a.image||e.warningImage,a.tooltip,a.align,a.valign,a.offset);d.addListener(mxEvent.CLICK,function(d,b){c.alert(a.tooltip)});return d}var b=null,c=this;if(null!=a&&0<a.length&&(b=mxUtils.parseXml(a),a=null!=b?b.documentElement:null,null!=a&&"updates"==a.nodeName)){var e=this.editor.graph,
+p=e.getModel();p.beginUpdate();var k=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var m=p.getCell(a.getAttribute("id"));if(null!=m){try{var u=a.getAttribute("value");if(null!=u){var q=mxUtils.parseXml(u).documentElement;if(null!=q)if("1"==q.getAttribute("replace-value"))p.setValue(m,q);else for(var z=q.attributes,E=0;E<z.length;E++)e.setAttributeForCell(m,z[E].nodeName,0<z[E].nodeValue.length?z[E].nodeValue:null)}}catch(I){null!=window.console&&console.log("Error in value for "+
+m.id+": "+I)}try{var r=a.getAttribute("style");null!=r&&e.model.setStyle(m,r)}catch(I){null!=window.console&&console.log("Error in style for "+m.id+": "+I)}try{var t=a.getAttribute("icon");if(null!=t){var v=0<t.length?JSON.parse(t):null;null!=v&&v.append||e.removeCellOverlays(m);null!=v&&e.addCellOverlay(m,d(v))}}catch(I){null!=window.console&&console.log("Error in icon for "+m.id+": "+I)}try{var A=a.getAttribute("geometry");if(null!=A){var A=JSON.parse(A),M=e.getCellGeometry(m);if(null!=M){M=M.clone();
+for(key in A){var H=parseFloat(A[key]);"dx"==key?M.x+=H:"dy"==key?M.y+=H:"dw"==key?M.width+=H:"dh"==key?M.height+=H:M[key]=parseFloat(A[key])}e.model.setGeometry(m,M)}}}catch(I){null!=window.console&&console.log("Error in icon for "+m.id+": "+I)}}}else if("model"==a.nodeName){for(var B=a.firstChild;null!=B&&B.nodeType!=mxConstants.NODETYPE_ELEMENT;)B=B.nextSibling;null!=B&&(new mxCodec(a.firstChild)).decode(B,p)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&(e.view.scale=parseFloat(a.getAttribute("scale"))),
+a.hasAttribute("dx")||a.hasAttribute("dy"))e.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(k=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{p.endUpdate()}null!=k&&this.chromelessResize&&this.chromelessResize(!0,k)}return b};EditorUi.prototype.getCopyFilename=function(a,b){var d=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,c="",f=d.lastIndexOf(".");0<=f&&(c=
+d.substring(f),d=d.substring(0,f));if(b)var e=new Date,f=e.getFullYear(),k=e.getMonth()+1,m=e.getDate(),u=e.getHours(),q=e.getMinutes(),e=e.getSeconds(),d=d+(" "+(f+"-"+k+"-"+m+"-"+u+"-"+q+"-"+e));return d=mxResources.get("copyOf",[d])+c};EditorUi.prototype.fileLoaded=function(a,b){var d=this.getCurrentFile();this.fileLoadedError=null;this.setCurrentFile(null);var c=!1;this.hideDialog();null!=d&&(d.removeListener(this.descriptorChangedListener),d.close());this.editor.graph.model.clear();this.editor.undoManager.clear();
+var f=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=d&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);!b&&null!=window.location.hash&&0<window.location.hash.length&&(window.location.hash="");null!=this.fname&&(this.fnameWrapper.style.display="none",this.fname.innerHTML="",this.fname.setAttribute("title",mxResources.get("rename")));this.editor.setStatus("");this.updateUi();b||this.showSplash()});
+if(null!=a)try{mxClient.IS_SF&&"min"==uiTheme&&(this.diagramContainer.style.visibility="");this.openingFile=!0;this.setCurrentFile(a);a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();delete this.openingFile;this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.graph.model.prefix=Editor.guid()+"-";this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();a.isEditable()?a.isModified()?(a.addUnsavedStatus(),
+null!=a.backupPatch&&a.patch([a.backupPatch])):this.editor.setStatus(""):this.editor.setStatus('<span class="geStatusAlert" style="margin-left:8px;">'+mxUtils.htmlEntities(mxResources.get("readOnly"))+"</span>");!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(y){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(y){}}catch(y){this.fileLoadedError=y;null!=window.console&&console.log("error in fileLoaded:",a,y);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!=y&&null!=y.message?":err:"+encodeURIComponent(y.message):"")+(null!=y&&null!=y.stack?"&stack="+encodeURIComponent(y.stack):"")}catch(x){}var e=mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):
+null!=d?this.fileLoaded(d):f()});b?e():this.handleError(y,mxResources.get("errorLoadingFile"),e,!0)}else f();return c};EditorUi.prototype.getHashValueForPages=function(a,b){var d=0,c=new mxGraphModel,f=new mxCodec;null!=b&&(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0);for(var e=0;e<a.length;e++){this.updatePageRoot(a[e]);var k=a[e].node.cloneNode(!1);k.removeAttribute("name");c.root=a[e].root;var m=f.encode(c);this.editor.graph.saveViewState(a[e].viewState,m,!0);m.removeAttribute("pageWidth");
+m.removeAttribute("pageHeight");k.appendChild(m);null!=b&&(b.eltCount+=k.getElementsByTagName("*").length,b.nodeCount+=k.getElementsByTagName("mxCell").length);d=(d<<5)-d+this.hashValue(k,function(a,d,b,c){return!c||"mxGeometry"!=a.nodeName&&"mxPoint"!=a.nodeName||"x"!=d&&"y"!=d&&"width"!=d&&"height"!=d?c&&"mxCell"==a.nodeName&&"previous"==d?null:b:Math.round(b)},b)<<0}return d};EditorUi.prototype.hashValue=function(a,b,c){var d=0;if(null!=a&&"object"===typeof a&&"number"===typeof a.nodeType&&"string"===
+typeof a.nodeName&&"function"===typeof a.getAttribute){null!=a.nodeName&&(d^=this.hashValue(a.nodeName,b,c));if(null!=a.attributes){null!=c&&(c.attrCount+=a.attributes.length);for(var f=0;f<a.attributes.length;f++){var e=a.attributes[f].name,g=null!=b?b(a,e,a.attributes[f].value,!0):a.attributes[f].value;null!=g&&(d^=this.hashValue(e,b,c)+this.hashValue(g,b,c))}}if(null!=a.childNodes)for(f=0;f<a.childNodes.length;f++)d=(d<<5)-d+this.hashValue(a.childNodes[f],b,c)<<0}else if(null!=a&&"function"!==
+typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(f=0;f<a.length;f++)b=(b<<5)-b+a.charCodeAt(f)<<0;d^=b}return d};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,e,l,p,k){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",
+mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var d=mxUtils.createXmlDocument(),b=d.createElement("mxlibrary");mxUtils.setTextContent(b,JSON.stringify(a));d.appendChild(b);return mxUtils.getXml(d)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),
+".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var d=this.sidebar.palettes[a];if(null!=d){for(var b=0;b<d.length;b++)d[b].parentNode.removeChild(d[b]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var d=this.sidebar.container;if(null==a){var b=this.sidebar.palettes["L.scratchpad"];null==b&&(b=this.sidebar.palettes.search);null!=b&&(a=b[b.length-1].nextSibling)}a=null!=a?a:d.firstChild.nextSibling.nextSibling;
+var b=d.lastChild,c=b.previousSibling;d.insertBefore(b,a);d.insertBefore(c,b)};EditorUi.prototype.loadLibrary=function(a){var d=mxUtils.parseXml(a.getData());if("mxlibrary"==d.documentElement.nodeName){var b=JSON.parse(mxUtils.getTextContent(d.documentElement));this.libraryLoaded(a,b,d.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,c){if(null!=
+this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var d=this.sidebar.palettes[a.getHash()],d=null!=d?d[d.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(d,b){0==d.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),f.className="geDropTarget",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f)):this.addLibraryEntries(d,b)});if(null!=
+this.sidebar&&null!=b)for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){var d=a.data;null!=d&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){d=this.convertDataUri(d);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+d,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var d=
+this.stringToCells(Graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(d,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);c=null!=c&&0<c.length?c:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),c,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(d);var u=k.parentNode.previousSibling;c=u.getAttribute("title");null!=c&&0<c.length&&".scratchpad"!=a.title&&u.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+c);var m=document.createElement("div");m.style.position=
+"absolute";m.style.right="0px";m.style.top="0px";m.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(m.style.backgroundColor="inherit");u.style.position="relative";var z=document.createElement("img");z.setAttribute("src",Dialog.prototype.closeImage);z.setAttribute("title",mxResources.get("close"));z.setAttribute("valign","absmiddle");z.setAttribute("border","0");z.style.margin="0 3px";var q=null;if(".scratchpad"!=a.title||this.closableScratchpad)m.appendChild(z),mxEvent.addListener(z,
+"click",mxUtils.bind(this,function(d){if(!mxEvent.isConsumed(d)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=q?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(d)}}));if(a.isEditable()){var r=this.editor.graph,t=null,v=mxUtils.bind(this,function(d){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(d)}),A=mxUtils.bind(this,function(d){a.setModified(!0);a.isAutosave()?(null!=
+t&&null!=t.parentNode&&t.parentNode.removeChild(t),t=z.cloneNode(!1),t.setAttribute("src",Editor.spinImage),t.setAttribute("title",mxResources.get("saving")),t.style.cursor="default",t.style.marginRight="2px",t.style.marginTop="-2px",m.insertBefore(t,m.firstChild),u.style.paddingRight=18*m.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=t&&null!=t.parentNode&&(t.parentNode.removeChild(t),u.style.paddingRight=18*m.childNodes.length+"px")})):null==q&&(q=z.cloneNode(!1),
+q.setAttribute("src",IMAGE_PATH+"/download.png"),q.setAttribute("title",mxResources.get("save")),m.insertBefore(q,m.firstChild),mxEvent.addListener(q,"click",mxUtils.bind(this,function(d){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==q||a.isModified()||(u.style.paddingRight=18*m.childNodes.length+"px",q.parentNode.removeChild(q),q=null)});mxEvent.consume(d)})),u.style.paddingRight=18*m.childNodes.length+"px")}),M=mxUtils.bind(this,function(a,d,c,e){a=
+r.cloneCells(mxUtils.sortCells(r.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var l=r.getCellGeometry(a[g]);null!=l&&l.translate(-d.x,-d.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,d.width,d.height,e||"",!0,!1,!1));a={xml:Graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:d.width,h:d.height};null!=e&&(a.title=e);b.push(a);A(c);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),H=mxUtils.bind(this,function(a){if(r.isSelectionEmpty())r.getRubberband().isActive()?
+(r.getRubberband().execute(a),r.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var d=r.getSelectionCells(),b=r.view.getBounds(d),c=r.view.scale;b.x/=c;b.y/=c;b.width/=c;b.height/=c;b.x-=r.view.translate.x;b.y-=r.view.translate.y;M(d,b)}mxEvent.consume(a)});mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){r.isMouseDown&&null!=r.panningManager&&null!=r.graphHandler.shape&&(r.graphHandler.shape.node.style.visibility=
+"hidden",k.style.backgroundColor="#f1f3f4",k.style.cursor="copy",r.panningManager.stop(),r.autoScroll=!1,null!=r.graphHandler.guide&&r.graphHandler.guide.setVisible(!1),null!=r.graphHandler.hint&&(r.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){r.isMouseDown&&null!=r.panningManager&&null!=r.graphHandler&&(k.style.backgroundColor="",k.style.cursor="default",this.sidebar.showTooltips=!0,r.panningManager.stop(),r.graphHandler.reset(),r.isMouseDown=!1,
+r.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){r.isMouseDown&&null!=r.graphHandler.shape&&(r.graphHandler.shape.node.style.visibility="visible",k.style.backgroundColor="",k.style.cursor="",r.autoScroll=!0,null!=r.graphHandler.guide&&r.graphHandler.guide.setVisible(!0),null!=r.graphHandler.hint&&(r.graphHandler.hint.style.visibility="visible"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){k.style.backgroundColor=
+"#f1f3f4";a.dataTransfer.dropEffect="copy";k.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.cursor="";k.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(d,c,g,l,p,n,u,m,y){if(null!=d&&"image/"==c.substring(0,6))d="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(d),
+d=[new mxCell("",new mxGeometry(0,0,p,n),d)],d[0].vertex=!0,M(d,new mxRectangle(0,0,p,n),a,mxEvent.isAltDown(a)?null:u.substring(0,u.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var r=!1,z=mxUtils.bind(this,function(d,c){if(null!=d&&"text/xml"==c){var g=mxUtils.parseXml(d);if("mxlibrary"==g.documentElement.nodeName)try{var l=JSON.parse(mxUtils.getTextContent(g.documentElement));e(l,k);b=b.concat(l);A(a);this.spinner.stop();
+r=!0}catch(F){}else if("mxfile"==g.documentElement.nodeName)try{for(var p=g.documentElement.getElementsByTagName("diagram"),g=0;g<p.length;g++){var l=mxUtils.getTextContent(p[g]),n=this.stringToCells(Graph.decompress(l)),u=this.editor.graph.getBoundingBoxFromGeometry(n);M(n,new mxRectangle(0,0,u.width,u.height),a)}r=!0}catch(F){null!=window.console&&console.log("error in drop handler:",F)}}r||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&
+0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=y&&null!=u&&(/(\.v(dx|sdx?))($|\?)/i.test(u)||/(\.vs(x|sx?))($|\?)/i.test(u))?this.importVisio(y,function(a){z(a,"text/xml")},null,u):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,u)&&null!=y?this.parseFile(y,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?z(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},
+mxResources.get("errorLoadingFile")))})):z(d,c)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){k.style.cursor="";k.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));z=z.cloneNode(!1);z.setAttribute("src",Editor.editImage);z.setAttribute("title",mxResources.get("edit"));m.insertBefore(z,m.firstChild);mxEvent.addListener(z,"click",v);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&v(a)});c=z.cloneNode(!1);c.setAttribute("src",
+Editor.plusImage);c.setAttribute("title",mxResources.get("add"));m.insertBefore(c,m.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)})),
+m.insertBefore(c,m.firstChild))}u.appendChild(m);u.style.paddingRight=18*m.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var d=0;d<a.length;d++){var c=a[d],f=c.data;if(null!=f){var f=this.convertDataUri(f),e="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==c.aspect&&(e+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(e+"image="+f,c.w,c.h,"",c.title||"",!1,!1,!0))}else null!=c.xml&&(f=this.stringToCells(Graph.decompress(c.xml)),
+0<f.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(f,c.w,c.h,c.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=function(a){return null!=a?a[mxLanguage]||a.main:null};EditorUi.prototype.footerHeight=0;"1"==urlParams.offline||EditorUi.isElectronApp||("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.createFooter=function(){return document.getElementById("geFooter")});EditorUi.initTheme=function(){"atlas"==uiTheme?
+(mxClient.link("stylesheet",STYLE_PATH+"/atlas.css"),"undefined"!==typeof Toolbar&&(Toolbar.prototype.unselectedBackground=mxClient.IS_QUIRKS?"none":"linear-gradient(rgb(255, 255, 255) 0px, rgb(242, 242, 242) 100%)",Toolbar.prototype.selectedBackground="rgb(242, 242, 242)"),Editor.prototype.initialTopSpacing=3,EditorUi.prototype.menubarHeight=41,EditorUi.prototype.toolbarHeight=38):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName=
+"darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor=
+"#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))};
+EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display="none",this.refresh())};EditorUi.prototype.showFooter=function(a){var d=document.getElementById("geFooter");null!=d&&(this.footerHeight=a,d.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,c,e,l){a=new ImageDialog(this,a,b,c,e,l);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,
+!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=!0;this.editor.graph.model.execute(a)});var d=new BackgroundImageDialog(this,mxUtils.bind(this,function(d){a(d)}));this.showDialog(d.container,360,200,!0,!0);d.init()};EditorUi.prototype.showLibraryDialog=function(a,b,c,e,l){a=new LibraryDialog(this,a,b,c,e,l);this.showDialog(a.container,640,440,!0,!1,mxUtils.bind(this,function(a){a&&null==
+this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};var b=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(a){var d=b.apply(this,arguments);this.editor.graph.addListener("viewStateChanged",mxUtils.bind(this,function(a){this.editor.graph.isSelectionEmpty()&&d.refresh()}));return d};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer geSidebarFooter");a.style.position="absolute";a.style.overflow="hidden";
+var b=document.createElement("a");b.className="geTitle";b.style.color="#188038";b.style.height="100%";b.style.paddingTop="9px";b.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();mxEvent.consume(a)}));a.appendChild(b);
+return a};EditorUi.prototype.handleError=function(a,b,c,e){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},f=null!=a&&null!=a.error?a.error:a;if(null!=f||null!=b){var g=mxUtils.htmlEntities(mxResources.get("unknownError")),n=mxResources.get("ok"),k=null;b=null!=b?b:mxResources.get("error");if(null!=f)if(null!=f.retry&&(n=mxResources.get("cancel"),k=function(){d();f.retry()}),404==f.code||404==f.status||403==f.code){var g=403==f.code?null!=f.message?mxUtils.htmlEntities(f.message):
+mxUtils.htmlEntities(mxResources.get("accessDenied")):mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")),m=window.location.hash;if(null!=m&&"#G"==m.substring(0,2)&&null!=a&&null!=a.error&&null!=a.error.errors&&0<a.error.errors.length&&"fileAccess"==a.error.errors[0].reason){m=m.substring(2);this.showError(b,g,mxResources.get("cancel"),null,k,mxResources.get("tryOpeningViaThisPage"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+m)}),null,null,
+380);return}}else null!=f.message?g=mxUtils.htmlEntities(f.message):null!=f.response&&null!=f.response.error?g=mxUtils.htmlEntities(f.response.error):"undefined"!==window.App&&(f.code==App.ERROR_TIMEOUT?g=mxUtils.htmlEntities(mxResources.get("timeout")):f.code==App.ERROR_BUSY&&(g=mxUtils.htmlEntities(mxResources.get("busy"))));this.showError(b,g,n,c,k,null,null,null,null,null,null,null,e?c:null)}else null!=c&&c()};EditorUi.prototype.showError=function(a,b,c,e,l,p,k,m,u,q,z,E,r){a=new ErrorDialog(this,
+a,b,c||mxResources.get("ok"),e,l,p,k,E,m,u);this.showDialog(a.container,q||340,z||(null!=b&&120<b.length?180:150),!0,!1,r);a.init()};EditorUi.prototype.alert=function(a,b){var d=new ErrorDialog(this,null,a,mxResources.get("ok"),b);this.showDialog(d.container,340,100,!0,!1);d.init()};EditorUi.prototype.confirm=function(a,b,c,e,l,p){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){};a=new ConfirmDialog(this,a,function(){d();null!=b&&b()},function(){d();null!=c&&c()},
+e,l);this.showDialog(a.container,340,90,!0,p);a.init()};EditorUi.prototype.setCurrentFile=function(a){this.currentFile=a};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||!this.editor.graph.mathEnabled&&this.useCanvasForExport};EditorUi.prototype.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};EditorUi.prototype.createImageDataUri=function(a,b,c){var d=
+a.toDataURL("image/"+c);if(6>=d.length||d==a.cloneNode(!1).toDataURL("image/"+c))throw{message:"Invalid image"};null!=b&&(d=this.writeGraphModelToPng(d,"zTXt","mxGraphModel",atob(Graph.compress(b))));return d};EditorUi.prototype.saveCanvas=function(a,b,c){var d="jpeg"==c?"jpg":c,f=this.getBaseFilename()+"."+d;a=this.createImageDataUri(a,b,c);this.saveData(f,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};EditorUi.prototype.isLocalFileSave=function(){return"remote"!=urlParams.save&&(mxClient.IS_IE||
+"undefined"!==typeof window.Blob&&"undefined"!==typeof window.URL)&&9!=document.documentMode&&8!=document.documentMode&&7!=document.documentMode&&!mxClient.IS_QUIRKS||this.isOfflineApp()||mxClient.IS_IOS};EditorUi.prototype.showTextDialog=function(a,b){var d=new TextareaDialog(this,a,b,null,null,mxResources.get("close"));d.textarea.style.width="600px";d.textarea.style.height="380px";this.showDialog(d.container,620,460,!0,!0);d.init();document.execCommand("selectall",!1,null)};EditorUi.prototype.doSaveLocalFile=
+function(a,b,c,e,l){if(window.Blob&&navigator.msSaveOrOpenBlob)a=e?this.base64ToBlob(a,c):new Blob([a],{type:c}),navigator.msSaveOrOpenBlob(a,b);else if(mxClient.IS_IE)c=window.open("about:blank","_blank"),null==c?mxUtils.popup(a,!0):(c.document.write(a),c.document.close(),c.document.execCommand("SaveAs",!0,b),c.close());else{var d=document.createElement("a"),f=!mxClient.IS_SF&&0>navigator.userAgent.indexOf("PaleMoon/")&&"undefined"!==typeof d.download;if(mxClient.IS_GC)var g=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./),
+f=65==(g?parseInt(g[2],10):!1)?!1:f;if(f||this.isOffline()){d.href=URL.createObjectURL(e?this.base64ToBlob(a,c):new Blob([a],{type:c}));f?d.download=b:d.setAttribute("target","_blank");document.body.appendChild(d);try{window.setTimeout(function(){URL.revokeObjectURL(d.href)},0),d.click(),d.parentNode.removeChild(d)}catch(u){}}else this.createEchoRequest(a,b,c,e,l).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,e,l,p){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,
+a+(null!=c?"&mime="+c:"")+(null!=l?"&format="+l:"")+(null!=p?"&base64="+p:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var d=atob(a),c=d.length,f=Math.ceil(c/1024),e=Array(f),k=0;k<f;++k){for(var m=1024*k,u=Math.min(m+1024,c),q=Array(u-m),z=0;m<u;++z,++m)q[z]=d[m].charCodeAt(0);e[k]=new Uint8Array(q)}return new Blob(e,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,e,l,p,k){p=null!=p?p:!1;k=null!=k?k:
+"vsdx"!=l&&(!mxClient.IS_IOS||!navigator.standalone);l=this.getServiceCount(p);b=new CreateDialog(this,b,mxUtils.bind(this,function(d,b){try{if("_blank"==b)if(null==c||"image/"!=c.substring(0,6)||"image/svg"==c.substring(0,9)&&!mxClient.IS_SVG){var f=window.open("about:blank");null==f?mxUtils.popup(a,!0):(f.document.write(mxUtils.htmlEntities(a,!1)),f.document.close())}else this.openInNewWindow(a,c,e);else b==App.MODE_DEVICE||"download"==b?this.doSaveLocalFile(a,d,c,e):null!=d&&0<d.length&&this.pickFolder(b,
+mxUtils.bind(this,function(f){try{this.exportFile(a,d,c,e,b,f)}catch(E){this.handleError(E)}}))}catch(z){this.handleError(z)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,p,k,null,1<l,4<l&&(!p||6>l)?3:4,a,c,e);this.showDialog(b.container,420,1==l?160:4<l?390:270,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){if(mxClient.IS_GC||mxClient.IS_EDGE||11==document.documentMode||10==document.documentMode){var d=window.open("about:blank");
+null==d||null==d.document?mxUtils.popup(a,!0):("image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):d.document.write('<html><img src="data:'+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))+'"/></html>'),d.document.close())}else d=window.open("data:"+b+(c?";base64,"+a:";charset=utf8,"+encodeURIComponent(a))),null!=d&&null!=d.document||mxUtils.popup(a,!0)};var e=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=
+null;var d=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 c=d.getBoundingClientRect();mxUtils.setPrefixedStyle(this.exportDialog.style,"borderRadius","5px");this.exportDialog.style.position="fixed";this.exportDialog.style.textAlign=
+"center";this.exportDialog.style.fontFamily="Helvetica,Arial";this.exportDialog.style.backgroundColor="#000000";this.exportDialog.style.width="50px";this.exportDialog.style.height="50px";this.exportDialog.style.padding="4px 2px 4px 2px";this.exportDialog.style.color="#ffffff";mxUtils.setOpacity(this.exportDialog,70);this.exportDialog.style.left=c.left+"px";this.exportDialog.style.bottom=parseInt(this.chromelessToolbar.style.bottom)+this.chromelessToolbar.offsetHeight+4+"px";c=mxUtils.getCurrentStyle(this.editor.graph.container);
+this.exportDialog.style.zIndex=c.zIndex;var f=new Spinner({lines:8,length:6,width:5,radius:6,rotate:0,color:"#fff",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"28px",zIndex:2E9});f.spin(this.exportDialog);this.exportToCanvas(mxUtils.bind(this,function(a){f.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var d=this.createImageDataUri(a,null,"png");a=document.createElement("img");a.style.maxWidth="140px";a.style.maxHeight="140px";
+a.style.cursor="pointer";a.style.backgroundColor="white";a.setAttribute("title",mxResources.get("openInNewWindow"));a.setAttribute("border","0");a.setAttribute("src",d);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(d.substring(d.indexOf(",")+1),"image/png",!0);b.apply(this,arguments)}))}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));mxEvent.addListener(this.editor.graph.container,
+"click",b);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),Editor.cameraLargeImage,mxResources.get("export"))}e.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,e,l){this.isLocalFileSave()?this.saveLocalFile(c,a,e,l,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,d){return this.createEchoRequest(c,a,e,l,b,d)}),c,l,e)};EditorUi.prototype.saveRequest=function(a,b,c,e,l,p,k){k=null!=k?k:!mxClient.IS_IOS||!navigator.standalone;var d=this.getServiceCount(!1);a=new CreateDialog(this,
+a,mxUtils.bind(this,function(a,d){if("_blank"==d||null!=a&&0<a.length){var f=c("_blank"==d?null:a,d==App.MODE_DEVICE||"download"==d||null==d||"_blank"==d?"0":"1");null!=f&&(d==App.MODE_DEVICE||"download"==d||"_blank"==d?f.simulate(document,"_blank"):this.pickFolder(d,mxUtils.bind(this,function(c){p=null!=p?p:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,p,!0,d,c)}catch(r){this.handleError(r)}else this.spinner.spin(document.body,mxResources.get("saving"))&&f.send(mxUtils.bind(this,
+function(){this.spinner.stop();if(200<=f.getStatus()&&299>=f.getStatus())try{this.exportFile(f.getText(),a,p,!0,d,c)}catch(r){this.handleError(r)}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<d,4<d?3:4,e,p,l);this.showDialog(a.container,380,1==d?160:4<d?390:270,!0,!0);a.init()};EditorUi.prototype.getEditBlankXml=
+function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,e,l,p){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,e,l,p,k,m,u,q){if(this.spinner.spin(document.body,mxResources.get("export"))){var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;d=b?null:this.editor.graph.background;d==mxConstants.NONE&&(d=null);null==d&&0==b&&(d="#ffffff");var f=this.editor.graph.getSvg(d,a,k,m,null,c,null,null,"blank"==q?"_blank":
+"self"==q?"_top":null);e&&this.editor.graph.addSvgShadow(f);var g=this.getBaseFilename()+".svg",n=mxUtils.bind(this,function(a){this.spinner.stop();l&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,u));if(null!=this.editor.fontCss){var d=a.ownerDocument,d=null!=d.createElementNS?d.createElementNS(mxConstants.NS_SVG,"style"):d.createElement("style");d.setAttribute("type","text/css");mxUtils.setTextContent(d,this.editor.fontCss);a.getElementsByTagName("defs")[0].appendChild(d)}var b=
+'<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?this.saveData(g,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.convertMath(this.editor.graph,f,!1,mxUtils.bind(this,function(){p?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.convertImages(f,n,this.thumbImageCache)):
+n(f)}))}};EditorUi.prototype.addRadiobox=function(a,b,c,e,l,p,k){return this.addCheckbox(a,c,e,l,p,k,!0,b)};EditorUi.prototype.addCheckbox=function(a,b,c,e,l,p,k,m){p=null!=p?p:!0;var d=document.createElement("input");d.style.marginRight="8px";d.style.marginTop="16px";d.setAttribute("type",k?"radio":"checkbox");k="geCheckbox-"+Editor.guid();d.id=k;null!=m&&d.setAttribute("name",m);c&&(d.setAttribute("checked","checked"),d.defaultChecked=!0);e&&d.setAttribute("disabled","disabled");p&&(a.appendChild(d),
+c=document.createElement("label"),mxUtils.write(c,b),c.setAttribute("for",k),a.appendChild(c),l||mxUtils.br(a));return d};EditorUi.prototype.addEditButton=function(a,b){var d=this.addCheckbox(a,mxResources.get("edit")+":",!0,null,!0);d.style.marginLeft="24px";var c=this.getCurrentFile(),f="";null!=c&&c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER&&(f=window.location.href);var e=document.createElement("select");e.style.width="120px";e.style.marginLeft="8px";e.style.marginRight="10px";
+e.className="geBtn";c=document.createElement("option");c.setAttribute("value","blank");mxUtils.write(c,mxResources.get("makeCopy"));e.appendChild(c);c=document.createElement("option");c.setAttribute("value","custom");mxUtils.write(c,mxResources.get("custom")+"...");e.appendChild(c);a.appendChild(e);mxEvent.addListener(e,"change",mxUtils.bind(this,function(){if("custom"==e.value){var a=new FilenameDialog(this,f,mxResources.get("ok"),function(a){null!=a?f=a:e.value="blank"},mxResources.get("url"),null,
+null,null,null,function(){e.value="blank"});this.showDialog(a.container,300,80,!0,!1);a.init()}}));mxEvent.addListener(d,"change",mxUtils.bind(this,function(){d.checked&&(null==b||b.checked)?e.removeAttribute("disabled"):e.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return d.checked?"blank"===e.value?"_blank":f:null},getEditInput:function(){return d},getEditSelect:function(){return e}}};EditorUi.prototype.addLinkSection=function(a,b){function d(){k.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+
+(null!=f&&f!=mxConstants.NONE?"border:1px solid black;background-color:"+f:"background-position:center center;background-repeat:no-repeat;background-image:url('"+Dialog.prototype.closeImage+"')")+';"></div>'}mxUtils.write(a,mxResources.get("links")+":");var c=document.createElement("select");c.style.width="100px";c.style.marginLeft="8px";c.style.marginRight="10px";c.className="geBtn";var e=document.createElement("option");e.setAttribute("value","auto");mxUtils.write(e,mxResources.get("automatic"));
+c.appendChild(e);e=document.createElement("option");e.setAttribute("value","blank");mxUtils.write(e,mxResources.get("openInNewWindow"));c.appendChild(e);e=document.createElement("option");e.setAttribute("value","self");mxUtils.write(e,mxResources.get("openInThisWindow"));c.appendChild(e);b&&(e=document.createElement("option"),e.setAttribute("value","frame"),mxUtils.write(e,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),c.appendChild(e));a.appendChild(c);mxUtils.write(a,mxResources.get("borderColor")+
+":");var f="#0000ff",k=null,k=mxUtils.button("",mxUtils.bind(this,function(a){this.pickColor(f||"none",function(a){f=a;d()});mxEvent.consume(a)}));d();k.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";k.style.marginLeft="4px";k.style.height="22px";k.style.width="22px";k.style.position="relative";k.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";k.className="geColorBtn";a.appendChild(k);mxUtils.br(a);return{getColor:function(){return f},getTarget:function(){return c.value},
+focus:function(){c.focus()}}};EditorUi.prototype.createLink=function(a,b,c,e,l,p,k,m){var d=this.getCurrentFile(),f=[];e&&(f.push("lightbox=1"),"auto"!=a&&f.push("target="+a),null!=b&&b!=mxConstants.NONE&&f.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=l&&0<l.length&&f.push("edit="+encodeURIComponent(l)),p&&f.push("layers=1"),this.editor.graph.foldingEnabled&&f.push("nav=1"));c&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&f.push("page-id="+this.currentPage.getId());
+a=!0;null!=k?c="#U"+encodeURIComponent(k):(d=this.getCurrentFile(),m||null==d||d.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+d.getHash(),a=!1));a&&null!=d&&null!=d.getTitle()&&d.getTitle()!=this.defaultFilename&&f.push("title="+encodeURIComponent(d.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:
+"https://"+window.location.host+"/")+(0<f.length?"?"+f.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,e,l,k,m,x,u,q,z){this.getBasenames();var d={};""!=l&&l!=mxConstants.NONE&&(d.highlight=l);"auto"!==e&&(d.target=e);u||(d.lightbox=!1);d.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(d.zoom=c/100);c=[];m&&(c.push("pages"),d.resize=!0,null!=this.pages&&null!=this.currentPage&&(d.page=mxUtils.indexOf(this.pages,this.currentPage)));b&&(c.push("zoom"),d.resize=!0);
+x&&c.push("layers");0<c.length&&(u&&c.push("lightbox"),d.toolbar=c.join(" "));null!=q&&0<q.length&&(d.edit=q);null!=a?d.url=a:d.xml=this.getFileData(!0,null,null,null,null,!m);b='<div class="mxgraph" style="'+(k?"max-width:100%;":"")+(""!=c?"border:1px solid transparent;":"")+'" data-mxgraph="'+mxUtils.htmlEntities(JSON.stringify(d))+'"></div>';a=null!=a?"&fetch="+encodeURIComponent(a):"";z(b,'<script type="text/javascript" src="'+(0<a.length?("1"==urlParams.dev?"https://test.draw.io/embed2.js?dev=1":
+EditorUi.drawHost+"/embed2.js?")+a:"1"==urlParams.dev?"https://test.draw.io/js/viewer.min.js":window.VIEWER_URL?window.VIEWER_URL:EditorUi.drawHost+"/js/viewer.min.js")+'">\x3c/script>')};EditorUi.prototype.showHtmlDialog=function(a,b,c,e){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,mxResources.get("html"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(f);var g=document.createElement("div");
+g.style.cssText="border-bottom:1px solid lightGray;padding-bottom:8px;margin-bottom:12px;";var k=document.createElement("input");k.style.cssText="margin-right:8px;margin-top:8px;margin-bottom:8px;";k.setAttribute("value","url");k.setAttribute("type","radio");k.setAttribute("name","type-embedhtmldialog");f=k.cloneNode(!0);f.setAttribute("value","copy");g.appendChild(f);var n=document.createElement("span");mxUtils.write(n,mxResources.get("includeCopyOfMyDiagram"));g.appendChild(n);mxUtils.br(g);g.appendChild(k);
+n=document.createElement("span");mxUtils.write(n,mxResources.get("publicDiagramUrl"));g.appendChild(n);var m=this.getCurrentFile();null==c&&null!=m&&m.constructor==window.DriveFile&&(n=document.createElement("a"),n.style.paddingLeft="12px",n.style.color="gray",n.setAttribute("href","javascript:void(0);"),mxUtils.write(n,mxResources.get("share")),g.appendChild(n),mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(m.getId())})));f.setAttribute("checked",
+"checked");null==c&&k.setAttribute("disabled","disabled");d.appendChild(g);var z=this.addLinkSection(d),q=this.addCheckbox(d,mxResources.get("zoom"),!0,null,!0);mxUtils.write(d,":");var r=document.createElement("input");r.setAttribute("type","text");r.style.marginRight="16px";r.style.width="60px";r.style.marginLeft="4px";r.style.marginRight="12px";r.value="100%";d.appendChild(r);var t=this.addCheckbox(d,mxResources.get("fit"),!0),g=null!=this.pages&&1<this.pages.length,v=v=this.addCheckbox(d,mxResources.get("allPages"),
+g,!g),A=this.addCheckbox(d,mxResources.get("layers"),!0),M=this.addCheckbox(d,mxResources.get("lightbox"),!0),H=this.addEditButton(d,M),B=H.getEditInput();B.style.marginBottom="16px";mxEvent.addListener(M,"change",function(){M.checked?B.removeAttribute("disabled"):B.setAttribute("disabled","disabled");B.checked&&M.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,d,mxUtils.bind(this,function(){e(k.checked?c:null,q.checked,
+r.value,z.getTarget(),z.getColor(),t.checked,v.checked,A.checked,M.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);f.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,e,l,k){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,a||mxResources.get("link"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(f);var g=this.getCurrentFile(),f="https://desk.draw.io/support/solutions/articles/16000051941";
+a=0;if(null!=g&&g.constructor==window.DriveFile&&!b){a=80;var f="https://desk.draw.io/support/solutions/articles/16000039384",p=document.createElement("div");p.style.cssText="border-bottom:1px solid lightGray;padding-bottom:14px;padding-top:6px;margin-bottom:14px;text-align:center;";var n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));p.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(g.getId())}));
+n.style.marginTop="12px";n.className="geBtn";p.appendChild(n);d.appendChild(p);n=document.createElement("a");n.style.paddingLeft="12px";n.style.color="gray";n.style.fontSize="11px";n.setAttribute("href","javascript:void(0);");mxUtils.write(n,mxResources.get("check"));p.appendChild(n);mxEvent.addListener(n,"click",mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"))&&this.getPublicUrl(this.getCurrentFile(),mxUtils.bind(this,function(a){this.spinner.stop();a=new ErrorDialog(this,
+null,mxResources.get(null!=a?"diagramIsPublic":"diagramIsNotPublic"),mxResources.get("ok"));this.showDialog(a.container,300,80,!0,!1);a.init()}))}))}var m=null,r=null;if(null!=c||null!=e)a+=30,mxUtils.write(d,mxResources.get("width")+":"),m=document.createElement("input"),m.setAttribute("type","text"),m.style.marginRight="16px",m.style.width="50px",m.style.marginLeft="6px",m.style.marginRight="16px",m.style.marginBottom="10px",m.value="100%",d.appendChild(m),mxUtils.write(d,mxResources.get("height")+
+":"),r=document.createElement("input"),r.setAttribute("type","text"),r.style.width="50px",r.style.marginLeft="6px",r.style.marginBottom="10px",r.value=e+"px",d.appendChild(r),mxUtils.br(d);var q=this.addLinkSection(d,k);c=null!=this.pages&&1<this.pages.length;var t=null;if(null==g||g.constructor!=window.DriveFile||b)t=this.addCheckbox(d,mxResources.get("allPages"),c,!c);var v=this.addCheckbox(d,mxResources.get("lightbox"),!0),A=this.addEditButton(d,v),H=A.getEditInput(),B=this.addCheckbox(d,mxResources.get("layers"),
+!0);B.style.marginLeft=H.style.marginLeft;B.style.marginBottom="16px";B.style.marginTop="8px";mxEvent.addListener(v,"change",function(){v.checked?(B.removeAttribute("disabled"),H.removeAttribute("disabled")):(B.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&v.checked?A.getEditSelect().removeAttribute("disabled"):A.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){l(q.getTarget(),q.getColor(),null==t?
+!0:t.checked,v.checked,A.getLink(),B.checked,null!=m?m.value:null,null!=r?r.value:null)}),null,mxResources.get("create"),f);this.showDialog(b.container,340,254+a,!0,!0);null!=m?(m.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)):q.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,e){var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=document.createElement("h3");mxUtils.write(f,
+mxResources.get("image"));f.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";d.appendChild(f);var g=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),k=e?null:this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),!0),f=this.editor.graph,n=e?null:this.addCheckbox(d,mxResources.get("transparentBackground"),f.background==mxConstants.NONE||null==f.background);null!=n&&(n.style.marginBottom="16px");a=new CustomDialog(this,d,
+mxUtils.bind(this,function(){c(!g.checked,null!=k?k.checked:!1,null!=n?n.checked:!1)}),null,a,b);this.showDialog(a.container,300,e?100:186,!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,e,l,k,m,q){m=null!=m?m:!0;var d=document.createElement("div");d.style.whiteSpace="nowrap";var f=this.editor.graph,g="jpeg"==q?196:300,p=document.createElement("h3");mxUtils.write(p,a);p.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";d.appendChild(p);mxUtils.write(d,mxResources.get("zoom")+
+":");var n=document.createElement("input");n.setAttribute("type","text");n.style.marginRight="16px";n.style.width="60px";n.style.marginLeft="4px";n.style.marginRight="12px";n.value=this.lastExportZoom||"100%";d.appendChild(n);mxUtils.write(d,mxResources.get("borderWidth")+":");var y=document.createElement("input");y.setAttribute("type","text");y.style.marginRight="16px";y.style.width="60px";y.style.marginLeft="4px";y.value=this.lastExportBorder||"0";d.appendChild(y);mxUtils.br(d);var x=this.addCheckbox(d,
+mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=q),t=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,f.isSelectionEmpty()),v=document.createElement("input");v.style.marginTop="16px";v.style.marginRight="8px";v.style.marginLeft="24px";v.setAttribute("disabled","disabled");v.setAttribute("type","checkbox");k&&(d.appendChild(v),mxUtils.write(d,mxResources.get("crop")),mxUtils.br(d),g+=26,mxEvent.addListener(t,"change",function(){t.checked?v.removeAttribute("disabled"):v.setAttribute("disabled",
+"disabled")}));f.isSelectionEmpty()||(v.setAttribute("checked","checked"),v.defaultChecked=!0);var H=this.addCheckbox(d,mxResources.get("shadow"),f.shadowVisible),B=document.createElement("input");B.style.marginTop="16px";B.style.marginRight="8px";B.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||B.setAttribute("disabled","disabled");b&&(d.appendChild(B),mxUtils.write(d,mxResources.get("embedImages")),mxUtils.br(d),g+=26);var I=this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),
+m,null,null,"jpeg"!=q),A=null!=this.pages&&1<this.pages.length,V=this.addCheckbox(d,A?mxResources.get("allPages"):"",A,!A,null,"jpeg"!=q);V.style.marginLeft="24px";V.style.marginBottom="16px";A||(V.style.display="none");mxEvent.addListener(I,"change",function(){I.checked&&A?V.removeAttribute("disabled"):V.setAttribute("disabled","disabled")});m&&A||V.setAttribute("disabled","disabled");var U=document.createElement("select");U.style.maxWidth="260px";U.style.marginLeft="8px";U.style.marginRight="10px";
+U.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));U.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));U.appendChild(a);a=document.createElement("option");a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));U.appendChild(a);"svg"==q&&(mxUtils.write(d,mxResources.get("links")+":"),d.appendChild(U),mxUtils.br(d),
+mxUtils.br(d),g+=26);c=new CustomDialog(this,d,mxUtils.bind(this,function(){this.lastExportBorder=y.value;this.lastExportZoom=n.value;l(n.value,x.checked,!t.checked,H.checked,I.checked,B.checked,y.value,v.checked,!V.checked,U.value)}),null,c,e);this.showDialog(c.container,340,g,!0,!0);n.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?n.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,e,l){var d=document.createElement("div");
+d.style.whiteSpace="nowrap";var f=this.editor.graph;if(null!=b){var g=document.createElement("h3");mxUtils.write(g,b);g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";d.appendChild(g)}var k=this.addCheckbox(d,mxResources.get("fit"),!0),n=this.addCheckbox(d,mxResources.get("shadow"),f.shadowVisible&&e,!e),m=this.addCheckbox(d,c),q=this.addCheckbox(d,mxResources.get("lightbox"),!0),r=this.addEditButton(d,q),t=r.getEditInput(),v=1<f.model.getChildCount(f.model.getRoot()),
+A=this.addCheckbox(d,mxResources.get("layers"),v,!v);A.style.marginLeft=t.style.marginLeft;A.style.marginBottom="12px";A.style.marginTop="8px";mxEvent.addListener(q,"change",function(){q.checked?(v&&A.removeAttribute("disabled"),t.removeAttribute("disabled")):(A.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled"));t.checked&&q.checked?r.getEditSelect().removeAttribute("disabled"):r.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,
+function(){a(k.checked,n.checked,m.checked,q.checked,r.getLink(),A.checked)}),null,mxResources.get("embed"),l);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,e,l,k,m,q){function d(d){var b=" ",g="";e&&(b=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
+EditorUi.drawHost+"/?client=1&lightbox=1"+(l?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",g+="cursor:pointer;");a&&(g+="max-width:100%;");var p="";c&&(p=' width="'+Math.round(f.width)+'" height="'+Math.round(f.height)+'"');m('<img src="'+d+'"'+p+(""!=g?' style="'+g+'"':"")+b+"/>")}var f=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.exportToCanvas(mxUtils.bind(this,function(a){var b=e?this.getFileData(!0):null;a=this.createImageDataUri(a,b,"png");d(a)}),null,null,null,
+mxUtils.bind(this,function(a){q({message:mxResources.get("unknownError")})}),null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),f.width*f.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var g="";c&&(g="&w="+Math.round(2*f.width)+"&h="+Math.round(2*f.height));var p=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+g+"&xml="+encodeURIComponent(b));p.send(mxUtils.bind(this,function(){200<=p.getStatus()&&299>=p.getStatus()?d("data:image/png;base64,"+p.getText()):q({message:mxResources.get("unknownError")})}))}else q({message:mxResources.get("drawingTooLarge")})};
+EditorUi.prototype.createEmbedSvg=function(a,b,c,e,l,k,m){var d=this.editor.graph.getSvg(),f=d.getElementsByTagName("a");if(null!=f)for(var g=0;g<f.length;g++){var p=f[g].getAttribute("href");null!=p&&"#"==p.charAt(0)&&"_blank"==f[g].getAttribute("target")&&f[g].removeAttribute("target")}e&&d.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(d);if(c){var n=" ",r="";e&&(n="onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
+EditorUi.drawHost+"/?client=1&lightbox=1"+(l?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",r+="cursor:pointer;");a&&(r+="max-width:100%;");this.convertImages(d,mxUtils.bind(this,function(a){m('<img src="'+this.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=r?' style="'+r+'"':"")+n+"/>")}))}else r="",e&&(d.setAttribute("onclick","(function(svg){var src=window.event.target||window.event.srcElement;while (src!=null&&src.nodeName.toLowerCase()!='a'){src=src.parentNode;}if(src==null){if(svg.wnd!=null&&!svg.wnd.closed){svg.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==svg.wnd){svg.wnd.postMessage(decodeURIComponent(svg.getAttribute('content')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);svg.wnd=window.open('"+
+EditorUi.drawHost+"/?client=1&lightbox=1"+(l?"&edit=_blank":"")+(k?"&layers=1":"")+"');}}})(this);"),r+="cursor:pointer;"),a&&(a=parseInt(d.getAttribute("width")),b=parseInt(d.getAttribute("height")),d.setAttribute("viewBox","-0.5 -0.5 "+a+" "+b),r+="max-width:100%;max-height:"+b+"px;",d.removeAttribute("height")),""!=r&&d.setAttribute("style",r),m(mxUtils.getXml(d))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-a)/1E3);var d=Math.floor(a/31536E3);if(1<d)return d+" "+mxResources.get("years");
+d=Math.floor(a/2592E3);if(1<d)return d+" "+mxResources.get("months");d=Math.floor(a/86400);if(1<d)return d+" "+mxResources.get("days");d=Math.floor(a/3600);if(1<d)return d+" "+mxResources.get("hours");d=Math.floor(a/60);return 1<d?d+" "+mxResources.get("minutes"):1==d?d+" "+mxResources.get("minute"):null};EditorUi.prototype.convertMath=function(a,b,c,e){a.mathEnabled&&"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?(Editor.MathJaxRender(b),window.setTimeout(mxUtils.bind(this,function(){MathJax.Hub.Queue(mxUtils.bind(this,
+function(){e()}))}),0)):e()};EditorUi.prototype.decodeNodeIntoGraph=function(a,b){if(null!=a){var d=null;if("diagram"==a.nodeName)d=a;else if("mxfile"==a.nodeName){var c=a.getElementsByTagName("diagram");if(0<c.length){var d=c[0],e=b.getGlobalVariable;b.getGlobalVariable=function(a){return"page"==a?d.getAttribute("name")||mxResources.get("pageWithNumber",[1]):"pagenumber"==a?1:e.apply(this,arguments)}}}null!=d&&(c=Graph.decompress(mxUtils.getTextContent(d)),null!=c&&0<c.length&&(a=mxUtils.parseXml(c).documentElement))}c=
+this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(p){}finally{this.editor.graph=c}return a};EditorUi.prototype.getEmbeddedPng=function(a,b,c){try{var d=this.editor.graph,e=null;if(null!=c&&0<c.length)d=this.createTemporaryGraph(this.editor.graph.getStylesheet()),document.body.appendChild(d.container),this.decodeNodeIntoGraph(this.editor.extractGraphModel(mxUtils.parseXml(c).documentElement,!0),d),e=c;else if(null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),
+f=d.getGlobalVariable,g=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?g.getName():"pagenumber"==a?1:f.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(g.root)}this.exportToCanvas(mxUtils.bind(this,function(c){try{null==e&&(e=this.getFileData(!0));var f=c.toDataURL("image/png"),f=this.writeGraphModelToPng(f,"zTXt","mxGraphModel",atob(Graph.compress(e)));a(f.substring(f.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(G){null!=
+b&&b(G)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,null,null,d.shadowVisible,null,d)}catch(x){null!=b&&b(x)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,e,l,k,m){m=b.background;m==mxConstants.NONE&&(m=null);k=b.getSvg(m,null,null,null,null,k);b.shadowVisible&&b.addSvgShadow(k);null!=a&&k.setAttribute("content",a);null!=c&&k.setAttribute("resource",c);if(null!=l)this.convertImages(k,mxUtils.bind(this,function(a){l((e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+
+mxUtils.getXml(a))}));else return(e?"":'<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')+mxUtils.getXml(k)};EditorUi.prototype.exportImage=function(a,b,c,e,l,k,m,q,u){u=null!=u?u:"png";if(this.spinner.spin(document.body,mxResources.get("exporting"))){var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;null==this.thumbImageCache&&(this.thumbImageCache={});try{this.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();
+try{this.saveCanvas(a,l?this.getFileData(!0,null,null,null,c,q):null,u)}catch(E){"Invalid image"==E.message?this.downloadFile(u):this.handleError(E)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,e,null,null,k,m)}catch(z){this.spinner.stop(),this.handleError(z)}}};EditorUi.prototype.loadFonts=function(a){if(null!=this.editor.fontCss&&null==this.editor.resolvedFontCss){var d=function(a){return a.replace(RegExp("^[\\s\"']+","g"),
+"").replace(RegExp("[\\s\"']+$","g"),"")},b=this.editor.fontCss.split("url("),c=0,e={},k=mxUtils.bind(this,function(){if(0==c){for(var f=[b[0]],g=1;g<b.length;g++){var l=b[g].indexOf(")");f.push('url("');f.push(e[d(b[g].substring(0,l))]);f.push('"'+b[g].substring(l))}this.editor.resolvedFontCss=f.join("");a()}});if(0<b.length)for(var m=1;m<b.length;m++){var q=b[m].indexOf(")"),u=null,t=b[m].indexOf("format(",q);0<t&&(u=d(b[m].substring(t+7,b[m].indexOf(")",t))));mxUtils.bind(this,function(a){if(null==
+e[a]){e[a]=a;c++;var d="application/x-font-ttf";if("svg"==u||/(\.svg)($|\?)/i.test(a))d="image/svg+xml";else if("otf"==u||"embedded-opentype"==u||/(\.otf)($|\?)/i.test(a))d="application/x-font-opentype";else if("woff"==u||/(\.woff)($|\?)/i.test(a))d="application/font-woff";else if("woff2"==u||/(\.woff2)($|\?)/i.test(a))d="application/font-woff2";else if("eot"==u||/(\.eot)($|\?)/i.test(a))d="application/vnd.ms-fontobject";else if("sfnt"==u||/(\.sfnt)($|\?)/i.test(a))d="application/font-sfnt";var b=
+a;/^https?:\/\//.test(b)&&!this.editor.isCorsEnabledForUrl(b)&&(b=PROXY_URL+"?url="+encodeURIComponent(a));this.loadUrl(b,mxUtils.bind(this,function(d){e[a]=d;c--;k()}),mxUtils.bind(this,function(a){c--;k()}),!0,null,"data:"+d+";charset=utf-8;base64,")}})(d(b[m].substring(0,q)),u)}}else a()};EditorUi.prototype.exportToCanvas=function(a,b,c,e,l,k,m,q,u,t,z,E,r,v){k=null!=k?k:!0;E=null!=E?E:this.editor.graph;r=null!=r?r:0;var d=u?null:E.background;d==mxConstants.NONE&&(d=null);null==d&&(d=e);null==
+d&&0==u&&(d="#ffffff");this.convertImages(E.getSvg(d,null,null,v,null,null!=m?m:!0,null,null,null,t),mxUtils.bind(this,function(c){var e=new Image;e.onload=mxUtils.bind(this,function(){try{var f=document.createElement("canvas"),g=parseInt(c.getAttribute("width")),p=parseInt(c.getAttribute("height"));q=null!=q?q:1;null!=b&&(q=k?Math.min(1,Math.min(3*b/(4*p),b/g)):b/g);g=Math.ceil(q*g)+2*r;p=Math.ceil(q*p)+2*r;f.setAttribute("width",g);f.setAttribute("height",p);var m=f.getContext("2d");null!=d&&(m.beginPath(),
+m.rect(0,0,g,p),m.fillStyle=d,m.fill());m.scale(q,q);mxClient.IS_SF?window.setTimeout(function(){m.drawImage(e,r/q,r/q);a(f)},0):(m.drawImage(e,r/q,r/q),a(f))}catch(U){null!=l&&l(U)}});e.onerror=function(a){null!=l&&l(a)};try{t&&this.editor.graph.addSvgShadow(c);var f=mxUtils.bind(this,function(){if(null!=this.editor.resolvedFontCss){var a=document.createElement("style");a.setAttribute("type","text/css");a.innerHTML=this.editor.resolvedFontCss;c.getElementsByTagName("defs")[0].appendChild(a)}this.convertMath(E,
+c,!0,mxUtils.bind(this,function(){e.src=this.createSvgDataUri(mxUtils.getXml(c))}))});this.loadFonts(f)}catch(B){null!=l&&l(B)}}),c,z)};EditorUi.prototype.createImageUrlConverter=function(){var a=new mxUrlConverter;a.updateBaseUrl();var b=a.convert,c=this;a.convert=function(d){if(null!=d){var e="http://"==d.substring(0,7)||"https://"==d.substring(0,8);e&&!navigator.onLine?d=c.svgBrokenImage.src:!e||d.substring(0,a.baseUrl.length)==a.baseUrl||c.crossOriginImages&&c.editor.isCorsEnabledForUrl(d)?"chrome-extension://"!=
+d.substring(0,19)&&(d=b.apply(this,arguments)):d=PROXY_URL+"?url="+encodeURIComponent(d)}return d};return a};EditorUi.prototype.convertImages=function(a,b,c,e){null==e&&(e=this.createImageUrlConverter());var d=0,f=c||{};c=mxUtils.bind(this,function(c,g){for(var l=a.getElementsByTagName(c),k=0;k<l.length;k++)mxUtils.bind(this,function(c){var l=e.convert(c.getAttribute(g));if(null!=l&&"data:"!=l.substring(0,5)){var k=f[l];null==k?(d++,this.convertImageToDataUri(l,function(e){null!=e&&(f[l]=e,c.setAttribute(g,
+e));d--;0==d&&b(a)})):c.setAttribute(g,k)}else null!=l&&c.setAttribute(g,l)})(l[k])});c("image","xlink:href");c("img","src");0==d&&b(a)};EditorUi.prototype.loadUrl=function(a,b,c,e,l,k,m){try{var d=!m&&(e||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a));l=null!=l?l:!0;var f=mxUtils.bind(this,function(){mxUtils.get(a,mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){if(null!=b){var e=a.getText();if(d){if((9==document.documentMode||10==document.documentMode)&&
+"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var e=Array(a.length),f=0;f<a.length;f++)e[f]=String.fromCharCode(a[f]);e=e.join("")}k=null!=k?k:"data:image/png;base64,";e=k+this.base64Encode(e)}b(e)}}else null!=c&&c({message:mxResources.get("error")+" "+a.getStatus()},a)}),function(a){null!=c&&c({message:mxResources.get("error")+" "+a.getStatus()})},d,this.timeout,function(){l&&null!=c&&c({code:App.ERROR_TIMEOUT,retry:f})})});f()}catch(G){null!=
+c&&c(G)}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.convertImageToDataUri=function(a,b){if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){b(this.createSvgDataUri(a.getText()))}),function(){b(this.svgBrokenImage.src)});else{var d=new Image,c=this;this.crossOriginImages&&(d.crossOrigin="anonymous");d.onload=function(){var a=document.createElement("canvas"),e=a.getContext("2d");a.height=d.height;a.width=d.width;e.drawImage(d,
+0,0);try{b(a.toDataURL())}catch(y){b(c.svgBrokenImage.src)}};d.onerror=function(){b(c.svgBrokenImage.src)};d.src=a}};EditorUi.prototype.importXml=function(a,b,c,e,l){b=null!=b?b:0;c=null!=c?c:0;var d=[];try{var f=this.editor.graph;if(null!=a&&0<a.length){f.model.beginUpdate();try{var g=mxUtils.parseXml(a),k=this.editor.extractGraphModel(g.documentElement,null!=this.pages);if(null!=k&&"mxfile"==k.nodeName&&null!=this.pages){var m=k.getElementsByTagName("diagram");if(1==m.length)k=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(m[0]))).documentElement;
+else if(1<m.length)for(a=0,null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(k=mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(m[0]))).documentElement,e=!1,a=1);a<m.length;a++){m[a].removeAttribute("id");var n=this.updatePageRoot(new DiagramPage(m[a])),q=this.pages.length;null==n.getName()&&n.setName(mxResources.get("pageWithNumber",[q+1]));f.model.execute(new ChangePage(this,n,n,q,!0))}}null!=k&&"mxGraphModel"===k.nodeName&&(d=f.importGraphModel(k,b,c,e))}finally{f.model.endUpdate()}}}catch(r){if(l)throw r;
+this.handleError(r)}return d};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};EditorUi.prototype.importVisio=function(a,b,c,e){e=null!=e?e:a.name;c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportVisio)if(this.isRemoteVisioFormat(e)&&null!=VSD_CONVERT_URL){var d=new FormData;d.append("file1",a,e);var f=new XMLHttpRequest;f.open("POST",VSD_CONVERT_URL);
+f.responseType="blob";f.onreadystatechange=mxUtils.bind(this,function(){if(4==f.readyState)if(200<=f.status&&299>=f.status)try{f.response.name=e,this.doImportVisio(f.response,b,c)}catch(x){c(x)}else c({})});f.send(d)}else try{this.doImportVisio(a,b,c)}catch(x){c(x)}});this.doImportVisio||this.loadingExtensions||this.isOffline()?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.importGraphML=function(a,b,c){c=null!=c?c:mxUtils.bind(this,function(a){this.handleError(a)});
+var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if(this.doImportGraphML)try{this.doImportGraphML(a,b,c)}catch(l){c(l)}});this.doImportGraphML||this.loadingExtensions||this.isOffline()?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()||this.handleError({message:mxResources.get("unknownError")})}catch(f){this.handleError(f)}});
+"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline()?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,b,c){var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter)try{b(LucidImporter.importState(JSON.parse(a)))}catch(l){c(l)}else c({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline()?
+window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",d):mxscript("js/extensions.min.js",d))};EditorUi.prototype.insertAsPreText=function(a,b,c){var d=this.editor.graph,e=null;d.getModel().beginUpdate();try{e=d.insertVertex(null,null,"<pre>"+a+"</pre>",b,c,1,1,"text;html=1;align=center;verticalAlign=middle;"),d.updateCellSize(e,!0)}finally{d.getModel().endUpdate()}return e};EditorUi.prototype.insertTextAt=function(a,b,c,e,l,k,m){k=null!=k?k:!0;
+m=null!=m?m:!0;if(null!=a)if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a))this.parseFile(new Blob([a.replace(/\s+/g," ")],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&this.editor.graph.setSelectionCells(this.insertTextAt(a.responseText,b,c,!0))}));else if("data:"==a.substring(0,5)||!this.isOffline()&&(l||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var d=this.editor.graph;if("data:image/png;base64,"==
+a.substring(0,22)){var f=this.extractGraphModelFromPng(a),g=this.importXml(f,b,c,k,!0);if(0<g.length)return g}if("data:image/svg+xml;"==a.substring(0,19))try{if(f=null,"data:image/svg+xml;base64,"==a.substring(0,26)?(f=a.substring(a.indexOf(",")+1),f=window.atob&&!mxClient.IS_SF?atob(f):Base64.decode(f,!0)):f=decodeURIComponent(a.substring(a.indexOf(",")+1)),g=this.importXml(f,b,c,k,!0),0<g.length)return g}catch(z){}this.loadImage(a,mxUtils.bind(this,function(e){if("data:"==a.substring(0,5))this.resizeImage(e,
+a,mxUtils.bind(this,function(a,e,f){d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),e,f,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),m,this.maxImageSize);else{var f=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/e.height)),g=Math.round(e.width*f);e=Math.round(e.height*f);d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),g,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
+a+";"))}}),mxUtils.bind(this,function(){var f=null;d.getModel().beginUpdate();try{f=d.insertVertex(d.getDefaultParent(),null,a,d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.updateCellSize(f),d.fireEvent(new mxEventObject("textInserted","cells",[f]))}finally{d.getModel().endUpdate()}d.setSelectionCell(f)}))}else{a=Graph.zapGremlins(mxUtils.trim(a));if(this.isCompatibleString(a))return this.importXml(a,b,c,k);if(0<a.length)if(this.isLucidChartData(a))this.convertLucidChart(a,mxUtils.bind(this,
+function(a){this.editor.graph.setSelectionCells(this.importXml(a,b,c,k))}),mxUtils.bind(this,function(a){this.handleError(a)}));else{d=this.editor.graph;l=null;d.getModel().beginUpdate();try{l=d.insertVertex(d.getDefaultParent(),null,"",d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.fireEvent(new mxEventObject("textInserted","cells",[l])),"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a)),l.value=a,d.updateCellSize(l),/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i.test(l.value)&&
+d.setLinkForCell(l,l.value),l.geometry.width+=d.gridSize,l.geometry.height+=d.gridSize}finally{d.getModel().endUpdate()}return[l]}}return[]};EditorUi.prototype.formatFileSize=function(a){var b=-1;do a/=1024,b++;while(1024<a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]};EditorUi.prototype.convertDataUri=function(a){if("data:"==a.substring(0,5)){var b=a.indexOf(";");0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1)))}return a};EditorUi.prototype.isRemoteFileFormat=
+function(a,b){return/(\"contentType\":\s*\"application\/gliffy\+json\")/.test(a)};EditorUi.prototype.isLucidChartData=function(a){return null!=a&&'{"state":"{\\"Properties\\":'==a.substring(0,26)};EditorUi.prototype.importLocalFile=function(a,b){if(a&&Graph.fileSupport&&(!mxClient.IS_IE&&!mxClient.IS_IE11||0>navigator.appVersion.indexOf("Windows NT 6.1"))){var d=document.createElement("input");d.setAttribute("type","file");mxEvent.addListener(d,"change",mxUtils.bind(this,function(){null!=d.files&&
+this.importFiles(d.files,null,null,this.maxImageSize)}));d.click()}else{window.openNew=!1;window.openKey="import";if(!b){var c=Editor.useLocalStorage;Editor.useLocalStorage=!a}window.openFile=new OpenFile(mxUtils.bind(this,function(a){this.hideDialog(a)}));window.openFile.setConsumer(mxUtils.bind(this,function(a,b){if(null!=b&&Graph.fileSupport&&/(\.v(dx|sdx?))($|\?)/i.test(b)){var d=new Blob([a],{type:"application/octet-stream"});this.importVisio(d,mxUtils.bind(this,function(a){this.importXml(a,
+0,0,!0)}),null,b)}else this.editor.graph.setSelectionCells(this.importXml(a,0,0,!0))}));this.showDialog((new OpenDialog(this)).container,360,220,!0,!0,function(){window.openFile=null});if(!b){var e=this.dialog,f=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=c;f.apply(e,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importFile=function(a,b,c,e,l,k,m,q,u,t,z){t=null!=t?t:!0;var d=!1,f=null,g=mxUtils.bind(this,
+function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,m)):b=this.importXml(a,c,e,t);null!=q&&q(b)});"image"==b.substring(0,5)?(u=!1,"image/png"==b.substring(0,9)&&(b=z?null:this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(f=this.importXml(b,c,e,t),u=!0)),u||(f=this.editor.graph,b=a.indexOf(";"),0<b&&(a=a.substring(0,b)+a.substring(a.indexOf(",",b+1))),t&&f.isGridEnabled()&&(c=f.snap(c),e=f.snap(e)),f=[f.insertVertex(null,null,"",c,e,l,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
+a+";")])):/(\.*<graphml )/.test(a)?(d=!0,this.importGraphML(a,g)):null!=u&&null!=m&&(/(\.v(dx|sdx?))($|\?)/i.test(m)||/(\.vs(x|sx?))($|\?)/i.test(m))?(d=!0,this.importVisio(u,g)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,m)?(d=!0,this.parseFile(null!=u?u:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?g(a.responseText):null!=q&&q(null))}),m)):/(\.v(sd|dx))($|\?)/i.test(m)||/(\.vs(s|x))($|\?)/i.test(m)||
+(f=this.insertTextAt(this.validateFileData(a),c,e,!0,null,t));d||null==q||q(f);return f};EditorUi.prototype.base64Encode=function(a){for(var b="",d=0,c=a.length,e,k,m;d<c;){e=a.charCodeAt(d++)&255;if(d==c){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);b+="==";break}k=a.charCodeAt(d++);if(d==c){b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);
+b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(k&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2);b+="=";break}m=a.charCodeAt(d++);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(k&240)>>4);b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((k&15)<<2|(m&192)>>6);b+=
+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m&63)}return b};EditorUi.prototype.importFiles=function(a,b,c,e,l,k,m,q,u,t,z,v){b=null!=b?b:0;c=null!=c?c:0;e=null!=e?e:this.maxImageSize;t=null!=t?t:this.maxImageBytes;var d=null!=b&&null!=c,f=!0,g=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var p=z||this.resampleThreshold,n=0;n<a.length;n++)if("image/"==a[n].type.substring(0,6)&&a[n].size>p){g=!0;break}var y=mxUtils.bind(this,function(){var g=this.editor.graph,p=g.gridSize;
+l=null!=l?l:mxUtils.bind(this,function(a,b,c,e,f,g,l,k,m){return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,l)),null):this.importFile(a,b,c,e,f,g,l,k,m,d,v)});k=null!=k?k:mxUtils.bind(this,function(a){g.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var n=a.length,u=n,r=[],y=mxUtils.bind(this,function(a,b){r[a]=b;if(0==--u){this.spinner.stop();if(null!=q)q(r);else{var d=[];g.getModel().beginUpdate();
+try{for(var c=0;c<r.length;c++){var e=r[c]();null!=e&&(d=d.concat(e))}}finally{g.getModel().endUpdate()}}k(d)}}),x=0;x<n;x++)mxUtils.bind(this,function(d){var k=a[d];if(null!=k){var n=new FileReader;n.onload=mxUtils.bind(this,function(a){if(null==m||m(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var n=a.target.result,u=n.indexOf(","),r=decodeURIComponent(escape(atob(n.substring(u+1)))),q=mxUtils.parseXml(r),r=q.getElementsByTagName("svg");if(0<r.length){var r=r[0],
+x=v?null:r.getAttribute("content");null!=x&&"<"!=x.charAt(0)&&"%"!=x.charAt(0)&&(x=unescape(window.atob?atob(x):Base64.decode(x,!0)));null!=x&&"%"==x.charAt(0)&&(x=decodeURIComponent(x));null==x||"<mxfile "!==x.substring(0,8)&&"<mxGraphModel "!==x.substring(0,14)?y(d,mxUtils.bind(this,function(){try{if(n.substring(0,u+1),null!=q){var a=q.getElementsByTagName("svg");if(0<a.length){var f=a[0],m=parseFloat(f.getAttribute("width")),r=parseFloat(f.getAttribute("height")),z=f.getAttribute("viewBox");if(null==
+z||0==z.length)f.setAttribute("viewBox","0 0 "+m+" "+r);else if(isNaN(m)||isNaN(r)){var y=z.split(" ");3<y.length&&(m=parseFloat(y[2]),r=parseFloat(y[3]))}n=this.createSvgDataUri(mxUtils.getXml(f));var t=Math.min(1,Math.min(e/Math.max(1,m)),e/Math.max(1,r)),x=l(n,k.type,b+d*p,c+d*p,Math.max(1,Math.round(m*t)),Math.max(1,Math.round(r*t)),k.name);if(isNaN(m)||isNaN(r)){var B=new Image;B.onload=mxUtils.bind(this,function(){m=Math.max(1,B.width);r=Math.max(1,B.height);x[0].geometry.width=m;x[0].geometry.height=
+r;f.setAttribute("viewBox","0 0 "+m+" "+r);n=this.createSvgDataUri(mxUtils.getXml(f));var a=n.indexOf(";");0<a&&(n=n.substring(0,a)+n.substring(n.indexOf(",",a+1)));g.setCellStyles("image",n,[x[0]])});B.src=this.createSvgDataUri(mxUtils.getXml(f))}return x}}}catch(ua){}return null})):y(d,mxUtils.bind(this,function(){return l(x,"text/xml",b+d*p,c+d*p,0,0,k.name)}))}else y(d,mxUtils.bind(this,function(){return null}))}else{r=!1;if("image/png"==k.type){var B=v?null:this.extractGraphModelFromPng(a.target.result);
+if(null!=B&&0<B.length){var H=new Image;H.src=a.target.result;y(d,mxUtils.bind(this,function(){return l(B,"text/xml",b+d*p,c+d*p,H.width,H.height,k.name)}));r=!0}}r||(mxClient.IS_CHROMEAPP?(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("dragAndDropNotSupported"),mxResources.get("cancel"),mxUtils.bind(this,function(){}),null,mxResources.get("ok"),mxUtils.bind(this,function(){this.actions.get("import").funct()}))):this.loadImage(a.target.result,mxUtils.bind(this,function(g){this.resizeImage(g,
+a.target.result,mxUtils.bind(this,function(g,m,n){y(d,mxUtils.bind(this,function(){if(null!=g&&g.length<t){var r=f&&this.isResampleImage(a.target.result,z)?Math.min(1,Math.min(e/m,e/n)):1;return l(g,k.type,b+d*p,c+d*p,Math.round(m*r),Math.round(n*r),k.name)}this.handleError({message:mxResources.get("imageTooBig")});return null}))}),f,e,z)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else l(a.target.result,k.type,b+d*p,c+d*p,240,160,k.name,
+function(a){y(d,function(){return a})})});/(\.v(dx|sdx?))($|\?)/i.test(k.name)||/(\.vs(x|sx?))($|\?)/i.test(k.name)?l(null,k.type,b+d*p,c+d*p,240,160,k.name,function(a){y(d,function(){return a})},k):"image"==k.type.substring(0,5)?n.readAsDataURL(k):n.readAsText(k)}})(x)});g?this.confirmImageResize(function(a){f=a;y()},u):y()};EditorUi.prototype.confirmImageResize=function(a,b){b=null!=b?b:!1;var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},c=isLocalStorage||mxClient.IS_CHROMEAPP?
+mxSettings.getResizeImages():null,e=function(c,e){if(c||b)mxSettings.setResizeImages(c?e:null),mxSettings.save();d();a(e)};null==c||b?this.showDialog((new ConfirmDialog(this,mxResources.get("resizeLargeImages"),function(a){e(a,!0)},function(a){e(a,!1)},mxResources.get("resize"),mxResources.get("actualSize"),'<img style="margin-top:8px;" src="'+Editor.loResImage+'"/>','<img style="margin-top:8px;" src="'+Editor.hiResImage+'"/>',isLocalStorage||mxClient.IS_CHROMEAPP)).container,340,isLocalStorage||
+mxClient.IS_CHROMEAPP?220:200,!0,!0):e(!1,c)};EditorUi.prototype.parseFile=function(a,b,c){c=null!=c?c:a.name;var d=new FormData;d.append("format","xml");d.append("upfile",a,c);var e=new XMLHttpRequest;e.open("POST",OPEN_URL);e.onreadystatechange=function(){b(e)};e.send(d)};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,e,l,k){l=null!=l?l:this.maxImageSize;var d=Math.max(1,a.width),f=Math.max(1,a.height);
+if(e&&this.isResampleImage(b,k))try{var g=Math.max(d/l,f/l);if(1<g){var m=Math.round(d/g),p=Math.round(f/g),n=document.createElement("canvas");n.width=m;n.height=p;n.getContext("2d").drawImage(a,0,0,m,p);var r=n.toDataURL();if(r.length<b.length){var q=document.createElement("canvas");q.width=m;q.height=p;var t=q.toDataURL();r!==t&&(b=r,d=m,f=p)}}}catch(O){}c(b,d,f)};EditorUi.prototype.crcTable=[];for(var c=0;256>c;c++)for(var k=c,m=0;8>m;m++)k=1==(k&1)?3988292384^k>>>1:k>>>1,EditorUi.prototype.crcTable[c]=
+k;EditorUi.prototype.updateCRC=function(a,b,c,e){for(var d=0;d<e;d++)a=EditorUi.prototype.crcTable[(a^b.charCodeAt(c+d))&255]^a>>>8;return a};EditorUi.prototype.crc32=function(a){this.crcTable=this.crcTable||this.createCrcTable();for(var b=-1,d=0;d<a.length;d++)b=b>>>8^this.crcTable[(b^a.charCodeAt(d))&255];return(b^-1)>>>0};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,e,l){function d(a,b){var d=k;k+=b;return a.substring(d,k)}function f(a){a=d(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<
+8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function g(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var k=0;if(d(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=l&&l();else if(d(a,4),"IHDR"!=d(a,4))null!=l&&l();else{d(a,17);l=a.substring(0,k);do{var m=f(a);if("IDAT"==d(a,4)){l=a.substring(0,k-8);c=c+String.fromCharCode(0)+("zTXt"==b?String.fromCharCode(0):"")+e;e=4294967295;
+e=this.updateCRC(e,b,0,4);e=this.updateCRC(e,c,0,c.length);l+=g(c.length)+b+c+g(e^4294967295);l+=a.substring(k-8,a.length);break}l+=a.substring(k-8,k-4+m);d(a,m);d(a,4)}while(m);return"data:image/png;base64,"+(window.btoa?btoa(l):Base64.encode(l,!0))}};EditorUi.prototype.extractGraphModelFromPng=function(a){var b=null;try{var d=a.substring(a.indexOf(",")+1),c=window.atob&&!mxClient.IS_SF?atob(d):Base64.decode(d,!0);EditorUi.parsePng(c,mxUtils.bind(this,function(a,d,e){a=c.substring(a+8,a+8+e);"zTXt"==
+d?(e=a.indexOf(String.fromCharCode(0)),"mxGraphModel"==a.substring(0,e)&&(a=Graph.bytesToString(pako.inflateRaw(a.substring(e+2))).replace(/\+/g," "),null!=a&&0<a.length&&(b=a))):"tEXt"==d&&(a=a.split(String.fromCharCode(0)),1<a.length&&"mxGraphModel"==a[0]&&(b=a[1]));if(null!=b||"IDAT"==d)return!0}))}catch(l){}null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));null!=b&&"%"==b.charAt(0)&&(b=decodeURIComponent(b));return b};EditorUi.prototype.loadImage=function(a,b,c){try{var d=new Image;d.onload=
+function(){b(d)};null!=c&&(d.onerror=c);d.src=a}catch(l){if(null!=c)c(l);else throw l;}};var q=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,b=this.editor.graph;b.getLinkTitle=function(b){return a.getLinkTitle(b)};b.customLinkClicked=function(b){var d=!1;try{a.handleCustomLink(b),d=!0}catch(B){a.handleError(B)}return d};
+var c=this.clearDefaultStyle;this.clearDefaultStyle=function(){c.apply(this,arguments)};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var e=a.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(b){b=null!=b?b:"";if(null!=a.pages&&null!=a.currentPage)for(var d=0;d<a.pages.length;d++)if(a.pages[d]==a.currentPage){0<d&&(b+=(0<b.length?"&":"?")+"page="+d);break}"1"==urlParams.dev&&
+(b+=(0<b.length?"&":"?")+"dev=1&drawdev=1");return e.apply(this,arguments)};var l=b.addClickHandler;b.addClickHandler=function(a,d,c){var e=d;d=function(a,d){if(null==d){var c=mxEvent.getSource(a);"a"==c.nodeName.toLowerCase()&&(d=c.getAttribute("href"))}null!=d&&b.isCustomLink(d)&&(mxEvent.isTouchEvent(a)||!mxEvent.isPopupTrigger(a))&&b.customLinkClicked(d)&&mxEvent.consume(a);null!=e&&e(a,d)};l.call(this,a,d,c)};q.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(b.view.canvas.ownerSVGElement,
+null,!0);a.actions.get("print").funct=function(){a.showDialog((new PrintDialog(a)).container,360,null!=a.pages&&1<a.pages.length?420:360,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var k=b.getGlobalVariable;b.getGlobalVariable=function(b){return"page"==b&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==b?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:k.apply(this,arguments)};var m=b.labelLinkClicked;b.labelLinkClicked=function(a,d,c){var e=
+d.getAttribute("href");if(null==e||!b.isCustomLink(e)||!mxEvent.isTouchEvent(c)&&mxEvent.isPopupTrigger(c))m.apply(this,arguments);else{if(!b.isEnabled()||null!=a&&b.isCellLocked(a.cell))b.customLinkClicked(e),b.getRubberband().reset();mxEvent.consume(c)}};this.editor.getOrCreateFilename=function(){var b=a.defaultFilename,d=a.getCurrentFile();null!=d&&(b=null!=d.getTitle()?d.getTitle():b);return b};var t=this.actions.get("print");t.setEnabled(!mxClient.IS_IOS||!navigator.standalone);t.visible=t.isEnabled();
+if(!this.editor.chromeless||this.editor.editable){var u=function(){window.setTimeout(function(){v.innerHTML="&nbsp;";v.focus();document.execCommand("selectAll",!1,null)},0)};this.keyHandler.bindAction(70,!0,"find");this.keyHandler.bindAction(67,!0,"copyStyle",!0);this.keyHandler.bindAction(86,!0,"pasteStyle",!0);this.keyHandler.bindAction(77,!0,"editGeometry",!0);this.keyHandler.bindAction(88,!0,"insertText",!0);this.keyHandler.bindAction(75,!0,"insertRectangle");this.keyHandler.bindAction(75,!0,
+"insertEllipse",!0);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(this.altShiftActions[83]="synchronize");mxClient.IS_IE||b.container.addEventListener("paste",mxUtils.bind(this,function(a){var b=this.editor.graph;if(!mxEvent.isConsumed(a))try{for(var d=a.clipboardData||a.originalEvent.clipboardData,c=!1,e=0;e<d.types.length;e++)if("text/"===d.types[e].substring(0,5)){c=!0;break}if(!c){var f=d.items;for(index in f){var g=f[index];if("file"===g.kind){if(b.isEditing())this.importFiles([g.getAsFile()],
+0,0,this.maxImageSize,function(a,d,c,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()});else{var l=this.editor.graph.getInsertPoint();this.importFiles([g.getAsFile()],l.x,l.y,this.maxImageSize);mxEvent.consume(a)}break}}}}catch(J){}}),!1);var v=document.createElement("div");v.style.position="absolute";v.style.whiteSpace="nowrap";v.style.overflow="hidden";v.style.display="block";v.contentEditable=!0;mxUtils.setOpacity(v,
+0);v.style.width="1px";v.style.height="1px";v.innerHTML="&nbsp;";var z=!1;this.keyHandler.bindControlKey(88,null);this.keyHandler.bindControlKey(67,null);this.keyHandler.bindControlKey(86,null);mxEvent.addListener(document,"keydown",mxUtils.bind(this,function(a){var d=mxEvent.getSource(a);null==b.container||!b.isEnabled()||b.isMouseDown||b.isEditing()||null!=this.dialog||"INPUT"==d.nodeName||"TEXTAREA"==d.nodeName||!(224==a.keyCode||!mxClient.IS_MAC&&17==a.keyCode||mxClient.IS_MAC&&91==a.keyCode)||
+z||(v.style.left=b.container.scrollLeft+10+"px",v.style.top=b.container.scrollTop+10+"px",b.container.appendChild(v),z=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){v.focus();document.execCommand("selectAll",!1,null)},0):(v.focus(),document.execCommand("selectAll",!1,null)))}));mxEvent.addListener(document,"keyup",mxUtils.bind(this,function(a){var d=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!z||224!=d&&17!=d&&91!=d||(z=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),
+v.parentNode.removeChild(v),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(v,"copy",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(v),u())}));mxEvent.addListener(v,"cut",mxUtils.bind(this,function(a){b.isEnabled()&&(mxClipboard.copy(b),this.copyCells(v,!0),u())}));mxEvent.addListener(v,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&(v.innerHTML="&nbsp;",v.focus(),window.setTimeout(mxUtils.bind(this,
+function(){this.pasteCells(a,v);v.innerHTML="&nbsp;"}),0))}),!0);var E=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==v?!0:E.apply(this,arguments)}}this.spinner=this.createSpinner(document.body.clientWidth/2-2,Math.max(document.body.clientHeight||0,document.documentElement.clientHeight||0)/2,24);Graph.fileSupport&&this.editor.graph.addListener(mxEvent.EDITING_STARTED,mxUtils.bind(this,function(a){var b=this.editor.graph,d=b.cellEditor.text2,c=null;null!=d&&
+(mxEvent.addListener(d,"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null==c&&(!mxClient.IS_IE||10<document.documentMode)&&(c=this.highlightElement(d));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=null);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,0,0,
+this.maxImageSize,function(a,d,c,e,f,g){b.insertImage(a,f,g)},function(){},function(a){return"image/"==a.type.substring(0,6)},function(a){for(var b=0;b<a.length;b++)a[b]()},mxEvent.isControlDown(a));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")){var d=a.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(d)?this.loadImage(decodeURIComponent(d),mxUtils.bind(this,function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var e=this.maxImageSize,e=Math.min(1,
+Math.min(e/Math.max(1,c)),e/Math.max(1,a));b.insertImage(decodeURIComponent(d),c*e,a*e)})):document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"))}else 0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")?document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/html")):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&document.execCommand("insertHTML",!1,a.dataTransfer.getData("text/plain"));a.stopPropagation();a.preventDefault()})))}));if("1"==urlParams.ruler&&"undefined"!==
+typeof mxRuler){t=document.createElement("div");t.style.position="absolute";t.style.top="95px";t.style.left="250px";t.style.width="2000px";t.style.height="30px";t.style.background="whiteSmoke";document.body.appendChild(t);var r=document.createElement("div");r.style.position="absolute";r.style.top="125px";r.style.left="220px";r.style.width="30px";r.style.height="1000px";r.style.background="whiteSmoke";document.body.appendChild(r);var A=document.createElement("div");A.style.position="absolute";A.style.top=
+"95px";A.style.left="220px";A.style.width="30px";A.style.height="30px";A.style.background="whiteSmoke";document.body.appendChild(A);this.vRuler=new mxRuler(this.editor.graph,r,!0);this.hRuler=new mxRuler(this.editor.graph,t,!1)}if("1"==urlParams.styledev){t=document.getElementById("geFooter");null!=t&&(this.styleInput=document.createElement("input"),this.styleInput.setAttribute("type","text"),this.styleInput.style.position="absolute",this.styleInput.style.top="14px",this.styleInput.style.left="2px",
+this.styleInput.style.width="98%",this.styleInput.style.visibility="hidden",this.styleInput.style.opacity="0.9",mxEvent.addListener(this.styleInput,"change",mxUtils.bind(this,function(){this.editor.graph.getModel().setStyle(this.editor.graph.getSelectionCell(),this.styleInput.value)})),t.appendChild(this.styleInput),this.editor.graph.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){if(0<this.editor.graph.getSelectionCount()){var d=this.editor.graph.getSelectionCell(),
+d=this.editor.graph.getModel().getStyle(d);this.styleInput.value=d||"";this.styleInput.style.visibility="visible"}else this.styleInput.style.visibility="hidden"})));var Q=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:Q.apply(this,arguments)}}t=document.getElementById("geInfo");null!=t&&t.parentNode.removeChild(t);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var O=null;mxEvent.addListener(b.container,"dragleave",
+function(a){b.isEnabled()&&(null!=O&&(O.parentNode.removeChild(O),O=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(b.container,"dragover",mxUtils.bind(this,function(a){null==O&&(!mxClient.IS_IE||10<document.documentMode)&&(O=this.highlightElement(b.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(b.container,"drop",mxUtils.bind(this,function(a){null!=O&&(O.parentNode.removeChild(O),O=null);if(b.isEnabled()){var d=
+mxUtils.convertPoint(b.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),c=b.view.translate,e=b.view.scale,f=d.x/e-c.x,g=d.y/e-c.y;mxEvent.isAltDown(a)&&(g=f=0);if(0<a.dataTransfer.files.length)this.importFiles(a.dataTransfer.files,f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{var l=0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,d=this.extractGraphModelFromEvent(a,null!=this.pages);
+if(null!=d)b.setSelectionCells(this.importXml(d,f,g,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var k=a.dataTransfer.getData("text/html"),d=document.createElement("div");d.innerHTML=k;var m=null,c=d.getElementsByTagName("img");null!=c&&1==c.length?(k=c[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(m=!0)):(d=d.getElementsByTagName("a"),null!=d&&1==d.length&&(k=d[0].getAttribute("href")));var p=!0,n=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(k,
+f,g,!0,m,null,p))});m&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){p=a;n()},mxEvent.isControlDown(a)):n()}else null!=l&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(l)?this.loadImage(decodeURIComponent(l),mxUtils.bind(this,function(a){var d=Math.max(1,a.width);a=Math.max(1,a.height);var c=this.maxImageSize,c=Math.min(1,Math.min(c/Math.max(1,d)),c/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",f,g,d*c,a*c,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+
+l+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(l,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();this.editUpdateListener=mxUtils.bind(this,function(a,b){var d=b.getProperty("edit");null!=d&&this.updateEditReferences(d)});this.editor.undoManager.addListener(mxEvent.BEFORE_UNDO,this.editUpdateListener);this.editor.undoManager.addListener(mxEvent.BEFORE_REDO,
+this.editUpdateListener);"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(a){var b=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==a.substring(0,13)){var d=a.indexOf(",");0<d&&(b=this.getPageById(a.substring(d+1)),b=null!=b?b.getName():mxResources.get("pageNotFound"))}else"data:"==a.substring(0,5)&&(b=mxResources.get("action"));return b};EditorUi.prototype.handleCustomLink=function(a){if("data:page/id,"==a.substring(0,
+13)){var b=a.indexOf(",");if(a=this.getPageById(a.substring(b+1)))this.selectPage(a);else throw Error(mxResources.get("pageNotFound")||"Page not found");}else this.editor.graph.handleCustomLink(a)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();this.fireEvent(new mxEventObject("styleChanged",
+"keys",[],"values",[],"cells",[]));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);
+mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",
+mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var d=this.editor.graph;if(d.isSelectionEmpty())a.innerHTML="";else{var c=mxUtils.sortCells(d.model.getTopmostCells(d.getSelectionCells())),
+e=mxUtils.getXml(this.editor.graph.encodeCells(c));mxUtils.setTextContent(a,encodeURIComponent(e));b?(d.removeCells(c,!1),d.lastPasteXml=null):(d.lastPasteXml=e,d.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var d=b.getElementsByTagName("span");if(null!=d&&0<d.length&&"application/vnd.lucid.chart.objects"===d[0].getAttribute("data-lucid-type")){var c=d[0].getAttribute("data-lucid-content");null!=c&&0<c.length&&
+(this.convertLucidChart(c,mxUtils.bind(this,function(a){var b=this.editor.graph;b.setSelectionCells(this.importXml(a,0,0));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,function(a){this.handleError(a)})),mxEvent.consume(a))}else{var c=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var k=e.lastIndexOf("%3E");0<=k&&k<e.length-3&&(e=e.substring(0,k+3))}catch(u){}try{var d=b.getElementsByTagName("span"),
+m=null!=d&&0<d.length?mxUtils.trim(decodeURIComponent(d[0].textContent)):decodeURIComponent(e);this.isCompatibleString(m)&&(f=!0,e=m)}catch(u){}c.lastPasteXml==e?c.pasteCounter++:(c.lastPasteXml=e,c.pasteCounter=0);d=c.pasteCounter*c.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?c.setSelectionCells(this.importXml(e,d,d)):(f=c.getInsertPoint(),c.isMouseInsertPoint()&&(d=0,c.lastPasteXml==e&&0<c.pasteCounter&&c.pasteCounter--),c.setSelectionCells(this.insertTextAt(e,f.x+d,f.y+d,!0))),
+!c.isSelectionEmpty())){c.scrollCellToVisible(c.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(c.view.getState(c.getSelectionCell()));try{mxEvent.consume(a)}catch(u){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,d=0;d<a.length;d++)mxEvent.addListener(a[d],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[d],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||
+"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[d],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&
+!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var d=this.extractGraphModelFromEvent(a);if(null==d){var c=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=c&&(10==document.documentMode||11==document.documentMode?d=c.getData("Text"):(d=null,d=0<=mxUtils.indexOf(c.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(c.types,"text/html")?c.getData("text/html"):null,null!=d&&0<d.length?(c=document.createElement("div"),c.innerHTML=d,c=c.getElementsByTagName("img"),
+0<c.length&&(d=c[0].getAttribute("src"))):0<=mxUtils.indexOf(c.types,"text/plain")&&(d=c.getData("text/plain"))),null!=d&&("data:image/png;base64,"==d.substring(0,22)?(d=this.extractGraphModelFromPng(d),null!=d&&0<d.length&&this.openLocalFile(d,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(d)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(d))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(d)&&
+(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(d):window.openWindow((mxClient.IS_CHROMEAPP?EditorUi.drawHost+"/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(d)))))}else this.openLocalFile(d,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,d=0,c,e;if(null==a){e=document.body;var k=document.documentElement;c=(e.clientWidth||k.clientWidth)-3;e=Math.max(e.clientHeight||0,k.clientHeight)-
+3}else b=a.offsetTop,d=a.offsetLeft,c=a.clientWidth,e=a.clientHeight;k=document.createElement("div");k.style.zIndex=mxPopupMenu.prototype.zIndex+2;k.style.border="3px dotted rgb(254, 137, 12)";k.style.pointerEvents="none";k.style.position="absolute";k.style.top=b+"px";k.style.left=d+"px";k.style.width=Math.max(0,c-3)+"px";k.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(k):document.body.appendChild(k);return k};EditorUi.prototype.stringToCells=
+function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var d=new mxCodec(b.ownerDocument),c=new mxGraphModel;d.decode(b,c);b=c.getChildAt(c.getRoot(),0);for(d=0;d<c.getChildCount(b);d++)a.push(c.getChildAt(b,d))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var d=0;d<a.length;d++)mxUtils.bind(this,function(a){var d=new FileReader;d.onload=mxUtils.bind(this,function(d){try{var c=
+d.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(z){this.handleError(z,mxResources.get("errorLoadingFile"))}}else this.openLocalFile(a,
+e,b)});if(/(\.v(dx|sdx?))($|\?)/i.test(e)||/(\.vs(x|sx?))($|\?)/i.test(e))this.importVisio(a,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(/(\.*<graphml )/.test(c))this.importGraphML(c,mxUtils.bind(this,function(a){this.spinner.stop();f(a)}));else if(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,e))this.parseFile(a,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?f(a.responseText):this.handleError({message:mxResources.get(413==
+a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))}));else if(this.isLucidChartData(c))/(\.json)$/i.test(e)&&(e=e.substring(0,e.length-5)+".xml"),this.convertLucidChart(c,mxUtils.bind(this,function(a){this.spinner.stop();this.openLocalFile(a,e,b)}),mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}));else if("<mxlibrary"==d.target.result.substring(0,10)){this.spinner.stop();null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,
+this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,d.target.result,a.name))}catch(G){this.handleError(G,mxResources.get("errorLoadingFile"))}}else"image/png"==a.type.substring(0,9)&&(c=this.extractGraphModelFromPng(c)),this.spinner.stop(),this.openLocalFile(c,e,b)}}catch(G){this.handleError(G)}});d.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"===a.type.substring(0,5)&&"image/svg"!==a.type.substring(0,9)?d.readAsDataURL(a):
+d.readAsText(a)})(a[d])};EditorUi.prototype.openLocalFile=function(a,b,c){var d=this.getCurrentFile(),e=mxUtils.bind(this,function(){window.openFile=null;if(null==b&&null!=this.getCurrentFile()&&this.isDiagramEmpty()){var d=mxUtils.parseXml(a);null!=d&&(this.editor.setGraphXml(d.documentElement),this.editor.graph.selectAll())}else this.fileLoaded(new LocalFile(this,a,b||this.defaultFilename,c))});if(null!=a&&0<a.length)null==d||!d.isModified()&&(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)?e():
+(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(a,b),window.openWindow(this.getUrl(),null,mxUtils.bind(this,function(){null!=d&&d.isModified()?this.confirm(mxResources.get("allChangesLost"),null,e,mxResources.get("cancel"),mxResources.get("discardChanges")):e()})));else throw Error(mxResources.get("notADiagramFile"));
+};EditorUi.prototype.getBasenames=function(){var a={};if(null!=this.pages)for(var b=0;b<this.pages.length;b++)this.updatePageRoot(this.pages[b]),this.addBasenamesForCell(this.pages[b].root,a);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),a);var b=[],c;for(c in a)b.push(c);return b};EditorUi.prototype.addBasenamesForCell=function(a,b){function d(a){if(null!=a){var d=a.lastIndexOf(".");0<d&&(a=a.substring(d+1,a.length));null==b[a]&&(b[a]=!0)}}var c=this.editor.graph,e=c.getCellStyle(a);
+d(mxStencilRegistry.getBasenameForStencil(e[mxConstants.STYLE_SHAPE]));c.model.isEdge(a)&&(d(mxMarker.getPackageForType(e[mxConstants.STYLE_STARTARROW])),d(mxMarker.getPackageForType(e[mxConstants.STYLE_ENDARROW])));for(var e=c.model.getChildCount(a),f=0;f<e;f++)this.addBasenamesForCell(c.model.getChildAt(a,f),b)};EditorUi.prototype.setGraphEnabled=function(a){this.diagramContainer.style.visibility=a?"":"hidden";this.formatContainer.style.visibility=a?"":"hidden";this.sidebarFooterContainer.style.display=
+a?"":"none";this.sidebarContainer.style.display=a?"":"none";this.hsplit.style.display=a?"":"none";this.editor.graph.setEnabled(a);null!=this.tabContainer&&(this.tabContainer.style.visibility=a?"":"hidden");a||(null!=this.actions.outlineWindow&&this.actions.outlineWindow.window.setVisible(!1),null!=this.actions.layersWindow&&this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&this.menus.tagsWindow.window.setVisible(!1),null!=this.menus.findWindow&&this.menus.findWindow.window.setVisible(!1))};
+EditorUi.prototype.initializeEmbedMode=function(){this.setGraphEnabled(!1);(window.opener||window.parent)!=window&&("1"!=urlParams.spin||this.spinner.spin(document.body,mxResources.get("loading")))&&this.installMessageHandler(mxUtils.bind(this,function(a,b,c){this.spinner.stop();this.addEmbedButtons();this.setGraphEnabled(!0);null!=a&&0<a.length?(this.setFileData(a),this.editor.isChromelessView()?this.editor.graph.isLightboxView()&&this.lightboxFit():this.showLayersDialog(),this.chromelessResize&&
+this.chromelessResize()):(this.editor.graph.model.clear(),this.editor.fireEvent(new mxEventObject("resetGraphView")));this.editor.undoManager.clear();this.editor.modified=null!=c?c:!1;this.updateUi();window.self!==window.top&&window.focus();null!=this.format&&this.format.refresh()}))};EditorUi.prototype.showLayersDialog=function(){1<this.editor.graph.getModel().getChildCount(this.editor.graph.getModel().getRoot())&&(null==this.actions.layersWindow?this.actions.get("layers").funct():this.actions.layersWindow.window.setVisible(!0))};
+EditorUi.prototype.getPublicUrl=function(a,b){null!=a?a.getPublicUrl(b):b(null)};EditorUi.prototype.createLoadMessage=function(a){var b=this.editor.graph;return{event:a,pageVisible:b.pageVisible,translate:b.view.translate,bounds:b.getGraphBounds(),currentPage:this.getSelectedPageIndex(),scale:b.view.scale,page:b.view.getBackgroundPageBounds()}};EditorUi.prototype.installMessageHandler=function(a){var b=null,d=!1,c=!1,e=null,k=mxUtils.bind(this,function(a,b){this.editor.modified&&"0"!=urlParams.modified?
+null!=urlParams.modified&&this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(urlParams.modified))):this.editor.setStatus("")});this.editor.graph.model.addListener(mxEvent.CHANGE,k);mxEvent.addListener(window,"message",mxUtils.bind(this,function(f){if(f.source==(window.opener||window.parent)){var g=f.data,l=mxUtils.bind(this,function(a){if(null!=a&&"function"===typeof a.charAt&&"<"!=a.charAt(0))try{"data:image/png;base64,"==a.substring(0,22)?a=this.extractGraphModelFromPng(a):"data:image/svg+xml;base64,"==
+a.substring(0,26)?a=atob(a.substring(26)):"data:image/svg+xml;utf8,"==a.substring(0,24)&&(a=a.substring(24)),null!=a&&("%"==a.charAt(0)?a=decodeURIComponent(a):"<"!=a.charAt(0)&&(a=Graph.decompress(a)))}catch(S){}return a});if("json"==urlParams.proto){try{g=JSON.parse(g)}catch(I){g=null}if(null==g)return;if("dialog"==g.action){this.showError(null!=g.titleKey?mxResources.get(g.titleKey):g.title,null!=g.messageKey?mxResources.get(g.messageKey):g.message,null!=g.buttonKey?mxResources.get(g.buttonKey):
+g.button);null!=g.modified&&(this.editor.modified=g.modified);return}if("prompt"==g.action){this.spinner.stop();l=new FilenameDialog(this,g.defaultValue||"",null!=g.okKey?mxResources.get(g.okKey):null,function(a){null!=a&&m.postMessage(JSON.stringify({event:"prompt",value:a,message:g}),"*")},null!=g.titleKey?mxResources.get(g.titleKey):g.title);this.showDialog(l.container,300,80,!0,!1);l.init();return}if("draft"==g.action){var k=l(g.xml);this.spinner.stop();l=new DraftDialog(this,mxResources.get("draftFound",
+[g.name||this.defaultFilename]),k,mxUtils.bind(this,function(){this.hideDialog();m.postMessage(JSON.stringify({event:"draft",result:"edit",message:g}),"*")}),mxUtils.bind(this,function(){this.hideDialog();m.postMessage(JSON.stringify({event:"draft",result:"discard",message:g}),"*")}),g.editKey?mxResources.get(g.editKey):null,g.discardKey?mxResources.get(g.discardKey):null,g.ignore?mxUtils.bind(this,function(){this.hideDialog();m.postMessage(JSON.stringify({event:"draft",result:"ignore",message:g}),
+"*")}):null);this.showDialog(l.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{l.init()}catch(I){m.postMessage(JSON.stringify({event:"draft",error:I.toString(),message:g}),"*")}return}if("template"==g.action){this.spinner.stop();l=1==g.enableRecent;k=1==g.enableSearch;l=new NewDialog(this,!1,null!=g.callback,mxUtils.bind(this,function(b,d){b=b||this.emptyDiagramXml;null!=g.callback?m.postMessage(JSON.stringify({event:"template",xml:b,blank:b==this.emptyDiagramXml,
+name:d}),"*"):(a(b,f,b!=this.emptyDiagramXml),this.editor.modified||this.editor.setStatus(""))}),null,null,null,null,null,null,null,l?mxUtils.bind(this,function(a){this.remoteInvoke("getRecentDiagrams",null,null,a,function(){a(null,"Network Error!")})}):null,k?mxUtils.bind(this,function(a,b){this.remoteInvoke("searchDiagrams",[a],null,b,function(){b(null,"Network Error!")})}):null,function(a,b,d){m.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:d}),"*")});this.showDialog(l.container,
+620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));l.init();return}if("textContent"==g.action){l=this.getDiagramTextContent();m.postMessage(JSON.stringify({event:"textContent",data:l,message:g}),"*");return}if("status"==g.action){null!=g.messageKey?this.editor.setStatus(mxUtils.htmlEntities(mxResources.get(g.messageKey))):null!=g.message&&this.editor.setStatus(mxUtils.htmlEntities(g.message));null!=g.modified&&(this.editor.modified=g.modified);return}if("spinner"==
+g.action){var p=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||g.show?this.spinner.spin(document.body,p):this.spinner.stop();return}if("export"==g.action){if("png"==g.format||"xmlpng"==g.format){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin)){var n=null!=g.xml?g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var q=this.editor.graph,t=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);
+this.spinner.stop();var b=this.createLoadMessage("export");b.format=g.format;b.message=g;b.data=a;b.xml=encodeURIComponent(n);m.postMessage(JSON.stringify(b),"*")}),y=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==g.format&&(a=this.writeGraphModelToPng(a,"zTXt","mxGraphModel",atob(Graph.compress(n))));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container);t(a)});if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage!=this.pages[0]){var q=this.createTemporaryGraph(q.getStylesheet()),
+v=q.getGlobalVariable,x=this.pages[0];q.getGlobalVariable=function(a){return"page"==a?x.getName():"pagenumber"==a?1:v.apply(this,arguments)};document.body.appendChild(q.container);q.model.setRoot(x.root)}this.exportToCanvas(mxUtils.bind(this,function(a){y(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,function(){y(null)}),null,null,null,null,null,null,q)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==g.format?"1":"0")+"&base64=1&xml="+encodeURIComponent(encodeURIComponent(n)))).send(mxUtils.bind(this,
+function(a){200<=a.getStatus()&&299>=a.getStatus()?t("data:image/png;base64,"+a.getText()):y(null)}),mxUtils.bind(this,function(){y(null)}))}}else{null!=g.xml&&0<g.xml.length&&this.setFileData(g.xml);p=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length))l=this.getXmlFileData(),p.xml=mxUtils.getXml(l),p.data=this.getFileData(null,null,!0,null,null,null,l),p.format=g.format;else if("html"==g.format)n=this.editor.getGraphXml(),
+p.data=this.getHtml(n,this.editor.graph),p.xml=mxUtils.getXml(n),p.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;l=this.editor.graph.background;l==mxConstants.NONE&&(l=null);p.xml=this.getFileData(!0);p.format="svg";if(g.embedImages||null==g.embedImages){if(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))this.editor.graph.setEnabled(!1),"xmlsvg"==g.format?this.getEmbeddedSvg(p.xml,this.editor.graph,null,!0,mxUtils.bind(this,
+function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(a);m.postMessage(JSON.stringify(p),"*")})):this.convertImages(this.editor.graph.getSvg(l),mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();p.data=this.createSvgDataUri(mxUtils.getXml(a));m.postMessage(JSON.stringify(p),"*")}));return}l="xmlsvg"==g.format?this.getEmbeddedSvg(this.getFileData(!0),this.editor.graph,null,!0):mxUtils.getXml(this.editor.graph.getSvg(l));p.data=
+this.createSvgDataUri(l)}m.postMessage(JSON.stringify(p),"*")}return}if("load"==g.action)c=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&(urlParams.modified=g.modified),null!=g.saveAndExit&&null==urlParams.saveAndExit&&(urlParams.saveAndExit=g.saveAndExit),null!=g.title&&null!=this.buttonContainer&&(k=document.createElement("span"),mxUtils.write(k,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="12px",this.buttonContainer.style.right=
+"25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(k),this.embedFilenameSpan=k),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):g.xml;else{"remoteInvokeReady"==g.action?this.handleRemoteInvokeReady(m):"remoteInvoke"==g.action?this.handleRemoteInvoke(g):"remoteInvokeResponse"==g.action?this.handleRemoteInvokeResponse(g):
+m.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}var B=mxUtils.bind(this,function(f,g){d=!0;try{a(f,g)}catch(U){this.handleError(U)}d=!1;null!=urlParams.modified&&this.editor.setStatus("");var l=mxUtils.bind(this,function(){return"0"!=urlParams.pages||null!=this.pages&&1<this.pages.length?this.getFileData(!0):mxUtils.getXml(this.editor.getGraphXml())});e=l();c&&null==b&&(b=mxUtils.bind(this,function(a,b){var c=l();if(c!=e&&!d){var f=this.createLoadMessage("autosave");
+f.xml=c;c=JSON.stringify(f);(window.opener||window.parent).postMessage(c,"*")}e=c}),this.editor.graph.model.addListener(mxEvent.CHANGE,b),this.editor.graph.addListener("gridSizeChanged",b),this.editor.graph.addListener("shadowVisibleChanged",b),this.addListener("pageFormatChanged",b),this.addListener("pageScaleChanged",b),this.addListener("backgroundColorChanged",b),this.addListener("backgroundImageChanged",b),this.addListener("foldingEnabledChanged",b),this.addListener("mathEnabledChanged",b),this.addListener("gridEnabledChanged",
+b),this.addListener("guidesEnabledChanged",b),this.addListener("pageViewChanged",b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||m.postMessage(JSON.stringify(this.createLoadMessage("load")),"*")});null!=g&&"function"===typeof g.substring&&"data:application/vnd.visio;base64,"==g.substring(0,34)?(l="0M8R4KGxGuE"==g.substring(34,45)?"raw.vsd":"raw.vsdx",this.importVisio(this.base64ToBlob(g.substring(g.indexOf(",")+1)),function(a){B(a,f)},mxUtils.bind(this,function(a){this.handleError(a)}),
+l)):null!=g&&"function"===typeof g.substring&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(g,"")?this.parseFile(new Blob([g],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&200<=a.status&&299>=a.status&&"<mxGraphModel"==a.responseText.substring(0,13)&&B(a.responseText,f)}),""):null!=g&&"function"===typeof g.substring&&this.isLucidChartData(g)?this.convertLucidChart(g,mxUtils.bind(this,function(a){B(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):
+(g=l(g),B(g,f))}}));var m=window.opener||window.parent,k="json"==urlParams.proto?JSON.stringify({event:"init"}):urlParams.ready||"ready";m.postMessage(k,"*")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.menubar){var a=document.createElement("div");a.style.display="inline-block";a.style.position="absolute";a.style.paddingTop="atlas"==uiTheme?"2px":"3px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));
+b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="geBigButton";b.style.fontSize="12px";b.style.padding="4px 6px 4px 6px";b.style.borderRadius="3px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.style.fontSize="12px",b.style.marginLeft=
+"6px",b.style.padding="4px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.style.fontSize="12px";b.style.marginLeft="6px";b.style.marginRight="20px";b.style.padding="4px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));
+a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import")));this.showDialog(this.importCsvDialog.container,640,520,!0,!0);this.importCsvDialog.init()};
+EditorUi.prototype.importCsv=function(a,b){try{var d=a.split("\n"),c=[];if(0<d.length){var e={},f=null,k=null,m=null,q=null,t="",z="auto",v="auto",r=null,A=null,Q=40,O=40,M=100,H=0,B=this.editor.graph;B.getGraphBounds();for(var I=function(){null!=b?b(W):(B.setSelectionCells(W),B.scrollCellToVisible(B.getSelectionCell()))},S=B.getFreeInsertPoint(),V=S.x,U=S.y,S=U,X=null,J="auto",q=null,aa=[],la=null,ea=null,Y=0;Y<d.length&&"#"==d[Y].charAt(0);){a=d[Y];for(Y++;Y<d.length&&"\\"==a.charAt(a.length-1)&&
+"#"==d[Y].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(d[Y].substring(1)),Y++;if("#"!=a.charAt(1)){var ba=a.indexOf(":");if(0<ba){var K=mxUtils.trim(a.substring(1,ba)),L=mxUtils.trim(a.substring(ba+1));"label"==K?X=B.sanitizeHtml(L):"style"==K?f=L:"parentstyle"==K?k=L:"identity"==K&&0<L.length&&"-"!=L?m=L:"parent"==K&&0<L.length&&"-"!=L?q=L:"namespace"==K&&0<L.length&&"-"!=L?t=L:"width"==K?z=L:"height"==K?v=L:"left"==K&&0<L.length?r=L:"top"==K&&0<L.length?A=L:"ignore"==K?ea=L.split(","):"connect"==
+K?aa.push(JSON.parse(L)):"link"==K?la=L:"padding"==K?H=parseFloat(L):"edgespacing"==K?Q=parseFloat(L):"nodespacing"==K?O=parseFloat(L):"levelspacing"==K?M=parseFloat(L):"layout"==K&&(J=L)}}}var ha=this.editor.csvToArray(d[Y]),K=ba=null;if(null!=m||null!=q)for(var N=0;N<ha.length;N++)m==ha[N]&&(ba=N),q==ha[N]&&(K=N);null==X&&(X="%"+ha[0]+"%");if(null!=aa)for(var R=0;R<aa.length;R++)null==e[aa[R].to]&&(e[aa[R].to]={});B.model.beginUpdate();try{for(N=Y+1;N<d.length;N++){var ia=this.editor.csvToArray(d[N]);
+if(null==ia){var fa=40<d[N].length?d[N].substring(0,40)+"...":d[N];throw Error(N+" ("+fa+") "+mxResources.get("containsValidationErrors"));}if(ia.length==ha.length){var F=null,ja=null!=ba?t+ia[ba]:null;null!=ja&&(F=B.model.getCell(ja));null==F&&(F=new mxCell(X,new mxGeometry(V,S,0,0),f||"whiteSpace=wrap;html=1;"),F.vertex=!0,F.id=ja);for(var P=0;P<ia.length;P++)B.setAttributeForCell(F,ha[P],ia[P]);B.setAttributeForCell(F,"placeholders","1");F.style=B.replacePlaceholders(F,F.style);for(R=0;R<aa.length;R++)e[aa[R].to][F.getAttribute(aa[R].to)]=
F;null!=la&&"link"!=la&&(B.setLinkForCell(F,F.getAttribute(la)),B.setAttributeForCell(F,la,null));B.fireEvent(new mxEventObject("cellsInserted","cells",[F]));var ca=this.editor.graph.getPreferredSizeForCell(F);F.vertex&&(null!=r&&null!=F.getAttribute(r)&&(F.geometry.x=V+parseFloat(F.getAttribute(r))),null!=A&&null!=F.getAttribute(A)&&(F.geometry.y=U+parseFloat(F.getAttribute(A))),"@"==z.charAt(0)&&null!=F.getAttribute(z.substring(1))?F.geometry.width=parseFloat(F.getAttribute(z.substring(1))):F.geometry.width=
-"auto"==z?ca.width+H:parseFloat(z),"@"==v.charAt(0)&&null!=F.getAttribute(v.substring(1))?F.geometry.height=parseFloat(F.getAttribute(v.substring(1))):F.geometry.height="auto"==v?ca.height+H:parseFloat(v),S+=F.geometry.height+O);q=null!=K?B.model.getCell(t+ia[K]):null;null!=q?(q.style=B.replacePlaceholders(q,k),B.addCell(F,q)):d.push(B.addCell(F))}}for(var ga=d.slice(),W=d.slice(),R=0;R<aa.length;R++)for(var Z=aa[R],N=0;N<d.length;N++){var F=d[N],wa=F.getAttribute(Z.from);if(null!=wa){B.setAttributeForCell(F,
-Z.from,null);for(var ua=wa.split(","),P=0;P<ua.length;P++){var pa=f[Z.to][ua[P]];null!=pa&&(X=Z.label,null!=Z.fromlabel&&(X=(F.getAttribute(Z.fromlabel)||"")+(X||"")),null!=Z.tolabel&&(X=(X||"")+(pa.getAttribute(Z.tolabel)||"")),W.push(B.insertEdge(null,null,X||"",Z.invert?pa:F,Z.invert?F:pa,Z.style||B.createCurrentEdgeStyle())),mxUtils.remove(Z.invert?F:pa,ga))}}}if(null!=ea)for(N=0;N<d.length;N++)for(F=d[N],P=0;P<ea.length;P++)B.setAttributeForCell(F,mxUtils.trim(ea[P]),null);var ta=new mxParallelEdgeLayout(B);
-ta.spacing=Q;var va=function(){ta.execute(B.getDefaultParent());for(var a=0;a<d.length;a++){var b=B.getCellGeometry(d[a]);b.x=Math.round(B.snap(b.x));b.y=Math.round(B.snap(b.y));"auto"==z&&(b.width=Math.round(B.snap(b.width)));"auto"==v&&(b.height=Math.round(B.snap(b.height)))}};if("circle"==J){var ma=new mxCircleLayout(B);ma.resetEdges=!1;var ra=ma.isVertexIgnored;ma.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(d,a)};this.executeLayout(function(){ma.execute(B.getDefaultParent());
-va()},!0,I);I=null}else if("horizontaltree"==J||"verticaltree"==J||"auto"==J&&W.length==2*d.length-1&&1==ga.length){B.view.validate();var ka=new mxCompactTreeLayout(B,"horizontaltree"==J);ka.levelDistance=O;ka.edgeRouting=!1;ka.resetEdges=!1;this.executeLayout(function(){ka.execute(B.getDefaultParent(),0<ga.length?ga[0]:null)},!0,I);I=null}else if("horizontalflow"==J||"verticalflow"==J||"auto"==J&&1==ga.length){B.view.validate();var da=new mxHierarchicalLayout(B,"horizontalflow"==J?mxConstants.DIRECTION_WEST:
-mxConstants.DIRECTION_NORTH);da.intraCellSpacing=O;da.parallelEdgeSpacing=Q;da.interRankCellSpacing=M;da.disableEdgeStyle=!1;this.executeLayout(function(){da.execute(B.getDefaultParent(),W);B.moveCells(W,V,U)},!0,I);I=null}else if("organic"==J||"auto"==J&&W.length>d.length){B.view.validate();var sa=new mxFastOrganicLayout(B);sa.forceConstant=3*O;sa.resetEdges=!1;var xa=sa.isVertexIgnored;sa.isVertexIgnored=function(a){return xa.apply(this,arguments)||0>mxUtils.indexOf(d,a)};ta=new mxParallelEdgeLayout(B);
-ta.spacing=Q;this.executeLayout(function(){sa.execute(B.getDefaultParent());va()},!0,I);I=null}this.hideDialog()}finally{B.model.endUpdate()}null!=I&&I()}}catch(na){this.handleError(na)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var c="?",d;for(d in urlParams)0>mxUtils.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=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var c="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),d;for(d in urlParams)0>mxUtils.indexOf(c,d)&&(a=0==b?a+"?":a+"&",null!=urlParams[d]&&(a+=d+"="+urlParams[d],b++))}return a};EditorUi.prototype.showLinkDialog=function(a,b,d){a=new LinkDialog(this,a,b,d,!0);this.showDialog(a.container,480,130,!0,!0);a.init()};var t=
-EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=t.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)};
-var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(c.container)&&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*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(c.container)&&null!=this.source.minimumGraphSize){var d=this.source.getPagePadding();
-return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*d.x))/2)-d.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*d.y))/2)-d.y-5/a))}return new mxPoint(8/a,8/a)};var k=b.init;b.init=function(){k.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=c.getPageLayout(),b=c.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+
-a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,c){var d=c.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&
-(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(d.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var c=0;null==this.drive&&"function"!==typeof window.DriveClient||c++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||c++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||c++;b||null==this.gitHub||c++;b||null==this.trello&&"function"!==typeof window.TrelloClient||c++;c++;
-return c};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var d=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!d);this.actions.get("print").setEnabled(!d);this.menus.get("exportAs").setEnabled(!d);this.menus.get("embed").setEnabled(!d);
-d="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(d);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(d),this.menus.get("newLibrary").setEnabled(d));a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.actions.get("undo").setEnabled(this.canUndo()&&
+"auto"==z?ca.width+H:parseFloat(z),"@"==v.charAt(0)&&null!=F.getAttribute(v.substring(1))?F.geometry.height=parseFloat(F.getAttribute(v.substring(1))):F.geometry.height="auto"==v?ca.height+H:parseFloat(v),S+=F.geometry.height+O);q=null!=K?B.model.getCell(t+ia[K]):null;null!=q?(q.style=B.replacePlaceholders(q,k),B.addCell(F,q)):c.push(B.addCell(F))}}for(var ga=c.slice(),W=c.slice(),R=0;R<aa.length;R++)for(var Z=aa[R],N=0;N<c.length;N++){var F=c[N],wa=F.getAttribute(Z.from);if(null!=wa){B.setAttributeForCell(F,
+Z.from,null);for(var ua=wa.split(","),P=0;P<ua.length;P++){var pa=e[Z.to][ua[P]];null!=pa&&(X=Z.label,null!=Z.fromlabel&&(X=(F.getAttribute(Z.fromlabel)||"")+(X||"")),null!=Z.tolabel&&(X=(X||"")+(pa.getAttribute(Z.tolabel)||"")),W.push(B.insertEdge(null,null,X||"",Z.invert?pa:F,Z.invert?F:pa,Z.style||B.createCurrentEdgeStyle())),mxUtils.remove(Z.invert?F:pa,ga))}}}if(null!=ea)for(N=0;N<c.length;N++)for(F=c[N],P=0;P<ea.length;P++)B.setAttributeForCell(F,mxUtils.trim(ea[P]),null);var ta=new mxParallelEdgeLayout(B);
+ta.spacing=Q;var va=function(){ta.execute(B.getDefaultParent());for(var a=0;a<c.length;a++){var b=B.getCellGeometry(c[a]);b.x=Math.round(B.snap(b.x));b.y=Math.round(B.snap(b.y));"auto"==z&&(b.width=Math.round(B.snap(b.width)));"auto"==v&&(b.height=Math.round(B.snap(b.height)))}};if("circle"==J){var ma=new mxCircleLayout(B);ma.resetEdges=!1;var ra=ma.isVertexIgnored;ma.isVertexIgnored=function(a){return ra.apply(this,arguments)||0>mxUtils.indexOf(c,a)};this.executeLayout(function(){ma.execute(B.getDefaultParent());
+va()},!0,I);I=null}else if("horizontaltree"==J||"verticaltree"==J||"auto"==J&&W.length==2*c.length-1&&1==ga.length){B.view.validate();var ka=new mxCompactTreeLayout(B,"horizontaltree"==J);ka.levelDistance=O;ka.edgeRouting=!1;ka.resetEdges=!1;this.executeLayout(function(){ka.execute(B.getDefaultParent(),0<ga.length?ga[0]:null)},!0,I);I=null}else if("horizontalflow"==J||"verticalflow"==J||"auto"==J&&1==ga.length){B.view.validate();var da=new mxHierarchicalLayout(B,"horizontalflow"==J?mxConstants.DIRECTION_WEST:
+mxConstants.DIRECTION_NORTH);da.intraCellSpacing=O;da.parallelEdgeSpacing=Q;da.interRankCellSpacing=M;da.disableEdgeStyle=!1;this.executeLayout(function(){da.execute(B.getDefaultParent(),W);B.moveCells(W,V,U)},!0,I);I=null}else if("organic"==J||"auto"==J&&W.length>c.length){B.view.validate();var sa=new mxFastOrganicLayout(B);sa.forceConstant=3*O;sa.resetEdges=!1;var xa=sa.isVertexIgnored;sa.isVertexIgnored=function(a){return xa.apply(this,arguments)||0>mxUtils.indexOf(c,a)};ta=new mxParallelEdgeLayout(B);
+ta.spacing=Q;this.executeLayout(function(){sa.execute(B.getDefaultParent());va()},!0,I);I=null}this.hideDialog()}finally{B.model.endUpdate()}null!=I&&I()}}catch(na){this.handleError(na)}};EditorUi.prototype.getSearch=function(a){var b="";if("1"!=urlParams.offline&&"1"!=urlParams.demo&&null!=a&&0<window.location.search.length){var d="?",c;for(c in urlParams)0>mxUtils.indexOf(a,c)&&null!=urlParams[c]&&(b+=d+c+"="+urlParams[c],d="&")}else b=window.location.search;return b};EditorUi.prototype.getUrl=
+function(a){a=null!=a?a:window.location.pathname;var b=0<a.indexOf("?")?1:0;if("1"==urlParams.offline)a+=window.location.search;else{var d="tmp libs clibs state fileId code share notitle data url embed client create title splash".split(" "),c;for(c in urlParams)0>mxUtils.indexOf(d,c)&&(a=0==b?a+"?":a+"&",null!=urlParams[c]&&(a+=c+"="+urlParams[c],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 t=
+EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=t.apply(this,arguments),d=this.editor.graph,c=b.getSourceGraphBounds;b.getSourceGraphBounds=function(){if(mxUtils.hasScrollbars(d.container)&&d.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 c.apply(this,arguments)};
+var e=b.getSourceContainerSize;b.getSourceContainerSize=function(){if(mxUtils.hasScrollbars(d.container)&&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*b-2*a.x),Math.ceil(this.source.minimumGraphSize.height*b-2*a.y))}return e.apply(this,arguments)};b.getOutlineOffset=function(a){if(mxUtils.hasScrollbars(d.container)&&null!=this.source.minimumGraphSize){var c=this.source.getPagePadding();
+return new mxPoint(Math.round(Math.max(0,(b.outline.container.clientWidth/a-(this.source.minimumGraphSize.width-2*c.x))/2)-c.x),Math.round(Math.max(0,(b.outline.container.clientHeight/a-(this.source.minimumGraphSize.height-2*c.y))/2)-c.y-5/a))}return new mxPoint(8/a,8/a)};var k=b.init;b.init=function(){k.apply(this,arguments);b.outline.view.getBackgroundPageBounds=function(){var a=d.getPageLayout(),b=d.getPageSize();return new mxRectangle(this.scale*(this.translate.x+a.x*b.width),this.scale*(this.translate.y+
+a.y*b.height),this.scale*a.width*b.width,this.scale*a.height*b.height)};b.outline.view.validateBackgroundPage()};this.editor.addListener("pageSelected",function(a,d){var c=d.getProperty("change"),e=b.source,f=b.outline;f.pageScale=e.pageScale;f.pageFormat=e.pageFormat;f.background=e.background;f.pageVisible=e.pageVisible;f.background=e.background;var g=mxUtils.getCurrentStyle(e.container);f.container.style.backgroundColor=g.backgroundColor;null!=e.view.backgroundPageShape&&null!=f.view.backgroundPageShape&&
+(f.view.backgroundPageShape.fill=e.view.backgroundPageShape.fill);b.outline.view.clear(c.previousPage.root,!0);b.outline.view.validate()});return b};EditorUi.prototype.getServiceCount=function(a,b){var d=0;null==this.drive&&"function"!==typeof window.DriveClient||d++;b||null==this.dropbox&&"function"!==typeof window.DropboxClient||d++;null==this.oneDrive&&"function"!==typeof window.OneDriveClient||d++;b||null==this.gitHub||d++;b||null==this.trello&&"function"!==typeof window.TrelloClient||d++;d++;
+return d};EditorUi.prototype.updateUi=function(){this.updateButtonContainer();this.updateActionStates();var a=this.getCurrentFile(),b=null!=a||"1"==urlParams.embed&&this.editor.graph.isEnabled();this.menus.get("viewPanels").setEnabled(b);this.menus.get("viewZoom").setEnabled(b);var c=("1"!=urlParams.embed||!this.editor.graph.isEnabled())&&(null==a||a.isRestricted());this.actions.get("makeCopy").setEnabled(!c);this.actions.get("print").setEnabled(!c);this.menus.get("exportAs").setEnabled(!c);this.menus.get("embed").setEnabled(!c);
+c="1"!=urlParams.embed||this.editor.graph.isEnabled();this.menus.get("extras").setEnabled(c);Editor.enableCustomLibraries&&(this.menus.get("openLibraryFrom").setEnabled(c),this.menus.get("newLibrary").setEnabled(c));a="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=a&&a.isEditable();this.actions.get("image").setEnabled(b);this.actions.get("zoomIn").setEnabled(b);this.actions.get("zoomOut").setEnabled(b);this.actions.get("resetView").setEnabled(b);this.actions.get("undo").setEnabled(this.canUndo()&&
a);this.actions.get("redo").setEnabled(this.canRedo()&&a);this.menus.get("edit").setEnabled(b);this.menus.get("view").setEnabled(b);this.menus.get("importFrom").setEnabled(a);this.menus.get("arrange").setEnabled(a);null!=this.toolbar&&(null!=this.toolbar.edgeShapeMenu&&this.toolbar.edgeShapeMenu.setEnabled(a),null!=this.toolbar.edgeStyleMenu&&this.toolbar.edgeStyleMenu.setEnabled(a));if(this.isAppCache()){var e=applicationCache;if(null!=e&&null==this.offlineStatus){this.offlineStatus=document.createElement("div");
this.offlineStatus.className="geItem";this.offlineStatus.style.position="absolute";this.offlineStatus.style.fontSize="8pt";this.offlineStatus.style.top="2px";this.offlineStatus.style.right="12px";this.offlineStatus.style.color="#666";this.offlineStatus.style.margin="4px";this.offlineStatus.style.padding="2px";this.offlineStatus.style.verticalAlign="middle";this.offlineStatus.innerHTML="";this.menubarContainer.appendChild(this.offlineStatus);mxEvent.addListener(this.offlineStatus,"click",mxUtils.bind(this,
function(){var a=this.offlineStatus.getElementsByTagName("img");null!=a&&0<a.length&&this.alert(a[0].getAttribute("title"))}));var e=window.applicationCache,l=null,b=mxUtils.bind(this,function(){var a=e.status,b;a==e.CHECKING&&(a=e.DOWNLOADING);switch(a){case e.UNCACHED:b="";break;case e.IDLE:b="min"==uiTheme?"":'<img title="draw.io is up to date." border="0" src="'+IMAGE_PATH+'/checkmark.gif"/>';break;case e.DOWNLOADING:b='<img title="Downloading new version..." border="0" src="'+IMAGE_PATH+'/spin.gif"/>';
break;case e.UPDATEREADY:b='<img title="'+mxUtils.htmlEntities(mxResources.get("restartForChangeRequired"))+'" border="0" src="'+IMAGE_PATH+'/download.png"/>';break;case e.OBSOLETE:b='<img title="Obsolete" border="0" src="'+IMAGE_PATH+'/clear.gif"/>';break;default:b='<img title="Unknown" border="0" src="'+IMAGE_PATH+'/clear.gif"/>'}a!=l&&(this.offlineStatus.innerHTML=b,l=a)});mxEvent.addListener(e,"checking",b);mxEvent.addListener(e,"noupdate",b);mxEvent.addListener(e,"downloading",b);mxEvent.addListener(e,
"progress",b);mxEvent.addListener(e,"cached",b);mxEvent.addListener(e,"updateready",b);mxEvent.addListener(e,"obsolete",b);mxEvent.addListener(e,"error",b);b()}}else this.updateUserElement()};EditorUi.prototype.updateButtonContainer=function(){};EditorUi.prototype.updateUserElement=function(){};EditorUi.prototype.isDiagramActive=function(){var a=this.getCurrentFile();return null!=a&&a.isEditable()||"1"==urlParams.embed&&this.editor.graph.isEnabled()};var v=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=
-function(){v.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),d=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=d&&d.isEditable()&&d.isAutosaveOptional());this.actions.get("guides").setEnabled(b);this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&
-!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);this.actions.get("moveToFolder").setEnabled(null!=d);this.actions.get("makeCopy").setEnabled(null!=d&&!d.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==d||!d.isRestricted()));this.actions.get("publishLink").setEnabled(null!=
-d&&!d.isRestricted());this.actions.get("tags").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("find").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=d&&d.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=d);
-this.menus.get("publish").setEnabled(null!=d&&!d.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var A=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.editUpdateListener&&(this.editor.undoManager.removeListener(this.editUpdateListener),this.editUpdateListener=null);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);A.apply(this,
-arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,d,e,l,k){var c=a.editor.graph;if("xml"==d)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==d)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(c.getSvg(e,l,k)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=c.getGraphBounds(),m=Math.floor(g.width*l/c.view.scale),p=Math.floor(g.height*l/c.view.scale);
-f.length<=MAX_REQUEST_SIZE&&m*p<MAX_AREA?(a.hideDialog(),a.saveRequest(b,d,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+d+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+m+"&h="+p+"&border="+k+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.updateEditReferences=function(a){for(var b=0;b<a.changes.length;b++){var c=a.changes[b];if(null!=c&&c.constructor==mxChildChange&&null!=
-c.child){var d=c.child;if(null!=d.source&&null!=d.source.id){var e=this.getFutureCellForEdit(c.model,a,d.source.id);e!=d.source&&(d.source=e)}null!=d.target&&null!=d.target.id&&(c=this.getFutureCellForEdit(c.model,a,d.target.id),c!=d.target&&(d.target=c))}}};EditorUi.prototype.getFutureCellForEdit=function(a,b,d){var c=a.getCell(d);if(null==c)for(var e=b.changes.length-1;0<=e;e--){var f=b.changes[e];if(f.constructor==mxChildChange&&null!=f.child&&f.child.id==d){a.contains(f.previous)&&(c=f.child);
-break}}return c};EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var a=this.editor.graph,b="";if(null!=this.pages)for(var d=0;d<this.pages.length;d++){var e=a;this.currentPage!=this.pages[d]&&(e=this.createTemporaryGraph(a.getStylesheet()),e.model.setRoot(this.pages[d].root));b+=this.pages[d].getName()+" "+e.getIndexableText()+" "}else b=a.getIndexableText();this.editor.graph.setEnabled(!0);return b};EditorUi.prototype.showRemotelyStoredLibrary=function(a){var b=
-{},c=document.createElement("div");c.style.whiteSpace="nowrap";var d=document.createElement("h3");mxUtils.write(d,mxUtils.htmlEntities(a));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";c.appendChild(d);var e=document.createElement("div");e.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";e.innerHTML='<img src="/images/spin.gif">';var k={};try{var m=mxSettings.getCustomLibraries();for(a=0;a<m.length;a++){var q=m[a];if("R"==q.substring(0,1)){var t=
-JSON.parse(decodeURIComponent(q.substring(1)));k[t[0]]={id:t[0],title:t[1],downloadUrl:t[2]}}}}catch(G){}this.remoteInvoke("getCustomLibraries",null,null,function(a){e.innerHTML="";for(var c=0;c<a.length;c++){var d=a[c];k[d.id]&&(b[d.id]=d);var f=this.addCheckbox(e,d.title,k[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked?b[a.id]=a:delete b[a.id]})})(d,f)}},function(){this.handleError(null,mxResources.get("errorGettingConfLibs",null,"An error occured while getting Confluence libraries list"))});
-c.appendChild(e);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==k[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(C){this.handleError(C,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,
-mxResources.get("errorLoadingFile"))}))})(b[c]));for(c in k)b[c]||this.closeLibrary(new RemoteLibrary(this,null,k[c]));0==a&&this.spinner.stop()}));this.showDialog(c.container,340,375,!0,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(a){this.remoteWin=a;for(var b=0;b<this.remoteInvokeQueue.length;b++)a.postMessage(this.remoteInvokeQueue[b],
-"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(a){var b=a.msgMarkers,c=this.remoteInvokeCallbacks[b.callbackId];a.error?c.error&&c.error(a.error.errResp):c.callback&&c.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=function(a,b,d,e,l){d=d||{};d.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:e,error:l});a=JSON.stringify({event:"remoteInvoke",funtionName:a,functionArgs:b,
-msgMarkers:d});null!=this.remoteWin?this.remoteWin.postMessage(a,"*"):this.remoteInvokeQueue.push(a)};EditorUi.prototype.handleRemoteInvoke=function(a){var b=mxUtils.bind(this,function(b,c){var d={event:"remoteInvokeResponse",msgMarkers:a.msgMarkers};null!=c?d.error={errResp:c}:null!=b&&(d.resp=b);this.remoteWin.postMessage(JSON.stringify(d),"*")});try{var c=a.funtionName,d=this.remoteInvokableFns[c];if(null!=d&&"function"===typeof this[c]){var e=a.functionArgs;Array.isArray(e)||(e=[]);if(d.isAsync)e.push(function(){b(Array.prototype.slice.apply(arguments))}),
-e.push(function(a){b(null,a||"Unkown Error")}),this[c].apply(this,e);else{var k=this[c].apply(this,e);b([k])}}else b(null,"Invalid Call: "+c+" is not found.")}catch(y){b(null,"Invalid Call: An error occured, "+y.message)}}})();function DiagramPage(a){this.node=a;null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};
+function(){v.apply(this,arguments);var a=this.editor.graph,b=this.isDiagramActive(),c=this.getCurrentFile();this.actions.get("pageSetup").setEnabled(b);this.actions.get("autosave").setEnabled(null!=c&&c.isEditable()&&c.isAutosaveOptional());this.actions.get("guides").setEnabled(b);this.actions.get("editData").setEnabled(b);this.actions.get("shadowVisible").setEnabled(b);this.actions.get("connectionArrows").setEnabled(b);this.actions.get("connectionPoints").setEnabled(b);this.actions.get("copyStyle").setEnabled(b&&
+!a.isSelectionEmpty());this.actions.get("pasteStyle").setEnabled(b&&!a.isSelectionEmpty());this.actions.get("editGeometry").setEnabled(a.getModel().isVertex(a.getSelectionCell()));this.actions.get("createShape").setEnabled(b);this.actions.get("createRevision").setEnabled(b);this.actions.get("moveToFolder").setEnabled(null!=c);this.actions.get("makeCopy").setEnabled(null!=c&&!c.isRestricted());this.actions.get("editDiagram").setEnabled(b&&(null==c||!c.isRestricted()));this.actions.get("publishLink").setEnabled(null!=
+c&&!c.isRestricted());this.actions.get("tags").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("find").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("layers").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("outline").setEnabled("hidden"!=this.diagramContainer.style.visibility);this.actions.get("rename").setEnabled(null!=c&&c.isRenamable()||"1"==urlParams.embed);this.actions.get("close").setEnabled(null!=c);
+this.menus.get("publish").setEnabled(null!=c&&!c.isRestricted());a=a.view.getState(a.getSelectionCell());this.actions.get("editShape").setEnabled(b&&null!=a&&null!=a.shape&&null!=a.shape.stencil)};var A=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){this.editUpdateListener&&(this.editor.undoManager.removeListener(this.editUpdateListener),this.editUpdateListener=null);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null);A.apply(this,
+arguments)};null!=window.ExportDialog&&(ExportDialog.showXmlOption=!1,ExportDialog.showGifOption=!1,ExportDialog.exportFile=function(a,b,c,e,l,k){var d=a.editor.graph;if("xml"==c)a.hideDialog(),a.saveData(b,"xml",mxUtils.getXml(a.editor.getGraphXml()),"text/xml");else if("svg"==c)a.hideDialog(),a.saveData(b,"svg",mxUtils.getXml(d.getSvg(e,l,k)),"image/svg+xml");else{var f=a.getFileData(!0,null,null,null,null,!0),g=d.getGraphBounds(),m=Math.floor(g.width*l/d.view.scale),p=Math.floor(g.height*l/d.view.scale);
+f.length<=MAX_REQUEST_SIZE&&m*p<MAX_AREA?(a.hideDialog(),a.saveRequest(b,c,function(a,b){return new mxXmlRequest(EXPORT_URL,"format="+c+"&base64="+(b||"0")+(null!=a?"&filename="+encodeURIComponent(a):"")+"&bg="+(null!=e?e:"none")+"&w="+m+"&h="+p+"&border="+k+"&xml="+encodeURIComponent(f))})):mxUtils.alert(mxResources.get("drawingTooLarge"))}});EditorUi.prototype.updateEditReferences=function(a){for(var b=0;b<a.changes.length;b++){var d=a.changes[b];if(null!=d&&d.constructor==mxChildChange&&null!=
+d.child){var c=d.child;if(null!=c.source&&null!=c.source.id){var e=this.getFutureCellForEdit(d.model,a,c.source.id);e!=c.source&&(c.source=e)}null!=c.target&&null!=c.target.id&&(d=this.getFutureCellForEdit(d.model,a,c.target.id),d!=c.target&&(c.target=d))}}};EditorUi.prototype.getFutureCellForEdit=function(a,b,c){var d=a.getCell(c);if(null==d)for(var e=b.changes.length-1;0<=e;e--){var f=b.changes[e];if(f.constructor==mxChildChange&&null!=f.child&&f.child.id==c){a.contains(f.previous)&&(d=f.child);
+break}}return d};EditorUi.prototype.getDiagramTextContent=function(){this.editor.graph.setEnabled(!1);var a=this.editor.graph,b="";if(null!=this.pages)for(var c=0;c<this.pages.length;c++){var e=a;this.currentPage!=this.pages[c]&&(e=this.createTemporaryGraph(a.getStylesheet()),e.model.setRoot(this.pages[c].root));b+=this.pages[c].getName()+" "+e.getIndexableText()+" "}else b=a.getIndexableText();this.editor.graph.setEnabled(!0);return b};EditorUi.prototype.showRemotelyStoredLibrary=function(a){var b=
+{},d=document.createElement("div");d.style.whiteSpace="nowrap";var c=document.createElement("h3");mxUtils.write(c,mxUtils.htmlEntities(a));c.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(c);var e=document.createElement("div");e.style.cssText="border:1px solid lightGray;overflow: auto;height:300px";e.innerHTML='<img src="/images/spin.gif">';var k={};try{var m=mxSettings.getCustomLibraries();for(a=0;a<m.length;a++){var q=m[a];if("R"==q.substring(0,1)){var t=
+JSON.parse(decodeURIComponent(q.substring(1)));k[t[0]]={id:t[0],title:t[1],downloadUrl:t[2]}}}}catch(G){}this.remoteInvoke("getCustomLibraries",null,null,function(a){e.innerHTML="";for(var d=0;d<a.length;d++){var c=a[d];k[c.id]&&(b[c.id]=c);var f=this.addCheckbox(e,c.title,k[c.id]);(function(a,d){mxEvent.addListener(d,"change",function(){this.checked?b[a.id]=a:delete b[a.id]})})(c,f)}},function(){this.handleError(null,mxResources.get("errorGettingConfLibs",null,"An error occured while getting Confluence libraries list"))});
+d.appendChild(e);d=new CustomDialog(this,d,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,d;for(d in b)null==k[d]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,function(d){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,d,b))}catch(C){this.handleError(C,mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,
+mxResources.get("errorLoadingFile"))}))})(b[d]));for(d in k)b[d]||this.closeLibrary(new RemoteLibrary(this,null,k[d]));0==a&&this.spinner.stop()}));this.showDialog(d.container,340,375,!0,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1}};EditorUi.prototype.remoteInvokeCallbacks=[];EditorUi.prototype.remoteInvokeQueue=[];EditorUi.prototype.handleRemoteInvokeReady=function(a){this.remoteWin=a;for(var b=0;b<this.remoteInvokeQueue.length;b++)a.postMessage(this.remoteInvokeQueue[b],
+"*");this.remoteInvokeQueue=[]};EditorUi.prototype.handleRemoteInvokeResponse=function(a){var b=a.msgMarkers,d=this.remoteInvokeCallbacks[b.callbackId];a.error?d.error&&d.error(a.error.errResp):d.callback&&d.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=function(a,b,c,e,l){c=c||{};c.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:e,error:l});a=JSON.stringify({event:"remoteInvoke",funtionName:a,functionArgs:b,
+msgMarkers:c});null!=this.remoteWin?this.remoteWin.postMessage(a,"*"):this.remoteInvokeQueue.push(a)};EditorUi.prototype.handleRemoteInvoke=function(a){var b=mxUtils.bind(this,function(b,d){var c={event:"remoteInvokeResponse",msgMarkers:a.msgMarkers};null!=d?c.error={errResp:d}:null!=b&&(c.resp=b);this.remoteWin.postMessage(JSON.stringify(c),"*")});try{var d=a.funtionName,c=this.remoteInvokableFns[d];if(null!=c&&"function"===typeof this[d]){var e=a.functionArgs;Array.isArray(e)||(e=[]);if(c.isAsync)e.push(function(){b(Array.prototype.slice.apply(arguments))}),
+e.push(function(a){b(null,a||"Unkown Error")}),this[d].apply(this,e);else{var k=this[d].apply(this,e);b([k])}}else b(null,"Invalid Call: "+d+" is not found.")}catch(y){b(null,"Invalid Call: An error occured, "+y.message)}}})();function DiagramPage(a){this.node=a;null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")};DiagramPage.prototype.setName=function(a){null==a?this.node.removeAttribute("name"):this.node.setAttribute("name",a)};
function RenamePage(a,b,e){this.ui=a;this.page=b;this.previous=this.name=e}RenamePage.prototype.execute=function(){var a=this.page.getName();this.page.setName(this.previous);this.name=this.previous;this.previous=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageRenamed"))};function MovePage(a,b,e){this.ui=a;this.oldIndex=b;this.newIndex=e}
MovePage.prototype.execute=function(){this.ui.pages.splice(this.newIndex,0,this.ui.pages.splice(this.oldIndex,1)[0]);var a=this.oldIndex;this.oldIndex=this.newIndex;this.newIndex=a;this.ui.editor.graph.updatePlaceholders();this.ui.editor.fireEvent(new mxEventObject("pageMoved"))};function SelectPage(a,b,e){this.ui=a;this.previousPage=this.page=b;this.neverShown=!0;null!=b&&(this.neverShown=null==b.viewState,this.ui.updatePageRoot(b),null!=e&&(b.viewState=e,this.neverShown=!1))}
-SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,b=this.ui.editor,e=b.graph,d=Graph.compressNode(b.getGraphXml(!0));mxUtils.setTextContent(a.node,d);a.viewState=e.getViewState();a.root=e.model.root;null!=a.model&&a.model.rootChanged(a.root);e.view.clear(a.root,!0);e.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;e.model.prefix=Editor.guid()+"-";e.model.rootChanged(a.root);
-e.setViewState(a.viewState);e.gridEnabled=e.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);b.updateGraphComponents();e.view.validate();e.sizeDidChange();this.neverShown&&(this.neverShown=!1,e.selectUnlockedLayer());b.graph.fireEvent(new mxEventObject(mxEvent.ROOT));b.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(a,b,e,d,k){SelectPage.call(this,a,e);this.relatedPage=b;this.index=d;this.previousIndex=null;this.noSelect=k}
+SelectPage.prototype.execute=function(){var a=mxUtils.indexOf(this.ui.pages,this.previousPage);if(null!=this.page&&0<=a){var a=this.ui.currentPage,b=this.ui.editor,e=b.graph,c=Graph.compressNode(b.getGraphXml(!0));mxUtils.setTextContent(a.node,c);a.viewState=e.getViewState();a.root=e.model.root;null!=a.model&&a.model.rootChanged(a.root);e.view.clear(a.root,!0);e.clearSelection();this.ui.currentPage=this.previousPage;this.previousPage=a;a=this.ui.currentPage;e.model.prefix=Editor.guid()+"-";e.model.rootChanged(a.root);
+e.setViewState(a.viewState);e.gridEnabled=e.gridEnabled&&(!this.ui.editor.isChromelessView()||"1"==urlParams.grid);b.updateGraphComponents();e.view.validate();e.sizeDidChange();this.neverShown&&(this.neverShown=!1,e.selectUnlockedLayer());b.graph.fireEvent(new mxEventObject(mxEvent.ROOT));b.fireEvent(new mxEventObject("pageSelected","change",this))}};function ChangePage(a,b,e,c,k){SelectPage.call(this,a,e);this.relatedPage=b;this.index=c;this.previousIndex=null;this.noSelect=k}
mxUtils.extend(ChangePage,SelectPage);ChangePage.prototype.execute=function(){this.ui.editor.fireEvent(new mxEventObject("beforePageChange","change",this));this.previousIndex=this.index;if(null==this.index){var a=mxUtils.indexOf(this.ui.pages,this.relatedPage);this.ui.pages.splice(a,1);this.index=a}else this.ui.pages.splice(this.index,0,this.relatedPage),this.index=null;this.noSelect||SelectPage.prototype.execute.apply(this,arguments)};EditorUi.prototype.tabContainerHeight=38;
EditorUi.prototype.getSelectedPageIndex=function(){var a=null;if(null!=this.pages&&null!=this.currentPage)for(var b=0;b<this.pages.length;b++)if(this.pages[b]==this.currentPage){a=b;break}return a};EditorUi.prototype.getPageById=function(a){if(null!=this.pages)for(var b=0;b<this.pages.length;b++)if(this.pages[b].getId()==a)return this.pages[b];return null};
-EditorUi.prototype.initPages=function(){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.keyHandler.bindAction(33,!0,"previousPage",!0);this.keyHandler.bindAction(34,!0,"nextPage",!0);var a=this.editor.graph,b=a.view.validateBackground;a.view.validateBackground=mxUtils.bind(this,function(){if(null!=this.tabContainer){var d=this.tabContainer.style.height;this.tabContainer.style.height=
-null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":this.tabContainerHeight+"px";d!=this.tabContainer.style.height&&this.refresh(!1)}b.apply(a.view,arguments)});var e=null,d=mxUtils.bind(this,function(){this.updateTabContainer();var b=this.currentPage;null!=b&&b!=e&&(null==b.viewState||null==b.viewState.scrollLeft?(this.resetScrollbars(),a.isLightboxView()&&this.lightboxFit(),null!=this.chromelessResize&&(a.container.scrollLeft=0,a.container.scrollTop=0,this.chromelessResize())):
+EditorUi.prototype.initPages=function(){this.actions.addAction("previousPage",mxUtils.bind(this,function(){this.selectNextPage(!1)}));this.actions.addAction("nextPage",mxUtils.bind(this,function(){this.selectNextPage(!0)}));this.keyHandler.bindAction(33,!0,"previousPage",!0);this.keyHandler.bindAction(34,!0,"nextPage",!0);var a=this.editor.graph,b=a.view.validateBackground;a.view.validateBackground=mxUtils.bind(this,function(){if(null!=this.tabContainer){var c=this.tabContainer.style.height;this.tabContainer.style.height=
+null==this.fileNode||null==this.pages||1==this.pages.length&&"0"==urlParams.pages?"0px":this.tabContainerHeight+"px";c!=this.tabContainer.style.height&&this.refresh(!1)}b.apply(a.view,arguments)});var e=null,c=mxUtils.bind(this,function(){this.updateTabContainer();var b=this.currentPage;null!=b&&b!=e&&(null==b.viewState||null==b.viewState.scrollLeft?(this.resetScrollbars(),a.isLightboxView()&&this.lightboxFit(),null!=this.chromelessResize&&(a.container.scrollLeft=0,a.container.scrollTop=0,this.chromelessResize())):
(a.container.scrollLeft=a.view.translate.x*a.view.scale+b.viewState.scrollLeft,a.container.scrollTop=a.view.translate.y*a.view.scale+b.viewState.scrollTop),e=b);null!=this.actions.layersWindow&&this.actions.layersWindow.refreshLayers();"undefined"!==typeof MathJax&&"undefined"!==typeof MathJax.Hub?1!=MathJax.Hub.queue.pending||null==this.editor||this.editor.graph.mathEnabled||MathJax.Hub.Queue(mxUtils.bind(this,function(){null!=this.editor&&this.editor.graph.refresh()})):"undefined"===typeof Editor.MathJaxClear||
-null!=this.editor&&this.editor.graph.mathEnabled||Editor.MathJaxClear()});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){for(var e=b.getProperty("edit").changes,k=0;k<e.length;k++)if(e[k]instanceof SelectPage||e[k]instanceof RenamePage||e[k]instanceof MovePage||e[k]instanceof mxRootChange){d();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)};
-EditorUi.prototype.restoreViewState=function(a,b,e){a=null!=a?this.getPageById(a.getId()):null;var d=this.editor.graph;null!=a&&null!=this.currentPage&&null!=this.pages&&(a!=this.currentPage?this.selectPage(a,!0,b):(d.setViewState(b),this.editor.updateGraphComponents(),d.view.revalidate(),d.sizeDidChange()),d.container.scrollLeft=d.view.translate.x*d.view.scale+b.scrollLeft,d.container.scrollTop=d.view.translate.y*d.view.scale+b.scrollTop,d.restoreSelection(e))};
-Graph.prototype.createViewState=function(a){var b=a.getAttribute("page"),e=parseFloat(a.getAttribute("pageScale")),d=parseFloat(a.getAttribute("pageWidth")),k=parseFloat(a.getAttribute("pageHeight")),m=a.getAttribute("background"),q=a.getAttribute("backgroundImage"),q=null!=q&&0<q.length?JSON.parse(q):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),
-shadowVisible:"1"==a.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=b?"0"!=b:this.defaultPageVisible,background:null!=m&&0<m.length?m:null,backgroundImage:null!=q?new mxImage(q.src,q.width,q.height):null,pageScale:isNaN(e)?mxGraph.prototype.pageScale:e,pageFormat:isNaN(d)||isNaN(k)?mxSettings.getPageFormat():new mxRectangle(0,0,d,k),tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"1"==a.getAttribute("math"),
+null!=this.editor&&this.editor.graph.mathEnabled||Editor.MathJaxClear()});this.editor.graph.model.addListener(mxEvent.CHANGE,mxUtils.bind(this,function(a,b){for(var e=b.getProperty("edit").changes,k=0;k<e.length;k++)if(e[k]instanceof SelectPage||e[k]instanceof RenamePage||e[k]instanceof MovePage||e[k]instanceof mxRootChange){c();break}}));null!=this.toolbar&&this.editor.addListener("pageSelected",this.toolbar.updateZoom)};
+EditorUi.prototype.restoreViewState=function(a,b,e){a=null!=a?this.getPageById(a.getId()):null;var c=this.editor.graph;null!=a&&null!=this.currentPage&&null!=this.pages&&(a!=this.currentPage?this.selectPage(a,!0,b):(c.setViewState(b),this.editor.updateGraphComponents(),c.view.revalidate(),c.sizeDidChange()),c.container.scrollLeft=c.view.translate.x*c.view.scale+b.scrollLeft,c.container.scrollTop=c.view.translate.y*c.view.scale+b.scrollTop,c.restoreSelection(e))};
+Graph.prototype.createViewState=function(a){var b=a.getAttribute("page"),e=parseFloat(a.getAttribute("pageScale")),c=parseFloat(a.getAttribute("pageWidth")),k=parseFloat(a.getAttribute("pageHeight")),m=a.getAttribute("background"),q=a.getAttribute("backgroundImage"),q=null!=q&&0<q.length?JSON.parse(q):null;return{gridEnabled:"0"!=a.getAttribute("grid"),gridSize:parseFloat(a.getAttribute("gridSize"))||mxGraph.prototype.gridSize,guidesEnabled:"0"!=a.getAttribute("guides"),foldingEnabled:"0"!=a.getAttribute("fold"),
+shadowVisible:"1"==a.getAttribute("shadow"),pageVisible:this.isLightboxView()?!1:null!=b?"0"!=b:this.defaultPageVisible,background:null!=m&&0<m.length?m:null,backgroundImage:null!=q?new mxImage(q.src,q.width,q.height):null,pageScale:isNaN(e)?mxGraph.prototype.pageScale:e,pageFormat:isNaN(c)||isNaN(k)?mxSettings.getPageFormat():new mxRectangle(0,0,c,k),tooltips:"0"!=a.getAttribute("tooltips"),connect:"0"!=a.getAttribute("connect"),arrows:"0"!=a.getAttribute("arrows"),mathEnabled:"1"==a.getAttribute("math"),
selectionCells:null,defaultParent:null,scrollbars:this.defaultScrollbars,scale:1}};
Graph.prototype.saveViewState=function(a,b,e){e||(b.setAttribute("grid",null==a||a.gridEnabled?"1":"0"),b.setAttribute("gridSize",null!=a?a.gridSize:mxGraph.prototype.gridSize),b.setAttribute("guides",null==a||a.guidesEnabled?"1":"0"),b.setAttribute("tooltips",null==a||a.tooltips?"1":"0"),b.setAttribute("connect",null==a||a.connect?"1":"0"),b.setAttribute("arrows",null==a||a.arrows?"1":"0"),b.setAttribute("page",null==a&&this.defaultPageVisible||null!=a&&a.pageVisible?"1":"0"),b.setAttribute("fold",
null==a||a.foldingEnabled?"1":"0"));b.setAttribute("pageScale",null!=a&&null!=a.pageScale?a.pageScale:mxGraph.prototype.pageScale);e=null!=a?a.pageFormat:mxSettings.getPageFormat();null!=e&&(b.setAttribute("pageWidth",e.width),b.setAttribute("pageHeight",e.height));null!=a&&null!=a.background&&b.setAttribute("background",a.background);null!=a&&null!=a.backgroundImage&&b.setAttribute("backgroundImage",JSON.stringify(a.backgroundImage));b.setAttribute("math",null!=a&&a.mathEnabled?"1":"0");b.setAttribute("shadow",
@@ -3248,84 +3249,84 @@ a.pageFormat,this.view.currentRoot=a.currentRoot,this.defaultParent=a.defaultPar
(this.view.currentRoot=null,this.view.scale=1,this.gridEnabled=!0,this.gridSize=mxGraph.prototype.gridSize,this.pageScale=mxGraph.prototype.pageScale,this.pageFormat=mxSettings.getPageFormat(),this.pageVisible=this.defaultPageVisible,this.backgroundImage=this.background=null,this.scrollbars=this.defaultScrollbars,this.foldingEnabled=this.graphHandler.guidesEnabled=!0,this.setShadowVisible(!1,!1),this.defaultParent=null,this.setTooltips(!0),this.setConnectable(!0),this.lastPasteXml=null,this.pasteCounter=
0,this.mathEnabled=!1,this.connectionArrowsEnabled=!0);this.preferPageSize=this.pageBreaksVisible=this.pageVisible;this.fireEvent(new mxEventObject("viewStateChanged","state",a))};
EditorUi.prototype.updatePageRoot=function(a){if(null==a.root){var b=this.editor.extractGraphModel(a.node);if(null!=b){a.graphModelNode=b;a.viewState=this.editor.graph.createViewState(b);var e=new mxCodec(b.ownerDocument);a.root=e.decode(b).root}else a.root=this.editor.graph.model.createRoot()}else null==a.viewState&&(null==a.graphModelNode&&(b=this.editor.extractGraphModel(a.node),null!=b&&(a.graphModelNode=b)),null!=a.graphModelNode&&(a.viewState=this.editor.graph.createViewState(a.graphModelNode)));
-return a};EditorUi.prototype.selectPage=function(a,b,e){try{this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);b=null!=b?b:!1;this.editor.graph.isMouseDown=!1;this.editor.graph.reset();var d=this.editor.graph.model.createUndoableEdit();d.ignoreEdit=!0;var k=new SelectPage(this,a,e);k.execute();d.add(k);d.notify();this.editor.graph.tooltipHandler.hide();b||this.editor.graph.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",d))}catch(m){this.handleError(m)}};
+return a};EditorUi.prototype.selectPage=function(a,b,e){try{this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);b=null!=b?b:!1;this.editor.graph.isMouseDown=!1;this.editor.graph.reset();var c=this.editor.graph.model.createUndoableEdit();c.ignoreEdit=!0;var k=new SelectPage(this,a,e);k.execute();c.add(k);c.notify();this.editor.graph.tooltipHandler.hide();b||this.editor.graph.model.fireEvent(new mxEventObject(mxEvent.UNDO,"edit",c))}catch(m){this.handleError(m)}};
EditorUi.prototype.selectNextPage=function(a){var b=this.currentPage;null!=b&&null!=this.pages&&(b=mxUtils.indexOf(this.pages,b),a?this.selectPage(this.pages[mxUtils.mod(b+1,this.pages.length)]):a||this.selectPage(this.pages[mxUtils.mod(b-1,this.pages.length)]))};EditorUi.prototype.insertPage=function(a,b){if(this.editor.graph.isEnabled()){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);a=null!=a?a:this.createPage();b=null!=b?b:this.pages.length;var e=new ChangePage(this,a,a,b);this.editor.graph.model.execute(e)}return a};
EditorUi.prototype.createPage=function(a){var b=new DiagramPage(this.fileNode.ownerDocument.createElement("diagram"));b.setName(null!=a?a:this.createPageName());return b};EditorUi.prototype.createPageName=function(){for(var a={},b=0;b<this.pages.length;b++){var e=this.pages[b].getName();null!=e&&0<e.length&&(a[e]=e)}b=this.pages.length;do e=mxResources.get("pageWithNumber",[++b]);while(null!=a[e]);return e};
-EditorUi.prototype.removePage=function(a){try{var b=this.editor.graph,e=mxUtils.indexOf(this.pages,a);if(b.isEnabled()&&0<=e){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);b.model.beginUpdate();try{var d=this.currentPage;d==a&&1<this.pages.length?(e==this.pages.length-1?e--:e++,d=this.pages[e]):1>=this.pages.length&&(d=this.insertPage(),b.model.execute(new RenamePage(this,d,mxResources.get("pageWithNumber",[1]))));b.model.execute(new ChangePage(this,a,d))}finally{b.model.endUpdate()}}}catch(k){this.handleError(k)}return a};
-EditorUi.prototype.duplicatePage=function(a,b){var e=null;try{var d=this.editor.graph;if(d.isEnabled()){d.isEditing()&&d.stopEditing();var k=a.node.cloneNode(!1);k.removeAttribute("id");e=new DiagramPage(k);e.root=d.cloneCell(d.model.root);e.viewState=d.getViewState();e.viewState.scale=1;e.viewState.scrollLeft=null;e.viewState.scrollTop=null;e.viewState.currentRoot=null;e.viewState.defaultParent=null;e.setName(b);e=this.insertPage(e,mxUtils.indexOf(this.pages,a)+1)}}catch(m){this.handleError(m)}return e};
+EditorUi.prototype.removePage=function(a){try{var b=this.editor.graph,e=mxUtils.indexOf(this.pages,a);if(b.isEnabled()&&0<=e){this.editor.graph.isEditing()&&this.editor.graph.stopEditing(!1);b.model.beginUpdate();try{var c=this.currentPage;c==a&&1<this.pages.length?(e==this.pages.length-1?e--:e++,c=this.pages[e]):1>=this.pages.length&&(c=this.insertPage(),b.model.execute(new RenamePage(this,c,mxResources.get("pageWithNumber",[1]))));b.model.execute(new ChangePage(this,a,c))}finally{b.model.endUpdate()}}}catch(k){this.handleError(k)}return a};
+EditorUi.prototype.duplicatePage=function(a,b){var e=null;try{var c=this.editor.graph;if(c.isEnabled()){c.isEditing()&&c.stopEditing();var k=a.node.cloneNode(!1);k.removeAttribute("id");e=new DiagramPage(k);e.root=c.cloneCell(c.model.root);e.viewState=c.getViewState();e.viewState.scale=1;e.viewState.scrollLeft=null;e.viewState.scrollTop=null;e.viewState.currentRoot=null;e.viewState.defaultParent=null;e.setName(b);e=this.insertPage(e,mxUtils.indexOf(this.pages,a)+1)}}catch(m){this.handleError(m)}return e};
EditorUi.prototype.renamePage=function(a){if(this.editor.graph.isEnabled()){var b=new FilenameDialog(this,a.getName(),mxResources.get("rename"),mxUtils.bind(this,function(b){null!=b&&0<b.length&&this.editor.graph.model.execute(new RenamePage(this,a,b))}),mxResources.get("rename"));this.showDialog(b.container,300,80,!0,!0);b.init()}return a};EditorUi.prototype.movePage=function(a,b){this.editor.graph.model.execute(new MovePage(this,a,b))};
EditorUi.prototype.createTabContainer=function(){var a=document.createElement("div");a.className="geTabContainer";a.style.position="absolute";a.style.whiteSpace="nowrap";a.style.overflow="hidden";a.style.height="0px";return a};
-EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var a=this.editor.graph,b=document.createElement("div");b.style.position="relative";b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.verticalAlign="top";b.style.height=this.tabContainer.style.height;b.style.whiteSpace="nowrap";b.style.overflow="hidden";b.style.fontSize="13px";b.style.marginLeft="30px";for(var e=this.editor.isChromelessView()?29:59,d=Math.min(140,Math.max(20,(this.tabContainer.clientWidth-
-e)/this.pages.length)+1),k=null,m=0;m<this.pages.length;m++)mxUtils.bind(this,function(d,c){this.pages[d]==this.currentPage?(c.className="geActivePage",c.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#fff"):c.className="geInactivePage";c.setAttribute("draggable","true");mxEvent.addListener(c,"dragstart",mxUtils.bind(this,function(b){a.isEnabled()?(mxClient.IS_FF&&b.dataTransfer.setData("Text","<diagram/>"),k=d):mxEvent.consume(b)}));mxEvent.addListener(c,"dragend",mxUtils.bind(this,function(a){k=
-null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c,"dragover",mxUtils.bind(this,function(a){null!=k&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c,"drop",mxUtils.bind(this,function(a){null!=k&&d!=k&&this.movePage(k,d);a.stopPropagation();a.preventDefault()}));b.appendChild(c)})(m,this.createTabForPage(this.pages[m],d,this.pages[m]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(b);d=this.createPageMenuTab();
-this.tabContainer.appendChild(d);d=null;this.isPageInsertTabVisible()&&(d=this.createPageInsertTab(),this.tabContainer.appendChild(d));if(b.clientWidth>this.tabContainer.clientWidth-e){null!=d&&(d.style.position="absolute",d.style.right="0px",b.style.marginRight="30px");var q=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");q.style.position="absolute";q.style.right=this.editor.chromeless?"29px":"55px";q.style.fontSize="13pt";this.tabContainer.appendChild(q);var t=this.createControlTab(4,"&nbsp;&#10095;");
+EditorUi.prototype.updateTabContainer=function(){if(null!=this.tabContainer&&null!=this.pages){var a=this.editor.graph,b=document.createElement("div");b.style.position="relative";b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.verticalAlign="top";b.style.height=this.tabContainer.style.height;b.style.whiteSpace="nowrap";b.style.overflow="hidden";b.style.fontSize="13px";b.style.marginLeft="30px";for(var e=this.editor.isChromelessView()?29:59,c=Math.min(140,Math.max(20,(this.tabContainer.clientWidth-
+e)/this.pages.length)+1),k=null,m=0;m<this.pages.length;m++)mxUtils.bind(this,function(c,d){this.pages[c]==this.currentPage?(d.className="geActivePage",d.style.backgroundColor="dark"==uiTheme?"#2a2a2a":"#fff"):d.className="geInactivePage";d.setAttribute("draggable","true");mxEvent.addListener(d,"dragstart",mxUtils.bind(this,function(b){a.isEnabled()?(mxClient.IS_FF&&b.dataTransfer.setData("Text","<diagram/>"),k=c):mxEvent.consume(b)}));mxEvent.addListener(d,"dragend",mxUtils.bind(this,function(a){k=
+null;a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(a){null!=k&&(a.dataTransfer.dropEffect="move");a.stopPropagation();a.preventDefault()}));mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=k&&c!=k&&this.movePage(k,c);a.stopPropagation();a.preventDefault()}));b.appendChild(d)})(m,this.createTabForPage(this.pages[m],c,this.pages[m]!=this.currentPage));this.tabContainer.innerHTML="";this.tabContainer.appendChild(b);c=this.createPageMenuTab();
+this.tabContainer.appendChild(c);c=null;this.isPageInsertTabVisible()&&(c=this.createPageInsertTab(),this.tabContainer.appendChild(c));if(b.clientWidth>this.tabContainer.clientWidth-e){null!=c&&(c.style.position="absolute",c.style.right="0px",b.style.marginRight="30px");var q=this.createControlTab(4,"&nbsp;&#10094;&nbsp;");q.style.position="absolute";q.style.right=this.editor.chromeless?"29px":"55px";q.style.fontSize="13pt";this.tabContainer.appendChild(q);var t=this.createControlTab(4,"&nbsp;&#10095;");
t.style.position="absolute";t.style.right=this.editor.chromeless?"0px":"29px";t.style.fontSize="13pt";this.tabContainer.appendChild(t);var v=Math.max(0,this.tabContainer.clientWidth-(this.editor.chromeless?86:116));b.style.width=v+"px";mxEvent.addListener(q,"click",mxUtils.bind(this,function(a){b.scrollLeft-=Math.max(20,v-20);mxUtils.setOpacity(q,0<b.scrollLeft?100:50);mxUtils.setOpacity(t,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}));mxUtils.setOpacity(q,0<b.scrollLeft?100:
50);mxUtils.setOpacity(t,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.addListener(t,"click",mxUtils.bind(this,function(a){b.scrollLeft+=Math.max(20,v-20);mxUtils.setOpacity(q,0<b.scrollLeft?100:50);mxUtils.setOpacity(t,b.scrollLeft<b.scrollWidth-b.clientWidth?100:50);mxEvent.consume(a)}))}}};EditorUi.prototype.isPageInsertTabVisible=function(){return 1==urlParams.embed||null!=this.getCurrentFile()&&this.getCurrentFile().isEditable()};
EditorUi.prototype.createTab=function(a){var b=document.createElement("div");b.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";b.style.whiteSpace="nowrap";b.style.boxSizing="border-box";b.style.position="relative";b.style.overflow="hidden";b.style.textAlign="center";b.style.marginLeft="-1px";b.style.height=this.tabContainer.clientHeight+"px";b.style.padding="12px 4px 8px 4px";b.style.border="dark"==uiTheme?"1px solid #505759":"1px solid #e8eaed";b.style.borderTopStyle="none";b.style.borderBottomStyle=
"none";b.style.backgroundColor=this.tabContainer.style.backgroundColor;b.style.cursor="move";b.style.color="gray";a&&(mxEvent.addListener(b,"mouseenter",mxUtils.bind(this,function(a){this.editor.graph.isMouseDown||(b.style.backgroundColor="dark"==uiTheme?"black":"#e8eaed",mxEvent.consume(a))})),mxEvent.addListener(b,"mouseleave",mxUtils.bind(this,function(a){b.style.backgroundColor=this.tabContainer.style.backgroundColor;mxEvent.consume(a)})));return b};
EditorUi.prototype.createControlTab=function(a,b){var e=this.createTab(!0);e.style.lineHeight=this.tabContainerHeight+"px";e.style.paddingTop=a+"px";e.style.cursor="pointer";e.style.width="30px";e.innerHTML=b;null!=e.firstChild&&null!=e.firstChild.style&&mxUtils.setOpacity(e.firstChild,40);return e};
-EditorUi.prototype.createPageMenuTab=function(){var a=this.createControlTab(3,'<div class="geSprite geSprite-dots" style="display:inline-block;margin-top:5px;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("pages"));a.style.position="absolute";a.style.marginLeft="0px";a.style.top="0px";a.style.left="1px";mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var b=new mxPopupMenu(mxUtils.bind(this,function(a,b){for(var d=
-0;d<this.pages.length;d++)mxUtils.bind(this,function(d){var c=a.addItem(this.pages[d].getName(),null,mxUtils.bind(this,function(){this.selectPage(this.pages[d])}),b);this.pages[d]==this.currentPage&&a.addCheckmark(c,Editor.checkmarkImage)})(d);if(this.editor.graph.isEnabled()){a.addSeparator(b);a.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){this.insertPage()}),b);var e=this.currentPage;null!=e&&(a.addSeparator(b),a.addItem(mxResources.get("delete"),null,mxUtils.bind(this,
-function(){this.removePage(e)}),b),a.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(e,e.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(e,mxResources.get("copyOf",[e.getName()]))}),b))}}));b.div.className+=" geMenubarMenu";b.smartSeparators=!0;b.showDisabled=!0;b.autoExpand=!0;b.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(b,arguments);b.destroy()});var d=
-mxEvent.getClientX(a),k=mxEvent.getClientY(a);b.popup(d,k,null,a);this.setCurrentMenu(b);mxEvent.consume(a)}));return a};EditorUi.prototype.createPageInsertTab=function(){var a=this.createControlTab(4,'<div class="geSprite geSprite-plus" style="display:inline-block;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("insertPage"));mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.insertPage();mxEvent.consume(a)}));return a};
-EditorUi.prototype.createTabForPage=function(a,b,e){e=this.createTab(e);var d=a.getName()||mxResources.get("untitled"),k=a.getId();e.setAttribute("title",d+(null!=k?" ("+k+")":""));mxUtils.write(e,d);e.style.maxWidth=b+"px";e.style.width=b+"px";this.addTabListeners(a,e);42<b&&(e.style.textOverflow="ellipsis");return e};
-EditorUi.prototype.addTabListeners=function(a,b){mxEvent.disableContextMenu(b);var e=this.editor.graph;mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var d=!1,k=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){d=null!=this.currentMenu;k=a==this.currentPage;e.isMouseDown||k||this.selectPage(a)}),null,mxUtils.bind(this,function(m){if(e.isEnabled()&&!e.isMouseDown&&(mxEvent.isTouchEvent(m)&&k||mxEvent.isPopupTrigger(m))){e.popupMenuHandler.hideMenu();
-this.hideCurrentMenu();if(!mxEvent.isTouchEvent(m)||!d){var q=new mxPopupMenu(this.createPageMenu(a));q.div.className+=" geMenubarMenu";q.smartSeparators=!0;q.showDisabled=!0;q.autoExpand=!0;q.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(q,arguments);this.resetCurrentMenu();q.destroy()});var t=mxEvent.getClientX(m),v=mxEvent.getClientY(m);q.popup(t,v,null,m);this.setCurrentMenu(q,b)}mxEvent.consume(m)}}))};
-EditorUi.prototype.createPageMenu=function(a,b){return mxUtils.bind(this,function(e,d){e.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),d);e.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),d);e.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,b)}),d);e.addSeparator(d);e.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a,
-mxResources.get("copyOf",[a.getName()]))}),d)})};(function(){var a=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(b){a.apply(this,arguments);this.updateTabContainer()}})();(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,e,d){d.ui=a.ui;return e};a.afterDecode=function(a,e,d){a=d.oldIndex;d.oldIndex=d.newIndex;d.newIndex=a;return d};mxCodecRegistry.register(a)})();
-(function(){var a=new mxObjectCodec(new RenamePage,["ui","page"]);a.beforeDecode=function(a,e,d){d.ui=a.ui;return e};a.afterDecode=function(a,e,d){a=d.previous;d.previous=d.name;d.name=a;return d};mxCodecRegistry.register(a)})();
-(function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" ")),b="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");a.afterEncode=function(a,d,k){k.setAttribute("relatedPage",d.relatedPage.getId());null==d.index&&(k.setAttribute("name",d.relatedPage.getName()),null!=d.relatedPage.viewState&&k.setAttribute("viewState",JSON.stringify(d.relatedPage.viewState,function(a,d){return 0>mxUtils.indexOf(b,
-a)?d:void 0})),null!=d.relatedPage.root&&a.encodeCell(d.relatedPage.root,k));return k};a.beforeDecode=function(a,b,k){k.ui=a.ui;k.relatedPage=k.ui.getPageById(b.getAttribute("relatedPage"));if(null==k.relatedPage){var d=b.ownerDocument.createElement("diagram");d.setAttribute("id",b.getAttribute("relatedPage"));d.setAttribute("name",b.getAttribute("name"));k.relatedPage=new DiagramPage(d);d=b.getAttribute("viewState");null!=d&&(k.relatedPage.viewState=JSON.parse(d),b.removeAttribute("viewState"));
-b=b.cloneNode(!0);d=b.firstChild;if(null!=d)for(k.relatedPage.root=a.decodeCell(d,!1),k=d.nextSibling,d.parentNode.removeChild(d),d=k;null!=d;){k=d.nextSibling;if(d.nodeType==mxConstants.NODETYPE_ELEMENT){var e=d.getAttribute("id");null==a.lookup(e)&&a.decodeCell(d)}d.parentNode.removeChild(d);d=k}}return b};a.afterDecode=function(a,b,k){k.index=k.previousIndex;return k};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png";EditorUi.prototype.altShiftActions[68]=
-"selectDescendants";var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(a,d,e,t,v){d=null!=d?d:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var k=e.slice(),c=[],f=0;f<e.length;f++){var g=this.view.getState(e[f]),m=null!=g?g.style:this.getCellStyle(e[f]);"1"==mxUtils.getValue(m,"treeFolding","0")&&(this.traverse(e[f],!0,mxUtils.bind(this,function(a,b){null!=b&&c.push(b);a!=e[f]&&c.push(a);return a==e[f]||!this.model.isCollapsed(a)})),
-this.model.setCollapsed(e[f],a))}for(f=0;f<c.length;f++)this.model.setVisible(c[f],!a);e=k;e=b.apply(this,arguments)}finally{this.model.endUpdate()}return e};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return p.isVertex(a)&&d(a)}function d(a){var b=!1;null!=a&&(a=p.getParent(a),b=l.view.getState(a),l.view.getState(a),b="tree"==(null!=
+EditorUi.prototype.createPageMenuTab=function(){var a=this.createControlTab(3,'<div class="geSprite geSprite-dots" style="display:inline-block;margin-top:5px;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("pages"));a.style.position="absolute";a.style.marginLeft="0px";a.style.top="0px";a.style.left="1px";mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.editor.graph.popupMenuHandler.hideMenu();var b=new mxPopupMenu(mxUtils.bind(this,function(a,b){for(var c=
+0;c<this.pages.length;c++)mxUtils.bind(this,function(c){var d=a.addItem(this.pages[c].getName(),null,mxUtils.bind(this,function(){this.selectPage(this.pages[c])}),b);this.pages[c]==this.currentPage&&a.addCheckmark(d,Editor.checkmarkImage)})(c);if(this.editor.graph.isEnabled()){a.addSeparator(b);a.addItem(mxResources.get("insertPage"),null,mxUtils.bind(this,function(){this.insertPage()}),b);var e=this.currentPage;null!=e&&(a.addSeparator(b),a.addItem(mxResources.get("delete"),null,mxUtils.bind(this,
+function(){this.removePage(e)}),b),a.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(e,e.getName())}),b),a.addSeparator(b),a.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(e,mxResources.get("copyOf",[e.getName()]))}),b))}}));b.div.className+=" geMenubarMenu";b.smartSeparators=!0;b.showDisabled=!0;b.autoExpand=!0;b.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(b,arguments);b.destroy()});var c=
+mxEvent.getClientX(a),k=mxEvent.getClientY(a);b.popup(c,k,null,a);this.setCurrentMenu(b);mxEvent.consume(a)}));return a};EditorUi.prototype.createPageInsertTab=function(){var a=this.createControlTab(4,'<div class="geSprite geSprite-plus" style="display:inline-block;width:21px;height:21px;"></div>');a.setAttribute("title",mxResources.get("insertPage"));mxEvent.addListener(a,"click",mxUtils.bind(this,function(a){this.insertPage();mxEvent.consume(a)}));return a};
+EditorUi.prototype.createTabForPage=function(a,b,e){e=this.createTab(e);var c=a.getName()||mxResources.get("untitled"),k=a.getId();e.setAttribute("title",c+(null!=k?" ("+k+")":""));mxUtils.write(e,c);e.style.maxWidth=b+"px";e.style.width=b+"px";this.addTabListeners(a,e);42<b&&(e.style.textOverflow="ellipsis");return e};
+EditorUi.prototype.addTabListeners=function(a,b){mxEvent.disableContextMenu(b);var e=this.editor.graph;mxEvent.addListener(b,"dblclick",mxUtils.bind(this,function(b){this.renamePage(a);mxEvent.consume(b)}));var c=!1,k=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this,function(b){c=null!=this.currentMenu;k=a==this.currentPage;e.isMouseDown||k||this.selectPage(a)}),null,mxUtils.bind(this,function(m){if(e.isEnabled()&&!e.isMouseDown&&(mxEvent.isTouchEvent(m)&&k||mxEvent.isPopupTrigger(m))){e.popupMenuHandler.hideMenu();
+this.hideCurrentMenu();if(!mxEvent.isTouchEvent(m)||!c){var q=new mxPopupMenu(this.createPageMenu(a));q.div.className+=" geMenubarMenu";q.smartSeparators=!0;q.showDisabled=!0;q.autoExpand=!0;q.hideMenu=mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(q,arguments);this.resetCurrentMenu();q.destroy()});var t=mxEvent.getClientX(m),v=mxEvent.getClientY(m);q.popup(t,v,null,m);this.setCurrentMenu(q,b)}mxEvent.consume(m)}}))};
+EditorUi.prototype.createPageMenu=function(a,b){return mxUtils.bind(this,function(e,c){e.addItem(mxResources.get("insert"),null,mxUtils.bind(this,function(){this.insertPage(null,mxUtils.indexOf(this.pages,a)+1)}),c);e.addItem(mxResources.get("delete"),null,mxUtils.bind(this,function(){this.removePage(a)}),c);e.addItem(mxResources.get("rename"),null,mxUtils.bind(this,function(){this.renamePage(a,b)}),c);e.addSeparator(c);e.addItem(mxResources.get("duplicate"),null,mxUtils.bind(this,function(){this.duplicatePage(a,
+mxResources.get("copyOf",[a.getName()]))}),c)})};(function(){var a=EditorUi.prototype.refresh;EditorUi.prototype.refresh=function(b){a.apply(this,arguments);this.updateTabContainer()}})();(function(){mxCodecRegistry.getCodec(ChangePageSetup).exclude.push("page")})();(function(){var a=new mxObjectCodec(new MovePage,["ui"]);a.beforeDecode=function(a,e,c){c.ui=a.ui;return e};a.afterDecode=function(a,e,c){a=c.oldIndex;c.oldIndex=c.newIndex;c.newIndex=a;return c};mxCodecRegistry.register(a)})();
+(function(){var a=new mxObjectCodec(new RenamePage,["ui","page"]);a.beforeDecode=function(a,e,c){c.ui=a.ui;return e};a.afterDecode=function(a,e,c){a=c.previous;c.previous=c.name;c.name=a;return c};mxCodecRegistry.register(a)})();
+(function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" ")),b="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");a.afterEncode=function(a,c,k){k.setAttribute("relatedPage",c.relatedPage.getId());null==c.index&&(k.setAttribute("name",c.relatedPage.getName()),null!=c.relatedPage.viewState&&k.setAttribute("viewState",JSON.stringify(c.relatedPage.viewState,function(a,c){return 0>mxUtils.indexOf(b,
+a)?c:void 0})),null!=c.relatedPage.root&&a.encodeCell(c.relatedPage.root,k));return k};a.beforeDecode=function(a,b,k){k.ui=a.ui;k.relatedPage=k.ui.getPageById(b.getAttribute("relatedPage"));if(null==k.relatedPage){var c=b.ownerDocument.createElement("diagram");c.setAttribute("id",b.getAttribute("relatedPage"));c.setAttribute("name",b.getAttribute("name"));k.relatedPage=new DiagramPage(c);c=b.getAttribute("viewState");null!=c&&(k.relatedPage.viewState=JSON.parse(c),b.removeAttribute("viewState"));
+b=b.cloneNode(!0);c=b.firstChild;if(null!=c)for(k.relatedPage.root=a.decodeCell(c,!1),k=c.nextSibling,c.parentNode.removeChild(c),c=k;null!=c;){k=c.nextSibling;if(c.nodeType==mxConstants.NODETYPE_ELEMENT){var e=c.getAttribute("id");null==a.lookup(e)&&a.decodeCell(c)}c.parentNode.removeChild(c);c=k}}return b};a.afterDecode=function(a,b,k){k.index=k.previousIndex;return k};mxCodecRegistry.register(a)})();(function(){var a=mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAASFBMVEUAAAAAAAB/f3/9/f319fUfHx/7+/s+Pj69vb0AAAAAAAAAAAAAAAAAAAAAAAAAAAB2dnZ1dXUAAAAAAAAVFRX///8ZGRkGBgbOcI1hAAAAE3RSTlMA+vr9/f38+fb1893Bo00u+/tFvPJUBQAAAIRJREFUGNM0jEcSxCAQAxlydGqD///TNWxZBx1aXVIrWysplbapL3sFxgDq/idXBnHgBPK1nIxwc55vCXl6dRFtrV6svs/A/UjsPcpzA5tqyByD92HqQlMFh45BG6ND1DiKSoPDdm96N77bg5F+wyaEqRGb8ZiOwHQqdg9hehszcLAEIQB2lQ4p/sEpnAAAAABJRU5ErkJggg==":IMAGE_PATH+"/move.png";EditorUi.prototype.altShiftActions[68]=
+"selectDescendants";var b=Graph.prototype.foldCells;Graph.prototype.foldCells=function(a,c,e,t,v){c=null!=c?c:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),a));this.stopEditing();this.model.beginUpdate();try{for(var k=e.slice(),d=[],f=0;f<e.length;f++){var g=this.view.getState(e[f]),m=null!=g?g.style:this.getCellStyle(e[f]);"1"==mxUtils.getValue(m,"treeFolding","0")&&(this.traverse(e[f],!0,mxUtils.bind(this,function(a,b){null!=b&&d.push(b);a!=e[f]&&d.push(a);return a==e[f]||!this.model.isCollapsed(a)})),
+this.model.setCollapsed(e[f],a))}for(f=0;f<d.length;f++)this.model.setVisible(d[f],!a);e=k;e=b.apply(this,arguments)}finally{this.model.endUpdate()}return e};var e=EditorUi.prototype.init;EditorUi.prototype.init=function(){e.apply(this,arguments);this.editor.isChromelessView()&&!this.editor.editable||this.addTrees()};EditorUi.prototype.addTrees=function(){function b(a){return p.isVertex(a)&&c(a)}function c(a){var b=!1;null!=a&&(a=p.getParent(a),b=l.view.getState(a),l.view.getState(a),b="tree"==(null!=
b?b.style:l.getCellStyle(a)).containerType);return b}function e(a){var b=!1;null!=a&&(a=p.getParent(a),b=l.view.getState(a),l.view.getState(a),b=null!=(null!=b?b.style:l.getCellStyle(a)).childLayout);return b}function t(a){a=l.view.getState(a);if(null!=a){var b=l.getIncomingEdges(a.cell);if(0<b.length&&(b=l.view.getState(b[0]),null!=b&&(b=b.absolutePoints,null!=b&&0<b.length&&(b=b[b.length-1],null!=b)))){if(b.y==a.y&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_SOUTH;if(b.y==
a.y+a.height&&Math.abs(b.x-a.getCenterX())<a.width/2)return mxConstants.DIRECTION_NORTH;if(b.x>a.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function v(a,b){b=null!=b?b:!0;l.model.beginUpdate();try{var c=l.model.getParent(a),d=l.getIncomingEdges(a),e=l.cloneCells([d[0],a]);l.model.setTerminal(e[0],l.model.getTerminal(d[0],!0),!0);var f=t(a),g=c.geometry;f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?e[1].geometry.x+=b?a.geometry.width+10:-e[1].geometry.width-
10:e[1].geometry.y+=b?a.geometry.height+10:-e[1].geometry.height-10;l.view.currentRoot!=c&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);var k=l.view.getState(a),m=l.view.scale;if(null!=k){var p=mxRectangle.fromRectangle(k);f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NORTH?p.x+=(b?a.geometry.width+10:-e[1].geometry.width-10)*m:p.y+=(b?a.geometry.height+10:-e[1].geometry.height-10)*m;var r=l.getOutgoingEdges(l.model.getTerminal(d[0],!0));if(null!=r){for(var q=f==mxConstants.DIRECTION_SOUTH||
f==mxConstants.DIRECTION_NORTH,n=g=d=0;n<r.length;n++){var z=l.model.getTerminal(r[n],!1);if(f==t(z)){var u=l.view.getState(z);z!=a&&null!=u&&(q&&b!=u.getCenterX()<k.getCenterX()||!q&&b!=u.getCenterY()<k.getCenterY())&&mxUtils.intersects(p,u)&&(d=10+Math.max(d,(Math.min(p.x+p.width,u.x+u.width)-Math.max(p.x,u.x))/m),g=10+Math.max(g,(Math.min(p.y+p.height,u.y+u.height)-Math.max(p.y,u.y))/m))}}q?g=0:d=0;for(n=0;n<r.length;n++)if(z=l.model.getTerminal(r[n],!1),f==t(z)&&(u=l.view.getState(z),z!=a&&null!=
u&&(q&&b!=u.getCenterX()<k.getCenterX()||!q&&b!=u.getCenterY()<k.getCenterY()))){var v=[];l.traverse(u.cell,!0,function(a,b){null!=b&&v.push(b);v.push(a);return!0});l.moveCells(v,(b?1:-1)*d,(b?1:-1)*g)}}}return l.addCells(e,c)}finally{l.model.endUpdate()}}function A(a){l.model.beginUpdate();try{var b=t(a),c=l.getIncomingEdges(a),d=l.cloneCells([c[0],a]);l.model.setTerminal(c[0],d[1],!1);l.model.setTerminal(d[0],d[1],!0);l.model.setTerminal(d[0],a,!1);var e=l.model.getParent(a),f=e.geometry,g=[];l.view.currentRoot!=
-e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);l.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,m=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,m=-m):b==mxConstants.DIRECTION_WEST?(k=-k,m=0):b==mxConstants.DIRECTION_EAST&&(m=0);l.moveCells(g,k,m);return l.addCells(d,e)}finally{l.model.endUpdate()}}function c(a){l.model.beginUpdate();try{var b=l.model.getParent(a),c=l.getIncomingEdges(a),d=l.cloneCells([c[0],
-a]);l.model.setTerminal(d[0],a,!0);var c=l.getOutgoingEdges(a),e=b.geometry,f=[];l.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<c.length;g++){var k=l.model.getTerminal(c[g],!1);null!=k&&f.push(k)}var m=l.view.getBounds(f),p=t(a),r=l.view.translate,q=l.view.scale;p==mxConstants.DIRECTION_SOUTH?(d[1].geometry.x=null==m?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(m.x+m.width)/q-r.x-e.x+10,d[1].geometry.y+=d[1].geometry.height-e.y+40):p==mxConstants.DIRECTION_NORTH?(d[1].geometry.x=
-null==m?a.geometry.x+(a.geometry.width-d[1].geometry.width)/2:(m.x+m.width)/q-r.x+-e.x+10,d[1].geometry.y-=d[1].geometry.height+e.y+40):(d[1].geometry.x=p==mxConstants.DIRECTION_WEST?d[1].geometry.x-(d[1].geometry.width+e.x+40):d[1].geometry.x+(d[1].geometry.width-e.x+40),d[1].geometry.y=null==m?a.geometry.y+(a.geometry.height-d[1].geometry.height)/2:(m.y+m.height)/q-r.y+-e.y+10);return l.addCells(d,b)}finally{l.model.endUpdate()}}function f(a,b,c){a=l.getOutgoingEdges(a);c=l.view.getState(c);var d=
+e&&(d[1].geometry.x-=f.x,d[1].geometry.y-=f.y);l.traverse(a,!0,function(a,b){null!=b&&g.push(b);g.push(a);return!0});var k=a.geometry.width+40,m=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?k=0:b==mxConstants.DIRECTION_NORTH?(k=0,m=-m):b==mxConstants.DIRECTION_WEST?(k=-k,m=0):b==mxConstants.DIRECTION_EAST&&(m=0);l.moveCells(g,k,m);return l.addCells(d,e)}finally{l.model.endUpdate()}}function d(a){l.model.beginUpdate();try{var b=l.model.getParent(a),d=l.getIncomingEdges(a),c=l.cloneCells([d[0],
+a]);l.model.setTerminal(c[0],a,!0);var d=l.getOutgoingEdges(a),e=b.geometry,f=[];l.view.currentRoot==b&&(e=new mxRectangle);for(var g=0;g<d.length;g++){var k=l.model.getTerminal(d[g],!1);null!=k&&f.push(k)}var m=l.view.getBounds(f),p=t(a),r=l.view.translate,q=l.view.scale;p==mxConstants.DIRECTION_SOUTH?(c[1].geometry.x=null==m?a.geometry.x+(a.geometry.width-c[1].geometry.width)/2:(m.x+m.width)/q-r.x-e.x+10,c[1].geometry.y+=c[1].geometry.height-e.y+40):p==mxConstants.DIRECTION_NORTH?(c[1].geometry.x=
+null==m?a.geometry.x+(a.geometry.width-c[1].geometry.width)/2:(m.x+m.width)/q-r.x+-e.x+10,c[1].geometry.y-=c[1].geometry.height+e.y+40):(c[1].geometry.x=p==mxConstants.DIRECTION_WEST?c[1].geometry.x-(c[1].geometry.width+e.x+40):c[1].geometry.x+(c[1].geometry.width-e.x+40),c[1].geometry.y=null==m?a.geometry.y+(a.geometry.height-c[1].geometry.height)/2:(m.y+m.height)/q-r.y+-e.y+10);return l.addCells(c,b)}finally{l.model.endUpdate()}}function f(a,b,c){a=l.getOutgoingEdges(a);c=l.view.getState(c);var d=
[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=l.view.getState(l.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function g(a,b){var c=t(a),d=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST)==d&&c!=b?n.actions.get("selectParent").funct():
c==b?(d=l.getOutgoingEdges(a),null!=d&&0<d.length&&l.setSelectionCell(l.model.getTerminal(d[0],!1))):(c=l.getIncomingEdges(a),null!=c&&0<c.length&&(d=f(l.model.getTerminal(c[0],!0),d,a),c=l.view.getState(a),null!=c&&(c=mxUtils.indexOf(d,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=d.length-1&&l.setSelectionCell(d[c].cell)))))}var n=this,l=n.editor.graph,p=l.getModel(),y=n.menus.createPopupMenu;n.menus.createPopupMenu=function(a,c,d){y.apply(this,arguments);
if(1==l.getSelectionCount()){c=l.getSelectionCell();var e=l.getOutgoingEdges(c);a.addSeparator();null!=e&&0<e.length&&(b(l.getSelectionCell())&&this.addMenuItems(a,["selectChildren"],null,d),this.addMenuItems(a,["selectDescendants"],null,d));b(l.getSelectionCell())&&(a.addSeparator(),0<l.getIncomingEdges(c).length&&this.addMenuItems(a,["selectSiblings","selectParent"],null,d))}};n.actions.addAction("selectChildren",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),
a=l.getOutgoingEdges(a);if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(l.model.getTerminal(a[c],!1));l.setSelectionCells(b)}}},null,null,"Alt+Shift+X");n.actions.addAction("selectSiblings",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),a=l.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=l.getOutgoingEdges(l.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(l.model.getTerminal(a[c],!1));l.setSelectionCells(b)}}},null,null,"Alt+Shift+S");
n.actions.addAction("selectParent",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),a=l.getIncomingEdges(a);null!=a&&0<a.length&&l.setSelectionCell(l.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");n.actions.addAction("selectDescendants",function(){if(l.isEnabled()&&1==l.getSelectionCount()){var a=l.getSelectionCell(),b=[];l.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});l.setSelectionCells(b)}},null,null,"Alt+Shift+D");var x=l.removeCells;
-l.removeCells=function(a,c){c=null!=c?c:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));c&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];p.isEdge(g)&&d(g)&&(e.push(g),g=p.getTerminal(g,!1));b(g)?(l.traverse(g,!0,function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=l.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return x.apply(this,arguments)};n.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,
+l.removeCells=function(a,d){d=null!=d?d:!0;null==a&&(a=this.getDeletableCells(this.getSelectionCells()));d&&(a=this.getDeletableCells(this.addAllEdges(a)));for(var e=[],f=0;f<a.length;f++){var g=a[f];p.isEdge(g)&&c(g)&&(e.push(g),g=p.getTerminal(g,!1));b(g)?(l.traverse(g,!0,function(a,b){null!=b&&e.push(b);e.push(a);return!0}),g=l.getIncomingEdges(a[f]),a=a.concat(g)):e.push(a[f])}a=e;return x.apply(this,arguments)};n.hoverIcons.getStateAt=function(a,c,d){return b(a.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,
d))};var u=l.duplicateCells;l.duplicateCells=function(a,c){a=null!=a?a:this.getSelectionCells();for(var d=a.slice(0),e=0;e<d.length;e++){var f=l.view.getState(d[e]);if(null!=f&&b(f.cell))for(var g=l.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],a)}this.model.beginUpdate();try{var k=u.call(this,a,c);if(k.length==a.length)for(e=0;e<a.length;e++)if(b(a[e])){var m=l.getIncomingEdges(k[e]),g=l.getIncomingEdges(a[e]);if(0==m.length&&0<g.length){var p=this.cloneCell(g[0]);this.addEdge(p,
l.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var G=l.moveCells;l.moveCells=function(a,c,d,e,f,g,k){var m=null;this.model.beginUpdate();try{var p=f,r=this.view.getState(f),q=null!=r?r.style:this.getCellStyle(f);if(null!=a&&b(f)&&"1"==mxUtils.getValue(q,"treeFolding","0")){for(var n=0;n<a.length;n++)if(b(a[n])||l.model.isEdge(a[n])&&null==l.model.getTerminal(a[n],!0)){f=l.model.getParent(a[n]);break}if(null!=p&&f!=p&&null!=this.view.getState(a[0])){var t=
l.getIncomingEdges(a[0]);if(0<t.length){var u=l.view.getState(l.model.getTerminal(t[0],!0));if(null!=u){var z=l.view.getState(p);null!=z&&(c=(z.getCenterX()-u.getCenterX())/l.view.scale,d=(z.getCenterY()-u.getCenterY())/l.view.scale)}}}}m=G.apply(this,arguments);if(null!=m&&null!=a&&m.length==a.length)for(n=0;n<m.length;n++)if(this.model.isEdge(m[n]))b(p)&&0>mxUtils.indexOf(m,this.model.getTerminal(m[n],!0))&&this.model.setTerminal(m[n],p,!0);else if(b(a[n])&&(t=l.getIncomingEdges(a[n]),0<t.length))if(!e)b(p)&&
0>mxUtils.indexOf(a,this.model.getTerminal(t[0],!0))&&this.model.setTerminal(t[0],p,!0);else if(0==l.getIncomingEdges(m[n]).length){r=p;if(null==r||r==l.model.getParent(a[n]))r=l.model.getTerminal(t[0],!0);e=this.cloneCell(t[0]);this.addEdge(e,l.getDefaultParent(),r,m[n])}}finally{this.model.endUpdate()}return m};if(null!=n.sidebar){var z=n.sidebar.dropAndConnect;n.sidebar.dropAndConnect=function(a,c,d,e){var f=l.model,g=null;f.beginUpdate();try{if(g=z.apply(this,arguments),b(a))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&
-null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var m=l.getCellGeometry(g[k]);m.points=null;null!=m.getTerminalPoint(!0)&&m.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var E={88:n.actions.get("selectChildren"),84:n.actions.get("selectSubtree"),80:n.actions.get("selectParent"),83:n.actions.get("selectSiblings")},r=n.onKeyDown;n.onKeyDown=function(a){try{if(l.isEnabled()&&!l.isEditing()&&b(l.getSelectionCell())&&1==l.getSelectionCount()){var d=null;0<l.getIncomingEdges(l.getSelectionCell()).length&&
-(9==a.which?d=mxEvent.isShiftDown(a)?A(l.getSelectionCell()):c(l.getSelectionCell()):13==a.which&&(d=v(l.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=d&&0<d.length)1==d.length&&l.model.isEdge(d[0])?l.setSelectionCell(l.model.getTerminal(d[0],!1)):l.setSelectionCell(d[d.length-1]),null!=n.hoverIcons&&n.hoverIcons.update(l.view.getState(l.getSelectionCell())),l.startEditingAtCell(l.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=E[a.keyCode];
+null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],a,!0);var m=l.getCellGeometry(g[k]);m.points=null;null!=m.getTerminalPoint(!0)&&m.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var E={88:n.actions.get("selectChildren"),84:n.actions.get("selectSubtree"),80:n.actions.get("selectParent"),83:n.actions.get("selectSiblings")},r=n.onKeyDown;n.onKeyDown=function(a){try{if(l.isEnabled()&&!l.isEditing()&&b(l.getSelectionCell())&&1==l.getSelectionCount()){var c=null;0<l.getIncomingEdges(l.getSelectionCell()).length&&
+(9==a.which?c=mxEvent.isShiftDown(a)?A(l.getSelectionCell()):d(l.getSelectionCell()):13==a.which&&(c=v(l.getSelectionCell(),!mxEvent.isShiftDown(a))));if(null!=c&&0<c.length)1==c.length&&l.model.isEdge(c[0])?l.setSelectionCell(l.model.getTerminal(c[0],!1)):l.setSelectionCell(c[c.length-1]),null!=n.hoverIcons&&n.hoverIcons.update(l.view.getState(l.getSelectionCell())),l.startEditingAtCell(l.getSelectionCell()),mxEvent.consume(a);else if(mxEvent.isAltDown(a)&&mxEvent.isShiftDown(a)){var e=E[a.keyCode];
null!=e&&(e.funct(a),mxEvent.consume(a))}else 37==a.keyCode?(g(l.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(a)):38==a.keyCode?(g(l.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(a)):39==a.keyCode?(g(l.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(a)):40==a.keyCode&&(g(l.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(a))}}catch(S){console.log("error",S)}mxEvent.isConsumed(a)||r.apply(this,arguments)};var C=l.connectVertex;l.connectVertex=
-function(a,d,e,f,g,k){var m=l.getIncomingEdges(a);return b(a)&&0<m.length?(e=t(a),f=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,g=d==mxConstants.DIRECTION_EAST||d==mxConstants.DIRECTION_WEST,e==d?c(a):f==g?A(a):v(a,d!=mxConstants.DIRECTION_NORTH&&d!=mxConstants.DIRECTION_WEST)):C.call(this,a,d,e,f,g,k)};l.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&l.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var Q=
+function(a,c,e,f,g,k){var m=l.getIncomingEdges(a);return b(a)&&0<m.length?(e=t(a),f=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,g=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,e==c?d(a):f==g?A(a):v(a,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):C.call(this,a,c,e,f,g,k)};l.getSubtree=function(a){var c=[a];b(a)&&!e(a)&&l.traverse(a,!0,function(a,b){null!=b&&0>mxUtils.indexOf(c,b)&&c.push(b);0>mxUtils.indexOf(c,a)&&c.push(a);return!0});return c};var Q=
mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){Q.apply(this,arguments);b(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(a),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="18px",this.moveHandle.style.height="18px",this.graph.container.appendChild(this.moveHandle),mxEvent.addGestureListeners(this.moveHandle,
mxUtils.bind(this,function(a){this.graph.graphHandler.start(this.state.cell,mxEvent.getClientX(a),mxEvent.getClientY(a));this.graph.graphHandler.cells=this.graph.getSubtree(this.state.cell);this.graph.graphHandler.bounds=this.state.view.getBounds(this.graph.graphHandler.cells);this.graph.graphHandler.pBounds=this.graph.graphHandler.getPreviewBounds(this.graph.graphHandler.cells);this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;mxEvent.consume(a)})))};
var O=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){O.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 M=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){M.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 d=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;");
-d.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");e.geometry.relative=!0;e.edge=!0;b.insertEdge(e,!0);d.insertEdge(e,!1);var c=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;");
-c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");f.geometry.relative=!0;f.edge=!0;b.insertEdge(f,!0);c.insertEdge(f,!1);var g=new mxCell("Topic",new mxGeometry(20,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;");g.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
+this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var c=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=c.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 e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");e.geometry.relative=!0;e.edge=!0;b.insertEdge(e,!0);c.insertEdge(e,!1);var d=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;");
+d.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");f.geometry.relative=!0;f.edge=!0;b.insertEdge(f,!0);d.insertEdge(f,!1);var g=new mxCell("Topic",new mxGeometry(20,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;");g.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
k.geometry.relative=!0;k.edge=!0;b.insertEdge(k,!0);g.insertEdge(k,!1);var l=new mxCell("Branch",new mxGeometry(20,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;");l.vertex=!0;var m=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
-m.geometry.relative=!0;m.edge=!0;b.insertEdge(m,!0);l.insertEdge(m,!1);a.insert(e);a.insert(f);a.insert(k);a.insert(m);a.insert(b);a.insert(d);a.insert(c);a.insert(g);a.insert(l);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],
+m.geometry.relative=!0;m.edge=!0;b.insertEdge(m,!0);l.insertEdge(m,!1);a.insert(e);a.insert(f);a.insert(k);a.insert(m);a.insert(b);a.insert(c);a.insert(d);a.insert(g);a.insert(l);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),"ellipse;whiteSpace=wrap;html=1;align=center;container=1;recursiveResize=0;treeFolding=1;");a.vertex=!0;return sb.createVertexTemplateFromCells([a],
a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap branch",function(){var a=new mxCell("Branch",new mxGeometry(0,0,80,20),"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;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap sub topic",function(){var a=new mxCell("Sub Topic",new mxGeometry(0,0,72,26),"whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;container=1;recursiveResize=0;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;");a.vertex=!0;var b=new mxCell("",new mxGeometry(0,
-0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree orgchart organization division",function(){var a=new mxCell("Orgchart",new mxGeometry(0,0,280,220),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var d=new mxCell("Organization",
-new mxGeometry(80,40,120,60),"whiteSpace=wrap;html=1;align=center;treeFolding=1;container=1;recursiveResize=0;");b.setAttributeForCell(d,"treeRoot","1");d.vertex=!0;var e=new mxCell("Division",new mxGeometry(20,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");e.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");k.geometry.relative=!0;k.edge=!0;
-d.insertEdge(k,!0);e.insertEdge(k,!1);var c=new mxCell("Division",new mxGeometry(160,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");c.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");f.geometry.relative=!0;f.edge=!0;d.insertEdge(f,!0);c.insertEdge(f,!1);a.insert(k);a.insert(f);a.insert(d);a.insert(e);a.insert(c);return sb.createVertexTemplateFromCells([a],
+0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");b.geometry.setTerminalPoint(new mxPoint(-40,40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree orgchart organization division",function(){var a=new mxCell("Orgchart",new mxGeometry(0,0,280,220),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var c=new mxCell("Organization",
+new mxGeometry(80,40,120,60),"whiteSpace=wrap;html=1;align=center;treeFolding=1;container=1;recursiveResize=0;");b.setAttributeForCell(c,"treeRoot","1");c.vertex=!0;var e=new mxCell("Division",new mxGeometry(20,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");e.vertex=!0;var k=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");k.geometry.relative=!0;k.edge=!0;
+c.insertEdge(k,!0);e.insertEdge(k,!1);var d=new mxCell("Division",new mxGeometry(160,140,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");d.vertex=!0;var f=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");f.geometry.relative=!0;f.edge=!0;c.insertEdge(f,!0);d.insertEdge(f,!1);a.insert(k);a.insert(f);a.insert(c);a.insert(e);a.insert(d);return sb.createVertexTemplateFromCells([a],
a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree root",function(){var a=new mxCell("Organization",new mxGeometry(0,0,120,60),"whiteSpace=wrap;html=1;align=center;treeFolding=1;container=1;recursiveResize=0;");b.setAttributeForCell(a,"treeRoot","1");a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree division",function(){var a=new mxCell("Division",new mxGeometry(20,40,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");
a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");b.geometry.setTerminalPoint(new mxPoint(0,0),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);return sb.createVertexTemplateFromCells([a,b],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree sub sections",function(){var a=new mxCell("Sub Section",new mxGeometry(0,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");
-a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");b.geometry.setTerminalPoint(new mxPoint(110,-40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);var d=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");d.vertex=!0;var e=new mxCell("",new mxGeometry(0,
-0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");e.geometry.setTerminalPoint(new mxPoint(110,-40),!0);e.geometry.relative=!0;e.edge=!0;d.insertEdge(e,!1);return sb.createVertexTemplateFromCells([b,e,a,d],220,60,"Sub Sections")})])}}})();EditorUi.initMinimalTheme=function(){function a(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();null==a.formatWindow?(a.formatWindow=new k(a,mxResources.get("format"),Math.max(20,a.diagramContainer.clientWidth-240-12),56,240,Math.min(566,b.container.clientHeight-10),function(b){b=a.createFormat(b);b.init();return b}),a.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80),a.formatWindow.window.setVisible(!0)):a.formatWindow.window.setVisible(!a.formatWindow.window.isVisible());a.formatWindow.window.isVisible()&&
+a.vertex=!0;var b=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");b.geometry.setTerminalPoint(new mxPoint(110,-40),!0);b.geometry.relative=!0;b.edge=!0;a.insertEdge(b,!1);var c=new mxCell("Sub Section",new mxGeometry(120,0,100,60),"whiteSpace=wrap;html=1;align=center;verticalAlign=middle;container=1;recursiveResize=0;treeFolding=1;");c.vertex=!0;var e=new mxCell("",new mxGeometry(0,
+0,0,0),"edgeStyle=orthogonalEdgeStyle;startArrow=none;endArrow=none;rounded=0;targetPortConstraint=eastwest;sourcePortConstraint=northsouth;");e.geometry.setTerminalPoint(new mxPoint(110,-40),!0);e.geometry.relative=!0;e.edge=!0;c.insertEdge(e,!1);return sb.createVertexTemplateFromCells([b,e,a,c],220,60,"Sub Sections")})])}}})();EditorUi.initMinimalTheme=function(){function a(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();null==a.formatWindow?(a.formatWindow=new k(a,mxResources.get("format"),Math.max(20,a.diagramContainer.clientWidth-240-12),56,240,Math.min(566,b.container.clientHeight-10),function(b){b=a.createFormat(b);b.init();return b}),a.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80),a.formatWindow.window.setVisible(!0)):a.formatWindow.window.setVisible(!a.formatWindow.window.isVisible());a.formatWindow.window.isVisible()&&
a.formatWindow.window.fit()}function b(a){var b=a.editor.graph;b.popupMenuHandler.hideMenu();new mxRectangle;if(null==a.sidebarWindow){var c=Math.min(b.container.clientWidth-10,266);a.sidebarWindow=new k(a,mxResources.get("shapes"),10,56,c-6,Math.min(650,b.container.clientHeight-30),function(b){function c(c,d){var f=a.menus.get(c),g=e.addMenu(d,mxUtils.bind(this,function(){f.funct.apply(this,arguments)}));g.style.cssText="position:absolute;border-top:1px solid lightgray;width:50%;height:24px;bottom:0px;text-align:center;cursor:pointer;padding:6px 0 0 0;cusor:pointer;";
g.className="geTitle";b.appendChild(g);return g}var d=document.createElement("div");d.style.cssText="position:absolute;left:0;right:0;border-top:1px solid lightgray;height:24px;bottom:31px;text-align:center;cursor:pointer;padding:6px 0 0 0;";d.className="geTitle";d.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(d,mxResources.get("moreShapes"));b.appendChild(d);mxEvent.addListener(d,"click",function(){a.actions.get("shapes").funct()});var e=new Menubar(a,b);if(!Editor.enableCustomLibraries||
"1"==urlParams.embed&&"1"!=urlParams.libraries)d.style.bottom="0";else if(null!=a.actions.get("newLibrary")){d=document.createElement("div");d.style.cssText="position:absolute;left:0px;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;";d.className="geTitle";var f=document.createElement("span");f.style.cssText="position:relative;top:6px;";mxUtils.write(f,mxResources.get("newLibrary"));d.appendChild(f);b.appendChild(d);mxEvent.addListener(d,
"click",a.actions.get("newLibrary").funct);d=document.createElement("div");d.style.cssText="position:absolute;left:50%;width:50%;border-top:1px solid lightgray;height:30px;bottom:0px;text-align:center;cursor:pointer;padding:0px;border-left: 1px solid lightgray;";d.className="geTitle";f=document.createElement("span");f.style.cssText="position:relative;top:6px;";mxUtils.write(f,mxResources.get("openLibrary"));d.appendChild(f);b.appendChild(d);mxEvent.addListener(d,"click",a.actions.get("openLibrary").funct)}else d=
c("newLibrary",mxResources.get("newLibrary")),d.style.left="0",d=c("openLibraryFrom",mxResources.get("openLibraryFrom")),d.style.borderLeft="1px solid lightgray",d.style.left="50%";b.appendChild(a.sidebar.container);b.style.overflow="hidden";return b});a.sidebarWindow.window.minimumSize=new mxRectangle(0,0,90,90);a.sidebarWindow.window.setVisible(!0);a.getLocalData("sidebar",function(b){a.sidebar.showEntries(b,null,!0)});a.restoreLibraries()}else a.sidebarWindow.window.setVisible(!a.sidebarWindow.window.isVisible());
-a.sidebarWindow.window.isVisible()&&a.sidebarWindow.window.fit()}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;try{var d=document.createElement("style");d.type="text/css";d.innerHTML="* { -webkit-font-smoothing: antialiased; }html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0; }html body table.mxWindow td.mxWindowPane div.mxWindowPane *:not(svg *) { font-size:9pt; }html body div.diagramContainer button, html body button.geBtn { font-size:14px; font-weight:700;border-radius: 5px; }html body button.geBtn:active { opacity: 0.6; }html body a.geMenuItem { opacity: 0.75; }html body a.geMenuItem[disabled] { opacity: 0.2; }html body a.geMenuItem[disabled]:active { opacity: 0.2; }html body div.geActivePage { opacity: 0.7; }html body a.geMenuItem:active { opacity: 0.2; }html body .geToolbarButton { opacity: 0.3; }html body .geToolbarButton:active { opacity: 0.15; }html body .geStatus:active { opacity: 0.5; }html table.mxPopupMenu tr.mxPopupMenuItemHover:active { opacity:0.7; }html body .geDialog input, html body .geToolbarContainer input, html body .mxWindow input {padding:2px;display:inline-block; }div.geDialog { border-radius: 5px; }html body div.geDialog button.geBigButton { color: #fff !important; }.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }html body .mxWindow .geColorBtn, html body .geDialog .geColorBtn { background: none; }html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-style: solid; border-width: 1px; border-color: rgb(216, 216, 216); }html body div.diagramContainer button:hover, html body .mxWindow button:hover, html body .geDialog button:hover { border-color: rgb(177, 177, 177); }html body div.diagramContainer button:active, html body .mxWindow button:active, html body .geDialog button:active { opacity: 0.6; }div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }div.diagramContainer button.gePrimaryBtn, .mxWindow button.gePrimaryBtn, .geDialog button.gePrimaryBtn, html body .gePrimaryBtn { background: #29b6f2; color: #fff !important; border: none; box-shadow: none; }html body .gePrimaryBtn:hover { background: #29b6f2; border: none; box-shadow: inherit; }html body button.gePrimaryBtn:hover { background: #29b6f2; border: none; }.geBtn button { min-width:72px !important; }div.geToolbarContainer a.geButton { margin:2px; padding: 0 2px 4px 2px; } .geDialog, .mxWindow td.mxWindowPane *, div.geSprite, td.mxWindowTitle, .geDiagramContainer { box-sizing:content-box; }.mxWindow div button.geStyleButton { box-sizing: border-box; }table.mxWindow td.mxWindowPane button.geColorBtn { padding:0px; box-sizing: border-box; }td.mxWindowPane .geSidebarContainer button { padding:2px 0 2px 0; box-sizing: border-box; }html body .geMenuItem { font-size:14px; text-decoration: none; font-weight: normal; padding: 6px 10px 6px 10px; border: none; border-radius: 5px; color: #353535; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }.geToolbarContainer { background:#fff !important; }div.mxWindow .geSidebarContainer .geTitle { background-color:#fdfdfd; }div.mxWindow .geSidebarContainer .geTitle:hover { background-color:#fafafa; }div.geSidebar { background-color: #fff !important;}div.mxWindow td.mxWindowPane button { background-image: none; float: none; }td.mxWindowTitle { height: 22px !important; background: none !important; font-size: 13px !important; text-align:center !important; border-bottom:1px solid lightgray; }div.mxWindow, div.mxWindowTitle { background-image: none !important; background-color:#fff !important; }div.mxWindow { border-radius:5px; box-shadow: 0px 0px 2px #C0C0C0 !important;}div.mxWindow * { font-family: inherit !important; }html div.geVerticalHandle { position:absolute;bottom:0px;left:50%;cursor:row-resize;width:11px;height:11px;background:white;margin-bottom:-6px; margin-left:-6px; border: none; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }html div.geInactivePage { background: rgb(249, 249, 249) !important; color:lightgray !important; } html div.geActivePage { background: white !important;color: #353535 !important; } html div.mxRubberband { border:1px solid; border-color: #29b6f2 !important; background:rgba(41,182,242,0.5) !important; } html body div.mxPopupMenu { border-radius:5px; border:1px solid #c0c0c0; padding:5px 0 5px 0; box-shadow: 0px 4px 17px -4px rgba(96,96,96,1); } html table.mxPopupMenu td.mxPopupMenuItem { color: #353535; font-size: 14px; padding-top: 4px; padding-bottom: 4px; }html table.mxPopupMenu tr.mxPopupMenuItemHover { background-color: #29b6f2; }html tr.mxPopupMenuItemHover td.mxPopupMenuItem, html tr.mxPopupMenuItemHover td.mxPopupMenuItem span { color: #fff !important; }html tr.mxPopupMenuItem, html td.mxPopupMenuItem { transition-property: none !important; }html table.mxPopupMenu hr { height: 2px; background-color: rgba(0,0,0,.07); margin: 5px 0; }"+
-(mxClient.IS_IOS?"html input[type=checkbox], html input[type=radio] { height:12px; }":"");document.getElementsByTagName("head")[0].appendChild(d)}catch(p){}var k=function(a,b,c,d,e,f,g){var l=document.createElement("div");l.className="geSidebarContainer";l.style.position="absolute";l.style.width="100%";l.style.height="100%";l.style.border="1px solid whiteSmoke";l.style.overflowX="hidden";l.style.overflowY="auto";g(l);this.window=new mxWindow(b,l,c,d,e,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
+a.sidebarWindow.window.isVisible()&&a.sidebarWindow.window.fit()}if("1"==urlParams.lightbox||"0"==urlParams.chrome||"undefined"===typeof window.Format||"undefined"===typeof window.Menus)window.uiTheme=null;else{var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;try{var c=document.createElement("style");c.type="text/css";c.innerHTML="* { -webkit-font-smoothing: antialiased; }html body .mxWindow button.geBtn { font-size:12px !important; margin-left: 0; }html body table.mxWindow td.mxWindowPane div.mxWindowPane *:not(svg *) { font-size:9pt; }html body div.diagramContainer button, html body button.geBtn { font-size:14px; font-weight:700;border-radius: 5px; }html body button.geBtn:active { opacity: 0.6; }html body a.geMenuItem { opacity: 0.75; }html body a.geMenuItem[disabled] { opacity: 0.2; }html body a.geMenuItem[disabled]:active { opacity: 0.2; }html body div.geActivePage { opacity: 0.7; }html body a.geMenuItem:active { opacity: 0.2; }html body .geToolbarButton { opacity: 0.3; }html body .geToolbarButton:active { opacity: 0.15; }html body .geStatus:active { opacity: 0.5; }html table.mxPopupMenu tr.mxPopupMenuItemHover:active { opacity:0.7; }html body .geDialog input, html body .geToolbarContainer input, html body .mxWindow input {padding:2px;display:inline-block; }div.geDialog { border-radius: 5px; }html body div.geDialog button.geBigButton { color: #fff !important; }.mxWindow button, .geDialog select, .mxWindow select { display:inline-block; }html body .mxWindow .geColorBtn, html body .geDialog .geColorBtn { background: none; }html body div.diagramContainer button, html body .mxWindow button, html body .geDialog button { min-width: 0px; border-radius: 5px; color: #353535 !important; border-style: solid; border-width: 1px; border-color: rgb(216, 216, 216); }html body div.diagramContainer button:hover, html body .mxWindow button:hover, html body .geDialog button:hover { border-color: rgb(177, 177, 177); }html body div.diagramContainer button:active, html body .mxWindow button:active, html body .geDialog button:active { opacity: 0.6; }div.diagramContainer button.geBtn, .mxWindow button.geBtn, .geDialog button.geBtn { min-width:72px; font-weight: 600; background: none; }div.diagramContainer button.gePrimaryBtn, .mxWindow button.gePrimaryBtn, .geDialog button.gePrimaryBtn, html body .gePrimaryBtn { background: #29b6f2; color: #fff !important; border: none; box-shadow: none; }html body .gePrimaryBtn:hover { background: #29b6f2; border: none; box-shadow: inherit; }html body button.gePrimaryBtn:hover { background: #29b6f2; border: none; }.geBtn button { min-width:72px !important; }div.geToolbarContainer a.geButton { margin:2px; padding: 0 2px 4px 2px; } .geDialog, .mxWindow td.mxWindowPane *, div.geSprite, td.mxWindowTitle, .geDiagramContainer { box-sizing:content-box; }.mxWindow div button.geStyleButton { box-sizing: border-box; }table.mxWindow td.mxWindowPane button.geColorBtn { padding:0px; box-sizing: border-box; }td.mxWindowPane .geSidebarContainer button { padding:2px 0 2px 0; box-sizing: border-box; }html body .geMenuItem { font-size:14px; text-decoration: none; font-weight: normal; padding: 6px 10px 6px 10px; border: none; border-radius: 5px; color: #353535; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }.geToolbarContainer { background:#fff !important; }div.mxWindow .geSidebarContainer .geTitle { background-color:#fdfdfd; }div.mxWindow .geSidebarContainer .geTitle:hover { background-color:#fafafa; }div.geSidebar { background-color: #fff !important;}div.mxWindow td.mxWindowPane button { background-image: none; float: none; }td.mxWindowTitle { height: 22px !important; background: none !important; font-size: 13px !important; text-align:center !important; border-bottom:1px solid lightgray; }div.mxWindow, div.mxWindowTitle { background-image: none !important; background-color:#fff !important; }div.mxWindow { border-radius:5px; box-shadow: 0px 0px 2px #C0C0C0 !important;}div.mxWindow * { font-family: inherit !important; }html div.geVerticalHandle { position:absolute;bottom:0px;left:50%;cursor:row-resize;width:11px;height:11px;background:white;margin-bottom:-6px; margin-left:-6px; border: none; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.11), inset 0 -1px 0 0 rgba(0,0,0,.08), 0 1px 2px 0 rgba(0,0,0,.04); }html div.geInactivePage { background: rgb(249, 249, 249) !important; color:lightgray !important; } html div.geActivePage { background: white !important;color: #353535 !important; } html div.mxRubberband { border:1px solid; border-color: #29b6f2 !important; background:rgba(41,182,242,0.5) !important; } html body div.mxPopupMenu { border-radius:5px; border:1px solid #c0c0c0; padding:5px 0 5px 0; box-shadow: 0px 4px 17px -4px rgba(96,96,96,1); } html table.mxPopupMenu td.mxPopupMenuItem { color: #353535; font-size: 14px; padding-top: 4px; padding-bottom: 4px; }html table.mxPopupMenu tr.mxPopupMenuItemHover { background-color: #29b6f2; }html tr.mxPopupMenuItemHover td.mxPopupMenuItem, html tr.mxPopupMenuItemHover td.mxPopupMenuItem span { color: #fff !important; }html tr.mxPopupMenuItem, html td.mxPopupMenuItem { transition-property: none !important; }html table.mxPopupMenu hr { height: 2px; background-color: rgba(0,0,0,.07); margin: 5px 0; }"+
+(mxClient.IS_IOS?"html input[type=checkbox], html input[type=radio] { height:12px; }":"");document.getElementsByTagName("head")[0].appendChild(c)}catch(p){}var k=function(a,b,c,d,e,f,g){var l=document.createElement("div");l.className="geSidebarContainer";l.style.position="absolute";l.style.width="100%";l.style.height="100%";l.style.border="1px solid whiteSmoke";l.style.overflowX="hidden";l.style.overflowY="auto";g(l);this.window=new mxWindow(b,l,c,d,e,f,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);
this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.setLocation=function(a,b){var c=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)};mxClient.IS_SF&&
(this.window.div.onselectstart=mxUtils.bind(this,function(b){null==b&&(b=window.event);return null!=b&&a.isSelectionAllowed(b)}))};Editor.checkmarkImage=Graph.createSvgImage(22,18,'<path transform="translate(4 0)" d="M7.181,15.007a1,1,0,0,1-.793-0.391L3.222,10.5A1,1,0,1,1,4.808,9.274L7.132,12.3l6.044-8.86A1,1,0,1,1,14.83,4.569l-6.823,10a1,1,0,0,1-.8.437H7.181Z" fill="#29b6f2"/>').src;mxWindow.prototype.closeImage=Graph.createSvgImage(18,10,'<path d="M 5 1 L 13 9 M 13 1 L 5 9" stroke="#C0C0C0" stroke-width="2"/>').src;
mxWindow.prototype.minimizeImage=Graph.createSvgImage(14,10,'<path d="M 3 7 L 7 3 L 11 7" stroke="#C0C0C0" stroke-width="2" fill="#ffffff"/>').src;mxWindow.prototype.normalizeImage=Graph.createSvgImage(14,10,'<path d="M 3 3 L 7 7 L 11 3" stroke="#C0C0C0" stroke-width="2" fill="#ffffff"/>').src;mxConstraintHandler.prototype.pointImage=Graph.createSvgImage(5,5,'<path d="m 0 0 L 5 5 M 0 5 L 5 0" stroke="#29b6f2"/>');mxOutline.prototype.sizerImage=null;mxConstants.VERTEX_SELECTION_COLOR="#C0C0C0";mxConstants.EDGE_SELECTION_COLOR=
@@ -3337,9 +3338,9 @@ b.shortcut):t.apply(this,arguments)};var v=App.prototype.updateUserElement;App.p
"center center";a.style.backgroundRepeat="no-repeat";a.style.backgroundSize="24px 24px";a.style.height="24px";a.style.width="24px"}};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.buttonContainer){var a=document.createElement("div");a.style.display="inline-block";a.style.position="relative";a.style.marginTop="2px";var b=document.createElement("button");mxUtils.write(b,mxResources.get("save"));b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)");b.className="1"==urlParams.saveAndExit?
"geMenuItem":"geMenuItem gePrimaryBtn";b.style.fontSize="14px";b.style.padding="6px";b.style.borderRadius="3px";b.style.marginLeft="8px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()}));a.appendChild(b);"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",mxResources.get("saveAndExit")),b.className="geMenuItem gePrimaryBtn",b.style.fontSize="14px",b.style.marginLeft=
"6px",b.style.padding="6px",b.style.cursor="pointer",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.className="geMenuItem";b.style.fontSize="14px";b.style.marginLeft="6px";b.style.padding="6px";b.style.cursor="pointer";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));
-a.appendChild(b);this.buttonContainer.appendChild(a);this.buttonContainer.style.top="6px"}};Sidebar.prototype.getTooltipOffset=function(){var a=mxUtils.getOffset(this.editorUi.sidebarWindow.window.div);a.y+=40;return a};var c=Menus.prototype.createPopupMenu;Menus.prototype.createPopupMenu=function(a,b,d){var e=this.editorUi.editor.graph;a.smartSeparators=!0;c.apply(this,arguments);mxUtils.bind(this,function(a,b){var c=new FilenameDialog(this.editorUi,a,mxResources.get("apply"),function(a){b(parseFloat(a))},
-mxResources.get("spacing"));this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()});1==e.getSelectionCount()?(this.addMenuItems(a,["editTooltip","-","editStyle","editGeometry","-"],null,d),e.isCellFoldable(e.getSelectionCell())&&this.addMenuItems(a,e.isCellCollapsed(b)?["expand"]:["collapse"],null,d),this.addMenuItems(a,["collapsible","-","lockUnlock","enterGroup"],null,d),a.addSeparator(),this.addSubmenu("layout",a)):e.isSelectionEmpty()&&e.isEnabled()?(a.addSeparator(),this.addMenuItems(a,
-["editData"],null,d),a.addSeparator(),this.addSubmenu("layout",a),this.addSubmenu("view",a,null,mxResources.get("options")),this.addMenuItems(a,["-","exitGroup"],null,d)):e.isEnabled()&&this.addMenuItems(a,["-","lockUnlock"],null,d)};EditorUi.prototype.toggleFormatPanel=function(b){null!=this.formatWindow?this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()):a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var f=EditorUi.prototype.destroy;EditorUi.prototype.destroy=
+a.appendChild(b);this.buttonContainer.appendChild(a);this.buttonContainer.style.top="6px"}};Sidebar.prototype.getTooltipOffset=function(){var a=mxUtils.getOffset(this.editorUi.sidebarWindow.window.div);a.y+=40;return a};var d=Menus.prototype.createPopupMenu;Menus.prototype.createPopupMenu=function(a,b,c){var e=this.editorUi.editor.graph;a.smartSeparators=!0;d.apply(this,arguments);mxUtils.bind(this,function(a,b){var c=new FilenameDialog(this.editorUi,a,mxResources.get("apply"),function(a){b(parseFloat(a))},
+mxResources.get("spacing"));this.editorUi.showDialog(c.container,300,80,!0,!0);c.init()});1==e.getSelectionCount()?(this.addMenuItems(a,["editTooltip","-","editStyle","editGeometry","-"],null,c),e.isCellFoldable(e.getSelectionCell())&&this.addMenuItems(a,e.isCellCollapsed(b)?["expand"]:["collapse"],null,c),this.addMenuItems(a,["collapsible","-","lockUnlock","enterGroup"],null,c),a.addSeparator(),this.addSubmenu("layout",a)):e.isSelectionEmpty()&&e.isEnabled()?(a.addSeparator(),this.addMenuItems(a,
+["editData"],null,c),a.addSeparator(),this.addSubmenu("layout",a),this.addSubmenu("view",a,null,mxResources.get("options")),this.addMenuItems(a,["-","exitGroup"],null,c)):e.isEnabled()&&this.addMenuItems(a,["-","lockUnlock"],null,c)};EditorUi.prototype.toggleFormatPanel=function(b){null!=this.formatWindow?this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()):a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var f=EditorUi.prototype.destroy;EditorUi.prototype.destroy=
function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),
this.actions.layersWindow.window.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),this.menus.tagsWindow.window.destroy(),this.menus.tagsWindow=null);null!=this.menus.findWindow&&(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);f.apply(this,arguments)};var g=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){g.apply(this,arguments);a||(null!=
this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};EditorUi.prototype.chromelessWindowResize=function(){};var n=Menus.prototype.init;Menus.prototype.init=function(){n.apply(this,arguments);var c=this.editorUi,d=c.editor.graph;c.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";c.actions.get("createShape").label=mxResources.get("shape")+"...";c.actions.get("outline").label=mxResources.get("outline")+"...";
@@ -3382,59 +3383,59 @@ Graph.prototype.defaultThemes.darkTheme=mxUtils.parseXml('<mxStylesheet><add as=
GraphViewer.prototype.showTitleAsTooltip=!1;GraphViewer.prototype.checkVisibleState=!0;GraphViewer.prototype.minHeight=28;GraphViewer.prototype.minWidth=100;
GraphViewer.prototype.init=function(a,b,e){this.graphConfig=null!=e?e:{};this.autoFit=null!=this.graphConfig["auto-fit"]?this.graphConfig["auto-fit"]:this.autoFit;this.allowZoomIn=null!=this.graphConfig["allow-zoom-in"]?this.graphConfig["allow-zoom-in"]:this.allowZoomIn;this.checkVisibleState=null!=this.graphConfig["check-visible-state"]?this.graphConfig["check-visible-state"]:this.checkVisibleState;this.toolbarItems=null!=this.graphConfig.toolbar?this.graphConfig.toolbar.split(" "):[];this.zoomEnabled=
0<=mxUtils.indexOf(this.toolbarItems,"zoom");this.layersEnabled=0<=mxUtils.indexOf(this.toolbarItems,"layers");this.lightboxEnabled=0<=mxUtils.indexOf(this.toolbarItems,"lightbox");this.lightboxClickEnabled=0!=this.graphConfig.lightbox;this.initialWidth=null!=a?a.style.width:null;this.widthIsEmpty=null!=this.initialWidth?""==this.initialWidth:!0;this.currentPage=parseInt(this.graphConfig.page)||0;this.pageId=this.graphConfig.pageId;this.editor=null;"inline"==this.graphConfig["toolbar-position"]&&
-(this.minHeight+=this.toolbarHeight);if(null!=b&&(this.xmlDocument=b.ownerDocument,this.xmlNode=b,this.xml=mxUtils.getXml(b),null!=a)){var d=mxUtils.bind(this,function(){this.graph=new Graph(a);this.graph.transparentBackground=!1;this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(a){return!0});this.lightboxClickEnabled&&(a.style.cursor="pointer");this.editor=new Editor(!0,null,null,this.graph);this.editor.editBlankUrl=this.editBlankUrl;this.graph.lightbox=!0;this.graph.centerZoom=!1;this.graph.autoExtend=
-!1;this.graph.autoScroll=!1;this.graph.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");this.xmlNode=this.editor.extractGraphModel(this.xmlNode,!0);var d=this;this.graph.getImageFromBundles=function(a){return d.getImageUrl(a)};mxClient.IS_SVG&&this.editor.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==b.nodeName){var e=b.getElementsByTagName("diagram");if(0<e.length){if(null!=this.pageId)for(var k=0;k<e.length;k++)if(this.pageId==
-e[k].getAttribute("id")){this.currentPage=k;break}var m=this.graph.getGlobalVariable,d=this;this.graph.getGlobalVariable=function(a){var b=e[d.currentPage];return"page"==a?b.getAttribute("name")||"Page-"+(d.currentPage+1):"pagenumber"==a?d.currentPage+1:m.apply(this,arguments)}}}this.diagrams=[];var c=null;this.selectPage=function(a){this.currentPage=mxUtils.mod(a,this.diagrams.length);this.updateGraphXml(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(this.diagrams[this.currentPage]))).documentElement)};
-this.selectPageById=function(a){for(var b=!1,c=0;c<this.diagrams.length;c++)if(this.diagrams[c].getAttribute("id")==a){this.selectPage(c);b=!0;break}return b};k=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=c&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),c=this.xmlNode)});this.addListener("xmlNodeChanged",k);k();urlParams.page=d.currentPage;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?
+(this.minHeight+=this.toolbarHeight);if(null!=b&&(this.xmlDocument=b.ownerDocument,this.xmlNode=b,this.xml=mxUtils.getXml(b),null!=a)){var c=mxUtils.bind(this,function(){this.graph=new Graph(a);this.graph.transparentBackground=!1;this.graphConfig.move&&(this.graph.isMoveCellsEvent=function(a){return!0});this.lightboxClickEnabled&&(a.style.cursor="pointer");this.editor=new Editor(!0,null,null,this.graph);this.editor.editBlankUrl=this.editBlankUrl;this.graph.lightbox=!0;this.graph.centerZoom=!1;this.graph.autoExtend=
+!1;this.graph.autoScroll=!1;this.graph.setEnabled(!1);1==this.graphConfig["toolbar-nohide"]&&(this.editor.defaultGraphOverflow="visible");this.xmlNode=this.editor.extractGraphModel(this.xmlNode,!0);var c=this;this.graph.getImageFromBundles=function(a){return c.getImageUrl(a)};mxClient.IS_SVG&&this.editor.graph.addSvgShadow(this.graph.view.canvas.ownerSVGElement,null,!0);if("mxfile"==b.nodeName){var e=b.getElementsByTagName("diagram");if(0<e.length){if(null!=this.pageId)for(var k=0;k<e.length;k++)if(this.pageId==
+e[k].getAttribute("id")){this.currentPage=k;break}var m=this.graph.getGlobalVariable,c=this;this.graph.getGlobalVariable=function(a){var b=e[c.currentPage];return"page"==a?b.getAttribute("name")||"Page-"+(c.currentPage+1):"pagenumber"==a?c.currentPage+1:m.apply(this,arguments)}}}this.diagrams=[];var d=null;this.selectPage=function(a){this.currentPage=mxUtils.mod(a,this.diagrams.length);this.updateGraphXml(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(this.diagrams[this.currentPage]))).documentElement)};
+this.selectPageById=function(a){for(var b=!1,c=0;c<this.diagrams.length;c++)if(this.diagrams[c].getAttribute("id")==a){this.selectPage(c);b=!0;break}return b};k=mxUtils.bind(this,function(){if(null==this.xmlNode||"mxfile"!=this.xmlNode.nodeName)this.diagrams=[];this.xmlNode!=d&&(this.diagrams=this.xmlNode.getElementsByTagName("diagram"),d=this.xmlNode)});this.addListener("xmlNodeChanged",k);k();urlParams.page=c.currentPage;this.graph.getModel().beginUpdate();try{urlParams.nav=0!=this.graphConfig.nav?
"1":"0",this.editor.setGraphXml(this.xmlNode),this.graph.border=null!=this.graphConfig.border?this.graphConfig.border:8,this.graph.view.scale=this.graphConfig.zoom||1}finally{this.graph.getModel().endUpdate()}this.graph.panningHandler.useLeftButtonForPanning=!0;this.graph.panningHandler.isForcePanningEvent=function(a){return!mxEvent.isPopupTrigger(a.getEvent())&&"auto"==this.graph.container.style.overflow};this.graph.panningHandler.usePopupTrigger=!1;this.graph.panningHandler.pinchEnabled=!1;this.graph.panningHandler.ignoreCell=
-!0;this.graph.setPanning(!1);this.addSizeHandler();this.showLayers(this.graph);this.addClickHandler(this.graph);this.graph.setTooltips(0!=this.graphConfig.tooltips);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};d=this;this.graph.customLinkClicked=function(a){var b=!0;if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");d.selectPageById(a.substring(c+1))||(b=!1,alert(mxResources.get("pageNotFound")||"Page not found"))}else this.handleCustomLink(a);
-return b};null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&a.setAttribute("title",this.graphConfig.title);this.fireEvent(new mxEventObject("render"))});e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==a.offsetWidth&&"undefined"!==typeof e){var k=this.getObservableParent(a),m=new e(mxUtils.bind(this,function(b){0<a.offsetWidth&&(m.disconnect(),d())}));m.observe(k,{attributes:!0})}else d()}};
+!0;this.graph.setPanning(!1);this.addSizeHandler();this.showLayers(this.graph);this.addClickHandler(this.graph);this.graph.setTooltips(0!=this.graphConfig.tooltips);this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale};c=this;this.graph.customLinkClicked=function(a){var b=!0;if("data:page/id,"==a.substring(0,13)){var d=a.indexOf(",");c.selectPageById(a.substring(d+1))||(b=!1,alert(mxResources.get("pageNotFound")||"Page not found"))}else this.handleCustomLink(a);
+return b};null!=this.graphConfig.toolbar?this.addToolbar():null!=this.graphConfig.title&&this.showTitleAsTooltip&&a.setAttribute("title",this.graphConfig.title);this.fireEvent(new mxEventObject("render"))});e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(this.checkVisibleState&&0==a.offsetWidth&&"undefined"!==typeof e){var k=this.getObservableParent(a),m=new e(mxUtils.bind(this,function(b){0<a.offsetWidth&&(m.disconnect(),c())}));m.observe(k,{attributes:!0})}else c()}};
GraphViewer.prototype.getObservableParent=function(a){for(a=a.parentNode;a!=document.body&&null!=a.parentNode&&"none"!==mxUtils.getCurrentStyle(a).display;)a=a.parentNode;return a};GraphViewer.prototype.getImageUrl=function(a){null!=a&&"http://"!=a.substring(0,7)&&"https://"!=a.substring(0,8)&&"data:image"!=a.substring(0,10)&&("/"==a.charAt(0)&&(a=a.substring(1,a.length)),a=this.imageBaseUrl+a);return a};
GraphViewer.prototype.setXmlNode=function(a){this.xmlDocument=a.ownerDocument;this.xml=mxUtils.getXml(a);this.xmlNode=a;this.updateGraphXml(a);this.fireEvent(new mxEventObject("xmlNodeChanged"))};GraphViewer.prototype.setFileNode=function(a){null==this.xmlNode&&(this.xmlDocument=a.ownerDocument,this.xml=mxUtils.getXml(a),this.xmlNode=a);this.setGraphXml(a)};GraphViewer.prototype.updateGraphXml=function(a){this.setGraphXml(a);this.fireEvent(new mxEventObject("graphChanged"))};
GraphViewer.prototype.setGraphXml=function(a){null!=this.graph&&(this.graph.view.translate=new mxPoint,this.graph.view.scale=1,this.graph.getModel().clear(),this.editor.setGraphXml(a),this.widthIsEmpty?(this.graph.container.style.width="",this.graph.container.style.height=""):this.graph.container.style.width=this.initialWidth,this.positionGraph(),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale})};
-GraphViewer.prototype.addSizeHandler=function(){var a=this.graph.container,b=this.graph.getGraphBounds(),e=!1;a.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var d=mxUtils.bind(this,function(){if(!e){e=!0;var b=this.graph.getGraphBounds();a.style.overflow=1!=this.graphConfig["toolbar-nohide"]?a.offsetWidth<=b.width+2*this.graph.border*this.graph.view.scale?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){var b=a.getBoundingClientRect(),
-d=mxUtils.getScrollOrigin(document.body),d="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-d.x,top:-d.y},b={left:b.left-d.left,top:b.top-d.top,bottom:b.bottom-d.top,right:b.right-d.left};this.toolbar.style.left=b.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=b.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,a.offsetWidth)+"px",this.toolbar.style.top=b.top+1+
-"px"):this.toolbar.style.top=b.top+"px"}e=!1}}),k=null,m=!1;this.fitGraph=function(b){var d=a.offsetWidth;d==k||m||(m=!0,this.graph.maxFitScale=null!=b?b:this.graphConfig.zoom||(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,!1,!0),this.graph.maxFitScale=null,b=this.graph.getGraphBounds(),this.updateContainerHeight(a,Math.max(this.minHeight,b.height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},k=d,window.setTimeout(function(){m=
-!1},0))};GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?(mxEvent.addListener(window,"resize",d),this.graph.addListener("size",d)):new ResizeSensor(this.graph.container,d));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,this.minWidth,this.minHeight),this.graph.resizeContainer=!0;else if(this.widthIsEmpty&&this.updateContainerWidth(a,b.width+2*this.graph.border),this.updateContainerHeight(a,
-Math.max(this.minHeight,b.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var q=k=null,d=mxUtils.bind(this,function(){window.clearTimeout(q);m||(q=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?mxEvent.addListener(window,"resize",d):new ResizeSensor(this.graph.container,d))}else mxClient.IS_QUIRKS||9>=document.documentMode||this.graph.addListener("size",d);var t=mxUtils.bind(this,function(){var d=
+GraphViewer.prototype.addSizeHandler=function(){var a=this.graph.container,b=this.graph.getGraphBounds(),e=!1;a.style.overflow=1!=this.graphConfig["toolbar-nohide"]?"hidden":"visible";var c=mxUtils.bind(this,function(){if(!e){e=!0;var b=this.graph.getGraphBounds();a.style.overflow=1!=this.graphConfig["toolbar-nohide"]?a.offsetWidth<=b.width+2*this.graph.border*this.graph.view.scale?"auto":"hidden":"visible";if(null!=this.toolbar&&1!=this.graphConfig["toolbar-nohide"]){var b=a.getBoundingClientRect(),
+c=mxUtils.getScrollOrigin(document.body),c="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-c.x,top:-c.y},b={left:b.left-c.left,top:b.top-c.top,bottom:b.bottom-c.top,right:b.right-c.left};this.toolbar.style.left=b.left+"px";"bottom"==this.graphConfig["toolbar-position"]?this.toolbar.style.top=b.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(this.toolbar.style.width=Math.max(this.minToolbarWidth,a.offsetWidth)+"px",this.toolbar.style.top=b.top+1+
+"px"):this.toolbar.style.top=b.top+"px"}e=!1}}),k=null,m=!1;this.fitGraph=function(b){var c=a.offsetWidth;c==k||m||(m=!0,this.graph.maxFitScale=null!=b?b:this.graphConfig.zoom||(this.allowZoomIn?null:1),this.graph.fit(null,null,null,null,!1,!0),this.graph.maxFitScale=null,b=this.graph.getGraphBounds(),this.updateContainerHeight(a,Math.max(this.minHeight,b.height+2*this.graph.border+1)),this.graph.initialViewState={translate:this.graph.view.translate.clone(),scale:this.graph.view.scale},k=c,window.setTimeout(function(){m=
+!1},0))};GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?(mxEvent.addListener(window,"resize",c),this.graph.addListener("size",c)):new ResizeSensor(this.graph.container,c));if(this.graphConfig.resize||(this.zoomEnabled||!this.autoFit)&&0!=this.graphConfig.resize)this.graph.minimumContainerSize=new mxRectangle(0,0,this.minWidth,this.minHeight),this.graph.resizeContainer=!0;else if(this.widthIsEmpty&&this.updateContainerWidth(a,b.width+2*this.graph.border),this.updateContainerHeight(a,
+Math.max(this.minHeight,b.height+2*this.graph.border+1)),!this.zoomEnabled&&this.autoFit){var q=k=null,c=mxUtils.bind(this,function(){window.clearTimeout(q);m||(q=window.setTimeout(mxUtils.bind(this,this.fitGraph),100))});GraphViewer.useResizeSensor&&(mxClient.IS_QUIRKS||9>=document.documentMode?mxEvent.addListener(window,"resize",c):new ResizeSensor(this.graph.container,c))}else mxClient.IS_QUIRKS||9>=document.documentMode||this.graph.addListener("size",c);var t=mxUtils.bind(this,function(){var c=
a.style.minWidth;this.widthIsEmpty&&(a.style.minWidth="100%");if(0<a.offsetWidth&&(this.allowZoomIn||b.width+2*this.graph.border>a.offsetWidth||b.height+2*this.graph.border>this.graphConfig["max-height"])){var e=null;null!=this.graphConfig["max-height"]&&(e=this.graphConfig["max-height"]/(b.height+2*this.graph.border));this.fitGraph(e)}else this.graph.view.setTranslate(Math.floor((this.graph.border-b.x)/this.graph.view.scale),Math.floor((this.graph.border-b.y)/this.graph.view.scale)),k=a.offsetWidth;
-a.style.minWidth=d});mxClient.IS_QUIRKS||8==document.documentMode?window.setTimeout(t,0):t();this.positionGraph=function(){b=this.graph.getGraphBounds();k=null;t()}};GraphViewer.prototype.updateContainerWidth=function(a,b){a.style.width=b+"px"};GraphViewer.prototype.updateContainerHeight=function(a,b){if(this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||mxClient.IS_QUIRKS||8==document.documentMode)a.style.height=b+"px"};
-GraphViewer.prototype.showLayers=function(a,b){var e=this.graphConfig.layers;if(null!=e||null!=b)if(e=null!=e?e.split(" "):null,null!=b||0<e.length){var d=null!=b?b.getModel():null,k=a.getModel();k.beginUpdate();try{for(var m=k.getChildCount(k.root),q=0;q<m;q++)k.setVisible(k.getChildAt(k.root,q),null!=b?d.isVisible(d.getChildAt(d.root,q)):!1);if(null==d)for(q=0;q<e.length;q++)k.setVisible(k.getChildAt(k.root,parseInt(e[q])),!0)}finally{k.endUpdate()}}};
-GraphViewer.prototype.addToolbar=function(){function a(a,b,d,f){var g=document.createElement("div");g.style.borderRight="1px solid #d0d0d0";g.style.padding="3px 6px 3px 6px";mxEvent.addListener(g,"click",a);null!=d&&g.setAttribute("title",d);g.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",b);null==f||f?(mxEvent.addListener(g,"mouseenter",function(){g.style.backgroundColor="#ddd"}),mxEvent.addListener(g,"mouseleave",
-function(){g.style.backgroundColor="#eee"}),mxUtils.setOpacity(a,60),g.style.cursor="pointer"):mxUtils.setOpacity(g,30);g.appendChild(a);e.appendChild(g);c++;return g}var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var e=b.ownerDocument.createElement("div");e.style.position="absolute";e.style.overflow="hidden";e.style.boxSizing="border-box";
-e.style.whiteSpace="nowrap";e.style.textAlign="left";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="#eee";e.style.height=this.toolbarHeight+"px";this.toolbar=e;if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(e,30);var d=null,k=null,m=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);d=window.setTimeout(mxUtils.bind(this,
-function(){mxUtils.setOpacity(e,0);d=null;k=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";k=null}),100)}),a||200)}),q=mxUtils.bind(this,function(a){null!=d&&(window.clearTimeout(d),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);e.style.display="";mxUtils.setOpacity(e,a||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(q(30),m())}));mxEvent.addListener(e,mxClient.IS_POINTER?
+a.style.minWidth=c});mxClient.IS_QUIRKS||8==document.documentMode?window.setTimeout(t,0):t();this.positionGraph=function(){b=this.graph.getGraphBounds();k=null;t()}};GraphViewer.prototype.updateContainerWidth=function(a,b){a.style.width=b+"px"};GraphViewer.prototype.updateContainerHeight=function(a,b){if(this.zoomEnabled||!this.autoFit||"BackCompat"==document.compatMode||mxClient.IS_QUIRKS||8==document.documentMode)a.style.height=b+"px"};
+GraphViewer.prototype.showLayers=function(a,b){var e=this.graphConfig.layers;if(null!=e||null!=b)if(e=null!=e?e.split(" "):null,null!=b||0<e.length){var c=null!=b?b.getModel():null,k=a.getModel();k.beginUpdate();try{for(var m=k.getChildCount(k.root),q=0;q<m;q++)k.setVisible(k.getChildAt(k.root,q),null!=b?c.isVisible(c.getChildAt(c.root,q)):!1);if(null==c)for(q=0;q<e.length;q++)k.setVisible(k.getChildAt(k.root,parseInt(e[q])),!0)}finally{k.endUpdate()}}};
+GraphViewer.prototype.addToolbar=function(){function a(a,b,c,f){var g=document.createElement("div");g.style.borderRight="1px solid #d0d0d0";g.style.padding="3px 6px 3px 6px";mxEvent.addListener(g,"click",a);null!=c&&g.setAttribute("title",c);g.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";a=document.createElement("img");a.setAttribute("border","0");a.setAttribute("src",b);null==f||f?(mxEvent.addListener(g,"mouseenter",function(){g.style.backgroundColor="#ddd"}),mxEvent.addListener(g,"mouseleave",
+function(){g.style.backgroundColor="#eee"}),mxUtils.setOpacity(a,60),g.style.cursor="pointer"):mxUtils.setOpacity(g,30);g.appendChild(a);e.appendChild(g);d++;return g}var b=this.graph.container;"bottom"==this.graphConfig["toolbar-position"]?b.style.marginBottom=this.toolbarHeight+"px":"inline"!=this.graphConfig["toolbar-position"]&&(b.style.marginTop=this.toolbarHeight+"px");var e=b.ownerDocument.createElement("div");e.style.position="absolute";e.style.overflow="hidden";e.style.boxSizing="border-box";
+e.style.whiteSpace="nowrap";e.style.textAlign="left";e.style.zIndex=this.toolbarZIndex;e.style.backgroundColor="#eee";e.style.height=this.toolbarHeight+"px";this.toolbar=e;if("inline"==this.graphConfig["toolbar-position"]){mxUtils.setPrefixedStyle(e.style,"transition","opacity 100ms ease-in-out");mxUtils.setOpacity(e,30);var c=null,k=null,m=mxUtils.bind(this,function(a){null!=c&&(window.clearTimeout(c),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);c=window.setTimeout(mxUtils.bind(this,
+function(){mxUtils.setOpacity(e,0);c=null;k=window.setTimeout(mxUtils.bind(this,function(){e.style.display="none";k=null}),100)}),a||200)}),q=mxUtils.bind(this,function(a){null!=c&&(window.clearTimeout(c),fadeThead=null);null!=k&&(window.clearTimeout(k),fadeThead2=null);e.style.display="";mxUtils.setOpacity(e,a||30)});mxEvent.addListener(this.graph.container,mxClient.IS_POINTER?"pointermove":"mousemove",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||(q(30),m())}));mxEvent.addListener(e,mxClient.IS_POINTER?
"pointermove":"mousemove",function(a){mxEvent.consume(a)});mxEvent.addListener(e,"mouseenter",mxUtils.bind(this,function(a){q(100)}));mxEvent.addListener(e,"mousemove",mxUtils.bind(this,function(a){q(100);mxEvent.consume(a)}));mxEvent.addListener(e,"mouseleave",mxUtils.bind(this,function(a){mxEvent.isTouchEvent(a)||q(30)}));var t=this.graph,v=t.getTolerance();t.addMouseListener({startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(a,b){this.startX=b.getGraphX();this.startY=b.getGraphY();
-this.scrollLeft=t.container.scrollLeft;this.scrollTop=t.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-t.container.scrollLeft)<v&&Math.abs(this.scrollTop-t.container.scrollTop)<v&&Math.abs(this.startX-b.getGraphX())<v&&Math.abs(this.startY-b.getGraphY())<v&&(0<parseFloat(e.style.opacity||0)?m():q(30))}})}for(var A=this.toolbarItems,c=0,f=null,g=null,n=0;n<A.length;n++){var l=A[n];if("pages"==l){g=b.ownerDocument.createElement("div");
+this.scrollLeft=t.container.scrollLeft;this.scrollTop=t.container.scrollTop},mouseMove:function(a,b){},mouseUp:function(a,b){mxEvent.isTouchEvent(b.getEvent())&&Math.abs(this.scrollLeft-t.container.scrollLeft)<v&&Math.abs(this.scrollTop-t.container.scrollTop)<v&&Math.abs(this.startX-b.getGraphX())<v&&Math.abs(this.startY-b.getGraphY())<v&&(0<parseFloat(e.style.opacity||0)?m():q(30))}})}for(var A=this.toolbarItems,d=0,f=null,g=null,n=0;n<A.length;n++){var l=A[n];if("pages"==l){g=b.ownerDocument.createElement("div");
g.style.cssText="display:inline-block;position:relative;padding:3px 4px 0 4px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;";mxUtils.setOpacity(g,70);var p=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage-1)}),Editor.previousImage,mxResources.get("previousPage")||"Previous Page");p.style.borderRightStyle="none";p.style.paddingLeft="0px";p.style.paddingRight="0px";e.appendChild(g);var y=a(mxUtils.bind(this,function(){this.selectPage(this.currentPage+
1)}),Editor.nextImage,mxResources.get("nextPage")||"Next Page");y.style.paddingLeft="0px";y.style.paddingRight="0px";l=mxUtils.bind(this,function(){g.innerHTML="";mxUtils.write(g,this.currentPage+1+" / "+this.diagrams.length);g.style.display=1<this.diagrams.length?"inline-block":"none";p.style.display=g.style.display;y.style.display=g.style.display});this.addListener("graphChanged",l);l()}else if("zoom"==l)this.zoomEnabled&&(a(mxUtils.bind(this,function(){this.graph.zoomOut()}),Editor.zoomOutImage,
mxResources.get("zoomOut")||"Zoom Out"),a(mxUtils.bind(this,function(){this.graph.zoomIn()}),Editor.zoomInImage,mxResources.get("zoomIn")||"Zoom In"),a(mxUtils.bind(this,function(){this.graph.view.scaleAndTranslate(this.graph.initialViewState.scale,this.graph.initialViewState.translate.x,this.graph.initialViewState.translate.y)}),Editor.zoomFitImage,mxResources.get("fit")||"Fit"));else if("layers"==l){if(this.layersEnabled){var x=this.graph.getModel(),u=a(mxUtils.bind(this,function(a){if(null!=f)f.parentNode.removeChild(f),
f=null;else{f=this.graph.createLayersDialog();mxEvent.addListener(f,"mouseleave",function(){f.parentNode.removeChild(f);f=null});a=u.getBoundingClientRect();f.style.width="140px";f.style.padding="2px 0px 2px 0px";f.style.border="1px solid #d0d0d0";f.style.backgroundColor="#eee";f.style.fontFamily="Helvetica Neue,Helvetica,Arial Unicode MS,Arial";f.style.fontSize="11px";f.style.zIndex=this.toolbarZIndex+1;mxUtils.setOpacity(f,80);var b=mxUtils.getDocumentScrollOrigin(document);f.style.left=b.x+a.left+
"px";f.style.top=b.y+a.bottom+"px";document.body.appendChild(f)}}),Editor.layersImage,mxResources.get("layers")||"Layers");x.addListener(mxEvent.CHANGE,function(){u.style.display=1<x.getChildCount(x.root)?"inline-block":"none"});u.style.display=1<x.getChildCount(x.root)?"inline-block":"none"}}else"lightbox"==l?this.lightboxEnabled&&a(mxUtils.bind(this,function(){this.showLightbox()}),Editor.maximizeImage,mxResources.get("show")||"Show"):null!=this.graphConfig["toolbar-buttons"]&&(l=this.graphConfig["toolbar-buttons"][l],
-null!=l&&a(null==l.enabled||l.enabled?l.handler:function(){},l.image,l.title,l.enabled))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*c);null!=this.graphConfig.title&&(A=b.ownerDocument.createElement("div"),A.style.cssText="display:inline-block;position:relative;padding:3px 6px 0 6px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;",A.setAttribute("title",this.graphConfig.title),mxUtils.write(A,this.graphConfig.title),mxUtils.setOpacity(A,
-70),e.appendChild(A));this.minToolbarWidth=34*c;var G=b.style.border,A=mxUtils.bind(this,function(){e.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";e.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var a=b.getBoundingClientRect(),c=mxUtils.getScrollOrigin(document.body),c="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-c.x,top:-c.y},a={left:a.left-c.left,top:a.top-
+null!=l&&a(null==l.enabled||l.enabled?l.handler:function(){},l.image,l.title,l.enabled))}null!=this.graph.minimumContainerSize&&(this.graph.minimumContainerSize.width=34*d);null!=this.graphConfig.title&&(A=b.ownerDocument.createElement("div"),A.style.cssText="display:inline-block;position:relative;padding:3px 6px 0 6px;vertical-align:top;font-family:Helvetica,Arial;font-size:12px;top:4px;cursor:default;",A.setAttribute("title",this.graphConfig.title),mxUtils.write(A,this.graphConfig.title),mxUtils.setOpacity(A,
+70),e.appendChild(A));this.minToolbarWidth=34*d;var G=b.style.border,A=mxUtils.bind(this,function(){e.style.width="inline"==this.graphConfig["toolbar-position"]?"auto":Math.max(this.minToolbarWidth,b.offsetWidth)+"px";e.style.border="1px solid #d0d0d0";if(1!=this.graphConfig["toolbar-nohide"]){var a=b.getBoundingClientRect(),c=mxUtils.getScrollOrigin(document.body),c="relative"===document.body.style.position?document.body.getBoundingClientRect():{left:-c.x,top:-c.y},a={left:a.left-c.left,top:a.top-
c.top,bottom:a.bottom-c.top,right:a.right-c.left};e.style.left=a.left+"px";"bottom"==this.graphConfig["toolbar-position"]?e.style.top=a.bottom-1+"px":"inline"!=this.graphConfig["toolbar-position"]?(e.style.marginTop=-this.toolbarHeight+"px",e.style.top=a.top+1+"px"):e.style.top=a.top+"px";"1px solid transparent"==G&&(b.style.border="1px solid #d0d0d0");document.body.appendChild(e);var d=mxUtils.bind(this,function(){null!=e.parentNode&&e.parentNode.removeChild(e);null!=f&&(f.parentNode.removeChild(f),
f=null);b.style.border=G});mxEvent.addListener(document,"mousemove",function(a){for(a=mxEvent.getSource(a);null!=a;){if(a==b||a==e||a==f)return;a=a.parentNode}d()});mxEvent.addListener(document,"mouseleave",function(a){d()})}else e.style.top=-this.toolbarHeight+"px",b.appendChild(e)});1!=this.graphConfig["toolbar-nohide"]?mxEvent.addListener(b,"mouseenter",A):A()};
-GraphViewer.prototype.addClickHandler=function(a,b){a.linkPolicy=this.graphConfig.target||a.linkPolicy;a.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(e,d){if(null==d){var k=mxEvent.getSource(e);"a"==k.nodeName.toLowerCase()&&(d=k.getAttribute("href"))}null!=b?null==d||a.isExternalProtocol(d)||a.isBlankLink(d)||window.setTimeout(function(){b.destroy()},0):null!=d&&null==b&&a.isCustomLink(d)&&(mxEvent.isTouchEvent(e)||!mxEvent.isPopupTrigger(e))&&a.customLinkClicked(d)&&mxEvent.consume(e)}),
+GraphViewer.prototype.addClickHandler=function(a,b){a.linkPolicy=this.graphConfig.target||a.linkPolicy;a.addClickHandler(this.graphConfig.highlight,mxUtils.bind(this,function(e,c){if(null==c){var k=mxEvent.getSource(e);"a"==k.nodeName.toLowerCase()&&(c=k.getAttribute("href"))}null!=b?null==c||a.isExternalProtocol(c)||a.isBlankLink(c)||window.setTimeout(function(){b.destroy()},0):null!=c&&null==b&&a.isCustomLink(c)&&(mxEvent.isTouchEvent(e)||!mxEvent.isPopupTrigger(e))&&a.customLinkClicked(c)&&mxEvent.consume(e)}),
mxUtils.bind(this,function(a){null!=b||!this.lightboxClickEnabled||mxEvent.isTouchEvent(a)&&0!=this.toolbarItems.length||this.showLightbox()}))};
GraphViewer.prototype.showLightbox=function(a,b,e){if("open"==this.graphConfig.lightbox||window.self!==window.top)if(null==this.lightboxWindow||this.lightboxWindow.closed){a=null!=a?a:null!=this.graphConfig.editable?this.graphConfig.editable:!0;e={client:1,lightbox:1,target:null!=e?e:"blank"};a&&(e.edit=this.graphConfig.edit||"_blank");if(null!=b?b:1)e.close=1;this.layersEnabled&&(e.layers=1);null!=this.graphConfig&&0!=this.graphConfig.nav&&(e.nav=1);null!=this.graphConfig&&null!=this.graphConfig.highlight&&
(e.highlight=this.graphConfig.highlight.substring(1));null!=this.currentPage&&0<this.currentPage&&(e.page=this.currentPage);"undefined"!==typeof window.postMessage&&(null==document.documentMode||10<=document.documentMode)?null==this.lightboxWindow&&mxEvent.addListener(window,"message",mxUtils.bind(this,function(a){"ready"==a.data&&a.source==this.lightboxWindow&&this.lightboxWindow.postMessage(this.xml,"*")})):e.data=encodeURIComponent(this.xml);a="www.draw.io";"1"==urlParams.dev&&(e.dev="1",e.drawdev=
"1",a="test.draw.io");this.lightboxWindow=window.open("https://"+a+"/#P"+encodeURIComponent(JSON.stringify(e)))}else this.lightboxWindow.focus();else this.showLocalLightbox()};
GraphViewer.prototype.showLocalLightbox=function(){var a=mxUtils.getDocumentScrollOrigin(document),b=document.createElement("div");mxClient.IS_QUIRKS?(b.style.position="absolute",b.style.left=a.x+"px",b.style.top=a.y+"px",b.style.width=document.body.offsetWidth+"px",b.style.height=document.body.offsetHeight+"px"):b.style.cssText="position:fixed;top:0;left:0;bottom:0;right:0;";b.style.zIndex=this.lightboxZIndex;b.style.backgroundColor="#000000";mxUtils.setOpacity(b,70);document.body.appendChild(b);
-var e=document.createElement("img");e.setAttribute("border","0");e.setAttribute("src",Editor.closeImage);mxClient.IS_QUIRKS?(e.style.position="absolute",e.style.right="32px",e.style.top=a.y+32+"px"):e.style.cssText="position:fixed;top:32px;right:32px;";e.style.cursor="pointer";mxEvent.addListener(e,"click",function(){d.destroy()});urlParams.pages="1";urlParams.page=this.currentPage;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=this.layersEnabled?"1":"0";if(null==document.documentMode||
-10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit,Editor.prototype.editButtonFunc=this.graphConfig.editFunc;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};Graph.prototype.shadowId="lightboxDropShadow";var d=new EditorUi(new Editor(!0),document.createElement("div"),!0);d.editor.editBlankUrl=this.editBlankUrl;Graph.prototype.shadowId="dropShadow";d.refresh=
-function(){};var k=mxUtils.bind(this,function(a){27==a.keyCode&&d.destroy()}),m=d.destroy;d.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",k);document.body.removeChild(b);document.body.removeChild(e);document.body.style.overflow="auto";GraphViewer.resizeSensorEnabled=!0;m.apply(this,arguments)};var q=d.editor.graph,t=q.container;t.style.overflow="hidden";this.lightboxChrome?(t.style.border="1px solid #c0c0c0",t.style.margin="40px",mxEvent.addListener(document.documentElement,
-"keydown",k)):(b.style.display="none",e.style.display="none");var v=this;q.getImageFromBundles=function(a){return v.getImageUrl(a)};var A=d.createTemporaryGraph;d.createTemporaryGraph=function(){var a=A.apply(this,arguments);a.getImageFromBundles=function(a){return v.getImageUrl(a)};return a};this.graphConfig.move&&(q.isMoveCellsEvent=function(a){return!0});mxClient.IS_QUIRKS||(mxUtils.setPrefixedStyle(t.style,"border-radius","4px"),t.style.position="fixed");GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow=
-"hidden";mxClient.IS_SF||mxClient.IS_EDGE||(mxUtils.setPrefixedStyle(t.style,"transform","rotateY(90deg)"),mxUtils.setPrefixedStyle(t.style,"transition","all .25s ease-in-out"));this.addClickHandler(q,d);window.setTimeout(mxUtils.bind(this,function(){t.style.outline="none";t.style.zIndex=this.lightboxZIndex;e.style.zIndex=this.lightboxZIndex;document.body.appendChild(t);document.body.appendChild(e);d.setFileData(this.xml);mxUtils.setPrefixedStyle(t.style,"transform","rotateY(0deg)");d.chromelessToolbar.style.bottom=
-"60px";d.chromelessToolbar.style.zIndex=this.lightboxZIndex;document.body.appendChild(d.chromelessToolbar);d.getEditBlankXml=mxUtils.bind(this,function(){return this.xml});mxClient.IS_QUIRKS&&(t.style.position="absolute",t.style.display="block",t.style.left=a.x+"px",t.style.top=a.y+"px",t.style.width=document.body.clientWidth-80+"px",t.style.height=document.body.clientHeight-80+"px",t.style.backgroundColor="white",d.chromelessToolbar.style.display="block",d.chromelessToolbar.style.position="absolute",
-d.chromelessToolbar.style.bottom="",d.chromelessToolbar.style.top=a.y+document.body.clientHeight-100+"px");d.lightboxFit();d.chromelessResize();this.showLayers(q,this.graph);mxEvent.addListener(b,"click",function(){d.destroy()})}),0);return d};GraphViewer.processElements=function(a){mxUtils.forEach(GraphViewer.getElementsByClassName(a||"mxgraph"),function(a){try{a.innerHTML="",GraphViewer.createViewerForElement(a)}catch(e){throw a.innerHTML=e.message,e;}})};
-GraphViewer.getElementsByClassName=function(a){if(document.getElementsByClassName){var b=document.getElementsByClassName(a);a=[];for(var e=0;e<b.length;e++)a.push(b[e]);return a}for(var d=document.getElementsByTagName("*"),b=[],e=0;e<d.length;e++){var k=d[e].className;null!=k&&0<k.length&&(k=k.split(" "),0<=mxUtils.indexOf(k,a)&&b.push(d[e]))}return b};
-GraphViewer.createViewerForElement=function(a,b){var e=a.getAttribute("data-mxgraph");if(null!=e){var d=JSON.parse(e),k=function(e){e=mxUtils.parseXml(e);e=new GraphViewer(a,e.documentElement,d);null!=b&&b(e)};null!=d.url?GraphViewer.getUrl(d.url,function(a){k(a)}):k(d.xml)}};
+var e=document.createElement("img");e.setAttribute("border","0");e.setAttribute("src",Editor.closeImage);mxClient.IS_QUIRKS?(e.style.position="absolute",e.style.right="32px",e.style.top=a.y+32+"px"):e.style.cssText="position:fixed;top:32px;right:32px;";e.style.cursor="pointer";mxEvent.addListener(e,"click",function(){c.destroy()});urlParams.pages="1";urlParams.page=this.currentPage;urlParams.nav=0!=this.graphConfig.nav?"1":"0";urlParams.layers=this.layersEnabled?"1":"0";if(null==document.documentMode||
+10<=document.documentMode)Editor.prototype.editButtonLink=this.graphConfig.edit,Editor.prototype.editButtonFunc=this.graphConfig.editFunc;EditorUi.prototype.updateActionStates=function(){};EditorUi.prototype.addBeforeUnloadListener=function(){};EditorUi.prototype.addChromelessClickHandler=function(){};Graph.prototype.shadowId="lightboxDropShadow";var c=new EditorUi(new Editor(!0),document.createElement("div"),!0);c.editor.editBlankUrl=this.editBlankUrl;Graph.prototype.shadowId="dropShadow";c.refresh=
+function(){};var k=mxUtils.bind(this,function(a){27==a.keyCode&&c.destroy()}),m=c.destroy;c.destroy=function(){mxEvent.removeListener(document.documentElement,"keydown",k);document.body.removeChild(b);document.body.removeChild(e);document.body.style.overflow="auto";GraphViewer.resizeSensorEnabled=!0;m.apply(this,arguments)};var q=c.editor.graph,t=q.container;t.style.overflow="hidden";this.lightboxChrome?(t.style.border="1px solid #c0c0c0",t.style.margin="40px",mxEvent.addListener(document.documentElement,
+"keydown",k)):(b.style.display="none",e.style.display="none");var v=this;q.getImageFromBundles=function(a){return v.getImageUrl(a)};var A=c.createTemporaryGraph;c.createTemporaryGraph=function(){var a=A.apply(this,arguments);a.getImageFromBundles=function(a){return v.getImageUrl(a)};return a};this.graphConfig.move&&(q.isMoveCellsEvent=function(a){return!0});mxClient.IS_QUIRKS||(mxUtils.setPrefixedStyle(t.style,"border-radius","4px"),t.style.position="fixed");GraphViewer.resizeSensorEnabled=!1;document.body.style.overflow=
+"hidden";mxClient.IS_SF||mxClient.IS_EDGE||(mxUtils.setPrefixedStyle(t.style,"transform","rotateY(90deg)"),mxUtils.setPrefixedStyle(t.style,"transition","all .25s ease-in-out"));this.addClickHandler(q,c);window.setTimeout(mxUtils.bind(this,function(){t.style.outline="none";t.style.zIndex=this.lightboxZIndex;e.style.zIndex=this.lightboxZIndex;document.body.appendChild(t);document.body.appendChild(e);c.setFileData(this.xml);mxUtils.setPrefixedStyle(t.style,"transform","rotateY(0deg)");c.chromelessToolbar.style.bottom=
+"60px";c.chromelessToolbar.style.zIndex=this.lightboxZIndex;document.body.appendChild(c.chromelessToolbar);c.getEditBlankXml=mxUtils.bind(this,function(){return this.xml});mxClient.IS_QUIRKS&&(t.style.position="absolute",t.style.display="block",t.style.left=a.x+"px",t.style.top=a.y+"px",t.style.width=document.body.clientWidth-80+"px",t.style.height=document.body.clientHeight-80+"px",t.style.backgroundColor="white",c.chromelessToolbar.style.display="block",c.chromelessToolbar.style.position="absolute",
+c.chromelessToolbar.style.bottom="",c.chromelessToolbar.style.top=a.y+document.body.clientHeight-100+"px");c.lightboxFit();c.chromelessResize();this.showLayers(q,this.graph);mxEvent.addListener(b,"click",function(){c.destroy()})}),0);return c};GraphViewer.processElements=function(a){mxUtils.forEach(GraphViewer.getElementsByClassName(a||"mxgraph"),function(a){try{a.innerHTML="",GraphViewer.createViewerForElement(a)}catch(e){throw a.innerHTML=e.message,e;}})};
+GraphViewer.getElementsByClassName=function(a){if(document.getElementsByClassName){var b=document.getElementsByClassName(a);a=[];for(var e=0;e<b.length;e++)a.push(b[e]);return a}for(var c=document.getElementsByTagName("*"),b=[],e=0;e<c.length;e++){var k=c[e].className;null!=k&&0<k.length&&(k=k.split(" "),0<=mxUtils.indexOf(k,a)&&b.push(c[e]))}return b};
+GraphViewer.createViewerForElement=function(a,b){var e=a.getAttribute("data-mxgraph");if(null!=e){var c=JSON.parse(e),k=function(e){e=mxUtils.parseXml(e);e=new GraphViewer(a,e.documentElement,c);null!=b&&b(e)};null!=c.url?GraphViewer.getUrl(c.url,function(a){k(a)}):k(c.xml)}};
GraphViewer.initCss=function(){try{var a=document.createElement("style");a.type="text/css";a.innerHTML="div.mxTooltip {\n-webkit-box-shadow: 3px 3px 12px #C0C0C0;\n-moz-box-shadow: 3px 3px 12px #C0C0C0;\nbox-shadow: 3px 3px 12px #C0C0C0;\nbackground: #FFFFCC;\nborder-style: solid;\nborder-width: 1px;\nborder-color: black;\nfont-family: Arial;\nfont-size: 8pt;\nposition: absolute;\ncursor: default;\npadding: 4px;\ncolor: black;}\ntd.mxPopupMenuIcon div {\nwidth:16px;\nheight:16px;}\nhtml div.mxPopupMenu {\n-webkit-box-shadow:2px 2px 3px #d5d5d5;\n-moz-box-shadow:2px 2px 3px #d5d5d5;\nbox-shadow:2px 2px 3px #d5d5d5;\n_filter:progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color='#d0d0d0',Positive='true');\nbackground:white;\nposition:absolute;\nborder:3px solid #e7e7e7;\npadding:3px;}\nhtml table.mxPopupMenu {\nborder-collapse:collapse;\nmargin:0px;}\nhtml td.mxPopupMenuItem {\npadding:7px 30px 7px 30px;\nfont-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;\nfont-size:10pt;}\nhtml td.mxPopupMenuIcon {\nbackground-color:white;\npadding:0px;}\ntd.mxPopupMenuIcon .geIcon {\npadding:2px;\npadding-bottom:4px;\nmargin:2px;\nborder:1px solid transparent;\nopacity:0.5;\n_width:26px;\n_height:26px;}\ntd.mxPopupMenuIcon .geIcon:hover {\nborder:1px solid gray;\nborder-radius:2px;\nopacity:1;}\nhtml tr.mxPopupMenuItemHover {\nbackground-color: #eeeeee;\ncolor: black;}\ntable.mxPopupMenu hr {\ncolor:#cccccc;\nbackground-color:#cccccc;\nborder:none;\nheight:1px;}\ntable.mxPopupMenu tr {\tfont-size:4pt;}\n.geDialog { font-family:Helvetica Neue,Helvetica,Arial Unicode MS,Arial;\nfont-size:10pt;\nborder:none;\nmargin:0px;}\n.geDialog {\tposition:absolute;\tbackground:white;\toverflow:hidden;\tpadding:30px;\tborder:1px solid #acacac;\t-webkit-box-shadow:0px 0px 2px 2px #d5d5d5;\t-moz-box-shadow:0px 0px 2px 2px #d5d5d5;\tbox-shadow:0px 0px 2px 2px #d5d5d5;\t_filter:progid:DXImageTransform.Microsoft.DropShadow(OffX=2, OffY=2, Color='#d5d5d5', Positive='true');\tz-index: 2;}.geDialogClose {\tposition:absolute;\twidth:9px;\theight:9px;\topacity:0.5;\tcursor:pointer;\t_filter:alpha(opacity=50);}.geDialogClose:hover {\topacity:1;}.geDialogTitle {\tbox-sizing:border-box;\twhite-space:nowrap;\tbackground:rgb(229, 229, 229);\tborder-bottom:1px solid rgb(192, 192, 192);\tfont-size:15px;\tfont-weight:bold;\ttext-align:center;\tcolor:rgb(35, 86, 149);}.geDialogFooter {\tbackground:whiteSmoke;\twhite-space:nowrap;\ttext-align:right;\tbox-sizing:border-box;\tborder-top:1px solid #e5e5e5;\tcolor:darkGray;}\n.geBtn {\tbackground-color: #f5f5f5;\tborder-radius: 2px;\tborder: 1px solid #d8d8d8;\tcolor: #333;\tcursor: default;\tfont-size: 11px;\tfont-weight: bold;\theight: 29px;\tline-height: 27px;\tmargin: 0 0 0 8px;\tmin-width: 72px;\toutline: 0;\tpadding: 0 8px;\tcursor: pointer;}.geBtn:hover, .geBtn:focus {\t-webkit-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);\t-moz-box-shadow: 0px 1px 1px rgba(0,0,0,0.1);\tbox-shadow: 0px 1px 1px rgba(0,0,0,0.1);\tborder: 1px solid #c6c6c6;\tbackground-color: #f8f8f8;\tbackground-image: linear-gradient(#f8f8f8 0px,#f1f1f1 100%);\tcolor: #111;}.geBtn:disabled {\topacity: .5;}.gePrimaryBtn {\tbackground-color: #4d90fe;\tbackground-image: linear-gradient(#4d90fe 0px,#4787ed 100%);\tborder: 1px solid #3079ed;\tcolor: #fff;}.gePrimaryBtn:hover, .gePrimaryBtn:focus {\tbackground-color: #357ae8;\tbackground-image: linear-gradient(#4d90fe 0px,#357ae8 100%);\tborder: 1px solid #2f5bb7;\tcolor: #fff;}.gePrimaryBtn:disabled {\topacity: .5;}";document.getElementsByTagName("head")[0].appendChild(a)}catch(b){}};
-GraphViewer.cachedUrls={};GraphViewer.getUrl=function(a,b,e){if(null!=GraphViewer.cachedUrls[a])b(GraphViewer.cachedUrls[a]);else{var d=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;d.open("GET",a);d.onload=function(){b(null!=d.getText?d.getText():d.responseText)};d.onerror=e;d.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeSensor=!0;
-(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},b=function(e,d){function k(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function m(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function q(b,c){if(!b.resizedAttached)b.resizedAttached=
+GraphViewer.cachedUrls={};GraphViewer.getUrl=function(a,b,e){if(null!=GraphViewer.cachedUrls[a])b(GraphViewer.cachedUrls[a]);else{var c=0<navigator.userAgent.indexOf("MSIE 9")?new XDomainRequest:new XMLHttpRequest;c.open("GET",a);c.onload=function(){b(null!=c.getText?c.getText():c.responseText)};c.onerror=e;c.send()}};GraphViewer.resizeSensorEnabled=!0;GraphViewer.useResizeSensor=!0;
+(function(){var a=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(a){return window.setTimeout(a,20)},b=function(e,c){function k(){this.q=[];this.add=function(a){this.q.push(a)};var a,b;this.call=function(){a=0;for(b=this.q.length;a<b;a++)this.q[a].call()}}function m(a,b){return a.currentStyle?a.currentStyle[b]:window.getComputedStyle?window.getComputedStyle(a,null).getPropertyValue(b):a.style[b]}function q(b,c){if(!b.resizedAttached)b.resizedAttached=
new k,b.resizedAttached.add(c);else if(b.resizedAttached){b.resizedAttached.add(c);return}b.resizeSensor=document.createElement("div");b.resizeSensor.className="resize-sensor";b.resizeSensor.style.cssText="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;";b.resizeSensor.innerHTML='<div class="resize-sensor-expand" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s;"></div></div><div class="resize-sensor-shrink" style="position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; z-index: -1; visibility: hidden;"><div style="position: absolute; left: 0; top: 0; transition: 0s; width: 200%; height: 200%"></div></div>';
b.appendChild(b.resizeSensor);"static"==m(b,"position")&&(b.style.position="relative");var d=b.resizeSensor.childNodes[0],e=d.childNodes[0],f=b.resizeSensor.childNodes[1],g=function(){e.style.width="100000px";e.style.height="100000px";d.scrollLeft=1E5;d.scrollTop=1E5;f.scrollLeft=1E5;f.scrollTop=1E5};g();var q=!1,t=function(){b.resizedAttached&&(q&&(b.resizedAttached.call(),q=!1),a(t))};a(t);var v,z,A,r,C=function(){if((A=b.offsetWidth)!=v||(r=b.offsetHeight)!=z)q=!0,v=A,z=r;g()},Q=function(a,b,c){a.attachEvent?
-a.attachEvent("on"+b,c):a.addEventListener(b,c)};Q(d,"scroll",C);Q(f,"scroll",C)}var t=function(){GraphViewer.resizeSensorEnabled&&d()},v=Object.prototype.toString.call(e),A="[object Array]"===v||"[object NodeList]"===v||"[object HTMLCollection]"===v||"undefined"!==typeof jQuery&&e instanceof jQuery||"undefined"!==typeof Elements&&e instanceof Elements;if(A)for(var v=0,c=e.length;v<c;v++)q(e[v],t);else q(e,t);this.detach=function(){if(A)for(var a=0,c=e.length;a<c;a++)b.detach(e[a]);else b.detach(e)}};
+a.attachEvent("on"+b,c):a.addEventListener(b,c)};Q(d,"scroll",C);Q(f,"scroll",C)}var t=function(){GraphViewer.resizeSensorEnabled&&c()},v=Object.prototype.toString.call(e),A="[object Array]"===v||"[object NodeList]"===v||"[object HTMLCollection]"===v||"undefined"!==typeof jQuery&&e instanceof jQuery||"undefined"!==typeof Elements&&e instanceof Elements;if(A)for(var v=0,d=e.length;v<d;v++)q(e[v],t);else q(e,t);this.detach=function(){if(A)for(var a=0,c=e.length;a<c;a++)b.detach(e[a]);else b.detach(e)}};
b.detach=function(a){a.resizeSensor&&(a.removeChild(a.resizeSensor),delete a.resizeSensor,delete a.resizedAttached)};window.ResizeSensor=b})();
(function(){Editor.initMath();GraphViewer.initCss();if(null!=window.onDrawioViewerLoad)window.onDrawioViewerLoad();else GraphViewer.processElements()})();