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>2020-05-03 14:29:47 +0300
committerGaudenz Alder <gaudenz@jgraph.com>2020-05-03 14:29:47 +0300
commit5edbf1dbdb6050ae32519bdceeb91797b3737488 (patch)
treed7438440e147b2fceeaa331887e5548c5251d77b
parent77a078dd8446043bf34e82629eec0b017aab94d6 (diff)
13.0.6 releasev13.0.6
-rw-r--r--ChangeLog9
-rw-r--r--VERSION2
-rw-r--r--src/main/java/com/mxgraph/online/Utils.java21
-rw-r--r--src/main/webapp/connect/confluence/lucidMassImport.html4
-rw-r--r--src/main/webapp/electron.js15
-rw-r--r--src/main/webapp/js/app.min.js989
-rw-r--r--src/main/webapp/js/diagramly/App.js2
-rw-r--r--src/main/webapp/js/diagramly/Dialogs.js4
-rw-r--r--src/main/webapp/js/diagramly/DrawioFile.js34
-rw-r--r--src/main/webapp/js/diagramly/DrawioFileSync.js387
-rw-r--r--src/main/webapp/js/diagramly/DriveClient.js4
-rw-r--r--src/main/webapp/js/diagramly/DriveFile.js262
-rw-r--r--src/main/webapp/js/diagramly/Editor.js6
-rw-r--r--src/main/webapp/js/diagramly/OneDriveFile.js14
-rw-r--r--src/main/webapp/js/diagramly/vsdx/importer.js26
-rw-r--r--src/main/webapp/js/extensions.min.js104
-rw-r--r--src/main/webapp/js/viewer.min.js24
-rw-r--r--src/main/webapp/service-worker.js4
18 files changed, 1041 insertions, 870 deletions
diff --git a/ChangeLog b/ChangeLog
index ac2fa8e7..cfb816e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+03-MAY-2020: 13.0.6
+
+- Disables deltas for OneDrive real time
+- Adds token for Google Drive real time
+
+01-MAY-2020: 13.0.5
+
+- Import Extension code updated
+
30-APR-2020: 13.0.4
- Adds support for vss(x) via clibs parameter
diff --git a/VERSION b/VERSION
index b04feae7..b5f62cdf 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-13.0.4 \ No newline at end of file
+13.0.6 \ No newline at end of file
diff --git a/src/main/java/com/mxgraph/online/Utils.java b/src/main/java/com/mxgraph/online/Utils.java
index 1ba9b645..6fc09c76 100644
--- a/src/main/java/com/mxgraph/online/Utils.java
+++ b/src/main/java/com/mxgraph/online/Utils.java
@@ -47,6 +47,27 @@ public class Utils
protected static final int IO_BUFFER_SIZE = 4 * 1024;
/**
+ * Alphabet for global unique IDs.
+ */
+ public static final String TOKEN_ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
+
+ /**
+ * Returns a random string of the given length.
+ */
+ public static String generateToken(int length)
+ {
+ StringBuffer rtn = new StringBuffer();
+
+ for (int i = 0; i < length; i++)
+ {
+ rtn.append(TOKEN_ALPHABET.charAt(
+ (int) Math.floor(Math.random() * TOKEN_ALPHABET.length())));
+ }
+
+ return rtn.toString();
+ };
+
+ /**
* Applies a standard inflate algo to the input byte array
* @param binary the byte array to inflate
* @return the inflated String
diff --git a/src/main/webapp/connect/confluence/lucidMassImport.html b/src/main/webapp/connect/confluence/lucidMassImport.html
index fbb4fd55..a915f6bd 100644
--- a/src/main/webapp/connect/confluence/lucidMassImport.html
+++ b/src/main/webapp/connect/confluence/lucidMassImport.html
@@ -32,8 +32,8 @@
script.onload = function()
{
- var importExtensionId = 'hbkpkhcoenkflmbidimljjbhdeggihne';
- var extensionInstallUrl = 'https://chrome.google.com/webstore/category/extensions';
+ var importExtensionId = 'cnoplimhpndhhhnmoigbanpjeghjpohi';
+ var extensionInstallUrl = 'https://chrome.google.com/webstore/detail/diagramsnet-and-drawio-im/cnoplimhpndhhhnmoigbanpjeghjpohi';
AP.sizeToParent(true);
diff --git a/src/main/webapp/electron.js b/src/main/webapp/electron.js
index 47a52c0b..4b860fe0 100644
--- a/src/main/webapp/electron.js
+++ b/src/main/webapp/electron.js
@@ -647,13 +647,14 @@ app.on('ready', e =>
}, {
label: 'Edit',
submenu: [
- { role: 'undo' },
- { role: 'redo' },
- { role: 'cut' },
- { role: 'copy' },
- { role: 'paste' },
- { role: 'pasteAndMatchStyle' },
- { role: 'selectAll' }
+ { role: 'undo' },
+ { role: 'redo' },
+ { type: 'separator' },
+ { role: 'cut' },
+ { role: 'copy' },
+ { role: 'paste' },
+ { role: 'pasteAndMatchStyle' },
+ { role: 'selectAll' }
]
}]
diff --git a/src/main/webapp/js/app.min.js b/src/main/webapp/js/app.min.js
index 6961694b..8ac07496 100644
--- a/src/main/webapp/js/app.min.js
+++ b/src/main/webapp/js/app.min.js
@@ -8492,9 +8492,9 @@ DrawioFile.prototype.changeListenerEnabled=!0;DrawioFile.prototype.lastAutosaveR
DrawioFile.prototype.synchronizeFile=function(a,e){this.savingFile?null!=e&&e({message:mxResources.get("busy")}):null!=this.sync?this.sync.fileChanged(a,e):this.updateFile(a,e)};
DrawioFile.prototype.updateFile=function(a,e,c,b){null!=c&&c()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():this.getLatestVersion(mxUtils.bind(this,function(k){try{null!=c&&c()||(this.ui.getCurrentFile()!=this||this.invalidChecksum?null!=e&&e():null!=k?this.mergeFile(k,a,e,b):this.reloadFile(a,e))}catch(f){null!=e&&e(f)}}),e))};
DrawioFile.prototype.mergeFile=function(a,e,c,b){var k=!0;try{this.stats.fileMerged++;var f=null!=this.shadowPages?this.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.shadowData).documentElement),l=this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement);if(null!=l&&0<l.length){this.shadowPages=l;this.backupPatch=this.isModified()?this.ui.diffPages(f,this.ui.pages):null;var d=[this.ui.diffPages(null!=b?b:f,this.shadowPages)];if(!this.ignorePatches(d)){var g=this.ui.patchPages(f,
-d[0]);b={};var m=this.ui.getHashValueForPages(g,b),f={},n=this.ui.getHashValueForPages(this.shadowPages,f);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",d,"checksum",n==m,m);if(null!=m&&m!=n){var p=this.compressReportData(this.getAnonymizedXmlForPages(l)),u=this.compressReportData(this.getAnonymizedXmlForPages(g)),t=this.ui.hashValue(a.getCurrentEtag()),q=this.ui.hashValue(this.getCurrentEtag());this.checksumError(c,d,"Shadow Details: "+JSON.stringify(b)+
-"\nChecksum: "+m+"\nCurrent: "+n+"\nCurrent Details: "+JSON.stringify(f)+"\nFrom: "+t+"\nTo: "+q+"\n\nFile Data:\n"+p+"\nPatched Shadow:\n"+u,null,"mergeFile");return}this.patch(d,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!=e&&e()}catch(y){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();
-null!=c&&c(y);try{if(k)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,y);else{var v=this.getCurrentUser(),z=null!=v?v.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),z,y)}}catch(A){}}};
+d[0]);b={};var m=this.ui.getHashValueForPages(g,b),f={},n=this.ui.getHashValueForPages(this.shadowPages,f);"1"==urlParams.test&&EditorUi.debug("File.mergeFile",[this],"backup",this.backupPatch,"patches",d,"checksum",n==m,m);if(null!=m&&m!=n){var p=this.compressReportData(this.getAnonymizedXmlForPages(l)),u=this.compressReportData(this.getAnonymizedXmlForPages(g)),q=this.ui.hashValue(a.getCurrentEtag()),t=this.ui.hashValue(this.getCurrentEtag());this.checksumError(c,d,"Shadow Details: "+JSON.stringify(b)+
+"\nChecksum: "+m+"\nCurrent: "+n+"\nCurrent Details: "+JSON.stringify(f)+"\nFrom: "+q+"\nTo: "+t+"\n\nFile Data:\n"+p+"\nPatched Shadow:\n"+u,null,"mergeFile");return}this.patch(d,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!=e&&e()}catch(y){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();
+null!=c&&c(y);try{if(k)if(this.errorReportsEnabled)this.sendErrorReport("Error in mergeFile",null,y);else{var v=this.getCurrentUser(),z=null!=v?v.id:"unknown";EditorUi.logError("Error in mergeFile",null,this.getMode()+"."+this.getId(),z,y)}}catch(B){}}};
DrawioFile.prototype.getAnonymizedXmlForPages=function(a){var e=new mxCodec(mxUtils.createXmlDocument()),c=e.document.createElement("mxfile");if(null!=a)for(var b=0;b<a.length;b++){var k=e.encode(new mxGraphModel(a[b].root));"1"!=urlParams.dev&&(k=this.ui.anonymizeNode(k,!0));k.setAttribute("id",a[b].getId());a[b].viewState&&this.ui.editor.graph.saveViewState(a[b].viewState,k,!0);c.appendChild(k)}return mxUtils.getPrettyXml(c)};
DrawioFile.prototype.compressReportData=function(a,e,c){e=null!=e?e:1E4;null!=c&&null!=a&&a.length>c?a=a.substring(0,c)+"[...]":null!=a&&a.length>e&&(a=Graph.compress(a)+"\n");return a};
DrawioFile.prototype.checksumError=function(a,e,c,b,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!=e)for(a=0;a<e.length;a++)this.ui.anonymizePatch(e[a]);var f=mxUtils.bind(this,function(a){var d=this.compressReportData(JSON.stringify(e,null,2));a=null!=a?this.compressReportData(this.getAnonymizedXmlForPages(this.ui.getPagesForNode(mxUtils.parseXml(a.data).documentElement)),
@@ -8543,9 +8543,9 @@ DrawioFile.prototype.handleConflictError=function(a,e){var c=mxUtils.bind(this,f
this.synchronizeFile(mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.save(!0,c,b,null,null,this.constructor!=GitHubFile&&this.constructor!=GitLabFile||null==a?null:a.commitMessage)}),b)});"none"==DrawioFile.SYNC?this.showCopyDialog(c,b,k):this.invalidChecksum?this.showRefreshDialog(c,b,this.getErrorMessage(a)):e?this.showConflictDialog(k,f):this.addConflictStatus(mxUtils.bind(this,function(){this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("updatingDocument")));
this.synchronizeFile(c,b)}),this.getErrorMessage(a))};DrawioFile.prototype.getErrorMessage=function(a){return null!=a?null!=a.error?a.error.message:a.message:null};DrawioFile.prototype.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval};
DrawioFile.prototype.fileChanged=function(){this.lastChanged=new Date;this.setModified(!0);this.isAutosave()?(this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.ui.scheduleSanityCheck(),null==this.ageStart&&(this.ageStart=new Date),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=
-this.lastChanged)}),mxUtils.bind(this,function(a){this.handleFileError(a)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus())};
-DrawioFile.prototype.fileSaved=function(a,e,c,b){this.lastSaved=new Date;this.ageStart=null;try{this.stats.saved++,this.invalidChecksum=this.inConflictState=!1,null==this.sync?(this.shadowData=a,this.shadowPages=null,null!=c&&c()):this.sync.fileSaved(this.ui.getPagesForNode(mxUtils.parseXml(a).documentElement),e,c,b,a)}catch(l){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=b&&b(l);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,l);else{var k=
-this.getCurrentUser(),f=null!=k?k.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),f,l)}}catch(d){}}};
+this.lastChanged)}),mxUtils.bind(this,function(a){this.handleFileError(a)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus())};DrawioFile.prototype.createSecret=function(a,e){var c=Editor.guid(32);null!=this.sync?this.sync.createToken(c,mxUtils.bind(this,function(b){a(c,b)}),e):a(c)};
+DrawioFile.prototype.fileSaved=function(a,e,c,b,k){this.lastSaved=new Date;this.ageStart=null;try{this.stats.saved++,this.invalidChecksum=this.inConflictState=!1,null==this.sync?(this.shadowData=a,this.shadowPages=null,null!=c&&c()):this.sync.fileSaved(this.ui.getPagesForNode(mxUtils.parseXml(a).documentElement),e,c,b,k)}catch(d){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=b&&b(d);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,d);else{var f=
+this.getCurrentUser(),l=null!=f?f.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),l,d)}}catch(g){}}};
DrawioFile.prototype.autosave=function(a,e,c,b){null==this.lastAutosave&&(this.lastAutosave=Date.now());a=Date.now()-this.lastAutosave<e?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!=c&&c(a)}),mxUtils.bind(this,
function(a){null!=b&&b(a)}))}else this.isModified()||this.ui.editor.setStatus(""),null!=c&&c(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"))};
@@ -8569,21 +8569,21 @@ RemoteLibrary.prototype.saveAs=function(a,e,c){};RemoteLibrary.prototype.updateF
mxClient.IS_IOS || */
var StorageDialog=function(a,e,c){function b(d,b,f,k,v,u){function l(){mxEvent.addListener(x,"click",null!=u?u:function(){f!=App.MODE_GOOGLE||a.isDriveDomain()?f==App.MODE_GOOGLE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.drive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(f,g.checked);e()})):f==App.MODE_ONEDRIVE&&a.spinner.spin(document.body,mxResources.get("authorizing"))?a.oneDrive.checkToken(mxUtils.bind(this,function(){a.spinner.stop();a.setMode(f,g.checked);
e()})):(a.setMode(f,g.checked),e()):window.location.hostname=DriveClient.prototype.newAppHostname})}++m>c&&(mxUtils.br(n),m=0);var x=document.createElement("a");x.style.overflow="hidden";x.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";x.className="geBaseButton";x.style.boxSizing="border-box";x.style.fontSize="11px";x.style.position="relative";x.style.margin="4px";x.style.marginTop="2px";x.style.padding="8px 10px 12px 10px";x.style.width="88px";x.style.height=StorageDialog.extended?"50px":
-"100px";x.style.whiteSpace="nowrap";x.setAttribute("title",b);mxClient.IS_QUIRKS&&(x.style.cssFloat="left",x.style.zoom="1");var t=document.createElement("div");t.style.textOverflow="ellipsis";t.style.overflow="hidden";if(null!=d){var q=document.createElement("img");q.setAttribute("src",d);q.setAttribute("border","0");q.setAttribute("align","absmiddle");q.style.width=StorageDialog.extended?"24px":"60px";q.style.height=StorageDialog.extended?"24px":"60px";q.style.paddingBottom=StorageDialog.extended?
-"4px":"6px";x.appendChild(q)}else t.style.paddingTop="5px",t.style.whiteSpace="normal",mxClient.IS_IOS?(x.style.padding="0px 10px 20px 10px",x.style.top="6px"):mxClient.IS_FF&&(t.style.paddingTop="0px",t.style.marginTop="-2px");StorageDialog.extended&&(x.style.paddingTop="4px",x.style.marginBottom="0px",t.display="inline-block",2==c&&(q.style.width="38px",q.style.height="38px",x.style.width="80px",x.style.height="68px"));x.appendChild(t);mxUtils.write(t,b);if(null!=v)for(d=0;d<v.length;d++)mxUtils.br(t),
-mxUtils.write(t,v[d]);if(null!=k&&null==a[k]){q.style.visibility="hidden";mxUtils.setOpacity(t,10);var B=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});B.spin(x);var C=window.setTimeout(function(){null==a[k]&&(B.stop(),x.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(d,b){null!=a[k]&&b.getProperty("client")==a[k]&&(window.clearTimeout(C),mxUtils.setOpacity(t,
-100),q.style.visibility="",B.stop(),l(),"drive"==k&&null!=p.parentNode&&p.parentNode.removeChild(p))}))}else l();n.appendChild(x)}c=null!=c?c:2;var k=document.createElement("div");k.style.textAlign="center";k.style.whiteSpace="nowrap";k.style.paddingTop="0px";k.style.paddingBottom="20px";var f=a.addLanguageMenu(k,!0);null!=f&&(f.style.bottom=parseInt("28px")-3+"px");if(!a.isOffline()&&1<a.getServiceCount()){f=document.createElement("a");f.setAttribute("href","https://about.draw.io/support/");f.setAttribute("title",
+"100px";x.style.whiteSpace="nowrap";x.setAttribute("title",b);mxClient.IS_QUIRKS&&(x.style.cssFloat="left",x.style.zoom="1");var q=document.createElement("div");q.style.textOverflow="ellipsis";q.style.overflow="hidden";if(null!=d){var t=document.createElement("img");t.setAttribute("src",d);t.setAttribute("border","0");t.setAttribute("align","absmiddle");t.style.width=StorageDialog.extended?"24px":"60px";t.style.height=StorageDialog.extended?"24px":"60px";t.style.paddingBottom=StorageDialog.extended?
+"4px":"6px";x.appendChild(t)}else q.style.paddingTop="5px",q.style.whiteSpace="normal",mxClient.IS_IOS?(x.style.padding="0px 10px 20px 10px",x.style.top="6px"):mxClient.IS_FF&&(q.style.paddingTop="0px",q.style.marginTop="-2px");StorageDialog.extended&&(x.style.paddingTop="4px",x.style.marginBottom="0px",q.display="inline-block",2==c&&(t.style.width="38px",t.style.height="38px",x.style.width="80px",x.style.height="68px"));x.appendChild(q);mxUtils.write(q,b);if(null!=v)for(d=0;d<v.length;d++)mxUtils.br(q),
+mxUtils.write(q,v[d]);if(null!=k&&null==a[k]){t.style.visibility="hidden";mxUtils.setOpacity(q,10);var A=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"dark"==uiTheme?"#c0c0c0":"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});A.spin(x);var C=window.setTimeout(function(){null==a[k]&&(A.stop(),x.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(d,b){null!=a[k]&&b.getProperty("client")==a[k]&&(window.clearTimeout(C),mxUtils.setOpacity(q,
+100),t.style.visibility="",A.stop(),l(),"drive"==k&&null!=p.parentNode&&p.parentNode.removeChild(p))}))}else l();n.appendChild(x)}c=null!=c?c:2;var k=document.createElement("div");k.style.textAlign="center";k.style.whiteSpace="nowrap";k.style.paddingTop="0px";k.style.paddingBottom="20px";var f=a.addLanguageMenu(k,!0);null!=f&&(f.style.bottom=parseInt("28px")-3+"px");if(!a.isOffline()&&1<a.getServiceCount()){f=document.createElement("a");f.setAttribute("href","https://about.draw.io/support/");f.setAttribute("title",
mxResources.get("help"));f.setAttribute("target","_blank");f.style.position="absolute";f.style.userSelect="none";f.style.textDecoration="none";f.style.cursor="pointer";f.style.fontSize="12px";f.style.bottom="28px";f.style.left="26px";f.style.color="gray";var l=document.createElement("img");mxUtils.setOpacity(l,50);l.style.height="16px";l.style.width="16px";l.setAttribute("border","0");l.setAttribute("valign","bottom");l.setAttribute("src",Editor.helpImage);l.style.marginRight="2px";f.appendChild(l);
mxUtils.write(f,mxResources.get("help"));k.appendChild(f)}var d=document.createElement("div");d.style.position="absolute";d.style.cursor="pointer";d.style.fontSize="12px";d.style.bottom="28px";d.style.color="gray";d.style.userSelect="none";mxUtils.write(d,mxResources.get("decideLater"));mxUtils.setPrefixedStyle(d.style,"transform","translate(-50%,0)");d.style.left="50%";this.init=function(){if(mxClient.IS_QUIRKS||8==document.documentMode)d.style.marginLeft=-Math.round(d.clientWidth/2)+"px"};k.appendChild(d);
mxEvent.addListener(d,"click",function(){a.hideDialog();var d=Editor.useLocalStorage;a.createFile(a.defaultFilename,null,null,null,null,null,null,!0);Editor.useLocalStorage=d});f=document.createElement("div");mxClient.IS_QUIRKS&&(f.style.whiteSpace="nowrap",f.style.cssFloat="left");f.style.border="1px solid #d3d3d3";f.style.borderWidth="1px 0px 1px 0px";f.style.padding="12px 0px 12px 0px";var g=document.createElement("input");g.setAttribute("type","checkbox");g.setAttribute("checked","checked");g.defaultChecked=
!0;var m=0,n=document.createElement("div");n.style.paddingTop="2px";f.appendChild(n);var p=document.createElement("p"),l=document.createElement("p");l.style.fontSize="16pt";l.style.padding="0px";l.style.paddingTop="4px";l.style.paddingBottom="16px";l.style.margin="0px";l.style.color="gray";mxUtils.write(l,mxResources.get("saveDiagramsTo")+":");k.appendChild(l);var u=function(){m=0;"function"===typeof window.DriveClient&&b(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,
"drive");"function"===typeof window.OneDriveClient&&b(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive");b(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),App.MODE_DEVICE);!isLocalStorage||"1"!=urlParams.browser&&"1"!=urlParams.offline||b(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER);StorageDialog.extended&&("function"===typeof window.DropboxClient&&b(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,
-"dropbox"),null!=a.gitHub&&b(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub"),null!=a.gitLab&&b(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab"))};k.appendChild(f);u();l=document.createElement("p");l.style.marginTop="8px";l.style.marginBottom="6px";var t=document.createElement("div");t.style.marginBottom="10px";if(!a.isOfflineApp()){var q=document.createElement("a");q.style.color="gray";q.style.fontSize="12px";q.style.cursor="pointer";
-q.style.userSelect="none";mxUtils.write(q,(StorageDialog.extended?mxResources.get("showLess"):mxResources.get("showMore"))+"...");t.appendChild(q);l.appendChild(t);mxEvent.addListener(q,"click",function(a){n.innerHTML="";q.innerHTML="";StorageDialog.extended=!StorageDialog.extended;u();mxUtils.write(q,(StorageDialog.extended?mxResources.get("showLess"):mxResources.get("showMore"))+"...");mxEvent.consume(a)})}l.appendChild(g);var v=document.createElement("span");v.style.color="gray";v.style.fontSize=
-"12px";v.style.userSelect="none";mxUtils.write(v," "+mxResources.get("rememberThisSetting"));l.appendChild(v);mxUtils.br(l);t=a.getRecent();if(!a.isOfflineApp()&&null!=t&&0<t.length){var z=document.createElement("select");z.style.marginTop="8px";z.style.maxWidth="170px";var y=document.createElement("option");y.setAttribute("value","");y.setAttribute("selected","selected");y.style.textAlign="center";mxUtils.write(y,mxResources.get("openRecent")+"...");z.appendChild(y);for(y=0;y<t.length;y++)(function(a){var d=
-a.mode;d==App.MODE_GOOGLE?d="googleDrive":d==App.MODE_ONEDRIVE&&(d="oneDrive");var b=document.createElement("option");b.setAttribute("value",a.id);mxUtils.write(b,a.title+" ("+mxResources.get(d)+")");z.appendChild(b)})(t[y]);l.appendChild(z);mxEvent.addListener(z,"change",function(d){""!=z.value&&a.loadFile(z.value)})}else l.style.marginTop="20px",f.style.padding="30px 0px 26px 0px";Graph.fileSupport&&(t=document.createElement("div"),t.style.marginBottom="10px",t.style.padding="18px 0px 6px 0px",
+"dropbox"),null!=a.gitHub&&b(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub"),null!=a.gitLab&&b(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab"))};k.appendChild(f);u();l=document.createElement("p");l.style.marginTop="8px";l.style.marginBottom="6px";var q=document.createElement("div");q.style.marginBottom="10px";if(!a.isOfflineApp()){var t=document.createElement("a");t.style.color="gray";t.style.fontSize="12px";t.style.cursor="pointer";
+t.style.userSelect="none";mxUtils.write(t,(StorageDialog.extended?mxResources.get("showLess"):mxResources.get("showMore"))+"...");q.appendChild(t);l.appendChild(q);mxEvent.addListener(t,"click",function(a){n.innerHTML="";t.innerHTML="";StorageDialog.extended=!StorageDialog.extended;u();mxUtils.write(t,(StorageDialog.extended?mxResources.get("showLess"):mxResources.get("showMore"))+"...");mxEvent.consume(a)})}l.appendChild(g);var v=document.createElement("span");v.style.color="gray";v.style.fontSize=
+"12px";v.style.userSelect="none";mxUtils.write(v," "+mxResources.get("rememberThisSetting"));l.appendChild(v);mxUtils.br(l);q=a.getRecent();if(!a.isOfflineApp()&&null!=q&&0<q.length){var z=document.createElement("select");z.style.marginTop="8px";z.style.maxWidth="170px";var y=document.createElement("option");y.setAttribute("value","");y.setAttribute("selected","selected");y.style.textAlign="center";mxUtils.write(y,mxResources.get("openRecent")+"...");z.appendChild(y);for(y=0;y<q.length;y++)(function(a){var d=
+a.mode;d==App.MODE_GOOGLE?d="googleDrive":d==App.MODE_ONEDRIVE&&(d="oneDrive");var b=document.createElement("option");b.setAttribute("value",a.id);mxUtils.write(b,a.title+" ("+mxResources.get(d)+")");z.appendChild(b)})(q[y]);l.appendChild(z);mxEvent.addListener(z,"change",function(d){""!=z.value&&a.loadFile(z.value)})}else l.style.marginTop="20px",f.style.padding="30px 0px 26px 0px";Graph.fileSupport&&(q=document.createElement("div"),q.style.marginBottom="10px",q.style.padding="18px 0px 6px 0px",
y=document.createElement("a"),y.style.cursor="pointer",y.style.fontSize="12px",y.style.color="gray",y.style.userSelect="none",mxUtils.write(y,mxResources.get("import")+": "+mxResources.get("gliffy")+", "+mxResources.get("formatVssx")+", "+mxResources.get("formatVsdx")+", "+mxResources.get("lucidchart")+"..."),mxEvent.addListener(y,"click",function(){if(null==a.storageFileInputElt){var d=document.createElement("input");d.setAttribute("type","file");mxEvent.addListener(d,"change",function(){null!=d.files&&
-(a.hideDialog(),a.openFiles(d.files,!0),d.type="",d.type="file",d.value="")});d.style.display="none";document.body.appendChild(d);a.storageFileInputElt=d}a.storageFileInputElt.click()}),t.appendChild(y),l.appendChild(t),f.style.paddingBottom="4px");f.appendChild(l);mxEvent.addListener(v,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==a.drive&&
+(a.hideDialog(),a.openFiles(d.files,!0),d.type="",d.type="file",d.value="")});d.style.display="none";document.body.appendChild(d);a.storageFileInputElt=d}a.storageFileInputElt.click()}),q.appendChild(y),l.appendChild(q),f.style.paddingBottom="4px");f.appendChild(l);mxEvent.addListener(v,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)});mxClient.IS_SVG&&isLocalStorage&&"0"!=urlParams.gapi&&(null==document.documentMode||10<=document.documentMode)&&window.setTimeout(function(){null==a.drive&&
(p.style.padding="8px",p.style.fontSize="9pt",p.style.marginTop="-14px",p.innerHTML='<a style="background-color:#dcdcdc;padding:5px;color:black;text-decoration:none;" href="https://desk.draw.io/a/solutions/articles/16000074659" target="_blank"><img border="0" src="'+mxGraph.prototype.warningImage.src+'" align="top"> '+mxResources.get("googleDriveMissingClickHere")+"</a>",k.appendChild(p))},5E3);this.container=k};StorageDialog.extended=!1;
var SplashDialog=function(a){var e=document.createElement("div");e.style.textAlign="center";var c=a.addLanguageMenu(e,!0);null!=c&&(c.style.bottom="19px");c=null;c=a.getServiceCount();if(!a.isOffline()&&1<c){c=document.createElement("a");c.setAttribute("href","https://about.draw.io/support/");c.setAttribute("title",mxResources.get("help"));c.setAttribute("target","_blank");c.style.position="absolute";c.style.fontSize="12px";c.style.textDecoration="none";c.style.cursor="pointer";c.style.bottom="22px";
c.style.left="26px";c.style.color="gray";var b=document.createElement("img");mxUtils.setOpacity(b,50);b.style.height="16px";b.style.width="16px";b.setAttribute("border","0");b.setAttribute("valign","bottom");b.setAttribute("src",Editor.helpImage);b.style.marginRight="2px";c.appendChild(b);mxUtils.write(c,mxResources.get("help"));e.appendChild(c)}c=document.createElement("p");c.style.fontSize="16pt";c.style.padding="0px";c.style.paddingTop="2px";c.style.margin="0px";c.style.color="gray";b=document.createElement("img");
@@ -8600,30 +8600,30 @@ mxEvent.addListener(c,"click",function(){a.hideDialog(!1);a.setMode(null);a.clea
f.style.color="gray";mxUtils.write(f,a.formatFileSize(e.length));b.appendChild(f);var d=document.createElement("textarea");d.setAttribute("autocomplete","off");d.setAttribute("autocorrect","off");d.setAttribute("autocapitalize","off");d.setAttribute("spellcheck","false");d.style.fontFamily="monospace";d.style.wordBreak="break-all";d.style.marginTop="10px";d.style.resize="none";d.style.height="150px";d.style.width="440px";d.style.border="1px solid gray";d.value=mxResources.get("updatingDocument");
b.appendChild(d);mxUtils.br(b);this.init=function(){window.setTimeout(function(){5E5>e.length?(d.value=e,d.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?d.select():document.execCommand("selectAll",!1,null)):(d.setAttribute("readonly","true"),d.value=e.substring(0,340)+"... ("+mxResources.get("drawingTooLarge")+")")},0)};f=document.createElement("div");f.style.position="absolute";f.style.bottom="36px";f.style.right="32px";var g=null;!EmbedDialog.showPreviewOption||
mxClient.IS_CHROMEAPP&&!l||navigator.standalone||!(l||mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode))||(g=mxUtils.button(mxResources.get(5E5>e.length?"preview":"openInNewWindow"),function(){var b=5E5>e.length?d.value:e;if(null!=k)k(b);else if(l)try{var g=a.openLink(b);null!=g&&(null==c||0<c)&&window.setTimeout(mxUtils.bind(this,function(){null!=g&&null!=g.location.href&&g.location.href.substring(0,8)!=b.substring(0,8)&&(g.close(),a.handleError({message:mxResources.get("drawingTooLarge")}))}),
-c||500)}catch(q){a.handleError({message:q.message||mxResources.get("drawingTooLarge")})}else{var m=window.open(),m=null!=m?m.document:null;null!=m?(m.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+e+"</body></html>"),m.close()):a.handleError({message:mxResources.get("errorUpdatingPreview")})}}),g.className="geBtn",f.appendChild(g));if(!l||7500<e.length){var m=mxUtils.button(mxResources.get("download"),function(){a.hideDialog();
+c||500)}catch(t){a.handleError({message:t.message||mxResources.get("drawingTooLarge")})}else{var m=window.open(),m=null!=m?m.document:null;null!=m?(m.writeln("<html><head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head><body>'+e+"</body></html>"),m.close()):a.handleError({message:mxResources.get("errorUpdatingPreview")})}}),g.className="geBtn",f.appendChild(g));if(!l||7500<e.length){var m=mxUtils.button(mxResources.get("download"),function(){a.hideDialog();
a.saveData("embed.txt","txt",e,"text/plain")});m.className="geBtn";f.appendChild(m)}if(l&&(!a.isOffline()||mxClient.IS_CHROMEAPP)){if(51200>e.length){var n=mxUtils.button("",function(){try{var b="https://www.facebook.com/sharer.php?p[url]="+encodeURIComponent(d.value);a.openLink(b)}catch(u){a.handleError({message:u.message||mxResources.get("drawingTooLarge")})}}),m=document.createElement("img");m.setAttribute("src",Editor.facebookImage);m.setAttribute("width","18");m.setAttribute("height","18");m.setAttribute("border",
"0");n.appendChild(m);n.setAttribute("title",mxResources.get("facebook")+" ("+a.formatFileSize(51200)+" max)");n.style.verticalAlign="bottom";n.style.paddingTop="4px";n.style.minWidth="46px";n.className="geBtn";f.appendChild(n)}7168>e.length&&(n=mxUtils.button("",function(){try{var b="https://twitter.com/intent/tweet?text="+encodeURIComponent("Check out the diagram I made using @drawio")+"&url="+encodeURIComponent(d.value);a.openLink(b)}catch(u){a.handleError({message:u.message||mxResources.get("drawingTooLarge")})}}),
m=document.createElement("img"),m.setAttribute("src",Editor.tweetImage),m.setAttribute("width","18"),m.setAttribute("height","18"),m.setAttribute("border","0"),m.style.marginBottom="5px",n.appendChild(m),n.setAttribute("title",mxResources.get("twitter")+" ("+a.formatFileSize(7168)+" max)"),n.style.verticalAlign="bottom",n.style.paddingTop="4px",n.style.minWidth="46px",n.className="geBtn",f.appendChild(n))}m=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.appendChild(m);n=mxUtils.button(mxResources.get("copy"),
function(){d.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?d.select():document.execCommand("selectAll",!1,null);document.execCommand("copy");a.alert(mxResources.get("copiedToClipboard"))});5E5>e.length?mxClient.IS_SF||null!=document.documentMode?m.className="geBtn gePrimaryBtn":(f.appendChild(n),n.className="geBtn gePrimaryBtn",m.className="geBtn"):(f.appendChild(g),m.className="geBtn",g.className="geBtn gePrimaryBtn");b.appendChild(f);this.container=b};
EmbedDialog.showPreviewOption=!0;
-var GoogleSitesDialog=function(a,e){function c(){var a=null!=D&&null!=D.getTitle()?D.getTitle():this.defaultFilename;if(B.checked&&""!=u.value){var d="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(u.value));null!=a&&(d+="&title="+encodeURIComponent(a));0<C.length&&(d+="&s="+C);""!=t.value&&"0"!=t.value&&(d+="&border="+t.value);""!=p.value&&(d+="&height="+p.value);d+="&pan="+(q.checked?"1":"0");d+="&zoom="+(v.checked?"1":"0");d+="&fit="+(x.checked?"1":"0");
-d+="&resize="+(A.checked?"1":"0");d+="&x0="+Number(n.value);d+="&y0="+g;k.mathEnabled&&(d+="&math=1");y.checked?d+="&edit=_blank":z.checked&&(d+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));m.value=d}else D.constructor==DriveFile||D.constructor==DropboxFile?(d="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=u.value?d+=encodeURIComponent(mxUtils.htmlEntities(u.value))+"&type=3":(d+=D.getHash().substring(1),d=D.constructor==DropboxFile?d+"&type=2":d+"&type=1"),null!=
+var GoogleSitesDialog=function(a,e){function c(){var a=null!=D&&null!=D.getTitle()?D.getTitle():this.defaultFilename;if(A.checked&&""!=u.value){var d="https://www.draw.io/gadget.xml?type=4&diagram="+encodeURIComponent(mxUtils.htmlEntities(u.value));null!=a&&(d+="&title="+encodeURIComponent(a));0<C.length&&(d+="&s="+C);""!=q.value&&"0"!=q.value&&(d+="&border="+q.value);""!=p.value&&(d+="&height="+p.value);d+="&pan="+(t.checked?"1":"0");d+="&zoom="+(v.checked?"1":"0");d+="&fit="+(x.checked?"1":"0");
+d+="&resize="+(B.checked?"1":"0");d+="&x0="+Number(n.value);d+="&y0="+g;k.mathEnabled&&(d+="&math=1");y.checked?d+="&edit=_blank":z.checked&&(d+="&edit="+encodeURIComponent(mxUtils.htmlEntities(window.location.href)));m.value=d}else D.constructor==DriveFile||D.constructor==DropboxFile?(d="https://www.draw.io/gadget.xml?embed=0&diagram=",""!=u.value?d+=encodeURIComponent(mxUtils.htmlEntities(u.value))+"&type=3":(d+=D.getHash().substring(1),d=D.constructor==DropboxFile?d+"&type=2":d+"&type=1"),null!=
a&&(d+="&title="+encodeURIComponent(a)),""!=p.value&&(a=parseInt(p.value)+parseInt(n.value),d+="&height="+a),m.value=d):m.value=""}var b=document.createElement("div"),k=a.editor.graph,f=k.getGraphBounds(),l=k.view.scale,d=Math.floor(f.x/l-k.view.translate.x),g=Math.floor(f.y/l-k.view.translate.y);mxUtils.write(b,mxResources.get("googleGadget")+":");mxUtils.br(b);var m=document.createElement("input");m.setAttribute("type","text");m.style.marginBottom="8px";m.style.marginTop="2px";m.style.width="410px";
b.appendChild(m);mxUtils.br(b);this.init=function(){m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)};mxUtils.write(b,mxResources.get("top")+":");var n=document.createElement("input");n.setAttribute("type","text");n.setAttribute("size","4");n.style.marginRight="16px";n.style.marginLeft="4px";n.value=d;b.appendChild(n);mxUtils.write(b,mxResources.get("height")+":");var p=document.createElement("input");p.setAttribute("type",
"text");p.setAttribute("size","4");p.style.marginLeft="4px";p.value=Math.ceil(f.height/l);b.appendChild(p);mxUtils.br(b);f=document.createElement("hr");f.setAttribute("size","1");f.style.marginBottom="16px";f.style.marginTop="16px";b.appendChild(f);mxUtils.write(b,mxResources.get("publicDiagramUrl")+":");mxUtils.br(b);var u=document.createElement("input");u.setAttribute("type","text");u.setAttribute("size","28");u.style.marginBottom="8px";u.style.marginTop="2px";u.style.width="410px";u.value=e||"";
-b.appendChild(u);mxUtils.br(b);mxUtils.write(b,mxResources.get("borderWidth")+":");var t=document.createElement("input");t.setAttribute("type","text");t.setAttribute("size","3");t.style.marginBottom="8px";t.style.marginLeft="4px";t.value="0";b.appendChild(t);mxUtils.br(b);var q=document.createElement("input");q.setAttribute("type","checkbox");q.setAttribute("checked","checked");q.defaultChecked=!0;q.style.marginLeft="16px";b.appendChild(q);mxUtils.write(b,mxResources.get("pan")+" ");var v=document.createElement("input");
+b.appendChild(u);mxUtils.br(b);mxUtils.write(b,mxResources.get("borderWidth")+":");var q=document.createElement("input");q.setAttribute("type","text");q.setAttribute("size","3");q.style.marginBottom="8px";q.style.marginLeft="4px";q.value="0";b.appendChild(q);mxUtils.br(b);var t=document.createElement("input");t.setAttribute("type","checkbox");t.setAttribute("checked","checked");t.defaultChecked=!0;t.style.marginLeft="16px";b.appendChild(t);mxUtils.write(b,mxResources.get("pan")+" ");var v=document.createElement("input");
v.setAttribute("type","checkbox");v.setAttribute("checked","checked");v.defaultChecked=!0;v.style.marginLeft="8px";b.appendChild(v);mxUtils.write(b,mxResources.get("zoom")+" ");var z=document.createElement("input");z.setAttribute("type","checkbox");z.style.marginLeft="8px";z.setAttribute("title",window.location.href);b.appendChild(z);mxUtils.write(b,mxResources.get("edit")+" ");var y=document.createElement("input");y.setAttribute("type","checkbox");y.style.marginLeft="8px";b.appendChild(y);mxUtils.write(b,
-mxResources.get("asNew")+" ");mxUtils.br(b);var A=document.createElement("input");A.setAttribute("type","checkbox");A.setAttribute("checked","checked");A.defaultChecked=!0;A.style.marginLeft="16px";b.appendChild(A);mxUtils.write(b,mxResources.get("resize")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";b.appendChild(x);mxUtils.write(b,mxResources.get("fit")+" ");var B=document.createElement("input");B.setAttribute("type","checkbox");B.style.marginLeft=
-"8px";b.appendChild(B);mxUtils.write(b,mxResources.get("embed")+" ");var C=a.getBasenames().join(";"),D=a.getCurrentFile();mxEvent.addListener(q,"change",c);mxEvent.addListener(v,"change",c);mxEvent.addListener(A,"change",c);mxEvent.addListener(x,"change",c);mxEvent.addListener(z,"change",c);mxEvent.addListener(y,"change",c);mxEvent.addListener(B,"change",c);mxEvent.addListener(p,"change",c);mxEvent.addListener(n,"change",c);mxEvent.addListener(t,"change",c);mxEvent.addListener(u,"change",c);c();
+mxResources.get("asNew")+" ");mxUtils.br(b);var B=document.createElement("input");B.setAttribute("type","checkbox");B.setAttribute("checked","checked");B.defaultChecked=!0;B.style.marginLeft="16px";b.appendChild(B);mxUtils.write(b,mxResources.get("resize")+" ");var x=document.createElement("input");x.setAttribute("type","checkbox");x.style.marginLeft="8px";b.appendChild(x);mxUtils.write(b,mxResources.get("fit")+" ");var A=document.createElement("input");A.setAttribute("type","checkbox");A.style.marginLeft=
+"8px";b.appendChild(A);mxUtils.write(b,mxResources.get("embed")+" ");var C=a.getBasenames().join(";"),D=a.getCurrentFile();mxEvent.addListener(t,"change",c);mxEvent.addListener(v,"change",c);mxEvent.addListener(B,"change",c);mxEvent.addListener(x,"change",c);mxEvent.addListener(z,"change",c);mxEvent.addListener(y,"change",c);mxEvent.addListener(A,"change",c);mxEvent.addListener(p,"change",c);mxEvent.addListener(n,"change",c);mxEvent.addListener(q,"change",c);mxEvent.addListener(u,"change",c);c();
mxEvent.addListener(m,"click",function(){m.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?m.select():document.execCommand("selectAll",!1,null)});f=document.createElement("div");f.style.paddingTop="12px";f.style.textAlign="right";l=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});l.className="geBtn gePrimaryBtn";f.appendChild(l);b.appendChild(f);this.container=b},CreateGraphDialog=function(a,e,c){var b=document.createElement("div");b.style.textAlign=
"right";this.init=function(){var e=document.createElement("div");e.style.position="relative";e.style.border="1px solid gray";e.style.width="100%";e.style.height="360px";e.style.overflow="hidden";e.style.marginBottom="16px";mxEvent.disableContextMenu(e);b.appendChild(e);var f=new Graph(e);f.setCellsCloneable(!0);f.setPanning(!0);f.setAllowDanglingEdges(!1);f.connectionHandler.select=!1;f.view.setTranslate(20,20);f.border=20;f.panningHandler.useLeftButtonForPanning=!0;var l="curved=1;";f.cellRenderer.installCellOverlayListeners=
function(a,d,b){mxCellRenderer.prototype.installCellOverlayListeners.apply(this,arguments);mxEvent.addListener(b.node,mxClient.IS_POINTER?"pointerdown":"mousedown",function(b){d.fireEvent(new mxEventObject("pointerdown","event",b,"state",a))});!mxClient.IS_POINTER&&mxClient.IS_TOUCH&&mxEvent.addListener(b.node,"touchstart",function(b){d.fireEvent(new mxEventObject("pointerdown","event",b,"state",a))})};f.getAllConnectionConstraints=function(){return null};f.connectionHandler.marker.highlight.keepOnTop=
!1;f.connectionHandler.createEdgeState=function(a){a=f.createEdge(null,null,null,null,null,l);return new mxCellState(this.graph.view,a,this.graph.getCellStyle(a))};var d=f.getDefaultParent(),g=mxUtils.bind(this,function(a){var b=new mxCellOverlay(this.connectImage,"Add outgoing");b.cursor="hand";b.addListener(mxEvent.CLICK,function(b,c){f.connectionHandler.reset();f.clearSelection();var e=f.getCellGeometry(a),m;p(function(){m=f.insertVertex(d,null,"Entry",e.x,e.y,80,30,"rounded=1;");g(m);f.view.refresh(m);
f.insertEdge(d,null,"",a,m,l)},function(){f.scrollCellToVisible(m)})});b.addListener("pointerdown",function(a,d){var b=d.getProperty("event"),c=d.getProperty("state");f.popupMenuHandler.hideMenu();f.stopEditing(!1);var e=mxUtils.convertPoint(f.container,mxEvent.getClientX(b),mxEvent.getClientY(b));f.connectionHandler.start(c,e.x,e.y);f.isMouseDown=!0;f.isMouseTrigger=mxEvent.isMouseEvent(b);mxEvent.consume(b)});f.addCellOverlay(a,b)});f.getModel().beginUpdate();var m;try{m=f.insertVertex(d,null,"Start",
0,0,80,30,"ellipse"),g(m)}finally{f.getModel().endUpdate()}var n;"horizontalTree"==c?(n=new mxCompactTreeLayout(f),n.edgeRouting=!1,n.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=horizontal;"):"verticalTree"==c?(n=new mxCompactTreeLayout(f,!1),n.edgeRouting=!1,n.levelDistance=30,l="edgeStyle=elbowEdgeStyle;elbow=vertical;"):"radialTree"==c?(n=new mxRadialTreeLayout(f,!1),n.edgeRouting=!1,n.levelDistance=80):"verticalFlow"==c?n=new mxHierarchicalLayout(f,mxConstants.DIRECTION_NORTH):"horizontalFlow"==
-c?n=new mxHierarchicalLayout(f,mxConstants.DIRECTION_WEST):"organic"==c?(n=new mxFastOrganicLayout(f,!1),n.forceConstant=80):"circle"==c&&(n=new mxCircleLayout(f));if(null!=n){var p=function(a,d){f.getModel().beginUpdate();try{null!=a&&a(),n.execute(f.getDefaultParent(),m)}catch(A){throw A;}finally{var b=new mxMorphing(f);b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){f.getModel().endUpdate();null!=d&&d()}));b.startAnimation()}},u=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=
-function(a,d,b,c,e){u.apply(this,arguments);p()};f.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);p()};f.connectionHandler.addListener(mxEvent.CONNECT,function(){p()})}var t=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=e.parentNode&&(f.destroy(),e.parentNode.removeChild(e));a.hideDialog()})});t.className="geBtn";a.editor.cancelFirst&&b.appendChild(t);var q=mxUtils.button(mxResources.get("insert"),function(){f.clearCellOverlays();
-var d=a.editor.graph.getFreeInsertPoint(),d=a.editor.graph.importCells(f.getModel().getChildren(f.getDefaultParent()),d.x,d.y),b=a.editor.graph.view,c=b.getBounds(d);c.x-=b.translate.x;c.y-=b.translate.y;a.editor.graph.scrollRectToVisible(c);a.editor.graph.setSelectionCells(d);null!=e.parentNode&&(f.destroy(),e.parentNode.removeChild(e));a.hideDialog()});b.appendChild(q);q.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(t)};this.container=b};
+c?n=new mxHierarchicalLayout(f,mxConstants.DIRECTION_WEST):"organic"==c?(n=new mxFastOrganicLayout(f,!1),n.forceConstant=80):"circle"==c&&(n=new mxCircleLayout(f));if(null!=n){var p=function(a,d){f.getModel().beginUpdate();try{null!=a&&a(),n.execute(f.getDefaultParent(),m)}catch(B){throw B;}finally{var b=new mxMorphing(f);b.addListener(mxEvent.DONE,mxUtils.bind(this,function(){f.getModel().endUpdate();null!=d&&d()}));b.startAnimation()}},u=mxEdgeHandler.prototype.connect;mxEdgeHandler.prototype.connect=
+function(a,d,b,c,e){u.apply(this,arguments);p()};f.resizeCell=function(){mxGraph.prototype.resizeCell.apply(this,arguments);p()};f.connectionHandler.addListener(mxEvent.CONNECT,function(){p()})}var q=mxUtils.button(mxResources.get("close"),function(){a.confirm(mxResources.get("areYouSure"),function(){null!=e.parentNode&&(f.destroy(),e.parentNode.removeChild(e));a.hideDialog()})});q.className="geBtn";a.editor.cancelFirst&&b.appendChild(q);var t=mxUtils.button(mxResources.get("insert"),function(){f.clearCellOverlays();
+var d=a.editor.graph.getFreeInsertPoint(),d=a.editor.graph.importCells(f.getModel().getChildren(f.getDefaultParent()),d.x,d.y),b=a.editor.graph.view,c=b.getBounds(d);c.x-=b.translate.x;c.y-=b.translate.y;a.editor.graph.scrollRectToVisible(c);a.editor.graph.setSelectionCells(d);null!=e.parentNode&&(f.destroy(),e.parentNode.removeChild(e));a.hideDialog()});b.appendChild(t);t.className="geBtn gePrimaryBtn";a.editor.cancelFirst||b.appendChild(q)};this.container=b};
CreateGraphDialog.prototype.connectImage=new mxImage(mxClient.IS_SVG?"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBNYWNpbnRvc2giIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjQ3OTk0QjMyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjQ3OTk0QjQyRDcyMTFFNThGQThGNDVBMjNBMjFDMzkiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoyRjA0N0I2MjJENzExMUU1OEZBOEY0NUEyM0EyMUMzOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpGNDc5OTRCMjJENzIxMUU1OEZBOEY0NUEyM0EyMUMzOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PjIf+MgAAATlSURBVHjanFZraFxFFD735u4ru3ls0yZG26ShgmJoKK1J2vhIYzBgRdtIURHyw1hQUH9IxIgI2h8iCEUF/1RRlNQYCsYfCTHVhiTtNolpZCEStqSC22xIsrs1bDfu7t37Gs/cO3Ozxs1DBw73zpk555vzmHNGgJ0NYatFgmNLYUHYUoHASMz5ijmgVLmxgfKCUiBxC4ACJAeSG8nb1dVVOTc3dyoSibwWDofPBIPBJzo7O8vpGtvjpDICGztxkciECpF2LS0tvZtOpwNkk5FKpcYXFxffwL1+JuPgllPj8nk1F6RoaGjoKCqZ5ApljZDZO4SMRA0SuG2QUJIQRV8HxMOM9vf3H0ZZH9Nhg20MMl2QkFwjIyNHWlpahtADnuUMwLcRHX5aNSBjCJYEsSSLUeLEbhGe3ytCmQtA1/XY+Pj46dbW1iDuyCJp9BC5ycBj4hoeHq5ra2sbw0Xn1ZgBZ+dVkA1Lc+6p0Ck2p0QS4Ox9EhwpEylYcmBg4LH29vYQLilIOt0u5FhDfevNZDI/u93uw6PLOrwTUtjxrbPYbhD42WgMrF8JmR894ICmCgnQjVe8Xu8pXEkzMJKbuo5oNPomBbm1ZsD7s2kwFA1JZ6QBUXWT1nmGNc/qoMgavDcrQzxjQGFh4aOYIJ0sFAXcEtui4uLiVjr5KpSBVFYDDZVrWUaKRRWSAYeK0fmKykgDXbVoNaPChRuyqdDv97czL5nXxQbq6empQmsaklkDBiNpSwFVrmr2P6UyicD5piI4f8wHh0oEm8/p4h8pyGiEWvVQd3e3nxtjAzU1NR2jP7NRBWQ8GbdEzzJAmc0V3RR4cI8Dvmwuhc8fKUFA0d6/ltHg5p+Kuaejo6OeY0jcNJ/PV00ZS0nFUoZRvvFS1bZFsKHCCQ2Pl8H0chY+C96B6ZUsrCQ1qKtwQVFRURW/QhIXMAzDPAZ6BgOr8tTa8dDxCmiYGApaJbJMxSzV+brE8pdgWkcpY5dbMF1AR9XH8/xu2ilef48bvn92n82ZwHh+8ssqTEXS9p7dHisiiURikd8PbpExNTU1UVNTA3V3Y7lC16n0gpB/NwpNcZjfa7dScC4Qh0kOQCwnlEgi3F/hMVl9fX0zvKrzSk2lfXjRhj0eT/2rvWG4+Pta3oJY7XfC3hInXAv/ldeFLx8shQ+eqQL0UAAz7ylkpej5eNZRVBWL6BU6ef14OYiY1oqyTtmsavr/5koaRucT1pzx+ZpL1+GV5nLutksUgIcmtwTRiuuVZXnU5XId7A2swJkfFsymRWC91hHg1Viw6x23+7vn9sPJ+j20BE1hCXqSWaNSQ8ScbknRZWxub1PGCw/fBV+c3AeijlUbY5bBjEqr9GuYZP4jP41WudGSC6erTRCqdGZm5i1WvXWeDHnbBCZGc2Nj4wBl/hZOwrmBBfgmlID1HmGJutHaF+tKoevp/XCgstDkjo2NtWKLuc6AVN4mNjY+s1XQxoenOoFuDPHGtnRbJj9ej5GvL0dI7+giuRyMk1giazc+DP6vgUDgOJVlOv7R+PJ12QIeL6SyeDz+Kfp8ZrNWjgDTsVjsQ7qXyTjztXJhm9ePxFLfMTg4eG9tbe1RTP9KFFYQfHliYmIS69kCC7jKYmKwxxD5P88tkVkqbPPcIps9t4T/+HjcuJ/s5BFJgf4WYABCtxGuxIZ90gAAAABJRU5ErkJggg==":
IMAGE_PATH+"/handle-connect.png",26,26);
var BackgroundImageDialog=function(a,e){var c=document.createElement("div");c.style.whiteSpace="nowrap";var b=document.createElement("h2");mxUtils.write(b,mxResources.get("backgroundImage"));b.style.marginTop="0px";c.appendChild(b);mxUtils.write(c,mxResources.get("image")+" "+mxResources.get("url")+":");mxUtils.br(c);var b=a.editor.graph.backgroundImage,k=document.createElement("input");k.setAttribute("type","text");k.style.marginTop="4px";k.style.marginBottom="4px";k.style.width="350px";k.value=
@@ -8636,12 +8636,12 @@ m.className="geBtn";a.editor.cancelFirst&&b.appendChild(m);var n=mxUtils.button(
a.editor.graph,g="plantUmlTxt"==b?"txt":"plantUmlPng"==b?"png":"svg";a.generatePlantUmlImage(d,g,function(b,c,m){a.spinner.stop();var n=null;e.getModel().beginUpdate();try{n="txt"==g?a.insertAsPreText(b,f.x,f.y):e.insertVertex(null,null,null,f.x,f.y,c,m,"shape=image;noLabel=1;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a.convertDataUri(b)+";"),e.setAttributeForCell(n,"plantUmlData",JSON.stringify({data:d,format:g},null,2))}finally{e.getModel().endUpdate()}null!=n&&(e.setSelectionCell(n),
e.scrollCellToVisible(n))},function(d){a.handleError(d)})}}else if("mermaid"==b)a.spinner.spin(document.body,mxResources.get("inserting"))&&(e=a.editor.graph,a.generateMermaidImage(d,g,function(b,c,g){a.spinner.stop();var m=null;e.getModel().beginUpdate();try{m=e.insertVertex(null,null,null,f.x,f.y,c,g,"shape=image;noLabel=1;verticalAlign=top;imageAspect=1;image="+b+";"),e.setAttributeForCell(m,"mermaidData",JSON.stringify({data:d,config:EditorUi.defaultMermaidConfig},null,2))}finally{e.getModel().endUpdate()}null!=
m&&(e.setSelectionCell(m),e.scrollCellToVisible(m))},function(d){a.handleError(d)}));else if("table"==b){for(var m=null,n=[],k=0,p=0;p<c.length;p++){var l=mxUtils.trim(c[p]);if("create table"==l.substring(0,12).toLowerCase())l=mxUtils.trim(l.substring(12)),"("==l.charAt(l.length-1)&&(l=l.substring(0,l.lastIndexOf(" "))),m=new mxCell(l,new mxGeometry(k,0,160,26),"swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;align=center;"),
-m.vertex=!0,n.push(m),l=a.editor.graph.getPreferredSizeForCell(t),null!=l&&(m.geometry.width=l.width+10);else if(null!=m&&")"==l.charAt(0))k+=m.geometry.width+40,m=null;else if("("!=l&&null!=m&&(l=l.substring(0,","==l.charAt(l.length-1)?l.length-1:l.length),"primary key"!=l.substring(0,11).toLowerCase())){var u=l.toLowerCase().indexOf("primary key"),l=l.replace(/primary key/i,""),t=new mxCell(l,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;");
-t.vertex=!0;l=sb.cloneCell(t,0<u?"PK":"");l.connectable=!1;l.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";l.geometry.width=30;l.geometry.height=26;t.insert(l);l=a.editor.graph.getPreferredSizeForCell(t);null!=l&&m.geometry.width<l.width+10&&(m.geometry.width=Math.min(220,l.width+10));m.insert(t);m.geometry.height+=26}}0<n.length&&(e=a.editor.graph,
-p=e.view,c=e.getGraphBounds(),e.setSelectionCells(e.importCells(n,Math.ceil(Math.max(0,c.x/p.scale-p.translate.x)+4*e.gridSize),Math.ceil(Math.max(0,(c.y+c.height)/p.scale-p.translate.y)+4*e.gridSize))),e.scrollCellToVisible(e.getSelectionCell()))}else if("list"==b){if(0<c.length){e=a.editor.graph;t=null;n=[];for(p=m=0;p<c.length;p++)";"!=c[p].charAt(0)&&(0==c[p].length?t=null:null==t?(t=new mxCell(c[p],new mxGeometry(m,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),
-t.vertex=!0,n.push(t),l=e.getPreferredSizeForCell(t),null!=l&&t.geometry.width<l.width+10&&(t.geometry.width=l.width+10),m+=t.geometry.width+40):"--"==c[p]?(l=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),l.vertex=!0,t.geometry.height+=l.geometry.height,t.insert(l)):0<c[p].length&&(k=new mxCell(c[p],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),
-k.vertex=!0,l=e.getPreferredSizeForCell(k),null!=l&&k.geometry.width<l.width&&(k.geometry.width=l.width),t.geometry.width=Math.max(t.geometry.width,k.geometry.width),t.geometry.height+=k.geometry.height,t.insert(k)));if(0<n.length){e.getModel().beginUpdate();try{n=e.importCells(n,f.x,f.y);l=[];for(p=0;p<n.length;p++)l.push(n[p]),l=l.concat(n[p].children);e.fireEvent(new mxEventObject("cellsInserted","cells",l))}finally{e.getModel().endUpdate()}e.setSelectionCells(n);e.scrollCellToVisible(e.getSelectionCell())}}}else{for(var t=
-function(a){var d=G[a];null==d&&(d=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),d.vertex=!0,G[a]=d,n.push(d));return d},G={},n=[],p=0;p<c.length;p++)if(";"!=c[p].charAt(0)){var E=c[p].split("->");if(2<=E.length){var u=t(E[0]),J=t(E[E.length-1]),E=new mxCell(2<E.length?E[1]:"",new mxGeometry);E.edge=!0;u.insertEdge(E,!0);J.insertEdge(E,!1);n.push(E)}}if(0<n.length){c=document.createElement("div");c.style.visibility="hidden";document.body.appendChild(c);e=new Graph(c);e.getModel().beginUpdate();
+m.vertex=!0,n.push(m),l=a.editor.graph.getPreferredSizeForCell(q),null!=l&&(m.geometry.width=l.width+10);else if(null!=m&&")"==l.charAt(0))k+=m.geometry.width+40,m=null;else if("("!=l&&null!=m&&(l=l.substring(0,","==l.charAt(l.length-1)?l.length-1:l.length),"primary key"!=l.substring(0,11).toLowerCase())){var u=l.toLowerCase().indexOf("primary key"),l=l.replace(/primary key/i,""),q=new mxCell(l,new mxGeometry(0,0,90,26),"shape=partialRectangle;top=0;left=0;right=0;bottom=0;align=left;verticalAlign=top;spacingTop=-2;fillColor=none;spacingLeft=34;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;dropTarget=0;");
+q.vertex=!0;l=sb.cloneCell(q,0<u?"PK":"");l.connectable=!1;l.style="shape=partialRectangle;top=0;left=0;bottom=0;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[];portConstraint=eastwest;part=1;";l.geometry.width=30;l.geometry.height=26;q.insert(l);l=a.editor.graph.getPreferredSizeForCell(q);null!=l&&m.geometry.width<l.width+10&&(m.geometry.width=Math.min(220,l.width+10));m.insert(q);m.geometry.height+=26}}0<n.length&&(e=a.editor.graph,
+p=e.view,c=e.getGraphBounds(),e.setSelectionCells(e.importCells(n,Math.ceil(Math.max(0,c.x/p.scale-p.translate.x)+4*e.gridSize),Math.ceil(Math.max(0,(c.y+c.height)/p.scale-p.translate.y)+4*e.gridSize))),e.scrollCellToVisible(e.getSelectionCell()))}else if("list"==b){if(0<c.length){e=a.editor.graph;q=null;n=[];for(p=m=0;p<c.length;p++)";"!=c[p].charAt(0)&&(0==c[p].length?q=null:null==q?(q=new mxCell(c[p],new mxGeometry(m,0,160,30),"swimlane;fontStyle=1;childLayout=stackLayout;horizontal=1;startSize=26;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;"),
+q.vertex=!0,n.push(q),l=e.getPreferredSizeForCell(q),null!=l&&q.geometry.width<l.width+10&&(q.geometry.width=l.width+10),m+=q.geometry.width+40):"--"==c[p]?(l=new mxCell("",new mxGeometry(0,0,40,8),"line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;"),l.vertex=!0,q.geometry.height+=l.geometry.height,q.insert(l)):0<c[p].length&&(k=new mxCell(c[p],new mxGeometry(0,0,60,26),"text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;"),
+k.vertex=!0,l=e.getPreferredSizeForCell(k),null!=l&&k.geometry.width<l.width&&(k.geometry.width=l.width),q.geometry.width=Math.max(q.geometry.width,k.geometry.width),q.geometry.height+=k.geometry.height,q.insert(k)));if(0<n.length){e.getModel().beginUpdate();try{n=e.importCells(n,f.x,f.y);l=[];for(p=0;p<n.length;p++)l.push(n[p]),l=l.concat(n[p].children);e.fireEvent(new mxEventObject("cellsInserted","cells",l))}finally{e.getModel().endUpdate()}e.setSelectionCells(n);e.scrollCellToVisible(e.getSelectionCell())}}}else{for(var q=
+function(a){var d=H[a];null==d&&(d=new mxCell(a,new mxGeometry(0,0,80,30),"whiteSpace=wrap;html=1;"),d.vertex=!0,H[a]=d,n.push(d));return d},H={},n=[],p=0;p<c.length;p++)if(";"!=c[p].charAt(0)){var F=c[p].split("->");if(2<=F.length){var u=q(F[0]),J=q(F[F.length-1]),F=new mxCell(2<F.length?F[1]:"",new mxGeometry);F.edge=!0;u.insertEdge(F,!0);J.insertEdge(F,!1);n.push(F)}}if(0<n.length){c=document.createElement("div");c.style.visibility="hidden";document.body.appendChild(c);e=new Graph(c);e.getModel().beginUpdate();
try{n=e.importCells(n);for(p=0;p<n.length;p++)e.getModel().isVertex(n[p])&&(l=e.getPreferredSizeForCell(n[p]),n[p].geometry.width=Math.max(n[p].geometry.width,l.width),n[p].geometry.height=Math.max(n[p].geometry.height,l.height));m=new mxFastOrganicLayout(e);m.disableEdgeStyle=!1;m.forceConstant=120;m.execute(e.getDefaultParent());k=new mxParallelEdgeLayout(e);k.spacing=20;k.execute(e.getDefaultParent())}finally{e.getModel().endUpdate()}e.clearCellOverlays();l=[];a.editor.graph.getModel().beginUpdate();
try{l=a.editor.graph.importCells(e.getModel().getChildren(e.getDefaultParent()),f.x,f.y),a.editor.graph.fireEvent(new mxEventObject("cellsInserted","cells",l))}finally{a.editor.graph.getModel().endUpdate()}a.editor.graph.setSelectionCells(l);a.editor.graph.scrollCellToVisible(a.editor.graph.getSelectionCell());e.destroy();c.parentNode.removeChild(c)}}}function k(){return"list"==d.value?"Person\n-name: String\n-birthDate: Date\n--\n+getName(): String\n+setName(String): void\n+isBirthday(): boolean\n\nAddress\n-street: String\n-city: String\n-state: String":
"mermaid"==d.value?"graph TD;\n A--\x3eB;\n A--\x3eC;\n B--\x3eD;\n C--\x3eD;":"table"==d.value?"CREATE TABLE Suppliers\n(\nsupplier_id int NOT NULL PRIMARY KEY,\nsupplier_name char(50) NOT NULL,\ncontact_name char(50),\n);\nCREATE TABLE Customers\n(\ncustomer_id int NOT NULL PRIMARY KEY,\ncustomer_name char(50) NOT NULL,\naddress char(50),\ncity char(50),\nstate char(25),\nzip_code char(10)\n);\n":"plantUmlPng"==d.value?"@startuml\nskinparam backgroundcolor transparent\nskinparam shadowing false\nAlice -> Bob: Authentication Request\nBob --\x3e Alice: Authentication Response\n\nAlice -> Bob: Another authentication Request\nAlice <-- Bob: Another authentication Response\n@enduml":
@@ -8651,44 +8651,44 @@ try{l=a.editor.graph.importCells(e.getModel().getChildren(e.getDefaultParent()),
c&&g.setAttribute("selected","selected");var m=document.createElement("option");m.setAttribute("value","plantUmlPng");mxUtils.write(m,mxResources.get("plantUml")+" ("+mxResources.get("formatPng")+")");var n=document.createElement("option");n.setAttribute("value","plantUmlTxt");mxUtils.write(n,mxResources.get("plantUml")+" ("+mxResources.get("text")+")");EditorUi.enablePlantUml&&Graph.fileSupport&&!a.isOffline()&&"plantUml"==c&&(d.appendChild(g),d.appendChild(m),d.appendChild(n));var p=k();l.value=
p;e.appendChild(l);this.init=function(){l.focus()};Graph.fileSupport&&(l.addEventListener("dragover",function(a){a.stopPropagation();a.preventDefault()},!1),l.addEventListener("drop",function(a){a.stopPropagation();a.preventDefault();if(0<a.dataTransfer.files.length){a=a.dataTransfer.files[0];var d=new FileReader;d.onload=function(a){l.value=a.target.result};d.readAsText(a)}},!1));e.appendChild(d);mxEvent.addListener(d,"change",function(){var a=k();if(0==l.value.length||l.value==p)p=a,l.value=p});
a.isOffline()||"mermaid"!=c&&"plantUml"!=c||(g=mxUtils.button(mxResources.get("help"),function(){a.openLink("mermaid"==c?"https://mermaid-js.github.io/mermaid/#/":"https://plantuml.com/")}),g.className="geBtn",e.appendChild(g));g=mxUtils.button(mxResources.get("close"),function(){l.value==p?a.hideDialog():a.confirm(mxResources.get("areYouSure"),function(){a.hideDialog()})});g.className="geBtn";a.editor.cancelFirst&&e.appendChild(g);m=mxUtils.button(mxResources.get("insert"),function(){a.hideDialog();
-b(l.value,d.value)});e.appendChild(m);m.className="geBtn gePrimaryBtn";a.editor.cancelFirst||e.appendChild(g);this.container=e},NewDialog=function(a,e,c,b,k,f,l,d,g,m,n,p,u,t,q,v,z){function y(){var a=!0;if(null!=O)for(;J<O.length&&(a||0!=mxUtils.mod(J,30));){var d=O[J++],d=B(d.url,d.libs,d.title,d.tooltip?d.tooltip:d.title,d.select,d.imgUrl,d.info,d.onClick,d.preview,d.noImg,d.clibs);a&&d.click();a=!1}}function A(){if(Z)c||a.hideDialog(),t(Z,aa,E.value);else if(b)c||a.hideDialog(),b(V,E.value);else{var d=
-E.value;null!=d&&0<d.length&&a.pickFolder(a.mode,function(b){a.createFile(d,V,null!=W&&0<W.length?W:null,null,function(){a.hideDialog()},null,b,null,null!=S&&0<S.length?S:null)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function x(a,b,c,e,m,f){null!=X&&(X.style.backgroundColor="transparent",X.style.border="1px solid transparent");H.removeAttribute("disabled");V=b;W=c;S=f;X=a;Z=e;aa=m;X.style.backgroundColor=d;X.style.border=g}function B(d,b,c,e,g,m,f,n,p,k,l){var u=document.createElement("div");
-u.className="geTemplate";u.style.height=N+"px";u.style.width=ga+"px";null!=c?u.setAttribute("title",mxResources.get(c,null,c)):null!=e&&0<e.length&&u.setAttribute("title",e);if(null!=m)u.style.backgroundImage="url("+m+")",u.style.backgroundSize="contain",u.style.backgroundPosition="center center",u.style.backgroundRepeat="no-repeat",mxEvent.addListener(u,"click",function(a){x(u,null,null,d,f,l)}),mxEvent.addListener(u,"dblclick",function(a){A()});else if(!k&&null!=d&&0<d.length){e=p||TEMPLATE_PATH+
-"/"+d.substring(0,d.length-4)+".png";u.style.backgroundImage="url("+e+")";u.style.backgroundPosition="center center";u.style.backgroundRepeat="no-repeat";null!=c&&(u.innerHTML='<table width="100%" height="100%" style="line-height:1.3em;'+("dark"==uiTheme?"":"background:rgba(255,255,255,0.85);")+'border:inherit;"><tr><td align="center" valign="middle"><span style="display:inline-block;padding:4px 8px 4px 8px;user-select:none;border-radius:3px;background:rgba(255,255,255,0.85);overflow:hidden;text-overflow:ellipsis;max-width:'+
-(N-34)+'px;">'+mxResources.get(c,null,c)+"</span></td></tr></table>");var v=!1;mxEvent.addListener(u,"click",function(c){H.setAttribute("disabled","disabled");u.style.backgroundColor="transparent";u.style.border="1px solid transparent";c=d;c=/^https?:\/\//.test(c)&&!a.editor.isCorsEnabledForUrl(c)?PROXY_URL+"?url="+encodeURIComponent(c):TEMPLATE_PATH+"/"+c;K.spin(P);mxUtils.get(c,mxUtils.bind(this,function(a){K.stop();200<=a.getStatus()&&299>=a.getStatus()&&(x(u,a.getText(),b,null,null,l),v&&A())}))});
+b(l.value,d.value)});e.appendChild(m);m.className="geBtn gePrimaryBtn";a.editor.cancelFirst||e.appendChild(g);this.container=e},NewDialog=function(a,e,c,b,k,f,l,d,g,m,n,p,u,q,t,v,z){function y(){var a=!0;if(null!=O)for(;J<O.length&&(a||0!=mxUtils.mod(J,30));){var d=O[J++],d=A(d.url,d.libs,d.title,d.tooltip?d.tooltip:d.title,d.select,d.imgUrl,d.info,d.onClick,d.preview,d.noImg,d.clibs);a&&d.click();a=!1}}function B(){if(fa)c||a.hideDialog(),q(fa,Y,F.value);else if(b)c||a.hideDialog(),b(S,F.value);
+else{var d=F.value;null!=d&&0<d.length&&a.pickFolder(a.mode,function(b){a.createFile(d,S,null!=X&&0<X.length?X:null,null,function(){a.hideDialog()},null,b,null,null!=U&&0<U.length?U:null)},a.mode!=App.MODE_GOOGLE||null==a.stateArg||null==a.stateArg.folderId)}}function x(a,b,c,e,m,f){null!=W&&(W.style.backgroundColor="transparent",W.style.border="1px solid transparent");G.removeAttribute("disabled");S=b;X=c;U=f;W=a;fa=e;Y=m;W.style.backgroundColor=d;W.style.border=g}function A(d,b,c,e,g,m,f,n,p,k,
+l){var u=document.createElement("div");u.className="geTemplate";u.style.height=N+"px";u.style.width=ga+"px";null!=c?u.setAttribute("title",mxResources.get(c,null,c)):null!=e&&0<e.length&&u.setAttribute("title",e);if(null!=m)u.style.backgroundImage="url("+m+")",u.style.backgroundSize="contain",u.style.backgroundPosition="center center",u.style.backgroundRepeat="no-repeat",mxEvent.addListener(u,"click",function(a){x(u,null,null,d,f,l)}),mxEvent.addListener(u,"dblclick",function(a){B()});else if(!k&&
+null!=d&&0<d.length){e=p||TEMPLATE_PATH+"/"+d.substring(0,d.length-4)+".png";u.style.backgroundImage="url("+e+")";u.style.backgroundPosition="center center";u.style.backgroundRepeat="no-repeat";null!=c&&(u.innerHTML='<table width="100%" height="100%" style="line-height:1.3em;'+("dark"==uiTheme?"":"background:rgba(255,255,255,0.85);")+'border:inherit;"><tr><td align="center" valign="middle"><span style="display:inline-block;padding:4px 8px 4px 8px;user-select:none;border-radius:3px;background:rgba(255,255,255,0.85);overflow:hidden;text-overflow:ellipsis;max-width:'+
+(N-34)+'px;">'+mxResources.get(c,null,c)+"</span></td></tr></table>");var v=!1;mxEvent.addListener(u,"click",function(c){G.setAttribute("disabled","disabled");u.style.backgroundColor="transparent";u.style.border="1px solid transparent";c=d;c=/^https?:\/\//.test(c)&&!a.editor.isCorsEnabledForUrl(c)?PROXY_URL+"?url="+encodeURIComponent(c):TEMPLATE_PATH+"/"+c;K.spin(P);mxUtils.get(c,mxUtils.bind(this,function(a){K.stop();200<=a.getStatus()&&299>=a.getStatus()&&(x(u,a.getText(),b,null,null,l),v&&B())}))});
mxEvent.addListener(u,"dblclick",function(a){v=!0})}else u.innerHTML='<table width="100%" height="100%" style="line-height:1.3em;"><tr><td align="center" valign="middle"><span style="display:inline-block;padding:4px 8px 4px 8px;user-select:none;border-radius:3px;background:#ffffff;overflow:hidden;text-overflow:ellipsis;max-width:'+(N-34)+'px;">'+mxResources.get(c,null,c)+"</span></td></tr></table>",g&&x(u),null!=n?mxEvent.addListener(u,"click",n):(mxEvent.addListener(u,"click",function(a){x(u,null,
-null,d,f)}),mxEvent.addListener(u,"dblclick",function(a){A()}));P.appendChild(u);return u}function C(){ta&&(ta=!1,mxEvent.addListener(P,"scroll",function(a){P.scrollTop+P.clientHeight>=P.scrollHeight&&(y(),mxEvent.consume(a))}));var a=null;if(0<da){var d=document.createElement("div");d.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(d,mxResources.get("custom"));Q.appendChild(d);for(var b in Y){var c=document.createElement("div"),d=b,e=Y[b];
-18<d.length&&(d=d.substring(0,18)+"&hellip;");c.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";c.setAttribute("title",d+" ("+e.length+")");mxUtils.write(c,c.getAttribute("title"));null!=m&&(c.style.padding=m);Q.appendChild(c);(function(d,b){mxEvent.addListener(c,"click",function(){a!=b&&(a.style.backgroundColor="",a=b,a.style.backgroundColor=l,P.scrollTop=0,P.innerHTML="",J=0,O=Y[d],M=null,y())})})(b,
+null,d,f)}),mxEvent.addListener(u,"dblclick",function(a){B()}));P.appendChild(u);return u}function C(){ta&&(ta=!1,mxEvent.addListener(P,"scroll",function(a){P.scrollTop+P.clientHeight>=P.scrollHeight&&(y(),mxEvent.consume(a))}));var a=null;if(0<ca){var d=document.createElement("div");d.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(d,mxResources.get("custom"));Q.appendChild(d);for(var b in Z){var c=document.createElement("div"),d=b,e=Z[b];
+18<d.length&&(d=d.substring(0,18)+"&hellip;");c.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;";c.setAttribute("title",d+" ("+e.length+")");mxUtils.write(c,c.getAttribute("title"));null!=m&&(c.style.padding=m);Q.appendChild(c);(function(d,b){mxEvent.addListener(c,"click",function(){a!=b&&(a.style.backgroundColor="",a=b,a.style.backgroundColor=l,P.scrollTop=0,P.innerHTML="",J=0,O=Z[d],M=null,y())})})(b,
c)}d=document.createElement("div");d.style.cssText="font-weight: bold;background: #f9f9f9;padding: 5px 0 5px 0;text-align: center;";mxUtils.write(d,"draw.io");Q.appendChild(d)}for(b in R)c=document.createElement("div"),d=mxResources.get(b),e=R[b],null==d&&(d=b.substring(0,1).toUpperCase()+b.substring(1)),18<d.length&&(d=d.substring(0,18)+"&hellip;"),c.style.cssText="display:block;cursor:pointer;padding:6px;white-space:nowrap;margin-bottom:-1px;overflow:hidden;text-overflow:ellipsis;user-select:none;",
c.setAttribute("title",d+" ("+e.length+")"),mxUtils.write(c,c.getAttribute("title")),null!=m&&(c.style.padding=m),Q.appendChild(c),null==a&&0<e.length&&(a=c,a.style.backgroundColor=l,O=e),function(d,b){mxEvent.addListener(c,"click",function(){a!=b&&(a.style.backgroundColor="",a=b,a.style.backgroundColor=l,P.scrollTop=0,P.innerHTML="",J=0,O=R[d],M=null,y())})}(b,c);y()}c=null!=c?c:!0;k=null!=k?k:!1;l=null!=l?l:"#ebf2f9";d=null!=d?d:"dark"==uiTheme?"transparent":"#e6eff8";g=null!=g?g:"dark"==uiTheme?
-"1px dotted rgb(235, 242, 249)":"1px solid #ccd9ea";n=null!=n?n:EditorUi.templateFile;var D=document.createElement("div");D.style.height="100%";var F=document.createElement("div");F.style.whiteSpace="nowrap";F.style.height="46px";c&&D.appendChild(F);var G=document.createElement("img");G.setAttribute("border","0");G.setAttribute("align","absmiddle");G.style.width="40px";G.style.height="40px";G.style.marginRight="10px";G.style.paddingBottom="4px";G.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":
-a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!e&&c&&F.appendChild(G);c&&mxUtils.write(F,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):
-mxResources.get("filename"))+":");G=".drawio";a.mode==App.MODE_GOOGLE&&null!=a.drive?G=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?G=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?G=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?G=a.gitHub.extension:a.mode==App.MODE_GITLAB&&null!=a.gitLab?G=a.gitLab.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(G=a.trello.extension);var E=document.createElement("input");E.setAttribute("value",a.defaultFilename+
-G);E.style.marginLeft="10px";E.style.width=e?"144px":"284px";this.init=function(){c&&(E.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?E.select():document.execCommand("selectAll",!1,null))};c&&(F.appendChild(E),null!=a.editor.diagramFileTypes&&(G=FilenameDialog.createFileTypes(a,E,a.editor.diagramFileTypes),G.style.marginLeft="6px",G.style.width=e?"80px":"140px",F.appendChild(G)),null!=a.editor.fileExtensions&&(G=FilenameDialog.createTypeHint(a,E,a.editor.fileExtensions),
-G.style.marginTop="12px",F.appendChild(G)));var F=!1,J=0,K=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),H=mxUtils.button(v||mxResources.get("create"),function(){H.setAttribute("disabled","disabled");A();H.removeAttribute("disabled")});H.className="geBtn gePrimaryBtn";if(p||u){var L=[],M=null,I=null,U=null,T=function(a){H.setAttribute("disabled","disabled");for(var d=0;d<L.length;d++)L[d].className=d==a?"geBtn gePrimaryBtn":
-"geBtn"},F=!0;v=document.createElement("div");v.style.whiteSpace="nowrap";v.style.height="30px";D.appendChild(v);G=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Q.style.display="";P.style.left="160px";T(0);P.scrollTop=0;P.innerHTML="";J=0;M!=O&&(O=M,R=I,da=U,Q.innerHTML="",C(),M=null)});L.push(G);v.appendChild(G);var ca=function(a){Q.style.display="none";P.style.left="30px";T(a?-1:1);null==M&&(M=O);P.scrollTop=0;P.innerHTML="";K.spin(P);var d=function(a,d,b){J=0;K.stop();
-O=a;b=b||{};var c=0,e;for(e in b)c+=b[e].length;if(d)P.innerHTML=d;else if(0==a.length&&0==c)P.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found"));else if(P.innerHTML="",0<c){Q.style.display="";P.style.left="160px";Q.innerHTML="";da=0;R={"draw.io":a};for(e in b)R[e]=b[e];C()}else y()};a?u(ba.value,d):p(d)};p&&(G=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){ca()}),v.appendChild(G),L.push(G));if(u){G=document.createElement("span");G.style.marginLeft=
-"10px";G.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");v.appendChild(G);var ba=document.createElement("input");ba.style.marginRight="10px";ba.style.marginLeft="10px";ba.style.width="220px";mxEvent.addListener(ba,"keypress",function(a){13==a.keyCode&&ca(!0)});v.appendChild(ba);G=mxUtils.button(mxResources.get("search"),function(){ca(!0)});G.className="geBtn";v.appendChild(G)}T(0)}var W=null,S=null,V=null,X=null,Z=null,aa=null,P=document.createElement("div");P.style.border="1px solid #d3d3d3";
-P.style.position="absolute";P.style.left="160px";P.style.right="34px";v=(c?72:40)+(F?30:0);P.style.top=v+"px";P.style.bottom="68px";P.style.margin="6px 0 0 -1px";P.style.padding="6px";P.style.overflow="auto";var Q=document.createElement("div");Q.style.cssText="position:absolute;left:30px;width:128px;top:"+v+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var N=140,ga=140,R={},Y={},da=0,ta=!0;R.basic=[{title:"blankDiagram",select:!0}];var O=R.basic;if(!e){var ha=function(){mxUtils.get(ea,
-function(a){if(!fa){fa=!0;a=a.getXml().documentElement.firstChild;for(var d={};null!=a;){if("undefined"!==typeof a.getAttribute)if("clibs"==a.nodeName){for(var b=a.getAttribute("name"),c=a.getElementsByTagName("add"),e=[],g=0;g<c.length;g++)e.push(encodeURIComponent(mxUtils.getTextContent(c[g])));null!=b&&0<e.length&&(d[b]=e.join(";"))}else b=a.getAttribute("url"),null!=b&&(c=a.getAttribute("section"),null==c&&(c=b.indexOf("/"),c=b.substring(0,c)),b=R[c],null==b&&(b=[],R[c]=b),c=a.getAttribute("clibs"),
-null!=d[c]&&(c=d[c]),b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview"),clibs:c}));a=a.nextSibling}K.stop();C()}})};D.appendChild(Q);D.appendChild(P);var fa=!1,ea=n;/^https?:\/\//.test(ea)&&!a.editor.isCorsEnabledForUrl(ea)&&(ea=PROXY_URL+"?url="+encodeURIComponent(ea));K.spin(P);null!=z?z(function(a,d){Y=a;U=da=d;ha()},ha):ha();I=R}mxEvent.addListener(E,"keypress",function(d){a.dialog.container.firstChild==
-D&&13==d.keyCode&&A()});n=document.createElement("div");n.style.marginTop=e?"4px":"16px";n.style.textAlign="right";n.style.position="absolute";n.style.left="40px";n.style.bottom="24px";n.style.right="40px";e||a.isOffline()||!c||null!=b||k||(z=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),z.className="geBtn",n.appendChild(z));z=mxUtils.button(mxResources.get("cancel"),function(){null!=f&&f();a.hideDialog(!0)});z.className=
-"geBtn";!a.editor.cancelFirst||k&&null==f||n.appendChild(z);e||"1"==urlParams.embed||k||(e=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var d=new FilenameDialog(a,"",mxResources.get("create"),function(d){null!=d&&0<d.length&&(d=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(E.value)+"&create="+encodeURIComponent(d)),null==a.getCurrentFile()?window.location.href=d:window.openWindow(d))},mxResources.get("url"));a.showDialog(d.container,300,80,!0,!0);d.init()}),
-e.className="geBtn",n.appendChild(e));Graph.fileSupport&&q&&(q=mxUtils.button(mxResources.get("import"),function(){if(null==a.newDlgFileInputElt){var d=document.createElement("input");d.setAttribute("multiple","multiple");d.setAttribute("type","file");mxEvent.addListener(d,"change",function(b){a.openFiles(d.files,!0);d.value=""});d.style.display="none";document.body.appendChild(d);a.newDlgFileInputElt=d}a.newDlgFileInputElt.click()}),q.className="geBtn",n.appendChild(q));n.appendChild(H);a.editor.cancelFirst||
-null!=b||k&&null==f||n.appendChild(z);D.appendChild(n);this.container=D},CreateDialog=function(a,e,c,b,k,f,l,d,g,m,n,p,u,t,q,v,z){function y(d,b,c,g){function m(){mxEvent.addListener(f,"click",function(){var d=c;if(l){var b=B.value,g=b.lastIndexOf(".");if(0>e.lastIndexOf(".")&&0>g){var d=null!=d?d:F.value,m="";d==App.MODE_GOOGLE?m=a.drive.extension:d==App.MODE_GITHUB?m=a.gitHub.extension:d==App.MODE_GITLAB?m=a.gitLab.extension:d==App.MODE_TRELLO?m=a.trello.extension:d==App.MODE_DROPBOX?m=a.dropbox.extension:
-d==App.MODE_ONEDRIVE?m=a.oneDrive.extension:d==App.MODE_DEVICE&&(m=".drawio");0<=g&&(b=b.substring(0,g));B.value=b+m}}A(c)})}var f=document.createElement("a");f.style.overflow="hidden";var n=document.createElement("img");n.src=d;n.setAttribute("border","0");n.setAttribute("align","absmiddle");n.style.width="60px";n.style.height="60px";n.style.paddingBottom="6px";f.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";f.className="geBaseButton";f.style.position="relative";f.style.margin="4px";f.style.padding=
+"1px dotted rgb(235, 242, 249)":"1px solid #ccd9ea";n=null!=n?n:EditorUi.templateFile;var D=document.createElement("div");D.style.height="100%";var E=document.createElement("div");E.style.whiteSpace="nowrap";E.style.height="46px";c&&D.appendChild(E);var H=document.createElement("img");H.setAttribute("border","0");H.setAttribute("align","absmiddle");H.style.width="40px";H.style.height="40px";H.style.marginRight="10px";H.style.paddingBottom="4px";H.src=a.mode==App.MODE_GOOGLE?IMAGE_PATH+"/google-drive-logo.svg":
+a.mode==App.MODE_DROPBOX?IMAGE_PATH+"/dropbox-logo.svg":a.mode==App.MODE_ONEDRIVE?IMAGE_PATH+"/onedrive-logo.svg":a.mode==App.MODE_GITHUB?IMAGE_PATH+"/github-logo.svg":a.mode==App.MODE_GITLAB?IMAGE_PATH+"/gitlab-logo.svg":a.mode==App.MODE_TRELLO?IMAGE_PATH+"/trello-logo.svg":a.mode==App.MODE_BROWSER?IMAGE_PATH+"/osa_database.png":IMAGE_PATH+"/osa_drive-harddisk.png";!e&&c&&E.appendChild(H);c&&mxUtils.write(E,(null==a.mode||a.mode==App.MODE_GOOGLE||a.mode==App.MODE_BROWSER?mxResources.get("diagramName"):
+mxResources.get("filename"))+":");H=".drawio";a.mode==App.MODE_GOOGLE&&null!=a.drive?H=a.drive.extension:a.mode==App.MODE_DROPBOX&&null!=a.dropbox?H=a.dropbox.extension:a.mode==App.MODE_ONEDRIVE&&null!=a.oneDrive?H=a.oneDrive.extension:a.mode==App.MODE_GITHUB&&null!=a.gitHub?H=a.gitHub.extension:a.mode==App.MODE_GITLAB&&null!=a.gitLab?H=a.gitLab.extension:a.mode==App.MODE_TRELLO&&null!=a.trello&&(H=a.trello.extension);var F=document.createElement("input");F.setAttribute("value",a.defaultFilename+
+H);F.style.marginLeft="10px";F.style.width=e?"144px":"244px";this.init=function(){c&&(F.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?F.select():document.execCommand("selectAll",!1,null))};c&&(E.appendChild(F),null!=a.editor.diagramFileTypes&&(H=FilenameDialog.createFileTypes(a,F,a.editor.diagramFileTypes),H.style.marginLeft="6px",H.style.width=e?"80px":"180px",E.appendChild(H)),null!=a.editor.fileExtensions&&(H=FilenameDialog.createTypeHint(a,F,a.editor.fileExtensions),
+H.style.marginTop="12px",E.appendChild(H)));var E=!1,J=0,K=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9}),G=mxUtils.button(v||mxResources.get("create"),function(){G.setAttribute("disabled","disabled");B();G.removeAttribute("disabled")});G.className="geBtn gePrimaryBtn";if(p||u){var L=[],M=null,I=null,T=null,V=function(a){G.setAttribute("disabled","disabled");for(var d=0;d<L.length;d++)L[d].className=d==a?"geBtn gePrimaryBtn":
+"geBtn"},E=!0;v=document.createElement("div");v.style.whiteSpace="nowrap";v.style.height="30px";D.appendChild(v);H=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Q.style.display="";P.style.left="160px";V(0);P.scrollTop=0;P.innerHTML="";J=0;M!=O&&(O=M,R=I,ca=T,Q.innerHTML="",C(),M=null)});L.push(H);v.appendChild(H);var aa=function(a){Q.style.display="none";P.style.left="30px";V(a?-1:1);null==M&&(M=O);P.scrollTop=0;P.innerHTML="";K.spin(P);var d=function(a,d,b){J=0;K.stop();
+O=a;b=b||{};var c=0,e;for(e in b)c+=b[e].length;if(d)P.innerHTML=d;else if(0==a.length&&0==c)P.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found"));else if(P.innerHTML="",0<c){Q.style.display="";P.style.left="160px";Q.innerHTML="";ca=0;R={"draw.io":a};for(e in b)R[e]=b[e];C()}else y()};a?u(ba.value,d):p(d)};p&&(H=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){aa()}),v.appendChild(H),L.push(H));if(u){H=document.createElement("span");H.style.marginLeft=
+"10px";H.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");v.appendChild(H);var ba=document.createElement("input");ba.style.marginRight="10px";ba.style.marginLeft="10px";ba.style.width="220px";mxEvent.addListener(ba,"keypress",function(a){13==a.keyCode&&aa(!0)});v.appendChild(ba);H=mxUtils.button(mxResources.get("search"),function(){aa(!0)});H.className="geBtn";v.appendChild(H)}V(0)}var X=null,U=null,S=null,W=null,fa=null,Y=null,P=document.createElement("div");P.style.border="1px solid #d3d3d3";
+P.style.position="absolute";P.style.left="160px";P.style.right="34px";v=(c?72:40)+(E?30:0);P.style.top=v+"px";P.style.bottom="68px";P.style.margin="6px 0 0 -1px";P.style.padding="6px";P.style.overflow="auto";var Q=document.createElement("div");Q.style.cssText="position:absolute;left:30px;width:128px;top:"+v+"px;bottom:68px;margin-top:6px;overflow:auto;border:1px solid #d3d3d3;";var N=140,ga=140,R={},Z={},ca=0,ta=!0;R.basic=[{title:"blankDiagram",select:!0}];var O=R.basic;if(!e){var ha=function(){mxUtils.get(da,
+function(a){if(!ea){ea=!0;a=a.getXml().documentElement.firstChild;for(var d={};null!=a;){if("undefined"!==typeof a.getAttribute)if("clibs"==a.nodeName){for(var b=a.getAttribute("name"),c=a.getElementsByTagName("add"),e=[],g=0;g<c.length;g++)e.push(encodeURIComponent(mxUtils.getTextContent(c[g])));null!=b&&0<e.length&&(d[b]=e.join(";"))}else b=a.getAttribute("url"),null!=b&&(c=a.getAttribute("section"),null==c&&(c=b.indexOf("/"),c=b.substring(0,c)),b=R[c],null==b&&(b=[],R[c]=b),c=a.getAttribute("clibs"),
+null!=d[c]&&(c=d[c]),b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),preview:a.getAttribute("preview"),clibs:c}));a=a.nextSibling}K.stop();C()}})};D.appendChild(Q);D.appendChild(P);var ea=!1,da=n;/^https?:\/\//.test(da)&&!a.editor.isCorsEnabledForUrl(da)&&(da=PROXY_URL+"?url="+encodeURIComponent(da));K.spin(P);null!=z?z(function(a,d){Z=a;T=ca=d;ha()},ha):ha();I=R}mxEvent.addListener(F,"keypress",function(d){a.dialog.container.firstChild==
+D&&13==d.keyCode&&B()});n=document.createElement("div");n.style.marginTop=e?"4px":"16px";n.style.textAlign="right";n.style.position="absolute";n.style.left="40px";n.style.bottom="24px";n.style.right="40px";e||a.isOffline()||!c||null!=b||k||(z=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://support.draw.io/display/DO/Creating+and+Opening+Files")}),z.className="geBtn",n.appendChild(z));z=mxUtils.button(mxResources.get("cancel"),function(){null!=f&&f();a.hideDialog(!0)});z.className=
+"geBtn";!a.editor.cancelFirst||k&&null==f||n.appendChild(z);e||"1"==urlParams.embed||k||(e=mxUtils.button(mxResources.get("fromTemplateUrl"),function(){var d=new FilenameDialog(a,"",mxResources.get("create"),function(d){null!=d&&0<d.length&&(d=a.getUrl(window.location.pathname+"?mode="+a.mode+"&title="+encodeURIComponent(F.value)+"&create="+encodeURIComponent(d)),null==a.getCurrentFile()?window.location.href=d:window.openWindow(d))},mxResources.get("url"));a.showDialog(d.container,300,80,!0,!0);d.init()}),
+e.className="geBtn",n.appendChild(e));Graph.fileSupport&&t&&(t=mxUtils.button(mxResources.get("import"),function(){if(null==a.newDlgFileInputElt){var d=document.createElement("input");d.setAttribute("multiple","multiple");d.setAttribute("type","file");mxEvent.addListener(d,"change",function(b){a.openFiles(d.files,!0);d.value=""});d.style.display="none";document.body.appendChild(d);a.newDlgFileInputElt=d}a.newDlgFileInputElt.click()}),t.className="geBtn",n.appendChild(t));n.appendChild(G);a.editor.cancelFirst||
+null!=b||k&&null==f||n.appendChild(z);D.appendChild(n);this.container=D},CreateDialog=function(a,e,c,b,k,f,l,d,g,m,n,p,u,q,t,v,z){function y(d,b,c,g){function m(){mxEvent.addListener(f,"click",function(){var d=c;if(l){var b=A.value,g=b.lastIndexOf(".");if(0>e.lastIndexOf(".")&&0>g){var d=null!=d?d:E.value,m="";d==App.MODE_GOOGLE?m=a.drive.extension:d==App.MODE_GITHUB?m=a.gitHub.extension:d==App.MODE_GITLAB?m=a.gitLab.extension:d==App.MODE_TRELLO?m=a.trello.extension:d==App.MODE_DROPBOX?m=a.dropbox.extension:
+d==App.MODE_ONEDRIVE?m=a.oneDrive.extension:d==App.MODE_DEVICE&&(m=".drawio");0<=g&&(b=b.substring(0,g));A.value=b+m}}B(c)})}var f=document.createElement("a");f.style.overflow="hidden";var n=document.createElement("img");n.src=d;n.setAttribute("border","0");n.setAttribute("align","absmiddle");n.style.width="60px";n.style.height="60px";n.style.paddingBottom="6px";f.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";f.className="geBaseButton";f.style.position="relative";f.style.margin="4px";f.style.padding=
"8px 8px 10px 8px";f.style.whiteSpace="nowrap";f.appendChild(n);mxClient.IS_QUIRKS&&(f.style.cssFloat="left",f.style.zoom="1");f.style.color="gray";f.style.fontSize="11px";var k=document.createElement("div");f.appendChild(k);mxUtils.write(k,b);if(null!=g&&null==a[g]){n.style.visibility="hidden";mxUtils.setOpacity(k,10);var u=new Spinner({lines:12,length:12,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"40%",zIndex:2E9});u.spin(f);var x=window.setTimeout(function(){null==
-a[g]&&(u.stop(),f.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[g]&&(window.clearTimeout(x),mxUtils.setOpacity(k,100),n.style.visibility="",u.stop(),m())}))}else m();C.appendChild(f);++D==p&&(mxUtils.br(C),D=0)}function A(d){var b=B.value;if(null==d||null!=b&&0<b.length)z&&a.hideDialog(),c(b,d,B)}l=null!=l?l:!0;d=null!=d?d:!0;p=null!=p?p:4;z=null!=z?z:!0;f=document.createElement("div");f.style.whiteSpace="nowrap";null==b&&a.addLanguageMenu(f);var x=
-document.createElement("h2");mxUtils.write(x,k||mxResources.get("create"));x.style.marginTop="0px";x.style.marginBottom="24px";f.appendChild(x);mxUtils.write(f,mxResources.get("filename")+":");var B=document.createElement("input");B.setAttribute("value",e);B.style.width="200px";B.style.marginLeft="10px";B.style.marginBottom="20px";B.style.maxWidth="70%";this.init=function(){B.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?B.select():document.execCommand("selectAll",
-!1,null)};f.appendChild(B);null!=v&&(null!=a.editor.diagramFileTypes&&(k=FilenameDialog.createFileTypes(a,B,a.editor.diagramFileTypes),k.style.marginLeft="6px",k.style.width="80px",f.appendChild(k)),f.appendChild(FilenameDialog.createTypeHint(a,B,v)));null==u||null==t||"image/"!=t.substring(0,6)||"image/svg"==t.substring(0,9)&&!mxClient.IS_SVG||(B.style.width="160px",v=document.createElement("img"),u=q?u:btoa(unescape(encodeURIComponent(u))),v.setAttribute("src","data:"+t+";base64,"+u),v.style.position=
-"absolute",v.style.top="70px",v.style.right="100px",v.style.maxWidth="120px",v.style.maxHeight="80px",mxUtils.setPrefixedStyle(v.style,"transform","translate(50%,-50%)"),f.appendChild(v),g&&Editor.popupsAllowed&&(v.style.cursor="pointer",mxEvent.addGestureListeners(v,null,null,function(){A("_blank")})));mxUtils.br(f);var C=document.createElement("div");C.style.textAlign="center";var D=0;C.style.marginTop="6px";f.appendChild(C);var F=document.createElement("select");F.style.marginLeft="10px";a.isOfflineApp()||
-a.isOffline()||("function"===typeof window.DriveClient&&(t=document.createElement("option"),t.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(t,mxResources.get("googleDrive")),F.appendChild(t),y(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(t=document.createElement("option"),t.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(t,mxResources.get("oneDrive")),F.appendChild(t),a.mode==App.MODE_ONEDRIVE&&
-t.setAttribute("selected","selected"),y(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(t=document.createElement("option"),t.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(t,mxResources.get("dropbox")),F.appendChild(t),a.mode==App.MODE_DROPBOX&&t.setAttribute("selected","selected"),y(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(t=document.createElement("option"),
-t.setAttribute("value",App.MODE_GITHUB),mxUtils.write(t,mxResources.get("github")),F.appendChild(t),y(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.gitLab&&(t=document.createElement("option"),t.setAttribute("value",App.MODE_GITLAB),mxUtils.write(t,mxResources.get("gitlab")),F.appendChild(t),y(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(t=document.createElement("option"),t.setAttribute("value",
-App.MODE_TRELLO),mxUtils.write(t,mxResources.get("trello")),F.appendChild(t),y(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));Editor.useLocalStorage&&"device"!=urlParams.storage&&null==a.getCurrentFile()||(t=document.createElement("option"),t.setAttribute("value",App.MODE_DEVICE),mxUtils.write(t,mxResources.get("device")),F.appendChild(t),a.mode!=App.MODE_DEVICE&&d||t.setAttribute("selected","selected"),n&&y(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),
-App.MODE_DEVICE));d&&isLocalStorage&&"0"!=urlParams.browser&&(d=document.createElement("option"),d.setAttribute("value",App.MODE_BROWSER),mxUtils.write(d,mxResources.get("browser")),F.appendChild(d),a.mode==App.MODE_BROWSER&&d.setAttribute("selected","selected"),y(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));d=document.createElement("div");d.style.marginTop="26px";d.style.textAlign="center";null!=m&&(n=mxUtils.button(mxResources.get("help"),function(){a.openLink(m)}),
-n.className="geBtn",d.appendChild(n));n=mxUtils.button(mxResources.get("cancel"),function(){null!=b?b():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});n.className="geBtn";a.editor.cancelFirst&&d.appendChild(n);null==b&&(t=mxUtils.button(mxResources.get("decideLater"),function(){A(null)}),t.className="geBtn",d.appendChild(t));g&&Editor.popupsAllowed&&(g=mxUtils.button(mxResources.get("openInNewWindow"),function(){A("_blank")}),g.className="geBtn",d.appendChild(g));
-CreateDialog.showDownloadButton&&(g=mxUtils.button(mxResources.get("download"),function(){A("download")}),g.className="geBtn",d.appendChild(g));a.editor.cancelFirst||d.appendChild(n);mxEvent.addListener(B,"keypress",function(d){13==d.keyCode?A(App.MODE_DEVICE):27==d.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});f.appendChild(d);this.container=f};CreateDialog.showDownloadButton=!0;
+a[g]&&(u.stop(),f.style.display="none")},3E4);a.addListener("clientLoaded",mxUtils.bind(this,function(){null!=a[g]&&(window.clearTimeout(x),mxUtils.setOpacity(k,100),n.style.visibility="",u.stop(),m())}))}else m();C.appendChild(f);++D==p&&(mxUtils.br(C),D=0)}function B(d){var b=A.value;if(null==d||null!=b&&0<b.length)z&&a.hideDialog(),c(b,d,A)}l=null!=l?l:!0;d=null!=d?d:!0;p=null!=p?p:4;z=null!=z?z:!0;f=document.createElement("div");f.style.whiteSpace="nowrap";null==b&&a.addLanguageMenu(f);var x=
+document.createElement("h2");mxUtils.write(x,k||mxResources.get("create"));x.style.marginTop="0px";x.style.marginBottom="24px";f.appendChild(x);mxUtils.write(f,mxResources.get("filename")+":");var A=document.createElement("input");A.setAttribute("value",e);A.style.width="200px";A.style.marginLeft="10px";A.style.marginBottom="20px";A.style.maxWidth="70%";this.init=function(){A.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?A.select():document.execCommand("selectAll",
+!1,null)};f.appendChild(A);null!=v&&(null!=a.editor.diagramFileTypes&&(k=FilenameDialog.createFileTypes(a,A,a.editor.diagramFileTypes),k.style.marginLeft="6px",k.style.width="80px",f.appendChild(k)),f.appendChild(FilenameDialog.createTypeHint(a,A,v)));null==u||null==q||"image/"!=q.substring(0,6)||"image/svg"==q.substring(0,9)&&!mxClient.IS_SVG||(A.style.width="160px",v=document.createElement("img"),u=t?u:btoa(unescape(encodeURIComponent(u))),v.setAttribute("src","data:"+q+";base64,"+u),v.style.position=
+"absolute",v.style.top="70px",v.style.right="100px",v.style.maxWidth="120px",v.style.maxHeight="80px",mxUtils.setPrefixedStyle(v.style,"transform","translate(50%,-50%)"),f.appendChild(v),g&&Editor.popupsAllowed&&(v.style.cursor="pointer",mxEvent.addGestureListeners(v,null,null,function(){B("_blank")})));mxUtils.br(f);var C=document.createElement("div");C.style.textAlign="center";var D=0;C.style.marginTop="6px";f.appendChild(C);var E=document.createElement("select");E.style.marginLeft="10px";a.isOfflineApp()||
+a.isOffline()||("function"===typeof window.DriveClient&&(q=document.createElement("option"),q.setAttribute("value",App.MODE_GOOGLE),mxUtils.write(q,mxResources.get("googleDrive")),E.appendChild(q),y(IMAGE_PATH+"/google-drive-logo.svg",mxResources.get("googleDrive"),App.MODE_GOOGLE,"drive")),"function"===typeof window.OneDriveClient&&(q=document.createElement("option"),q.setAttribute("value",App.MODE_ONEDRIVE),mxUtils.write(q,mxResources.get("oneDrive")),E.appendChild(q),a.mode==App.MODE_ONEDRIVE&&
+q.setAttribute("selected","selected"),y(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"),App.MODE_ONEDRIVE,"oneDrive")),"function"===typeof window.DropboxClient&&(q=document.createElement("option"),q.setAttribute("value",App.MODE_DROPBOX),mxUtils.write(q,mxResources.get("dropbox")),E.appendChild(q),a.mode==App.MODE_DROPBOX&&q.setAttribute("selected","selected"),y(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),App.MODE_DROPBOX,"dropbox")),null!=a.gitHub&&(q=document.createElement("option"),
+q.setAttribute("value",App.MODE_GITHUB),mxUtils.write(q,mxResources.get("github")),E.appendChild(q),y(IMAGE_PATH+"/github-logo.svg",mxResources.get("github"),App.MODE_GITHUB,"gitHub")),null!=a.gitLab&&(q=document.createElement("option"),q.setAttribute("value",App.MODE_GITLAB),mxUtils.write(q,mxResources.get("gitlab")),E.appendChild(q),y(IMAGE_PATH+"/gitlab-logo.svg",mxResources.get("gitlab"),App.MODE_GITLAB,"gitLab")),"function"===typeof window.TrelloClient&&(q=document.createElement("option"),q.setAttribute("value",
+App.MODE_TRELLO),mxUtils.write(q,mxResources.get("trello")),E.appendChild(q),y(IMAGE_PATH+"/trello-logo.svg",mxResources.get("trello"),App.MODE_TRELLO,"trello")));Editor.useLocalStorage&&"device"!=urlParams.storage&&null==a.getCurrentFile()||(q=document.createElement("option"),q.setAttribute("value",App.MODE_DEVICE),mxUtils.write(q,mxResources.get("device")),E.appendChild(q),a.mode!=App.MODE_DEVICE&&d||q.setAttribute("selected","selected"),n&&y(IMAGE_PATH+"/osa_drive-harddisk.png",mxResources.get("device"),
+App.MODE_DEVICE));d&&isLocalStorage&&"0"!=urlParams.browser&&(d=document.createElement("option"),d.setAttribute("value",App.MODE_BROWSER),mxUtils.write(d,mxResources.get("browser")),E.appendChild(d),a.mode==App.MODE_BROWSER&&d.setAttribute("selected","selected"),y(IMAGE_PATH+"/osa_database.png",mxResources.get("browser"),App.MODE_BROWSER));d=document.createElement("div");d.style.marginTop="26px";d.style.textAlign="center";null!=m&&(n=mxUtils.button(mxResources.get("help"),function(){a.openLink(m)}),
+n.className="geBtn",d.appendChild(n));n=mxUtils.button(mxResources.get("cancel"),function(){null!=b?b():(a.fileLoaded(null),a.hideDialog(),window.close(),window.location.href=a.getUrl())});n.className="geBtn";a.editor.cancelFirst&&d.appendChild(n);null==b&&(q=mxUtils.button(mxResources.get("decideLater"),function(){B(null)}),q.className="geBtn",d.appendChild(q));g&&Editor.popupsAllowed&&(g=mxUtils.button(mxResources.get("openInNewWindow"),function(){B("_blank")}),g.className="geBtn",d.appendChild(g));
+CreateDialog.showDownloadButton&&(g=mxUtils.button(mxResources.get("download"),function(){B("download")}),g.className="geBtn",d.appendChild(g));a.editor.cancelFirst||d.appendChild(n);mxEvent.addListener(A,"keypress",function(d){13==d.keyCode?B(App.MODE_DEVICE):27==d.keyCode&&(a.fileLoaded(null),a.hideDialog(),window.close())});f.appendChild(d);this.container=f};CreateDialog.showDownloadButton=!0;
var PopupDialog=function(a,e,c,b,k){k=null!=k?k:!0;var f=document.createElement("div");f.style.textAlign="left";mxUtils.write(f,mxResources.get("fileOpenLocation"));mxUtils.br(f);mxUtils.br(f);var l=mxUtils.button(mxResources.get("openInThisWindow"),function(){k&&a.hideDialog();null!=b&&b()});l.className="geBtn";l.style.marginBottom="8px";l.style.width="280px";f.appendChild(l);mxUtils.br(f);var d=mxUtils.button(mxResources.get("openInNewWindow"),function(){k&&a.hideDialog();null!=c&&c();a.openLink(e,
null,!0)});d.className="geBtn gePrimaryBtn";d.style.width=l.style.width;f.appendChild(d);mxUtils.br(f);mxUtils.br(f);mxUtils.write(f,mxResources.get("allowPopups"));this.container=f},ImageDialog=function(a,e,c,b,k,f){f=null!=f?f:!0;var l=a.editor.graph,d=document.createElement("div");mxUtils.write(d,e);e=document.createElement("div");e.className="geTitle";e.style.backgroundColor="transparent";e.style.borderColor="transparent";e.style.whiteSpace="nowrap";e.style.textOverflow="clip";e.style.cursor=
"default";mxClient.IS_VML||(e.style.paddingRight="20px");var g=document.createElement("input");g.setAttribute("value",c);g.setAttribute("type","text");g.setAttribute("spellcheck","false");g.setAttribute("autocorrect","off");g.setAttribute("autocomplete","off");g.setAttribute("autocapitalize","off");g.style.marginTop="6px";g.style.width=(Graph.fileSupport?460:340)+(mxClient.IS_QUIRKS?20:-20)+"px";g.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";g.style.backgroundRepeat="no-repeat";
@@ -8705,8 +8705,8 @@ p.files&&(a.importFiles(p.files,0,0,a.maxImageSize,function(a,d,b,c,e,g){n(a)},f
"default";mxClient.IS_VML||(d.style.paddingRight="20px");var g=document.createElement("input");g.setAttribute("placeholder",mxResources.get("dragUrlsHere"));g.setAttribute("type","text");g.style.marginTop="6px";g.style.width="100%";g.style.boxSizing="border-box";g.style.backgroundImage="url('"+Dialog.prototype.clearImage+"')";g.style.backgroundRepeat="no-repeat";g.style.backgroundPosition="100% 50%";g.style.paddingRight="14px";var m=document.createElement("div");m.setAttribute("title",mxResources.get("reset"));
m.style.position="relative";m.style.left="-16px";m.style.width="12px";m.style.height="14px";m.style.cursor="pointer";m.style.display=mxClient.IS_VML?"inline":"inline-block";m.style.top=(mxClient.IS_VML?0:3)+"px";m.style.background="url('"+a.editor.transparentImage+"')";mxEvent.addListener(m,"click",function(){g.value="";g.focus()});var n=document.createElement("input");n.style.cssText="margin-right:8px;margin-bottom:8px;";n.setAttribute("value","url");n.setAttribute("type","radio");n.setAttribute("name",
"current-linkdialog");var p=document.createElement("input");p.style.cssText="margin-right:8px;margin-bottom:8px;";p.setAttribute("value","url");p.setAttribute("type","radio");p.setAttribute("name","current-linkdialog");var u=document.createElement("select");u.style.width="100%";if(k&&null!=a.pages){null!=e&&"data:page/id,"==e.substring(0,13)?(p.setAttribute("checked","checked"),p.defaultChecked=!0):(g.setAttribute("value",e),n.setAttribute("checked","checked"),n.defaultChecked=!0);d.appendChild(n);
-d.appendChild(g);d.appendChild(m);mxUtils.br(d);d.appendChild(p);k=!1;for(m=0;m<a.pages.length;m++){var t=document.createElement("option");mxUtils.write(t,a.pages[m].getName()||mxResources.get("pageWithNumber",[m+1]));t.setAttribute("value","data:page/id,"+a.pages[m].getId());e==t.getAttribute("value")&&(t.setAttribute("selected","selected"),k=!0);u.appendChild(t)}if(!k&&p.checked){var q=document.createElement("option");mxUtils.write(q,mxResources.get("pageNotFound"));q.setAttribute("disabled","disabled");
-q.setAttribute("selected","selected");q.setAttribute("value","pageNotFound");u.appendChild(q);mxEvent.addListener(u,"change",function(){null==q.parentNode||q.selected||q.parentNode.removeChild(q)})}d.appendChild(u)}else g.setAttribute("value",e),d.appendChild(g),d.appendChild(m);l.appendChild(d);var v=mxUtils.button(c,function(){a.hideDialog();b(p.checked?"pageNotFound"!==u.value?u.value:e:g.value,LinkDialog.selectedDocs)});v.style.verticalAlign="middle";v.className="geBtn gePrimaryBtn";this.init=
+d.appendChild(g);d.appendChild(m);mxUtils.br(d);d.appendChild(p);k=!1;for(m=0;m<a.pages.length;m++){var q=document.createElement("option");mxUtils.write(q,a.pages[m].getName()||mxResources.get("pageWithNumber",[m+1]));q.setAttribute("value","data:page/id,"+a.pages[m].getId());e==q.getAttribute("value")&&(q.setAttribute("selected","selected"),k=!0);u.appendChild(q)}if(!k&&p.checked){var t=document.createElement("option");mxUtils.write(t,mxResources.get("pageNotFound"));t.setAttribute("disabled","disabled");
+t.setAttribute("selected","selected");t.setAttribute("value","pageNotFound");u.appendChild(t);mxEvent.addListener(u,"change",function(){null==t.parentNode||t.selected||t.parentNode.removeChild(t)})}d.appendChild(u)}else g.setAttribute("value",e),d.appendChild(g),d.appendChild(m);l.appendChild(d);var v=mxUtils.button(c,function(){a.hideDialog();b(p.checked?"pageNotFound"!==u.value?u.value:e:g.value,LinkDialog.selectedDocs)});v.style.verticalAlign="middle";v.className="geBtn gePrimaryBtn";this.init=
function(){p.checked?u.focus():(g.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?g.select():document.execCommand("selectAll",!1,null));mxEvent.addListener(u,"focus",function(){n.removeAttribute("checked");p.setAttribute("checked","checked");p.checked=!0});mxEvent.addListener(g,"focus",function(){p.removeAttribute("checked");n.setAttribute("checked","checked");n.checked=!0});if(Graph.fileSupport){var d=l.parentNode,b=null;mxEvent.addListener(d,"dragleave",function(a){null!=
b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()});mxEvent.addListener(d,"dragover",mxUtils.bind(this,function(c){null==b&&(!mxClient.IS_IE||10<document.documentMode)&&(b=a.highlightElement(d));c.stopPropagation();c.preventDefault()}));mxEvent.addListener(d,"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);0<=mxUtils.indexOf(a.dataTransfer.types,"text/uri-list")&&(g.value=decodeURIComponent(a.dataTransfer.getData("text/uri-list")),n.setAttribute("checked",
"checked"),n.checked=!0,v.click());a.stopPropagation();a.preventDefault()}),!1)}};var z=document.createElement("div");z.style.marginTop="20px";z.style.textAlign="center";c=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/solution/articles/16000080137")});c.style.verticalAlign="middle";c.className="geBtn";z.appendChild(c);a.isOffline()&&!mxClient.IS_CHROMEAPP&&(c.style.display="none");c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});c.style.verticalAlign=
@@ -8724,44 +8724,44 @@ mxUtils.write(f,mxResources.get("feedback"));k.appendChild(f);var n=document.cre
c.appendChild(f));k.appendChild(c);this.container=k};FeedbackDialog.maxAttachmentSize=1E6;
var RevisionDialog=function(a,e,c){var b=document.createElement("div"),k=document.createElement("h3");k.style.marginTop="0px";mxUtils.write(k,mxResources.get("revisionHistory"));b.appendChild(k);var f=document.createElement("div");f.style.position="absolute";f.style.overflow="auto";f.style.width="170px";f.style.height="378px";b.appendChild(f);var l=document.createElement("div");l.style.position="absolute";l.style.border="1px solid lightGray";l.style.left="199px";l.style.width="470px";l.style.height=
"376px";l.style.overflow="hidden";mxEvent.disableContextMenu(l);b.appendChild(l);var d=new Graph(l);d.setTooltips(!1);d.setEnabled(!1);d.setPanning(!0);d.panningHandler.ignoreCell=!0;d.panningHandler.useLeftButtonForPanning=!0;d.minFitScale=null;d.maxFitScale=null;d.centerZoom=!0;var g=0,m=null,n=0,p=d.getGlobalVariable;d.getGlobalVariable=function(a){return"page"==a&&null!=m&&null!=m[n]?m[n].getAttribute("name"):"pagenumber"==a?n+1:"pagecount"==a?null!=m?m.length:1:p.apply(this,arguments)};d.getLinkForCell=
-function(){return null};Editor.MathJaxRender&&d.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(d.container)}));var u=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),t=a.getCurrentFile(),q=null,v=null,z=null,y=null,A=mxUtils.button("",function(){null!=z&&d.zoomIn()});A.className="geSprite geSprite-zoomin";
-A.setAttribute("title",mxResources.get("zoomIn"));A.style.outline="none";A.style.border="none";A.style.margin="2px";A.setAttribute("disabled","disabled");mxUtils.setOpacity(A,20);var x=mxUtils.button("",function(){null!=z&&d.zoomOut()});x.className="geSprite geSprite-zoomout";x.setAttribute("title",mxResources.get("zoomOut"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var B=mxUtils.button("",function(){null!=z&&
-(d.maxFitScale=8,d.fit(8),d.center())});B.className="geSprite geSprite-fit";B.setAttribute("title",mxResources.get("fit"));B.style.outline="none";B.style.border="none";B.style.margin="2px";B.setAttribute("disabled","disabled");mxUtils.setOpacity(B,20);var C=mxUtils.button("",function(){null!=z&&(d.zoomActual(),d.center())});C.className="geSprite geSprite-actualsize";C.setAttribute("title",mxResources.get("actualSize"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled",
-"disabled");mxUtils.setOpacity(C,20);var D=document.createElement("div");D.style.position="absolute";D.style.textAlign="right";D.style.color="gray";D.style.marginTop="10px";D.style.backgroundColor="transparent";D.style.top="440px";D.style.right="32px";D.style.maxWidth="380px";D.style.cursor="default";var F=mxUtils.button(mxResources.get("download"),function(){if(null!=z){var d=mxUtils.getXml(z.documentElement),b=a.getBaseFilename()+".drawio";a.isLocalFileSave()?a.saveLocalFile(d,b,"text/xml"):(d=
-"undefined"===typeof pako?"&xml="+encodeURIComponent(d):"&data="+encodeURIComponent(Graph.compress(d)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+d)).simulate(document,"_blank"))}});F.className="geBtn";F.setAttribute("disabled","disabled");var G=mxUtils.button(mxResources.get("restore"),function(){null!=z&&null!=y&&a.confirm(mxResources.get("areYouSure"),function(){null!=c?c(y):a.spinner.spin(document.body,mxResources.get("restoring"))&&t.save(!0,function(d){a.spinner.stop();
-a.replaceFileData(y);a.hideDialog()},function(d){a.spinner.stop();a.editor.setStatus("");a.handleError(d,null!=d?mxResources.get("errorSavingFile"):null)})})});G.className="geBtn";G.setAttribute("disabled","disabled");var E=document.createElement("select");E.setAttribute("disabled","disabled");E.style.maxWidth="80px";E.style.position="relative";E.style.top="-2px";E.style.verticalAlign="bottom";E.style.marginRight="6px";E.style.display="none";var J=null;mxEvent.addListener(E,"change",function(a){null!=
-J&&(J(a),mxEvent.consume(a))});var K=mxUtils.button(mxResources.get("edit"),function(){null!=z&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(z.documentElement)),a.openLink(a.getUrl(),null,!0))});K.className="geBtn";K.setAttribute("disabled","disabled");null!=c&&(K.style.display="none");var H=mxUtils.button(mxResources.get("show"),function(){null!=v&&a.openLink(v.getUrl(E.selectedIndex))});H.className="geBtn gePrimaryBtn";H.setAttribute("disabled",
-"disabled");null!=c&&(H.style.display="none",G.className="geBtn gePrimaryBtn");k=document.createElement("div");k.style.position="absolute";k.style.top="482px";k.style.width="640px";k.style.textAlign="right";var L=document.createElement("div");L.className="geToolbarContainer";L.style.backgroundColor="transparent";L.style.padding="2px";L.style.border="none";L.style.left="199px";L.style.top="442px";var M=null;if(null!=e&&0<e.length){l.style.cursor="move";var I=document.createElement("table");I.style.border=
-"1px solid lightGray";I.style.borderCollapse="collapse";I.style.borderSpacing="0px";I.style.width="100%";var U=document.createElement("tbody"),T=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(g=mxUtils.indexOf(a.pages,a.currentPage));for(var ca=e.length-1;0<=ca;ca--){var ba=function(b){var c=new Date(b.modifiedDate),f=null;if(0<=c.getTime()){var k=function(e){u.stop();var k=mxUtils.parseXml(e),p=a.editor.extractGraphModel(k.documentElement,!0);if(null!=p){var v=function(a){null!=a&&
-(a=q(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(a))).documentElement));return a},q=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";l.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,d.getModel());d.maxFitScale=1;d.fit(8);d.center();return a};E.style.display="none";E.innerHTML="";z=k;y=e;m=parseSelectFunction=null;n=0;if("mxfile"==p.nodeName){k=p.getElementsByTagName("diagram");m=[];for(e=0;e<k.length;e++)m.push(k[e]);n=
-Math.min(g,m.length-1);0<m.length&&v(m[n]);if(1<m.length)for(E.removeAttribute("disabled"),E.style.display="",e=0;e<m.length;e++)k=document.createElement("option"),mxUtils.write(k,m[e].getAttribute("name")||mxResources.get("pageWithNumber",[e+1])),k.setAttribute("value",e),e==n&&k.setAttribute("selected","selected"),E.appendChild(k);J=function(){try{var d=parseInt(E.value);n=g=d;v(m[d])}catch(Y){E.value=g,a.handleError(Y)}}}else q(p);e=b.lastModifyingUserName;null!=e&&20<e.length&&(e=e.substring(0,
-20)+"...");D.innerHTML="";mxUtils.write(D,(null!=e?e+" ":"")+c.toLocaleDateString()+" "+c.toLocaleTimeString());D.setAttribute("title",f.getAttribute("title"));A.removeAttribute("disabled");x.removeAttribute("disabled");B.removeAttribute("disabled");C.removeAttribute("disabled");null!=t&&t.isRestricted()||(a.editor.graph.isEnabled()&&G.removeAttribute("disabled"),F.removeAttribute("disabled"),H.removeAttribute("disabled"),K.removeAttribute("disabled"));mxUtils.setOpacity(A,60);mxUtils.setOpacity(x,
-60);mxUtils.setOpacity(B,60);mxUtils.setOpacity(C,60)}else E.style.display="none",E.innerHTML="",D.innerHTML="",mxUtils.write(D,mxResources.get("errorLoadingFile"))},f=document.createElement("tr");f.style.borderBottom="1px solid lightGray";f.style.fontSize="12px";f.style.cursor="pointer";var p=document.createElement("td");p.style.padding="6px";p.style.whiteSpace="nowrap";b==e[e.length-1]?mxUtils.write(p,mxResources.get("current")):c.toDateString()===T?mxUtils.write(p,c.toLocaleTimeString()):mxUtils.write(p,
-c.toLocaleDateString()+" "+c.toLocaleTimeString());f.appendChild(p);f.setAttribute("title",c.toLocaleDateString()+" "+c.toLocaleTimeString()+(null!=b.fileSize?" "+a.formatFileSize(parseInt(b.fileSize)):"")+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(f,"click",function(a){v!=b&&(u.stop(),null!=q&&(q.style.backgroundColor=""),v=b,q=f,q.style.backgroundColor="#ebf2f9",y=z=null,D.removeAttribute("title"),D.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+
-"..."),l.style.backgroundColor="#ffffff",d.getModel().clear(),G.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),x.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),K.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),mxUtils.setOpacity(A,20),mxUtils.setOpacity(x,20),mxUtils.setOpacity(B,20),mxUtils.setOpacity(C,20),
-u.spin(l),b.getXml(function(a){if(v==b)try{k(a)}catch(Q){D.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+": "+Q.message)}},function(a){u.stop();E.style.display="none";E.innerHTML="";D.innerHTML="";mxUtils.write(D,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(f,"dblclick",function(a){H.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);U.appendChild(f)}return f}(e[ca]);
-null!=ba&&ca==e.length-1&&(M=ba)}I.appendChild(U);f.appendChild(I)}else null==t||null==a.drive&&t.constructor==window.DriveFile||null==a.dropbox&&t.constructor==window.DropboxFile?(l.style.display="none",L.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"))):(l.style.display="none",L.style.display="none",mxUtils.write(f,mxResources.get("noRevisions")));this.init=function(){null!=M&&M.click()};f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.className="geBtn";
-L.appendChild(E);L.appendChild(A);L.appendChild(x);L.appendChild(C);L.appendChild(B);a.editor.cancelFirst?(k.appendChild(f),k.appendChild(F),k.appendChild(K),k.appendChild(G),k.appendChild(H)):(k.appendChild(F),k.appendChild(K),k.appendChild(G),k.appendChild(H),k.appendChild(f));b.appendChild(k);b.appendChild(L);b.appendChild(D);this.container=b},DraftDialog=function(a,e,c,b,k,f,l,d,g){var m=document.createElement("div"),n=document.createElement("div");n.style.marginTop="0px";n.style.whiteSpace="nowrap";
-n.style.overflow="auto";n.style.lineHeight="normal";mxUtils.write(n,e);m.appendChild(n);var p=document.createElement("select"),u=mxUtils.bind(this,function(){A=mxUtils.parseXml(g[p.value].data);x=a.editor.extractGraphModel(A.documentElement,!0);B=0;this.init()});if(null!=g){p.style.marginLeft="4px";for(e=0;e<g.length;e++){var t=document.createElement("option");t.setAttribute("value",e);var q=new Date(g[e].created),v=new Date(g[e].modified);mxUtils.write(t,q.toLocaleDateString()+" "+q.toLocaleTimeString()+
-" - "+(q.toDateString(),v.toDateString(),v.toLocaleDateString())+" "+v.toLocaleTimeString());p.appendChild(t)}n.appendChild(p);mxEvent.addListener(p,"change",u)}null==c&&(c=g[0].data);var z=document.createElement("div");z.style.position="absolute";z.style.border="1px solid lightGray";z.style.marginTop="10px";z.style.width="640px";z.style.top="46px";z.style.bottom="74px";z.style.overflow="hidden";mxEvent.disableContextMenu(z);m.appendChild(z);var y=new Graph(z);y.setEnabled(!1);y.setPanning(!0);y.panningHandler.ignoreCell=
-!0;y.panningHandler.useLeftButtonForPanning=!0;y.minFitScale=null;y.maxFitScale=null;y.centerZoom=!0;var A=mxUtils.parseXml(c),x=a.editor.extractGraphModel(A.documentElement,!0),B=0,C=null,D=y.getGlobalVariable;y.getGlobalVariable=function(a){return"page"==a&&null!=C&&null!=C[B]?C[B].getAttribute("name"):"pagenumber"==a?B+1:"pagecount"==a?null!=C?C.length:1:D.apply(this,arguments)};y.getLinkForCell=function(){return null};c=mxUtils.button("",function(){y.zoomIn()});c.className="geSprite geSprite-zoomin";
+function(){return null};Editor.MathJaxRender&&d.addListener(mxEvent.SIZE,mxUtils.bind(this,function(b,c){a.editor.graph.mathEnabled&&Editor.MathJaxRender(d.container)}));var u=new Spinner({lines:11,length:15,width:6,radius:10,corners:1,rotate:0,direction:1,color:"#000",speed:1.4,trail:60,shadow:!1,hwaccel:!1,className:"spinner",zIndex:2E9,top:"50%",left:"50%"}),q=a.getCurrentFile(),t=null,v=null,z=null,y=null,B=mxUtils.button("",function(){null!=z&&d.zoomIn()});B.className="geSprite geSprite-zoomin";
+B.setAttribute("title",mxResources.get("zoomIn"));B.style.outline="none";B.style.border="none";B.style.margin="2px";B.setAttribute("disabled","disabled");mxUtils.setOpacity(B,20);var x=mxUtils.button("",function(){null!=z&&d.zoomOut()});x.className="geSprite geSprite-zoomout";x.setAttribute("title",mxResources.get("zoomOut"));x.style.outline="none";x.style.border="none";x.style.margin="2px";x.setAttribute("disabled","disabled");mxUtils.setOpacity(x,20);var A=mxUtils.button("",function(){null!=z&&
+(d.maxFitScale=8,d.fit(8),d.center())});A.className="geSprite geSprite-fit";A.setAttribute("title",mxResources.get("fit"));A.style.outline="none";A.style.border="none";A.style.margin="2px";A.setAttribute("disabled","disabled");mxUtils.setOpacity(A,20);var C=mxUtils.button("",function(){null!=z&&(d.zoomActual(),d.center())});C.className="geSprite geSprite-actualsize";C.setAttribute("title",mxResources.get("actualSize"));C.style.outline="none";C.style.border="none";C.style.margin="2px";C.setAttribute("disabled",
+"disabled");mxUtils.setOpacity(C,20);var D=document.createElement("div");D.style.position="absolute";D.style.textAlign="right";D.style.color="gray";D.style.marginTop="10px";D.style.backgroundColor="transparent";D.style.top="440px";D.style.right="32px";D.style.maxWidth="380px";D.style.cursor="default";var E=mxUtils.button(mxResources.get("download"),function(){if(null!=z){var d=mxUtils.getXml(z.documentElement),b=a.getBaseFilename()+".drawio";a.isLocalFileSave()?a.saveLocalFile(d,b,"text/xml"):(d=
+"undefined"===typeof pako?"&xml="+encodeURIComponent(d):"&data="+encodeURIComponent(Graph.compress(d)),(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml"+d)).simulate(document,"_blank"))}});E.className="geBtn";E.setAttribute("disabled","disabled");var H=mxUtils.button(mxResources.get("restore"),function(){null!=z&&null!=y&&a.confirm(mxResources.get("areYouSure"),function(){null!=c?c(y):a.spinner.spin(document.body,mxResources.get("restoring"))&&q.save(!0,function(d){a.spinner.stop();
+a.replaceFileData(y);a.hideDialog()},function(d){a.spinner.stop();a.editor.setStatus("");a.handleError(d,null!=d?mxResources.get("errorSavingFile"):null)})})});H.className="geBtn";H.setAttribute("disabled","disabled");var F=document.createElement("select");F.setAttribute("disabled","disabled");F.style.maxWidth="80px";F.style.position="relative";F.style.top="-2px";F.style.verticalAlign="bottom";F.style.marginRight="6px";F.style.display="none";var J=null;mxEvent.addListener(F,"change",function(a){null!=
+J&&(J(a),mxEvent.consume(a))});var K=mxUtils.button(mxResources.get("edit"),function(){null!=z&&(window.openFile=new OpenFile(function(){window.openFile=null}),window.openFile.setData(mxUtils.getXml(z.documentElement)),a.openLink(a.getUrl(),null,!0))});K.className="geBtn";K.setAttribute("disabled","disabled");null!=c&&(K.style.display="none");var G=mxUtils.button(mxResources.get("show"),function(){null!=v&&a.openLink(v.getUrl(F.selectedIndex))});G.className="geBtn gePrimaryBtn";G.setAttribute("disabled",
+"disabled");null!=c&&(G.style.display="none",H.className="geBtn gePrimaryBtn");k=document.createElement("div");k.style.position="absolute";k.style.top="482px";k.style.width="640px";k.style.textAlign="right";var L=document.createElement("div");L.className="geToolbarContainer";L.style.backgroundColor="transparent";L.style.padding="2px";L.style.border="none";L.style.left="199px";L.style.top="442px";var M=null;if(null!=e&&0<e.length){l.style.cursor="move";var I=document.createElement("table");I.style.border=
+"1px solid lightGray";I.style.borderCollapse="collapse";I.style.borderSpacing="0px";I.style.width="100%";var T=document.createElement("tbody"),V=(new Date).toDateString();null!=a.currentPage&&null!=a.pages&&(g=mxUtils.indexOf(a.pages,a.currentPage));for(var aa=e.length-1;0<=aa;aa--){var ba=function(b){var c=new Date(b.modifiedDate),f=null;if(0<=c.getTime()){var p=function(e){u.stop();var p=mxUtils.parseXml(e),k=a.editor.extractGraphModel(p.documentElement,!0);if(null!=k){var v=function(a){null!=a&&
+(a=t(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(a))).documentElement));return a},t=function(a){var b=a.getAttribute("background");if(null==b||""==b||b==mxConstants.NONE)b="#ffffff";l.style.backgroundColor=b;(new mxCodec(a.ownerDocument)).decode(a,d.getModel());d.maxFitScale=1;d.fit(8);d.center();return a};F.style.display="none";F.innerHTML="";z=p;y=e;m=parseSelectFunction=null;n=0;if("mxfile"==k.nodeName){p=k.getElementsByTagName("diagram");m=[];for(e=0;e<p.length;e++)m.push(p[e]);n=
+Math.min(g,m.length-1);0<m.length&&v(m[n]);if(1<m.length)for(F.removeAttribute("disabled"),F.style.display="",e=0;e<m.length;e++)p=document.createElement("option"),mxUtils.write(p,m[e].getAttribute("name")||mxResources.get("pageWithNumber",[e+1])),p.setAttribute("value",e),e==n&&p.setAttribute("selected","selected"),F.appendChild(p);J=function(){try{var d=parseInt(F.value);n=g=d;v(m[d])}catch(Z){F.value=g,a.handleError(Z)}}}else t(k);e=b.lastModifyingUserName;null!=e&&20<e.length&&(e=e.substring(0,
+20)+"...");D.innerHTML="";mxUtils.write(D,(null!=e?e+" ":"")+c.toLocaleDateString()+" "+c.toLocaleTimeString());D.setAttribute("title",f.getAttribute("title"));B.removeAttribute("disabled");x.removeAttribute("disabled");A.removeAttribute("disabled");C.removeAttribute("disabled");null!=q&&q.isRestricted()||(a.editor.graph.isEnabled()&&H.removeAttribute("disabled"),E.removeAttribute("disabled"),G.removeAttribute("disabled"),K.removeAttribute("disabled"));mxUtils.setOpacity(B,60);mxUtils.setOpacity(x,
+60);mxUtils.setOpacity(A,60);mxUtils.setOpacity(C,60)}else F.style.display="none",F.innerHTML="",D.innerHTML="",mxUtils.write(D,mxResources.get("errorLoadingFile"))},f=document.createElement("tr");f.style.borderBottom="1px solid lightGray";f.style.fontSize="12px";f.style.cursor="pointer";var k=document.createElement("td");k.style.padding="6px";k.style.whiteSpace="nowrap";b==e[e.length-1]?mxUtils.write(k,mxResources.get("current")):c.toDateString()===V?mxUtils.write(k,c.toLocaleTimeString()):mxUtils.write(k,
+c.toLocaleDateString()+" "+c.toLocaleTimeString());f.appendChild(k);f.setAttribute("title",c.toLocaleDateString()+" "+c.toLocaleTimeString()+(null!=b.fileSize?" "+a.formatFileSize(parseInt(b.fileSize)):"")+(null!=b.lastModifyingUserName?" "+b.lastModifyingUserName:""));mxEvent.addListener(f,"click",function(a){v!=b&&(u.stop(),null!=t&&(t.style.backgroundColor=""),v=b,t=f,t.style.backgroundColor="#ebf2f9",y=z=null,D.removeAttribute("title"),D.innerHTML=mxUtils.htmlEntities(mxResources.get("loading")+
+"..."),l.style.backgroundColor="#ffffff",d.getModel().clear(),H.setAttribute("disabled","disabled"),E.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"),x.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"),K.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"),F.setAttribute("disabled","disabled"),mxUtils.setOpacity(B,20),mxUtils.setOpacity(x,20),mxUtils.setOpacity(A,20),mxUtils.setOpacity(C,20),
+u.spin(l),b.getXml(function(a){if(v==b)try{p(a)}catch(Q){D.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+": "+Q.message)}},function(a){u.stop();F.style.display="none";F.innerHTML="";D.innerHTML="";mxUtils.write(D,mxResources.get("errorLoadingFile"))}),mxEvent.consume(a))});mxEvent.addListener(f,"dblclick",function(a){G.click();window.getSelection?window.getSelection().removeAllRanges():document.selection&&document.selection.empty();mxEvent.consume(a)},!1);T.appendChild(f)}return f}(e[aa]);
+null!=ba&&aa==e.length-1&&(M=ba)}I.appendChild(T);f.appendChild(I)}else null==q||null==a.drive&&q.constructor==window.DriveFile||null==a.dropbox&&q.constructor==window.DropboxFile?(l.style.display="none",L.style.display="none",mxUtils.write(f,mxResources.get("notAvailable"))):(l.style.display="none",L.style.display="none",mxUtils.write(f,mxResources.get("noRevisions")));this.init=function(){null!=M&&M.click()};f=mxUtils.button(mxResources.get("close"),function(){a.hideDialog()});f.className="geBtn";
+L.appendChild(F);L.appendChild(B);L.appendChild(x);L.appendChild(C);L.appendChild(A);a.editor.cancelFirst?(k.appendChild(f),k.appendChild(E),k.appendChild(K),k.appendChild(H),k.appendChild(G)):(k.appendChild(E),k.appendChild(K),k.appendChild(H),k.appendChild(G),k.appendChild(f));b.appendChild(k);b.appendChild(L);b.appendChild(D);this.container=b},DraftDialog=function(a,e,c,b,k,f,l,d,g){var m=document.createElement("div"),n=document.createElement("div");n.style.marginTop="0px";n.style.whiteSpace="nowrap";
+n.style.overflow="auto";n.style.lineHeight="normal";mxUtils.write(n,e);m.appendChild(n);var p=document.createElement("select"),u=mxUtils.bind(this,function(){B=mxUtils.parseXml(g[p.value].data);x=a.editor.extractGraphModel(B.documentElement,!0);A=0;this.init()});if(null!=g){p.style.marginLeft="4px";for(e=0;e<g.length;e++){var q=document.createElement("option");q.setAttribute("value",e);var t=new Date(g[e].created),v=new Date(g[e].modified);mxUtils.write(q,t.toLocaleDateString()+" "+t.toLocaleTimeString()+
+" - "+(t.toDateString(),v.toDateString(),v.toLocaleDateString())+" "+v.toLocaleTimeString());p.appendChild(q)}n.appendChild(p);mxEvent.addListener(p,"change",u)}null==c&&(c=g[0].data);var z=document.createElement("div");z.style.position="absolute";z.style.border="1px solid lightGray";z.style.marginTop="10px";z.style.width="640px";z.style.top="46px";z.style.bottom="74px";z.style.overflow="hidden";mxEvent.disableContextMenu(z);m.appendChild(z);var y=new Graph(z);y.setEnabled(!1);y.setPanning(!0);y.panningHandler.ignoreCell=
+!0;y.panningHandler.useLeftButtonForPanning=!0;y.minFitScale=null;y.maxFitScale=null;y.centerZoom=!0;var B=mxUtils.parseXml(c),x=a.editor.extractGraphModel(B.documentElement,!0),A=0,C=null,D=y.getGlobalVariable;y.getGlobalVariable=function(a){return"page"==a&&null!=C&&null!=C[A]?C[A].getAttribute("name"):"pagenumber"==a?A+1:"pagecount"==a?null!=C?C.length:1:D.apply(this,arguments)};y.getLinkForCell=function(){return null};c=mxUtils.button("",function(){y.zoomIn()});c.className="geSprite geSprite-zoomin";
c.setAttribute("title",mxResources.get("zoomIn"));c.style.outline="none";c.style.border="none";c.style.margin="2px";mxUtils.setOpacity(c,60);n=mxUtils.button("",function(){y.zoomOut()});n.className="geSprite geSprite-zoomout";n.setAttribute("title",mxResources.get("zoomOut"));n.style.outline="none";n.style.border="none";n.style.margin="2px";mxUtils.setOpacity(n,60);e=mxUtils.button("",function(){y.maxFitScale=8;y.fit(8);y.center()});e.className="geSprite geSprite-fit";e.setAttribute("title",mxResources.get("fit"));
-e.style.outline="none";e.style.border="none";e.style.margin="2px";mxUtils.setOpacity(e,60);t=mxUtils.button("",function(){y.zoomActual();y.center()});t.className="geSprite geSprite-actualsize";t.setAttribute("title",mxResources.get("actualSize"));t.style.outline="none";t.style.border="none";t.style.margin="2px";mxUtils.setOpacity(t,60);l=mxUtils.button(l||mxResources.get("discard"),function(){k.apply(this,[p.value,mxUtils.bind(this,function(){null!=p.parentNode&&(p.options[p.selectedIndex].parentNode.removeChild(p.options[p.selectedIndex]),
-0<p.options.length?(p.value=p.options[0].value,u()):a.hideDialog(!0))})])});l.className="geBtn";var F=document.createElement("select");F.style.maxWidth="80px";F.style.position="relative";F.style.top="-2px";F.style.verticalAlign="bottom";F.style.marginRight="6px";F.style.display="none";f=mxUtils.button(f||mxResources.get("edit"),function(){b.apply(this,[p.value])});f.className="geBtn gePrimaryBtn";q=document.createElement("div");q.style.position="absolute";q.style.bottom="30px";q.style.width="640px";
-q.style.textAlign="right";v=document.createElement("div");v.className="geToolbarContainer";v.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function a(a){if(null!=a){var d=a.getAttribute("background");if(null==d||""==d||d==mxConstants.NONE)d="dark"==uiTheme?"transparent":"#ffffff";z.style.backgroundColor=d;(new mxCodec(a.ownerDocument)).decode(a,y.getModel());y.maxFitScale=1;y.fit(8);y.center()}}function d(d){null!=
-d&&(d=a(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(d))).documentElement));return d}mxEvent.addListener(F,"change",function(a){B=parseInt(F.value);d(C[B]);mxEvent.consume(a)});if("mxfile"==x.nodeName){var b=x.getElementsByTagName("diagram");C=[];for(var c=0;c<b.length;c++)C.push(b[c]);0<C.length&&d(C[B]);F.innerHTML="";if(1<C.length)for(F.style.display="",c=0;c<C.length;c++)b=document.createElement("option"),mxUtils.write(b,C[c].getAttribute("name")||mxResources.get("pageWithNumber",
-[c+1])),b.setAttribute("value",c),c==B&&b.setAttribute("selected","selected"),F.appendChild(b);else F.style.display="none"}else a(x)};v.appendChild(F);v.appendChild(c);v.appendChild(n);v.appendChild(t);v.appendChild(e);c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.className="geBtn";d=null!=d?mxUtils.button(mxResources.get("ignore"),d):null;null!=d&&(d.className="geBtn");a.editor.cancelFirst?(q.appendChild(c),null!=d&&q.appendChild(d),q.appendChild(l),q.appendChild(f)):
-(q.appendChild(f),q.appendChild(l),null!=d&&q.appendChild(d),q.appendChild(c));m.appendChild(q);m.appendChild(v);this.container=m},FindWindow=function(a,e,c,b,k){function f(a,d,b){if("object"===typeof d.value&&null!=d.value.attributes){d=d.value.attributes;for(var c=0;c<d.length;c++)if("label"!=d[c].nodeName){var e=mxUtils.trim(d[c].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&e.substring(0,b.length)===b||null!=a&&a.test(e))return!0}}return!1}function l(d){var b=g.model.getDescendants(g.model.getRoot()),
-c=t.value.toLowerCase(),e=q.checked?new RegExp(c):null,k=null;m!=c&&(m=c,n=null,p=!1);var u=null==n;if(0<c.length){if(p){p=!1;for(var v,x=0;x<a.pages.length;x++)if(a.currentPage==a.pages[x]){v=x;break}d=(v+1)%a.pages.length;n=null;do p=!1,b=a.pages[d],g=a.createTemporaryGraph(g.getStylesheet()),a.updatePageRoot(b),g.model.setRoot(b.root),d=(d+1)%a.pages.length;while(!l(!0)&&d!=v);n&&(n=null,a.selectPage(b));p=!1;g=a.editor.graph;return l(!0)}for(x=0;x<b.length;x++){v=g.view.getState(b[x]);if(null!=
+e.style.outline="none";e.style.border="none";e.style.margin="2px";mxUtils.setOpacity(e,60);q=mxUtils.button("",function(){y.zoomActual();y.center()});q.className="geSprite geSprite-actualsize";q.setAttribute("title",mxResources.get("actualSize"));q.style.outline="none";q.style.border="none";q.style.margin="2px";mxUtils.setOpacity(q,60);l=mxUtils.button(l||mxResources.get("discard"),function(){k.apply(this,[p.value,mxUtils.bind(this,function(){null!=p.parentNode&&(p.options[p.selectedIndex].parentNode.removeChild(p.options[p.selectedIndex]),
+0<p.options.length?(p.value=p.options[0].value,u()):a.hideDialog(!0))})])});l.className="geBtn";var E=document.createElement("select");E.style.maxWidth="80px";E.style.position="relative";E.style.top="-2px";E.style.verticalAlign="bottom";E.style.marginRight="6px";E.style.display="none";f=mxUtils.button(f||mxResources.get("edit"),function(){b.apply(this,[p.value])});f.className="geBtn gePrimaryBtn";t=document.createElement("div");t.style.position="absolute";t.style.bottom="30px";t.style.width="640px";
+t.style.textAlign="right";v=document.createElement("div");v.className="geToolbarContainer";v.style.cssText="box-shadow:none !important;background-color:transparent;padding:2px;border-style:none !important;bottom:30px;";this.init=function(){function a(a){if(null!=a){var d=a.getAttribute("background");if(null==d||""==d||d==mxConstants.NONE)d="dark"==uiTheme?"transparent":"#ffffff";z.style.backgroundColor=d;(new mxCodec(a.ownerDocument)).decode(a,y.getModel());y.maxFitScale=1;y.fit(8);y.center()}}function d(d){null!=
+d&&(d=a(mxUtils.parseXml(Graph.decompress(mxUtils.getTextContent(d))).documentElement));return d}mxEvent.addListener(E,"change",function(a){A=parseInt(E.value);d(C[A]);mxEvent.consume(a)});if("mxfile"==x.nodeName){var b=x.getElementsByTagName("diagram");C=[];for(var c=0;c<b.length;c++)C.push(b[c]);0<C.length&&d(C[A]);E.innerHTML="";if(1<C.length)for(E.style.display="",c=0;c<C.length;c++)b=document.createElement("option"),mxUtils.write(b,C[c].getAttribute("name")||mxResources.get("pageWithNumber",
+[c+1])),b.setAttribute("value",c),c==A&&b.setAttribute("selected","selected"),E.appendChild(b);else E.style.display="none"}else a(x)};v.appendChild(E);v.appendChild(c);v.appendChild(n);v.appendChild(q);v.appendChild(e);c=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});c.className="geBtn";d=null!=d?mxUtils.button(mxResources.get("ignore"),d):null;null!=d&&(d.className="geBtn");a.editor.cancelFirst?(t.appendChild(c),null!=d&&t.appendChild(d),t.appendChild(l),t.appendChild(f)):
+(t.appendChild(f),t.appendChild(l),null!=d&&t.appendChild(d),t.appendChild(c));m.appendChild(t);m.appendChild(v);this.container=m},FindWindow=function(a,e,c,b,k){function f(a,d,b){if("object"===typeof d.value&&null!=d.value.attributes){d=d.value.attributes;for(var c=0;c<d.length;c++)if("label"!=d[c].nodeName){var e=mxUtils.trim(d[c].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==a&&e.substring(0,b.length)===b||null!=a&&a.test(e))return!0}}return!1}function l(d){var b=g.model.getDescendants(g.model.getRoot()),
+c=q.value.toLowerCase(),e=t.checked?new RegExp(c):null,k=null;m!=c&&(m=c,n=null,p=!1);var u=null==n;if(0<c.length){if(p){p=!1;for(var v,x=0;x<a.pages.length;x++)if(a.currentPage==a.pages[x]){v=x;break}d=(v+1)%a.pages.length;n=null;do p=!1,b=a.pages[d],g=a.createTemporaryGraph(g.getStylesheet()),a.updatePageRoot(b),g.model.setRoot(b.root),d=(d+1)%a.pages.length;while(!l(!0)&&d!=v);n&&(n=null,a.selectPage(b));p=!1;g=a.editor.graph;return l(!0)}for(x=0;x<b.length;x++){v=g.view.getState(b[x]);if(null!=
v&&null!=v.cell.value&&(u||null==k)&&(g.model.isVertex(v.cell)||g.model.isEdge(v.cell))&&(g.isHtmlLabel(v.cell)?(y.innerHTML=g.getLabel(v.cell),label=mxUtils.extractTextWithWhitespace([y])):label=g.getLabel(v.cell),label=mxUtils.trim(label.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase(),null==e&&(label.substring(0,c.length)===c||f(e,v.cell,c))||null!=e&&(e.test(label)||f(e,v.cell,c))))if(u){k=v;break}else null==k&&(k=v);u=u||v==n}}if(null!=k){if(x==b.length&&z.checked)return n=null,p=!0,l(!0);
-n=k;g.scrollCellToVisible(n.cell);g.isEnabled()?g.setSelectionCell(n.cell):g.highlightCell(n.cell)}else{if(!d&&z.checked)return p=!0,l(!0);g.isEnabled()&&g.clearSelection()}return 0==c.length||null!=k}var d=a.actions.get("find"),g=a.editor.graph,m=null,n=null,p=!1,u=document.createElement("div");u.style.userSelect="none";u.style.overflow="hidden";u.style.padding="10px";u.style.height="100%";var t=document.createElement("input");t.setAttribute("placeholder",mxResources.get("find"));t.setAttribute("type",
-"text");t.style.marginTop="4px";t.style.marginBottom="6px";t.style.width="200px";t.style.fontSize="12px";t.style.borderRadius="4px";t.style.padding="6px";u.appendChild(t);mxUtils.br(u);var q=document.createElement("input");q.setAttribute("id","geFindWinRegExChck");q.setAttribute("type","checkbox");q.style.marginRight="4px";u.appendChild(q);var v=document.createElement("label");v.setAttribute("for","geFindWinRegExChck");u.appendChild(v);mxUtils.write(v,mxResources.get("regularExpression"));u.appendChild(v);
+n=k;g.scrollCellToVisible(n.cell);g.isEnabled()?g.setSelectionCell(n.cell):g.highlightCell(n.cell)}else{if(!d&&z.checked)return p=!0,l(!0);g.isEnabled()&&g.clearSelection()}return 0==c.length||null!=k}var d=a.actions.get("find"),g=a.editor.graph,m=null,n=null,p=!1,u=document.createElement("div");u.style.userSelect="none";u.style.overflow="hidden";u.style.padding="10px";u.style.height="100%";var q=document.createElement("input");q.setAttribute("placeholder",mxResources.get("find"));q.setAttribute("type",
+"text");q.style.marginTop="4px";q.style.marginBottom="6px";q.style.width="200px";q.style.fontSize="12px";q.style.borderRadius="4px";q.style.padding="6px";u.appendChild(q);mxUtils.br(u);var t=document.createElement("input");t.setAttribute("id","geFindWinRegExChck");t.setAttribute("type","checkbox");t.style.marginRight="4px";u.appendChild(t);var v=document.createElement("label");v.setAttribute("for","geFindWinRegExChck");u.appendChild(v);mxUtils.write(v,mxResources.get("regularExpression"));u.appendChild(v);
v=a.menus.createHelpLink("https://desk.draw.io/support/solutions/articles/16000088250");v.style.position="relative";v.style.marginLeft="6px";v.style.top="-1px";u.appendChild(v);mxUtils.br(u);var z=document.createElement("input");z.setAttribute("id","geFindWinAllPagesChck");z.setAttribute("type","checkbox");z.style.marginRight="4px";u.appendChild(z);v=document.createElement("label");v.setAttribute("for","geFindWinAllPagesChck");u.appendChild(v);mxUtils.write(v,mxResources.get("allPages"));u.appendChild(v);
-var y=document.createElement("div");mxUtils.br(u);v=mxUtils.button(mxResources.get("reset"),function(){t.value="";t.style.backgroundColor="";m=n=null;p=!1;t.focus()});v.setAttribute("title",mxResources.get("reset"));v.style.marginTop="6px";v.style.marginRight="4px";v.style.marginLeft=(b-20-156)/2+"px";v.className="geBtn";u.appendChild(v);v=mxUtils.button(mxResources.get("find"),function(){try{t.style.backgroundColor=l()?"":"#ffcfcf"}catch(x){a.handleError(x)}});v.setAttribute("title",mxResources.get("find")+
-" (Enter)");v.style.marginTop="6px";v.className="geBtn gePrimaryBtn";u.appendChild(v);mxEvent.addListener(t,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)d.funct();else if(m!=t.value.toLowerCase()||13==a.keyCode)try{t.style.backgroundColor=l()?"":"#ffcfcf"}catch(B){t.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(u,"keydown",function(b){70==b.keyCode&&a.keyHandler.isControlDown(b)&&!mxEvent.isShiftDown(b)&&(d.funct(),mxEvent.consume(b))});this.window=
-new mxWindow(mxResources.get("find"),u,e,c,b,k,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(t.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?t.select():document.execCommand("selectAll",!1,null),null!=a.pages&&1<a.pages.length?z.removeAttribute("disabled"):(z.checked=!1,z.setAttribute("disabled",
-"disabled"))):g.container.focus()}));this.window.setLocation=function(a,d){var b=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));d=Math.max(0,Math.min(d,b-this.table.clientHeight-48));this.getX()==a&&this.getY()==d||mxWindow.prototype.setLocation.apply(this,arguments)};var A=mxUtils.bind(this,function(){var a=this.window.getX(),
-d=this.window.getY();this.window.setLocation(a,d)});mxEvent.addListener(window,"resize",A);this.destroy=function(){mxEvent.removeListener(window,"resize",A);this.window.destroy()}},FreehandWindow=function(a,e,c,b,k){var f=a.editor.graph;a=document.createElement("div");a.style.userSelect="none";a.style.overflow="hidden";a.style.height="100%";var l=mxUtils.button(mxResources.get("startDrawing"),function(){f.freehand.isDrawing()&&f.freehand.stopDrawing();f.freehand.startDrawing()});l.setAttribute("title",
+var y=document.createElement("div");mxUtils.br(u);v=mxUtils.button(mxResources.get("reset"),function(){q.value="";q.style.backgroundColor="";m=n=null;p=!1;q.focus()});v.setAttribute("title",mxResources.get("reset"));v.style.marginTop="6px";v.style.marginRight="4px";v.style.marginLeft=(b-20-156)/2+"px";v.className="geBtn";u.appendChild(v);v=mxUtils.button(mxResources.get("find"),function(){try{q.style.backgroundColor=l()?"":"#ffcfcf"}catch(x){a.handleError(x)}});v.setAttribute("title",mxResources.get("find")+
+" (Enter)");v.style.marginTop="6px";v.className="geBtn gePrimaryBtn";u.appendChild(v);mxEvent.addListener(q,"keyup",function(a){if(91==a.keyCode||17==a.keyCode)mxEvent.consume(a);else if(27==a.keyCode)d.funct();else if(m!=q.value.toLowerCase()||13==a.keyCode)try{q.style.backgroundColor=l()?"":"#ffcfcf"}catch(A){q.style.backgroundColor="#ffcfcf"}});mxEvent.addListener(u,"keydown",function(b){70==b.keyCode&&a.keyHandler.isControlDown(b)&&!mxEvent.isShiftDown(b)&&(d.funct(),mxEvent.consume(b))});this.window=
+new mxWindow(mxResources.get("find"),u,e,c,b,k,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit();this.window.isVisible()?(q.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?q.select():document.execCommand("selectAll",!1,null),null!=a.pages&&1<a.pages.length?z.removeAttribute("disabled"):(z.checked=!1,z.setAttribute("disabled",
+"disabled"))):g.container.focus()}));this.window.setLocation=function(a,d){var b=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));d=Math.max(0,Math.min(d,b-this.table.clientHeight-48));this.getX()==a&&this.getY()==d||mxWindow.prototype.setLocation.apply(this,arguments)};var B=mxUtils.bind(this,function(){var a=this.window.getX(),
+d=this.window.getY();this.window.setLocation(a,d)});mxEvent.addListener(window,"resize",B);this.destroy=function(){mxEvent.removeListener(window,"resize",B);this.window.destroy()}},FreehandWindow=function(a,e,c,b,k){var f=a.editor.graph;a=document.createElement("div");a.style.userSelect="none";a.style.overflow="hidden";a.style.height="100%";var l=mxUtils.button(mxResources.get("startDrawing"),function(){f.freehand.isDrawing()&&f.freehand.stopDrawing();f.freehand.startDrawing()});l.setAttribute("title",
mxResources.get("startDrawing"));l.style.marginTop="8px";l.style.marginRight="4px";l.style.width="160px";l.style.overflow="hidden";l.style.textOverflow="ellipsis";l.style.textAlign="center";l.className="geBtn gePrimaryBtn";a.appendChild(l);var d=l.cloneNode(!1);mxUtils.write(d,mxResources.get("stopDrawing"));d.setAttribute("title",mxResources.get("stopDrawing"));d.style.marginTop="4px";mxEvent.addListener(d,"click",function(){f.freehand.stopDrawing()});a.appendChild(d);this.window=new mxWindow(mxResources.get("freehand"),
a,e,c,b,k,!0,!0);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!1);this.window.setClosable(!0);f.addListener("freehandStateChanged",mxUtils.bind(this,function(){d.className="geBtn"+(f.freehand.isDrawing()?" gePrimaryBtn":"")}));this.window.addListener("show",mxUtils.bind(this,function(){this.window.fit()}));this.window.addListener("hide",mxUtils.bind(this,function(){f.freehand.isDrawing()&&f.freehand.stopDrawing()}));this.window.setLocation=function(a,d){var b=
window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));d=Math.max(0,Math.min(d,b-this.table.clientHeight-48));this.getX()==a&&this.getY()==d||mxWindow.prototype.setLocation.apply(this,arguments)};var g=mxUtils.bind(this,function(){var a=this.window.getX(),d=this.window.getY();this.window.setLocation(a,d)});mxEvent.addListener(window,"resize",
@@ -8776,17 +8776,17 @@ this.window.setLocation(a,d)});mxEvent.addListener(window,"resize",p);this.destr
"32px"):e==a.trello&&(l=mxResources.get("trello"),d.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizeThisAppIn",[l]));var g=document.createElement("input");g.setAttribute("type","checkbox");l=mxUtils.button(mxResources.get("authorize"),function(){b(g.checked)});l.insertBefore(d,l.firstChild);l.style.marginTop="6px";l.className="geBigButton";l.style.fontSize="18px";l.style.padding="14px";k.appendChild(f);k.appendChild(a);k.appendChild(l);
c&&(c=document.createElement("p"),c.style.marginTop="20px",c.appendChild(g),f=document.createElement("span"),mxUtils.write(f," "+mxResources.get("rememberMe")),c.appendChild(f),k.appendChild(c),g.checked=!0,g.defaultChecked=!0,mxEvent.addListener(f,"click",function(a){g.checked=!g.checked;mxEvent.consume(a)}));this.container=k},MoreShapesDialog=function(a,e,c){c=null!=c?c:a.sidebar.entries;var b=document.createElement("div"),k=[];if(null!=a.sidebar.customEntries)for(var f=0;f<a.sidebar.customEntries.length;f++){for(var l=
a.sidebar.customEntries[f],d={title:a.getResource(l.title),entries:[]},g=0;g<l.entries.length;g++){var m=l.entries[g];d.entries.push({id:m.id,title:a.getResource(m.title),desc:a.getResource(m.desc),image:m.preview})}k.push(d)}for(f=0;f<c.length;f++)if(null==a.sidebar.enabledLibraries)k.push(c[f]);else{d={title:c[f].title,entries:[]};for(g=0;g<c[f].entries.length;g++)0<=mxUtils.indexOf(a.sidebar.enabledLibraries,c[f].entries[g].id)&&d.entries.push(c[f].entries[g]);0<d.entries.length&&k.push(d)}c=k;
-if(e){g=mxUtils.bind(this,function(d){for(var b=0;b<d.length;b++)(function(d){var c=q.cloneNode(!1);c.style.fontWeight="bold";c.style.backgroundColor="dark"==uiTheme?"#505759":"#e5e5e5";c.style.padding="6px 0px 6px 20px";mxUtils.write(c,d.title);n.appendChild(c);for(var e=0;e<d.entries.length;e++)(function(d){var c=q.cloneNode(!1);c.style.cursor="pointer";c.style.padding="4px 0px 4px 20px";c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.setAttribute("title",
+if(e){g=mxUtils.bind(this,function(d){for(var b=0;b<d.length;b++)(function(d){var c=t.cloneNode(!1);c.style.fontWeight="bold";c.style.backgroundColor="dark"==uiTheme?"#505759":"#e5e5e5";c.style.padding="6px 0px 6px 20px";mxUtils.write(c,d.title);n.appendChild(c);for(var e=0;e<d.entries.length;e++)(function(d){var c=t.cloneNode(!1);c.style.cursor="pointer";c.style.padding="4px 0px 4px 20px";c.style.whiteSpace="nowrap";c.style.overflow="hidden";c.style.textOverflow="ellipsis";c.setAttribute("title",
d.title+" ("+d.id+")");var g=document.createElement("input");g.setAttribute("type","checkbox");g.checked=a.sidebar.isEntryVisible(d.id);g.defaultChecked=g.checked;c.appendChild(g);mxUtils.write(c," "+d.title);n.appendChild(c);var m=function(a){if(null==a||"INPUT"!=mxEvent.getSource(a).nodeName){p.style.textAlign="center";p.style.padding="0px";p.style.color="";p.innerHTML="";if(null!=d.desc){var b=document.createElement("pre");b.style.boxSizing="border-box";b.style.fontFamily="inherit";b.style.margin=
"20px";b.style.right="0px";b.style.textAlign="left";mxUtils.write(b,d.desc);p.appendChild(b)}null!=d.imageCallback?d.imageCallback(p):null!=d.image?p.innerHTML+='<img border="0" src="'+d.image+'"/>':null==d.desc&&(p.style.padding="20px",p.style.color="rgb(179, 179, 179)",mxUtils.write(p,mxResources.get("noPreview")));null!=u&&(u.style.backgroundColor="");u=c;u.style.backgroundColor="dark"==uiTheme?"#505759":"#ebf2f9";null!=a&&mxEvent.consume(a)}};mxEvent.addListener(c,"click",m);mxEvent.addListener(c,
-"dblclick",function(a){g.checked=!g.checked;mxEvent.consume(a)});t.push(function(){return g.checked?d.id:null});0==b&&0==e&&m()})(d.entries[e])})(d[b])});f=document.createElement("div");f.className="geDialogTitle";mxUtils.write(f,mxResources.get("shapes"));f.style.position="absolute";f.style.top="0px";f.style.left="0px";f.style.lineHeight="40px";f.style.height="40px";f.style.right="0px";mxClient.IS_QUIRKS&&(f.style.width="718px");var n=document.createElement("div"),p=document.createElement("div");
+"dblclick",function(a){g.checked=!g.checked;mxEvent.consume(a)});q.push(function(){return g.checked?d.id:null});0==b&&0==e&&m()})(d.entries[e])})(d[b])});f=document.createElement("div");f.className="geDialogTitle";mxUtils.write(f,mxResources.get("shapes"));f.style.position="absolute";f.style.top="0px";f.style.left="0px";f.style.lineHeight="40px";f.style.height="40px";f.style.right="0px";mxClient.IS_QUIRKS&&(f.style.width="718px");var n=document.createElement("div"),p=document.createElement("div");
n.style.position="absolute";n.style.top="40px";n.style.left="0px";n.style.width="202px";n.style.bottom="60px";n.style.overflow="auto";mxClient.IS_QUIRKS&&(n.style.height="437px",n.style.marginTop="1px");p.style.position="absolute";p.style.left="202px";p.style.right="0px";p.style.top="40px";p.style.bottom="60px";p.style.overflow="auto";p.style.borderLeft="1px solid rgb(211, 211, 211)";p.style.textAlign="center";mxClient.IS_QUIRKS&&(p.style.width=parseInt(f.style.width)-202+"px",p.style.height=n.style.height,
-p.style.marginTop=n.style.marginTop);var u=null,t=[],q=document.createElement("div");q.style.position="relative";q.style.left="0px";q.style.right="0px";g(c);b.style.padding="30px";b.appendChild(f);b.appendChild(n);b.appendChild(p);c=document.createElement("div");c.className="geDialogFooter";c.style.position="absolute";c.style.paddingRight="16px";c.style.color="gray";c.style.left="0px";c.style.right="0px";c.style.bottom="0px";c.style.height="60px";c.style.lineHeight="52px";mxClient.IS_QUIRKS&&(c.style.width=
+p.style.marginTop=n.style.marginTop);var u=null,q=[],t=document.createElement("div");t.style.position="relative";t.style.left="0px";t.style.right="0px";g(c);b.style.padding="30px";b.appendChild(f);b.appendChild(n);b.appendChild(p);c=document.createElement("div");c.className="geDialogFooter";c.style.position="absolute";c.style.paddingRight="16px";c.style.color="gray";c.style.left="0px";c.style.right="0px";c.style.bottom="0px";c.style.height="60px";c.style.lineHeight="52px";mxClient.IS_QUIRKS&&(c.style.width=
f.style.width,c.style.paddingTop="12px");var v=document.createElement("input");v.setAttribute("type","checkbox");if(isLocalStorage||mxClient.IS_CHROMEAPP)f=document.createElement("span"),f.style.paddingRight="20px",f.appendChild(v),mxUtils.write(f," "+mxResources.get("rememberThisSetting")),v.checked=!0,v.defaultChecked=!0,mxEvent.addListener(f,"click",function(a){mxEvent.getSource(a)!=v&&(v.checked=!v.checked,mxEvent.consume(a))}),mxClient.IS_QUIRKS&&(f.style.position="relative",f.style.top="-6px"),
-c.appendChild(f);f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});f.className="geBtn";g=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var d=[],b=0;b<t.length;b++){var c=t[b].apply(this,arguments);null!=c&&d.push(c)}a.sidebar.showEntries(d.join(";"),v.checked,!0)});g.className="geBtn gePrimaryBtn"}else{var z=document.createElement("table"),f=document.createElement("tbody");b.style.height="100%";b.style.overflow="auto";g=document.createElement("tr");z.style.width=
+c.appendChild(f);f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});f.className="geBtn";g=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();for(var d=[],b=0;b<q.length;b++){var c=q[b].apply(this,arguments);null!=c&&d.push(c)}a.sidebar.showEntries(d.join(";"),v.checked,!0)});g.className="geBtn gePrimaryBtn"}else{var z=document.createElement("table"),f=document.createElement("tbody");b.style.height="100%";b.style.overflow="auto";g=document.createElement("tr");z.style.width=
"100%";e=document.createElement("td");var k=document.createElement("td"),l=document.createElement("td"),y=mxUtils.bind(this,function(d,b,c){var e=document.createElement("input");e.type="checkbox";z.appendChild(e);e.checked=a.sidebar.isEntryVisible(c);var g=document.createElement("span");mxUtils.write(g,b);b=document.createElement("div");b.style.display="block";b.appendChild(e);b.appendChild(g);mxEvent.addListener(g,"click",function(a){e.checked=!e.checked;mxEvent.consume(a)});d.appendChild(b);return function(){return e.checked?
-c:null}});g.appendChild(e);g.appendChild(k);g.appendChild(l);f.appendChild(g);z.appendChild(f);for(var t=[],A=0,f=0;f<c.length;f++)for(g=0;g<c[f].entries.length;g++)A++;for(var x=[e,k,l],B=0,f=0;f<c.length;f++)(function(a){for(var d=0;d<a.entries.length;d++){var b=a.entries[d];t.push(y(x[Math.floor(B/(A/3))],b.title,b.id));B++}})(c[f]);b.appendChild(z);c=document.createElement("div");c.style.marginTop="18px";c.style.textAlign="center";v=document.createElement("input");isLocalStorage&&(v.setAttribute("type",
-"checkbox"),v.checked=!0,v.defaultChecked=!0,c.appendChild(v),f=document.createElement("span"),mxUtils.write(f," "+mxResources.get("rememberThisSetting")),c.appendChild(f),mxEvent.addListener(f,"click",function(a){v.checked=!v.checked;mxEvent.consume(a)}));b.appendChild(c);f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});f.className="geBtn";g=mxUtils.button(mxResources.get("apply"),function(){for(var d=["search"],b=0;b<t.length;b++){var c=t[b].apply(this,arguments);null!=c&&
+c:null}});g.appendChild(e);g.appendChild(k);g.appendChild(l);f.appendChild(g);z.appendChild(f);for(var q=[],B=0,f=0;f<c.length;f++)for(g=0;g<c[f].entries.length;g++)B++;for(var x=[e,k,l],A=0,f=0;f<c.length;f++)(function(a){for(var d=0;d<a.entries.length;d++){var b=a.entries[d];q.push(y(x[Math.floor(A/(B/3))],b.title,b.id));A++}})(c[f]);b.appendChild(z);c=document.createElement("div");c.style.marginTop="18px";c.style.textAlign="center";v=document.createElement("input");isLocalStorage&&(v.setAttribute("type",
+"checkbox"),v.checked=!0,v.defaultChecked=!0,c.appendChild(v),f=document.createElement("span"),mxUtils.write(f," "+mxResources.get("rememberThisSetting")),c.appendChild(f),mxEvent.addListener(f,"click",function(a){v.checked=!v.checked;mxEvent.consume(a)}));b.appendChild(c);f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});f.className="geBtn";g=mxUtils.button(mxResources.get("apply"),function(){for(var d=["search"],b=0;b<q.length;b++){var c=q[b].apply(this,arguments);null!=c&&
d.push(c)}a.sidebar.showEntries(0<d.length?d.join(";"):"",v.checked);a.hideDialog()});g.className="geBtn gePrimaryBtn";c=document.createElement("div");c.style.marginTop="26px";c.style.textAlign="right"}a.editor.cancelFirst?(c.appendChild(f),c.appendChild(g)):(c.appendChild(g),c.appendChild(f));b.appendChild(c);this.container=b},PluginsDialog=function(a){function e(){if(0==k.length)b.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{b.innerHTML="";for(var d=0;d<k.length;d++){var c=
document.createElement("span");c.style.whiteSpace="nowrap";var g=document.createElement("span");g.className="geSprite geSprite-delete";g.style.position="relative";g.style.cursor="pointer";g.style.top="5px";g.style.marginRight="4px";g.style.display="inline-block";c.appendChild(g);mxUtils.write(c,k[d]);b.appendChild(c);mxUtils.br(b);mxEvent.addListener(g,"click",function(d){return function(){a.confirm(mxResources.get("delete")+' "'+k[d]+'"?',function(){k.splice(d,1);e()})}}(d))}}}var c=document.createElement("div"),
b=document.createElement("div");b.style.height="120px";b.style.overflow="auto";var k=mxSettings.getPlugins().slice();c.appendChild(b);e();var f=mxUtils.button(mxResources.get("add"),function(){var d="",b=urlParams.p;if(null!=b&&0<b.length){for(var c=b.split(";"),b=0;b<c.length;b++){var g=App.pluginRegistry[c[b]];null!=g&&(d+=g+";")}";"==d.charAt(d.length-1)&&(d=d.substring(0,d.length-1))}d=new FilenameDialog(a,d,mxResources.get("add"),function(a){if(null!=a&&0<a.length){c=a.split(";");for(a=0;a<c.length;a++){var d=
@@ -8798,80 +8798,80 @@ n.appendChild(u);g.className="cr-rotate-controls";g.style["float"]="right";g.sty
size:"original"}).then(function(d){c(d);a.hideDialog()})});g.className="geBtn gePrimaryBtn";m=document.createElement("div");m.style.marginTop="20px";m.style.textAlign="right";a.editor.cancelFirst?(m.appendChild(d),m.appendChild(g)):(m.appendChild(g),m.appendChild(d));k.appendChild(m);this.container=k},EditGeometryDialog=function(a,e){var c=a.editor.graph,b=1==e.length?c.getCellGeometry(e[0]):null,k=document.createElement("div"),f=document.createElement("table"),l=document.createElement("tbody"),d=
document.createElement("tr"),g=document.createElement("td"),m=document.createElement("td");f.style.paddingLeft="6px";mxUtils.write(g,mxResources.get("relative")+":");var n=document.createElement("input");n.setAttribute("type","checkbox");null!=b&&b.relative&&(n.setAttribute("checked","checked"),n.defaultChecked=!0);this.init=function(){n.focus()};m.appendChild(n);d.appendChild(g);d.appendChild(m);l.appendChild(d);d=document.createElement("tr");g=document.createElement("td");m=document.createElement("td");
mxUtils.write(g,mxResources.get("left")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.width="100px";p.value=null!=b?b.x:"";m.appendChild(p);d.appendChild(g);d.appendChild(m);l.appendChild(d);d=document.createElement("tr");g=document.createElement("td");m=document.createElement("td");mxUtils.write(g,mxResources.get("top")+":");var u=document.createElement("input");u.setAttribute("type","text");u.style.width="100px";u.value=null!=b?b.y:"";m.appendChild(u);d.appendChild(g);
-d.appendChild(m);l.appendChild(d);d=document.createElement("tr");g=document.createElement("td");m=document.createElement("td");mxUtils.write(g,mxResources.get("dx")+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=b&&null!=b.offset?b.offset.x:"";m.appendChild(t);d.appendChild(g);d.appendChild(m);l.appendChild(d);d=document.createElement("tr");g=document.createElement("td");m=document.createElement("td");mxUtils.write(g,mxResources.get("dy")+
-":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=null!=b&&null!=b.offset?b.offset.y:"";m.appendChild(q);d.appendChild(g);d.appendChild(m);l.appendChild(d);d=document.createElement("tr");g=document.createElement("td");m=document.createElement("td");mxUtils.write(g,mxResources.get("width")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=null!=b?b.width:"";m.appendChild(v);d.appendChild(g);d.appendChild(m);
+d.appendChild(m);l.appendChild(d);d=document.createElement("tr");g=document.createElement("td");m=document.createElement("td");mxUtils.write(g,mxResources.get("dx")+":");var q=document.createElement("input");q.setAttribute("type","text");q.style.width="100px";q.value=null!=b&&null!=b.offset?b.offset.x:"";m.appendChild(q);d.appendChild(g);d.appendChild(m);l.appendChild(d);d=document.createElement("tr");g=document.createElement("td");m=document.createElement("td");mxUtils.write(g,mxResources.get("dy")+
+":");var t=document.createElement("input");t.setAttribute("type","text");t.style.width="100px";t.value=null!=b&&null!=b.offset?b.offset.y:"";m.appendChild(t);d.appendChild(g);d.appendChild(m);l.appendChild(d);d=document.createElement("tr");g=document.createElement("td");m=document.createElement("td");mxUtils.write(g,mxResources.get("width")+":");var v=document.createElement("input");v.setAttribute("type","text");v.style.width="100px";v.value=null!=b?b.width:"";m.appendChild(v);d.appendChild(g);d.appendChild(m);
l.appendChild(d);d=document.createElement("tr");g=document.createElement("td");m=document.createElement("td");mxUtils.write(g,mxResources.get("height")+":");var z=document.createElement("input");z.setAttribute("type","text");z.style.width="100px";z.value=null!=b?b.height:"";m.appendChild(z);d.appendChild(g);d.appendChild(m);l.appendChild(d);d=document.createElement("tr");g=document.createElement("td");m=document.createElement("td");mxUtils.write(g,mxResources.get("rotation")+":");var y=document.createElement("input");
-y.setAttribute("type","text");y.style.width="100px";y.value=1==e.length?mxUtils.getValue(c.getCellStyle(e[0]),mxConstants.STYLE_ROTATION,0):"";m.appendChild(y);d.appendChild(g);d.appendChild(m);l.appendChild(d);f.appendChild(l);k.appendChild(f);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";var A=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();c.getModel().beginUpdate();try{for(var d=0;d<e.length;d++){var b=c.getCellGeometry(e[d]);null!=
-b&&(b=b.clone(),c.isCellMovable(e[d])&&(b.relative=n.checked,0<mxUtils.trim(p.value).length&&(b.x=Number(p.value)),0<mxUtils.trim(u.value).length&&(b.y=Number(u.value)),0<mxUtils.trim(t.value).length&&(null==b.offset&&(b.offset=new mxPoint),b.offset.x=Number(t.value)),0<mxUtils.trim(q.value).length&&(null==b.offset&&(b.offset=new mxPoint),b.offset.y=Number(q.value))),c.isCellResizable(e[d])&&(0<mxUtils.trim(v.value).length&&(b.width=Number(v.value)),0<mxUtils.trim(z.value).length&&(b.height=Number(z.value))),
-c.getModel().setGeometry(e[d],b));0<mxUtils.trim(y.value).length&&c.setCellStyles(mxConstants.STYLE_ROTATION,Number(y.value),[e[d]])}}finally{c.getModel().endUpdate()}});A.className="geBtn gePrimaryBtn";mxEvent.addListener(k,"keypress",function(a){13==a.keyCode&&A.click()});f=document.createElement("div");f.style.marginTop="20px";f.style.textAlign="right";a.editor.cancelFirst?(f.appendChild(b),f.appendChild(A)):(f.appendChild(A),f.appendChild(b));k.appendChild(f);this.container=k},LibraryDialog=function(a,
-e,c,b,k,f){function l(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=t;)a=a.parentNode;var d=null;if(null!=a)for(var b=t.firstChild,d=0;null!=b&&b!=a;)b=b.nextSibling,d++;return d}function d(b,c,e,g,m,f,k,p,u){try{if(a.spinner.stop(),null==c||"image/"==c.substring(0,6))if(null==b&&null!=k||null==v[b]){var J=function(){I.innerHTML="";I.style.cursor="pointer";I.style.whiteSpace="nowrap";I.style.textOverflow="ellipsis";mxUtils.write(I,null!=F.title&&0<F.title.length?F.title:
-mxResources.get("untitled"));I.style.color=null==F.title||0==F.title.length?"#d0d0d0":""};t.style.backgroundImage="";q.style.display="none";var H=m,K=f;if(m>a.maxImageSize||f>a.maxImageSize){var C=Math.min(1,Math.min(a.maxImageSize/Math.max(1,m)),a.maxImageSize/Math.max(1,f));m*=C;f*=C}H>K?(K=Math.round(100*K/H),H=100):(H=Math.round(100*H/K),K=100);var y=document.createElement("div");y.setAttribute("draggable","true");y.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";y.style.position="relative";
-y.style.cursor="move";mxUtils.setPrefixedStyle(y.style,"transition","transform .1s ease-in-out");if(null!=b){var D=document.createElement("img");D.setAttribute("src",x.convert(b));D.style.width=H+"px";D.style.height=K+"px";D.style.margin="10px";D.style.paddingBottom=Math.floor((100-K)/2)+"px";D.style.paddingLeft=Math.floor((100-H)/2)+"px";y.appendChild(D)}else if(null!=k){var L=a.stringToCells(Graph.decompress(k.xml));0<L.length&&(a.sidebar.createThumb(L,100,100,y,null,!0,!1),y.firstChild.style.display=
+y.setAttribute("type","text");y.style.width="100px";y.value=1==e.length?mxUtils.getValue(c.getCellStyle(e[0]),mxConstants.STYLE_ROTATION,0):"";m.appendChild(y);d.appendChild(g);d.appendChild(m);l.appendChild(d);f.appendChild(l);k.appendChild(f);b=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});b.className="geBtn";var B=mxUtils.button(mxResources.get("apply"),function(){a.hideDialog();c.getModel().beginUpdate();try{for(var d=0;d<e.length;d++){var b=c.getCellGeometry(e[d]);null!=
+b&&(b=b.clone(),c.isCellMovable(e[d])&&(b.relative=n.checked,0<mxUtils.trim(p.value).length&&(b.x=Number(p.value)),0<mxUtils.trim(u.value).length&&(b.y=Number(u.value)),0<mxUtils.trim(q.value).length&&(null==b.offset&&(b.offset=new mxPoint),b.offset.x=Number(q.value)),0<mxUtils.trim(t.value).length&&(null==b.offset&&(b.offset=new mxPoint),b.offset.y=Number(t.value))),c.isCellResizable(e[d])&&(0<mxUtils.trim(v.value).length&&(b.width=Number(v.value)),0<mxUtils.trim(z.value).length&&(b.height=Number(z.value))),
+c.getModel().setGeometry(e[d],b));0<mxUtils.trim(y.value).length&&c.setCellStyles(mxConstants.STYLE_ROTATION,Number(y.value),[e[d]])}}finally{c.getModel().endUpdate()}});B.className="geBtn gePrimaryBtn";mxEvent.addListener(k,"keypress",function(a){13==a.keyCode&&B.click()});f=document.createElement("div");f.style.marginTop="20px";f.style.textAlign="right";a.editor.cancelFirst?(f.appendChild(b),f.appendChild(B)):(f.appendChild(B),f.appendChild(b));k.appendChild(f);this.container=k},LibraryDialog=function(a,
+e,c,b,k,f){function l(a){for(a=document.elementFromPoint(a.clientX,a.clientY);null!=a&&a.parentNode!=q;)a=a.parentNode;var d=null;if(null!=a)for(var b=q.firstChild,d=0;null!=b&&b!=a;)b=b.nextSibling,d++;return d}function d(b,c,e,g,m,f,k,p,u){try{if(a.spinner.stop(),null==c||"image/"==c.substring(0,6))if(null==b&&null!=k||null==v[b]){var J=function(){I.innerHTML="";I.style.cursor="pointer";I.style.whiteSpace="nowrap";I.style.textOverflow="ellipsis";mxUtils.write(I,null!=E.title&&0<E.title.length?E.title:
+mxResources.get("untitled"));I.style.color=null==E.title||0==E.title.length?"#d0d0d0":""};q.style.backgroundImage="";t.style.display="none";var G=m,C=f;if(m>a.maxImageSize||f>a.maxImageSize){var K=Math.min(1,Math.min(a.maxImageSize/Math.max(1,m)),a.maxImageSize/Math.max(1,f));m*=K;f*=K}G>C?(C=Math.round(100*C/G),G=100):(G=Math.round(100*G/C),C=100);var y=document.createElement("div");y.setAttribute("draggable","true");y.style.display=mxClient.IS_QUIRKS?"inline":"inline-block";y.style.position="relative";
+y.style.cursor="move";mxUtils.setPrefixedStyle(y.style,"transition","transform .1s ease-in-out");if(null!=b){var D=document.createElement("img");D.setAttribute("src",x.convert(b));D.style.width=G+"px";D.style.height=C+"px";D.style.margin="10px";D.style.paddingBottom=Math.floor((100-C)/2)+"px";D.style.paddingLeft=Math.floor((100-G)/2)+"px";y.appendChild(D)}else if(null!=k){var L=a.stringToCells(Graph.decompress(k.xml));0<L.length&&(a.sidebar.createThumb(L,100,100,y,null,!0,!1),y.firstChild.style.display=
mxClient.IS_QUIRKS?"inline":"inline-block",y.firstChild.style.cursor="")}var M=document.createElement("img");M.setAttribute("src",Editor.closeImage);M.setAttribute("border","0");M.setAttribute("title",mxResources.get("delete"));M.setAttribute("align","top");M.style.paddingTop="4px";M.style.position="absolute";M.style.marginLeft="-12px";M.style.zIndex="1";M.style.cursor="pointer";mxEvent.addListener(M,"dragstart",function(a){mxEvent.consume(a)});(function(a,d,b){mxEvent.addListener(M,"click",function(c){v[d]=
-null;for(var e=0;e<n.length;e++)if(null!=n[e].data&&n[e].data==d||null!=n[e].xml&&null!=b&&n[e].xml==b.xml){n.splice(e,1);break}y.parentNode.removeChild(a);0==n.length&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",q.style.display="");mxEvent.consume(c)});mxEvent.addListener(M,"dblclick",function(a){mxEvent.consume(a)})})(y,b,k);y.appendChild(M);y.style.marginBottom="30px";var I=document.createElement("div");I.style.position="absolute";I.style.boxSizing="border-box";I.style.bottom=
-"-18px";I.style.left="10px";I.style.right="10px";I.style.backgroundColor="#ffffff";I.style.overflow="hidden";I.style.textAlign="center";var F=null;null!=b?(F={data:b,w:m,h:f,title:u},null!=p&&(F.aspect=p),v[b]=D,n.push(F)):null!=k&&(k.aspect="fixed",n.push(k),F=k);mxEvent.addListener(I,"keydown",function(a){13==a.keyCode&&null!=A&&(A(),A=null,mxEvent.consume(a))});J();y.appendChild(I);mxEvent.addListener(I,"mousedown",function(a){"true"!=I.getAttribute("contentEditable")&&mxEvent.consume(a)});L=function(d){if(mxClient.IS_IOS||
-mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var b=new FilenameDialog(a,F.title||"",mxResources.get("ok"),function(a){null!=a&&(F.title=a,J())},mxResources.get("enterValue"));a.showDialog(b.container,300,80,!0,!0);b.init();mxEvent.consume(d)}else if("true"!=I.getAttribute("contentEditable")){null!=A&&(A(),A=null);if(null==F.title||0==F.title.length)I.innerHTML="";I.style.textOverflow="";I.style.whiteSpace="";I.style.cursor="text";I.style.color="";I.setAttribute("contentEditable",
-"true");mxUtils.setPrefixedStyle(I.style,"user-select","text");I.focus();document.execCommand("selectAll",!1,null);A=function(){I.removeAttribute("contentEditable");I.style.cursor="pointer";F.title=I.innerHTML;J()};mxEvent.consume(d)}};mxEvent.addListener(I,"click",L);mxEvent.addListener(y,"dblclick",L);t.appendChild(y);mxEvent.addListener(y,"dragstart",function(a){null==b&&null!=k&&(M.style.visibility="hidden",I.style.visibility="hidden");mxClient.IS_FF&&null!=k.xml&&a.dataTransfer.setData("Text",
-k.xml);z=l(a);mxClient.IS_GC&&(y.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(y.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(y,30);M.style.visibility="";I.style.visibility=""},0)});mxEvent.addListener(y,"dragend",function(a){"hidden"==M.style.visibility&&(M.style.visibility="",I.style.visibility="");z=null;mxUtils.setOpacity(y,100);mxUtils.setPrefixedStyle(y.style,"transform",null)})}else B||(B=!0,a.handleError({message:mxResources.get("fileExists")}));else{m=
-!1;try{if(H=mxUtils.parseXml(b),"mxlibrary"==H.documentElement.nodeName){K=JSON.parse(mxUtils.getTextContent(H.documentElement));if(null!=K&&0<K.length)for(var E=0;E<K.length;E++)null!=K[E].xml?d(null,null,0,0,0,0,K[E]):d(K[E].data,null,0,0,K[E].w,K[E].h,null,"fixed",K[E].title);m=!0}else if("mxfile"==H.documentElement.nodeName){for(var G=H.documentElement.getElementsByTagName("diagram"),E=0;E<G.length;E++){var K=mxUtils.getTextContent(G[E]),L=a.stringToCells(Graph.decompress(K)),N=a.editor.graph.getBoundingBoxFromGeometry(L);
-d(null,null,0,0,0,0,{xml:K,w:N.width,h:N.height})}m=!0}}catch(ga){}m||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ga){}return null}function g(a){a.dataTransfer.dropEffect=null!=z?"move":"copy";a.stopPropagation();a.preventDefault()}function m(b){b.stopPropagation();b.preventDefault();B=!1;y=l(b);if(null!=z)null!=y&&y<t.children.length?(n.splice(y>z?y-1:y,0,n.splice(z,1)[0]),t.insertBefore(t.children[z],t.children[y])):(n.push(n.splice(z,1)[0]),t.appendChild(t.children[z]));
-else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,C(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){d(c,null,0,0,a.width,a.height);t.scrollTop=t.scrollHeight})}b.stopPropagation();b.preventDefault()}var n=[];c=document.createElement("div");
+null;for(var e=0;e<n.length;e++)if(null!=n[e].data&&n[e].data==d||null!=n[e].xml&&null!=b&&n[e].xml==b.xml){n.splice(e,1);break}y.parentNode.removeChild(a);0==n.length&&(q.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')",t.style.display="");mxEvent.consume(c)});mxEvent.addListener(M,"dblclick",function(a){mxEvent.consume(a)})})(y,b,k);y.appendChild(M);y.style.marginBottom="30px";var I=document.createElement("div");I.style.position="absolute";I.style.boxSizing="border-box";I.style.bottom=
+"-18px";I.style.left="10px";I.style.right="10px";I.style.backgroundColor="#ffffff";I.style.overflow="hidden";I.style.textAlign="center";var E=null;null!=b?(E={data:b,w:m,h:f,title:u},null!=p&&(E.aspect=p),v[b]=D,n.push(E)):null!=k&&(k.aspect="fixed",n.push(k),E=k);mxEvent.addListener(I,"keydown",function(a){13==a.keyCode&&null!=B&&(B(),B=null,mxEvent.consume(a))});J();y.appendChild(I);mxEvent.addListener(I,"mousedown",function(a){"true"!=I.getAttribute("contentEditable")&&mxEvent.consume(a)});L=function(d){if(mxClient.IS_IOS||
+mxClient.IS_QUIRKS||mxClient.IS_FF||!(null==document.documentMode||9<document.documentMode)){var b=new FilenameDialog(a,E.title||"",mxResources.get("ok"),function(a){null!=a&&(E.title=a,J())},mxResources.get("enterValue"));a.showDialog(b.container,300,80,!0,!0);b.init();mxEvent.consume(d)}else if("true"!=I.getAttribute("contentEditable")){null!=B&&(B(),B=null);if(null==E.title||0==E.title.length)I.innerHTML="";I.style.textOverflow="";I.style.whiteSpace="";I.style.cursor="text";I.style.color="";I.setAttribute("contentEditable",
+"true");mxUtils.setPrefixedStyle(I.style,"user-select","text");I.focus();document.execCommand("selectAll",!1,null);B=function(){I.removeAttribute("contentEditable");I.style.cursor="pointer";E.title=I.innerHTML;J()};mxEvent.consume(d)}};mxEvent.addListener(I,"click",L);mxEvent.addListener(y,"dblclick",L);q.appendChild(y);mxEvent.addListener(y,"dragstart",function(a){null==b&&null!=k&&(M.style.visibility="hidden",I.style.visibility="hidden");mxClient.IS_FF&&null!=k.xml&&a.dataTransfer.setData("Text",
+k.xml);z=l(a);mxClient.IS_GC&&(y.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(y.style,"transform","scale(0.5,0.5)");mxUtils.setOpacity(y,30);M.style.visibility="";I.style.visibility=""},0)});mxEvent.addListener(y,"dragend",function(a){"hidden"==M.style.visibility&&(M.style.visibility="",I.style.visibility="");z=null;mxUtils.setOpacity(y,100);mxUtils.setPrefixedStyle(y.style,"transform",null)})}else A||(A=!0,a.handleError({message:mxResources.get("fileExists")}));else{m=
+!1;try{if(G=mxUtils.parseXml(b),"mxlibrary"==G.documentElement.nodeName){C=JSON.parse(mxUtils.getTextContent(G.documentElement));if(null!=C&&0<C.length)for(var F=0;F<C.length;F++)null!=C[F].xml?d(null,null,0,0,0,0,C[F]):d(C[F].data,null,0,0,C[F].w,C[F].h,null,"fixed",C[F].title);m=!0}else if("mxfile"==G.documentElement.nodeName){for(var H=G.documentElement.getElementsByTagName("diagram"),F=0;F<H.length;F++){var C=mxUtils.getTextContent(H[F]),L=a.stringToCells(Graph.decompress(C)),N=a.editor.graph.getBoundingBoxFromGeometry(L);
+d(null,null,0,0,0,0,{xml:C,w:N.width,h:N.height})}m=!0}}catch(ga){}m||(a.spinner.stop(),a.handleError({message:mxResources.get("errorLoadingFile")}))}}catch(ga){}return null}function g(a){a.dataTransfer.dropEffect=null!=z?"move":"copy";a.stopPropagation();a.preventDefault()}function m(b){b.stopPropagation();b.preventDefault();A=!1;y=l(b);if(null!=z)null!=y&&y<q.children.length?(n.splice(y>z?y-1:y,0,n.splice(z,1)[0]),q.insertBefore(q.children[z],q.children[y])):(n.push(n.splice(z,1)[0]),q.appendChild(q.children[z]));
+else if(0<b.dataTransfer.files.length)a.importFiles(b.dataTransfer.files,0,0,a.maxImageSize,C(b));else if(0<=mxUtils.indexOf(b.dataTransfer.types,"text/uri-list")){var c=decodeURIComponent(b.dataTransfer.getData("text/uri-list"));(/(\.jpg)($|\?)/i.test(c)||/(\.png)($|\?)/i.test(c)||/(\.gif)($|\?)/i.test(c)||/(\.svg)($|\?)/i.test(c))&&a.loadImage(c,function(a){d(c,null,0,0,a.width,a.height);q.scrollTop=q.scrollHeight})}b.stopPropagation();b.preventDefault()}var n=[];c=document.createElement("div");
c.style.height="100%";var p=document.createElement("div");p.style.whiteSpace="nowrap";p.style.height="40px";c.appendChild(p);mxUtils.write(p,mxResources.get("filename")+":");null==e&&(e=a.defaultLibraryName+".xml");var u=document.createElement("input");u.setAttribute("value",e);u.style.marginRight="20px";u.style.marginLeft="10px";u.style.width="500px";null==k||k.isRenamable()||u.setAttribute("disabled","true");this.init=function(){if(null==k||k.isRenamable())u.focus(),mxClient.IS_GC||mxClient.IS_FF||
-5<=document.documentMode||mxClient.IS_QUIRKS?u.select():document.execCommand("selectAll",!1,null)};p.appendChild(u);var t=document.createElement("div");t.style.borderWidth="1px 0px 1px 0px";t.style.borderColor="#d3d3d3";t.style.borderStyle="solid";t.style.marginTop="6px";t.style.overflow="auto";t.style.height="340px";t.style.backgroundPosition="center center";t.style.backgroundRepeat="no-repeat";0==n.length&&Graph.fileSupport&&(t.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var q=
-document.createElement("div");q.style.position="absolute";q.style.width="640px";q.style.top="260px";q.style.textAlign="center";q.style.fontSize="22px";q.style.color="#a0c3ff";mxUtils.write(q,mxResources.get("dragImagesHere"));c.appendChild(q);var v={},z=null,y=null,A=null;e=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=A&&(A(),A=null,mxEvent.consume(a))};mxEvent.addListener(t,"mousedown",e);mxEvent.addListener(t,"pointerdown",e);mxEvent.addListener(t,"touchstart",
-e);var x=new mxUrlConverter,B=!1;if(null!=b)for(e=0;e<b.length;e++)p=b[e],d(p.data,null,0,0,p.w,p.h,p,p.aspect,p.title);mxEvent.addListener(t,"dragleave",function(a){q.style.cursor="";for(var d=mxEvent.getSource(a);null!=d;){if(d==t||d==q){a.stopPropagation();a.preventDefault();break}d=d.parentNode}});var C=function(b){return function(c,e,g,m,f,n,k,p,l){null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l.name)||/(\.vs(x|sx?))($|\?)/i.test(l.name))?a.importVisio(l,mxUtils.bind(this,function(a){d(a,e,g,m,f,n,
-k,"fixed",mxEvent.isAltDown(b)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g," "))})):null!=l&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,l.name)?a.parseFile(l,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=c.status&&(d(c.responseText,e,g,m,f,n,k,"fixed",mxEvent.isAltDown(b)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g," ")),t.scrollTop=t.scrollHeight))})):(d(c,e,g,m,f,n,k,"fixed",mxEvent.isAltDown(b)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g,
-" ")),t.scrollTop=t.scrollHeight)}};mxEvent.addListener(t,"dragover",g);mxEvent.addListener(t,"drop",m);mxEvent.addListener(q,"dragover",g);mxEvent.addListener(q,"drop",m);c.appendChild(t);b=document.createElement("div");b.style.textAlign="right";b.style.marginTop="20px";e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});e.setAttribute("id","btnCancel");e.className="geBtn";a.editor.cancelFirst&&b.appendChild(e);p=mxUtils.button(mxResources.get("export"),function(){var d=a.createLibraryDataFromImages(n),
+5<=document.documentMode||mxClient.IS_QUIRKS?u.select():document.execCommand("selectAll",!1,null)};p.appendChild(u);var q=document.createElement("div");q.style.borderWidth="1px 0px 1px 0px";q.style.borderColor="#d3d3d3";q.style.borderStyle="solid";q.style.marginTop="6px";q.style.overflow="auto";q.style.height="340px";q.style.backgroundPosition="center center";q.style.backgroundRepeat="no-repeat";0==n.length&&Graph.fileSupport&&(q.style.backgroundImage="url('"+IMAGE_PATH+"/droptarget.png')");var t=
+document.createElement("div");t.style.position="absolute";t.style.width="640px";t.style.top="260px";t.style.textAlign="center";t.style.fontSize="22px";t.style.color="#a0c3ff";mxUtils.write(t,mxResources.get("dragImagesHere"));c.appendChild(t);var v={},z=null,y=null,B=null;e=function(a){"true"!=mxEvent.getSource(a).getAttribute("contentEditable")&&null!=B&&(B(),B=null,mxEvent.consume(a))};mxEvent.addListener(q,"mousedown",e);mxEvent.addListener(q,"pointerdown",e);mxEvent.addListener(q,"touchstart",
+e);var x=new mxUrlConverter,A=!1;if(null!=b)for(e=0;e<b.length;e++)p=b[e],d(p.data,null,0,0,p.w,p.h,p,p.aspect,p.title);mxEvent.addListener(q,"dragleave",function(a){t.style.cursor="";for(var d=mxEvent.getSource(a);null!=d;){if(d==q||d==t){a.stopPropagation();a.preventDefault();break}d=d.parentNode}});var C=function(b){return function(c,e,g,m,f,n,k,p,l){null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l.name)||/(\.vs(x|sx?))($|\?)/i.test(l.name))?a.importVisio(l,mxUtils.bind(this,function(a){d(a,e,g,m,f,n,
+k,"fixed",mxEvent.isAltDown(b)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g," "))})):null!=l&&!a.isOffline()&&(new XMLHttpRequest).upload&&a.isRemoteFileFormat(c,l.name)?a.parseFile(l,mxUtils.bind(this,function(c){4==c.readyState&&(a.spinner.stop(),200<=c.status&&299>=c.status&&(d(c.responseText,e,g,m,f,n,k,"fixed",mxEvent.isAltDown(b)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g," ")),q.scrollTop=q.scrollHeight))})):(d(c,e,g,m,f,n,k,"fixed",mxEvent.isAltDown(b)?null:k.substring(0,k.lastIndexOf(".")).replace(/_/g,
+" ")),q.scrollTop=q.scrollHeight)}};mxEvent.addListener(q,"dragover",g);mxEvent.addListener(q,"drop",m);mxEvent.addListener(t,"dragover",g);mxEvent.addListener(t,"drop",m);c.appendChild(q);b=document.createElement("div");b.style.textAlign="right";b.style.marginTop="20px";e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog(!0)});e.setAttribute("id","btnCancel");e.className="geBtn";a.editor.cancelFirst&&b.appendChild(e);p=mxUtils.button(mxResources.get("export"),function(){var d=a.createLibraryDataFromImages(n),
b=u.value;/(\.xml)$/i.test(b)||(b+=".xml");a.isLocalFileSave()?a.saveLocalFile(d,b,"text/xml",null,null,!0):(new mxXmlRequest(SAVE_URL,"filename="+encodeURIComponent(b)+"&format=xml&xml="+encodeURIComponent(d))).simulate(document,"_blank")});p.setAttribute("id","btnDownload");p.className="geBtn";b.appendChild(p);if(Graph.fileSupport){if(null==a.libDlgFileInputElt){var D=document.createElement("input");D.setAttribute("multiple","multiple");D.setAttribute("type","file");mxEvent.addListener(D,"change",
-function(d){B=!1;a.importFiles(D.files,0,0,a.maxImageSize,function(a,b,c,e,g,m,f,n,k){null!=D.files&&(C(d)(a,b,c,e,g,m,f,n,k),D.type="",D.type="file",D.value="")});t.scrollTop=t.scrollHeight});D.style.display="none";document.body.appendChild(D);a.libDlgFileInputElt=D}p=mxUtils.button(mxResources.get("import"),function(){null!=A&&(A(),A=null);a.libDlgFileInputElt.click()});p.setAttribute("id","btnAddImage");p.className="geBtn";b.appendChild(p)}p=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=
-A&&(A(),A=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){B=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var e=a.indexOf(",");0<e&&(a=a.substring(0,e)+";base64,"+a.substring(e+1))}d(a,null,0,0,b,c);t.scrollTop=t.scrollHeight}})});p.setAttribute("id","btnAddImageUrl");p.className="geBtn";b.appendChild(p);this.saveBtnClickHandler=function(d,b,c,e){a.saveLibrary(d,b,c,e)};p=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=A&&(A(),A=null);this.saveBtnClickHandler(u.value,
+function(d){A=!1;a.importFiles(D.files,0,0,a.maxImageSize,function(a,b,c,e,g,m,f,n,k){null!=D.files&&(C(d)(a,b,c,e,g,m,f,n,k),D.type="",D.type="file",D.value="")});q.scrollTop=q.scrollHeight});D.style.display="none";document.body.appendChild(D);a.libDlgFileInputElt=D}p=mxUtils.button(mxResources.get("import"),function(){null!=B&&(B(),B=null);a.libDlgFileInputElt.click()});p.setAttribute("id","btnAddImage");p.className="geBtn";b.appendChild(p)}p=mxUtils.button(mxResources.get("addImageUrl"),function(){null!=
+B&&(B(),B=null);a.showImageDialog(mxResources.get("addImageUrl"),"",function(a,b,c){A=!1;if(null!=a){if("data:image/"==a.substring(0,11)){var e=a.indexOf(",");0<e&&(a=a.substring(0,e)+";base64,"+a.substring(e+1))}d(a,null,0,0,b,c);q.scrollTop=q.scrollHeight}})});p.setAttribute("id","btnAddImageUrl");p.className="geBtn";b.appendChild(p);this.saveBtnClickHandler=function(d,b,c,e){a.saveLibrary(d,b,c,e)};p=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=B&&(B(),B=null);this.saveBtnClickHandler(u.value,
n,k,f)}));p.setAttribute("id","btnSave");p.className="geBtn gePrimaryBtn";b.appendChild(p);a.editor.cancelFirst||b.appendChild(e);c.appendChild(b);this.container=c},EditShapeDialog=function(a,e,c,b,k){b=null!=b?b:300;k=null!=k?k:120;var f,l,d=document.createElement("table"),g=document.createElement("tbody");d.style.cellPadding="4px";f=document.createElement("tr");l=document.createElement("td");l.setAttribute("colspan","2");l.style.fontSize="10pt";mxUtils.write(l,c);f.appendChild(l);g.appendChild(f);
f=document.createElement("tr");l=document.createElement("td");var m=document.createElement("textarea");m.style.outline="none";m.style.resize="none";m.style.width=b-200+"px";m.style.height=k+"px";this.textarea=m;this.init=function(){m.focus();m.scrollTop=0};l.appendChild(m);f.appendChild(l);l=document.createElement("td");c=document.createElement("div");c.style.position="relative";c.style.border="1px solid gray";c.style.top="6px";c.style.width="200px";c.style.height=k+4+"px";c.style.overflow="hidden";
c.style.marginBottom="16px";mxEvent.disableContextMenu(c);l.appendChild(c);var n=new Graph(c);n.setEnabled(!1);var p=a.editor.graph.cloneCell(e);n.addCells([p]);c=n.view.getState(p);var u="";null!=c.shape&&null!=c.shape.stencil&&(u=mxUtils.getPrettyXml(c.shape.stencil.desc));mxUtils.write(m,u||"");c=n.getGraphBounds();k=Math.min(160/c.width,(k-40)/c.height);n.view.scaleAndTranslate(k,20/k-c.x,20/k-c.y);f.appendChild(l);g.appendChild(f);f=document.createElement("tr");l=document.createElement("td");
-l.setAttribute("colspan","2");l.style.paddingTop="2px";l.style.whiteSpace="nowrap";l.setAttribute("align","right");a.isOffline()||(k=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),k.className="geBtn",l.appendChild(k));k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";a.editor.cancelFirst&&l.appendChild(k);var t=function(d,b,c){var e=m.value,g=mxUtils.parseXml(e),e=mxUtils.getPrettyXml(g.documentElement),
-g=g.documentElement.getElementsByTagName("parsererror");if(null!=g&&0<g.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(c&&a.hideDialog(),g=!d.model.contains(b),!c||g||e!=u){e=Graph.compress(e);d.getModel().beginUpdate();try{if(g){var f=a.editor.graph.getFreeInsertPoint();b.geometry.x=f.x;b.geometry.y=f.y;d.addCell(b)}d.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+e+")",[b])}catch(B){throw B;}finally{d.getModel().endUpdate()}g&&
-(d.setSelectionCell(b),d.scrollCellToVisible(b))}};c=mxUtils.button(mxResources.get("preview"),function(){t(n,p,!1)});c.className="geBtn";l.appendChild(c);c=mxUtils.button(mxResources.get("apply"),function(){t(a.editor.graph,e,!0)});c.className="geBtn gePrimaryBtn";l.appendChild(c);a.editor.cancelFirst||l.appendChild(k);f.appendChild(l);g.appendChild(f);d.appendChild(g);this.container=d},CustomDialog=function(a,e,c,b,k,f,l,d){var g=document.createElement("div");g.appendChild(e);e=document.createElement("div");
+l.setAttribute("colspan","2");l.style.paddingTop="2px";l.style.whiteSpace="nowrap";l.setAttribute("align","right");a.isOffline()||(k=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://desk.draw.io/support/solutions/articles/16000052874")}),k.className="geBtn",l.appendChild(k));k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";a.editor.cancelFirst&&l.appendChild(k);var q=function(d,b,c){var e=m.value,g=mxUtils.parseXml(e),e=mxUtils.getPrettyXml(g.documentElement),
+g=g.documentElement.getElementsByTagName("parsererror");if(null!=g&&0<g.length)a.showError(mxResources.get("error"),mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(c&&a.hideDialog(),g=!d.model.contains(b),!c||g||e!=u){e=Graph.compress(e);d.getModel().beginUpdate();try{if(g){var f=a.editor.graph.getFreeInsertPoint();b.geometry.x=f.x;b.geometry.y=f.y;d.addCell(b)}d.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+e+")",[b])}catch(A){throw A;}finally{d.getModel().endUpdate()}g&&
+(d.setSelectionCell(b),d.scrollCellToVisible(b))}};c=mxUtils.button(mxResources.get("preview"),function(){q(n,p,!1)});c.className="geBtn";l.appendChild(c);c=mxUtils.button(mxResources.get("apply"),function(){q(a.editor.graph,e,!0)});c.className="geBtn gePrimaryBtn";l.appendChild(c);a.editor.cancelFirst||l.appendChild(k);f.appendChild(l);g.appendChild(f);d.appendChild(g);this.container=d},CustomDialog=function(a,e,c,b,k,f,l,d){var g=document.createElement("div");g.appendChild(e);e=document.createElement("div");
e.style.marginTop="16px";e.style.textAlign="center";null!=l&&e.appendChild(l);a.isOffline()||null==f||(l=mxUtils.button(mxResources.get("help"),function(){a.openLink(f)}),l.className="geBtn",e.appendChild(l));l=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b()});l.className="geBtn";d&&(l.style.display="none");a.editor.cancelFirst&&e.appendChild(l);k=mxUtils.button(k||mxResources.get("ok"),function(){a.hideDialog();null!=c&&c()});e.appendChild(k);k.className="geBtn gePrimaryBtn";
a.editor.cancelFirst||e.appendChild(l);g.appendChild(e);this.cancelBtn=l;this.okButton=k;this.container=g},TemplatesDialog=function(){var a='<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" placeholder="'+mxResources.get("search",null,"Search")+'"></div><div class="geTemplatesList"><div class="geTempDlgNewDiagramlbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgHLine"></div><div class="geTemplatesLbl">'+
mxResources.get("templates",null,"Templates")+'</div></div><div class="geTempDlgContent"><div class="geTempDlgNewDiagramCat"><div class="geTempDlgNewDiagramCatLbl">'+mxResources.get("newDiagram",null,"New Diagram")+'</div><div class="geTempDlgNewDiagramCatList"></div><div class="geTempDlgNewDiagramCatFooter"><div class="geTempDlgShowAllBtn">'+mxResources.get("showAll",null,"+ Show all")+'</div></div></div><div class="geTempDlgDiagramsList"><div class="geTempDlgDiagramsListHeader"><div class="geTempDlgDiagramsListTitle"></div><div class="geTempDlgDiagramsListBtns"><div class="geTempDlgRadioBtn geTempDlgRadioBtnLarge" data-id="myDiagramsBtn"><img src="/images/my-diagrams.svg" class="geTempDlgMyDiagramsBtnImg"> <span>'+
mxResources.get("myDiagrams",null,"My diagrams")+'</span></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnLarge geTempDlgRadioBtnActive" data-id="allDiagramsBtn"><img src="/images/all-diagrams-sel.svg" class="geTempDlgAllDiagramsBtnImg"> <span>'+mxResources.get("allDiagrams",null,"All diagrams")+'</span></div><div class="geTempDlgSpacer"> </div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall geTempDlgRadioBtnActive" data-id="tilesBtn"><img src="/images/tiles-sel.svg" class="geTempDlgTilesBtnImg"></div><div class="geTempDlgRadioBtn geTempDlgRadioBtnSmall" data-id="listBtn"><img src="/images/list.svg" class="geTempDlgListBtnImg"></div></div></div><div class="geTempDlgDiagramsTiles"></div></div></div><br style="clear:both;"/><div class="geTempDlgFooter"><span class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramHint">&#x1F6C8; '+
mxResources.get("linkToDiagramHint",null,"Add a link to this diagram. The diagram can only be edited from the page that owns it.")+'</span><button class="geTempDlgLinkToDiagram geTempDlgLinkToDiagramBtn">'+mxResources.get("linkToDiagram",null,"Link to Diagram")+'</button><div class="geTempDlgCreateBtn">'+mxResources.get("create",null,"Create")+'</div><div class="geTempDlgCancelBtn">'+mxResources.get("cancel",null,"Cancel")+"</div></div>",e=document.createElement("div");e.innerHTML=a;e.className="geTemplateDlg";
var a=window.innerWidth,c=window.innerHeight,b=987,k=712;.9*a<b&&(b=Math.max(.9*a,600),e.style.width=b+"px");.9*c<k&&(k=Math.max(.9*c,300),e.style.height=k+"px");this.width=b;this.height=k;this.container=e};
-TemplatesDialog.prototype.init=function(a,e,c,b,k,f,l,d,g,m){function n(){null!=G&&(G.style.fontWeight="normal",G.style.textDecoration="none",G=null)}function p(a,d,b,c,e,g,m){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";C.querySelector(".geTempDlgRadioBtn[data-id="+c+"]").className="geTempDlgRadioBtn "+(m?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");C.querySelector("."+d).src="/images/"+b+"-sel.svg";C.querySelector("."+e).src="/images/"+
-g+".svg";return!0}function u(a){function d(a){W.removeChild(c);C.removeChild(b);W.scrollTop=g}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var b=document.createElement("div");b.className="geTempDlgDialogMask";C.appendChild(b);var c=document.createElement("div");c.className="geTempDlgDiagramPreviewBox";var e=document.createElement("img");e.src=a;c.appendChild(e);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn";
-a.setAttribute("title",mxResources.get("close"));c.appendChild(a);var g=W.scrollTop;mxEvent.addListener(a,"click",d);mxEvent.addListener(b,"click",d);W.appendChild(c);W.scrollTop=0;c.style.lineHeight=c.clientHeight+"px"}function t(a,d,b){if(null!=E){for(var c=E.className.split(" "),e=0;e<c.length;e++)if(-1<c[e].indexOf("Active")){c.splice(e,1);break}E.className=c.join(" ")}null!=a?(E=a,E.className+=" "+d,J=b,Z.className="geTempDlgCreateBtn"):(J=E=null,Z.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")}
-function q(d){if(null!=J){var b=J;J=null;Z.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";b.isExternal?(1==d?m(b.url,b,"nameInput.value"):g(b.url,b,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+b.url,mxUtils.bind(this,function(d){200<=d.getStatus()&&299>=d.getStatus()&&(e(d.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function v(a){a=a?"":"none";for(var d=C.querySelectorAll(".geTempDlgLinkToDiagram"),b=0;b<d.length;b++)d[b].style.display=
-a}function z(a,d,b){function c(){Z.innerHTML=d?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));v(!d)}T.innerHTML="";t();M=a;var e=null;if(b){e=document.createElement("table");e.className="geTempDlgDiagramsListGrid";var g=document.createElement("tr"),m=document.createElement("th");m.style.width="50%";m.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));g.appendChild(m);m=document.createElement("th");m.style.width="25%";m.innerHTML=
-mxUtils.htmlEntities(mxResources.get("changedBy",null,"Changed By"));g.appendChild(m);m=document.createElement("th");m.style.width="25%";m.innerHTML=mxUtils.htmlEntities(mxResources.get("lastModifiedOn",null,"Last modified on"));g.appendChild(m);e.appendChild(g);T.appendChild(e)}for(g=0;g<a.length;g++){a[g].isExternal=!d;var f=a[g].url,m=mxUtils.htmlEntities(a[g].title),n=a[g].tooltip||a[g].title,k=a[g].imgUrl,p=mxUtils.htmlEntities(a[g].changedBy||""),l=mxUtils.htmlEntities(a[g].lastModifiedOn||
+TemplatesDialog.prototype.init=function(a,e,c,b,k,f,l,d,g,m){function n(){null!=H&&(H.style.fontWeight="normal",H.style.textDecoration="none",H=null)}function p(a,d,b,c,e,g,m){if(-1<a.className.indexOf("geTempDlgRadioBtnActive"))return!1;a.className+=" geTempDlgRadioBtnActive";C.querySelector(".geTempDlgRadioBtn[data-id="+c+"]").className="geTempDlgRadioBtn "+(m?"geTempDlgRadioBtnLarge":"geTempDlgRadioBtnSmall");C.querySelector("."+d).src="/images/"+b+"-sel.svg";C.querySelector("."+e).src="/images/"+
+g+".svg";return!0}function u(a){function d(a){X.removeChild(c);C.removeChild(b);X.scrollTop=g}a=a.prevImgUrl||a.imgUrl||TEMPLATE_PATH+"/"+a.url.substring(0,a.url.length-4)+".png";var b=document.createElement("div");b.className="geTempDlgDialogMask";C.appendChild(b);var c=document.createElement("div");c.className="geTempDlgDiagramPreviewBox";var e=document.createElement("img");e.src=a;c.appendChild(e);a=document.createElement("img");a.src="/images/close.png";a.className="geTempDlgPreviewCloseBtn";
+a.setAttribute("title",mxResources.get("close"));c.appendChild(a);var g=X.scrollTop;mxEvent.addListener(a,"click",d);mxEvent.addListener(b,"click",d);X.appendChild(c);X.scrollTop=0;c.style.lineHeight=c.clientHeight+"px"}function q(a,d,b){if(null!=F){for(var c=F.className.split(" "),e=0;e<c.length;e++)if(-1<c[e].indexOf("Active")){c.splice(e,1);break}F.className=c.join(" ")}null!=a?(F=a,F.className+=" "+d,J=b,fa.className="geTempDlgCreateBtn"):(J=F=null,fa.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled")}
+function t(d){if(null!=J){var b=J;J=null;fa.className="geTempDlgCreateBtn geTempDlgCreateBtnDisabled geTempDlgCreateBtnBusy";b.isExternal?(1==d?m(b.url,b,"nameInput.value"):g(b.url,b,"nameInput.value"),a.hideDialog(!0)):mxUtils.get(TEMPLATE_PATH+"/"+b.url,mxUtils.bind(this,function(d){200<=d.getStatus()&&299>=d.getStatus()&&(e(d.getText(),"nameInput.value"),a.hideDialog(!0))}))}}function v(a){a=a?"":"none";for(var d=C.querySelectorAll(".geTempDlgLinkToDiagram"),b=0;b<d.length;b++)d[b].style.display=
+a}function z(a,d,b){function c(){fa.innerHTML=d?mxUtils.htmlEntities(mxResources.get("create")):mxUtils.htmlEntities(mxResources.get("copy"));v(!d)}V.innerHTML="";q();M=a;var e=null;if(b){e=document.createElement("table");e.className="geTempDlgDiagramsListGrid";var g=document.createElement("tr"),m=document.createElement("th");m.style.width="50%";m.innerHTML=mxUtils.htmlEntities(mxResources.get("diagram",null,"Diagram"));g.appendChild(m);m=document.createElement("th");m.style.width="25%";m.innerHTML=
+mxUtils.htmlEntities(mxResources.get("changedBy",null,"Changed By"));g.appendChild(m);m=document.createElement("th");m.style.width="25%";m.innerHTML=mxUtils.htmlEntities(mxResources.get("lastModifiedOn",null,"Last modified on"));g.appendChild(m);e.appendChild(g);V.appendChild(e)}for(g=0;g<a.length;g++){a[g].isExternal=!d;var f=a[g].url,m=mxUtils.htmlEntities(a[g].title),n=a[g].tooltip||a[g].title,k=a[g].imgUrl,p=mxUtils.htmlEntities(a[g].changedBy||""),l=mxUtils.htmlEntities(a[g].lastModifiedOn||
"");k||(k=TEMPLATE_PATH+"/"+f.substring(0,f.length-4)+".png");f=b?50:15;null!=m&&m.length>f&&(m=m.substring(0,f)+"&hellip;");if(b){var x=document.createElement("tr"),k=document.createElement("td"),J=document.createElement("img");J.src="/images/icon-search.svg";J.className="geTempDlgDiagramListPreviewBtn";J.setAttribute("title",mxResources.get("preview"));k.appendChild(J);n=document.createElement("span");n.className="geTempDlgDiagramTitle";n.innerHTML=m;k.appendChild(n);x.appendChild(k);k=document.createElement("td");
-k.innerHTML=p;x.appendChild(k);k=document.createElement("td");k.innerHTML=l;x.appendChild(k);e.appendChild(x);null==E&&(c(),t(x,"geTempDlgDiagramsListGridActive",a[g]));(function(a,d){mxEvent.addListener(x,"click",function(){E!=d&&(c(),t(d,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(x,"dblclick",q);mxEvent.addListener(J,"click",function(){u(a)})})(a[g],x)}else{var B=document.createElement("div");B.className="geTempDlgDiagramTile";B.setAttribute("title",n);null==E&&(c(),t(B,"geTempDlgDiagramTileActive",
-a[g]));p=document.createElement("div");p.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var H=document.createElement("img");H.style.display="none";(function(a,d){H.onload=function(){d.className="geTempDlgDiagramTileImg";a.style.display=""};H.onerror=function(){d.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(H,p);H.src=k;p.appendChild(H);B.appendChild(p);p=document.createElement("div");p.className="geTempDlgDiagramTileLbl";p.innerHTML=null!=m?m:"";B.appendChild(p);
-J=document.createElement("img");J.src="/images/icon-search.svg";J.className="geTempDlgDiagramPreviewBtn";J.setAttribute("title",mxResources.get("preview"));B.appendChild(J);(function(a,d){mxEvent.addListener(B,"click",function(){E!=d&&(c(),t(d,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(B,"dblclick",q);mxEvent.addListener(J,"click",function(){u(a)})})(a[g],B);T.appendChild(B)}}}function y(a,d){X.innerHTML="";t();for(var b=!d&&5<a.length?5:a.length,c=0;c<b;c++){var e=a[c];e.isCategory=!0;
-var g=document.createElement("div"),m=mxResources.get(e.title);null==m&&(m=e.title.substring(0,1).toUpperCase()+e.title.substring(1));g.className="geTempDlgNewDiagramCatItem";g.setAttribute("title",m);m=mxUtils.htmlEntities(m);15<m.length&&(m=m.substring(0,15)+"&hellip;");null==E&&(Z.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),v(),t(g,"geTempDlgNewDiagramCatItemActive",e));var f=document.createElement("div");f.className="geTempDlgNewDiagramCatItemImg";var n=document.createElement("img");
-n.src=NEW_DIAGRAM_CATS_PATH+"/"+e.img;f.appendChild(n);g.appendChild(f);f=document.createElement("div");f.className="geTempDlgNewDiagramCatItemLbl";f.innerHTML=m;g.appendChild(f);X.appendChild(g);(function(a,d){mxEvent.addListener(g,"click",function(){E!=d&&(Z.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),v(),t(d,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(g,"dblclick",q)})(e,g)}U.style.display=5>a.length?"none":""}function A(a){var d=C.querySelector(".geTemplatesList"),
-b;for(b in a){var c=document.createElement("div"),e=mxResources.get(b),g=a[b];null==e&&(e=b.substring(0,1).toUpperCase()+b.substring(1));c.className="geTemplateCatLink";c.setAttribute("title",e+" ("+g.length+")");e=mxUtils.htmlEntities(e);15<e.length&&(e=e.substring(0,15)+"&hellip;");c.innerHTML=e+" ("+g.length+")";d.appendChild(c);(function(d,b,e){mxEvent.addListener(c,"click",function(){G!=e&&(null!=G?(G.style.fontWeight="normal",G.style.textDecoration="none"):(V.style.display="none",S.style.minHeight=
-"100%"),G=e,G.style.fontWeight="bold",G.style.textDecoration="underline",W.scrollTop=0,D&&(F=!0),ca.innerHTML=b,ba.style.display="none",z(a[d],!0))})})(b,e,c)}}function x(a){l&&(W.scrollTop=0,T.innerHTML="",aa.spin(T),F=!1,D=!0,ca.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),I=null,l(Y,a?null:f))}function B(a){n();W.scrollTop=0;T.innerHTML="";aa.spin(T);F=!1;D=!0;da=null;ca.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+
-' "'+mxUtils.htmlEntities(a)+'"';d(a,Y,H?null:f);I=a}b=null!=b?b:TEMPLATE_PATH+"/index.xml";k=null!=k?k:NEW_DIAGRAM_CATS_PATH+"/index.xml";var C=this.container,D=!1,F=!1,G=null,E=null,J=null,K=!1,H=!0,L=!1,M=[],I,U=C.querySelector(".geTempDlgShowAllBtn"),T=C.querySelector(".geTempDlgDiagramsTiles"),ca=C.querySelector(".geTempDlgDiagramsListTitle"),ba=C.querySelector(".geTempDlgDiagramsListBtns"),W=C.querySelector(".geTempDlgContent"),S=C.querySelector(".geTempDlgDiagramsList"),V=C.querySelector(".geTempDlgNewDiagramCat"),
-X=C.querySelector(".geTempDlgNewDiagramCatList"),Z=C.querySelector(".geTempDlgCreateBtn"),aa=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(C.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){n();V.style.display="";S.style.minHeight="calc(100% - 280px)";x(H)});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){p(this,"geTempDlgAllDiagramsBtnImg",
-"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(H=!0,null==I?x(H):B(I))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){p(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(H=!1,null==I?x(H):B(I))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){p(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
-"tiles",!1)&&(L=!0,z(M,!1,L))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){p(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(L=!1,z(M,!1,L))});mxEvent.addListener(U,"click",function(){K?(V.style.height="280px",X.style.height="190px",U.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),y(ga)):(V.style.height="440px",X.style.height="355px",U.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess",
+k.innerHTML=p;x.appendChild(k);k=document.createElement("td");k.innerHTML=l;x.appendChild(k);e.appendChild(x);null==F&&(c(),q(x,"geTempDlgDiagramsListGridActive",a[g]));(function(a,d){mxEvent.addListener(x,"click",function(){F!=d&&(c(),q(d,"geTempDlgDiagramsListGridActive",a))});mxEvent.addListener(x,"dblclick",t);mxEvent.addListener(J,"click",function(){u(a)})})(a[g],x)}else{var A=document.createElement("div");A.className="geTempDlgDiagramTile";A.setAttribute("title",n);null==F&&(c(),q(A,"geTempDlgDiagramTileActive",
+a[g]));p=document.createElement("div");p.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var G=document.createElement("img");G.style.display="none";(function(a,d){G.onload=function(){d.className="geTempDlgDiagramTileImg";a.style.display=""};G.onerror=function(){d.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(G,p);G.src=k;p.appendChild(G);A.appendChild(p);p=document.createElement("div");p.className="geTempDlgDiagramTileLbl";p.innerHTML=null!=m?m:"";A.appendChild(p);
+J=document.createElement("img");J.src="/images/icon-search.svg";J.className="geTempDlgDiagramPreviewBtn";J.setAttribute("title",mxResources.get("preview"));A.appendChild(J);(function(a,d){mxEvent.addListener(A,"click",function(){F!=d&&(c(),q(d,"geTempDlgDiagramTileActive",a))});mxEvent.addListener(A,"dblclick",t);mxEvent.addListener(J,"click",function(){u(a)})})(a[g],A);V.appendChild(A)}}}function y(a,d){W.innerHTML="";q();for(var b=!d&&5<a.length?5:a.length,c=0;c<b;c++){var e=a[c];e.isCategory=!0;
+var g=document.createElement("div"),m=mxResources.get(e.title);null==m&&(m=e.title.substring(0,1).toUpperCase()+e.title.substring(1));g.className="geTempDlgNewDiagramCatItem";g.setAttribute("title",m);m=mxUtils.htmlEntities(m);15<m.length&&(m=m.substring(0,15)+"&hellip;");null==F&&(fa.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),v(),q(g,"geTempDlgNewDiagramCatItemActive",e));var f=document.createElement("div");f.className="geTempDlgNewDiagramCatItemImg";var n=document.createElement("img");
+n.src=NEW_DIAGRAM_CATS_PATH+"/"+e.img;f.appendChild(n);g.appendChild(f);f=document.createElement("div");f.className="geTempDlgNewDiagramCatItemLbl";f.innerHTML=m;g.appendChild(f);W.appendChild(g);(function(a,d){mxEvent.addListener(g,"click",function(){F!=d&&(fa.innerHTML=mxUtils.htmlEntities(mxResources.get("create")),v(),q(d,"geTempDlgNewDiagramCatItemActive",a))});mxEvent.addListener(g,"dblclick",t)})(e,g)}T.style.display=5>a.length?"none":""}function B(a){var d=C.querySelector(".geTemplatesList"),
+b;for(b in a){var c=document.createElement("div"),e=mxResources.get(b),g=a[b];null==e&&(e=b.substring(0,1).toUpperCase()+b.substring(1));c.className="geTemplateCatLink";c.setAttribute("title",e+" ("+g.length+")");e=mxUtils.htmlEntities(e);15<e.length&&(e=e.substring(0,15)+"&hellip;");c.innerHTML=e+" ("+g.length+")";d.appendChild(c);(function(d,b,e){mxEvent.addListener(c,"click",function(){H!=e&&(null!=H?(H.style.fontWeight="normal",H.style.textDecoration="none"):(S.style.display="none",U.style.minHeight=
+"100%"),H=e,H.style.fontWeight="bold",H.style.textDecoration="underline",X.scrollTop=0,D&&(E=!0),aa.innerHTML=b,ba.style.display="none",z(a[d],!0))})})(b,e,c)}}function x(a){l&&(X.scrollTop=0,V.innerHTML="",Y.spin(V),E=!1,D=!0,aa.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag",null,"Recent Diagrams")),I=null,l(Z,a?null:f))}function A(a){n();X.scrollTop=0;V.innerHTML="";Y.spin(V);E=!1;D=!0;ca=null;aa.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults",null,"Search Results"))+
+' "'+mxUtils.htmlEntities(a)+'"';d(a,Z,G?null:f);I=a}b=null!=b?b:TEMPLATE_PATH+"/index.xml";k=null!=k?k:NEW_DIAGRAM_CATS_PATH+"/index.xml";var C=this.container,D=!1,E=!1,H=null,F=null,J=null,K=!1,G=!0,L=!1,M=[],I,T=C.querySelector(".geTempDlgShowAllBtn"),V=C.querySelector(".geTempDlgDiagramsTiles"),aa=C.querySelector(".geTempDlgDiagramsListTitle"),ba=C.querySelector(".geTempDlgDiagramsListBtns"),X=C.querySelector(".geTempDlgContent"),U=C.querySelector(".geTempDlgDiagramsList"),S=C.querySelector(".geTempDlgNewDiagramCat"),
+W=C.querySelector(".geTempDlgNewDiagramCatList"),fa=C.querySelector(".geTempDlgCreateBtn"),Y=new Spinner({lines:12,length:10,width:5,radius:10,rotate:0,color:"#000",speed:1.5,trail:60,shadow:!1,hwaccel:!1,top:"50px",zIndex:2E9});mxEvent.addListener(C.querySelector(".geTempDlgNewDiagramlbl"),"click",function(){n();S.style.display="";U.style.minHeight="calc(100% - 280px)";x(G)});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=allDiagramsBtn]"),"click",function(){p(this,"geTempDlgAllDiagramsBtnImg",
+"all-diagrams","myDiagramsBtn","geTempDlgMyDiagramsBtnImg","my-diagrams",!0)&&(G=!0,null==I?x(G):A(I))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=myDiagramsBtn]"),"click",function(){p(this,"geTempDlgMyDiagramsBtnImg","my-diagrams","allDiagramsBtn","geTempDlgAllDiagramsBtnImg","all-diagrams",!0)&&(G=!1,null==I?x(G):A(I))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=listBtn]"),"click",function(){p(this,"geTempDlgListBtnImg","list","tilesBtn","geTempDlgTilesBtnImg",
+"tiles",!1)&&(L=!0,z(M,!1,L))});mxEvent.addListener(C.querySelector(".geTempDlgRadioBtn[data-id=tilesBtn]"),"click",function(){p(this,"geTempDlgTilesBtnImg","tiles","listBtn","geTempDlgListBtnImg","list",!1)&&(L=!1,z(M,!1,L))});mxEvent.addListener(T,"click",function(){K?(S.style.height="280px",W.style.height="190px",T.innerHTML=mxUtils.htmlEntities(mxResources.get("showAll",null,"+ Show all")),y(ga)):(S.style.height="440px",W.style.height="355px",T.innerHTML=mxUtils.htmlEntities(mxResources.get("showLess",
null,"- Show less")),y(ga,!0));K=!K});var P=!1,Q=!1,N={},ga=[],R=1;mxUtils.get(b,function(a){if(!P){P=!0;for(a=a.getXml().documentElement.firstChild;null!=a;){if("undefined"!==typeof a.getAttribute){var d=a.getAttribute("url");if(null!=d){var b=d.indexOf("/"),d=d.substring(0,b),b=N[d];null==b&&(R++,b=[],N[d]=b);b.push({url:a.getAttribute("url"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title"),tooltip:a.getAttribute("url"),imgUrl:a.getAttribute("imgUrl")})}}a=
-a.nextSibling}A(N)}});mxUtils.get(k,function(a){if(!Q){Q=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&ga.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title")}),a=a.nextSibling;y(ga)}});var Y=function(a,d){ba.style.display="";aa.stop();D=!1;F?F=!1:d?T.innerHTML=d:0==a.length?T.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):
-z(a,!1,L)};x(H);var da=null;d&&mxEvent.addListener(C.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var d=this;null!=da&&clearTimeout(da);13==a.keyCode?B(d.value):da=setTimeout(function(){B(d.value)},500)});mxEvent.addListener(Z,"click",q);mxEvent.addListener(C.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){q(!0)});mxEvent.addListener(C.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=c&&c();a.hideDialog(!0)})};
+a.nextSibling}B(N)}});mxUtils.get(k,function(a){if(!Q){Q=!0;for(a=a.getXml().documentElement.firstChild;null!=a;)"undefined"!==typeof a.getAttribute&&null!=a.getAttribute("title")&&ga.push({img:a.getAttribute("img"),libs:a.getAttribute("libs"),clibs:a.getAttribute("clibs"),title:a.getAttribute("title")}),a=a.nextSibling;y(ga)}});var Z=function(a,d){ba.style.display="";Y.stop();D=!1;E?E=!1:d?V.innerHTML=d:0==a.length?V.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found")):
+z(a,!1,L)};x(G);var ca=null;d&&mxEvent.addListener(C.querySelector(".geTempDlgSearchBox"),"keyup",function(a){var d=this;null!=ca&&clearTimeout(ca);13==a.keyCode?A(d.value):ca=setTimeout(function(){A(d.value)},500)});mxEvent.addListener(fa,"click",t);mxEvent.addListener(C.querySelector(".geTempDlgLinkToDiagramBtn"),"click",function(a){t(!0)});mxEvent.addListener(C.querySelector(".geTempDlgCancelBtn"),"click",function(){null!=c&&c();a.hideDialog(!0)})};
var BtnDialog=function(a,e,c,b){var k=document.createElement("div");k.style.textAlign="center";var f=document.createElement("p");f.style.fontSize="16pt";f.style.padding="0px";f.style.margin="0px";f.style.color="gray";mxUtils.write(f,mxResources.get("done"));var l="Unknown",d=document.createElement("img");d.setAttribute("border","0");d.setAttribute("align","absmiddle");d.style.marginRight="10px";e==a.drive?(l=mxResources.get("googleDrive"),d.src=IMAGE_PATH+"/google-drive-logo-white.svg"):e==a.dropbox?
(l=mxResources.get("dropbox"),d.src=IMAGE_PATH+"/dropbox-logo-white.svg"):e==a.oneDrive?(l=mxResources.get("oneDrive"),d.src=IMAGE_PATH+"/onedrive-logo-white.svg"):e==a.gitHub?(l=mxResources.get("github"),d.src=IMAGE_PATH+"/github-logo-white.svg"):e==a.gitLab?(l=mxResources.get("gitlab"),d.src=IMAGE_PATH+"/gitlab-logo.svg"):e==a.trello&&(l=mxResources.get("trello"),d.src=IMAGE_PATH+"/trello-logo-white.svg");a=document.createElement("p");mxUtils.write(a,mxResources.get("authorizedIn",[l],"You are now authorized in {1}"));
-c=mxUtils.button(c,b);c.insertBefore(d,c.firstChild);c.style.marginTop="6px";c.className="geBigButton";c.style.fontSize="18px";c.style.padding="14px";k.appendChild(f);k.appendChild(a);k.appendChild(c);this.container=k},FontDialog=function(a,e,c,b,k){function f(a){this.style.border="";13==a.keyCode&&A.click()}var l,d,g,m=document.createElement("table"),n=document.createElement("tbody");m.style.marginTop="8px";l=document.createElement("tr");d=document.createElement("td");d.colSpan=2;d.style.whiteSpace=
+c=mxUtils.button(c,b);c.insertBefore(d,c.firstChild);c.style.marginTop="6px";c.className="geBigButton";c.style.fontSize="18px";c.style.padding="14px";k.appendChild(f);k.appendChild(a);k.appendChild(c);this.container=k},FontDialog=function(a,e,c,b,k){function f(a){this.style.border="";13==a.keyCode&&B.click()}var l,d,g,m=document.createElement("table"),n=document.createElement("tbody");m.style.marginTop="8px";l=document.createElement("tr");d=document.createElement("td");d.colSpan=2;d.style.whiteSpace=
"nowrap";d.style.fontSize="10pt";d.style.fontWeight="bold";var p=document.createElement("input");p.style.cssText="margin-right:8px;margin-bottom:8px;";p.setAttribute("value","sysfonts");p.setAttribute("type","radio");p.setAttribute("name","current-fontdialog");p.setAttribute("id","fontdialog-sysfonts");d.appendChild(p);g=document.createElement("label");g.setAttribute("for","fontdialog-sysfonts");mxUtils.write(g,mxResources.get("sysFonts",null,"System Fonts"));d.appendChild(g);l.appendChild(d);n.appendChild(l);
l=document.createElement("tr");d=document.createElement("td");d.style.whiteSpace="nowrap";d.style.fontSize="10pt";d.style.width="120px";d.style.paddingLeft="15px";mxUtils.write(d,mxResources.get("fontname",null,"Font Name")+":");l.appendChild(d);var u=document.createElement("input");"s"==b&&u.setAttribute("value",e);u.style.marginLeft="4px";u.style.width="250px";u.className="dlg_fontName_s";d=document.createElement("td");d.appendChild(u);l.appendChild(d);n.appendChild(l);l=document.createElement("tr");
-d=document.createElement("td");d.colSpan=2;d.style.whiteSpace="nowrap";d.style.fontSize="10pt";d.style.fontWeight="bold";var t=document.createElement("input");t.style.cssText="margin-right:8px;margin-bottom:8px;";t.setAttribute("value","googlefonts");t.setAttribute("type","radio");t.setAttribute("name","current-fontdialog");t.setAttribute("id","fontdialog-googlefonts");d.appendChild(t);g=document.createElement("label");g.setAttribute("for","fontdialog-googlefonts");mxUtils.write(g,mxResources.get("googleFonts",
-null,"Google Fonts"));d.appendChild(g);l.appendChild(d);n.appendChild(l);l=document.createElement("tr");d=document.createElement("td");d.style.whiteSpace="nowrap";d.style.fontSize="10pt";d.style.width="120px";d.style.paddingLeft="15px";mxUtils.write(d,mxResources.get("fontname",null,"Font Name")+":");l.appendChild(d);var q=document.createElement("input");"g"==b&&q.setAttribute("value",e);q.style.marginLeft="4px";q.style.width="250px";q.className="dlg_fontName_g";d=document.createElement("td");d.appendChild(q);
+d=document.createElement("td");d.colSpan=2;d.style.whiteSpace="nowrap";d.style.fontSize="10pt";d.style.fontWeight="bold";var q=document.createElement("input");q.style.cssText="margin-right:8px;margin-bottom:8px;";q.setAttribute("value","googlefonts");q.setAttribute("type","radio");q.setAttribute("name","current-fontdialog");q.setAttribute("id","fontdialog-googlefonts");d.appendChild(q);g=document.createElement("label");g.setAttribute("for","fontdialog-googlefonts");mxUtils.write(g,mxResources.get("googleFonts",
+null,"Google Fonts"));d.appendChild(g);l.appendChild(d);n.appendChild(l);l=document.createElement("tr");d=document.createElement("td");d.style.whiteSpace="nowrap";d.style.fontSize="10pt";d.style.width="120px";d.style.paddingLeft="15px";mxUtils.write(d,mxResources.get("fontname",null,"Font Name")+":");l.appendChild(d);var t=document.createElement("input");"g"==b&&t.setAttribute("value",e);t.style.marginLeft="4px";t.style.width="250px";t.className="dlg_fontName_g";d=document.createElement("td");d.appendChild(t);
l.appendChild(d);n.appendChild(l);l=document.createElement("tr");d=document.createElement("td");d.colSpan=2;d.style.whiteSpace="nowrap";d.style.fontSize="10pt";d.style.fontWeight="bold";var v=document.createElement("input");v.style.cssText="margin-right:8px;margin-bottom:8px;";v.setAttribute("value","webfonts");v.setAttribute("type","radio");v.setAttribute("name","current-fontdialog");v.setAttribute("id","fontdialog-webfonts");d.appendChild(v);g=document.createElement("label");g.setAttribute("for",
"fontdialog-webfonts");mxUtils.write(g,mxResources.get("webfonts",null,"Web Fonts"));d.appendChild(g);l.appendChild(d);n.appendChild(l);l=document.createElement("tr");d=document.createElement("td");d.style.whiteSpace="nowrap";d.style.fontSize="10pt";d.style.width="120px";d.style.paddingLeft="15px";mxUtils.write(d,mxResources.get("fontname",null,"Font Name")+":");l.appendChild(d);var z=document.createElement("input");"w"==b&&z.setAttribute("value",e);z.style.marginLeft="4px";z.style.width="250px";
z.className="dlg_fontName_w";d=document.createElement("td");d.appendChild(z);l.appendChild(d);n.appendChild(l);l=document.createElement("tr");d=document.createElement("td");d.style.whiteSpace="nowrap";d.style.fontSize="10pt";d.style.width="120px";d.style.paddingLeft="15px";mxUtils.write(d,mxResources.get("fontUrl",null,"Font URL")+":");l.appendChild(d);var y=document.createElement("input");y.setAttribute("value",c||"");y.style.marginLeft="4px";y.style.width="250px";y.className="dlg_fontUrl";d=document.createElement("td");
-d.appendChild(y);l.appendChild(d);n.appendChild(l);this.init=function(){var a=u;"g"==b?a=q:"w"==b&&(a=z);a.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?a.select():document.execCommand("selectAll",!1,null)};l=document.createElement("tr");d=document.createElement("td");d.colSpan=2;d.style.paddingTop="20px";d.style.whiteSpace="nowrap";d.setAttribute("align","right");a.isOffline()||(e=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://www.diagrams.net/blog/external-fonts")}),
-e.className="geBtn",d.appendChild(e));e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";a.editor.cancelFirst&&d.appendChild(e);var A=mxUtils.button(mxResources.get("apply"),function(){var d,b,c;p.checked?(d=u.value,c="s"):t.checked?(d=q.value,b=Editor.GOOGLE_FONTS+encodeURIComponent(d).replace(/%20/g,"+"),c="g"):v.checked&&(d=z.value,b=y.value,c="w");var e;e=b;var g=c,f=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;null==
-d||0==d.length?(m.querySelector(".dlg_fontName_"+g).style.border="1px solid red",e=!1):"w"!=g||f.test(e)?e=!0:(m.querySelector(".dlg_fontUrl").style.border="1px solid red",e=!1);e&&(k(d,b,c),a.hideDialog())});A.className="geBtn gePrimaryBtn";mxEvent.addListener(u,"keypress",f);mxEvent.addListener(q,"keypress",f);mxEvent.addListener(z,"keypress",f);mxEvent.addListener(y,"keypress",f);mxEvent.addListener(u,"focus",function(){p.setAttribute("checked","checked");p.checked=!0});mxEvent.addListener(q,"focus",
-function(){t.setAttribute("checked","checked");t.checked=!0});mxEvent.addListener(z,"focus",function(){v.setAttribute("checked","checked");v.checked=!0});mxEvent.addListener(y,"focus",function(){v.setAttribute("checked","checked");v.checked=!0});d.appendChild(A);a.editor.cancelFirst||d.appendChild(e);l.appendChild(d);n.appendChild(l);m.appendChild(n);this.container=m};
+d.appendChild(y);l.appendChild(d);n.appendChild(l);this.init=function(){var a=u;"g"==b?a=t:"w"==b&&(a=z);a.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?a.select():document.execCommand("selectAll",!1,null)};l=document.createElement("tr");d=document.createElement("td");d.colSpan=2;d.style.paddingTop="20px";d.style.whiteSpace="nowrap";d.setAttribute("align","right");a.isOffline()||(e=mxUtils.button(mxResources.get("help"),function(){a.openLink("https://www.diagrams.net/blog/external-fonts")}),
+e.className="geBtn",d.appendChild(e));e=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});e.className="geBtn";a.editor.cancelFirst&&d.appendChild(e);var B=mxUtils.button(mxResources.get("apply"),function(){var d,b,c;p.checked?(d=u.value,c="s"):q.checked?(d=t.value,b=Editor.GOOGLE_FONTS+encodeURIComponent(d).replace(/%20/g,"+"),c="g"):v.checked&&(d=z.value,b=y.value,c="w");var e;e=b;var g=c,f=/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;null==
+d||0==d.length?(m.querySelector(".dlg_fontName_"+g).style.border="1px solid red",e=!1):"w"!=g||f.test(e)?e=!0:(m.querySelector(".dlg_fontUrl").style.border="1px solid red",e=!1);e&&(k(d,b,c),a.hideDialog())});B.className="geBtn gePrimaryBtn";mxEvent.addListener(u,"keypress",f);mxEvent.addListener(t,"keypress",f);mxEvent.addListener(z,"keypress",f);mxEvent.addListener(y,"keypress",f);mxEvent.addListener(u,"focus",function(){p.setAttribute("checked","checked");p.checked=!0});mxEvent.addListener(t,"focus",
+function(){q.setAttribute("checked","checked");q.checked=!0});mxEvent.addListener(z,"focus",function(){v.setAttribute("checked","checked");v.checked=!0});mxEvent.addListener(y,"focus",function(){v.setAttribute("checked","checked");v.checked=!0});d.appendChild(B);a.editor.cancelFirst||d.appendChild(e);l.appendChild(d);n.appendChild(l);m.appendChild(n);this.container=m};
function AspectDialog(a,e,c,b,k){this.aspect={pageId:e||a.pages[0].getId(),layerIds:c||[]};e=document.createElement("div");var f=document.createElement("h5");f.style.margin="0 0 10px";mxUtils.write(f,mxResources.get("pages"));e.appendChild(f);c=document.createElement("div");c.className="geAspectDlgList";e.appendChild(c);f=document.createElement("h5");f.style.margin="0 0 10px";mxUtils.write(f,mxResources.get("layers"));e.appendChild(f);f=document.createElement("div");f.className="geAspectDlgList";
e.appendChild(f);this.pagesContainer=c;this.layersContainer=f;this.ui=a;c=document.createElement("div");c.style.marginTop="16px";c.style.textAlign="center";f=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog();null!=k&&k()});f.className="geBtn";a.editor.cancelFirst&&c.appendChild(f);var l=mxUtils.button(mxResources.get("ok"),mxUtils.bind(this,function(){a.hideDialog();b({pageId:this.selectedPage,layerIds:Object.keys(this.selectedLayers)})}));c.appendChild(l);l.className="geBtn gePrimaryBtn";
a.editor.cancelFirst||c.appendChild(f);l.setAttribute("disabled","disabled");this.okBtn=l;e.appendChild(c);this.container=e}AspectDialog.prototype.init=function(){this.ui.getFileData(!0);for(var a=0;a<this.ui.pages.length;a++){var e=this.ui.updatePageRoot(this.ui.pages[a]);this.createPageItem(e.getId(),e.getName(),e.node,e.root)}};
@@ -8944,21 +8944,21 @@ var d=[];a.replace(/(?!\s*$)\s*(?:'([^'\\]*(?:\\[\S\s][^'\\]*)*)'|"([^"\\]*(?:\\
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?:\/\/[^\/]*\.blob.core.windows.net\//.test(a)||/^https?:\/\/[^\/]*\.diagrams\.new\/proxy/.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 e="http://"==c.substring(0,7)||"https://"==c.substring(0,8);e&&!navigator.onLine?c=Editor.svgBrokenImage.src:!e||c.substring(0,a.baseUrl.length)==a.baseUrl||b.crossOriginImages&&b.isCorsEnabledForUrl(c)?"chrome-extension://"==c.substring(0,19)||mxClient.IS_CHROMEAPP||(c=d.apply(this,arguments)):c=PROXY_URL+"?url="+encodeURIComponent(c)}return c};return a};Editor.createSvgDataUri=function(a){return"data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(a)))};
Editor.prototype.convertImageToDataUri=function(a,d){try{var b=!0,c=window.setTimeout(mxUtils.bind(this,function(){b=!1;d(Editor.svgBrokenImage.src)}),this.timeout);if(/(\.svg)$/i.test(a))mxUtils.get(a,mxUtils.bind(this,function(a){window.clearTimeout(c);b&&d(Editor.createSvgDataUri(a.getText()))}),function(){window.clearTimeout(c);b&&d(Editor.svgBrokenImage.src)});else{var e=new Image;this.crossOriginImages&&(e.crossOrigin="anonymous");e.onload=function(){window.clearTimeout(c);if(b)try{var a=document.createElement("canvas"),
-g=a.getContext("2d");a.height=e.height;a.width=e.width;g.drawImage(e,0,0);d(a.toDataURL())}catch(T){d(Editor.svgBrokenImage.src)}};e.onerror=function(){window.clearTimeout(c);b&&d(Editor.svgBrokenImage.src)};e.src=a}}catch(I){d(Editor.svgBrokenImage.src)}};Editor.prototype.convertImages=function(a,d,b,c){null==c&&(c=this.createImageUrlConverter());var e=0,g=b||{};b=mxUtils.bind(this,function(b,m){for(var f=a.getElementsByTagName(b),n=0;n<f.length;n++)mxUtils.bind(this,function(b){try{if(null!=b){var f=
-c.convert(b.getAttribute(m));if(null!=f&&"data:"!=f.substring(0,5)){var n=g[f];null==n?(e++,this.convertImageToDataUri(f,function(c){null!=c&&(g[f]=c,b.setAttribute(m,c));e--;0==e&&d(a)})):b.setAttribute(m,n)}else null!=f&&b.setAttribute(m,f)}}catch(X){}})(f[n])});b("image","xlink:href");b("img","src");0==e&&d(a)};Editor.base64Encode=function(a){for(var d="",b=0,c=a.length,e,g,m;b<c;){e=a.charCodeAt(b++)&255;if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>
+g=a.getContext("2d");a.height=e.height;a.width=e.width;g.drawImage(e,0,0);d(a.toDataURL())}catch(V){d(Editor.svgBrokenImage.src)}};e.onerror=function(){window.clearTimeout(c);b&&d(Editor.svgBrokenImage.src)};e.src=a}}catch(I){d(Editor.svgBrokenImage.src)}};Editor.prototype.convertImages=function(a,d,b,c){null==c&&(c=this.createImageUrlConverter());var e=0,g=b||{};b=mxUtils.bind(this,function(b,m){for(var f=a.getElementsByTagName(b),n=0;n<f.length;n++)mxUtils.bind(this,function(b){try{if(null!=b){var f=
+c.convert(b.getAttribute(m));if(null!=f&&"data:"!=f.substring(0,5)){var n=g[f];null==n?(e++,this.convertImageToDataUri(f,function(c){null!=c&&(g[f]=c,b.setAttribute(m,c));e--;0==e&&d(a)})):b.setAttribute(m,n)}else null!=f&&b.setAttribute(m,f)}}catch(W){}})(f[n])});b("image","xlink:href");b("img","src");0==e&&d(a)};Editor.base64Encode=function(a){for(var d="",b=0,c=a.length,e,g,m;b<c;){e=a.charCodeAt(b++)&255;if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>
2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4);d+="==";break}g=a.charCodeAt(b++);if(b==c){d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2);d+="=";break}m=a.charCodeAt(b++);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e>>
2);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((e&3)<<4|(g&240)>>4);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt((g&15)<<2|(m&192)>>6);d+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(m&63)}return d};Editor.prototype.loadUrl=function(a,d,b,c,e,g,m,f){try{var n=!m&&(c||/(\.png)($|\?)/i.test(a)||/(\.jpe?g)($|\?)/i.test(a)||/(\.gif)($|\?)/i.test(a)||/(\.pdf)($|\?)/i.test(a));e=null!=e?e:!0;var k=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(n){if((9==document.documentMode||10==document.documentMode)&&"undefined"!==typeof window.mxUtilsBinaryToArray){a=mxUtilsBinaryToArray(a.request.responseBody).toArray();for(var c=Array(a.length),e=0;e<a.length;e++)c[e]=String.fromCharCode(a[e]);c=c.join("")}g=null!=g?g:"data:image/png;base64,";c=g+Editor.base64Encode(c)}d(c)}}else null!=b&&(0==a.getStatus()?b({message:mxResources.get("accessDenied")},
-a):b({message:mxResources.get("error")+" "+a.getStatus()},a))}),function(a){null!=b&&b({message:mxResources.get("error")+" "+a.getStatus()})},n,this.timeout,function(){e&&null!=b&&b({code:App.ERROR_TIMEOUT,retry:k})},f)});k()}catch(W){null!=b&&b(W)}};Editor.prototype.embedCssFonts=function(a,d){function b(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")}var c=a.split("url("),e=0;null==this.cachedFonts&&(this.cachedFonts={});var g=mxUtils.bind(this,function(){if(0==
+a):b({message:mxResources.get("error")+" "+a.getStatus()},a))}),function(a){null!=b&&b({message:mxResources.get("error")+" "+a.getStatus()})},n,this.timeout,function(){e&&null!=b&&b({code:App.ERROR_TIMEOUT,retry:k})},f)});k()}catch(X){null!=b&&b(X)}};Editor.prototype.embedCssFonts=function(a,d){function b(a){return a.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")}var c=a.split("url("),e=0;null==this.cachedFonts&&(this.cachedFonts={});var g=mxUtils.bind(this,function(){if(0==
e){for(var a=[c[0]],g=1;g<c.length;g++){var m=c[g].indexOf(")");a.push('url("');a.push(this.cachedFonts[b(c[g].substring(0,m))]);a.push('"'+c[g].substring(m))}d(a.join(""))}});if(0<c.length){for(var m=1;m<c.length;m++){var f=c[m].indexOf(")"),n=null,k=c[m].indexOf("format(",f);0<k&&(n=b(c[m].substring(k+7,c[m].indexOf(")",k))));mxUtils.bind(this,function(a){if(null==this.cachedFonts[a]){this.cachedFonts[a]=a;e++;var d="application/x-font-ttf";if("svg"==n||/(\.svg)($|\?)/i.test(a))d="image/svg+xml";
else if("otf"==n||"embedded-opentype"==n||/(\.otf)($|\?)/i.test(a))d="application/x-font-opentype";else if("woff"==n||/(\.woff)($|\?)/i.test(a))d="application/font-woff";else if("woff2"==n||/(\.woff2)($|\?)/i.test(a))d="application/font-woff2";else if("eot"==n||/(\.eot)($|\?)/i.test(a))d="application/vnd.ms-fontobject";else if("sfnt"==n||/(\.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){this.cachedFonts[a]=d;e--;g()}),mxUtils.bind(this,function(a){e--;g()}),!0,null,"data:"+d+";charset=utf-8;base64,")}})(b(c[m].substring(0,f)),n)}g()}else d(a)};Editor.prototype.loadFonts=function(a){null!=this.fontCss&&null==this.resolvedFontCss?this.embedCssFonts(this.fontCss,mxUtils.bind(this,function(d){this.resolvedFontCss=d;a()})):a()};Editor.prototype.embedExtFonts=function(a){var d=this.graph.extFonts;if(null!=d&&0<d.length){var b="",c=0;null==this.cachedGoogleFonts&&
(this.cachedGoogleFonts={});for(var e=mxUtils.bind(this,function(){0==c&&this.embedCssFonts(b,a)}),g=0;g<d.length;g++)mxUtils.bind(this,function(a,d){0==d.indexOf(Editor.GOOGLE_FONTS)?null==this.cachedGoogleFonts[d]?(c++,this.loadUrl(d,mxUtils.bind(this,function(a){this.cachedGoogleFonts[d]=a;b+=a;c--;e()}),mxUtils.bind(this,function(a){c--;b+="@import url("+d+");";e()}))):b+=this.cachedGoogleFonts[d]:b+='@font-face {font-family: "'+a+'";src: url("'+d+'");}'})(d[g].name,d[g].url);e()}else a()};Editor.prototype.addMathCss=
function(a){a=a.getElementsByTagName("defs");if(null!=a&&0<a.length)for(var d=document.getElementsByTagName("style"),b=0;b<d.length;b++)0<mxUtils.getTextContent(d[b]).indexOf("MathJax")&&a[0].appendChild(d[b].cloneNode(!0))};Editor.prototype.addFontCss=function(a,d){d=null!=d?d:this.fontCss;if(null!=d){var b=a.getElementsByTagName("defs"),c=a.ownerDocument;0==b.length?(b=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"defs"):c.createElement("defs"),null!=a.firstChild?a.insertBefore(b,
-a.firstChild):a.appendChild(b)):b=b[0];c=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"style"):c.createElement("style");c.setAttribute("type","text/css");mxUtils.setTextContent(c,d);b.appendChild(c)}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.exportToCanvas=function(a,d,b,c,e,g,m,f,n,k,p,l,u,v,x){try{g=null!=g?g:!0;m=null!=m?m:!0;l=null!=l?l:this.graph;u=null!=u?u:0;var t=n?null:l.background;t==mxConstants.NONE&&
-(t=null);null==t&&(t=c);null==t&&0==n&&(t="#ffffff");this.convertImages(l.getSvg(null,null,null,v,null,m,null,null,null,k),mxUtils.bind(this,function(b){try{var c=new Image;c.onload=mxUtils.bind(this,function(){try{var m=function(){mxClient.IS_SF?window.setTimeout(function(){v.drawImage(c,u/f,u/f);a(n)},0):(v.drawImage(c,u/f,u/f),a(n))},n=document.createElement("canvas"),k=parseInt(b.getAttribute("width")),p=parseInt(b.getAttribute("height"));f=null!=f?f:1;null!=d&&(f=g?Math.min(1,Math.min(3*d/(4*
-p),d/k)):d/k);k=Math.ceil(f*k)+2*u;p=Math.ceil(f*p)+2*u;n.setAttribute("width",k);n.setAttribute("height",p);var v=n.getContext("2d");null!=t&&(v.beginPath(),v.rect(0,0,k,p),v.fillStyle=t,v.fill());v.scale(f,f);if(x){var q=l.view,B=q.scale;q.scale=1;var C=btoa(unescape(encodeURIComponent(q.createSvgGrid(q.gridColor))));q.scale=B;var C="data:image/svg+xml;base64,"+C,y=l.gridSize*q.gridSteps*f,J=l.getGraphBounds(),H=q.translate.x*B,z=q.translate.y*B,D=H+(J.x-H)/B,K=z+(J.y-z)/B,A=new Image;A.onload=
-function(){try{for(var a=-Math.round(y-mxUtils.mod((H-D)*f,y)),d=-Math.round(y-mxUtils.mod((z-K)*f,y));a<k;a+=y)for(var b=d;b<p;b+=y)v.drawImage(A,a/f,b/f);m()}catch(va){null!=e&&e(va)}};A.onerror=function(a){null!=e&&e(a)};A.src=C}else m()}catch(qa){null!=e&&e(qa)}});c.onerror=function(a){null!=e&&e(a)};k&&this.graph.addSvgShadow(b);this.graph.mathEnabled&&this.addMathCss(b);var m=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(b,this.resolvedFontCss),c.src=Editor.createSvgDataUri(mxUtils.getXml(b))}catch(ga){null!=
+a.firstChild):a.appendChild(b)):b=b[0];c=null!=c.createElementNS?c.createElementNS(mxConstants.NS_SVG,"style"):c.createElement("style");c.setAttribute("type","text/css");mxUtils.setTextContent(c,d);b.appendChild(c)}};Editor.prototype.isExportToCanvas=function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.exportToCanvas=function(a,d,b,c,e,g,m,f,n,k,p,l,u,v,x){try{g=null!=g?g:!0;m=null!=m?m:!0;l=null!=l?l:this.graph;u=null!=u?u:0;var q=n?null:l.background;q==mxConstants.NONE&&
+(q=null);null==q&&(q=c);null==q&&0==n&&(q="#ffffff");this.convertImages(l.getSvg(null,null,null,v,null,m,null,null,null,k),mxUtils.bind(this,function(b){try{var c=new Image;c.onload=mxUtils.bind(this,function(){try{var m=function(){mxClient.IS_SF?window.setTimeout(function(){v.drawImage(c,u/f,u/f);a(n)},0):(v.drawImage(c,u/f,u/f),a(n))},n=document.createElement("canvas"),k=parseInt(b.getAttribute("width")),p=parseInt(b.getAttribute("height"));f=null!=f?f:1;null!=d&&(f=g?Math.min(1,Math.min(3*d/(4*
+p),d/k)):d/k);k=Math.ceil(f*k)+2*u;p=Math.ceil(f*p)+2*u;n.setAttribute("width",k);n.setAttribute("height",p);var v=n.getContext("2d");null!=q&&(v.beginPath(),v.rect(0,0,k,p),v.fillStyle=q,v.fill());v.scale(f,f);if(x){var t=l.view,A=t.scale;t.scale=1;var C=btoa(unescape(encodeURIComponent(t.createSvgGrid(t.gridColor))));t.scale=A;var C="data:image/svg+xml;base64,"+C,y=l.gridSize*t.gridSteps*f,J=l.getGraphBounds(),G=t.translate.x*A,z=t.translate.y*A,D=G+(J.x-G)/A,B=z+(J.y-z)/A,K=new Image;K.onload=
+function(){try{for(var a=-Math.round(y-mxUtils.mod((G-D)*f,y)),d=-Math.round(y-mxUtils.mod((z-B)*f,y));a<k;a+=y)for(var b=d;b<p;b+=y)v.drawImage(K,a/f,b/f);m()}catch(va){null!=e&&e(va)}};K.onerror=function(a){null!=e&&e(a)};K.src=C}else m()}catch(qa){null!=e&&e(qa)}});c.onerror=function(a){null!=e&&e(a)};k&&this.graph.addSvgShadow(b);this.graph.mathEnabled&&this.addMathCss(b);var m=mxUtils.bind(this,function(){try{null!=this.resolvedFontCss&&this.addFontCss(b,this.resolvedFontCss),c.src=Editor.createSvgDataUri(mxUtils.getXml(b))}catch(ga){null!=
e&&e(ga)}});this.embedExtFonts(mxUtils.bind(this,function(a){try{null!=a&&this.addFontCss(b,a),this.loadFonts(m)}catch(R){null!=e&&e(R)}}))}catch(ga){null!=e&&e(ga)}}),b,p)}catch(P){null!=e&&e(P)}};Editor.crcTable=[];for(var k=0;256>k;k++)for(var f=k,l=0;8>l;l++)f=1==(f&1)?3988292384^f>>>1:f>>>1,Editor.crcTable[k]=f;Editor.updateCRC=function(a,d,b,c){for(var e=0;e<c;e++)a=Editor.crcTable[(a^d.charCodeAt(b+e))&255]^a>>>8;return a};Editor.crc32=function(a){for(var d=-1,b=0;b<a.length;b++)d=d>>>8^Editor.crcTable[(d^
a.charCodeAt(b))&255];return(d^-1)>>>0};Editor.writeGraphModelToPng=function(a,d,b,c,e){function g(a,d){var b=n;n+=d;return a.substring(b,n)}function m(a){a=g(a,4);return a.charCodeAt(3)+(a.charCodeAt(2)<<8)+(a.charCodeAt(1)<<16)+(a.charCodeAt(0)<<24)}function f(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}a=a.substring(a.indexOf(",")+1);a=window.atob?atob(a):Base64.decode(a,!0);var n=0;if(g(a,8)!=String.fromCharCode(137)+"PNG"+String.fromCharCode(13,10,26,10))null!=e&&e();else if(g(a,
4),"IHDR"!=g(a,4))null!=e&&e();else{g(a,17);e=a.substring(0,n);do{var k=m(a);if("IDAT"==g(a,4)){e=a.substring(0,n-8);"pHYs"==d&&"dpi"==b?(b=Math.round(c/.0254),b=f(b)+f(b)+String.fromCharCode(1)):b=b+String.fromCharCode(0)+("zTXt"==d?String.fromCharCode(0):"")+c;c=4294967295;c=Editor.updateCRC(c,d,0,4);c=Editor.updateCRC(c,b,0,b.length);e+=f(b.length)+d+b+f(c^4294967295);e+=a.substring(n-8,a.length);break}e+=a.substring(n-8,n-4+k);g(a,k);g(a,4)}while(k);return"data:image/png;base64,"+(window.btoa?
@@ -8990,24 +8990,24 @@ font:"#ffffff"},{fill:"#aa00ff",stroke:"#7700CC",font:"#ffffff"},{fill:"#d80073"
{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,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 e in d){for(var g=!1,c=0;c<a.length;c++)if(a[c].name==e&&a[c].type==d[e].type){g=!0;break}g||delete d[e]}},e=this.editorUi.editor.graph.view.getState(a);null!=e&&null!=e.shape&&(e.shape.commonCustomPropAdded||(e.shape.commonCustomPropAdded=!0,e.shape.customProperties=e.shape.customProperties||[],e.cell.vertex?Array.prototype.push.apply(e.shape.customProperties,
-Editor.commonVertexProperties):Array.prototype.push.apply(e.shape.customProperties,Editor.commonEdgeProperties)),c(e.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{c(JSON.parse(a))}catch(I){}}};var t=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=this.format.createSelectionState();"image"==a.style.shape||a.containsLabel||this.container.appendChild(this.addStyles(this.createPanel()));t.apply(this,arguments);if(Editor.enableCustomProperties){for(var d=
-{},b=a.vertices,c=a.edges,e=0;e<b.length;e++)this.findCommonProperties(b[e],d,0==e);for(e=0;e<c.length;e++)this.findCommonProperties(c[e],d,0==b.length&&0==e);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(d).length&&this.container.appendChild(this.addProperties(this.createPanel(),d,a))}};var q=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()}));
+Editor.commonVertexProperties):Array.prototype.push.apply(e.shape.customProperties,Editor.commonEdgeProperties)),c(e.shape.customProperties));a=a.getAttribute("customProperties");if(null!=a)try{c(JSON.parse(a))}catch(I){}}};var q=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var a=this.format.createSelectionState();"image"==a.style.shape||a.containsLabel||this.container.appendChild(this.addStyles(this.createPanel()));q.apply(this,arguments);if(Editor.enableCustomProperties){for(var d=
+{},b=a.vertices,c=a.edges,e=0;e<b.length;e++)this.findCommonProperties(b[e],d,0==e);for(e=0;e<c.length;e++)this.findCommonProperties(c[e],d,0==b.length&&0==e);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(d).length&&this.container.appendChild(this.addProperties(this.createPanel(),d,a))}};var t=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 q.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,d,b){function c(a,d,b,c){l.getModel().beginUpdate();try{var e=[],g=[];if(null!=b.index){for(var m=[],f=b.parentRow.nextSibling;f&&f.getAttribute("data-pName")==a;)m.push(f.getAttribute("data-pValue")),f=f.nextSibling;b.index<m.length?null!=c?m.splice(c,1):m[b.index]=d:m.push(d);null!=b.size&&m.length>b.size&&(m=m.slice(0,b.size));d=m.join(",");null!=b.countProperty&&
+mxUtils.br(a);return t.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed=!0;StyleFormatPanel.prototype.addProperties=function(a,d,b){function c(a,d,b,c){l.getModel().beginUpdate();try{var e=[],g=[];if(null!=b.index){for(var m=[],f=b.parentRow.nextSibling;f&&f.getAttribute("data-pName")==a;)m.push(f.getAttribute("data-pValue")),f=f.nextSibling;b.index<m.length?null!=c?m.splice(c,1):m[b.index]=d:m.push(d);null!=b.size&&m.length>b.size&&(m=m.slice(0,b.size));d=m.join(",");null!=b.countProperty&&
(l.setCellStyles(b.countProperty,m.length,l.getSelectionCells()),e.push(b.countProperty),g.push(m.length))}l.setCellStyles(a,d,l.getSelectionCells());e.push(a);g.push(d);if(null!=b.dependentProps)for(a=0;a<b.dependentProps.length;a++){var n=b.dependentPropsDefVal[a],k=b.dependentPropsVals[a];if(k.length>d)k=k.slice(0,d);else for(var u=k.length;u<d;u++)k.push(n);k=k.join(",");l.setCellStyles(b.dependentProps[a],k,l.getSelectionCells());e.push(b.dependentProps[a]);g.push(k)}if("function"==typeof b.onChange)b.onChange(l,
d);p.editorUi.fireEvent(new mxEventObject("styleChanged","keys",e,"values",g,"cells",l.getSelectionCells()))}finally{l.getModel().endUpdate()}}function e(d,b,c){var e=mxUtils.getOffset(a,!0),g=mxUtils.getOffset(d,!0);b.style.position="absolute";b.style.left=g.x-e.x+"px";b.style.top=g.y-e.y+"px";b.style.width=d.offsetWidth+"px";b.style.height=d.offsetHeight-(c?4:0)+"px";b.style.zIndex=5}function g(a,d,b){var e=document.createElement("div");e.style.width="32px";e.style.height="4px";e.style.margin="2px";
e.style.border="1px solid black";e.style.background=d&&"none"!=d?d:"url('"+Dialog.prototype.noColorImage+"')";btn=mxUtils.button("",mxUtils.bind(p,function(g){this.editorUi.pickColor(d,function(d){e.style.background="none"==d?"url('"+Dialog.prototype.noColorImage+"')":d;c(a,d,b)});mxEvent.consume(g)}));btn.style.height="12px";btn.style.width="40px";btn.className="geColorBtn";btn.appendChild(e);return btn}function m(a,d,b,e,g,m,f){null!=d&&(d=d.split(","),u.push({name:a,values:d,type:b,defVal:e,countProperty:g,
parentRow:m,isDeletable:!0,flipBkg:f}));btn=mxUtils.button("+",mxUtils.bind(p,function(d){for(var n=m,p=0;null!=n.nextSibling;)if(n.nextSibling.getAttribute("data-pName")==a)n=n.nextSibling,p++;else break;var l={type:b,parentRow:m,index:p,isDeletable:!0,defVal:e,countProperty:g},p=k(a,"",l,0==p%2,f);c(a,e,l);n.parentNode.insertBefore(p,n.nextSibling);mxEvent.consume(d)}));btn.style.height="16px";btn.style.width="25px";btn.className="geColorBtn";return btn}function f(a,d,b,c,e,g,m){if(0<e){var f=Array(e);
-d=null!=d?d.split(","):[];for(var n=0;n<e;n++)f[n]=null!=d[n]?d[n]:null!=c?c:"";u.push({name:a,values:f,type:b,defVal:c,parentRow:g,flipBkg:m,size:e})}return document.createElement("div")}function n(a,d,b){var e=document.createElement("input");e.type="checkbox";e.checked="1"==d;mxEvent.addListener(e,"change",function(){c(a,e.checked?"1":"0",b)});return e}function k(d,b,k,l,u){var v=k.dispName,x=k.type,t=document.createElement("tr");t.className="gePropRow"+(u?"Dark":"")+(l?"Alt":"")+" gePropNonHeaderRow";
-t.setAttribute("data-pName",d);t.setAttribute("data-pValue",b);l=!1;null!=k.index&&(t.setAttribute("data-index",k.index),v=(null!=v?v:"")+"["+k.index+"]",l=!0);var q=document.createElement("td");q.className="gePropRowCell";q.innerHTML=mxUtils.htmlEntities(mxResources.get(v,null,v));l&&(q.style.textAlign="right");t.appendChild(q);q=document.createElement("td");q.className="gePropRowCell";if("color"==x)q.appendChild(g(d,b,k));else if("bool"==x||"boolean"==x)q.appendChild(n(d,b,k));else if("enum"==x){var B=
-k.enumList;for(u=0;u<B.length;u++)if(v=B[u],v.val==b){q.innerHTML=mxUtils.htmlEntities(mxResources.get(v.dispName,null,v.dispName));break}mxEvent.addListener(q,"click",mxUtils.bind(p,function(){var g=document.createElement("select");e(q,g);for(var m=0;m<B.length;m++){var f=B[m],n=document.createElement("option");n.value=mxUtils.htmlEntities(f.val);n.innerHTML=mxUtils.htmlEntities(mxResources.get(f.dispName,null,f.dispName));g.appendChild(n)}g.value=b;a.appendChild(g);mxEvent.addListener(g,"change",
-function(){var a=mxUtils.htmlEntities(g.value);c(d,a,k)});g.focus();mxEvent.addListener(g,"blur",function(){a.removeChild(g)})}))}else"dynamicArr"==x?q.appendChild(m(d,b,k.subType,k.subDefVal,k.countProperty,t,u)):"staticArr"==x?q.appendChild(f(d,b,k.subType,k.subDefVal,k.size,t,u)):(q.innerHTML=b,mxEvent.addListener(q,"click",mxUtils.bind(p,function(){function g(){var a=m.value,a=0==a.length&&"string"!=x?0:a;k.allowAuto&&(null!=a.trim&&"auto"==a.trim().toLowerCase()?(a="auto",x="string"):(a=parseFloat(a),
-a=isNaN(a)?0:a));null!=k.min&&a<k.min?a=k.min:null!=k.max&&a>k.max&&(a=k.max);a=mxUtils.htmlEntities(("int"==x?parseInt(a):a)+"");c(d,a,k)}var m=document.createElement("input");e(q,m,!0);m.value=b;m.className="gePropEditor";"int"!=x&&"float"!=x||k.allowAuto||(m.type="number",m.step="int"==x?"1":"any",null!=k.min&&(m.min=parseFloat(k.min)),null!=k.max&&(m.max=parseFloat(k.max)));a.appendChild(m);mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&g()});m.focus();mxEvent.addListener(m,"blur",
-function(){g()})})));k.isDeletable&&(u=mxUtils.button("-",mxUtils.bind(p,function(a){c(d,"",k,k.index);mxEvent.consume(a)})),u.style.height="16px",u.style.width="25px",u.style["float"]="right",u.className="geColorBtn",q.appendChild(u));t.appendChild(q);return t}var p=this,l=this.editorUi.editor.graph,u=[];a.style.position="relative";a.style.padding="0";var v=document.createElement("table");v.style.whiteSpace="nowrap";v.style.width="100%";var x=document.createElement("tr");x.className="gePropHeader";
-var t=document.createElement("th");t.className="gePropHeaderCell";var q=document.createElement("img");q.src=Sidebar.prototype.expandedImage;t.appendChild(q);mxUtils.write(t,mxResources.get("property"));x.style.cursor="pointer";var B=function(){var d=v.querySelectorAll(".gePropNonHeaderRow"),b;if(p.editorUi.propertiesCollapsed){q.src=Sidebar.prototype.collapsedImage;b="none";for(var c=a.childNodes.length-1;0<=c;c--)try{var e=a.childNodes[c],g=e.nodeName.toUpperCase();"INPUT"!=g&&"SELECT"!=g||a.removeChild(e)}catch(la){}}else q.src=
-Sidebar.prototype.expandedImage,b="";for(c=0;c<d.length;c++)d[c].style.display=b};mxEvent.addListener(x,"click",function(){p.editorUi.propertiesCollapsed=!p.editorUi.propertiesCollapsed;B()});x.appendChild(t);t=document.createElement("th");t.className="gePropHeaderCell";t.innerHTML=mxResources.get("value");x.appendChild(t);v.appendChild(x);var C=!1,y=!1,z;for(z in d)if(x=d[z],"function"!=typeof x.isVisible||x.isVisible(b,this)){var H=null!=b.style[z]?mxUtils.htmlEntities(b.style[z]+""):null!=x.getDefaultValue?
-x.getDefaultValue(b,this):x.defVal;if("separator"==x.type)y=!y;else{if("staticArr"==x.type)x.size=parseInt(b.style[x.sizeProperty]||d[x.sizeProperty].defVal)||0;else if(null!=x.dependentProps){for(var D=x.dependentProps,J=[],A=[],t=0;t<D.length;t++){var F=b.style[D[t]];A.push(d[D[t]].subDefVal);J.push(null!=F?F.split(","):[])}x.dependentPropsDefVal=A;x.dependentPropsVals=J}v.appendChild(k(z,H,x,C,y));C=!C}}for(t=0;t<u.length;t++)for(x=u[t],d=x.parentRow,b=0;b<x.values.length;b++)z=k(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(z,d.nextSibling),d=z;a.appendChild(v);B();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 e=c.getModel().getStyle(b[d]),m=0;m<g.length;m++)e=mxUtils.removeStylename(e,
+d=null!=d?d.split(","):[];for(var n=0;n<e;n++)f[n]=null!=d[n]?d[n]:null!=c?c:"";u.push({name:a,values:f,type:b,defVal:c,parentRow:g,flipBkg:m,size:e})}return document.createElement("div")}function n(a,d,b){var e=document.createElement("input");e.type="checkbox";e.checked="1"==d;mxEvent.addListener(e,"change",function(){c(a,e.checked?"1":"0",b)});return e}function k(d,b,k,l,u){var v=k.dispName,x=k.type,q=document.createElement("tr");q.className="gePropRow"+(u?"Dark":"")+(l?"Alt":"")+" gePropNonHeaderRow";
+q.setAttribute("data-pName",d);q.setAttribute("data-pValue",b);l=!1;null!=k.index&&(q.setAttribute("data-index",k.index),v=(null!=v?v:"")+"["+k.index+"]",l=!0);var t=document.createElement("td");t.className="gePropRowCell";t.innerHTML=mxUtils.htmlEntities(mxResources.get(v,null,v));l&&(t.style.textAlign="right");q.appendChild(t);t=document.createElement("td");t.className="gePropRowCell";if("color"==x)t.appendChild(g(d,b,k));else if("bool"==x||"boolean"==x)t.appendChild(n(d,b,k));else if("enum"==x){var A=
+k.enumList;for(u=0;u<A.length;u++)if(v=A[u],v.val==b){t.innerHTML=mxUtils.htmlEntities(mxResources.get(v.dispName,null,v.dispName));break}mxEvent.addListener(t,"click",mxUtils.bind(p,function(){var g=document.createElement("select");e(t,g);for(var m=0;m<A.length;m++){var f=A[m],n=document.createElement("option");n.value=mxUtils.htmlEntities(f.val);n.innerHTML=mxUtils.htmlEntities(mxResources.get(f.dispName,null,f.dispName));g.appendChild(n)}g.value=b;a.appendChild(g);mxEvent.addListener(g,"change",
+function(){var a=mxUtils.htmlEntities(g.value);c(d,a,k)});g.focus();mxEvent.addListener(g,"blur",function(){a.removeChild(g)})}))}else"dynamicArr"==x?t.appendChild(m(d,b,k.subType,k.subDefVal,k.countProperty,q,u)):"staticArr"==x?t.appendChild(f(d,b,k.subType,k.subDefVal,k.size,q,u)):(t.innerHTML=b,mxEvent.addListener(t,"click",mxUtils.bind(p,function(){function g(){var a=m.value,a=0==a.length&&"string"!=x?0:a;k.allowAuto&&(null!=a.trim&&"auto"==a.trim().toLowerCase()?(a="auto",x="string"):(a=parseFloat(a),
+a=isNaN(a)?0:a));null!=k.min&&a<k.min?a=k.min:null!=k.max&&a>k.max&&(a=k.max);a=mxUtils.htmlEntities(("int"==x?parseInt(a):a)+"");c(d,a,k)}var m=document.createElement("input");e(t,m,!0);m.value=b;m.className="gePropEditor";"int"!=x&&"float"!=x||k.allowAuto||(m.type="number",m.step="int"==x?"1":"any",null!=k.min&&(m.min=parseFloat(k.min)),null!=k.max&&(m.max=parseFloat(k.max)));a.appendChild(m);mxEvent.addListener(m,"keypress",function(a){13==a.keyCode&&g()});m.focus();mxEvent.addListener(m,"blur",
+function(){g()})})));k.isDeletable&&(u=mxUtils.button("-",mxUtils.bind(p,function(a){c(d,"",k,k.index);mxEvent.consume(a)})),u.style.height="16px",u.style.width="25px",u.style["float"]="right",u.className="geColorBtn",t.appendChild(u));q.appendChild(t);return q}var p=this,l=this.editorUi.editor.graph,u=[];a.style.position="relative";a.style.padding="0";var v=document.createElement("table");v.style.whiteSpace="nowrap";v.style.width="100%";var x=document.createElement("tr");x.className="gePropHeader";
+var q=document.createElement("th");q.className="gePropHeaderCell";var t=document.createElement("img");t.src=Sidebar.prototype.expandedImage;q.appendChild(t);mxUtils.write(q,mxResources.get("property"));x.style.cursor="pointer";var A=function(){var d=v.querySelectorAll(".gePropNonHeaderRow"),b;if(p.editorUi.propertiesCollapsed){t.src=Sidebar.prototype.collapsedImage;b="none";for(var c=a.childNodes.length-1;0<=c;c--)try{var e=a.childNodes[c],g=e.nodeName.toUpperCase();"INPUT"!=g&&"SELECT"!=g||a.removeChild(e)}catch(la){}}else t.src=
+Sidebar.prototype.expandedImage,b="";for(c=0;c<d.length;c++)d[c].style.display=b};mxEvent.addListener(x,"click",function(){p.editorUi.propertiesCollapsed=!p.editorUi.propertiesCollapsed;A()});x.appendChild(q);q=document.createElement("th");q.className="gePropHeaderCell";q.innerHTML=mxResources.get("value");x.appendChild(q);v.appendChild(x);var C=!1,y=!1,z;for(z in d)if(x=d[z],"function"!=typeof x.isVisible||x.isVisible(b,this)){var G=null!=b.style[z]?mxUtils.htmlEntities(b.style[z]+""):null!=x.getDefaultValue?
+x.getDefaultValue(b,this):x.defVal;if("separator"==x.type)y=!y;else{if("staticArr"==x.type)x.size=parseInt(b.style[x.sizeProperty]||d[x.sizeProperty].defVal)||0;else if(null!=x.dependentProps){for(var D=x.dependentProps,J=[],B=[],q=0;q<D.length;q++){var E=b.style[D[q]];B.push(d[D[q]].subDefVal);J.push(null!=E?E.split(","):[])}x.dependentPropsDefVal=B;x.dependentPropsVals=J}v.appendChild(k(z,G,x,C,y));C=!C}}for(q=0;q<u.length;q++)for(x=u[q],d=x.parentRow,b=0;b<x.values.length;b++)z=k(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(z,d.nextSibling),d=z;a.appendChild(v);A();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 e=c.getModel().getStyle(b[d]),m=0;m<g.length;m++)e=mxUtils.removeStylename(e,
g[m]);var f=c.getModel().isVertex(b[d])?c.defaultVertexStyle:c.defaultEdgeStyle;null!=a?(e=mxUtils.setStyle(e,mxConstants.STYLE_GRADIENTCOLOR,a.gradient||mxUtils.getValue(f,mxConstants.STYLE_GRADIENTCOLOR,null)),e=""==a.fill?mxUtils.setStyle(e,mxConstants.STYLE_FILLCOLOR,null):mxUtils.setStyle(e,mxConstants.STYLE_FILLCOLOR,a.fill||mxUtils.getValue(f,mxConstants.STYLE_FILLCOLOR,null)),e=""==a.stroke?mxUtils.setStyle(e,mxConstants.STYLE_STROKECOLOR,null):mxUtils.setStyle(e,mxConstants.STYLE_STROKECOLOR,
a.stroke||mxUtils.getValue(f,mxConstants.STYLE_STROKECOLOR,null)),c.getModel().isVertex(b[d])&&(e=mxUtils.setStyle(e,mxConstants.STYLE_FONTCOLOR,a.font||mxUtils.getValue(f,mxConstants.STYLE_FONTCOLOR,null)))):(e=mxUtils.setStyle(e,mxConstants.STYLE_FILLCOLOR,mxUtils.getValue(f,mxConstants.STYLE_FILLCOLOR,"#ffffff")),e=mxUtils.setStyle(e,mxConstants.STYLE_STROKECOLOR,mxUtils.getValue(f,mxConstants.STYLE_STROKECOLOR,"#000000")),e=mxUtils.setStyle(e,mxConstants.STYLE_GRADIENTCOLOR,mxUtils.getValue(f,
mxConstants.STYLE_GRADIENTCOLOR,null)),c.getModel().isVertex(b[d])&&(e=mxUtils.setStyle(e,mxConstants.STYLE_FONTCOLOR,mxUtils.getValue(f,mxConstants.STYLE_FONTCOLOR,null))));c.getModel().setStyle(b[d],e)}}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='"+
@@ -9025,12 +9025,12 @@ a.button,d.relatedTarget=a.relatedTarget}catch(I){}}v.apply(this,arguments);wind
this.layoutManager.getLayout=function(a){var d=this.graph.getCellStyle(a);if(null!=d){if("rack"==d.childLayout){var b=new mxStackLayout(this.graph,!1);b.gridSize=null!=d.rackUnitSize?parseFloat(d.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;b.fill=!0;b.marginLeft=d.marginLeft||0;b.marginRight=d.marginRight||0;b.marginTop=d.marginTop||0;b.marginBottom=d.marginBottom||0;b.allowGaps=d.allowGaps||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)};this.updateGlobalUrlVariables()};var z=Graph.prototype.isFastZoomEnabled;Graph.prototype.isFastZoomEnabled=function(){return z.apply(this,arguments)&&(!this.shadowVisible||!mxClient.IS_SF)};Graph.prototype.updateGlobalUrlVariables=function(){this.globalVars=
-Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var a=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=a)for(var d in a)this.globalVars[d]=a[d]}catch(H){null!=window.console&&console.log("Error in vars URL parameter: "+H)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var y=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var d=
-y.apply(this,arguments);null==d&&null!=this.globalVars&&(d=this.globalVars[a]);return d};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(a.ownerDocument)).decode(a)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var A=Graph.prototype.getSvg;Graph.prototype.getSvg=function(a,d,b,c,e,g,m,f,n,k,p){var l=null;null!=this.themes&&"darkTheme"==this.defaultThemeName&&
-(l=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var u=A.apply(this,arguments);if(p&&null!=this.extFonts&&0<this.extFonts.length){var v=u.ownerDocument,x=null!=v.createElementNS?v.createElementNS(mxConstants.NS_SVG,"style"):v.createElement("style");null!=v.setAttributeNS?x.setAttributeNS("type","text/css"):x.setAttribute("type","text/css");for(var t="",q="",B=0;B<this.extFonts.length;B++){var C=this.extFonts[B].name,y=this.extFonts[B].url;0==y.indexOf(Editor.GOOGLE_FONTS)?
-t+="@import url("+y+");\n":q+='@font-face {\nfont-family: "'+C+'";\nsrc: url("'+y+'");\n}\n'}x.appendChild(v.createTextNode(t+q));u.getElementsByTagName("defs")[0].appendChild(x)}null!=l&&(this.stylesheet=l,this.refresh());return u};var x=Graph.prototype.createSvgImageExport;Graph.prototype.createSvgImageExport=function(){var a=x.apply(this,arguments);if(this.mathEnabled){this.container.getBoundingClientRect();var d=a.drawText;a.drawText=function(a,b){if(null!=a.text&&null!=a.text.value&&a.text.checkBounds()&&
-(mxUtils.isNode(a.text.value)||a.text.dialect==mxConstants.DIALECT_STRICTHTML)){var c=a.text.getContentNode();if(null!=c){c=c.cloneNode(!0);if(c.getElementsByTagNameNS)for(var e=c.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML","math");0<e.length;)e[0].parentNode.removeChild(e[0]);null!=c.innerHTML&&(e=a.text.value,a.text.value=c.innerHTML,d.apply(this,arguments),a.text.value=e)}}else d.apply(this,arguments)}}return a};var B=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=
-function(){B.apply(this,arguments);if(mxClient.IS_GC&&null!=this.getDrawPane()){var a=this.getDrawPane().parentNode;!this.graph.mathEnabled||mxClient.NO_FO||null!=this.webKitForceRepaintNode&&null!=this.webKitForceRepaintNode.parentNode||"svg"!=this.graph.container.firstChild.nodeName?null==this.webKitForceRepaintNode||this.graph.mathEnabled&&("svg"==this.graph.container.firstChild.nodeName||this.graph.container.firstChild==this.webKitForceRepaintNode)||(null!=this.webKitForceRepaintNode.parentNode&&
+Editor.globalVars;if(null!=urlParams.vars)try{this.globalVars=null!=this.globalVars?mxUtils.clone(this.globalVars):{};var a=JSON.parse(decodeURIComponent(urlParams.vars));if(null!=a)for(var d in a)this.globalVars[d]=a[d]}catch(G){null!=window.console&&console.log("Error in vars URL parameter: "+G)}};Graph.prototype.getExportVariables=function(){return null!=this.globalVars?mxUtils.clone(this.globalVars):{}};var y=Graph.prototype.getGlobalVariable;Graph.prototype.getGlobalVariable=function(a){var d=
+y.apply(this,arguments);null==d&&null!=this.globalVars&&(d=this.globalVars[a]);return d};Graph.prototype.getDefaultStylesheet=function(){if(null==this.defaultStylesheet){var a=this.themes["default-style2"];this.defaultStylesheet=(new mxCodec(a.ownerDocument)).decode(a)}return this.defaultStylesheet};Graph.prototype.isViewer=function(){return urlParams.viewer};var B=Graph.prototype.getSvg;Graph.prototype.getSvg=function(a,d,b,c,e,g,m,f,n,k,p){var l=null;null!=this.themes&&"darkTheme"==this.defaultThemeName&&
+(l=this.stylesheet,this.stylesheet=this.getDefaultStylesheet(),this.refresh());var u=B.apply(this,arguments);if(p&&null!=this.extFonts&&0<this.extFonts.length){var v=u.ownerDocument,x=null!=v.createElementNS?v.createElementNS(mxConstants.NS_SVG,"style"):v.createElement("style");null!=v.setAttributeNS?x.setAttributeNS("type","text/css"):x.setAttribute("type","text/css");for(var q="",t="",A=0;A<this.extFonts.length;A++){var C=this.extFonts[A].name,y=this.extFonts[A].url;0==y.indexOf(Editor.GOOGLE_FONTS)?
+q+="@import url("+y+");\n":t+='@font-face {\nfont-family: "'+C+'";\nsrc: url("'+y+'");\n}\n'}x.appendChild(v.createTextNode(q+t));u.getElementsByTagName("defs")[0].appendChild(x)}null!=l&&(this.stylesheet=l,this.refresh());return u};var x=Graph.prototype.createSvgImageExport;Graph.prototype.createSvgImageExport=function(){var a=x.apply(this,arguments);if(this.mathEnabled){this.container.getBoundingClientRect();var d=a.drawText;a.drawText=function(a,b){if(null!=a.text&&null!=a.text.value&&a.text.checkBounds()&&
+(mxUtils.isNode(a.text.value)||a.text.dialect==mxConstants.DIALECT_STRICTHTML)){var c=a.text.getContentNode();if(null!=c){c=c.cloneNode(!0);if(c.getElementsByTagNameNS)for(var e=c.getElementsByTagNameNS("http://www.w3.org/1998/Math/MathML","math");0<e.length;)e[0].parentNode.removeChild(e[0]);null!=c.innerHTML&&(e=a.text.value,a.text.value=c.innerHTML,d.apply(this,arguments),a.text.value=e)}}else d.apply(this,arguments)}}return a};var A=mxGraphView.prototype.validateBackgroundPage;mxGraphView.prototype.validateBackgroundPage=
+function(){A.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 C=Graph.prototype.loadStylesheet;Graph.prototype.loadStylesheet=function(){C.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++){var b=a.actions[d];if(null!=b.open)if(this.isCustomLink(b.open)){if(!this.customLinkClicked(b.open))return}else this.openLink(b.open)}this.model.beginUpdate();try{for(d=0;d<a.actions.length;d++)b=a.actions[d],null!=b.toggle&&this.toggleCells(this.getCellsForAction(b.toggle,!0)),null!=b.show&&this.setCellsVisible(this.getCellsForAction(b.show,!0),!0),null!=b.hide&&this.setCellsVisible(this.getCellsForAction(b.hide,
!0),!1)}finally{this.model.endUpdate()}for(d=0;d<a.actions.length;d++){var b=a.actions[d],c=[];null!=b.select&&this.isEnabled()&&(c=this.getCellsForAction(b.select),this.setSelectionCells(c));null!=b.highlight&&(c=this.getCellsForAction(b.highlight),this.highlightCells(c,b.highlight.color,b.highlight.duration,b.highlight.opacity));null!=b.scroll&&(c=this.getCellsForAction(b.scroll));0<c.length&&this.scrollCellToVisible(c[0])}}};Graph.prototype.updateCustomLinksForCell=function(a,d){var b=this.getLinkForCell(d);
@@ -9056,29 +9056,29 @@ STENCIL_PATH+"/flowchart.xml"];mxStencilRegistry.libraries.ios=[SHAPES_PATH+"/mo
[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.veeam2=[STENCIL_PATH+"/veeam/2d.xml",STENCIL_PATH+"/veeam/3d.xml",STENCIL_PATH+"/veeam/veeam2.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 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 D=mxMarker.createMarker;mxMarker.createMarker=
function(a,d,b,c,e,g,m,f,n,k){if(null!=b&&null==mxMarker.markers[b]){var p=this.getPackageForType(b);null!=p&&mxStencilRegistry.getStencil(p)}return D.apply(this,arguments)};PrintDialog.prototype.create=function(a,d){function b(){v.value=Math.max(1,Math.min(f,Math.max(parseInt(v.value),parseInt(u.value))));u.value=Math.max(1,Math.min(f,Math.min(parseInt(v.value),parseInt(u.value))))}function c(d){function b(d,b,g){var m=d.useCssTransforms,f=d.currentTranslate,n=d.currentScale,k=d.view.translate,p=
-d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var l=d.getGraphBounds(),u=0,v=0,x=pa.get(),t=1/d.pageScale,C=B.checked;if(C)var t=parseInt(K.value),y=parseInt(ka.value),t=Math.min(x.height*y/(l.height/d.view.scale),x.width*t/(l.width/d.view.scale));else t=parseInt(q.value)/(100*d.pageScale),isNaN(t)&&(c=1/d.pageScale,q.value="100 %");x=mxRectangle.fromRectangle(x);x.width=Math.ceil(x.width*
-c);x.height=Math.ceil(x.height*c);t*=c;!C&&d.pageVisible?(l=d.getPageLayout(),u-=l.x*x.width,v-=l.y*x.height):C=!0;if(null==b){b=PrintDialog.createPrintPreview(d,t,x,0,u,v,C);b.pageSelector=!1;b.mathEnabled=!1;u=a.getCurrentFile();null!=u&&(b.title=u.getTitle());var z=b.writeHead;b.writeHead=function(b){z.apply(this,arguments);null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"));if(null!=d.extFonts)for(var c=0;c<d.extFonts.length;c++){var e=
+d.view.scale;d.useCssTransforms&&(d.useCssTransforms=!1,d.currentTranslate=new mxPoint(0,0),d.currentScale=1,d.view.translate=new mxPoint(0,0),d.view.scale=1);var l=d.getGraphBounds(),u=0,x=0,v=pa.get(),q=1/d.pageScale,C=A.checked;if(C)var q=parseInt(K.value),y=parseInt(ka.value),q=Math.min(v.height*y/(l.height/d.view.scale),v.width*q/(l.width/d.view.scale));else q=parseInt(t.value)/(100*d.pageScale),isNaN(q)&&(c=1/d.pageScale,t.value="100 %");v=mxRectangle.fromRectangle(v);v.width=Math.ceil(v.width*
+c);v.height=Math.ceil(v.height*c);q*=c;!C&&d.pageVisible?(l=d.getPageLayout(),u-=l.x*v.width,x-=l.y*v.height):C=!0;if(null==b){b=PrintDialog.createPrintPreview(d,q,v,0,u,x,C);b.pageSelector=!1;b.mathEnabled=!1;u=a.getCurrentFile();null!=u&&(b.title=u.getTitle());var z=b.writeHead;b.writeHead=function(b){z.apply(this,arguments);null!=a.editor.fontCss&&(b.writeln('<style type="text/css">'),b.writeln(a.editor.fontCss),b.writeln("</style>"));if(null!=d.extFonts)for(var c=0;c<d.extFonts.length;c++){var e=
d.extFonts[c].name,g=d.extFonts[c].url;0==g.indexOf(Editor.GOOGLE_FONTS)?b.writeln('<link rel="stylesheet" href="'+g+'" charset="UTF-8" type="text/css">'):(b.writeln('<style type="text/css">'),b.writeln('@font-face {\n\tfont-family: "'+e+'";\n\tsrc: url("'+g+'");\n}'),b.writeln("</style>"))}};if("undefined"!==typeof MathJax){var D=b.renderPage;b.renderPage=function(d,b,c,e,g,m){var f=mxClient.NO_FO;mxClient.NO_FO=this.graph.mathEnabled&&!a.editor.useForeignObjectForMath?!0:a.editor.originalNoForeignObject;
-var n=D.apply(this,arguments);mxClient.NO_FO=f;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:n.className="geDisableMathJax";return n}}u=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(u=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());b.open(null,null,g,!0);null!=u&&(e.stylesheet=u,e.refresh())}else{x=d.background;if(null==x||""==x||x==mxConstants.NONE)x="#ffffff";b.backgroundColor=x;b.autoOrigin=C;b.appendGraph(d,t,u,v,g,!0);if(null!=d.extFonts&&null!=b.wnd)for(g=
-0;g<d.extFonts.length;g++)u=d.extFonts[g].name,v=d.extFonts[g].url,0==v.indexOf(Editor.GOOGLE_FONTS)?b.wnd.document.writeln('<link rel="stylesheet" href="'+v+'" charset="UTF-8" type="text/css">'):(b.wnd.document.writeln('<style type="text/css">'),b.wnd.document.writeln('@font-face {\n\tfont-family: "'+u+'";\n\tsrc: url("'+v+'");\n}'),b.wnd.document.writeln("</style>"))}m&&(d.useCssTransforms=m,d.currentTranslate=f,d.currentScale=n,d.view.translate=k,d.view.scale=p);return b}var c=parseInt(ia.value)/
-100;isNaN(c)&&(c=1,ia.value="100 %");var c=.75*c,g=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(g=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());var m=u.value,f=v.value,k=!p.checked,l=null;k&&(k=m==n&&f==n);if(!k&&null!=a.pages&&a.pages.length){var x=0,k=a.pages.length-1;p.checked||(x=parseInt(m)-1,k=parseInt(f)-1);for(var t=x;t<=k;t++){var C=a.pages[t],m=C==a.currentPage?e:null;if(null==m){var m=a.createTemporaryGraph(e.stylesheet),f=!0,x=!1,y=null,z=null;null==C.viewState&&
-null==C.root&&a.updatePageRoot(C);null!=C.viewState&&(f=C.viewState.pageVisible,x=C.viewState.mathEnabled,y=C.viewState.background,z=C.viewState.backgroundImage,m.extFonts=C.viewState.extFonts);m.background=y;m.backgroundImage=null!=z?new mxImage(z.src,z.width,z.height):null;m.pageVisible=f;m.mathEnabled=x;var D=m.getGlobalVariable;m.getGlobalVariable=function(d){return"page"==d?C.getName():"pagenumber"==d?t+1:"pagecount"==d?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(m.container);
-a.updatePageRoot(C);m.model.setRoot(C.root)}l=b(m,l,t!=k);m!=e&&m.container.parentNode.removeChild(m.container)}}else l=b(e);null==l?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(l.mathEnabled&&(k=l.wnd.document,k.writeln('<script type="text/x-mathjax-config">'),k.writeln("MathJax.Hub.Config({"),k.writeln("showMathMenu: false,"),k.writeln('messageStyle: "none",'),k.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/SVG"],'),k.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),
+var n=D.apply(this,arguments);mxClient.NO_FO=f;this.graph.mathEnabled?this.mathEnabled=this.mathEnabled||!0:n.className="geDisableMathJax";return n}}u=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(u=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());b.open(null,null,g,!0);null!=u&&(e.stylesheet=u,e.refresh())}else{v=d.background;if(null==v||""==v||v==mxConstants.NONE)v="#ffffff";b.backgroundColor=v;b.autoOrigin=C;b.appendGraph(d,q,u,x,g,!0);if(null!=d.extFonts&&null!=b.wnd)for(g=
+0;g<d.extFonts.length;g++)u=d.extFonts[g].name,x=d.extFonts[g].url,0==x.indexOf(Editor.GOOGLE_FONTS)?b.wnd.document.writeln('<link rel="stylesheet" href="'+x+'" charset="UTF-8" type="text/css">'):(b.wnd.document.writeln('<style type="text/css">'),b.wnd.document.writeln('@font-face {\n\tfont-family: "'+u+'";\n\tsrc: url("'+x+'");\n}'),b.wnd.document.writeln("</style>"))}m&&(d.useCssTransforms=m,d.currentTranslate=f,d.currentScale=n,d.view.translate=k,d.view.scale=p);return b}var c=parseInt(ia.value)/
+100;isNaN(c)&&(c=1,ia.value="100 %");var c=.75*c,g=null;null!=e.themes&&"darkTheme"==e.defaultThemeName&&(g=e.stylesheet,e.stylesheet=e.getDefaultStylesheet(),e.refresh());var m=u.value,f=v.value,k=!p.checked,l=null;k&&(k=m==n&&f==n);if(!k&&null!=a.pages&&a.pages.length){var x=0,k=a.pages.length-1;p.checked||(x=parseInt(m)-1,k=parseInt(f)-1);for(var q=x;q<=k;q++){var C=a.pages[q],m=C==a.currentPage?e:null;if(null==m){var m=a.createTemporaryGraph(e.stylesheet),f=!0,x=!1,y=null,z=null;null==C.viewState&&
+null==C.root&&a.updatePageRoot(C);null!=C.viewState&&(f=C.viewState.pageVisible,x=C.viewState.mathEnabled,y=C.viewState.background,z=C.viewState.backgroundImage,m.extFonts=C.viewState.extFonts);m.background=y;m.backgroundImage=null!=z?new mxImage(z.src,z.width,z.height):null;m.pageVisible=f;m.mathEnabled=x;var D=m.getGlobalVariable;m.getGlobalVariable=function(d){return"page"==d?C.getName():"pagenumber"==d?q+1:"pagecount"==d?null!=a.pages?a.pages.length:1:D.apply(this,arguments)};document.body.appendChild(m.container);
+a.updatePageRoot(C);m.model.setRoot(C.root)}l=b(m,l,q!=k);m!=e&&m.container.parentNode.removeChild(m.container)}}else l=b(e);null==l?a.handleError({message:mxResources.get("errorUpdatingPreview")}):(l.mathEnabled&&(k=l.wnd.document,k.writeln('<script type="text/x-mathjax-config">'),k.writeln("MathJax.Hub.Config({"),k.writeln("showMathMenu: false,"),k.writeln('messageStyle: "none",'),k.writeln('jax: ["input/TeX", "input/MathML", "input/AsciiMath", "output/SVG"],'),k.writeln('extensions: ["tex2jax.js", "mml2jax.js", "asciimath2jax.js"],'),
k.writeln("TeX: {"),k.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'),k.writeln("},"),k.writeln("SVG: {"),k.writeln('font: "'+(null!=urlParams["math-font"]?decodeURIComponent(urlParams["math-font"]):"TeX")+'"'),k.writeln("},"),k.writeln("tex2jax: {"),k.writeln('ignoreClass: "geDisableMathJax"'),k.writeln("},"),k.writeln("asciimath2jax: {"),k.writeln('ignoreClass: "geDisableMathJax"'),k.writeln("}"),k.writeln("});"),d&&(k.writeln("MathJax.Hub.Queue(function () {"),
k.writeln("window.print();"),k.writeln("});")),k.writeln("\x3c/script>"),k.writeln('<script type="text/javascript" src="'+DRAW_MATH_URL+'/MathJax.js">\x3c/script>')),l.closeDocument(),!l.mathEnabled&&d&&PrintDialog.printPreview(l));null!=g&&(e.stylesheet=g,e.refresh())}var e=a.editor.graph,g=document.createElement("div"),m=document.createElement("h3");m.style.width="100%";m.style.textAlign="center";m.style.marginTop="0px";mxUtils.write(m,d||mxResources.get("print"));g.appendChild(m);var f=1,n=1,k=
document.createElement("div");k.style.cssText="border-bottom:1px solid lightGray;padding-bottom:12px;margin-bottom:12px;";var p=document.createElement("input");p.style.cssText="margin-right:8px;margin-bottom:8px;";p.setAttribute("value","all");p.setAttribute("type","radio");p.setAttribute("name","pages-printdialog");k.appendChild(p);m=document.createElement("span");mxUtils.write(m,mxResources.get("printAllPages"));k.appendChild(m);mxUtils.br(k);var l=p.cloneNode(!0);p.setAttribute("checked","checked");
l.setAttribute("value","range");k.appendChild(l);m=document.createElement("span");mxUtils.write(m,mxResources.get("pages")+":");k.appendChild(m);var u=document.createElement("input");u.style.cssText="margin:0 8px 0 8px;";u.setAttribute("value","1");u.setAttribute("type","number");u.setAttribute("min","1");u.style.width="50px";k.appendChild(u);m=document.createElement("span");mxUtils.write(m,mxResources.get("to"));k.appendChild(m);var v=u.cloneNode(!0);k.appendChild(v);mxEvent.addListener(u,"focus",
-function(){l.checked=!0});mxEvent.addListener(v,"focus",function(){l.checked=!0});mxEvent.addListener(u,"change",b);mxEvent.addListener(v,"change",b);if(null!=a.pages&&(f=a.pages.length,null!=a.currentPage))for(m=0;m<a.pages.length;m++)if(a.currentPage==a.pages[m]){n=m+1;u.value=n;v.value=n;break}u.setAttribute("max",f);v.setAttribute("max",f);1<f&&g.appendChild(k);var x=document.createElement("div");x.style.marginBottom="10px";var t=document.createElement("input");t.style.marginRight="8px";t.setAttribute("value",
-"adjust");t.setAttribute("type","radio");t.setAttribute("name","printZoom");x.appendChild(t);m=document.createElement("span");mxUtils.write(m,mxResources.get("adjustTo"));x.appendChild(m);var q=document.createElement("input");q.style.cssText="margin:0 8px 0 8px;";q.setAttribute("value","100 %");q.style.width="50px";x.appendChild(q);mxEvent.addListener(q,"focus",function(){t.checked=!0});g.appendChild(x);var k=k.cloneNode(!1),B=t.cloneNode(!0);B.setAttribute("value","fit");t.setAttribute("checked",
-"checked");m=document.createElement("div");m.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";m.appendChild(B);k.appendChild(m);x=document.createElement("table");x.style.display="inline-block";var C=document.createElement("tbody"),y=document.createElement("tr"),z=y.cloneNode(!0),D=document.createElement("td"),A=D.cloneNode(!0),F=D.cloneNode(!0),J=D.cloneNode(!0),E=D.cloneNode(!0),G=D.cloneNode(!0);D.style.textAlign="right";J.style.textAlign="right";mxUtils.write(D,
-mxResources.get("fitTo"));var K=document.createElement("input");K.style.cssText="margin:0 8px 0 8px;";K.setAttribute("value","1");K.setAttribute("min","1");K.setAttribute("type","number");K.style.width="40px";A.appendChild(K);m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsAcross"));F.appendChild(m);mxUtils.write(J,mxResources.get("fitToBy"));var ka=K.cloneNode(!0);E.appendChild(ka);mxEvent.addListener(K,"focus",function(){B.checked=!0});mxEvent.addListener(ka,"focus",
-function(){B.checked=!0});m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsDown"));G.appendChild(m);y.appendChild(D);y.appendChild(A);y.appendChild(F);z.appendChild(J);z.appendChild(E);z.appendChild(G);C.appendChild(y);C.appendChild(z);x.appendChild(C);k.appendChild(x);g.appendChild(k);k=document.createElement("div");m=document.createElement("div");m.style.fontWeight="bold";m.style.marginBottom="12px";mxUtils.write(m,mxResources.get("paperSize"));k.appendChild(m);m=document.createElement("div");
+function(){l.checked=!0});mxEvent.addListener(v,"focus",function(){l.checked=!0});mxEvent.addListener(u,"change",b);mxEvent.addListener(v,"change",b);if(null!=a.pages&&(f=a.pages.length,null!=a.currentPage))for(m=0;m<a.pages.length;m++)if(a.currentPage==a.pages[m]){n=m+1;u.value=n;v.value=n;break}u.setAttribute("max",f);v.setAttribute("max",f);1<f&&g.appendChild(k);var x=document.createElement("div");x.style.marginBottom="10px";var q=document.createElement("input");q.style.marginRight="8px";q.setAttribute("value",
+"adjust");q.setAttribute("type","radio");q.setAttribute("name","printZoom");x.appendChild(q);m=document.createElement("span");mxUtils.write(m,mxResources.get("adjustTo"));x.appendChild(m);var t=document.createElement("input");t.style.cssText="margin:0 8px 0 8px;";t.setAttribute("value","100 %");t.style.width="50px";x.appendChild(t);mxEvent.addListener(t,"focus",function(){q.checked=!0});g.appendChild(x);var k=k.cloneNode(!1),A=q.cloneNode(!0);A.setAttribute("value","fit");q.setAttribute("checked",
+"checked");m=document.createElement("div");m.style.cssText="display:inline-block;height:100%;vertical-align:top;padding-top:2px;";m.appendChild(A);k.appendChild(m);x=document.createElement("table");x.style.display="inline-block";var C=document.createElement("tbody"),y=document.createElement("tr"),z=y.cloneNode(!0),D=document.createElement("td"),B=D.cloneNode(!0),E=D.cloneNode(!0),J=D.cloneNode(!0),F=D.cloneNode(!0),H=D.cloneNode(!0);D.style.textAlign="right";J.style.textAlign="right";mxUtils.write(D,
+mxResources.get("fitTo"));var K=document.createElement("input");K.style.cssText="margin:0 8px 0 8px;";K.setAttribute("value","1");K.setAttribute("min","1");K.setAttribute("type","number");K.style.width="40px";B.appendChild(K);m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsAcross"));E.appendChild(m);mxUtils.write(J,mxResources.get("fitToBy"));var ka=K.cloneNode(!0);F.appendChild(ka);mxEvent.addListener(K,"focus",function(){A.checked=!0});mxEvent.addListener(ka,"focus",
+function(){A.checked=!0});m=document.createElement("span");mxUtils.write(m,mxResources.get("fitToSheetsDown"));H.appendChild(m);y.appendChild(D);y.appendChild(B);y.appendChild(E);z.appendChild(J);z.appendChild(F);z.appendChild(H);C.appendChild(y);C.appendChild(z);x.appendChild(C);k.appendChild(x);g.appendChild(k);k=document.createElement("div");m=document.createElement("div");m.style.fontWeight="bold";m.style.marginBottom="12px";mxUtils.write(m,mxResources.get("paperSize"));k.appendChild(m);m=document.createElement("div");
m.style.marginBottom="12px";var pa=PageSetupDialog.addPageFormatPanel(m,"printdialog",a.editor.graph.pageFormat||mxConstants.PAGE_FORMAT_A4_PORTRAIT);k.appendChild(m);m=document.createElement("span");mxUtils.write(m,mxResources.get("pageScale"));k.appendChild(m);var ia=document.createElement("input");ia.style.cssText="margin:0 8px 0 8px;";ia.setAttribute("value","100 %");ia.style.width="60px";k.appendChild(ia);g.appendChild(k);m=document.createElement("div");m.style.cssText="text-align:right;margin:48px 0 0 0;";
k=mxUtils.button(mxResources.get("cancel"),function(){a.hideDialog()});k.className="geBtn";a.editor.cancelFirst&&m.appendChild(k);a.isOffline()||(x=mxUtils.button(mxResources.get("help"),function(){e.openLink("https://desk.draw.io/support/solutions/articles/16000048947")}),x.className="geBtn",m.appendChild(x));PrintDialog.previewEnabled&&(x=mxUtils.button(mxResources.get("preview"),function(){a.hideDialog();c(!1)}),x.className="geBtn",m.appendChild(x));x=mxUtils.button(mxResources.get(PrintDialog.previewEnabled?
-"print":"ok"),function(){a.hideDialog();c(!0)});x.className="geBtn gePrimaryBtn";m.appendChild(x);a.editor.cancelFirst||m.appendChild(k);g.appendChild(m);this.container=g};var F=ChangePageSetup.prototype.execute;ChangePageSetup.prototype.execute=function(){null==this.page&&(this.page=this.ui.currentPage);this.page!=this.ui.currentPage?null!=this.page.viewState&&(this.ignoreColor||(this.page.viewState.background=this.color),this.ignoreImage||(this.page.viewState.backgroundImage=this.image),null!=this.format&&
-(this.page.viewState.pageFormat=this.format),null!=this.mathEnabled&&(this.page.viewState.mathEnabled=this.mathEnabled),null!=this.shadowVisible&&(this.page.viewState.shadowVisible=this.shadowVisible)):(F.apply(this,arguments),null!=this.mathEnabled&&this.mathEnabled!=this.ui.isMathEnabled()&&(this.ui.setMathEnabled(this.mathEnabled),this.mathEnabled=!this.mathEnabled),null!=this.shadowVisible&&this.shadowVisible!=this.ui.editor.graph.shadowVisible&&(this.ui.editor.graph.setShadowVisible(this.shadowVisible),
-this.shadowVisible=!this.shadowVisible))};Editor.prototype.useCanvasForExport=!1;try{var G=document.createElement("canvas"),E=new Image;E.onload=function(){try{G.getContext("2d").drawImage(E,0,0);var a=G.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(K){}};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(J){}})();
-(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,c,b){b.ui=a.ui;return c};a.afterDecode=function(a,c,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="13.0.4";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars=
+"print":"ok"),function(){a.hideDialog();c(!0)});x.className="geBtn gePrimaryBtn";m.appendChild(x);a.editor.cancelFirst||m.appendChild(k);g.appendChild(m);this.container=g};var E=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)):(E.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 H=document.createElement("canvas"),F=new Image;F.onload=function(){try{H.getContext("2d").drawImage(F,0,0);var a=H.toDataURL("image/png");Editor.prototype.useCanvasForExport=null!=a&&6<a.length}catch(K){}};F.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1px" height="1px" version="1.1"><foreignObject pointer-events="all" width="1" height="1"><div xmlns="http://www.w3.org/1999/xhtml"></div></foreignObject></svg>')))}catch(J){}})();
+(function(){var a=new mxObjectCodec(new ChangePageSetup,["ui","previousColor","previousImage","previousFormat"]);a.beforeDecode=function(a,c,b){b.ui=a.ui;return c};a.afterDecode=function(a,c,b){b.previousColor=b.color;b.previousImage=b.image;b.previousFormat=b.format;null!=b.foldingEnabled&&(b.foldingEnabled=!b.foldingEnabled);null!=b.mathEnabled&&(b.mathEnabled=!b.mathEnabled);null!=b.shadowVisible&&(b.shadowVisible=!b.shadowVisible);return b};mxCodecRegistry.register(a)})();(function(){EditorUi.VERSION="13.0.6";EditorUi.compactUi="atlas"!=uiTheme;mxGraphView.prototype.defaultDarkGridColor="#6e6e6e";"dark"==uiTheme&&(mxGraphView.prototype.gridColor=mxGraphView.prototype.defaultDarkGridColor);EditorUi.enableLogging="1"!=urlParams.stealth&&(/.*\.draw\.io$/.test(window.location.hostname)||/.*\.diagrams\.net$/.test(window.location.hostname))&&"support.draw.io"!=window.location.hostname;EditorUi.drawHost=window.DRAWIO_BASE_URL;EditorUi.lastErrorMessage=null;EditorUi.ignoredAnonymizedChars=
"\n\t`~!@#$%^&*()_+{}|:\"<>?-=[];'./,\n\t";EditorUi.templateFile=TEMPLATE_PATH+"/index.xml";EditorUi.cacheUrl="1"==urlParams.dev?"/cache":window.REALTIME_URL;null==EditorUi.cacheUrl&&"undefined"!==typeof DrawioFile&&(DrawioFile.SYNC="none");Editor.cacheTimeout=1E4;EditorUi.enablePlantUml=EditorUi.enableLogging;EditorUi.isElectronApp=null!=window&&null!=window.process&&null!=window.process.versions&&null!=window.process.versions.electron;EditorUi.enableDrafts=!mxClient.IS_CHROMEAPP&&isLocalStorage&&
!EditorUi.isElectronApp&&"0"!=urlParams.drafts;EditorUi.scratchpadHelpLink="https://desk.draw.io/support/solutions/articles/16000042367";EditorUi.defaultMermaidConfig={theme:"neutral",arrowMarkerAbsolute:!1,flowchart:{htmlLabels:!1},sequence:{diagramMarginX:50,diagramMarginY:10,actorMargin:50,width:150,height:65,boxMargin:10,boxTextMargin:5,noteMargin:10,messageMargin:35,mirrorActors:!0,bottomMarginAdj:1,useMaxWidth:!0,rightAngles:!1,showSequenceNumbers:!1},gantt:{titleTopMargin:25,barHeight:20,barGap:4,
topPadding:50,leftPadding:75,gridLineStartPadding:35,fontSize:11,fontFamily:'"Open-Sans", "sans-serif"',numberSectionStyles:4,axisFormat:"%Y-%m-%d"}};EditorUi.logError=function(a,b,c,e,f,k,l){k=null!=k?k:0<=a.indexOf("NetworkError")||0<=a.indexOf("SecurityError")||0<=a.indexOf("NS_ERROR_FAILURE")||0<=a.indexOf("out of memory")?"CONFIG":"SEVERE";if(EditorUi.enableLogging&&"1"!=urlParams.dev)try{if(a!=EditorUi.lastErrorMessage&&(null==a||null==b||-1==a.indexOf("Script error")&&-1==a.indexOf("extension"))&&
@@ -9097,14 +9097,14 @@ function(a,b,c){c=null!=c?c:24;var d=new Spinner({lines:12,length:c,width:Math.r
d.pause=function(){return function(){}};return d};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.isRemoteVisioData=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)||60==a.charCodeAt(0)&&63==a.charCodeAt(1)&&120==a.charCodeAt(2)&&109==a.charCodeAt(3)&&108==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 f=mxUtils.parseXml(d),k=this.editor.extractGraphModel(f.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!=k?mxUtils.getXml(k):""}catch(t){}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=
+">").replace(/&lt;/g,"<").replace(/\\&quot;/g,'"').replace(/\n/g,""))}else var f=mxUtils.parseXml(d),k=this.editor.extractGraphModel(f.documentElement,null!=this.pages||"hidden"==this.diagramContainer.style.visibility),b=null!=k?mxUtils.getXml(k):""}catch(q){}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 f=this.updatePageRoot(new DiagramPage(c[e]));
null==f.getName()&&f.setName(mxResources.get("pageWithNumber",[e+1]));d.model.execute(new ChangePage(this,f,0==e?f: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,f,k,l,q,v,z,y){b=null!=b?b:this.editor.graph;f=null!=f?f:!1;v=null!=v?v:!0;var d,g=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?d="_blank":g=d=e;if(null==a)return"";var m=a;if("mxfile"!=m.nodeName.toLowerCase()){if(y){var n=a.ownerDocument.createElement("diagram");n.setAttribute("id",
+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,f,k,l,t,v,z,y){b=null!=b?b:this.editor.graph;f=null!=f?f:!1;v=null!=v?v:!0;var d,g=null;null==c||c.getMode()==App.MODE_DEVICE||c.getMode()==App.MODE_BROWSER?d="_blank":g=d=e;if(null==a)return"";var m=a;if("mxfile"!=m.nodeName.toLowerCase()){if(y){var n=a.ownerDocument.createElement("diagram");n.setAttribute("id",
Editor.guid());n.appendChild(a)}else{n=Graph.zapGremlins(mxUtils.getXml(a));m=Graph.compress(n);if(Graph.decompress(m)!=n)return n;n=a.ownerDocument.createElement("diagram");n.setAttribute("id",Editor.guid());mxUtils.setTextContent(n,m)}m=a.ownerDocument.createElement("mxfile");m.appendChild(n)}z?(m=m.cloneNode(!0),m.removeAttribute("modified"),m.removeAttribute("host"),m.removeAttribute("agent"),m.removeAttribute("etag"),m.removeAttribute("userAgent"),m.removeAttribute("version"),m.removeAttribute("editor"),
m.removeAttribute("type")):(m.removeAttribute("userAgent"),m.removeAttribute("version"),m.removeAttribute("editor"),m.removeAttribute("pages"),m.removeAttribute("type"),mxClient.IS_CHROMEAPP?m.setAttribute("host","Chrome"):EditorUi.isElectronApp?m.setAttribute("host","Electron"):m.setAttribute("host",window.location.hostname),m.setAttribute("modified",(new Date).toISOString()),m.setAttribute("agent",navigator.appVersion),m.setAttribute("version",EditorUi.VERSION),m.setAttribute("etag",Editor.guid()),
a=null!=c?c.getMode():this.mode,null!=a&&m.setAttribute("type",a),1<m.getElementsByTagName("diagram").length&&null!=this.pages&&m.setAttribute("pages",this.pages.length));y=y?mxUtils.getPrettyXml(m):mxUtils.getXml(m);if(!k&&!f&&(l||null!=c&&/(\.html)$/i.test(c.getTitle())))y=this.getHtml2(mxUtils.getXml(m),b,null!=c?c.getTitle():null,d,g);else if(k||!f&&null!=c&&/(\.svg)$/i.test(c.getTitle()))null==c||c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER||(e=null),y=this.getEmbeddedSvg(y,b,
-e,null,q,v,g);return y};EditorUi.prototype.getXmlFileData=function(a,b,c){a=null!=a?a:!0;b=null!=b?b:!1;c=null!=c?c:!Editor.compressXml;var d=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(a=function(a){var b=a.getElementsByTagName("mxGraphModel"),b=0<b.length?b[0]:null;null==b&&c?(b=mxUtils.trim(mxUtils.getTextContent(a)),a=a.cloneNode(!1),0<b.length&&(b=Graph.decompress(b),null!=b&&0<b.length&&a.appendChild(mxUtils.parseXml(b).documentElement))):null==b||c?a=a.cloneNode(!0):
+e,null,t,v,g);return y};EditorUi.prototype.getXmlFileData=function(a,b,c){a=null!=a?a:!0;b=null!=b?b:!1;c=null!=c?c:!Editor.compressXml;var d=this.editor.getGraphXml(a);if(a&&null!=this.fileNode&&null!=this.currentPage)if(a=function(a){var b=a.getElementsByTagName("mxGraphModel"),b=0<b.length?b[0]:null;null==b&&c?(b=mxUtils.trim(mxUtils.getTextContent(a)),a=a.cloneNode(!1),0<b.length&&(b=Graph.decompress(b),null!=b&&0<b.length&&a.appendChild(mxUtils.parseXml(b).documentElement))):null==b||c?a=a.cloneNode(!0):
(a=a.cloneNode(!1),mxUtils.setTextContent(a,Graph.compressNode(b)));d.appendChild(a)},EditorUi.removeChildNodes(this.currentPage.node),mxUtils.setTextContent(this.currentPage.node,Graph.compressNode(d)),d=this.fileNode.cloneNode(!1),b)a(this.currentPage.node);else for(b=0;b<this.pages.length;b++){if(this.currentPage!=this.pages[b]&&this.pages[b].needsUpdate){var e=(new mxCodec(mxUtils.createXmlDocument())).encode(new mxGraphModel(this.pages[b].root));this.editor.graph.saveViewState(this.pages[b].viewState,
e);EditorUi.removeChildNodes(this.pages[b].node);mxUtils.setTextContent(this.pages[b].node,Graph.compressNode(e));delete this.pages[b].needsUpdate}a(this.pages[b].node)}return d};EditorUi.prototype.anonymizeString=function(a,b){for(var d=[],c=0;c<a.length;c++){var e=a.charAt(c);0<=EditorUi.ignoredAnonymizedChars.indexOf(e)?d.push(e):isNaN(parseInt(e))?e.toLowerCase()!=e?d.push(String.fromCharCode(65+Math.round(25*Math.random()))):e.toUpperCase()!=e?d.push(String.fromCharCode(97+Math.round(25*Math.random()))):
/\s/.test(e)?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(u){a[EditorUi.DIFF_INSERT][d].data=
@@ -9112,8 +9112,8 @@ u.message}if(null!=a[EditorUi.DIFF_UPDATE]){for(var c in a[EditorUi.DIFF_UPDATE]
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,f,k,l,q,v,z){f=null!=f?f:!0;k=null!=k?k:!1;var d=this.editor.graph;if(b||!a&&null!=v&&/(\.svg)$/i.test(v.getTitle()))if(z=
-!1,null!=this.pages&&this.currentPage!=this.pages[0]){var g=d.getGlobalVariable,d=this.createTemporaryGraph(d.getStylesheet()),m=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?1:g.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(m.root)}l=null!=l?l:this.getXmlFileData(f,k,z);v=null!=v?v:this.getCurrentFile();a=this.createFileData(l,d,v,window.location.href,a,b,c,e,f,q,z);d!=this.editor.graph&&d.container.parentNode.removeChild(d.container);
+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,f,k,l,t,v,z){f=null!=f?f:!0;k=null!=k?k:!1;var d=this.editor.graph;if(b||!a&&null!=v&&/(\.svg)$/i.test(v.getTitle()))if(z=
+!1,null!=this.pages&&this.currentPage!=this.pages[0]){var g=d.getGlobalVariable,d=this.createTemporaryGraph(d.getStylesheet()),m=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?1:g.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(m.root)}l=null!=l?l:this.getXmlFileData(f,k,z);v=null!=v?v:this.getCurrentFile();a=this.createFileData(l,d,v,window.location.href,a,b,c,e,f,t,z);d!=this.editor.graph&&d.container.parentNode.removeChild(d.container);
return a};EditorUi.prototype.getHtml=function(a,b,c,e,f,k){k=null!=k?k:!0;var d=null,g=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=b){var d=k?b.getGraphBounds():b.getBoundingBox(b.getSelectionCells()),m=b.view.scale;k=Math.floor(d.x/m-b.view.translate.x);m=Math.floor(d.y/m-b.view.translate.y);d=b.background;null==f&&(b=this.getBasenames().join(";"),0<b.length&&(g=EditorUi.drawHost+"/embed.js?s="+b));a.setAttribute("x0",k);a.setAttribute("y0",m)}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!=f&&(f=f.replace(/&/g,"&amp;"));a=null!=a?Graph.zapGremlins(mxUtils.getXml(a)):"";e=Graph.compress(a);Graph.decompress(e)!=a&&(e=encodeURIComponent(a));return(null==f?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![endif]--\x3e\n':"")+"<!DOCTYPE html>\n<html"+(null!=f?' xmlns="http://www.w3.org/1999/xhtml">':">")+"\n<head>\n"+
(null==f?null!=c?"<title>"+mxUtils.htmlEntities(c)+"</title>\n":"":"<title>diagrams.net</title>\n")+(null!=f?'<meta http-equiv="refresh" content="0;URL=\''+f+"'\"/>\n":"")+"</head>\n<body"+(null==f&&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==f?'<script type="text/javascript" src="'+g+'">\x3c/script>':'<a style="position:absolute;top:50%;left:50%;margin-top:-128px;margin-left:-64px;" href="'+
@@ -9123,57 +9123,57 @@ f?'\x3c!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=5,IE=9" ><![end
mxResources.get("invalidOrMissingFile"));if(d)throw Error(mxResources.get("notADiagramFile")+" ("+d+")");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(var c=0;c<d.length;c++)null==d[c].getAttribute("id")&&d[c].setAttribute("id",c),a=new DiagramPage(d[c]),null==a.getName()&&a.setName(mxResources.get("pageWithNumber",
[c+1])),this.pages.push(a),null!=urlParams["page-id"]&&a.getId()==urlParams["page-id"]&&(b=a);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);if(null!=urlParams["layer-ids"])try{var e=urlParams["layer-ids"].split(" ");a={};for(c=0;c<e.length;c++)a[e[c]]=!0;for(var f=this.editor.graph.getModel(),k=f.getChildren(f.root),c=0;c<k.length;c++){var l=k[c];f.setVisible(l,a[l.id]||!1)}}catch(v){}};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,f,k,l,q,v,z,y){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var d=this.getBaseFilename(!f),g=d+"."+a;if("xml"==a){var m='<?xml version="1.0" encoding="UTF-8"?>\n'+
+/(\.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,f,k,l,t,v,z,y){try{e=null!=e?e:this.editor.graph.isSelectionEmpty();var d=this.getBaseFilename(!f),g=d+"."+a;if("xml"==a){var m='<?xml version="1.0" encoding="UTF-8"?>\n'+
this.getFileData(!0,null,null,null,e,f,null,null,null,b);this.saveData(g,a,m,"text/xml")}else if("html"==a)m=this.getHtml2(this.getFileData(!0),this.editor.graph,d),this.saveData(g,a,m,"text/html");else if("svg"!=a&&"xmlsvg"!=a||!this.spinner.spin(document.body,mxResources.get("export")))"xmlpng"==a?g=d+".png":"jpeg"==a&&(g=d+".jpg"),this.saveRequest(g,a,mxUtils.bind(this,function(d,b){try{var c=this.editor.graph.pageVisible;null!=k&&(this.editor.graph.pageVisible=k);var g=this.createDownloadRequest(d,
-a,e,b,l,f,q,v,z,y);this.editor.graph.pageVisible=c;return g}catch(L){this.handleError(L)}}));else{var n=null,p=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(g,"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 u=this.editor.graph.background;if(l||u==mxConstants.NONE)u=null;var t=this.editor.graph.getSvg(u,null,null,null,null,e);c&&this.editor.graph.addSvgShadow(t);
-this.editor.convertImages(t,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();p('<?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 g=d+".svg",n=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();p(a)}),e)}}catch(E){this.handleError(E)}};EditorUi.prototype.createDownloadRequest=function(a,b,c,e,f,k,l,q,v,z){var d=this.editor.graph,g=d.getGraphBounds();
+a,e,b,l,f,t,v,z,y);this.editor.graph.pageVisible=c;return g}catch(L){this.handleError(L)}}));else{var n=null,p=mxUtils.bind(this,function(a){a.length<=MAX_REQUEST_SIZE?this.saveData(g,"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 u=this.editor.graph.background;if(l||u==mxConstants.NONE)u=null;var q=this.editor.graph.getSvg(u,null,null,null,null,e);c&&this.editor.graph.addSvgShadow(q);
+this.editor.convertImages(q,mxUtils.bind(this,mxUtils.bind(this,function(a){this.spinner.stop();p('<?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 g=d+".svg",n=this.getFileData(!1,!0,null,mxUtils.bind(this,function(a){this.spinner.stop();p(a)}),e)}}catch(F){this.handleError(F)}};EditorUi.prototype.createDownloadRequest=function(a,b,c,e,f,k,l,t,v,z){var d=this.editor.graph,g=d.getGraphBounds();
c=this.getFileData(!0,null,null,null,c,0==k?!1:"xmlpng"!=b);var m="",n="";if(g.width*g.height>MAX_AREA||c.length>MAX_REQUEST_SIZE)throw{message:mxResources.get("drawingTooLarge")};z=z?"1":"0";"pdf"==b&&0==k&&(n="&allPages=1");if("xmlpng"==b&&(z="1",b="png",null!=this.pages&&null!=this.currentPage))for(k=0;k<this.pages.length;k++)if(this.pages[k]==this.currentPage){m="&from="+k;break}k=d.background;"png"==b&&f?k=mxConstants.NONE:f||null!=k&&k!=mxConstants.NONE||(k="#ffffff");f={globalVars:d.getExportVariables()};
-v&&(f.grid={size:d.gridSize,steps:d.view.gridSteps,color:d.view.gridColor});return new mxXmlRequest(EXPORT_URL,"format="+b+m+n+"&bg="+(null!=k?k:mxConstants.NONE)+"&base64="+e+"&embedXml="+z+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(f))+(null!=l?"&scale="+l:"")+(null!=q?"&border="+q:""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var d=window.location.hash,
+v&&(f.grid={size:d.gridSize,steps:d.view.gridSteps,color:d.view.gridColor});return new mxXmlRequest(EXPORT_URL,"format="+b+m+n+"&bg="+(null!=k?k:mxConstants.NONE)+"&base64="+e+"&embedXml="+z+"&xml="+encodeURIComponent(c)+(null!=a?"&filename="+encodeURIComponent(a):"")+"&extras="+encodeURIComponent(JSON.stringify(f))+(null!=l?"&scale="+l:"")+(null!=t?"&border="+t:""))};EditorUi.prototype.setMode=function(a,b){this.mode=a};EditorUi.prototype.loadDescriptor=function(a,b,c){var d=window.location.hash,
e=mxUtils.bind(this,function(c){var e=null!=a.data?a.data:"";null!=c&&0<c.length&&(0<e.length&&(e+="\n"),e+=c);c=new LocalFile(this,"csv"!=a.format&&0<e.length?e:this.emptyDiagramXml,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);c.getHash=function(){return d};this.fileLoaded(c);"csv"==a.format&&this.importCsv(e,mxUtils.bind(this,function(a){this.editor.undoManager.clear();this.editor.setModified(!1);this.editor.setStatus("")}));if(null!=a.update){var g=null!=a.interval?
parseInt(a.interval):6E4,m=null,f=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()),k()):this.handleError({message:mxResources.get("error")+" "+a.getStatus()}))}),mxUtils.bind(this,function(a){this.handleError(a)}))}),k=mxUtils.bind(this,function(){window.clearTimeout(m);m=window.setTimeout(f,
g)});this.editor.addListener("pageSelected",mxUtils.bind(this,function(){k();f()}));k();f()}null!=b&&b()});if(null!=a.url&&0<a.url.length){var g=a.url;/^https?:\/\//.test(g)&&!this.editor.isCorsEnabledForUrl(g)&&(g=PROXY_URL+"?url="+encodeURIComponent(g));this.editor.loadUrl(g,mxUtils.bind(this,function(a){e(a)}),mxUtils.bind(this,function(a){null!=c&&c(a)}))}else e("")};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,f=e.getModel();f.beginUpdate();var k=null;try{for(a=a.firstChild;null!=a;){if("update"==a.nodeName){var l=f.getCell(a.getAttribute("id"));if(null!=l){try{var v=a.getAttribute("value");if(null!=v){var z=mxUtils.parseXml(v).documentElement;if(null!=z)if("1"==z.getAttribute("replace-value"))f.setValue(l,
-z);else for(var y=z.attributes,A=0;A<y.length;A++)e.setAttributeForCell(l,y[A].nodeName,0<y[A].nodeValue.length?y[A].nodeValue:null)}}catch(J){null!=window.console&&console.log("Error in value for "+l.id+": "+J)}try{var x=a.getAttribute("style");null!=x&&e.model.setStyle(l,x)}catch(J){null!=window.console&&console.log("Error in style for "+l.id+": "+J)}try{var B=a.getAttribute("icon");if(null!=B){var C=0<B.length?JSON.parse(B):null;null!=C&&C.append||e.removeCellOverlays(l);null!=C&&e.addCellOverlay(l,
-d(C))}}catch(J){null!=window.console&&console.log("Error in icon for "+l.id+": "+J)}try{var D=a.getAttribute("geometry");if(null!=D){var D=JSON.parse(D),F=e.getCellGeometry(l);if(null!=F){F=F.clone();for(key in D){var G=parseFloat(D[key]);"dx"==key?F.x+=G:"dy"==key?F.y+=G:"dw"==key?F.width+=G:"dh"==key?F.height+=G:F[key]=parseFloat(D[key])}e.model.setGeometry(l,F)}}}catch(J){null!=window.console&&console.log("Error in icon for "+l.id+": "+J)}}}else if("model"==a.nodeName){for(var E=a.firstChild;null!=
-E&&E.nodeType!=mxConstants.NODETYPE_ELEMENT;)E=E.nextSibling;null!=E&&(new mxCodec(a.firstChild)).decode(E,f)}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{f.endUpdate()}null!=
+z);else for(var y=z.attributes,B=0;B<y.length;B++)e.setAttributeForCell(l,y[B].nodeName,0<y[B].nodeValue.length?y[B].nodeValue:null)}}catch(J){null!=window.console&&console.log("Error in value for "+l.id+": "+J)}try{var x=a.getAttribute("style");null!=x&&e.model.setStyle(l,x)}catch(J){null!=window.console&&console.log("Error in style for "+l.id+": "+J)}try{var A=a.getAttribute("icon");if(null!=A){var C=0<A.length?JSON.parse(A):null;null!=C&&C.append||e.removeCellOverlays(l);null!=C&&e.addCellOverlay(l,
+d(C))}}catch(J){null!=window.console&&console.log("Error in icon for "+l.id+": "+J)}try{var D=a.getAttribute("geometry");if(null!=D){var D=JSON.parse(D),E=e.getCellGeometry(l);if(null!=E){E=E.clone();for(key in D){var H=parseFloat(D[key]);"dx"==key?E.x+=H:"dy"==key?E.y+=H:"dw"==key?E.width+=H:"dh"==key?E.height+=H:E[key]=parseFloat(D[key])}e.model.setGeometry(l,E)}}}catch(J){null!=window.console&&console.log("Error in icon for "+l.id+": "+J)}}}else if("model"==a.nodeName){for(var F=a.firstChild;null!=
+F&&F.nodeType!=mxConstants.NODETYPE_ELEMENT;)F=F.nextSibling;null!=F&&(new mxCodec(a.firstChild)).decode(F,f)}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{f.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="",e=d.lastIndexOf(".");0<=e&&(c=d.substring(e),d=d.substring(0,e));if(b)var g=new Date,e=g.getFullYear(),f=g.getMonth()+1,k=g.getDate(),l=g.getHours(),z=g.getMinutes(),g=g.getSeconds(),d=d+(" "+(e+"-"+f+"-"+k+"-"+l+"-"+z+"-"+g));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&&(EditorUi.debug("File.closed",[d]),d.removeListener(this.descriptorChangedListener),d.close());this.editor.graph.model.clear();this.editor.undoManager.clear();var e=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:a.getMode().toUpperCase()+"-OPEN-FILE-"+a.getHash(),action:"size_"+a.getSize(),label:"autosave_"+(this.editor.autosave?"on":
-"off")});EditorUi.debug("File.opened",[a]);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(t){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(t){}}catch(t){this.fileLoadedError=t;if(EditorUi.enableLogging&&!this.isOffline())try{EditorUi.logEvent({category:"ERROR-LOAD-FILE-"+(null!=a?a.getHash():"none"),action:"message_"+t.message,label:"stack_"+
-t.stack})}catch(q){}var g=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):e()});b?g():this.handleError(t,mxResources.get("errorLoadingFile"),g,!0,null,null,!0)}else e();return c};EditorUi.prototype.getHashValueForPages=function(a,b){var d=0,c=new mxGraphModel,e=new mxCodec;null!=b&&(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0);for(var g=0;g<a.length;g++){this.updatePageRoot(a[g]);
+"off")});EditorUi.debug("File.opened",[a]);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(q){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(q){}}catch(q){this.fileLoadedError=q;if(EditorUi.enableLogging&&!this.isOffline())try{EditorUi.logEvent({category:"ERROR-LOAD-FILE-"+(null!=a?a.getHash():"none"),action:"message_"+q.message,label:"stack_"+
+q.stack})}catch(t){}var g=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):e()});b?g():this.handleError(q,mxResources.get("errorLoadingFile"),g,!0,null,null,!0)}else e();return c};EditorUi.prototype.getHashValueForPages=function(a,b){var d=0,c=new mxGraphModel,e=new mxCodec;null!=b&&(b.byteCount=0,b.attrCount=0,b.eltCount=0,b.nodeCount=0);for(var g=0;g<a.length;g++){this.updatePageRoot(a[g]);
var f=a[g].node.cloneNode(!1);f.removeAttribute("name");c.root=a[g].root;var k=e.encode(c);this.editor.graph.saveViewState(a[g].viewState,k,!0);k.removeAttribute("pageWidth");k.removeAttribute("pageHeight");f.appendChild(k);null!=b&&(b.eltCount+=f.getElementsByTagName("*").length,b.nodeCount+=f.getElementsByTagName("mxCell").length);d=(d<<5)-d+this.hashValue(f,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 e=0;e<a.attributes.length;e++){var g=a.attributes[e].name,m=null!=b?b(a,g,a.attributes[e].value,!0):a.attributes[e].value;null!=m&&(d^=this.hashValue(g,
-b,c)+this.hashValue(m,b,c))}}if(null!=a.childNodes)for(e=0;e<a.childNodes.length;e++)d=(d<<5)-d+this.hashValue(a.childNodes[e],b,c)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(e=0;e<a.length;e++)b=(b<<5)-b+a.charCodeAt(e)<<0;d^=b}return d};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,e,f,k,l){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||
+"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 e=0;e<a.attributes.length;e++){var g=a.attributes[e].name,f=null!=b?b(a,g,a.attributes[e].value,!0):a.attributes[e].value;null!=f&&(d^=this.hashValue(g,
+b,c)+this.hashValue(f,b,c))}}if(null!=a.childNodes)for(e=0;e<a.childNodes.length;e++)d=(d<<5)-d+this.hashValue(a.childNodes[e],b,c)<<0}else if(null!=a&&"function"!==typeof a){a=String(a);b=0;null!=c&&(c.byteCount+=a.length);for(e=0;e<a.length;e++)b=(b<<5)-b+a.charCodeAt(e)<<0;d^=b}return d};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,c,e,f,k,l){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||
mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?StorageFile.getFileContent(this,".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,b){var d=mxUtils.parseXml(a.getData());if("mxlibrary"==d.documentElement.nodeName){var c=JSON.parse(mxUtils.getTextContent(d.documentElement));this.libraryLoaded(a,c,d.documentElement.getAttribute("title"),
-b)}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,c,e){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 g=null,f=mxUtils.bind(this,function(d,b){0==d.length&&a.isEditable()?
-(null==g&&(g=document.createElement("div"),g.className="geDropTarget",mxUtils.write(g,mxResources.get("dragElementsHere"))),b.appendChild(g)):this.addLibraryEntries(d,b)});null!=this.sidebar&&null!=b&&this.sidebar.addEntries(b);c=null!=c&&0<c.length?c:a.getTitle();var m=this.sidebar.addPalette(a.getHash(),c,null!=e?e:!0,mxUtils.bind(this,function(a){f(b,a)}));this.repositionLibrary(d);var k=m.parentNode.previousSibling;e=k.getAttribute("title");null!=e&&0<e.length&&".scratchpad"!=a.title&&k.setAttribute("title",
+b)}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,c,e){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 g=null,f=mxUtils.bind(this,function(b,d){0==b.length&&a.isEditable()?
+(null==g&&(g=document.createElement("div"),g.className="geDropTarget",mxUtils.write(g,mxResources.get("dragElementsHere"))),d.appendChild(g)):this.addLibraryEntries(b,d)});null!=this.sidebar&&null!=b&&this.sidebar.addEntries(b);c=null!=c&&0<c.length?c:a.getTitle();var m=this.sidebar.addPalette(a.getHash(),c,null!=e?e:!0,mxUtils.bind(this,function(a){f(b,a)}));this.repositionLibrary(d);var k=m.parentNode.previousSibling;e=k.getAttribute("title");null!=e&&0<e.length&&".scratchpad"!=a.title&&k.setAttribute("title",
this.getLibraryStorageHint(a)+"\n"+e);var n=document.createElement("div");n.style.position="absolute";n.style.right="0px";n.style.top="0px";n.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(n.style.backgroundColor="inherit");k.style.position="relative";var l=document.createElement("img");l.setAttribute("src",Dialog.prototype.closeImage);l.setAttribute("title",mxResources.get("close"));l.setAttribute("valign","absmiddle");l.setAttribute("border","0");l.style.cursor="pointer";l.style.margin=
-"0 3px";var A=null;if(".scratchpad"!=a.title||this.closableScratchpad)n.appendChild(l),mxEvent.addListener(l,"click",mxUtils.bind(this,function(d){if(!mxEvent.isConsumed(d)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=A?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(d)}}));if(a.isEditable()){var x=this.editor.graph,B=null,C=mxUtils.bind(this,function(d){this.showLibraryDialog(a.getTitle(),m,
-b,a,a.getMode());mxEvent.consume(d)}),D=mxUtils.bind(this,function(d){a.setModified(!0);a.isAutosave()?(null!=B&&null!=B.parentNode&&B.parentNode.removeChild(B),B=l.cloneNode(!1),B.setAttribute("src",Editor.spinImage),B.setAttribute("title",mxResources.get("saving")),B.style.cursor="default",B.style.marginRight="2px",B.style.marginTop="-2px",n.insertBefore(B,n.firstChild),k.style.paddingRight=18*n.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=B&&null!=
-B.parentNode&&(B.parentNode.removeChild(B),k.style.paddingRight=18*n.childNodes.length+"px")})):null==A&&(A=l.cloneNode(!1),A.setAttribute("src",IMAGE_PATH+"/download.png"),A.setAttribute("title",mxResources.get("save")),n.insertBefore(A,n.firstChild),mxEvent.addListener(A,"click",mxUtils.bind(this,function(d){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==A||a.isModified()||(k.style.paddingRight=18*n.childNodes.length+"px",A.parentNode.removeChild(A),
-A=null)});mxEvent.consume(d)})),k.style.paddingRight=18*n.childNodes.length+"px")}),F=mxUtils.bind(this,function(a,d,c,e){a=x.cloneCells(mxUtils.sortCells(x.model.getTopmostCells(a)));for(var f=0;f<a.length;f++){var k=x.getCellGeometry(a[f]);null!=k&&k.translate(-d.x,-d.y)}m.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);D(c);null!=
-g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)}),G=mxUtils.bind(this,function(a){if(x.isSelectionEmpty())x.getRubberband().isActive()?(x.getRubberband().execute(a),x.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var d=x.getSelectionCells(),b=x.view.getBounds(d),c=x.view.scale;b.x/=c;b.y/=c;b.width/=c;b.height/=c;b.x-=x.view.translate.x;b.y-=x.view.translate.y;F(d,b)}mxEvent.consume(a)});mxEvent.addGestureListeners(m,
+"0 3px";var B=null;if(".scratchpad"!=a.title||this.closableScratchpad)n.appendChild(l),mxEvent.addListener(l,"click",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b)){var d=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=B?this.confirm(mxResources.get("allChangesLost"),null,d,mxResources.get("cancel"),mxResources.get("discardChanges")):d();mxEvent.consume(b)}}));if(a.isEditable()){var x=this.editor.graph,A=null,C=mxUtils.bind(this,function(d){this.showLibraryDialog(a.getTitle(),m,
+b,a,a.getMode());mxEvent.consume(d)}),D=mxUtils.bind(this,function(d){a.setModified(!0);a.isAutosave()?(null!=A&&null!=A.parentNode&&A.parentNode.removeChild(A),A=l.cloneNode(!1),A.setAttribute("src",Editor.spinImage),A.setAttribute("title",mxResources.get("saving")),A.style.cursor="default",A.style.marginRight="2px",A.style.marginTop="-2px",n.insertBefore(A,n.firstChild),k.style.paddingRight=18*n.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=A&&null!=
+A.parentNode&&(A.parentNode.removeChild(A),k.style.paddingRight=18*n.childNodes.length+"px")})):null==B&&(B=l.cloneNode(!1),B.setAttribute("src",IMAGE_PATH+"/download.png"),B.setAttribute("title",mxResources.get("save")),n.insertBefore(B,n.firstChild),mxEvent.addListener(B,"click",mxUtils.bind(this,function(d){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==B||a.isModified()||(k.style.paddingRight=18*n.childNodes.length+"px",B.parentNode.removeChild(B),
+B=null)});mxEvent.consume(d)})),k.style.paddingRight=18*n.childNodes.length+"px")}),E=mxUtils.bind(this,function(a,d,c,e){a=x.cloneCells(mxUtils.sortCells(x.model.getTopmostCells(a)));for(var f=0;f<a.length;f++){var k=x.getCellGeometry(a[f]);null!=k&&k.translate(-d.x,-d.y)}m.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);D(c);null!=
+g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)}),H=mxUtils.bind(this,function(a){if(x.isSelectionEmpty())x.getRubberband().isActive()?(x.getRubberband().execute(a),x.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var d=x.getSelectionCells(),b=x.view.getBounds(d),c=x.view.scale;b.x/=c;b.y/=c;b.width/=c;b.height/=c;b.x-=x.view.translate.x;b.y-=x.view.translate.y;E(d,b)}mxEvent.consume(a)});mxEvent.addGestureListeners(m,
function(){},mxUtils.bind(this,function(a){x.isMouseDown&&null!=x.panningManager&&null!=x.graphHandler.first&&(x.graphHandler.suspend(),null!=x.graphHandler.hint&&(x.graphHandler.hint.style.visibility="hidden"),m.style.backgroundColor="#f1f3f4",m.style.cursor="copy",x.panningManager.stop(),x.autoScroll=!1,mxEvent.consume(a))}),mxUtils.bind(this,function(a){x.isMouseDown&&null!=x.panningManager&&null!=x.graphHandler&&(m.style.backgroundColor="",m.style.cursor="default",this.sidebar.showTooltips=!0,
-x.panningManager.stop(),x.graphHandler.reset(),x.isMouseDown=!1,x.autoScroll=!0,G(a),mxEvent.consume(a))}));mxEvent.addListener(m,"mouseleave",mxUtils.bind(this,function(a){x.isMouseDown&&null!=x.graphHandler.first&&(x.graphHandler.resume(),null!=x.graphHandler.hint&&(x.graphHandler.hint.style.visibility="visible"),m.style.backgroundColor="",m.style.cursor="",x.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(m,"dragover",mxUtils.bind(this,function(a){m.style.backgroundColor="#f1f3f4";a.dataTransfer.dropEffect=
+x.panningManager.stop(),x.graphHandler.reset(),x.isMouseDown=!1,x.autoScroll=!0,H(a),mxEvent.consume(a))}));mxEvent.addListener(m,"mouseleave",mxUtils.bind(this,function(a){x.isMouseDown&&null!=x.graphHandler.first&&(x.graphHandler.resume(),null!=x.graphHandler.hint&&(x.graphHandler.hint.style.visibility="visible"),m.style.backgroundColor="",m.style.cursor="",x.autoScroll=!0)}));Graph.fileSupport&&(mxEvent.addListener(m,"dragover",mxUtils.bind(this,function(a){m.style.backgroundColor="#f1f3f4";a.dataTransfer.dropEffect=
"copy";m.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(m,"drop",mxUtils.bind(this,function(a){m.style.cursor="";m.style.backgroundColor="";0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(d,c,e,k,n,l,p,x,v){if(null!=d&&"image/"==c.substring(0,6))d="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;aspect=fixed;image="+this.convertDataUri(d),d=[new mxCell("",
-new mxGeometry(0,0,n,l),d)],d[0].vertex=!0,F(d,new mxRectangle(0,0,n,l),a,mxEvent.isAltDown(a)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," ")),null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null);else{var u=!1,t=mxUtils.bind(this,function(d,c){if(null!=d&&"application/pdf"==c){var e=Editor.extractGraphModelFromPdf(d);null!=e&&0<e.length&&(d=e)}if(null!=d)if(e=mxUtils.parseXml(d),"mxlibrary"==e.documentElement.nodeName)try{var k=JSON.parse(mxUtils.getTextContent(e.documentElement));
-f(k,m);b=b.concat(k);D(a);this.spinner.stop();u=!0}catch(N){}else if("mxfile"==e.documentElement.nodeName)try{for(var n=e.documentElement.getElementsByTagName("diagram"),k=0;k<n.length;k++){var l=this.stringToCells(Editor.getDiagramNodeXml(n[k])),p=this.editor.graph.getBoundingBoxFromGeometry(l);F(l,new mxRectangle(0,0,p.width,p.height),a)}u=!0}catch(N){null!=window.console&&console.log("error in drop handler:",N)}u||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
-null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)});null!=v&&null!=p&&(/(\.v(dx|sdx?))($|\?)/i.test(p)||/(\.vs(x|sx?))($|\?)/i.test(p))?this.importVisio(v,function(a){t(a,"text/xml")},null,p):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,p)&&null!=v?this.parseFile(v,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?t(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?
-"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):t(d,c)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(m,"dragleave",function(a){m.style.cursor="";m.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));l=l.cloneNode(!1);l.setAttribute("src",Editor.editImage);l.setAttribute("title",mxResources.get("edit"));n.insertBefore(l,n.firstChild);mxEvent.addListener(l,"click",C);mxEvent.addListener(m,"dblclick",function(a){mxEvent.getSource(a)==
-m&&C(a)});e=l.cloneNode(!1);e.setAttribute("src",Editor.plusImage);e.setAttribute("title",mxResources.get("add"));n.insertBefore(e,n.firstChild);mxEvent.addListener(e,"click",G);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(e=document.createElement("span"),e.setAttribute("title",mxResources.get("help")),e.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(e,"?"),mxEvent.addGestureListeners(e,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);
+new mxGeometry(0,0,n,l),d)],d[0].vertex=!0,E(d,new mxRectangle(0,0,n,l),a,mxEvent.isAltDown(a)?null:p.substring(0,p.lastIndexOf(".")).replace(/_/g," ")),null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null);else{var u=!1,q=mxUtils.bind(this,function(d,c){if(null!=d&&"application/pdf"==c){var e=Editor.extractGraphModelFromPdf(d);null!=e&&0<e.length&&(d=e)}if(null!=d)if(e=mxUtils.parseXml(d),"mxlibrary"==e.documentElement.nodeName)try{var k=JSON.parse(mxUtils.getTextContent(e.documentElement));
+f(k,m);b=b.concat(k);D(a);this.spinner.stop();u=!0}catch(N){}else if("mxfile"==e.documentElement.nodeName)try{for(var n=e.documentElement.getElementsByTagName("diagram"),k=0;k<n.length;k++){var l=this.stringToCells(Editor.getDiagramNodeXml(n[k])),p=this.editor.graph.getBoundingBoxFromGeometry(l);E(l,new mxRectangle(0,0,p.width,p.height),a)}u=!0}catch(N){null!=window.console&&console.log("error in drop handler:",N)}u||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));
+null!=g&&null!=g.parentNode&&0<b.length&&(g.parentNode.removeChild(g),g=null)});null!=v&&null!=p&&(/(\.v(dx|sdx?))($|\?)/i.test(p)||/(\.vs(x|sx?))($|\?)/i.test(p))?this.importVisio(v,function(a){q(a,"text/xml")},null,p):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,p)&&null!=v?this.parseFile(v,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?q(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?
+"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):q(d,c)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(m,"dragleave",function(a){m.style.cursor="";m.style.backgroundColor="";a.stopPropagation();a.preventDefault()}));l=l.cloneNode(!1);l.setAttribute("src",Editor.editImage);l.setAttribute("title",mxResources.get("edit"));n.insertBefore(l,n.firstChild);mxEvent.addListener(l,"click",C);mxEvent.addListener(m,"dblclick",function(a){mxEvent.getSource(a)==
+m&&C(a)});e=l.cloneNode(!1);e.setAttribute("src",Editor.plusImage);e.setAttribute("title",mxResources.get("add"));n.insertBefore(e,n.firstChild);mxEvent.addListener(e,"click",H);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(e=document.createElement("span"),e.setAttribute("title",mxResources.get("help")),e.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(e,"?"),mxEvent.addGestureListeners(e,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);
mxEvent.consume(a)})),n.insertBefore(e,n.firstChild))}k.appendChild(n);k.style.paddingRight=18*n.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var d=0;d<a.length;d++){var c=a[d],e=c.data;if(null!=e){var e=this.convertDataUri(e),g="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==c.aspect&&(g+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(g+"image="+e,c.w,c.h,"",c.title||"",!1,!1,!0))}else null!=c.xml&&(e=this.stringToCells(Graph.decompress(c.xml)),
0<e.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(e,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.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64);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",Format.prototype.inactiveTabBackgroundColor=
"black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxConstants.DROP_TARGET_COLOR="#00ff00",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.showImageDialog=function(a,b,c,e,f){a=new ImageDialog(this,a,b,c,e,f);this.showDialog(a.container,Graph.fileSupport?
-480: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,f){a=new LibraryDialog(this,a,b,c,e,f);this.showDialog(a.container,640,440,!0,!1,
+480: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,e,f){a=new LibraryDialog(this,a,b,c,e,f);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 e=EditorUi.prototype.createFormat;EditorUi.prototype.createFormat=function(a){var b=e.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="#DF6C0C";b.style.fontWeight="bold";b.style.height="100%";b.style.paddingTop="9px";b.innerHTML='<span style="font-size:18px;margin-right:5px;">+</span>';mxUtils.write(b,mxResources.get("moreShapes")+"...");mxEvent.addListener(b,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(b,"click",mxUtils.bind(this,function(a){this.actions.get("shapes").funct();
-mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c,e,f,k,l){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},g=null!=a&&null!=a.error?a.error:a;if(null!=a&&null!=a.stack&&null!=a.message)try{l?null!=window.console&&console.error("EditorUi.handleError:",a):EditorUi.logError("Caught: "+(null!=a.message?a.message:"null"),null,null,null,a,"INFO")}catch(B){}if(null!=g||null!=b){l=mxUtils.htmlEntities(mxResources.get("unknownError"));
+mxEvent.consume(a)}));a.appendChild(b);return a};EditorUi.prototype.handleError=function(a,b,c,e,f,k,l){var d=null!=this.spinner&&null!=this.spinner.pause?this.spinner.pause():function(){},g=null!=a&&null!=a.error?a.error:a;if(null!=a&&null!=a.stack&&null!=a.message)try{l?null!=window.console&&console.error("EditorUi.handleError:",a):EditorUi.logError("Caught: "+(null!=a.message?a.message:"null"),null,null,null,a,"INFO")}catch(A){}if(null!=g||null!=b){l=mxUtils.htmlEntities(mxResources.get("unknownError"));
var m=mxResources.get("ok"),n=null;b=null!=b?b:mxResources.get("error");if(null!=g){null!=g.retry&&(m=mxResources.get("cancel"),n=function(){d();g.retry()});if(404==g.code||404==g.status||403==g.code){l=403==g.code?null!=g.message?mxUtils.htmlEntities(g.message):mxUtils.htmlEntities(mxResources.get("accessDenied")):null!=f?f:mxUtils.htmlEntities(mxResources.get("fileNotFoundOrDenied")+(null!=this.drive&&null!=this.drive.user?" ("+this.drive.user.displayName+", "+this.drive.user.email+")":""));var p=
null!=k?k:window.location.hash;if(null!=p&&("#G"==p.substring(0,2)||"#Uhttps%3A%2F%2Fdrive.google.com%2Fuc%3Fid%3D"==p.substring(0,45))&&(null!=a&&null!=a.error&&(null!=a.error.errors&&0<a.error.errors.length&&"fileAccess"==a.error.errors[0].reason||null!=a.error.data&&0<a.error.data.length&&"fileAccess"==a.error.data[0].reason)||404==g.code||404==g.status)){p="#U"==p.substring(0,2)?p.substring(45,p.lastIndexOf("%26ex")):p.substring(2);this.showError(b,l,mxResources.get("openInNewWindow"),mxUtils.bind(this,
function(){this.editor.graph.openLink("https://drive.google.com/open?id="+p);this.handleError(a,b,c,e,f)}),n,mxResources.get("changeUser"),mxUtils.bind(this,function(){function a(){e.innerHTML="";for(var a=0;a<b.length;a++){var d=document.createElement("option");mxUtils.write(d,b[a].displayName);d.value=a;e.appendChild(d);d=document.createElement("option");d.innerHTML="&nbsp;&nbsp;&nbsp;";mxUtils.write(d,"<"+b[a].email+">");d.setAttribute("disabled","disabled");e.appendChild(d)}d=document.createElement("option");
@@ -9193,55 +9193,55 @@ b,c,f);this.saveData(e,d,a.substring(a.lastIndexOf(",")+1),"image/"+c,!0)};Edito
g=65==(m?parseInt(m[2],10):!1)?!1:g;if(g||this.isOffline()){d.href=URL.createObjectURL(e?this.base64ToBlob(a,c):new Blob([a],{type:c}));g?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(v){}}else this.createEchoRequest(a,b,c,e,f).simulate(document,"_blank")}};EditorUi.prototype.createEchoRequest=function(a,b,c,e,f,k){a="xml="+encodeURIComponent(a);return new mxXmlRequest(SAVE_URL,
a+(null!=c?"&mime="+c:"")+(null!=f?"&format="+f:"")+(null!=k?"&base64="+k:"")+(null!=b?"&filename="+encodeURIComponent(b):"")+(e?"&binary=1":""))};EditorUi.prototype.base64ToBlob=function(a,b){b=b||"";for(var d=atob(a),c=d.length,e=Math.ceil(c/1024),g=Array(e),f=0;f<e;++f){for(var k=1024*f,l=Math.min(k+1024,c),z=Array(l-k),y=0;k<l;++y,++k)z[y]=d[k].charCodeAt(0);g[f]=new Uint8Array(z)}return new Blob(g,{type:b})};EditorUi.prototype.saveLocalFile=function(a,b,c,e,f,k,l){k=null!=k?k:!1;l=null!=l?l:
"vsdx"!=f&&(!mxClient.IS_IOS||!navigator.standalone);f=this.getServiceCount(k);isLocalStorage&&f++;var d=4>=f?2:6<f?4:3;b=new CreateDialog(this,b,mxUtils.bind(this,function(b,d){try{if("_blank"==d)if(null!=c&&"image/"==c.substring(0,6))this.openInNewWindow(a,c,e);else{var g=window.open("about:blank");null==g?mxUtils.popup(a,!0):(g.document.write("<pre>"+mxUtils.htmlEntities(a,!1)+"</pre>"),g.document.close())}else d==App.MODE_DEVICE||"download"==d?this.doSaveLocalFile(a,b,c,e):null!=b&&0<b.length&&
-this.pickFolder(d,mxUtils.bind(this,function(g){try{this.exportFile(a,b,c,e,d,g)}catch(x){this.handleError(x)}}))}catch(A){this.handleError(A)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,k,l,null,1<f,d,a,c,e);k=this.isServices(f)?f>d?390:270:160;this.showDialog(b.container,400,k,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){var d=window.open("about:blank");null==d||null==d.document?mxUtils.popup(a,!0):("image/svg+xml"!=
+this.pickFolder(d,mxUtils.bind(this,function(g){try{this.exportFile(a,b,c,e,d,g)}catch(x){this.handleError(x)}}))}catch(B){this.handleError(B)}}),mxUtils.bind(this,function(){this.hideDialog()}),mxResources.get("saveAs"),mxResources.get("download"),!1,k,l,null,1<f,d,a,c,e);k=this.isServices(f)?f>d?390:270:160;this.showDialog(b.container,400,k,!0,!0);b.init()};EditorUi.prototype.openInNewWindow=function(a,b,c){var d=window.open("about:blank");null==d||null==d.document?mxUtils.popup(a,!0):("image/svg+xml"!=
b||mxClient.IS_SVG?"image/svg+xml"==b?d.document.write("<html>"+a+"</html>"):(a=c?a:btoa(unescape(encodeURIComponent(a))),d.document.write('<html><img style="max-width:100%;" src="data:'+b+";base64,"+a+'"/></html>')):d.document.write("<html><pre>"+mxUtils.htmlEntities(a,!1)+"</pre></html>"),d.document.close())};var c=EditorUi.prototype.addChromelessToolbarItems;EditorUi.prototype.addChromelessToolbarItems=function(a){if(this.isExportToCanvas()){this.exportDialog=null;var b=a(mxUtils.bind(this,function(a){var d=
mxUtils.bind(this,function(){mxEvent.removeListener(this.editor.graph.container,"click",d);null!=this.exportDialog&&(this.exportDialog.parentNode.removeChild(this.exportDialog),this.exportDialog=null)});if(null!=this.exportDialog)d.apply(this);else{this.exportDialog=document.createElement("div");var c=b.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 e=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});e.spin(this.exportDialog);this.editor.exportToCanvas(mxUtils.bind(this,function(a){e.stop();this.exportDialog.style.width="auto";this.exportDialog.style.height="auto";this.exportDialog.style.padding="10px";var b=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",b);this.exportDialog.appendChild(a);mxEvent.addListener(a,"click",mxUtils.bind(this,function(){this.openInNewWindow(b.substring(b.indexOf(",")+1),"image/png",!0);d.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",d);document.body.appendChild(this.exportDialog)}mxEvent.consume(a)}),
Editor.cameraLargeImage,mxResources.get("export"))}c.apply(this,arguments)};EditorUi.prototype.saveData=function(a,b,c,e,f){this.isLocalFileSave()?this.saveLocalFile(c,a,e,f,b):this.saveRequest(a,b,mxUtils.bind(this,function(a,d){return this.createEchoRequest(c,a,e,f,b,d)}),c,f,e)};EditorUi.prototype.saveRequest=function(a,b,c,e,f,k,l){l=null!=l?l:!mxClient.IS_IOS||!navigator.standalone;var d=this.getServiceCount(!1);isLocalStorage&&d++;var g=4>=d?2:6<d?4:3;a=new CreateDialog(this,a,mxUtils.bind(this,
-function(a,d){if("_blank"==d||null!=a&&0<a.length){var g=c("_blank"==d?null:a,d==App.MODE_DEVICE||"download"==d||null==d||"_blank"==d?"0":"1");null!=g&&(d==App.MODE_DEVICE||"download"==d||"_blank"==d?g.simulate(document,"_blank"):this.pickFolder(d,mxUtils.bind(this,function(c){k=null!=k?k:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,k,!0,d,c)}catch(B){this.handleError(B)}else this.spinner.spin(document.body,mxResources.get("saving"))&&g.send(mxUtils.bind(this,function(){this.spinner.stop();
-if(200<=g.getStatus()&&299>=g.getStatus())try{this.exportFile(g.getText(),a,k,!0,d,c)}catch(B){this.handleError(B)}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<d,g,e,k,f);d=this.isServices(d)?4<d?390:270:160;this.showDialog(a.container,380,d,!0,!0);a.init()};EditorUi.prototype.isServices=function(a){return 1!=
-a};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,e,f,k){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,e,f,k,l,q,v,z){if(this.spinner.spin(document.body,mxResources.get("export")))try{var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;var g=b?null:this.editor.graph.background;g==mxConstants.NONE&&(g=null);null==g&&0==b&&(g="#ffffff");var m=this.editor.graph.getSvg(g,
-a,l,q,null,c,null,null,"blank"==z?"_blank":"self"==z?"_top":null,null,!0);e&&this.editor.graph.addSvgShadow(m);var n=this.getBaseFilename()+".svg",p=mxUtils.bind(this,function(a){this.spinner.stop();f&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,v,null,null,null,!1));var b='<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?
+function(a,d){if("_blank"==d||null!=a&&0<a.length){var g=c("_blank"==d?null:a,d==App.MODE_DEVICE||"download"==d||null==d||"_blank"==d?"0":"1");null!=g&&(d==App.MODE_DEVICE||"download"==d||"_blank"==d?g.simulate(document,"_blank"):this.pickFolder(d,mxUtils.bind(this,function(c){k=null!=k?k:"pdf"==b?"application/pdf":"image/"+b;if(null!=e)try{this.exportFile(e,a,k,!0,d,c)}catch(A){this.handleError(A)}else this.spinner.spin(document.body,mxResources.get("saving"))&&g.send(mxUtils.bind(this,function(){this.spinner.stop();
+if(200<=g.getStatus()&&299>=g.getStatus())try{this.exportFile(g.getText(),a,k,!0,d,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<d,g,e,k,f);d=this.isServices(d)?4<d?390:270:160;this.showDialog(a.container,380,d,!0,!0);a.init()};EditorUi.prototype.isServices=function(a){return 1!=
+a};EditorUi.prototype.getEditBlankXml=function(){return this.getFileData(!0)};EditorUi.prototype.exportFile=function(a,b,c,e,f,k){};EditorUi.prototype.pickFolder=function(a,b,c){b(null)};EditorUi.prototype.exportSvg=function(a,b,c,e,f,k,l,t,v,z){if(this.spinner.spin(document.body,mxResources.get("export")))try{var d=this.editor.graph.isSelectionEmpty();c=null!=c?c:d;var g=b?null:this.editor.graph.background;g==mxConstants.NONE&&(g=null);null==g&&0==b&&(g="#ffffff");var m=this.editor.graph.getSvg(g,
+a,l,t,null,c,null,null,"blank"==z?"_blank":"self"==z?"_top":null,null,!0);e&&this.editor.graph.addSvgShadow(m);var n=this.getBaseFilename()+".svg",p=mxUtils.bind(this,function(a){this.spinner.stop();f&&a.setAttribute("content",this.getFileData(!0,null,null,null,c,v,null,null,null,!1));var b='<?xml version="1.0" encoding="UTF-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+mxUtils.getXml(a);this.isLocalFileSave()||b.length<=MAX_REQUEST_SIZE?
this.saveData(n,"svg",b,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(b)}))});this.editor.addFontCss(m);this.editor.graph.mathEnabled&&this.editor.addMathCss(m);k?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(m,p,this.thumbImageCache)):p(m)}catch(D){this.handleError(D)}};EditorUi.prototype.addRadiobox=function(a,b,c,e,f,k,l){return this.addCheckbox(a,c,e,f,k,l,!0,
-b)};EditorUi.prototype.addCheckbox=function(a,b,c,e,f,k,l,q){k=null!=k?k:!0;var d=document.createElement("input");d.style.marginRight="8px";d.style.marginTop="16px";d.setAttribute("type",l?"radio":"checkbox");l="geCheckbox-"+Editor.guid();d.id=l;null!=q&&d.setAttribute("name",q);c&&(d.setAttribute("checked","checked"),d.defaultChecked=!0);e&&d.setAttribute("disabled","disabled");k&&(a.appendChild(d),c=document.createElement("label"),mxUtils.write(c,b),c.setAttribute("for",l),a.appendChild(c),f||mxUtils.br(a));
+b)};EditorUi.prototype.addCheckbox=function(a,b,c,e,f,k,l,t){k=null!=k?k:!0;var d=document.createElement("input");d.style.marginRight="8px";d.style.marginTop="16px";d.setAttribute("type",l?"radio":"checkbox");l="geCheckbox-"+Editor.guid();d.id=l;null!=t&&d.setAttribute("name",t);c&&(d.setAttribute("checked","checked"),d.defaultChecked=!0);e&&d.setAttribute("disabled","disabled");k&&(a.appendChild(d),c=document.createElement("label"),mxUtils.write(c,b),c.setAttribute("for",l),a.appendChild(c),f||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(),e="";null!=c&&c.getMode()!=App.MODE_DEVICE&&c.getMode()!=App.MODE_BROWSER&&(e=window.location.href);var g=document.createElement("select");g.style.width="120px";g.style.marginLeft="8px";g.style.marginRight="10px";g.className="geBtn";c=document.createElement("option");c.setAttribute("value","blank");mxUtils.write(c,mxResources.get("makeCopy"));
g.appendChild(c);c=document.createElement("option");c.setAttribute("value","custom");mxUtils.write(c,mxResources.get("custom")+"...");g.appendChild(c);a.appendChild(g);mxEvent.addListener(g,"change",mxUtils.bind(this,function(){if("custom"==g.value){var a=new FilenameDialog(this,e,mxResources.get("ok"),function(a){null!=a?e=a:g.value="blank"},mxResources.get("url"),null,null,null,null,function(){g.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)?g.removeAttribute("disabled"):g.setAttribute("disabled","disabled")}));mxUtils.br(a);return{getLink:function(){return d.checked?"blank"===g.value?"_blank":e:null},getEditInput:function(){return d},getEditSelect:function(){return g}}};EditorUi.prototype.addLinkSection=function(a,b){function d(){f.innerHTML='<div style="width:100%;height:100%;box-sizing:border-box;'+(null!=g&&g!=mxConstants.NONE?"border:1px solid black;background-color:"+
g:"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 g="#0000ff",f=null,f=mxUtils.button("",
mxUtils.bind(this,function(a){this.pickColor(g||"none",function(a){g=a;d()});mxEvent.consume(a)}));d();f.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";f.style.marginLeft="4px";f.style.height="22px";f.style.width="22px";f.style.position="relative";f.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";f.className="geColorBtn";a.appendChild(f);mxUtils.br(a);return{getColor:function(){return g},getTarget:function(){return c.value},focus:function(){c.focus()}}};EditorUi.prototype.createLink=
-function(a,b,c,e,f,k,l,q){var d=this.getCurrentFile(),g=[];e&&(g.push("lightbox=1"),"auto"!=a&&g.push("target="+a),null!=b&&b!=mxConstants.NONE&&g.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=f&&0<f.length&&g.push("edit="+encodeURIComponent(f)),k&&g.push("layers=1"),this.editor.graph.foldingEnabled&&g.push("nav=1"));c&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&g.push("page-id="+this.currentPage.getId());a=!0;null!=l?c="#U"+encodeURIComponent(l):(d=
-this.getCurrentFile(),q||null==d||d.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+d.getHash(),a=!1));a&&null!=d&&null!=d.getTitle()&&d.getTitle()!=this.defaultFilename&&g.push("title="+encodeURIComponent(d.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+
-"/"+(0<g.length?"?"+g.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,e,f,k,l,q,v,z,y){this.getBasenames();var d={};""!=f&&f!=mxConstants.NONE&&(d.highlight=f);"auto"!==e&&(d.target=e);v||(d.lightbox=!1);d.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(d.zoom=c/100);c=[];l&&(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);q&&c.push("layers");0<c.length&&
+function(a,b,c,e,f,k,l,t){var d=this.getCurrentFile(),g=[];e&&(g.push("lightbox=1"),"auto"!=a&&g.push("target="+a),null!=b&&b!=mxConstants.NONE&&g.push("highlight="+("#"==b.charAt(0)?b.substring(1):b)),null!=f&&0<f.length&&g.push("edit="+encodeURIComponent(f)),k&&g.push("layers=1"),this.editor.graph.foldingEnabled&&g.push("nav=1"));c&&null!=this.currentPage&&null!=this.pages&&this.currentPage!=this.pages[0]&&g.push("page-id="+this.currentPage.getId());a=!0;null!=l?c="#U"+encodeURIComponent(l):(d=
+this.getCurrentFile(),t||null==d||d.constructor!=window.DriveFile?c="#R"+encodeURIComponent(c?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(c="#"+d.getHash(),a=!1));a&&null!=d&&null!=d.getTitle()&&d.getTitle()!=this.defaultFilename&&g.push("title="+encodeURIComponent(d.getTitle()));return(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+
+"/"+(0<g.length?"?"+g.join("&"):"")+c};EditorUi.prototype.createHtml=function(a,b,c,e,f,k,l,t,v,z,y){this.getBasenames();var d={};""!=f&&f!=mxConstants.NONE&&(d.highlight=f);"auto"!==e&&(d.target=e);v||(d.lightbox=!1);d.nav=this.editor.graph.foldingEnabled;c=parseInt(c);isNaN(c)||100==c||(d.zoom=c/100);c=[];l&&(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);t&&c.push("layers");0<c.length&&
(v&&c.push("lightbox"),d.toolbar=c.join(" "));null!=z&&0<z.length&&(d.edit=z);null!=a?d.url=a:d.xml=this.getFileData(!0,null,null,null,null,!l);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):"";y(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 g=document.createElement("h3");mxUtils.write(g,mxResources.get("html"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(g);var f=document.createElement("div");f.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");g=k.cloneNode(!0);g.setAttribute("value","copy");f.appendChild(g);var m=document.createElement("span");mxUtils.write(m,mxResources.get("includeCopyOfMyDiagram"));f.appendChild(m);mxUtils.br(f);f.appendChild(k);m=document.createElement("span");mxUtils.write(m,mxResources.get("publicDiagramUrl"));
f.appendChild(m);var l=this.getCurrentFile();null==c&&null!=l&&l.constructor==window.DriveFile&&(m=document.createElement("a"),m.style.paddingLeft="12px",m.style.color="gray",m.setAttribute("href","javascript:void(0);"),mxUtils.write(m,mxResources.get("share")),f.appendChild(m),mxEvent.addListener(m,"click",mxUtils.bind(this,function(){this.hideDialog();this.drive.showPermissions(l.getId())})));g.setAttribute("checked","checked");null==c&&k.setAttribute("disabled","disabled");d.appendChild(f);var n=
-this.addLinkSection(d),A=this.addCheckbox(d,mxResources.get("zoom"),!0,null,!0);mxUtils.write(d,":");var x=document.createElement("input");x.setAttribute("type","text");x.style.marginRight="16px";x.style.width="60px";x.style.marginLeft="4px";x.style.marginRight="12px";x.value="100%";d.appendChild(x);var B=this.addCheckbox(d,mxResources.get("fit"),!0),f=null!=this.pages&&1<this.pages.length,C=C=this.addCheckbox(d,mxResources.get("allPages"),f,!f),D=this.addCheckbox(d,mxResources.get("layers"),!0),
-F=this.addCheckbox(d,mxResources.get("lightbox"),!0),G=this.addEditButton(d,F),E=G.getEditInput();E.style.marginBottom="16px";mxEvent.addListener(F,"change",function(){F.checked?E.removeAttribute("disabled"):E.setAttribute("disabled","disabled");E.checked&&F.checked?G.getEditSelect().removeAttribute("disabled"):G.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,d,mxUtils.bind(this,function(){e(k.checked?c:null,A.checked,x.value,n.getTarget(),n.getColor(),B.checked,C.checked,
-D.checked,F.checked,G.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);g.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,e,f,k){var d=document.createElement("div");d.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,a||mxResources.get("link"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(g);var m=this.getCurrentFile(),g="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=
+this.addLinkSection(d),B=this.addCheckbox(d,mxResources.get("zoom"),!0,null,!0);mxUtils.write(d,":");var x=document.createElement("input");x.setAttribute("type","text");x.style.marginRight="16px";x.style.width="60px";x.style.marginLeft="4px";x.style.marginRight="12px";x.value="100%";d.appendChild(x);var A=this.addCheckbox(d,mxResources.get("fit"),!0),f=null!=this.pages&&1<this.pages.length,C=C=this.addCheckbox(d,mxResources.get("allPages"),f,!f),D=this.addCheckbox(d,mxResources.get("layers"),!0),
+E=this.addCheckbox(d,mxResources.get("lightbox"),!0),H=this.addEditButton(d,E),F=H.getEditInput();F.style.marginBottom="16px";mxEvent.addListener(E,"change",function(){E.checked?F.removeAttribute("disabled"):F.setAttribute("disabled","disabled");F.checked&&E.checked?H.getEditSelect().removeAttribute("disabled"):H.getEditSelect().setAttribute("disabled","disabled")});a=new CustomDialog(this,d,mxUtils.bind(this,function(){e(k.checked?c:null,B.checked,x.value,n.getTarget(),n.getColor(),A.checked,C.checked,
+D.checked,E.checked,H.getLink())}),null,a,b);this.showDialog(a.container,340,384,!0,!0);g.focus()};EditorUi.prototype.showPublishLinkDialog=function(a,b,c,e,f,k){var d=document.createElement("div");d.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,a||mxResources.get("link"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";d.appendChild(g);var m=this.getCurrentFile(),g="https://desk.draw.io/support/solutions/articles/16000051941";a=0;if(null!=
m&&m.constructor==window.DriveFile&&!b){a=80;var g="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 n=document.createElement("div");n.style.whiteSpace="normal";mxUtils.write(n,mxResources.get("linkAccountRequired"));l.appendChild(n);n=mxUtils.button(mxResources.get("share"),mxUtils.bind(this,function(){this.drive.showPermissions(m.getId())}));
n.style.marginTop="12px";n.className="geBtn";l.appendChild(n);d.appendChild(l);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"));l.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 p=null,x=null;if(null!=c||null!=e)a+=30,mxUtils.write(d,mxResources.get("width")+":"),p=document.createElement("input"),p.setAttribute("type","text"),p.style.marginRight="16px",p.style.width="50px",p.style.marginLeft="6px",p.style.marginRight="16px",p.style.marginBottom="10px",p.value="100%",d.appendChild(p),mxUtils.write(d,mxResources.get("height")+
-":"),x=document.createElement("input"),x.setAttribute("type","text"),x.style.width="50px",x.style.marginLeft="6px",x.style.marginBottom="10px",x.value=e+"px",d.appendChild(x),mxUtils.br(d);var u=this.addLinkSection(d,k);c=null!=this.pages&&1<this.pages.length;var C=null;if(null==m||m.constructor!=window.DriveFile||b)C=this.addCheckbox(d,mxResources.get("allPages"),c,!c);var D=this.addCheckbox(d,mxResources.get("lightbox"),!0),F=this.addEditButton(d,D),G=F.getEditInput(),E=this.addCheckbox(d,mxResources.get("layers"),
-!0);E.style.marginLeft=G.style.marginLeft;E.style.marginBottom="16px";E.style.marginTop="8px";mxEvent.addListener(D,"change",function(){D.checked?(E.removeAttribute("disabled"),G.removeAttribute("disabled")):(E.setAttribute("disabled","disabled"),G.setAttribute("disabled","disabled"));G.checked&&D.checked?F.getEditSelect().removeAttribute("disabled"):F.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){f(u.getTarget(),u.getColor(),null==C?
-!0:C.checked,D.checked,F.getLink(),E.checked,null!=p?p.value:null,null!=x?x.value:null)}),null,mxResources.get("create"),g);this.showDialog(b.container,340,254+a,!0,!0);null!=p?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)):u.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,e,f){var d=document.createElement("div");d.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,
+":"),x=document.createElement("input"),x.setAttribute("type","text"),x.style.width="50px",x.style.marginLeft="6px",x.style.marginBottom="10px",x.value=e+"px",d.appendChild(x),mxUtils.br(d);var u=this.addLinkSection(d,k);c=null!=this.pages&&1<this.pages.length;var C=null;if(null==m||m.constructor!=window.DriveFile||b)C=this.addCheckbox(d,mxResources.get("allPages"),c,!c);var D=this.addCheckbox(d,mxResources.get("lightbox"),!0),E=this.addEditButton(d,D),H=E.getEditInput(),F=this.addCheckbox(d,mxResources.get("layers"),
+!0);F.style.marginLeft=H.style.marginLeft;F.style.marginBottom="16px";F.style.marginTop="8px";mxEvent.addListener(D,"change",function(){D.checked?(F.removeAttribute("disabled"),H.removeAttribute("disabled")):(F.setAttribute("disabled","disabled"),H.setAttribute("disabled","disabled"));H.checked&&D.checked?E.getEditSelect().removeAttribute("disabled"):E.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){f(u.getTarget(),u.getColor(),null==C?
+!0:C.checked,D.checked,E.getLink(),F.checked,null!=p?p.value:null,null!=x?x.value:null)}),null,mxResources.get("create"),g);this.showDialog(b.container,340,254+a,!0,!0);null!=p?(p.focus(),mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?p.select():document.execCommand("selectAll",!1,null)):u.focus()};EditorUi.prototype.showRemoteExportDialog=function(a,b,c,e,f){var d=document.createElement("div");d.style.whiteSpace="nowrap";var g=document.createElement("h3");mxUtils.write(g,
mxResources.get("image"));g.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:"+(f?"10":"4")+"px";d.appendChild(g);if(f){mxUtils.write(d,mxResources.get("zoom")+":");var k=document.createElement("input");k.setAttribute("type","text");k.style.marginRight="16px";k.style.width="60px";k.style.marginLeft="4px";k.style.marginRight="12px";k.value=this.lastExportZoom||"100%";d.appendChild(k);mxUtils.write(d,mxResources.get("borderWidth")+":");var m=document.createElement("input");m.setAttribute("type",
"text");m.style.marginRight="16px";m.style.width="60px";m.style.marginLeft="4px";m.value=this.lastExportBorder||"0";d.appendChild(m);mxUtils.br(d)}var l=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,this.editor.graph.isSelectionEmpty()),n=e?null:this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),!0),g=this.editor.graph,p=e?null:this.addCheckbox(d,mxResources.get("transparentBackground"),g.background==mxConstants.NONE||null==g.background);null!=p&&(p.style.marginBottom="16px");a=
-new CustomDialog(this,d,mxUtils.bind(this,function(){var a=parseInt(k.value)/100||1,b=parseInt(m.value)||0;c(!l.checked,null!=n?n.checked:!1,null!=p?p.checked:!1,a,b)}),null,a,b);this.showDialog(a.container,300,(f?25:0)+(e?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,e,f,k,l,q){l=null!=l?l:!0;var d=document.createElement("div");d.style.whiteSpace="nowrap";var g=this.editor.graph,m="jpeg"==q?196:300,n=document.createElement("h3");mxUtils.write(n,a);n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";
+new CustomDialog(this,d,mxUtils.bind(this,function(){var a=parseInt(k.value)/100||1,b=parseInt(m.value)||0;c(!l.checked,null!=n?n.checked:!1,null!=p?p.checked:!1,a,b)}),null,a,b);this.showDialog(a.container,300,(f?25:0)+(e?125:210),!0,!0)};EditorUi.prototype.showExportDialog=function(a,b,c,e,f,k,l,t){l=null!=l?l:!0;var d=document.createElement("div");d.style.whiteSpace="nowrap";var g=this.editor.graph,m="jpeg"==t?196:300,n=document.createElement("h3");mxUtils.write(n,a);n.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:10px";
d.appendChild(n);mxUtils.write(d,mxResources.get("zoom")+":");var x=document.createElement("input");x.setAttribute("type","text");x.style.marginRight="16px";x.style.width="60px";x.style.marginLeft="4px";x.style.marginRight="12px";x.value=this.lastExportZoom||"100%";d.appendChild(x);mxUtils.write(d,mxResources.get("borderWidth")+":");var p=document.createElement("input");p.setAttribute("type","text");p.style.marginRight="16px";p.style.width="60px";p.style.marginLeft="4px";p.value=this.lastExportBorder||
-"0";d.appendChild(p);mxUtils.br(d);var u=this.addCheckbox(d,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=q),t=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),F=document.createElement("input");F.style.marginTop="16px";F.style.marginRight="8px";F.style.marginLeft="24px";F.setAttribute("disabled","disabled");F.setAttribute("type","checkbox");k&&(d.appendChild(F),mxUtils.write(d,mxResources.get("crop")),mxUtils.br(d),m+=26,mxEvent.addListener(t,"change",function(){t.checked?
-F.removeAttribute("disabled"):F.setAttribute("disabled","disabled")}));g.isSelectionEmpty()||(F.setAttribute("checked","checked"),F.defaultChecked=!0);var G=this.addCheckbox(d,mxResources.get("shadow"),g.shadowVisible),E=document.createElement("input");E.style.marginTop="16px";E.style.marginRight="8px";E.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||E.setAttribute("disabled","disabled");b&&(d.appendChild(E),mxUtils.write(d,mxResources.get("embedImages")),mxUtils.br(d),m+=
-26);var J=null;if("png"==q||"jpeg"==q)J=this.addCheckbox(d,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),m+=26;var K=this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),l,null,null,"jpeg"!=q),H=null!=this.pages&&1<this.pages.length,L=this.addCheckbox(d,H?mxResources.get("allPages"):"",H,!H,null,"jpeg"!=q);L.style.marginLeft="24px";L.style.marginBottom="16px";H?m+=26:L.style.display="none";mxEvent.addListener(K,"change",function(){K.checked&&H?L.removeAttribute("disabled"):
-L.setAttribute("disabled","disabled")});l&&H||L.setAttribute("disabled","disabled");var M=document.createElement("select");M.style.maxWidth="260px";M.style.marginLeft="8px";M.style.marginRight="10px";M.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));M.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));M.appendChild(a);a=document.createElement("option");
-a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));M.appendChild(a);"svg"==q&&(mxUtils.write(d,mxResources.get("links")+":"),d.appendChild(M),mxUtils.br(d),mxUtils.br(d),m+=26);c=new CustomDialog(this,d,mxUtils.bind(this,function(){this.lastExportBorder=p.value;this.lastExportZoom=x.value;f(x.value,u.checked,!t.checked,G.checked,K.checked,E.checked,p.value,F.checked,!L.checked,M.value,null!=J?J.checked:null)}),null,c,e);this.showDialog(c.container,340,m,!0,!0,null,
+"0";d.appendChild(p);mxUtils.br(d);var u=this.addCheckbox(d,mxResources.get("transparentBackground"),!1,null,null,"jpeg"!=t),q=this.addCheckbox(d,mxResources.get("selectionOnly"),!1,g.isSelectionEmpty()),E=document.createElement("input");E.style.marginTop="16px";E.style.marginRight="8px";E.style.marginLeft="24px";E.setAttribute("disabled","disabled");E.setAttribute("type","checkbox");k&&(d.appendChild(E),mxUtils.write(d,mxResources.get("crop")),mxUtils.br(d),m+=26,mxEvent.addListener(q,"change",function(){q.checked?
+E.removeAttribute("disabled"):E.setAttribute("disabled","disabled")}));g.isSelectionEmpty()||(E.setAttribute("checked","checked"),E.defaultChecked=!0);var H=this.addCheckbox(d,mxResources.get("shadow"),g.shadowVisible),F=document.createElement("input");F.style.marginTop="16px";F.style.marginRight="8px";F.setAttribute("type","checkbox");!this.isOffline()&&this.canvasSupported||F.setAttribute("disabled","disabled");b&&(d.appendChild(F),mxUtils.write(d,mxResources.get("embedImages")),mxUtils.br(d),m+=
+26);var J=null;if("png"==t||"jpeg"==t)J=this.addCheckbox(d,mxResources.get("grid"),!1,this.isOffline()||!this.canvasSupported,!1,!0),m+=26;var K=this.addCheckbox(d,mxResources.get("includeCopyOfMyDiagram"),l,null,null,"jpeg"!=t),G=null!=this.pages&&1<this.pages.length,L=this.addCheckbox(d,G?mxResources.get("allPages"):"",G,!G,null,"jpeg"!=t);L.style.marginLeft="24px";L.style.marginBottom="16px";G?m+=26:L.style.display="none";mxEvent.addListener(K,"change",function(){K.checked&&G?L.removeAttribute("disabled"):
+L.setAttribute("disabled","disabled")});l&&G||L.setAttribute("disabled","disabled");var M=document.createElement("select");M.style.maxWidth="260px";M.style.marginLeft="8px";M.style.marginRight="10px";M.className="geBtn";a=document.createElement("option");a.setAttribute("value","auto");mxUtils.write(a,mxResources.get("automatic"));M.appendChild(a);a=document.createElement("option");a.setAttribute("value","blank");mxUtils.write(a,mxResources.get("openInNewWindow"));M.appendChild(a);a=document.createElement("option");
+a.setAttribute("value","self");mxUtils.write(a,mxResources.get("openInThisWindow"));M.appendChild(a);"svg"==t&&(mxUtils.write(d,mxResources.get("links")+":"),d.appendChild(M),mxUtils.br(d),mxUtils.br(d),m+=26);c=new CustomDialog(this,d,mxUtils.bind(this,function(){this.lastExportBorder=p.value;this.lastExportZoom=x.value;f(x.value,u.checked,!q.checked,H.checked,K.checked,F.checked,p.value,E.checked,!L.checked,M.value,null!=J?J.checked:null)}),null,c,e);this.showDialog(c.container,340,m,!0,!0,null,
null,null,null,!0);x.focus();mxClient.IS_GC||mxClient.IS_FF||5<=document.documentMode||mxClient.IS_QUIRKS?x.select():document.execCommand("selectAll",!1,null)};EditorUi.prototype.showEmbedImageDialog=function(a,b,c,e,f){var d=document.createElement("div");d.style.whiteSpace="nowrap";var g=this.editor.graph;if(null!=b){var k=document.createElement("h3");mxUtils.write(k,b);k.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:4px";d.appendChild(k)}var m=this.addCheckbox(d,mxResources.get("fit"),
-!0),l=this.addCheckbox(d,mxResources.get("shadow"),g.shadowVisible&&e,!e),n=this.addCheckbox(d,c),p=this.addCheckbox(d,mxResources.get("lightbox"),!0),x=this.addEditButton(d,p),B=x.getEditInput(),C=1<g.model.getChildCount(g.model.getRoot()),D=this.addCheckbox(d,mxResources.get("layers"),C,!C);D.style.marginLeft=B.style.marginLeft;D.style.marginBottom="12px";D.style.marginTop="8px";mxEvent.addListener(p,"change",function(){p.checked?(C&&D.removeAttribute("disabled"),B.removeAttribute("disabled")):
-(D.setAttribute("disabled","disabled"),B.setAttribute("disabled","disabled"));B.checked&&p.checked?x.getEditSelect().removeAttribute("disabled"):x.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){a(m.checked,l.checked,n.checked,p.checked,x.getLink(),D.checked)}),null,mxResources.get("embed"),f);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,e,f,k,l,q){function d(b){var d=" ",m="";e&&(d=" 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('"+
+!0),l=this.addCheckbox(d,mxResources.get("shadow"),g.shadowVisible&&e,!e),n=this.addCheckbox(d,c),p=this.addCheckbox(d,mxResources.get("lightbox"),!0),x=this.addEditButton(d,p),A=x.getEditInput(),C=1<g.model.getChildCount(g.model.getRoot()),D=this.addCheckbox(d,mxResources.get("layers"),C,!C);D.style.marginLeft=A.style.marginLeft;D.style.marginBottom="12px";D.style.marginTop="8px";mxEvent.addListener(p,"change",function(){p.checked?(C&&D.removeAttribute("disabled"),A.removeAttribute("disabled")):
+(D.setAttribute("disabled","disabled"),A.setAttribute("disabled","disabled"));A.checked&&p.checked?x.getEditSelect().removeAttribute("disabled"):x.getEditSelect().setAttribute("disabled","disabled")});b=new CustomDialog(this,d,mxUtils.bind(this,function(){a(m.checked,l.checked,n.checked,p.checked,x.getLink(),D.checked)}),null,mxResources.get("embed"),f);this.showDialog(b.container,280,280,!0,!0)};EditorUi.prototype.createEmbedImage=function(a,b,c,e,f,k,l,t){function d(b){var d=" ",m="";e&&(d=" 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"+(f?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",m+="cursor:pointer;");a&&(m+="max-width:100%;");var n="";c&&(n=' width="'+Math.round(g.width)+'" height="'+Math.round(g.height)+'"');l('<img src="'+b+'"'+n+(""!=m?' style="'+m+'"':"")+d+"/>")}var g=this.editor.graph.getGraphBounds();if(this.isExportToCanvas())this.editor.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),g.width*g.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var m="";c&&(m="&w="+Math.round(2*g.width)+"&h="+Math.round(2*g.height));var n=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+m+"&xml="+encodeURIComponent(b));n.send(mxUtils.bind(this,function(){200<=n.getStatus()&&299>=n.getStatus()?d("data:image/png;base64,"+n.getText()):q({message:mxResources.get("unknownError")})}))}else q({message:mxResources.get("drawingTooLarge")})};
+null,null,mxUtils.bind(this,function(a){t({message:mxResources.get("unknownError")})}),null,!0,c?2:1,null,b);else if(b=this.getFileData(!0),g.width*g.height<=MAX_AREA&&b.length<=MAX_REQUEST_SIZE){var m="";c&&(m="&w="+Math.round(2*g.width)+"&h="+Math.round(2*g.height));var n=new mxXmlRequest(EXPORT_URL,"format=png&base64=1&embedXml="+(e?"1":"0")+m+"&xml="+encodeURIComponent(b));n.send(mxUtils.bind(this,function(){200<=n.getStatus()&&299>=n.getStatus()?d("data:image/png;base64,"+n.getText()):t({message:mxResources.get("unknownError")})}))}else t({message:mxResources.get("drawingTooLarge")})};
EditorUi.prototype.createEmbedSvg=function(a,b,c,e,f,k,l){var d=this.editor.graph.getSvg(null,null,null,null,null,null,null,null,null,null,!c),g=d.getElementsByTagName("a");if(null!=g)for(var m=0;m<g.length;m++){var n=g[m].getAttribute("href");null!=n&&"#"==n.charAt(0)&&"_blank"==g[m].getAttribute("target")&&g[m].removeAttribute("target")}e&&d.setAttribute("content",this.getFileData(!0));b&&this.editor.graph.addSvgShadow(d);if(c){var p=" ",x="";e&&(p="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"+(f?"&edit=_blank":"")+(k?"&layers=1":"")+"');}})(this);\"",x+="cursor:pointer;");a&&(x+="max-width:100%;");this.editor.convertImages(d,mxUtils.bind(this,function(a){l('<img src="'+Editor.createSvgDataUri(mxUtils.getXml(a))+'"'+(""!=x?' style="'+x+'"':"")+p+"/>")}))}else x="",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"+(f?"&edit=_blank":"")+(k?"&layers=1":"")+"');}}})(this);"),x+="cursor:pointer;"),a&&(a=parseInt(d.getAttribute("width")),b=parseInt(d.getAttribute("height")),d.setAttribute("viewBox","-0.5 -0.5 "+a+" "+b),x+="max-width:100%;max-height:"+b+"px;",d.removeAttribute("height")),""!=x&&d.setAttribute("style",x),this.editor.addFontCss(d),this.editor.graph.mathEnabled&&this.editor.addMathCss(d),l(mxUtils.getXml(d))};EditorUi.prototype.timeSince=function(a){a=Math.floor((new Date-
@@ -9249,30 +9249,30 @@ a)/1E3);var b=Math.floor(a/31536E3);if(1<b)return b+" "+mxResources.get("years")
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&&(a=Editor.parseDiagramNode(d))}c=this.editor.graph;try{this.editor.graph=b,this.editor.setGraphXml(a)}catch(u){}finally{this.editor.graph=c}return a};EditorUi.prototype.getPngFileProperties=function(a){var b=1,d=0;if(null!=a){if(a.hasAttribute("scale")){var c=
parseFloat(a.getAttribute("scale"));!isNaN(c)&&0<c&&(b=c)}a.hasAttribute("border")&&(c=parseInt(a.getAttribute("border")),!isNaN(c)&&0<c&&(d=c))}return{scale:b,border:d}};EditorUi.prototype.getEmbeddedPng=function(a,b,c,e,f){try{var d=this.editor.graph,g=null!=d.themes&&"darkTheme"==d.defaultThemeName,k=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),k=c;else if(g||null!=this.pages&&this.currentPage!=this.pages[0]){var d=this.createTemporaryGraph(d.getStylesheet()),m=d.getGlobalVariable,l=this.pages[0];d.getGlobalVariable=function(a){return"page"==a?l.getName():"pagenumber"==a?1:m.apply(this,arguments)};document.body.appendChild(d.container);d.model.setRoot(l.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(c){try{null==k&&(k=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var e=c.toDataURL("image/png"),e=Editor.writeGraphModelToPng(e,
-"tEXt","mxfile",encodeURIComponent(k));a(e.substring(e.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(x){null!=b&&b(x)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,e,null,d.shadowVisible,null,d,f)}catch(y){null!=b&&b(y)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,e,f,k,l,q){q=null!=q?q:!0;l=b.background;l==mxConstants.NONE&&(l=null);k=b.getSvg(l,null,null,null,null,k);b.shadowVisible&&b.addSvgShadow(k);null!=a&&
-k.setAttribute("content",a);null!=c&&k.setAttribute("resource",c);if(null!=f)this.embedFonts(k,mxUtils.bind(this,function(a){q?this.editor.convertImages(a,mxUtils.bind(this,function(a){f((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))})):f((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')+
+"tEXt","mxfile",encodeURIComponent(k));a(e.substring(e.lastIndexOf(",")+1));d!=this.editor.graph&&d.container.parentNode.removeChild(d.container)}catch(x){null!=b&&b(x)}}),null,null,null,mxUtils.bind(this,function(a){null!=b&&b(a)}),null,null,e,null,d.shadowVisible,null,d,f)}catch(y){null!=b&&b(y)}};EditorUi.prototype.getEmbeddedSvg=function(a,b,c,e,f,k,l,t){t=null!=t?t:!0;l=b.background;l==mxConstants.NONE&&(l=null);k=b.getSvg(l,null,null,null,null,k);b.shadowVisible&&b.addSvgShadow(k);null!=a&&
+k.setAttribute("content",a);null!=c&&k.setAttribute("resource",c);if(null!=f)this.embedFonts(k,mxUtils.bind(this,function(a){t?this.editor.convertImages(a,mxUtils.bind(this,function(a){f((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))})):f((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.embedFonts=function(a,b){this.editor.loadFonts(mxUtils.bind(this,function(){try{null!=this.editor.resolvedFontCss&&this.editor.addFontCss(a,this.editor.resolvedFontCss),this.editor.embedExtFonts(mxUtils.bind(this,function(d){try{null!=d&&this.editor.addFontCss(a,d),b(a)}catch(n){b(a)}}))}catch(m){b(a)}}))};
-EditorUi.prototype.exportImage=function(a,b,c,e,f,k,l,q,v,z,y){v=null!=v?v:"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.editor.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,f?this.getFileData(!0,null,null,null,c,q):null,v,null==this.pages||0==this.pages.length,y)}catch(B){"Invalid image"==B.message?this.downloadFile(v):
-this.handleError(B)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,e,null,null,k,l,z)}catch(x){this.spinner.stop(),this.handleError(x)}}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.importXml=function(a,b,c,e,f){b=null!=b?b:0;c=null!=c?c:0;var d=[];try{var g=this.editor.graph;if(null!=a&&0<a.length){g.model.beginUpdate();try{var k=mxUtils.parseXml(a);a={};var m=
+EditorUi.prototype.exportImage=function(a,b,c,e,f,k,l,t,v,z,y){v=null!=v?v:"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.editor.exportToCanvas(mxUtils.bind(this,function(a){this.spinner.stop();try{this.saveCanvas(a,f?this.getFileData(!0,null,null,null,c,t):null,v,null==this.pages||0==this.pages.length,y)}catch(A){"Invalid image"==A.message?this.downloadFile(v):
+this.handleError(A)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a)}),null,c,a||1,b,e,null,null,k,l,z)}catch(x){this.spinner.stop(),this.handleError(x)}}};EditorUi.prototype.isCorsEnabledForUrl=function(a){return this.editor.isCorsEnabledForUrl(a)};EditorUi.prototype.importXml=function(a,b,c,e,f){b=null!=b?b:0;c=null!=c?c:0;var d=[];try{var g=this.editor.graph;if(null!=a&&0<a.length){g.model.beginUpdate();try{var k=mxUtils.parseXml(a);a={};var m=
this.editor.extractGraphModel(k.documentElement,null!=this.pages);if(null!=m&&"mxfile"==m.nodeName&&null!=this.pages){var l=m.getElementsByTagName("diagram");if(1==l.length)m=Editor.parseDiagramNode(l[0]),null!=this.currentPage&&(a[l[0].getAttribute("id")]=this.currentPage.getId());else if(1<l.length){var k=[],n=0;null!=this.pages&&1==this.pages.length&&this.isDiagramEmpty()&&(a[l[0].getAttribute("id")]=this.pages[0].getId(),m=Editor.parseDiagramNode(l[0]),e=!1,n=1);for(;n<l.length;n++){var p=l[n].getAttribute("id");
-l[n].removeAttribute("id");var x=this.updatePageRoot(new DiagramPage(l[n]));a[p]=l[n].getAttribute("id");var B=this.pages.length;null==x.getName()&&x.setName(mxResources.get("pageWithNumber",[B+1]));g.model.execute(new ChangePage(this,x,x,B,!0));k.push(x)}this.updatePageLinks(a,k)}}if(null!=m&&"mxGraphModel"===m.nodeName&&(d=g.importGraphModel(m,b,c,e),null!=d))for(n=0;n<d.length;n++)this.updatePageLinksForCell(a,d[n])}finally{g.model.endUpdate()}}}catch(C){if(f)throw C;this.handleError(C)}return d};
+l[n].removeAttribute("id");var x=this.updatePageRoot(new DiagramPage(l[n]));a[p]=l[n].getAttribute("id");var A=this.pages.length;null==x.getName()&&x.setName(mxResources.get("pageWithNumber",[A+1]));g.model.execute(new ChangePage(this,x,x,A,!0));k.push(x)}this.updatePageLinks(a,k)}}if(null!=m&&"mxGraphModel"===m.nodeName&&(d=g.importGraphModel(m,b,c,e),null!=d))for(n=0;n<d.length;n++)this.updatePageLinksForCell(a,d[n])}finally{g.model.endUpdate()}}}catch(C){if(f)throw C;this.handleError(C)}return d};
EditorUi.prototype.updatePageLinks=function(a,b){for(var d=0;d<b.length;d++)this.updatePageLinksForCell(a,b[d].root)};EditorUi.prototype.updatePageLinksForCell=function(a,b){var d=document.createElement("div"),c=this.editor.graph,e=c.getLinkForCell(b);null!=e&&c.setLinkForCell(b,this.updatePageLink(a,e));if(c.isHtmlLabel(b)){d.innerHTML=c.getLabel(b);for(var g=d.getElementsByTagName("a"),f=!1,k=0;k<g.length;k++)e=g[k].getAttribute("href"),null!=e&&(g[k].setAttribute("href",this.updatePageLink(a,e)),
f=!0);f&&c.labelChanged(b,d.innerHTML)}for(k=0;k<c.model.getChildCount(b);k++)this.updatePageLinksForCell(a,c.model.getChildAt(b,k))};EditorUi.prototype.updatePageLink=function(a,b){if("data:page/id,"==b.substring(0,13)){var d=a[b.substring(b.indexOf(",")+1)];b=null!=d?"data:page/id,"+d:null}else if("data:action/json,"==b.substring(0,17))try{var c=JSON.parse(b.substring(17));if(null!=c.actions){for(var e=0;e<c.actions.length;e++){var g=c.actions[e];null!=g.open&&"data:page/id,"==g.open.substring(0,
-13)&&(d=a[g.open.substring(g.open.indexOf(",")+1)],null!=d?g.open="data:page/id,"+d:delete g.open)}b="data:action/json,"+JSON.stringify(c)}}catch(t){}return b};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};EditorUi.prototype.importVisio=function(a,b,c,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){var d=this.isRemoteVisioFormat(e);
+13)&&(d=a[g.open.substring(g.open.indexOf(",")+1)],null!=d?g.open="data:page/id,"+d:delete g.open)}b="data:action/json,"+JSON.stringify(c)}}catch(q){}return b};EditorUi.prototype.isRemoteVisioFormat=function(a){return/(\.v(sd|dx))($|\?)/i.test(a)||/(\.vs(s|x))($|\?)/i.test(a)};EditorUi.prototype.importVisio=function(a,b,c,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){var d=this.isRemoteVisioFormat(e);
try{var g="UNKNOWN-VISIO",f=e.lastIndexOf(".");if(0<=f&&f<e.length)g=e.substring(f+1).toUpperCase();else{var k=e.lastIndexOf("/");0<=k&&k<e.length&&(e=e.substring(k+1))}EditorUi.logEvent({category:g+"-MS-IMPORT-FILE",action:"filename_"+e,label:d?"remote":"local"})}catch(y){}if(d)if(null==VSD_CONVERT_URL||this.isOffline())c({message:"conf"==this.getServiceName()?mxResources.get("vsdNoConfig"):mxResources.get("serviceUnavailableOrBlocked")});else{d=new FormData;d.append("file1",a,e);var m=new XMLHttpRequest;
-m.open("POST",VSD_CONVERT_URL);m.responseType="blob";this.addRemoteServiceSecurityCheck(m);m.onreadystatechange=mxUtils.bind(this,function(){if(4==m.readyState)if(200<=m.status&&299>=m.status)try{var a=m.response;if("text/xml"==a.type){var d=new FileReader;d.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(B){c({message:mxResources.get("errorLoadingFile")})}});d.readAsText(a)}else this.doImportVisio(a,b,c,e)}catch(x){c(x)}else c({})});m.send(d)}else try{this.doImportVisio(a,b,c,e)}catch(y){c(y)}}else this.spinner.stop(),
+m.open("POST",VSD_CONVERT_URL);m.responseType="blob";this.addRemoteServiceSecurityCheck(m);m.onreadystatechange=mxUtils.bind(this,function(){if(4==m.readyState)if(200<=m.status&&299>=m.status)try{var a=m.response;if("text/xml"==a.type){var d=new FileReader;d.onload=mxUtils.bind(this,function(a){try{b(a.target.result)}catch(A){c({message:mxResources.get("errorLoadingFile")})}});d.readAsText(a)}else this.doImportVisio(a,b,c,e)}catch(x){c(x)}else c({})});m.send(d)}else try{this.doImportVisio(a,b,c,e)}catch(y){c(y)}}else this.spinner.stop(),
this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?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(p){c(p)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});
this.doImportGraphML||this.loadingExtensions||this.isOffline(!0)?d():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",d))};EditorUi.prototype.exportVisio=function(){var a=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof VsdxExport)try{(new VsdxExport(this)).exportCurrentDiagrams()||this.handleError({message:mxResources.get("unknownError")})}catch(g){this.handleError(g)}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});
"undefined"!==typeof VsdxExport||this.loadingExtensions||this.isOffline(!0)?a():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",a))};EditorUi.prototype.convertLucidChart=function(a,b,c){var d=mxUtils.bind(this,function(){this.loadingExtensions=!1;if("undefined"!==typeof window.LucidImporter){try{EditorUi.logEvent({category:"LUCIDCHART-IMPORT-FILE",action:"size_"+a.length}),EditorUi.debug("convertLucidChart",a)}catch(p){}try{b(LucidImporter.importState(JSON.parse(a)))}catch(p){null!=window.console&&
console.error(p),c(p)}}else c({message:mxResources.get("serviceUnavailableOrBlocked")})});"undefined"!==typeof window.LucidImporter||this.loadingExtensions||this.isOffline(!0)?window.setTimeout(d,0):(this.loadingExtensions=!0,"1"==urlParams.dev?mxscript("js/diagramly/Extensions.js",d):mxscript("js/extensions.min.js",d))};EditorUi.prototype.generateMermaidImage=function(a,b,c,e){var d=this,g=function(){try{this.loadingMermaid=!1,b=null!=b?b:EditorUi.defaultMermaidConfig,b.securityLevel="strict",b.startOnLoad=
!1,mermaid.mermaidAPI.initialize(b),mermaid.mermaidAPI.render("geMermaidOutput-"+(new Date).getTime(),a,function(a){try{if(mxClient.IS_IE||mxClient.IS_IE11)a=a.replace(/ xmlns:\S*="http:\/\/www.w3.org\/XML\/1998\/namespace"/g,"").replace(/ (NS xml|\S*):space="preserve"/g,' xml:space="preserve"');var b=mxUtils.parseXml(a).getElementsByTagName("svg");if(0<b.length){var g=parseFloat(b[0].getAttribute("width")),f=parseFloat(b[0].getAttribute("height"));c(d.convertDataUri(Editor.createSvgDataUri(a)),g,
-f)}else e({message:mxResources.get("invalidInput")})}catch(y){e(y)}})}catch(t){e(t)}};"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?g():(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",g):mxscript("js/extensions.min.js",g))};EditorUi.prototype.generatePlantUmlImage=function(a,b,c,e){function d(a,b,d){c1=a>>2;c2=(a&3)<<4|b>>4;c3=(b&15)<<2|d>>6;c4=d&63;r="";r+=g(c1&63);r+=g(c2&63);r+=g(c3&63);return r+=g(c4&63)}function g(a){if(10>a)return String.fromCharCode(48+
+f)}else e({message:mxResources.get("invalidInput")})}catch(y){e(y)}})}catch(q){e(q)}};"undefined"!==typeof mermaid||this.loadingMermaid||this.isOffline(!0)?g():(this.loadingMermaid=!0,"1"==urlParams.dev?mxscript("js/mermaid/mermaid.min.js",g):mxscript("js/extensions.min.js",g))};EditorUi.prototype.generatePlantUmlImage=function(a,b,c,e){function d(a,b,d){c1=a>>2;c2=(a&3)<<4|b>>4;c3=(b&15)<<2|d>>6;c4=d&63;r="";r+=g(c1&63);r+=g(c2&63);r+=g(c3&63);return r+=g(c4&63)}function g(a){if(10>a)return String.fromCharCode(48+
a);a-=10;if(26>a)return String.fromCharCode(65+a);a-=26;if(26>a)return String.fromCharCode(97+a);a-=26;return 0==a?"-":1==a?"_":"?"}var f=new XMLHttpRequest;f.open("GET",("txt"==b?PLANT_URL+"/txt/":"png"==b?PLANT_URL+"/png/":PLANT_URL+"/svg/")+function(a){r="";for(i=0;i<a.length;i+=3)r=i+2==a.length?r+d(a.charCodeAt(i),a.charCodeAt(i+1),0):i+1==a.length?r+d(a.charCodeAt(i),0,0):r+d(a.charCodeAt(i),a.charCodeAt(i+1),a.charCodeAt(i+2));return r}(pako.deflateRaw(a,{to:"string"})),!0);"txt"!=b&&(f.responseType=
"blob");f.onload=function(a){if(200<=this.status&&300>this.status)if("txt"==b)c(this.response);else{var d=new FileReader;d.readAsDataURL(this.response);d.onloadend=function(a){var b=new Image;b.onload=function(){try{var a=b.width,g=b.height;if(0==a&&0==g){var f=d.result,k=f.indexOf(","),m=decodeURIComponent(escape(atob(f.substring(k+1)))),l=mxUtils.parseXml(m).getElementsByTagName("svg");0<l.length&&(a=parseFloat(l[0].getAttribute("width")),g=parseFloat(l[0].getAttribute("height")))}c(d.result,a,
-g)}catch(G){e(G)}};b.src=d.result};d.onerror=function(a){e(a)}}else e(a)};f.onerror=function(a){e(a)};f.send()};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=left;verticalAlign=top;"),d.updateCellSize(e,!0)}finally{d.getModel().endUpdate()}return e};EditorUi.prototype.insertTextAt=function(a,b,c,e,f,k,l){k=null!=k?k:!0;l=null!=l?l:!0;if(null!=a)if(Graph.fileSupport&&
+g)}catch(H){e(H)}};b.src=d.result};d.onerror=function(a){e(a)}}else e(a)};f.onerror=function(a){e(a)};f.send()};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=left;verticalAlign=top;"),d.updateCellSize(e,!0)}finally{d.getModel().endUpdate()}return e};EditorUi.prototype.insertTextAt=function(a,b,c,e,f,k,l){k=null!=k?k:!0;l=null!=l?l:!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()&&(f||/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(a))){var d=this.editor.graph;if("data:application/pdf;base64,"==a.substring(0,28)){var g=
Editor.extractGraphModelFromPdf(a);if(null!=g&&0<g.length)return this.importXml(g,b,c,k,!0)}if("data:image/png;base64,"==a.substring(0,22)&&(g=this.extractGraphModelFromPng(a),null!=g&&0<g.length))return this.importXml(g,b,c,k,!0);if("data:image/svg+xml;"==a.substring(0,19))try{g=null;"data:image/svg+xml;base64,"==a.substring(0,26)?(g=a.substring(a.indexOf(",")+1),g=window.atob&&!mxClient.IS_SF?atob(g):Base64.decode(g,!0)):g=decodeURIComponent(a.substring(a.indexOf(",")+1));var m=this.importXml(g,
-b,c,k,!0);if(0<m.length)return m}catch(A){}this.loadImage(a,mxUtils.bind(this,function(e){if("data:"==a.substring(0,5))this.resizeImage(e,a,mxUtils.bind(this,function(a,e,g){d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),e,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var g=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/e.height)),
+b,c,k,!0);if(0<m.length)return m}catch(B){}this.loadImage(a,mxUtils.bind(this,function(e){if("data:"==a.substring(0,5))this.resizeImage(e,a,mxUtils.bind(this,function(a,e,g){d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),e,g,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+this.convertDataUri(a)+";"))}),l,this.maxImageSize);else{var g=Math.min(1,Math.min(this.maxImageSize/e.width,this.maxImageSize/e.height)),
f=Math.round(e.width*g);e=Math.round(e.height*g);d.setSelectionCell(d.insertVertex(null,null,"",d.snap(b),d.snap(c),f,e,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";"))}}),mxUtils.bind(this,function(){var g=null;d.getModel().beginUpdate();try{g=d.insertVertex(d.getDefaultParent(),null,a,d.snap(b),d.snap(c),1,1,"text;"+(e?"html=1;":"")),d.updateCellSize(g),d.fireEvent(new mxEventObject("textInserted","cells",[g]))}finally{d.getModel().endUpdate()}d.setSelectionCell(g)}))}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(d){this.editor.graph.setSelectionCells(this.importXml(d,b,c,k));!this.isOffline()&&(/.*\.diagrams\.net$/.test(window.location.hostname)||/.*\.appspot\.com$/.test(window.location.hostname)||/.*\.draw\.io$/.test(window.location.hostname))&&this.showBanner("LucidChartImportSurvey",mxResources.get("notSatisfiedWithImport"),
mxUtils.bind(this,function(){var b=new FeedbackDialog(this,"Lucidchart Import Feedback",!0,a);this.showDialog(b.container,610,360,!0,!1);b.init()}))}),mxUtils.bind(this,function(a){this.handleError(a)}));else{d=this.editor.graph;f=null;d.getModel().beginUpdate();try{f=d.insertVertex(d.getDefaultParent(),null,"",d.snap(b),d.snap(c),1,1,"text;whiteSpace=wrap;"+(e?"html=1;":""));d.fireEvent(new mxEventObject("textInserted","cells",[f]));"<"==a.charAt(0)&&a.indexOf(">")==a.length-1&&(a=mxUtils.htmlEntities(a));
@@ -9282,31 +9282,31 @@ a);return Math.max(a,.1).toFixed(1)+" kB; MB; GB; TB;PB;EB;ZB;YB".split(";")[b]}
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,g=e.close;this.dialog.close=mxUtils.bind(this,function(a){Editor.useLocalStorage=c;g.apply(e,arguments);a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()})}}};EditorUi.prototype.importZipFile=function(a,b,c){var d=this,e=mxUtils.bind(this,function(){this.loadingExtensions=!1;"undefined"!==typeof JSZip?JSZip.loadAsync(a).then(function(e){if(0==Object.keys(e.files).length)c();else{var g=0,f,k=!1;e.forEach(function(a,
d){var e=d.name.toLowerCase();"diagram/diagram.xml"==e?(k=!0,d.async("string").then(function(a){0==a.indexOf("<mxfile ")?b(a):c()})):0==e.indexOf("versions/")&&(e=parseInt(e.substr(9)),e>g&&(g=e,f=d))});0<g?f.async("string").then(function(e){!d.isOffline()&&(new XMLHttpRequest).upload&&d.isRemoteFileFormat(e,a.name)?d.parseFile(new Blob([e],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?b(a.responseText):c())}),a.name):c()}):k||c()}},
-function(a){c(a)}):c()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?e():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",e))};EditorUi.prototype.importFile=function(a,b,c,e,f,k,l,q,v,z,y){z=null!=z?z:!0;var d=!1,g=null,m=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,l)):b=this.importXml(a,c,e,z);null!=q&&q(b)});"image"==b.substring(0,5)?(v=!1,"image/png"==b.substring(0,9)&&(b=y?null:
+function(a){c(a)}):c()});"undefined"!==typeof JSZip||this.loadingExtensions||this.isOffline(!0)?e():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",e))};EditorUi.prototype.importFile=function(a,b,c,e,f,k,l,t,v,z,y){z=null!=z?z:!0;var d=!1,g=null,m=mxUtils.bind(this,function(a){var b=null;null!=a&&"<mxlibrary"==a.substring(0,10)?this.loadLibrary(new LocalLibrary(this,a,l)):b=this.importXml(a,c,e,z);null!=t&&t(b)});"image"==b.substring(0,5)?(v=!1,"image/png"==b.substring(0,9)&&(b=y?null:
this.extractGraphModelFromPng(a),null!=b&&0<b.length&&(g=this.importXml(b,c,e,z),v=!0)),v||(b=this.editor.graph,y=a.indexOf(";"),0<y&&(a=a.substring(0,y)+a.substring(a.indexOf(",",y+1))),z&&b.isGridEnabled()&&(c=b.snap(c),e=b.snap(e)),g=[b.insertVertex(null,null,"",c,e,f,k,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+a+";")])):/(\.*<graphml )/.test(a)?(d=!0,this.importGraphML(a,m)):null!=v&&null!=l&&(/(\.v(dx|sdx?))($|\?)/i.test(l)||
-/(\.vs(x|sx?))($|\?)/i.test(l))?(d=!0,this.importVisio(v,m)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(d=!0,this.parseFile(null!=v?v:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?m(a.responseText):null!=q&&q(null))}),l)):0==a.indexOf("PK")&&null!=v?(d=!0,this.importZipFile(v,m,mxUtils.bind(this,function(){g=this.insertTextAt(this.validateFileData(a),c,e,!0,null,z);q(g)}))):/(\.v(sd|dx))($|\?)/i.test(l)||
-/(\.vs(s|x))($|\?)/i.test(l)||(g=this.insertTextAt(this.validateFileData(a),c,e,!0,null,z));d||null==q||q(g);return g};EditorUi.prototype.importFiles=function(a,b,c,e,f,k,l,q,v,z,y,A){e=null!=e?e:this.maxImageSize;z=null!=z?z:this.maxImageBytes;var d=null!=b&&null!=c,g=!0;b=null!=b?b:0;c=null!=c?c:0;var m=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var n=y||this.resampleThreshold,p=0;p<a.length;p++)if("image/"==a[p].type.substring(0,6)&&a[p].size>n){m=!0;break}var u=mxUtils.bind(this,function(){var m=
-this.editor.graph,n=m.gridSize;f=null!=f?f:mxUtils.bind(this,function(a,b,c,e,g,f,k,m,l){try{return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,c,e,g,f,k,m,l,d,A)}catch(aa){return this.handleError(aa),null}});k=null!=k?k:mxUtils.bind(this,function(a){m.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var x=a.length,p=x,v=[],B=mxUtils.bind(this,function(a,b){v[a]=b;if(0==
---p){this.spinner.stop();if(null!=q)q(v);else{var d=[];m.getModel().beginUpdate();try{for(var c=0;c<v.length;c++){var e=v[c]();null!=e&&(d=d.concat(e))}}finally{m.getModel().endUpdate()}}k(d)}}),u=0;u<x;u++)mxUtils.bind(this,function(d){var k=a[d];if(null!=k){var x=new FileReader;x.onload=mxUtils.bind(this,function(a){if(null==l||l(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var x=a.target.result,p=x.indexOf(","),v=decodeURIComponent(escape(atob(x.substring(p+1)))),
-u=mxUtils.parseXml(v),v=u.getElementsByTagName("svg");if(0<v.length){var v=v[0],t=A?null:v.getAttribute("content");null!=t&&"<"!=t.charAt(0)&&"%"!=t.charAt(0)&&(t=unescape(window.atob?atob(t):Base64.decode(t,!0)));null!=t&&"%"==t.charAt(0)&&(t=decodeURIComponent(t));null==t||"<mxfile "!==t.substring(0,8)&&"<mxGraphModel "!==t.substring(0,14)?B(d,mxUtils.bind(this,function(){try{if(x.substring(0,p+1),null!=u){var a=u.getElementsByTagName("svg");if(0<a.length){var g=a[0],l=g.getAttribute("width"),v=
-g.getAttribute("height"),l=null!=l&&"%"!=l.charAt(l.length-1)?parseFloat(l):NaN,v=null!=v&&"%"!=v.charAt(v.length-1)?parseFloat(v):NaN,B=g.getAttribute("viewBox");if(null==B||0==B.length)g.setAttribute("viewBox","0 0 "+l+" "+v);else if(isNaN(l)||isNaN(v)){var t=B.split(" ");3<t.length&&(l=parseFloat(t[2]),v=parseFloat(t[3]))}x=Editor.createSvgDataUri(mxUtils.getXml(g));var q=Math.min(1,Math.min(e/Math.max(1,l)),e/Math.max(1,v)),C=f(x,k.type,b+d*n,c+d*n,Math.max(1,Math.round(l*q)),Math.max(1,Math.round(v*
-q)),k.name);if(isNaN(l)||isNaN(v)){var D=new Image;D.onload=mxUtils.bind(this,function(){l=Math.max(1,D.width);v=Math.max(1,D.height);C[0].geometry.width=l;C[0].geometry.height=v;g.setAttribute("viewBox","0 0 "+l+" "+v);x=Editor.createSvgDataUri(mxUtils.getXml(g));var a=x.indexOf(";");0<a&&(x=x.substring(0,a)+x.substring(x.indexOf(",",a+1)));m.setCellStyles("image",x,[C[0]])});D.src=Editor.createSvgDataUri(mxUtils.getXml(g))}return C}}}catch(fa){}return null})):B(d,mxUtils.bind(this,function(){return f(t,
-"text/xml",b+d*n,c+d*n,0,0,k.name)}))}else B(d,mxUtils.bind(this,function(){return null}))}else{v=!1;if("image/png"==k.type){var q=A?null:this.extractGraphModelFromPng(a.target.result);if(null!=q&&0<q.length){var C=new Image;C.src=a.target.result;B(d,mxUtils.bind(this,function(){return f(q,"text/xml",b+d*n,c+d*n,C.width,C.height,k.name)}));v=!0}}v||(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(m){this.resizeImage(m,a.target.result,mxUtils.bind(this,function(m,l,x){B(d,mxUtils.bind(this,function(){if(null!=m&&m.length<z){var p=g&&this.isResampleImage(a.target.result,y)?Math.min(1,Math.min(e/l,e/x)):1;return f(m,k.type,b+d*n,c+d*n,Math.round(l*p),Math.round(x*p),k.name)}this.handleError({message:mxResources.get("imageTooBig")});
-return null}))}),g,e,y)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else x=a.target.result,f(x,k.type,b+d*n,c+d*n,240,160,k.name,function(a){B(d,function(){return a})},k)});/(\.v(dx|sdx?))($|\?)/i.test(k.name)||/(\.vs(x|sx?))($|\?)/i.test(k.name)?f(null,k.type,b+d*n,c+d*n,240,160,k.name,function(a){B(d,function(){return a})},k):"image"==k.type.substring(0,5)||"application/pdf"==k.type?x.readAsDataURL(k):x.readAsText(k)}})(u)});if(m){m=[];
+/(\.vs(x|sx?))($|\?)/i.test(l))?(d=!0,this.importVisio(v,m)):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(a,l)?(d=!0,this.parseFile(null!=v?v:new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){4==a.readyState&&(200<=a.status&&299>=a.status?m(a.responseText):null!=t&&t(null))}),l)):0==a.indexOf("PK")&&null!=v?(d=!0,this.importZipFile(v,m,mxUtils.bind(this,function(){g=this.insertTextAt(this.validateFileData(a),c,e,!0,null,z);t(g)}))):/(\.v(sd|dx))($|\?)/i.test(l)||
+/(\.vs(s|x))($|\?)/i.test(l)||(g=this.insertTextAt(this.validateFileData(a),c,e,!0,null,z));d||null==t||t(g);return g};EditorUi.prototype.importFiles=function(a,b,c,e,f,k,l,t,v,z,y,B){e=null!=e?e:this.maxImageSize;z=null!=z?z:this.maxImageBytes;var d=null!=b&&null!=c,g=!0;b=null!=b?b:0;c=null!=c?c:0;var m=!1;if(!mxClient.IS_CHROMEAPP&&null!=a)for(var n=y||this.resampleThreshold,p=0;p<a.length;p++)if("image/"==a[p].type.substring(0,6)&&a[p].size>n){m=!0;break}var u=mxUtils.bind(this,function(){var m=
+this.editor.graph,n=m.gridSize;f=null!=f?f:mxUtils.bind(this,function(a,b,c,e,g,f,k,m,l){try{return null!=a&&"<mxlibrary"==a.substring(0,10)?(this.spinner.stop(),this.loadLibrary(new LocalLibrary(this,a,k)),null):this.importFile(a,b,c,e,g,f,k,m,l,d,B)}catch(Y){return this.handleError(Y),null}});k=null!=k?k:mxUtils.bind(this,function(a){m.setSelectionCells(a)});if(this.spinner.spin(document.body,mxResources.get("loading")))for(var x=a.length,p=x,v=[],u=mxUtils.bind(this,function(a,b){v[a]=b;if(0==
+--p){this.spinner.stop();if(null!=t)t(v);else{var d=[];m.getModel().beginUpdate();try{for(var c=0;c<v.length;c++){var e=v[c]();null!=e&&(d=d.concat(e))}}finally{m.getModel().endUpdate()}}k(d)}}),A=0;A<x;A++)mxUtils.bind(this,function(d){var k=a[d];if(null!=k){var x=new FileReader;x.onload=mxUtils.bind(this,function(a){if(null==l||l(k))if("image/"==k.type.substring(0,6))if("image/svg"==k.type.substring(0,9)){var x=a.target.result,p=x.indexOf(","),v=decodeURIComponent(escape(atob(x.substring(p+1)))),
+A=mxUtils.parseXml(v),v=A.getElementsByTagName("svg");if(0<v.length){var v=v[0],q=B?null:v.getAttribute("content");null!=q&&"<"!=q.charAt(0)&&"%"!=q.charAt(0)&&(q=unescape(window.atob?atob(q):Base64.decode(q,!0)));null!=q&&"%"==q.charAt(0)&&(q=decodeURIComponent(q));null==q||"<mxfile "!==q.substring(0,8)&&"<mxGraphModel "!==q.substring(0,14)?u(d,mxUtils.bind(this,function(){try{if(x.substring(0,p+1),null!=A){var a=A.getElementsByTagName("svg");if(0<a.length){var g=a[0],l=g.getAttribute("width"),v=
+g.getAttribute("height"),l=null!=l&&"%"!=l.charAt(l.length-1)?parseFloat(l):NaN,v=null!=v&&"%"!=v.charAt(v.length-1)?parseFloat(v):NaN,u=g.getAttribute("viewBox");if(null==u||0==u.length)g.setAttribute("viewBox","0 0 "+l+" "+v);else if(isNaN(l)||isNaN(v)){var q=u.split(" ");3<q.length&&(l=parseFloat(q[2]),v=parseFloat(q[3]))}x=Editor.createSvgDataUri(mxUtils.getXml(g));var t=Math.min(1,Math.min(e/Math.max(1,l)),e/Math.max(1,v)),C=f(x,k.type,b+d*n,c+d*n,Math.max(1,Math.round(l*t)),Math.max(1,Math.round(v*
+t)),k.name);if(isNaN(l)||isNaN(v)){var D=new Image;D.onload=mxUtils.bind(this,function(){l=Math.max(1,D.width);v=Math.max(1,D.height);C[0].geometry.width=l;C[0].geometry.height=v;g.setAttribute("viewBox","0 0 "+l+" "+v);x=Editor.createSvgDataUri(mxUtils.getXml(g));var a=x.indexOf(";");0<a&&(x=x.substring(0,a)+x.substring(x.indexOf(",",a+1)));m.setCellStyles("image",x,[C[0]])});D.src=Editor.createSvgDataUri(mxUtils.getXml(g))}return C}}}catch(ea){}return null})):u(d,mxUtils.bind(this,function(){return f(q,
+"text/xml",b+d*n,c+d*n,0,0,k.name)}))}else u(d,mxUtils.bind(this,function(){return null}))}else{v=!1;if("image/png"==k.type){var t=B?null:this.extractGraphModelFromPng(a.target.result);if(null!=t&&0<t.length){var C=new Image;C.src=a.target.result;u(d,mxUtils.bind(this,function(){return f(t,"text/xml",b+d*n,c+d*n,C.width,C.height,k.name)}));v=!0}}v||(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(m){this.resizeImage(m,a.target.result,mxUtils.bind(this,function(m,l,x){u(d,mxUtils.bind(this,function(){if(null!=m&&m.length<z){var p=g&&this.isResampleImage(a.target.result,y)?Math.min(1,Math.min(e/l,e/x)):1;return f(m,k.type,b+d*n,c+d*n,Math.round(l*p),Math.round(x*p),k.name)}this.handleError({message:mxResources.get("imageTooBig")});
+return null}))}),g,e,y)}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("invalidOrMissingFile")})})))}else x=a.target.result,f(x,k.type,b+d*n,c+d*n,240,160,k.name,function(a){u(d,function(){return a})},k)});/(\.v(dx|sdx?))($|\?)/i.test(k.name)||/(\.vs(x|sx?))($|\?)/i.test(k.name)?f(null,k.type,b+d*n,c+d*n,240,160,k.name,function(a){u(d,function(){return a})},k):"image"==k.type.substring(0,5)||"application/pdf"==k.type?x.readAsDataURL(k):x.readAsText(k)}})(A)});if(m){m=[];
for(p=0;p<a.length;p++)m.push(a[p]);a=m;this.confirmImageResize(function(a){g=a;u()},v)}else u()};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);try{EditorUi.logEvent({category:"GLIFFY-IMPORT-FILE",action:"size_"+a.size})}catch(u){}};EditorUi.prototype.isResampleImage=function(a,b){b=null!=b?b:this.resampleThreshold;return a.length>b};EditorUi.prototype.resizeImage=function(a,b,c,e,f,k){f=null!=f?f:this.maxImageSize;var d=Math.max(1,a.width),g=Math.max(1,a.height);if(e&&this.isResampleImage(b,k))try{var m=Math.max(d/f,g/f);if(1<m){var l=Math.round(d/m),n=Math.round(g/m),p=document.createElement("canvas");
-p.width=l;p.height=n;p.getContext("2d").drawImage(a,0,0,l,n);var x=p.toDataURL();if(x.length<b.length){var B=document.createElement("canvas");B.width=l;B.height=n;var u=B.toDataURL();x!==u&&(b=x,d=l,g=n)}}}catch(D){}c(b,d,g)};EditorUi.prototype.extractGraphModelFromPng=function(a){return Editor.extractGraphModelFromPng(a)};EditorUi.prototype.loadImage=function(a,b,c){try{var d=new Image;d.onload=function(){d.width=0<d.width?d.width:120;d.height=0<d.height?d.height:120;b(d)};null!=c&&(d.onerror=c);
+p.width=l;p.height=n;p.getContext("2d").drawImage(a,0,0,l,n);var x=p.toDataURL();if(x.length<b.length){var u=document.createElement("canvas");u.width=l;u.height=n;var C=u.toDataURL();x!==C&&(b=x,d=l,g=n)}}}catch(D){}c(b,d,g)};EditorUi.prototype.extractGraphModelFromPng=function(a){return Editor.extractGraphModelFromPng(a)};EditorUi.prototype.loadImage=function(a,b,c){try{var d=new Image;d.onload=function(){d.width=0<d.width?d.width:120;d.height=0<d.height?d.height:120;b(d)};null!=c&&(d.onerror=c);
d.src=a}catch(p){if(null!=c)c(p);else throw p;}};var b=EditorUi.prototype.init;EditorUi.prototype.init=function(){mxStencilRegistry.allowEval=mxStencilRegistry.allowEval&&!this.isOfflineApp();"undefined"!==typeof window.mxSettings&&(this.formatWidth=mxSettings.getFormatWidth());var a=this,c=this.editor.graph;c.cellEditor.editPlantUmlData=function(b,d,e){var g=JSON.parse(e);d=new TextareaDialog(a,mxResources.get("plantUml")+":",g.data,function(d){null!=d&&a.spinner.spin(document.body,mxResources.get("inserting"))&&
a.generatePlantUmlImage(d,g.format,function(e,f,k){a.spinner.stop();c.getModel().beginUpdate();try{if("txt"==g.format)c.labelChanged(b,"<pre>"+e+"</pre>"),c.updateCellSize(b,!0);else{c.setCellStyles("image",a.convertDataUri(e),[b]);var m=c.model.getGeometry(b);null!=m&&(m=m.clone(),m.width=f,m.height=k,c.cellsResized([b],[m],!1))}c.setAttributeForCell(b,"plantUmlData",JSON.stringify({data:d,format:g.format}))}finally{c.getModel().endUpdate()}},function(b){a.handleError(b)})},null,null,400,220);a.showDialog(d.container,
420,300,!0,!0);d.init()};c.cellEditor.editMermaidData=function(b,d,e){var g=JSON.parse(e);d=new TextareaDialog(a,mxResources.get("mermaid")+":",g.data,function(d){null!=d&&a.spinner.spin(document.body,mxResources.get("inserting"))&&a.generateMermaidImage(d,g.config,function(e,f,k){a.spinner.stop();c.getModel().beginUpdate();try{c.setCellStyles("image",e,[b]);var m=c.model.getGeometry(b);null!=m&&(m=m.clone(),m.width=Math.max(m.width,f),m.height=Math.max(m.height,k),c.cellsResized([b],[m],!1));c.setAttributeForCell(b,
"mermaidData",JSON.stringify({data:d,config:g.config},null,2))}finally{c.getModel().endUpdate()}},function(b){a.handleError(b)})},null,null,400,220);a.showDialog(d.container,420,300,!0,!0);d.init()};var e=c.cellEditor.startEditing;c.cellEditor.startEditing=function(b,d){try{var c=this.graph.getAttributeForCell(b,"plantUmlData");null!=c?this.editPlantUmlData(b,d,c):(c=this.graph.getAttributeForCell(b,"mermaidData"),null!=c?this.editMermaidData(b,d,c):e.apply(this,arguments))}catch(D){a.handleError(D)}};
c.getLinkTitle=function(b){return a.getLinkTitle(b)};c.customLinkClicked=function(b){var d=!1;try{a.handleCustomLink(b),d=!0}catch(C){a.handleError(C)}return d};var f=this.clearDefaultStyle;this.clearDefaultStyle=function(){f.apply(this,arguments)};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://desk.draw.io/support/solutions/articles/16000051979");var k=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 k.apply(this,arguments)};var l=c.addClickHandler;c.addClickHandler=function(a,b,d){var e=b;b=function(a,b){if(null==b){var d=mxEvent.getSource(a);"a"==d.nodeName.toLowerCase()&&(b=d.getAttribute("href"))}null!=b&&c.isCustomLink(b)&&(mxEvent.isTouchEvent(a)||!mxEvent.isPopupTrigger(a))&&c.customLinkClicked(b)&&
-mxEvent.consume(a);null!=e&&e(a,b)};l.call(this,a,b,d)};b.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.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?450:370,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var t=c.getExportVariables;c.getExportVariables=function(){var b=t.apply(this,arguments),d=a.getCurrentFile();null!=d&&(b.filename=d.getTitle());
-b.pagecount=null!=a.pages?a.pages.length:1;b.page=null!=a.currentPage?a.currentPage.getName():"";b.pagenumber=null!=a.pages&&null!=a.currentPage?mxUtils.indexOf(a.pages,a.currentPage)+1:1;return b};var q=c.getGlobalVariable;c.getGlobalVariable=function(b){var d=a.getCurrentFile();return"filename"==b&&null!=d?d.getTitle():"page"==b&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==b?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:"pagecount"==b?null!=a.pages?
-a.pages.length:1:q.apply(this,arguments)};var v=c.labelLinkClicked;c.labelLinkClicked=function(a,b,d){var e=b.getAttribute("href");if(null==e||!c.isCustomLink(e)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))v.apply(this,arguments);else{if(!c.isEnabled()||null!=a&&c.isCellLocked(a.cell))c.customLinkClicked(e),c.getRubberband().reset();mxEvent.consume(d)}};this.editor.getOrCreateFilename=function(){var b=a.defaultFilename,d=a.getCurrentFile();null!=d&&(b=null!=d.getTitle()?d.getTitle():b);return b};
+mxEvent.consume(a);null!=e&&e(a,b)};l.call(this,a,b,d)};b.apply(this,arguments);mxClient.IS_SVG&&this.editor.graph.addSvgShadow(c.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?450:370,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var q=c.getExportVariables;c.getExportVariables=function(){var b=q.apply(this,arguments),d=a.getCurrentFile();null!=d&&(b.filename=d.getTitle());
+b.pagecount=null!=a.pages?a.pages.length:1;b.page=null!=a.currentPage?a.currentPage.getName():"";b.pagenumber=null!=a.pages&&null!=a.currentPage?mxUtils.indexOf(a.pages,a.currentPage)+1:1;return b};var t=c.getGlobalVariable;c.getGlobalVariable=function(b){var d=a.getCurrentFile();return"filename"==b&&null!=d?d.getTitle():"page"==b&&null!=a.currentPage?a.currentPage.getName():"pagenumber"==b?null!=a.currentPage&&null!=a.pages?mxUtils.indexOf(a.pages,a.currentPage)+1:1:"pagecount"==b?null!=a.pages?
+a.pages.length:1:t.apply(this,arguments)};var v=c.labelLinkClicked;c.labelLinkClicked=function(a,b,d){var e=b.getAttribute("href");if(null==e||!c.isCustomLink(e)||!mxEvent.isTouchEvent(d)&&mxEvent.isPopupTrigger(d))v.apply(this,arguments);else{if(!c.isEnabled()||null!=a&&c.isCellLocked(a.cell))c.customLinkClicked(e),c.getRubberband().reset();mxEvent.consume(d)}};this.editor.getOrCreateFilename=function(){var b=a.defaultFilename,d=a.getCurrentFile();null!=d&&(b=null!=d.getTitle()?d.getTitle():b);return b};
var z=this.actions.get("print");z.setEnabled(!mxClient.IS_IOS||!navigator.standalone);z.visible=z.isEnabled();if(!this.editor.chromeless||this.editor.editable)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"),this.installImagePasteHandler(),this.installNativeClipboardHandler();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,
@@ -9315,18 +9315,18 @@ a));b.insertImage(decodeURIComponent(d),c*e,a*e)})):document.execCommand("insert
z.setUnit(mxSettings.getUnit()),z.addListener("unitChanged",function(a,b){mxSettings.setUnit(b.getProperty("unit"));mxSettings.save()}),this.ruler=!this.canvasSupported||9==document.documentMode||"1"!=urlParams.ruler&&!mxSettings.isRulerOn()||this.editor.isChromelessView()&&!this.editor.editable?null:new mxDualRuler(this,z.unit),this.refresh());if("1"==urlParams.styledev){z=document.getElementById("geFooter");null!=z&&(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)})),z.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 y=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==this.styleInput?!0:y.apply(this,arguments)}}z=document.getElementById("geInfo");null!=z&&z.parentNode.removeChild(z);if(Graph.fileSupport&&(!this.editor.chromeless||
-this.editor.editable)){var A=null;mxEvent.addListener(c.container,"dragleave",function(a){c.isEnabled()&&(null!=A&&(A.parentNode.removeChild(A),A=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(c.container,"dragover",mxUtils.bind(this,function(a){null==A&&(!mxClient.IS_IE||10<document.documentMode)&&(A=this.highlightElement(c.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c.container,"drop",mxUtils.bind(this,
-function(a){null!=A&&(A.parentNode.removeChild(A),A=null);if(c.isEnabled()){var b=mxUtils.convertPoint(c.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=c.view.translate,e=c.view.scale,g=b.x/e-d.x,f=b.y/e-d.y;if(0<a.dataTransfer.files.length)mxEvent.isAltDown(a)&&(f=g=null),this.importFiles(a.dataTransfer.files,g,f,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{mxEvent.isAltDown(a)&&(f=g=0);var k=0<=mxUtils.indexOf(a.dataTransfer.types,
+this.editor.editable)){var B=null;mxEvent.addListener(c.container,"dragleave",function(a){c.isEnabled()&&(null!=B&&(B.parentNode.removeChild(B),B=null),a.stopPropagation(),a.preventDefault())});mxEvent.addListener(c.container,"dragover",mxUtils.bind(this,function(a){null==B&&(!mxClient.IS_IE||10<document.documentMode)&&(B=this.highlightElement(c.container));null!=this.sidebar&&this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()}));mxEvent.addListener(c.container,"drop",mxUtils.bind(this,
+function(a){null!=B&&(B.parentNode.removeChild(B),B=null);if(c.isEnabled()){var b=mxUtils.convertPoint(c.container,mxEvent.getClientX(a),mxEvent.getClientY(a)),d=c.view.translate,e=c.view.scale,g=b.x/e-d.x,f=b.y/e-d.y;if(0<a.dataTransfer.files.length)mxEvent.isAltDown(a)&&(f=g=null),this.importFiles(a.dataTransfer.files,g,f,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxEvent.isShiftDown(a));else{mxEvent.isAltDown(a)&&(f=g=0);var k=0<=mxUtils.indexOf(a.dataTransfer.types,
"text/uri-list")?a.dataTransfer.getData("text/uri-list"):null,b=this.extractGraphModelFromEvent(a,null!=this.pages);if(null!=b)c.setSelectionCells(this.importXml(b,g,f,!0));else if(0<=mxUtils.indexOf(a.dataTransfer.types,"text/html")){var m=a.dataTransfer.getData("text/html"),b=document.createElement("div");b.innerHTML=m;var l=null,d=b.getElementsByTagName("img");null!=d&&1==d.length?(m=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(m)||(l=!0)):(d=b.getElementsByTagName("a"),null!=
-d&&1==d.length?m=d[0].getAttribute("href"):(b=b.getElementsByTagName("pre"),null!=b&&1==b.length&&(m=mxUtils.getTextContent(b[0]))));var n=!0,x=mxUtils.bind(this,function(){c.setSelectionCells(this.insertTextAt(m,g,f,!0,l,null,n))});l&&m.length>this.resampleThreshold?this.confirmImageResize(function(a){n=a;x()},mxEvent.isControlDown(a)):x()}else null!=k&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)?this.loadImage(decodeURIComponent(k),mxUtils.bind(this,function(a){var b=Math.max(1,a.width);a=Math.max(1,
+d&&1==d.length?m=d[0].getAttribute("href"):(b=b.getElementsByTagName("pre"),null!=b&&1==b.length&&(m=mxUtils.getTextContent(b[0]))));var n=!0,p=mxUtils.bind(this,function(){c.setSelectionCells(this.insertTextAt(m,g,f,!0,l,null,n))});l&&m.length>this.resampleThreshold?this.confirmImageResize(function(a){n=a;p()},mxEvent.isControlDown(a)):p()}else null!=k&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)?this.loadImage(decodeURIComponent(k),mxUtils.bind(this,function(a){var b=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,b)),d/Math.max(1,a));c.setSelectionCell(c.insertVertex(null,null,"",g,f,b*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+k+";"))}),mxUtils.bind(this,function(a){c.setSelectionCells(this.insertTextAt(k,g,f,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&c.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),g,f,!0))}}a.stopPropagation();
a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var a=this.editor.graph;a.container.addEventListener("paste",mxUtils.bind(this,function(b){if(!mxEvent.isConsumed(b))try{for(var d=b.clipboardData||b.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 g=d.items;for(index in g){var f=g[index];
if("file"===f.kind){if(a.isEditing())this.importFiles([f.getAsFile()],0,0,this.maxImageSize,function(b,d,c,e,g,f){a.insertImage(b,g,f)},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([f.getAsFile()],k.x,k.y,this.maxImageSize);mxEvent.consume(b)}break}}}}catch(v){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function a(){window.setTimeout(function(){c.innerHTML=
"&nbsp;";c.focus();document.execCommand("selectAll",!1,null)},0)}var b=this.editor.graph,c=document.createElement("div");c.setAttribute("autocomplete","off");c.setAttribute("autocorrect","off");c.setAttribute("autocapitalize","off");c.setAttribute("spellcheck","false");c.style.textRendering="optimizeSpeed";c.style.fontFamily="monospace";c.style.wordBreak="break-all";c.style.background="transparent";c.style.color="transparent";c.style.position="absolute";c.style.whiteSpace="nowrap";c.style.overflow=
"hidden";c.style.display="block";c.style.fontSize="1";c.style.zIndex="-1";c.style.resize="none";c.style.outline="none";c.style.width="1px";c.style.height="1px";mxUtils.setOpacity(c,0);c.contentEditable=!0;c.innerHTML="&nbsp;";var e=!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)||e||(c.style.left=b.container.scrollLeft+10+"px",c.style.top=b.container.scrollTop+10+"px",b.container.appendChild(c),e=!0,mxClient.IS_QUIRKS?window.setTimeout(function(){c.focus();document.execCommand("selectAll",!1,null)},0):(c.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(){!e||224!=d&&17!=d&&91!=d||(e=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),c.parentNode.removeChild(c),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(c,"copy",mxUtils.bind(this,function(d){if(b.isEnabled())try{mxClipboard.copy(b),this.copyCells(c),a()}catch(t){this.handleError(t)}}));mxEvent.addListener(c,"cut",mxUtils.bind(this,function(d){if(b.isEnabled())try{mxClipboard.copy(b),
-this.copyCells(c,!0),a()}catch(t){this.handleError(t)}}));mxEvent.addListener(c,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&((new Date).getTime(),c.innerHTML="&nbsp;",c.focus(),null!=a.clipboardData&&this.pasteCells(a,c,!0,!0),mxEvent.isConsumed(a)||window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,c,!1,!0)}),0))}),!0);var f=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==c?!0:f.apply(this,arguments)}};
+function(a){var d=a.keyCode;window.setTimeout(mxUtils.bind(this,function(){!e||224!=d&&17!=d&&91!=d||(e=!1,b.isEditing()||null!=this.dialog||null==b.container||b.container.focus(),c.parentNode.removeChild(c),null==this.dialog&&mxUtils.clearSelection())}),0)}));mxEvent.addListener(c,"copy",mxUtils.bind(this,function(d){if(b.isEnabled())try{mxClipboard.copy(b),this.copyCells(c),a()}catch(q){this.handleError(q)}}));mxEvent.addListener(c,"cut",mxUtils.bind(this,function(d){if(b.isEnabled())try{mxClipboard.copy(b),
+this.copyCells(c,!0),a()}catch(q){this.handleError(q)}}));mxEvent.addListener(c,"paste",mxUtils.bind(this,function(a){b.isEnabled()&&!b.isCellLocked(b.getDefaultParent())&&((new Date).getTime(),c.innerHTML="&nbsp;",c.focus(),null!=a.clipboardData&&this.pasteCells(a,c,!0,!0),mxEvent.isConsumed(a)||window.setTimeout(mxUtils.bind(this,function(){this.pasteCells(a,c,!1,!0)}),0))}),!0);var f=this.isSelectionAllowed;this.isSelectionAllowed=function(a){return mxEvent.getSource(a)==c?!0:f.apply(this,arguments)}};
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();if(isLocalStorage)try{window.addEventListener("storage",mxUtils.bind(this,function(a){a.key==mxSettings.key&&(mxSettings.load(),ColorDialog.recentColors=mxSettings.getRecentColors(),
this.menus.customFonts=mxSettings.getCustomFonts())}),!1)}catch(d){}this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.menus.customFonts=mxSettings.getCustomFonts();this.addListener("customFontsChanged",mxUtils.bind(this,function(a,b){var d=b.getProperty("customFonts");this.menus.customFonts=d;mxSettings.setCustomFonts(d);mxSettings.save()}));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));
@@ -9336,9 +9336,9 @@ function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor,"dark"==u
null):(d.lastPasteXml=e,d.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b,c,e){if(!mxEvent.isConsumed(a)){var d=b,f=!1;if(c&&null!=a.clipboardData&&a.clipboardData.getData){var g=a.clipboardData.getData("text/html");if(null!=g&&0<g.length){d=document.createElement("div");d.innerHTML=g;f=!0;g=d.getElementsByTagName("style");if(null!=g)for(;0<g.length;)g[0].parentNode.removeChild(g[0]);null!=d.firstChild&&d.firstChild.nodeType==mxConstants.NODETYPE_ELEMENT&&
null!=d.firstChild.nextSibling&&d.firstChild.nextSibling.nodeType==mxConstants.NODETYPE_ELEMENT&&"META"==d.firstChild.nodeName&&"A"==d.firstChild.nextSibling.nodeName&&null==d.firstChild.nextSibling.nextSibling&&(g=null==d.firstChild.nextSibling.innerText?mxUtils.getTextContent(d.firstChild.nextSibling):d.firstChild.nextSibling.innerText,g==d.firstChild.nextSibling.getAttribute("href")&&(mxUtils.setTextContent(d,g),f=!1));Graph.removePasteFormatting(d)}else g=a.clipboardData.getData("text/plain"),
null!=g&&0<g.length&&(d=document.createElement("div"),mxUtils.setTextContent(d,g))}g=d.getElementsByTagName("span");if(null!=g&&0<g.length&&"application/vnd.lucid.chart.objects"===g[0].getAttribute("data-lucid-type"))c=g[0].getAttribute("data-lucid-content"),null!=c&&0<c.length&&(this.convertLucidChart(c,mxUtils.bind(this,function(a){var b=this.editor.graph;b.lastPasteXml==a?b.pasteCounter++:(b.lastPasteXml=a,b.pasteCounter=0);var d=b.pasteCounter*b.gridSize;b.setSelectionCells(this.importXml(a,d,
-d));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,function(a){this.handleError(a)})),mxEvent.consume(a));else{var f=f?d.innerHTML:mxUtils.trim(null==d.innerText?mxUtils.getTextContent(d):d.innerText),k=!1;try{var m=f.lastIndexOf("%3E");0<=m&&m<f.length-3&&(f=f.substring(0,m+3))}catch(B){}try{var g=d.getElementsByTagName("span"),l=null!=g&&0<g.length?mxUtils.trim(decodeURIComponent(g[0].textContent)):decodeURIComponent(f);this.isCompatibleString(l)&&(k=!0,f=l)}catch(B){}try{var n=
-this.editor.graph;if(null!=f&&0<f.length){n.lastPasteXml==f?n.pasteCounter++:(n.lastPasteXml=f,n.pasteCounter=0);var A=n.pasteCounter*n.gridSize;if(k||this.isCompatibleString(f))n.setSelectionCells(this.importXml(f,A,A));else if(e&&1==n.getSelectionCount())n.labelChanged(n.getSelectionCell(),f),Graph.isLink(f)&&n.setLinkForCell(n.getSelectionCell(),f);else{var x=n.getInsertPoint();n.isMouseInsertPoint()&&(A=0,n.lastPasteXml==f&&0<n.pasteCounter&&n.pasteCounter--);n.setSelectionCells(this.insertTextAt(f,
-x.x+A,x.y+A,!0))}n.isSelectionEmpty()||(n.scrollCellToVisible(n.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(n.view.getState(n.getSelectionCell())));try{mxEvent.consume(a)}catch(B){}}else c||(n.lastPasteXml=null,n.pasteCounter=0)}catch(B){this.handleError(B)}}}b.innerHTML="&nbsp;"};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);
+d));b.scrollCellToVisible(b.getSelectionCell())}),mxUtils.bind(this,function(a){this.handleError(a)})),mxEvent.consume(a));else{var f=f?d.innerHTML:mxUtils.trim(null==d.innerText?mxUtils.getTextContent(d):d.innerText),k=!1;try{var l=f.lastIndexOf("%3E");0<=l&&l<f.length-3&&(f=f.substring(0,l+3))}catch(A){}try{var g=d.getElementsByTagName("span"),m=null!=g&&0<g.length?mxUtils.trim(decodeURIComponent(g[0].textContent)):decodeURIComponent(f);this.isCompatibleString(m)&&(k=!0,f=m)}catch(A){}try{var n=
+this.editor.graph;if(null!=f&&0<f.length){n.lastPasteXml==f?n.pasteCounter++:(n.lastPasteXml=f,n.pasteCounter=0);var B=n.pasteCounter*n.gridSize;if(k||this.isCompatibleString(f))n.setSelectionCells(this.importXml(f,B,B));else if(e&&1==n.getSelectionCount())n.labelChanged(n.getSelectionCell(),f),Graph.isLink(f)&&n.setLinkForCell(n.getSelectionCell(),f);else{var x=n.getInsertPoint();n.isMouseInsertPoint()&&(B=0,n.lastPasteXml==f&&0<n.pasteCounter&&n.pasteCounter--);n.setSelectionCells(this.insertTextAt(f,
+x.x+B,x.y+B,!0))}n.isSelectionEmpty()||(n.scrollCellToVisible(n.getSelectionCell()),null!=this.hoverIcons&&this.hoverIcons.update(n.view.getState(n.getSelectionCell())));try{mxEvent.consume(a)}catch(A){}}else c||(n.lastPasteXml=null,n.pasteCounter=0)}catch(A){this.handleError(A)}}}b.innerHTML="&nbsp;"};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,
@@ -9346,7 +9346,7 @@ function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText
var f=document.documentElement;c=(e.clientWidth||f.clientWidth)-3;e=Math.max(e.clientHeight||0,f.clientHeight)-3}else b=a.offsetTop,d=a.offsetLeft,c=a.clientWidth,e=a.clientHeight;f=document.createElement("div");f.style.zIndex=mxPopupMenu.prototype.zIndex+2;f.style.border="3px dotted rgb(254, 137, 12)";f.style.pointerEvents="none";f.style.position="absolute";f.style.top=b+"px";f.style.left=d+"px";f.style.width=Math.max(0,c-3)+"px";f.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?
this.editor.graph.container.appendChild(f):document.body.appendChild(f);return f};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)+".drawio":/(\.pdf)$/i.test(e)&&(e=e.substring(0,e.length-4)+".drawio");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".drawio":e+".drawio";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(A){this.handleError(A,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()&&
+this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(B){this.handleError(B,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)+".drawio"),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(y){this.handleError(y,mxResources.get("errorLoadingFile"))}}else if(0==c.indexOf("PK"))this.importZipFile(a,mxUtils.bind(this,function(a){this.spinner.stop();
f(a)}),mxUtils.bind(this,function(){this.spinner.stop();this.openLocalFile(c,e,b)}));else{if("image/png"==a.type.substring(0,9))c=this.extractGraphModelFromPng(c);else if("application/pdf"==a.type){var g=Editor.extractGraphModelFromPdf(c);null!=g&&(c=g)}this.spinner.stop();this.openLocalFile(c,e,b)}}}catch(y){this.handleError(y)}});d.onerror=mxUtils.bind(this,function(a){this.spinner.stop();this.handleError(a);window.openFile=null});"image"!==a.type.substring(0,5)&&"application/pdf"!==a.type||"image/svg"===
@@ -9359,44 +9359,44 @@ this.actions.layersWindow.window.setVisible(!1),null!=this.menus.tagsWindow&&thi
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,f=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,f);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(Z){}return a});if("json"==urlParams.proto){try{g=JSON.parse(g)}catch(X){g=null}try{if(null==
+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(fa){}return a});if("json"==urlParams.proto){try{g=JSON.parse(g)}catch(W){g=null}try{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();var m=new FilenameDialog(this,g.defaultValue||"",null!=g.okKey?mxResources.get(g.okKey):null,function(a){null!=a&&k.postMessage(JSON.stringify({event:"prompt",value:a,message:g}),"*")},
null!=g.titleKey?mxResources.get(g.titleKey):g.title);this.showDialog(m.container,300,80,!0,!1);m.init();return}if("draft"==g.action){var n=l(g.xml);this.spinner.stop();m=new DraftDialog(this,mxResources.get("draftFound",[g.name||this.defaultFilename]),n,mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"edit",message:g}),"*")}),mxUtils.bind(this,function(){this.hideDialog();k.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();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:g}),"*")}):null);this.showDialog(m.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{m.init()}catch(X){k.postMessage(JSON.stringify({event:"draft",error:X.toString(),message:g}),"*")}return}if("template"==g.action){this.spinner.stop();var x=
+g.editKey?mxResources.get(g.editKey):null,g.discardKey?mxResources.get(g.discardKey):null,g.ignore?mxUtils.bind(this,function(){this.hideDialog();k.postMessage(JSON.stringify({event:"draft",result:"ignore",message:g}),"*")}):null);this.showDialog(m.container,640,480,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));try{m.init()}catch(W){k.postMessage(JSON.stringify({event:"draft",error:W.toString(),message:g}),"*")}return}if("template"==g.action){this.spinner.stop();var x=
1==g.enableRecent,p=1==g.enableSearch,u=1==g.enableCustomTemp,m=new NewDialog(this,!1,null!=g.callback,mxUtils.bind(this,function(b,d){b=b||this.emptyDiagramXml;null!=g.callback?k.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,x?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,mxUtils.bind(this,function(a,b,d){k.postMessage(JSON.stringify({event:"template",docUrl:a,info:b,name:d}),"*")}),null,null,u?mxUtils.bind(this,function(a){this.remoteInvoke("getCustomTemplates",null,null,a,function(){a({},0)})}):null);this.showDialog(m.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&this.actions.get("exit").funct()}));m.init();return}if("textContent"==
-g.action){var t=this.getDiagramTextContent();k.postMessage(JSON.stringify({event:"textContent",data:t,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 q=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||g.show?this.spinner.spin(document.body,
-q):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 G=null!=g.xml?g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var E=this.editor.graph,J=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(G);
-k.postMessage(JSON.stringify(b),"*")}),K=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==g.format&&(a=Editor.writeGraphModelToPng(a,"tEXt","mxfile",encodeURIComponent(G)));E!=this.editor.graph&&E.container.parentNode.removeChild(E.container);J(a)}),H=g.pageId||(null!=this.pages?this.pages[0].getId():null);if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage.getId()!=H){for(var L=E.getGlobalVariable,E=this.createTemporaryGraph(E.getStylesheet()),M,I=0;I<this.pages.length;I++)if(this.pages[I].getId()==
-H){M=this.updatePageRoot(this.pages[I]);break}E.getGlobalVariable=function(a){return"page"==a?M.getName():"pagenumber"==a?1:L.apply(this,arguments)};document.body.appendChild(E.container);E.model.setRoot(M.root)}if(null!=g.layerIds){for(var U=E.model,T=U.getChildCells(U.getRoot()),m={},I=0;I<g.layerIds.length;I++)m[g.layerIds[I]]=!0;for(I=0;I<T.length;I++)U.setVisible(T[I],m[T[I].id]||!1)}this.editor.exportToCanvas(mxUtils.bind(this,function(a){K(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,
-function(){K(null)}),null,null,g.scale,null,null,null,E)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==g.format?"1":"0")+(null!=H?"&pageId="+H:"")+(null!=g.layerIds?"&extras="+encodeURIComponent(JSON.stringify({layerIds:g.layerIds})):"")+(null!=g.scale?"&scale="+g.scale:"")+"&base64=1&xml="+encodeURIComponent(G))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?J("data:image/png;base64,"+a.getText()):K(null)}),mxUtils.bind(this,function(){K(null)}))}}else{null!=
-g.xml&&0<g.xml.length&&this.setFileData(g.xml);q=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var ca=this.getXmlFileData();q.xml=mxUtils.getXml(ca);q.data=this.getFileData(null,null,!0,null,null,null,ca);q.format=g.format}else if("html"==g.format)G=this.editor.getGraphXml(),q.data=this.getHtml(G,this.editor.graph),q.xml=mxUtils.getXml(G),q.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;var ba=this.editor.graph.background;
-ba==mxConstants.NONE&&(ba=null);q.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);q.format="svg";var W=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();q.data=Editor.createSvgDataUri(a);k.postMessage(JSON.stringify(q),"*")});if("xmlsvg"==g.format)(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))&&this.getEmbeddedSvg(q.xml,this.editor.graph,null,!0,W,null,null,g.embedImages);else 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);var S=this.editor.graph.getSvg(ba);this.embedFonts(S,mxUtils.bind(this,function(a){g.embedImages||null==g.embedImages?this.editor.convertImages(a,mxUtils.bind(this,function(a){W(mxUtils.getXml(a))})):W(mxUtils.getXml(a))}))}return}k.postMessage(JSON.stringify(q),"*")}return}if("load"==g.action)c=1==g.autosave,this.hideDialog(),null!=g.modified&&null==urlParams.modified&&
+g.action){var q=this.getDiagramTextContent();k.postMessage(JSON.stringify({event:"textContent",data:q,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 t=null!=g.messageKey?mxResources.get(g.messageKey):g.message;null==g.show||g.show?this.spinner.spin(document.body,
+t):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 H=null!=g.xml?g.xml:this.getFileData(!0);this.editor.graph.setEnabled(!1);var F=this.editor.graph,J=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(H);
+k.postMessage(JSON.stringify(b),"*")}),K=mxUtils.bind(this,function(a){null==a&&(a=Editor.blankImage);"xmlpng"==g.format&&(a=Editor.writeGraphModelToPng(a,"tEXt","mxfile",encodeURIComponent(H)));F!=this.editor.graph&&F.container.parentNode.removeChild(F.container);J(a)}),G=g.pageId||(null!=this.pages?this.pages[0].getId():null);if(this.isExportToCanvas()){if(null!=this.pages&&this.currentPage.getId()!=G){for(var L=F.getGlobalVariable,F=this.createTemporaryGraph(F.getStylesheet()),M,I=0;I<this.pages.length;I++)if(this.pages[I].getId()==
+G){M=this.updatePageRoot(this.pages[I]);break}F.getGlobalVariable=function(a){return"page"==a?M.getName():"pagenumber"==a?1:L.apply(this,arguments)};document.body.appendChild(F.container);F.model.setRoot(M.root)}if(null!=g.layerIds){for(var T=F.model,V=T.getChildCells(T.getRoot()),m={},I=0;I<g.layerIds.length;I++)m[g.layerIds[I]]=!0;for(I=0;I<V.length;I++)T.setVisible(V[I],m[V[I].id]||!1)}this.editor.exportToCanvas(mxUtils.bind(this,function(a){K(a.toDataURL("image/png"))}),null,null,null,mxUtils.bind(this,
+function(){K(null)}),null,null,g.scale,null,null,null,F)}else(new mxXmlRequest(EXPORT_URL,"format=png&embedXml="+("xmlpng"==g.format?"1":"0")+(null!=G?"&pageId="+G:"")+(null!=g.layerIds?"&extras="+encodeURIComponent(JSON.stringify({layerIds:g.layerIds})):"")+(null!=g.scale?"&scale="+g.scale:"")+"&base64=1&xml="+encodeURIComponent(H))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()?J("data:image/png;base64,"+a.getText()):K(null)}),mxUtils.bind(this,function(){K(null)}))}}else{null!=
+g.xml&&0<g.xml.length&&this.setFileData(g.xml);t=this.createLoadMessage("export");if("html2"==g.format||"html"==g.format&&("0"!=urlParams.pages||null!=this.pages&&1<this.pages.length)){var aa=this.getXmlFileData();t.xml=mxUtils.getXml(aa);t.data=this.getFileData(null,null,!0,null,null,null,aa);t.format=g.format}else if("html"==g.format)H=this.editor.getGraphXml(),t.data=this.getHtml(H,this.editor.graph),t.xml=mxUtils.getXml(H),t.format=g.format;else{mxSvgCanvas2D.prototype.foAltText=null;var ba=this.editor.graph.background;
+ba==mxConstants.NONE&&(ba=null);t.xml=this.getFileData(!0,null,null,null,null,null,null,null,null,!1);t.format="svg";var X=mxUtils.bind(this,function(a){this.editor.graph.setEnabled(!0);this.spinner.stop();t.data=Editor.createSvgDataUri(a);k.postMessage(JSON.stringify(t),"*")});if("xmlsvg"==g.format)(null==g.spin&&null==g.spinKey||this.spinner.spin(document.body,null!=g.spinKey?mxResources.get(g.spinKey):g.spin))&&this.getEmbeddedSvg(t.xml,this.editor.graph,null,!0,X,null,null,g.embedImages);else 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);var U=this.editor.graph.getSvg(ba);this.embedFonts(U,mxUtils.bind(this,function(a){g.embedImages||null==g.embedImages?this.editor.convertImages(a,mxUtils.bind(this,function(a){X(mxUtils.getXml(a))})):X(mxUtils.getXml(a))}))}return}k.postMessage(JSON.stringify(t),"*")}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&&(n=document.createElement("span"),mxUtils.write(n,g.title),"atlas"==uiTheme?(this.buttonContainer.style.paddingRight="12px",this.buttonContainer.style.paddingTop="6px",this.buttonContainer.style.right="25px"):"min"!=uiTheme&&(this.buttonContainer.style.paddingRight="38px",this.buttonContainer.style.paddingTop="6px"),null!=this.embedFilenameSpan&&
-this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(n),this.embedFilenameSpan=n),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):g.xml;else{"remoteInvokeReady"==g.action?this.handleRemoteInvokeReady(k):"remoteInvoke"==g.action?this.handleRemoteInvoke(g,f.origin):"remoteInvokeResponse"==g.action?this.handleRemoteInvokeResponse(g):k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}catch(X){this.handleError(X)}}var V=
+this.embedFilenameSpan.parentNode.removeChild(this.embedFilenameSpan),this.buttonContainer.appendChild(n),this.embedFilenameSpan=n),g=null!=g.xmlpng?this.extractGraphModelFromPng(g.xmlpng):g.xml;else{"remoteInvokeReady"==g.action?this.handleRemoteInvokeReady(k):"remoteInvoke"==g.action?this.handleRemoteInvoke(g,f.origin):"remoteInvokeResponse"==g.action?this.handleRemoteInvokeResponse(g):k.postMessage(JSON.stringify({error:"unknownMessage",data:JSON.stringify(g)}),"*");return}}catch(W){this.handleError(W)}}var S=
mxUtils.bind(this,function(g,f){d=!0;try{a(g,f)}catch(P){this.handleError(P)}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 g=this.createLoadMessage("autosave");g.xml=c;c=JSON.stringify(g);(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||k.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){V(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)&&V(a.responseText,f)}),""):null!=g&&"function"===typeof g.substring&&this.isLucidChartData(g)?this.convertLucidChart(g,mxUtils.bind(this,function(a){V(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(g=l(g),V(g,f))}}));var k=window.opener||window.parent,f="json"==urlParams.proto?
+b));"1"!=urlParams.returnbounds&&"json"!=urlParams.proto||k.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){S(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)&&S(a.responseText,f)}),""):null!=g&&"function"===typeof g.substring&&this.isLucidChartData(g)?this.convertLucidChart(g,mxUtils.bind(this,function(a){S(a)}),mxUtils.bind(this,function(a){this.handleError(a)})):(g=l(g),S(g,f))}}));var k=window.opener||window.parent,f="json"==urlParams.proto?
JSON.stringify({event:"init"}):urlParams.ready||"ready";k.postMessage(f,"*")};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":"0px";a.style.paddingLeft="8px";a.style.paddingBottom="2px";var b=document.createElement("button");b.className="geBigButton";"1"==urlParams.noSaveBtn?(mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",
mxResources.get("saveAndExit")),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b)):(mxUtils.write(b,mxResources.get("save")),b.setAttribute("title",mxResources.get("save")+" ("+Editor.ctrlKey+"+S)"),mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("save").funct()})),a.appendChild(b),"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUtils.write(b,mxResources.get("saveAndExit")),b.setAttribute("title",
mxResources.get("saveAndExit")),b.className="geBigButton geBigStandardButton",b.style.marginLeft="6px",mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("saveAndExit").funct()})),a.appendChild(b)));b=document.createElement("a");mxUtils.write(b,mxResources.get("exit"));b.setAttribute("title",mxResources.get("exit"));b.className="geBigButton geBigStandardButton";b.style.marginLeft="6px";b.style.marginRight="20px";mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.actions.get("exit").funct()}));
a.appendChild(b);this.toolbar.container.appendChild(a);this.toolbar.staticElements.push(a);a.style.right="atlas"!=uiTheme?"52px":"42px"}};EditorUi.prototype.showImportCsvDialog=function(){null==this.importCsvDialog&&(this.importCsvDialog=new TextareaDialog(this,mxResources.get("csv")+":",Editor.defaultCsvValue,mxUtils.bind(this,function(a){this.importCsv(a)}),null,null,620,430,null,!0,!0,mxResources.get("import"),this.isOffline()?null:"https://drawio-app.com/import-from-csv-to-drawio/"));this.showDialog(this.importCsvDialog.container,
-640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.executeLayoutList=function(a,b){for(var d=this.editor.graph,c=d.getSelectionCells(),e=0;e<a.length;e++){var f=new window[a[e].layout](d);if(null!=a[e].config)for(var g in a[e].config)f[g]=a[e].config[g];this.executeLayout(function(){f.execute(d.getDefaultParent(),0==c.length?null:c)},e==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],e=[],f={};if(0<c.length){var g={},k=null,
-l=null,z=null,y=null,A=null,x=null,B=null,C=null,D="",F="auto",G="auto",E=null,J=null,K=40,H=40,L=100,M=0,I=this.editor.graph;I.getGraphBounds();for(var U=function(){null!=b?b(ja):(I.setSelectionCells(ja),I.scrollCellToVisible(I.getSelectionCell()))},T=I.getFreeInsertPoint(),ca=T.x,ba=T.y,T=ba,W=null,S="auto",C=null,V=[],X=null,Z=null,aa=0;aa<c.length&&"#"==c[aa].charAt(0);){a=c[aa];for(aa++;aa<c.length&&"\\"==a.charAt(a.length-1)&&"#"==c[aa].charAt(0);)a=a.substring(0,a.length-1)+mxUtils.trim(c[aa].substring(1)),
-aa++;if("#"!=a.charAt(1)){var P=a.indexOf(":");if(0<P){var Q=mxUtils.trim(a.substring(1,P)),N=mxUtils.trim(a.substring(P+1));"label"==Q?W=I.sanitizeHtml(N):"labelname"==Q&&0<N.length&&"-"!=N?y=N:"labels"==Q&&0<N.length&&"-"!=N?A=JSON.parse(N):"style"==Q?k=N:"parentstyle"==Q?x=N:"stylename"==Q&&0<N.length&&"-"!=N?z=N:"styles"==Q&&0<N.length&&"-"!=N?l=JSON.parse(N):"identity"==Q&&0<N.length&&"-"!=N?B=N:"parent"==Q&&0<N.length&&"-"!=N?C=N:"namespace"==Q&&0<N.length&&"-"!=N?D=N:"width"==Q?F=N:"height"==
-Q?G=N:"left"==Q&&0<N.length?E=N:"top"==Q&&0<N.length?J=N:"ignore"==Q?Z=N.split(","):"connect"==Q?V.push(JSON.parse(N)):"link"==Q?X=N:"padding"==Q?M=parseFloat(N):"edgespacing"==Q?K=parseFloat(N):"nodespacing"==Q?H=parseFloat(N):"levelspacing"==Q?L=parseFloat(N):"layout"==Q&&(S=N)}}}if(null==c[aa])throw Error(mxResources.get("invalidOrMissingFile"));for(var ga=this.editor.csvToArray(c[aa]),Q=P=null,N=[],R=0;R<ga.length;R++)B==ga[R]&&(P=R),C==ga[R]&&(Q=R),N.push(mxUtils.trim(ga[R]).replace(/[^a-z0-9]+/ig,
-"_").replace(/^\d+/,"").replace(/_+$/,""));null==W&&(W="%"+N[0]+"%");if(null!=V)for(var Y=0;Y<V.length;Y++)null==g[V[Y].to]&&(g[V[Y].to]={});B=[];for(R=aa+1;R<c.length;R++){var da=this.editor.csvToArray(c[R]);if(null==da){var ta=40<c[R].length?c[R].substring(0,40)+"...":c[R];throw Error(ta+" ("+R+"):\n"+mxResources.get("containsValidationErrors"));}0<da.length&&B.push(da)}I.model.beginUpdate();try{for(R=0;R<B.length;R++){var da=B[R],O=null,ha=null!=P?D+da[P]:null;null!=ha&&(O=I.model.getCell(ha));
-var c=null!=O,fa=new mxCell(W,new mxGeometry(ca,T,0,0),k||"whiteSpace=wrap;html=1;");fa.vertex=!0;fa.id=ha;for(var ea=0;ea<da.length;ea++)I.setAttributeForCell(fa,N[ea],da[ea]);if(null!=y&&null!=A){var ka=A[fa.getAttribute(y)];null!=ka&&I.labelChanged(fa,ka)}if(null!=z&&null!=l){var pa=l[fa.getAttribute(z)];null!=pa&&(fa.style=pa)}I.setAttributeForCell(fa,"placeholders","1");fa.style=I.replacePlaceholders(fa,fa.style);c&&(I.model.setGeometry(O,fa.geometry),I.model.setStyle(O,fa.style),0>mxUtils.indexOf(e,
-O)&&e.push(O));O=fa;if(!c)for(Y=0;Y<V.length;Y++)g[V[Y].to][O.getAttribute(V[Y].to)]=O;null!=X&&"link"!=X&&(I.setLinkForCell(O,O.getAttribute(X)),I.setAttributeForCell(O,X,null));I.fireEvent(new mxEventObject("cellsInserted","cells",[O]));var ia=this.editor.graph.getPreferredSizeForCell(O);O.vertex&&(null!=E&&null!=O.getAttribute(E)&&(O.geometry.x=ca+parseFloat(O.getAttribute(E))),null!=J&&null!=O.getAttribute(J)&&(O.geometry.y=ba+parseFloat(O.getAttribute(J))),"@"==F.charAt(0)&&null!=O.getAttribute(F.substring(1))?
-O.geometry.width=parseFloat(O.getAttribute(F.substring(1))):O.geometry.width="auto"==F?ia.width+M:parseFloat(F),"@"==G.charAt(0)&&null!=O.getAttribute(G.substring(1))?O.geometry.height=parseFloat(O.getAttribute(G.substring(1))):O.geometry.height="auto"==G?ia.height+M:parseFloat(G),T+=O.geometry.height+H);c?(null==f[ha]&&(f[ha]=[]),f[ha].push(O)):(C=null!=Q?I.model.getCell(D+da[Q]):null,d.push(O),null!=C?(C.style=I.replacePlaceholders(C,x),I.addCell(O,C)):e.push(I.addCell(O)))}for(var la=e.slice(),
-ja=e.slice(),Y=0;Y<V.length;Y++)for(var wa=V[Y],R=0;R<d.length;R++){var O=d[R],qa=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d&&(I.setAttributeForCell(b,c.from,null),""!=d))for(var d=d.split(","),e=0;e<d.length;e++){var f=g[c.to][d[e]];if(null!=f){var k=c.label;null!=c.fromlabel&&(k=(b.getAttribute(c.fromlabel)||"")+(k||""));null!=c.tolabel&&(k=(k||"")+(f.getAttribute(c.tolabel)||""));var l="target"==c.placeholders==!c.invert?f:a,l=null!=c.style?I.replacePlaceholders(l,
-c.style):I.createCurrentEdgeStyle();ja.push(I.insertEdge(null,null,k||"",c.invert?f:a,c.invert?a:f,l));mxUtils.remove(c.invert?a:f,la)}}});qa(O,O,wa);if(null!=f[O.id])for(ea=0;ea<f[O.id].length;ea++)qa(O,f[O.id][ea],wa)}if(null!=Z)for(R=0;R<d.length;R++)for(O=d[R],ea=0;ea<Z.length;ea++)I.setAttributeForCell(O,mxUtils.trim(Z[ea]),null);if(0<e.length){var ma=new mxParallelEdgeLayout(I);ma.spacing=K;var ua=function(){0<ma.spacing&&ma.execute(I.getDefaultParent());for(var a=0;a<e.length;a++){var b=I.getCellGeometry(e[a]);
-b.x=Math.round(I.snap(b.x));b.y=Math.round(I.snap(b.y));"auto"==F&&(b.width=Math.round(I.snap(b.width)));"auto"==G&&(b.height=Math.round(I.snap(b.height)))}};if("["==S.charAt(0)){var va=U;I.view.validate();this.executeLayoutList(JSON.parse(S),function(){ua();va()});U=null}else if("circle"==S){var ra=new mxCircleLayout(I);ra.resetEdges=!1;var xa=ra.isVertexIgnored;ra.isVertexIgnored=function(a){return xa.apply(this,arguments)||0>mxUtils.indexOf(e,a)};this.executeLayout(function(){ra.execute(I.getDefaultParent());
-ua()},!0,U);U=null}else if("horizontaltree"==S||"verticaltree"==S||"auto"==S&&ja.length==2*e.length-1&&1==la.length){I.view.validate();var sa=new mxCompactTreeLayout(I,"horizontaltree"==S);sa.levelDistance=H;sa.edgeRouting=!1;sa.resetEdges=!1;this.executeLayout(function(){sa.execute(I.getDefaultParent(),0<la.length?la[0]:null)},!0,U);U=null}else if("horizontalflow"==S||"verticalflow"==S||"auto"==S&&1==la.length){I.view.validate();var na=new mxHierarchicalLayout(I,"horizontalflow"==S?mxConstants.DIRECTION_WEST:
-mxConstants.DIRECTION_NORTH);na.intraCellSpacing=H;na.parallelEdgeSpacing=K;na.interRankCellSpacing=L;na.disableEdgeStyle=!1;this.executeLayout(function(){na.execute(I.getDefaultParent(),ja);I.moveCells(ja,ca,ba)},!0,U);U=null}else if("organic"==S||"auto"==S&&ja.length>e.length){I.view.validate();var oa=new mxFastOrganicLayout(I);oa.forceConstant=3*H;oa.resetEdges=!1;var ya=oa.isVertexIgnored;oa.isVertexIgnored=function(a){return ya.apply(this,arguments)||0>mxUtils.indexOf(e,a)};ma=new mxParallelEdgeLayout(I);
-ma.spacing=K;this.executeLayout(function(){oa.execute(I.getDefaultParent());ua()},!0,U);U=null}}this.hideDialog()}finally{I.model.endUpdate()}null!=U&&U()}}catch(za){this.handleError(za)}};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=
+640,520,!0,!0,null,null,null,null,!0);this.importCsvDialog.init()};EditorUi.prototype.executeLayoutList=function(a,b){for(var c=this.editor.graph,d=c.getSelectionCells(),e=0;e<a.length;e++){var f=new window[a[e].layout](c);if(null!=a[e].config)for(var g in a[e].config)f[g]=a[e].config[g];this.executeLayout(function(){f.execute(c.getDefaultParent(),0==d.length?null:d)},e==a.length-1,b)}};EditorUi.prototype.importCsv=function(a,b){try{var c=a.split("\n"),d=[],e=[],f={};if(0<c.length){var g={},k=null,
+l=null,z=null,y=null,B=null,x=null,A=null,C=null,D="",E="auto",H="auto",F=null,J=null,K=40,G=40,L=100,M=0,I=this.editor.graph;I.getGraphBounds();for(var T=function(){null!=b?b(ja):(I.setSelectionCells(ja),I.scrollCellToVisible(I.getSelectionCell()))},V=I.getFreeInsertPoint(),aa=V.x,ba=V.y,V=ba,X=null,U="auto",C=null,S=[],W=null,fa=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 P=a.indexOf(":");if(0<P){var Q=mxUtils.trim(a.substring(1,P)),N=mxUtils.trim(a.substring(P+1));"label"==Q?X=I.sanitizeHtml(N):"labelname"==Q&&0<N.length&&"-"!=N?y=N:"labels"==Q&&0<N.length&&"-"!=N?B=JSON.parse(N):"style"==Q?k=N:"parentstyle"==Q?x=N:"stylename"==Q&&0<N.length&&"-"!=N?z=N:"styles"==Q&&0<N.length&&"-"!=N?l=JSON.parse(N):"identity"==Q&&0<N.length&&"-"!=N?A=N:"parent"==Q&&0<N.length&&"-"!=N?C=N:"namespace"==Q&&0<N.length&&"-"!=N?D=N:"width"==Q?E=N:"height"==
+Q?H=N:"left"==Q&&0<N.length?F=N:"top"==Q&&0<N.length?J=N:"ignore"==Q?fa=N.split(","):"connect"==Q?S.push(JSON.parse(N)):"link"==Q?W=N:"padding"==Q?M=parseFloat(N):"edgespacing"==Q?K=parseFloat(N):"nodespacing"==Q?G=parseFloat(N):"levelspacing"==Q?L=parseFloat(N):"layout"==Q&&(U=N)}}}if(null==c[Y])throw Error(mxResources.get("invalidOrMissingFile"));for(var ga=this.editor.csvToArray(c[Y]),Q=P=null,N=[],R=0;R<ga.length;R++)A==ga[R]&&(P=R),C==ga[R]&&(Q=R),N.push(mxUtils.trim(ga[R]).replace(/[^a-z0-9]+/ig,
+"_").replace(/^\d+/,"").replace(/_+$/,""));null==X&&(X="%"+N[0]+"%");if(null!=S)for(var Z=0;Z<S.length;Z++)null==g[S[Z].to]&&(g[S[Z].to]={});A=[];for(R=Y+1;R<c.length;R++){var ca=this.editor.csvToArray(c[R]);if(null==ca){var ta=40<c[R].length?c[R].substring(0,40)+"...":c[R];throw Error(ta+" ("+R+"):\n"+mxResources.get("containsValidationErrors"));}0<ca.length&&A.push(ca)}I.model.beginUpdate();try{for(R=0;R<A.length;R++){var ca=A[R],O=null,ha=null!=P?D+ca[P]:null;null!=ha&&(O=I.model.getCell(ha));
+var c=null!=O,ea=new mxCell(X,new mxGeometry(aa,V,0,0),k||"whiteSpace=wrap;html=1;");ea.vertex=!0;ea.id=ha;for(var da=0;da<ca.length;da++)I.setAttributeForCell(ea,N[da],ca[da]);if(null!=y&&null!=B){var ka=B[ea.getAttribute(y)];null!=ka&&I.labelChanged(ea,ka)}if(null!=z&&null!=l){var pa=l[ea.getAttribute(z)];null!=pa&&(ea.style=pa)}I.setAttributeForCell(ea,"placeholders","1");ea.style=I.replacePlaceholders(ea,ea.style);c&&(I.model.setGeometry(O,ea.geometry),I.model.setStyle(O,ea.style),0>mxUtils.indexOf(e,
+O)&&e.push(O));O=ea;if(!c)for(Z=0;Z<S.length;Z++)g[S[Z].to][O.getAttribute(S[Z].to)]=O;null!=W&&"link"!=W&&(I.setLinkForCell(O,O.getAttribute(W)),I.setAttributeForCell(O,W,null));I.fireEvent(new mxEventObject("cellsInserted","cells",[O]));var ia=this.editor.graph.getPreferredSizeForCell(O);O.vertex&&(null!=F&&null!=O.getAttribute(F)&&(O.geometry.x=aa+parseFloat(O.getAttribute(F))),null!=J&&null!=O.getAttribute(J)&&(O.geometry.y=ba+parseFloat(O.getAttribute(J))),"@"==E.charAt(0)&&null!=O.getAttribute(E.substring(1))?
+O.geometry.width=parseFloat(O.getAttribute(E.substring(1))):O.geometry.width="auto"==E?ia.width+M:parseFloat(E),"@"==H.charAt(0)&&null!=O.getAttribute(H.substring(1))?O.geometry.height=parseFloat(O.getAttribute(H.substring(1))):O.geometry.height="auto"==H?ia.height+M:parseFloat(H),V+=O.geometry.height+G);c?(null==f[ha]&&(f[ha]=[]),f[ha].push(O)):(C=null!=Q?I.model.getCell(D+ca[Q]):null,d.push(O),null!=C?(C.style=I.replacePlaceholders(C,x),I.addCell(O,C)):e.push(I.addCell(O)))}for(var la=e.slice(),
+ja=e.slice(),Z=0;Z<S.length;Z++)for(var wa=S[Z],R=0;R<d.length;R++){var O=d[R],qa=mxUtils.bind(this,function(a,b,c){var d=b.getAttribute(c.from);if(null!=d&&(I.setAttributeForCell(b,c.from,null),""!=d))for(var d=d.split(","),e=0;e<d.length;e++){var f=g[c.to][d[e]];if(null!=f){var k=c.label;null!=c.fromlabel&&(k=(b.getAttribute(c.fromlabel)||"")+(k||""));null!=c.tolabel&&(k=(k||"")+(f.getAttribute(c.tolabel)||""));var l="target"==c.placeholders==!c.invert?f:a,l=null!=c.style?I.replacePlaceholders(l,
+c.style):I.createCurrentEdgeStyle();ja.push(I.insertEdge(null,null,k||"",c.invert?f:a,c.invert?a:f,l));mxUtils.remove(c.invert?a:f,la)}}});qa(O,O,wa);if(null!=f[O.id])for(da=0;da<f[O.id].length;da++)qa(O,f[O.id][da],wa)}if(null!=fa)for(R=0;R<d.length;R++)for(O=d[R],da=0;da<fa.length;da++)I.setAttributeForCell(O,mxUtils.trim(fa[da]),null);if(0<e.length){var ma=new mxParallelEdgeLayout(I);ma.spacing=K;var ua=function(){0<ma.spacing&&ma.execute(I.getDefaultParent());for(var a=0;a<e.length;a++){var b=
+I.getCellGeometry(e[a]);b.x=Math.round(I.snap(b.x));b.y=Math.round(I.snap(b.y));"auto"==E&&(b.width=Math.round(I.snap(b.width)));"auto"==H&&(b.height=Math.round(I.snap(b.height)))}};if("["==U.charAt(0)){var va=T;I.view.validate();this.executeLayoutList(JSON.parse(U),function(){ua();va()});T=null}else if("circle"==U){var ra=new mxCircleLayout(I);ra.resetEdges=!1;var xa=ra.isVertexIgnored;ra.isVertexIgnored=function(a){return xa.apply(this,arguments)||0>mxUtils.indexOf(e,a)};this.executeLayout(function(){ra.execute(I.getDefaultParent());
+ua()},!0,T);T=null}else if("horizontaltree"==U||"verticaltree"==U||"auto"==U&&ja.length==2*e.length-1&&1==la.length){I.view.validate();var sa=new mxCompactTreeLayout(I,"horizontaltree"==U);sa.levelDistance=G;sa.edgeRouting=!1;sa.resetEdges=!1;this.executeLayout(function(){sa.execute(I.getDefaultParent(),0<la.length?la[0]:null)},!0,T);T=null}else if("horizontalflow"==U||"verticalflow"==U||"auto"==U&&1==la.length){I.view.validate();var na=new mxHierarchicalLayout(I,"horizontalflow"==U?mxConstants.DIRECTION_WEST:
+mxConstants.DIRECTION_NORTH);na.intraCellSpacing=G;na.parallelEdgeSpacing=K;na.interRankCellSpacing=L;na.disableEdgeStyle=!1;this.executeLayout(function(){na.execute(I.getDefaultParent(),ja);I.moveCells(ja,aa,ba)},!0,T);T=null}else if("organic"==U||"auto"==U&&ja.length>e.length){I.view.validate();var oa=new mxFastOrganicLayout(I);oa.forceConstant=3*G;oa.resetEdges=!1;var ya=oa.isVertexIgnored;oa.isVertexIgnored=function(a){return ya.apply(this,arguments)||0>mxUtils.indexOf(e,a)};ma=new mxParallelEdgeLayout(I);
+ma.spacing=K;this.executeLayout(function(){oa.execute(I.getDefaultParent());ua()},!0,T);T=null}}this.hideDialog()}finally{I.model.endUpdate()}null!=T&&T()}}catch(za){this.handleError(za)}};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,c){a=new LinkDialog(this,a,b,c,!0);this.showDialog(a.container,560,130,!0,!0);a.init()};var k=
EditorUi.prototype.createOutline;EditorUi.prototype.createOutline=function(a){var b=k.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();
@@ -9416,63 +9416,63 @@ var l=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=thi
a;this.currentPage!=this.pages[c]&&(e=this.createTemporaryGraph(a.getStylesheet()),this.updatePageRoot(this.pages[c]),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={},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='<div style="text-align:center;padding:8px;"><img src="/images/spin.gif"></div>';var f={};try{var k=mxSettings.getCustomLibraries();for(a=0;a<k.length;a++){var l=k[a];if("R"==l.substring(0,1)){var v=JSON.parse(decodeURIComponent(l.substring(1)));f[v[0]]={id:v[0],title:v[1],downloadUrl:v[2]}}}}catch(z){}this.remoteInvoke("getCustomLibraries",null,null,function(a){e.innerHTML=
"";if(0==a.length)e.innerHTML='<div style="text-align:center;padding-top:20px;color:gray;">'+mxUtils.htmlEntities(mxResources.get("noLibraries"))+"</div>";else for(var c=0;c<a.length;c++){var d=a[c];f[d.id]&&(b[d.id]=d);var g=this.addCheckbox(e,d.title,f[d.id]);(function(a,c){mxEvent.addListener(c,"change",function(){this.checked?b[a.id]=a:delete b[a.id]})})(d,g)}},mxUtils.bind(this,function(a){e.innerHTML="";var b=document.createElement("div");b.style.padding="8px";b.style.textAlign="center";mxUtils.write(b,
-mxResources.get("error")+": ");mxUtils.write(b,null!=a&&null!=a.message?a.message:mxResources.get("unknownError"));e.appendChild(b)}));c.appendChild(e);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==f[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(B){this.handleError(B,
+mxResources.get("error")+": ");mxUtils.write(b,null!=a&&null!=a.message?a.message:mxResources.get("unknownError"));e.appendChild(b)}));c.appendChild(e);c=new CustomDialog(this,c,mxUtils.bind(this,function(){this.spinner.spin(document.body,mxResources.get("loading"));var a=0,c;for(c in b)null==f[c]&&(a++,mxUtils.bind(this,function(b){this.remoteInvoke("getFileContent",[b.downloadUrl],null,mxUtils.bind(this,function(c){a--;0==a&&this.spinner.stop();try{this.loadLibrary(new RemoteLibrary(this,c,b))}catch(A){this.handleError(A,
mxResources.get("errorLoadingFile"))}}),mxUtils.bind(this,function(){a--;0==a&&this.spinner.stop();this.handleError(null,mxResources.get("errorLoadingFile"))}))})(b[c]));for(c in f)b[c]||this.closeLibrary(new RemoteLibrary(this,null,f[c]));0==a&&this.spinner.stop()}),null,null,"https://desk.draw.io/support/solutions/articles/16000092763");this.showDialog(c.container,340,375,!0,!0,null,null,null,null,!0)};EditorUi.prototype.remoteInvokableFns={getDiagramTextContent:{isAsync:!1},getLocalStorageFile:{isAsync:!1,
allowedDomains:["app.diagrams.net"]},getLocalStorageFileNames:{isAsync:!1,allowedDomains:["app.diagrams.net"]},setMigratedFlag:{isAsync:!1,allowedDomains:["app.diagrams.net"]}};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];if(null==c)throw Error("No callback for "+(null!=b?b.callbackId:"null"));a.error?c.error&&c.error(a.error.errResp):c.callback&&c.callback.apply(this,a.resp);this.remoteInvokeCallbacks[b.callbackId]=null};EditorUi.prototype.remoteInvoke=function(a,b,c,e,f){var d=!0,g=window.setTimeout(mxUtils.bind(this,function(){d=!1;f({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.timeout),k=mxUtils.bind(this,function(){window.clearTimeout(g);
d&&e.apply(this,arguments)});c=c||{};c.callbackId=this.remoteInvokeCallbacks.length;this.remoteInvokeCallbacks.push({callback:k,error:f});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,b){var c=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 d=a.funtionName,e=this.remoteInvokableFns[d];if(null!=e&&"function"===typeof this[d]){if(e.allowedDomains){for(var f=!1,g=0;g<e.allowedDomains.length;g++)if(b=="https://"+e.allowedDomains[g]){f=!0;break}if(!f){c(null,"Invalid Call: "+d+" is not allowed.");return}}var k=a.functionArgs;Array.isArray(k)||(k=[]);if(e.isAsync)k.push(function(){c(Array.prototype.slice.apply(arguments))}),k.push(function(a){c(null,a||"Unkown Error")}),this[d].apply(this,
k);else{var l=this[d].apply(this,k);c([l])}}else c(null,"Invalid Call: "+d+" is not found.")}catch(z){c(null,"Invalid Call: An error occured, "+z.message)}};EditorUi.prototype.openDatabase=function(a,b){if(null==this.database){var c=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB;if(null!=c)try{var d=c.open("database",2);d.onupgradeneeded=function(a){try{var c=d.result;1>a.oldVersion&&c.createObjectStore("objects",{keyPath:"key"});2>a.oldVersion&&(c.createObjectStore("files",{keyPath:"title"}),
-c.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(t){null!=b&&b(t)}};d.onsuccess=mxUtils.bind(this,function(b){var c=d.result;this.database=c;EditorUi.migrateStorageFiles&&(StorageFile.migrate(c),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(a){if(!a||"1"==urlParams.forceMigration){var b=document.createElement("iframe");
+c.createObjectStore("filesInfo",{keyPath:"title"}),EditorUi.migrateStorageFiles=isLocalStorage)}catch(q){null!=b&&b(q)}};d.onsuccess=mxUtils.bind(this,function(b){var c=d.result;this.database=c;EditorUi.migrateStorageFiles&&(StorageFile.migrate(c),EditorUi.migrateStorageFiles=!1);"app.diagrams.net"!=location.host||this.drawioMigrationStarted||(this.drawioMigrationStarted=!0,this.getDatabaseItem(".drawioMigrated3",mxUtils.bind(this,function(a){if(!a||"1"==urlParams.forceMigration){var b=document.createElement("iframe");
b.style.display="none";b.setAttribute("src","https://www.draw.io?embed=1&proto=json&forceMigration="+urlParams.forceMigration);document.body.appendChild(b);var c=!0,d=!1,e,f=0,g=mxUtils.bind(this,function(){d=!0;this.setDatabaseItem(".drawioMigrated3",!0);b.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"setMigratedFlag"}),"*")}),k=mxUtils.bind(this,function(){f++;l()}),l=mxUtils.bind(this,function(){try{if(f>=e.length)g();else{var a=e[f];StorageFile.getFileContent(this,
-a,mxUtils.bind(this,function(c){null==c||".scratchpad"==a&&c==this.emptyLibraryXml?b.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[a]}),"*"):k()}),k)}}catch(G){console.log(G)}}),m=mxUtils.bind(this,function(a){try{this.setDatabaseItem(null,[{title:a.title,size:a.data.length,lastModified:Date.now(),type:a.isLib?"L":"F"},{title:a.title,data:a.data}],k,k,["filesInfo","files"])}catch(G){console.log(G)}});a=mxUtils.bind(this,function(a){try{if(a.source==
-b.contentWindow){var f={};try{f=JSON.parse(a.data)}catch(E){}"init"==f.event?(b.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),b.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=f.event||d||(c?null!=f.resp&&0<f.resp.length&&null!=f.resp[0]?(e=f.resp[0],c=!1,l()):g():null!=f.resp&&0<f.resp.length&&null!=f.resp[0]?m(f.resp[0]):k())}}catch(E){console.log(E)}});window.addEventListener("message",
-a)}})));a(c);c.onversionchange=function(){c.close()}});d.onerror=b;d.onblocked=function(){}}catch(p){null!=b&&b(p)}else null!=b&&b()}else a(this.database)};EditorUi.prototype.setDatabaseItem=function(a,b,c,e,f){this.openDatabase(mxUtils.bind(this,function(d){try{f=f||"objects";Array.isArray(f)||(f=[f],a=[a],b=[b]);var g=d.transaction(f,"readwrite");g.oncomplete=c;g.onerror=e;for(d=0;d<f.length;d++)g.objectStore(f[d]).put(null!=a&&null!=a[d]?{key:a[d],data:b[d]}:b[d])}catch(q){null!=e&&e(q)}}),e)};
+a,mxUtils.bind(this,function(c){null==c||".scratchpad"==a&&c==this.emptyLibraryXml?b.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[a]}),"*"):k()}),k)}}catch(H){console.log(H)}}),m=mxUtils.bind(this,function(a){try{this.setDatabaseItem(null,[{title:a.title,size:a.data.length,lastModified:Date.now(),type:a.isLib?"L":"F"},{title:a.title,data:a.data}],k,k,["filesInfo","files"])}catch(H){console.log(H)}});a=mxUtils.bind(this,function(a){try{if(a.source==
+b.contentWindow){var f={};try{f=JSON.parse(a.data)}catch(F){}"init"==f.event?(b.contentWindow.postMessage(JSON.stringify({action:"remoteInvokeReady"}),"*"),b.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFileNames"}),"*")):"remoteInvokeResponse"!=f.event||d||(c?null!=f.resp&&0<f.resp.length&&null!=f.resp[0]?(e=f.resp[0],c=!1,l()):g():null!=f.resp&&0<f.resp.length&&null!=f.resp[0]?m(f.resp[0]):k())}}catch(F){console.log(F)}});window.addEventListener("message",
+a)}})));a(c);c.onversionchange=function(){c.close()}});d.onerror=b;d.onblocked=function(){}}catch(p){null!=b&&b(p)}else null!=b&&b()}else a(this.database)};EditorUi.prototype.setDatabaseItem=function(a,b,c,e,f){this.openDatabase(mxUtils.bind(this,function(d){try{f=f||"objects";Array.isArray(f)||(f=[f],a=[a],b=[b]);var g=d.transaction(f,"readwrite");g.oncomplete=c;g.onerror=e;for(d=0;d<f.length;d++)g.objectStore(f[d]).put(null!=a&&null!=a[d]?{key:a[d],data:b[d]}:b[d])}catch(t){null!=e&&e(t)}}),e)};
EditorUi.prototype.removeDatabaseItem=function(a,b,c,e){this.openDatabase(mxUtils.bind(this,function(d){e=e||"objects";Array.isArray(e)||(e=[e],a=[a]);d=d.transaction(e,"readwrite");d.oncomplete=b;d.onerror=c;for(var f=0;f<e.length;f++)d.objectStore(e[f])["delete"](a[f])}),c)};EditorUi.prototype.getDatabaseItem=function(a,b,c,e){this.openDatabase(mxUtils.bind(this,function(d){try{e=e||"objects";var f=d.transaction([e],"readonly").objectStore(e).get(a);f.onsuccess=function(){b(f.result)};f.onerror=
-c}catch(t){null!=c&&c(t)}}),c)};EditorUi.prototype.getDatabaseItems=function(a,b,c){this.openDatabase(mxUtils.bind(this,function(d){try{c=c||"objects";var e=d.transaction([c],"readonly").objectStore(c).openCursor(IDBKeyRange.lowerBound(0)),f=[];e.onsuccess=function(b){null==b.target.result?a(f):(f.push(b.target.result.value),b.target.result["continue"]())};e.onerror=b}catch(t){null!=b&&b(t)}}),b)};EditorUi.prototype.getDatabaseItemKeys=function(a,b,c){this.openDatabase(mxUtils.bind(this,function(d){try{c=
+c}catch(q){null!=c&&c(q)}}),c)};EditorUi.prototype.getDatabaseItems=function(a,b,c){this.openDatabase(mxUtils.bind(this,function(d){try{c=c||"objects";var e=d.transaction([c],"readonly").objectStore(c).openCursor(IDBKeyRange.lowerBound(0)),f=[];e.onsuccess=function(b){null==b.target.result?a(f):(f.push(b.target.result.value),b.target.result["continue"]())};e.onerror=b}catch(q){null!=b&&b(q)}}),b)};EditorUi.prototype.getDatabaseItemKeys=function(a,b,c){this.openDatabase(mxUtils.bind(this,function(d){try{c=
c||"objects";var e=d.transaction([c],"readonly").objectStore(c).getAllKeys();e.onsuccess=function(){a(e.result)};e.onerror=b}catch(u){null!=b&&b(u)}}),b)};EditorUi.prototype.commentsSupported=function(){var a=this.getCurrentFile();return null!=a?a.commentsSupported():!1};EditorUi.prototype.commentsRefreshNeeded=function(){var a=this.getCurrentFile();return null!=a?a.commentsRefreshNeeded():!0};EditorUi.prototype.commentsSaveNeeded=function(){var a=this.getCurrentFile();return null!=a?a.commentsSaveNeeded():
!1};EditorUi.prototype.getComments=function(a,b){var c=this.getCurrentFile();null!=c?c.getComments(a,b):a([])};EditorUi.prototype.addComment=function(a,b,c){var d=this.getCurrentFile();null!=d?d.addComment(a,b,c):b(Date.now())};EditorUi.prototype.canReplyToReplies=function(){var a=this.getCurrentFile();return null!=a?a.canReplyToReplies():!0};EditorUi.prototype.canComment=function(){var a=this.getCurrentFile();return null!=a?a.canComment():!0};EditorUi.prototype.newComment=function(a,b){var c=this.getCurrentFile();
return null!=c?c.newComment(a,b):new DrawioComment(this,null,a,Date.now(),Date.now(),!1,b)};EditorUi.prototype.isRevisionHistorySupported=function(){var a=this.getCurrentFile();return null!=a&&a.isRevisionHistorySupported()};EditorUi.prototype.getRevisions=function(a,b){var c=this.getCurrentFile();null!=c&&c.getRevisions?c.getRevisions(a,b):b({message:mxResources.get("unknownError")})};EditorUi.prototype.isRevisionHistoryEnabled=function(){var a=this.getCurrentFile();return null!=a&&(a.constructor==
-DriveFile&&a.isEditable()||a.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(a){a.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(a,b,c,e,f,k,l,q){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(a,b,c,e,f,k,l,q)};EditorUi.prototype.loadFonts=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(a)};
-EditorUi.prototype.createSvgDataUri=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(a)};EditorUi.prototype.embedCssFonts=function(a,b){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(a,b)};EditorUi.prototype.embedExtFonts=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(a)};EditorUi.prototype.exportToCanvas=function(a,b,c,e,f,k,l,q,v,z,y,A,x,B,C){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");
-return this.editor.exportToCanvas(a,b,c,e,f,k,l,q,v,z,y,A,x,B,C)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(a,b,c,e){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(a,b,c,e)};EditorUi.prototype.convertImageToDataUri=function(a,b){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");
+DriveFile&&a.isEditable()||a.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(a){a.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(a,b,c,e,f,k,l,t){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(a,b,c,e,f,k,l,t)};EditorUi.prototype.loadFonts=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(a)};
+EditorUi.prototype.createSvgDataUri=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: createSvgDataUri");return Editor.createSvgDataUri(a)};EditorUi.prototype.embedCssFonts=function(a,b){EditorUi.logEvent("SHOULD NOT BE CALLED: embedCssFonts");return this.editor.embedCssFonts(a,b)};EditorUi.prototype.embedExtFonts=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: embedExtFonts");return this.editor.embedExtFonts(a)};EditorUi.prototype.exportToCanvas=function(a,b,c,e,f,k,l,t,v,z,y,B,x,A,C){EditorUi.logEvent("SHOULD NOT BE CALLED: exportToCanvas");
+return this.editor.exportToCanvas(a,b,c,e,f,k,l,t,v,z,y,B,x,A,C)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(a,b,c,e){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(a,b,c,e)};EditorUi.prototype.convertImageToDataUri=function(a,b){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri");
return this.editor.convertImageToDataUri(a,b)};EditorUi.prototype.base64Encode=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: base64Encode");return Editor.base64Encode(a)};EditorUi.prototype.updateCRC=function(a,b,c,e){EditorUi.logEvent("SHOULD NOT BE CALLED: updateCRC");return Editor.updateCRC(a,b,c,e)};EditorUi.prototype.crc32=function(a){EditorUi.logEvent("SHOULD NOT BE CALLED: crc32");return Editor.crc32(a)};EditorUi.prototype.writeGraphModelToPng=function(a,b,c,e,f){EditorUi.logEvent("SHOULD NOT BE CALLED: writeGraphModelToPng");
return Editor.writeGraphModelToPng(a,b,c,e,f)};EditorUi.prototype.getLocalStorageFileNames=function(){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;for(var a=[],b=0;b<localStorage.length;b++){var c=localStorage.key(b),e=localStorage.getItem(c);if(0<c.length&&(".scratchpad"==c||"."!=c.charAt(0))&&0<e.length){var f="<mxfile "===e.substring(0,8)||"<?xml"===e.substring(0,5)||"\x3c!--[if IE]>"===e.substring(0,12),e="<mxlibrary>"===e.substring(0,11);(f||
e)&&a.push(c)}}return a};EditorUi.prototype.getLocalStorageFile=function(a){if("1"==localStorage.getItem(".localStorageMigrated")&&"1"!=urlParams.forceMigration)return null;var b=localStorage.getItem(a);return{title:a,data:b,isLib:"<mxlibrary>"===b.substring(0,11)}};EditorUi.prototype.setMigratedFlag=function(){localStorage.setItem(".localStorageMigrated","1")}})();
-var CommentsWindow=function(a,e,c,b,k,f){function l(){for(var a=A.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==A&&b++;x.style.display=0==b?"block":"none"}function d(a,b,c,d){function e(){b.removeChild(k);b.removeChild(m);g.style.display="block";f.style.display="block"}v={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),g=b.querySelector(".geCommentActionsList"),k=document.createElement("textarea");k.className=
+var CommentsWindow=function(a,e,c,b,k,f){function l(){for(var a=B.getElementsByTagName("div"),b=0,c=0;c<a.length;c++)"none"!=a[c].style.display&&a[c].parentNode==B&&b++;x.style.display=0==b?"block":"none"}function d(a,b,c,d){function e(){b.removeChild(k);b.removeChild(m);g.style.display="block";f.style.display="block"}v={div:b,comment:a,saveCallback:c,deleteOnCancel:d};var f=b.querySelector(".geCommentTxt"),g=b.querySelector(".geCommentActionsList"),k=document.createElement("textarea");k.className=
"geCommentEditTxtArea";k.style.minHeight=f.offsetHeight+"px";k.value=a.content;b.insertBefore(k,f);var m=document.createElement("div");m.className="geCommentEditBtns";var n=mxUtils.button(mxResources.get("cancel"),function(){d?(b.parentNode.removeChild(b),l()):e();v=null});n.className="geCommentEditBtn";m.appendChild(n);var x=mxUtils.button(mxResources.get("save"),function(){f.innerHTML="";a.content=k.value;mxUtils.write(f,a.content);e();c(a);v=null});mxEvent.addListener(k,"keydown",mxUtils.bind(this,
function(a){mxEvent.isConsumed(a)||((mxEvent.isControlDown(a)||mxClient.IS_MAC&&mxEvent.isMetaDown(a))&&13==a.keyCode?(x.click(),mxEvent.consume(a)):27==a.keyCode&&(n.click(),mxEvent.consume(a)))}));x.focus();x.className="geCommentEditBtn gePrimaryBtn";m.appendChild(x);b.insertBefore(m,f);g.style.display="none";f.style.display="none";k.focus()}function g(b,c){c.innerHTML="";var d=new Date(b.modifiedDate),e=a.timeSince(d);null==e&&(e=mxResources.get("lessThanAMinute"));mxUtils.write(c,mxResources.get("timeAgo",
-[e],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function m(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function n(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function p(a){a.style.border="";a.removeChild(a.busyImg)}function u(b,c,e,f,k){function B(a,c,d){var e=document.createElement("li");e.className="geCommentAction";var f=document.createElement("a");f.className=
-"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});E.appendChild(e);d&&(e.style.display="none")}function C(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=z;a(b);return{pdiv:d,replies:c}}function y(c,e,g,k,l){function x(){m(q);b.addReply(t,function(a){t.id=a;b.replies.push(t);p(q);g&&g()},function(b){B();n(q);a.handleError(b,null,
-null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},k,l)}function B(){d(t,q,function(a){x()},!0)}var v=C().pdiv,t=a.newComment(c,a.getCurrentUser());t.pCommentId=b.id;null==b.replies&&(b.replies=[]);var q=u(t,b.replies,v,f+1);e?B():x()}if(k||!b.isResolved){x.style.display="none";var z=document.createElement("div");z.className="geCommentContainer";z.setAttribute("data-commentId",b.id);z.style.marginLeft=20*f+5+"px";b.isResolved&&"dark"!=uiTheme&&(z.style.backgroundColor="ghostWhite");
-var H=document.createElement("div");H.className="geCommentHeader";var F=document.createElement("img");F.className="geCommentUserImg";F.src=b.user.pictureUrl||Editor.userImage;H.appendChild(F);F=document.createElement("div");F.className="geCommentHeaderTxt";H.appendChild(F);var G=document.createElement("div");G.className="geCommentUsername";mxUtils.write(G,b.user.displayName||"");F.appendChild(G);G=document.createElement("div");G.className="geCommentDate";G.setAttribute("data-commentId",b.id);g(b,
-G);F.appendChild(G);z.appendChild(H);H=document.createElement("div");H.className="geCommentTxt";mxUtils.write(H,b.content||"");z.appendChild(H);H=document.createElement("div");H.className="geCommentActions";var E=document.createElement("ul");E.className="geCommentActionsList";H.appendChild(E);t||0!=f&&!q||B(mxResources.get("reply"),function(){y("",!0)},b.isResolved);F=a.getCurrentUser();null==F||F.id!=b.user.id||t||(B(mxResources.get("edit"),function(){function c(){d(b,z,function(){m(z);b.editComment(b.content,
-function(){p(z)},function(b){n(z);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}c()},b.isResolved),B(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){m(z);b.deleteComment(function(){for(var a=C(b).replies,d=0;d<a.length;d++)A.removeChild(a[d]);for(d=0;d<c.length;d++)if(c[d]==b){c.splice(d,1);break}x.style.display=0==A.getElementsByTagName("div").length?"block":"none"},function(b){n(z);a.handleError(b,null,null,
-null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));t||0!=f||B(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=a.target;c.innerHTML="";b.isResolved=!b.isResolved;mxUtils.write(c,b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var d=b.isResolved?"none":"",e=C(b).replies,f="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",g=0;g<e.length;g++){e[g].style.backgroundColor=f;for(var k=e[g].querySelectorAll(".geCommentAction"),
-m=0;m<k.length;m++)k[m]!=c.parentNode&&(k[m].style.display=d);D||(e[g].style.display="none")}l()}b.isResolved?y(mxResources.get("reOpened")+": ",!0,c,!1,!0):y(mxResources.get("markedAsResolved"),!1,c,!0)});z.appendChild(H);null!=e?A.insertBefore(z,e.nextSibling):A.appendChild(z);for(e=0;null!=b.replies&&e<b.replies.length;e++)H=b.replies[e],H.isResolved=b.isResolved,u(H,b.replies,null,f+1,k);null!=v&&(v.comment.id==b.id?(k=b.content,b.content=v.comment.content,d(b,z,v.saveCallback,v.deleteOnCancel),
-b.content=k):null==v.comment.id&&v.comment.pCommentId==b.id&&(A.appendChild(v.div),d(v.comment,v.div,v.saveCallback,v.deleteOnCancel)));return z}}var t=!a.canComment(),q=a.canReplyToReplies(),v=null,z=document.createElement("div");z.className="geCommentsWin";z.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;var y=EditorUi.compactUi?"26px":"30px",A=document.createElement("div");A.className="geCommentsList";A.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":
-Dialog.backdropColor;A.style.bottom=parseInt(y)+7+"px";z.appendChild(A);var x=document.createElement("span");x.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(x,mxResources.get("noCommentsFound"));var B=document.createElement("div");B.className="geToolbarContainer geCommentsToolbar";B.style.height=y;B.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";B.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;mxClient.IS_QUIRKS&&(B.style.filter=
-"none");y=document.createElement("a");y.className="geButton";mxClient.IS_QUIRKS&&(y.style.filter="none");if(!t){var C=y.cloneNode();C.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';C.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(C,"click",function(b){function c(){d(e,f,function(b){m(f);a.addComment(b,function(a){b.id=a;F.push(b);p(f)},function(b){n(f);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},
-!0)}var e=a.newComment("",a.getCurrentUser()),f=u(e,F,null,0);c();b.preventDefault();mxEvent.consume(b)});B.appendChild(C)}C=y.cloneNode();C.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';C.setAttribute("title",mxResources.get("showResolved"));var D=!1;"dark"==uiTheme&&(C.style.filter="invert(100%)");mxEvent.addListener(C,"click",function(a){this.className=(D=!D)?"geButton geCheckedBtn":"geButton";G();a.preventDefault();mxEvent.consume(a)});B.appendChild(C);a.commentsRefreshNeeded()&&
-(C=y.cloneNode(),C.innerHTML='<img src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',C.setAttribute("title",mxResources.get("refresh")),"dark"==uiTheme&&(C.style.filter="invert(100%)"),mxEvent.addListener(C,"click",function(a){G();a.preventDefault();mxEvent.consume(a)}),B.appendChild(C));a.commentsSaveNeeded()&&(y=y.cloneNode(),y.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',y.setAttribute("title",mxResources.get("save")),"dark"==uiTheme&&
-(y.style.filter="invert(100%)"),mxEvent.addListener(y,"click",function(a){f();a.preventDefault();mxEvent.consume(a)}),B.appendChild(y));z.appendChild(B);var F=[],G=mxUtils.bind(this,function(){this.hasError=!1;if(null!=v)try{v.div=v.div.cloneNode(!0);var b=v.div.querySelector(".geCommentEditTxtArea"),c=v.div.querySelector(".geCommentEditBtns");v.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}catch(H){a.handleError(H)}A.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+
-IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";q=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});A.innerHTML="";A.appendChild(x);x.style.display="block";F=a;for(a=0;a<F.length;a++)b(F[a].replies),
-u(F[a],F,null,0,D);null!=v&&null==v.comment.id&&null==v.comment.pCommentId&&(A.appendChild(v.div),d(v.comment,v.div,v.saveCallback,v.deleteOnCancel))},mxUtils.bind(this,function(a){A.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(a&&a.message?": "+a.message:""));this.hasError=!0})):A.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});G();this.refreshComments=G;B=mxUtils.bind(this,function(){function a(b){var d=c[b.id];if(null!=d)for(g(b,d),d=0;null!=b.replies&&d<b.replies.length;d++)a(b.replies[d])}
-if(this.window.isVisible()){for(var b=A.querySelectorAll(".geCommentDate"),c={},d=0;d<b.length;d++){var e=b[d];c[e.getAttribute("data-commentId")]=e}for(d=0;d<F.length;d++)a(F[d])}});setInterval(B,6E4);this.refreshCommentsTime=B;this.window=new mxWindow(mxResources.get("comments"),z,e,c,b,k,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,
-mxUtils.bind(this,function(){this.window.fit()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)};var E=mxUtils.bind(this,function(){var a=this.window.getX(),
-b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",E);this.destroy=function(){mxEvent.removeListener(window,"resize",E);this.window.destroy()}},ConfirmDialog=function(a,e,c,b,k,f,l,d,g,m,n){var p=document.createElement("div");p.style.textAlign="center";n=null!=n?n:44;var u=document.createElement("div");u.style.padding="6px";u.style.overflow="auto";u.style.maxHeight=n+"px";u.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(u.style.height="60px");mxUtils.write(u,e);
-p.appendChild(u);null!=m&&(u=document.createElement("div"),u.style.padding="6px 0 6px 0",e=document.createElement("img"),e.setAttribute("src",m),u.appendChild(e),p.appendChild(u));m=document.createElement("div");m.style.textAlign="center";m.style.whiteSpace="nowrap";var t=document.createElement("input");t.setAttribute("type","checkbox");f=mxUtils.button(f||mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b(t.checked)});f.className="geBtn";null!=d&&(f.innerHTML=d+"<br>"+f.innerHTML,f.style.paddingBottom=
-"8px",f.style.paddingTop="8px",f.style.height="auto",f.style.width="40%");a.editor.cancelFirst&&m.appendChild(f);var q=mxUtils.button(k||mxResources.get("ok"),function(){a.hideDialog();null!=c&&c(t.checked)});m.appendChild(q);null!=l?(q.innerHTML=l+"<br>"+q.innerHTML+"<br>",q.style.paddingBottom="8px",q.style.paddingTop="8px",q.style.height="auto",q.className="geBtn",q.style.width="40%"):q.className="geBtn gePrimaryBtn";a.editor.cancelFirst||m.appendChild(f);p.appendChild(m);g?(m.style.marginTop=
-"10px",u=document.createElement("p"),u.style.marginTop="20px",u.appendChild(t),k=document.createElement("span"),mxUtils.write(k," "+mxResources.get("rememberThisSetting")),u.appendChild(k),p.appendChild(u),mxEvent.addListener(k,"click",function(a){t.checked=!t.checked;mxEvent.consume(a)})):m.style.marginTop="12px";this.init=function(){q.focus()};this.container=p};EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0,extFonts:!0};EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,mxObjectId:!0,mxTransient:!0};
+[e],"{1} ago"));c.setAttribute("title",d.toLocaleDateString()+" "+d.toLocaleTimeString())}function m(a){var b=document.createElement("img");b.className="geCommentBusyImg";b.src=IMAGE_PATH+"/spin.gif";a.appendChild(b);a.busyImg=b}function n(a){a.style.border="1px solid red";a.removeChild(a.busyImg)}function p(a){a.style.border="";a.removeChild(a.busyImg)}function u(b,c,e,f,k){function A(a,c,d){var e=document.createElement("li");e.className="geCommentAction";var f=document.createElement("a");f.className=
+"geCommentActionLnk";mxUtils.write(f,a);e.appendChild(f);mxEvent.addListener(f,"click",function(a){c(a,b);a.preventDefault();mxEvent.consume(a)});F.appendChild(e);d&&(e.style.display="none")}function C(){function a(b){c.push(d);if(null!=b.replies)for(var e=0;e<b.replies.length;e++)d=d.nextSibling,a(b.replies[e])}var c=[],d=G;a(b);return{pdiv:d,replies:c}}function y(c,e,g,k,l){function x(){m(t);b.addReply(q,function(a){q.id=a;b.replies.push(q);p(t);g&&g()},function(b){v();n(t);a.handleError(b,null,
+null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))},k,l)}function v(){d(q,t,function(a){x()},!0)}var A=C().pdiv,q=a.newComment(c,a.getCurrentUser());q.pCommentId=b.id;null==b.replies&&(b.replies=[]);var t=u(q,b.replies,A,f+1);e?v():x()}if(k||!b.isResolved){x.style.display="none";var G=document.createElement("div");G.className="geCommentContainer";G.setAttribute("data-commentId",b.id);G.style.marginLeft=20*f+5+"px";b.isResolved&&"dark"!=uiTheme&&(G.style.backgroundColor="ghostWhite");
+var z=document.createElement("div");z.className="geCommentHeader";var E=document.createElement("img");E.className="geCommentUserImg";E.src=b.user.pictureUrl||Editor.userImage;z.appendChild(E);E=document.createElement("div");E.className="geCommentHeaderTxt";z.appendChild(E);var H=document.createElement("div");H.className="geCommentUsername";mxUtils.write(H,b.user.displayName||"");E.appendChild(H);H=document.createElement("div");H.className="geCommentDate";H.setAttribute("data-commentId",b.id);g(b,
+H);E.appendChild(H);G.appendChild(z);z=document.createElement("div");z.className="geCommentTxt";mxUtils.write(z,b.content||"");G.appendChild(z);z=document.createElement("div");z.className="geCommentActions";var F=document.createElement("ul");F.className="geCommentActionsList";z.appendChild(F);q||0!=f&&!t||A(mxResources.get("reply"),function(){y("",!0)},b.isResolved);E=a.getCurrentUser();null==E||E.id!=b.user.id||q||(A(mxResources.get("edit"),function(){function c(){d(b,G,function(){m(G);b.editComment(b.content,
+function(){p(G)},function(b){n(G);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}c()},b.isResolved),A(mxResources.get("delete"),function(){a.confirm(mxResources.get("areYouSure"),function(){m(G);b.deleteComment(function(){for(var a=C(b).replies,d=0;d<a.length;d++)B.removeChild(a[d]);for(d=0;d<c.length;d++)if(c[d]==b){c.splice(d,1);break}x.style.display=0==B.getElementsByTagName("div").length?"block":"none"},function(b){n(G);a.handleError(b,null,null,
+null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})},b.isResolved));q||0!=f||A(b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"),function(a){function c(){var c=a.target;c.innerHTML="";b.isResolved=!b.isResolved;mxUtils.write(c,b.isResolved?mxResources.get("reopen"):mxResources.get("resolve"));for(var d=b.isResolved?"none":"",e=C(b).replies,f="dark"==uiTheme?"transparent":b.isResolved?"ghostWhite":"white",g=0;g<e.length;g++){e[g].style.backgroundColor=f;for(var k=e[g].querySelectorAll(".geCommentAction"),
+m=0;m<k.length;m++)k[m]!=c.parentNode&&(k[m].style.display=d);D||(e[g].style.display="none")}l()}b.isResolved?y(mxResources.get("reOpened")+": ",!0,c,!1,!0):y(mxResources.get("markedAsResolved"),!1,c,!0)});G.appendChild(z);null!=e?B.insertBefore(G,e.nextSibling):B.appendChild(G);for(e=0;null!=b.replies&&e<b.replies.length;e++)z=b.replies[e],z.isResolved=b.isResolved,u(z,b.replies,null,f+1,k);null!=v&&(v.comment.id==b.id?(k=b.content,b.content=v.comment.content,d(b,G,v.saveCallback,v.deleteOnCancel),
+b.content=k):null==v.comment.id&&v.comment.pCommentId==b.id&&(B.appendChild(v.div),d(v.comment,v.div,v.saveCallback,v.deleteOnCancel)));return G}}var q=!a.canComment(),t=a.canReplyToReplies(),v=null,z=document.createElement("div");z.className="geCommentsWin";z.style.background="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;var y=EditorUi.compactUi?"26px":"30px",B=document.createElement("div");B.className="geCommentsList";B.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":
+Dialog.backdropColor;B.style.bottom=parseInt(y)+7+"px";z.appendChild(B);var x=document.createElement("span");x.style.cssText="display:none;padding-top:10px;text-align:center;";mxUtils.write(x,mxResources.get("noCommentsFound"));var A=document.createElement("div");A.className="geToolbarContainer geCommentsToolbar";A.style.height=y;A.style.padding=EditorUi.compactUi?"4px 0px 3px 0px":"1px";A.style.backgroundColor="white"==Dialog.backdropColor?"whiteSmoke":Dialog.backdropColor;mxClient.IS_QUIRKS&&(A.style.filter=
+"none");y=document.createElement("a");y.className="geButton";mxClient.IS_QUIRKS&&(y.style.filter="none");if(!q){var C=y.cloneNode();C.innerHTML='<div class="geSprite geSprite-plus" style="display:inline-block;"></div>';C.setAttribute("title",mxResources.get("create")+"...");mxEvent.addListener(C,"click",function(b){function c(){d(e,f,function(b){m(f);a.addComment(b,function(a){b.id=a;E.push(b);p(f)},function(b){n(f);c();a.handleError(b,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})},
+!0)}var e=a.newComment("",a.getCurrentUser()),f=u(e,E,null,0);c();b.preventDefault();mxEvent.consume(b)});A.appendChild(C)}C=y.cloneNode();C.innerHTML='<img src="'+IMAGE_PATH+'/check.png" style="width: 16px; padding: 2px;">';C.setAttribute("title",mxResources.get("showResolved"));var D=!1;"dark"==uiTheme&&(C.style.filter="invert(100%)");mxEvent.addListener(C,"click",function(a){this.className=(D=!D)?"geButton geCheckedBtn":"geButton";H();a.preventDefault();mxEvent.consume(a)});A.appendChild(C);a.commentsRefreshNeeded()&&
+(C=y.cloneNode(),C.innerHTML='<img src="'+IMAGE_PATH+'/update16.png" style="width: 16px; padding: 2px;">',C.setAttribute("title",mxResources.get("refresh")),"dark"==uiTheme&&(C.style.filter="invert(100%)"),mxEvent.addListener(C,"click",function(a){H();a.preventDefault();mxEvent.consume(a)}),A.appendChild(C));a.commentsSaveNeeded()&&(y=y.cloneNode(),y.innerHTML='<img src="'+IMAGE_PATH+'/save.png" style="width: 20px; padding: 2px;">',y.setAttribute("title",mxResources.get("save")),"dark"==uiTheme&&
+(y.style.filter="invert(100%)"),mxEvent.addListener(y,"click",function(a){f();a.preventDefault();mxEvent.consume(a)}),A.appendChild(y));z.appendChild(A);var E=[],H=mxUtils.bind(this,function(){this.hasError=!1;if(null!=v)try{v.div=v.div.cloneNode(!0);var b=v.div.querySelector(".geCommentEditTxtArea"),c=v.div.querySelector(".geCommentEditBtns");v.comment.content=b.value;b.parentNode.removeChild(b);c.parentNode.removeChild(c)}catch(G){a.handleError(G)}B.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+
+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";t=a.canReplyToReplies();a.commentsSupported()?a.getComments(function(a){function b(a){if(null!=a){a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});for(var c=0;c<a.length;c++)b(a[c].replies)}}a.sort(function(a,b){return new Date(a.modifiedDate)-new Date(b.modifiedDate)});B.innerHTML="";B.appendChild(x);x.style.display="block";E=a;for(a=0;a<E.length;a++)b(E[a].replies),
+u(E[a],E,null,0,D);null!=v&&null==v.comment.id&&null==v.comment.pCommentId&&(B.appendChild(v.div),d(v.comment,v.div,v.saveCallback,v.deleteOnCancel))},mxUtils.bind(this,function(a){B.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(a&&a.message?": "+a.message:""));this.hasError=!0})):B.innerHTML=mxUtils.htmlEntities(mxResources.get("error"))});H();this.refreshComments=H;A=mxUtils.bind(this,function(){function a(b){var d=c[b.id];if(null!=d)for(g(b,d),d=0;null!=b.replies&&d<b.replies.length;d++)a(b.replies[d])}
+if(this.window.isVisible()){for(var b=B.querySelectorAll(".geCommentDate"),c={},d=0;d<b.length;d++){var e=b[d];c[e.getAttribute("data-commentId")]=e}for(d=0;d<E.length;d++)a(E[d])}});setInterval(A,6E4);this.refreshCommentsTime=A;this.window=new mxWindow(mxResources.get("comments"),z,e,c,b,k,!0,!0);this.window.minimumSize=new mxRectangle(0,0,300,200);this.window.destroyOnClose=!1;this.window.setMaximizable(!1);this.window.setResizable(!0);this.window.setClosable(!0);this.window.setVisible(!0);this.window.addListener(mxEvent.SHOW,
+mxUtils.bind(this,function(){this.window.fit()}));this.window.setLocation=function(a,b){var c=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;a=Math.max(0,Math.min(a,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));b=Math.max(0,Math.min(b,c-this.table.clientHeight-48));this.getX()==a&&this.getY()==b||mxWindow.prototype.setLocation.apply(this,arguments)};var F=mxUtils.bind(this,function(){var a=this.window.getX(),
+b=this.window.getY();this.window.setLocation(a,b)});mxEvent.addListener(window,"resize",F);this.destroy=function(){mxEvent.removeListener(window,"resize",F);this.window.destroy()}},ConfirmDialog=function(a,e,c,b,k,f,l,d,g,m,n){var p=document.createElement("div");p.style.textAlign="center";n=null!=n?n:44;var u=document.createElement("div");u.style.padding="6px";u.style.overflow="auto";u.style.maxHeight=n+"px";u.style.lineHeight="1.2em";mxClient.IS_QUIRKS&&(u.style.height="60px");mxUtils.write(u,e);
+p.appendChild(u);null!=m&&(u=document.createElement("div"),u.style.padding="6px 0 6px 0",e=document.createElement("img"),e.setAttribute("src",m),u.appendChild(e),p.appendChild(u));m=document.createElement("div");m.style.textAlign="center";m.style.whiteSpace="nowrap";var q=document.createElement("input");q.setAttribute("type","checkbox");f=mxUtils.button(f||mxResources.get("cancel"),function(){a.hideDialog();null!=b&&b(q.checked)});f.className="geBtn";null!=d&&(f.innerHTML=d+"<br>"+f.innerHTML,f.style.paddingBottom=
+"8px",f.style.paddingTop="8px",f.style.height="auto",f.style.width="40%");a.editor.cancelFirst&&m.appendChild(f);var t=mxUtils.button(k||mxResources.get("ok"),function(){a.hideDialog();null!=c&&c(q.checked)});m.appendChild(t);null!=l?(t.innerHTML=l+"<br>"+t.innerHTML+"<br>",t.style.paddingBottom="8px",t.style.paddingTop="8px",t.style.height="auto",t.className="geBtn",t.style.width="40%"):t.className="geBtn gePrimaryBtn";a.editor.cancelFirst||m.appendChild(f);p.appendChild(m);g?(m.style.marginTop=
+"10px",u=document.createElement("p"),u.style.marginTop="20px",u.appendChild(q),k=document.createElement("span"),mxUtils.write(k," "+mxResources.get("rememberThisSetting")),u.appendChild(k),p.appendChild(u),mxEvent.addListener(k,"click",function(a){q.checked=!q.checked;mxEvent.consume(a)})):m.style.marginTop="12px";this.init=function(){t.focus()};this.container=p};EditorUi.DIFF_INSERT="i";EditorUi.DIFF_REMOVE="r";EditorUi.DIFF_UPDATE="u";EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.viewStateProperties={background:!0,backgroundImage:!0,shadowVisible:!0,foldingEnabled:!0,pageScale:!0,mathEnabled:!0,pageFormat:!0,extFonts:!0};EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,mxObjectId:!0,mxTransient:!0};
EditorUi.prototype.patchPages=function(a,e,c,b,k){var f={},l=[],d={},g={},m={},n={};if(null!=b&&null!=b[EditorUi.DIFF_UPDATE])for(var p in b[EditorUi.DIFF_UPDATE])f[p]=b[EditorUi.DIFF_UPDATE][p];if(null!=e[EditorUi.DIFF_REMOVE])for(b=0;b<e[EditorUi.DIFF_REMOVE].length;b++)g[e[EditorUi.DIFF_REMOVE][b]]=!0;if(null!=e[EditorUi.DIFF_INSERT])for(b=0;b<e[EditorUi.DIFF_INSERT].length;b++)d[e[EditorUi.DIFF_INSERT][b].previous]=e[EditorUi.DIFF_INSERT][b];if(null!=e[EditorUi.DIFF_UPDATE])for(p in e[EditorUi.DIFF_UPDATE])b=
-e[EditorUi.DIFF_UPDATE][p],null!=b.previous&&(n[b.previous]=p);if(null!=a){var u="";for(b=0;b<a.length;b++){var t=a[b].getId();m[t]=a[b];null!=n[u]||g[t]||null!=e[EditorUi.DIFF_UPDATE]&&null!=e[EditorUi.DIFF_UPDATE][t]&&null!=e[EditorUi.DIFF_UPDATE][t].previous||(n[u]=t);u=t}}var q={},v=mxUtils.bind(this,function(a){var b=null!=a?a.getId():"";if(null!=a&&!q[b]){q[b]=!0;l.push(a);var g=null!=e[EditorUi.DIFF_UPDATE]?e[EditorUi.DIFF_UPDATE][b]:null;null!=g&&(this.updatePageRoot(a),null!=g.name&&a.setName(g.name),
+e[EditorUi.DIFF_UPDATE][p],null!=b.previous&&(n[b.previous]=p);if(null!=a){var u="";for(b=0;b<a.length;b++){var q=a[b].getId();m[q]=a[b];null!=n[u]||g[q]||null!=e[EditorUi.DIFF_UPDATE]&&null!=e[EditorUi.DIFF_UPDATE][q]&&null!=e[EditorUi.DIFF_UPDATE][q].previous||(n[u]=q);u=q}}var t={},v=mxUtils.bind(this,function(a){var b=null!=a?a.getId():"";if(null!=a&&!t[b]){t[b]=!0;l.push(a);var g=null!=e[EditorUi.DIFF_UPDATE]?e[EditorUi.DIFF_UPDATE][b]:null;null!=g&&(this.updatePageRoot(a),null!=g.name&&a.setName(g.name),
null!=g.view&&this.patchViewState(a,g.view),null!=g.cells&&this.patchPage(a,g.cells,f[a.getId()],k),!c||null==g.cells&&null==g.view||(a.needsUpdate=!0))}a=n[b];null!=a&&(delete n[b],v(m[a]));a=d[b];null!=a&&(delete d[b],z(a))}),z=mxUtils.bind(this,function(a){a=mxUtils.parseXml(a.data).documentElement;a=new DiagramPage(a);this.updatePageRoot(a);var b=m[a.getId()];null==b?v(a):(b.root=a.root,this.currentPage==b?this.editor.graph.model.setRoot(b.root):c&&(b.needsUpdate=!0))});v();for(p in n)v(m[n[p]]),
delete n[p];for(p in d)z(d[p]),delete d[p];return l};EditorUi.prototype.patchViewState=function(a,e){if(null!=a.viewState&&null!=e){a==this.currentPage&&(a.viewState=this.editor.graph.getViewState());for(var c in e)a.viewState[c]=JSON.parse(e[c]);a==this.currentPage&&this.editor.graph.setViewState(a.viewState,!0)}};
EditorUi.prototype.createParentLookup=function(a,e){function c(a){var c=b[a];null==c&&(c={inserted:[],moved:{}},b[a]=c);return c}var b={};if(null!=e[EditorUi.DIFF_INSERT])for(var k=0;k<e[EditorUi.DIFF_INSERT].length;k++){var f=e[EditorUi.DIFF_INSERT][k],l=null!=f.parent?f.parent:"",d=null!=f.previous?f.previous:"";c(l).inserted[d]=f}if(null!=e[EditorUi.DIFF_UPDATE])for(var g in e[EditorUi.DIFF_UPDATE])f=e[EditorUi.DIFF_UPDATE][g],null!=f.previous&&(l=f.parent,null==l&&(k=a.getCell(g),null!=k&&(k=
a.getParent(k),null!=k&&(l=k.getId()))),null!=l&&(c(l).moved[f.previous]=g));return b};
EditorUi.prototype.patchPage=function(a,e,c,b){var k=a==this.currentPage?this.editor.graph.model:new mxGraphModel(a.root),f=this.createParentLookup(k,e);k.beginUpdate();try{var l=k.updateEdgeParent,d=new mxDictionary,g=[];k.updateEdgeParent=function(a,c){!d.get(a)&&b&&(d.put(a,!0),g.push(a))};var m=f[""],n=null!=m&&null!=m.inserted?m.inserted[""]:null,p=null;null!=n&&(p=this.getCellForJson(n));if(null==p){var u=null!=m&&null!=m.moved?m.moved[""]:null;null!=u&&(p=k.getCell(u))}null!=p&&(k.setRoot(p),
-a.root=p);this.patchCellRecursive(a,k,k.root,f,e);if(null!=e[EditorUi.DIFF_REMOVE])for(var t=0;t<e[EditorUi.DIFF_REMOVE].length;t++){var q=k.getCell(e[EditorUi.DIFF_REMOVE][t]);null!=q&&k.remove(q)}if(null!=e[EditorUi.DIFF_UPDATE]){var v=null!=c&&null!=c.cells?c.cells[EditorUi.DIFF_UPDATE]:null;for(u in e[EditorUi.DIFF_UPDATE])this.patchCell(k,k.getCell(u),e[EditorUi.DIFF_UPDATE][u],null!=v?v[u]:null)}if(null!=e[EditorUi.DIFF_INSERT])for(t=0;t<e[EditorUi.DIFF_INSERT].length;t++)n=e[EditorUi.DIFF_INSERT][t],
-q=k.getCell(n.id),null!=q&&(k.setTerminal(q,k.getCell(n.source),!0),k.setTerminal(q,k.getCell(n.target),!1));k.updateEdgeParent=l;if(b&&0<g.length)for(t=0;t<g.length;t++)k.contains(g[t])&&k.updateEdgeParent(g[t])}finally{k.endUpdate()}};
+a.root=p);this.patchCellRecursive(a,k,k.root,f,e);if(null!=e[EditorUi.DIFF_REMOVE])for(var q=0;q<e[EditorUi.DIFF_REMOVE].length;q++){var t=k.getCell(e[EditorUi.DIFF_REMOVE][q]);null!=t&&k.remove(t)}if(null!=e[EditorUi.DIFF_UPDATE]){var v=null!=c&&null!=c.cells?c.cells[EditorUi.DIFF_UPDATE]:null;for(u in e[EditorUi.DIFF_UPDATE])this.patchCell(k,k.getCell(u),e[EditorUi.DIFF_UPDATE][u],null!=v?v[u]:null)}if(null!=e[EditorUi.DIFF_INSERT])for(q=0;q<e[EditorUi.DIFF_INSERT].length;q++)n=e[EditorUi.DIFF_INSERT][q],
+t=k.getCell(n.id),null!=t&&(k.setTerminal(t,k.getCell(n.source),!0),k.setTerminal(t,k.getCell(n.target),!1));k.updateEdgeParent=l;if(b&&0<g.length)for(q=0;q<g.length;q++)k.contains(g[q])&&k.updateEdgeParent(g[q])}finally{k.endUpdate()}};
EditorUi.prototype.patchCellRecursive=function(a,e,c,b,k){if(null!=c){for(var f=b[c.getId()],l=null!=f&&null!=f.inserted?f.inserted:{},f=null!=f&&null!=f.moved?f.moved:{},d=0,g=e.getChildCount(c),m="",n=0;n<g;n++){var p=e.getChildAt(c,n).getId();null==f[m]&&(null==k[EditorUi.DIFF_UPDATE]||null==k[EditorUi.DIFF_UPDATE][p]||null==k[EditorUi.DIFF_UPDATE][p].previous&&null==k[EditorUi.DIFF_UPDATE][p].parent)&&(f[m]=p);m=p}g=mxUtils.bind(this,function(f,g){var l=null!=f?f.getId():"";if(null!=f&&g){var m=
e.getCell(l);null!=m&&m!=f&&(f=null)}null!=f&&(e.getChildAt(c,d)!=f&&e.add(c,f,d),this.patchCellRecursive(a,e,f,b,k),d++);return l});for(m=[null];0<m.length;)if(n=m.shift(),n=g(null!=n?n.child:null,null!=n?n.insert:!1),p=f[n],null!=p&&(delete f[n],m.push({child:e.getCell(p)})),p=l[n],null!=p&&(delete l[n],m.push({child:this.getCellForJson(p),insert:!0})),0==m.length){for(n in f)m.push({child:e.getCell(f[n])}),delete f[n];for(n in l)m.push({child:this.getCellForJson(l[n]),insert:!0}),delete l[n]}}};
EditorUi.prototype.patchCell=function(a,e,c,b){if(null!=e&&null!=c){if(null==b||null==b.xmlValue&&(null==b.value||""==b.value))"value"in c?a.setValue(e,c.value):null!=c.xmlValue&&a.setValue(e,mxUtils.parseXml(c.xmlValue).documentElement);null!=b&&null!=b.style||null==c.style||a.setStyle(e,c.style);null!=c.visible&&a.setVisible(e,1==c.visible);null!=c.collapsed&&a.setCollapsed(e,1==c.collapsed);null!=c.vertex&&(e.vertex=1==c.vertex);null!=c.edge&&(e.edge=1==c.edge);null!=c.connectable&&(e.connectable=
@@ -9524,20 +9524,23 @@ DrawioFileSync.prototype.fileChangedNotify=function(){if(this.isValidState())if(
DrawioFileSync.prototype.fileChanged=function(a,e,c,b){return this.notifyThread=b=window.setTimeout(mxUtils.bind(this,function(){null!=c&&c()||(this.isValidState()?this.file.loadPatchDescriptor(mxUtils.bind(this,function(b){null!=c&&c()||(this.isValidState()?this.catchup(b,a,e,c):null!=e&&e())}),e):null!=e&&e())}),b?this.cacheReadyDelay:0)};
DrawioFileSync.prototype.reloadDescriptor=function(){this.file.loadDescriptor(mxUtils.bind(this,function(a){null!=a?(this.file.setDescriptorRevisionId(a,this.file.getCurrentRevisionId()),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,e,c,b){if(null!=a&&(null==b||!b())){var k=this.file.getDescriptorRevisionId(a),f=this.file.getCurrentRevisionId();if(f==k)this.file.patchDescriptor(this.file.getDescriptor(),a),null!=e&&e();else if(this.isValidState()){var l=this.file.getDescriptorSecret(a),d=0,g=!1,m=mxUtils.bind(this,function(){if(null==b||!b())if(f!=this.file.getCurrentRevisionId())null!=e&&e();else if(this.isValidState()){var n=!0,p=window.setTimeout(mxUtils.bind(this,function(){n=!1;
-this.reload(e,c,b)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(f)+"&to="+encodeURIComponent(k)+(null!=l?"&secret="+encodeURIComponent(l):""),mxUtils.bind(this,function(k){this.file.stats.bytesReceived+=k.getText().length;window.clearTimeout(p);if(n&&(null==b||!b()))if(f!=this.file.getCurrentRevisionId())null!=e&&e();else if(this.isValidState()){var l=null,u=[];if(200<=k.getStatus()&&299>=k.getStatus()&&0<k.getText().length)try{var v=
-JSON.parse(k.getText());if(null!=v&&0<v.length)for(var z=0;z<v.length;z++){var y=this.stringToObject(v[z]);if(y.v>DrawioFileSync.PROTOCOL){g=!0;u=[];break}else if(y.v===DrawioFileSync.PROTOCOL&&null!=y.d)l=y.d.checksum,u.push(y.d.patch);else{g=!0;u=[];break}}}catch(A){u=[],null!=window.console&&"1"==urlParams.test&&console.log(A)}try{0<u.length?(this.file.stats.cacheHits++,this.merge(u,l,a,e,c,b)):d<=this.maxCacheReadyRetries-1&&!g&&401!=k.getStatus()?(d++,this.file.stats.cacheMiss++,window.setTimeout(m,
-(d+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(e,c,b))}catch(A){null!=c&&c(A)}}else null!=c&&c()}))}else null!=c&&c()});window.setTimeout(m,this.cacheReadyDelay)}else null!=c&&c()}};DrawioFileSync.prototype.reload=function(a,e,c,b){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!=e&&e(a)}),c,b)};
+DrawioFileSync.prototype.catchup=function(a,e,c,b){if(null!=a&&(null==b||!b())){var k=this.file.getDescriptorRevisionId(a),f=this.file.getCurrentRevisionId();if(f==k)this.file.patchDescriptor(this.file.getDescriptor(),a),null!=e&&e();else if(this.isValidState()){var l=this.file.getDescriptorSecret(a);if(null==l)this.reload(e,c,b);else{var d=0,g=!1,m=mxUtils.bind(this,function(){if(null==b||!b())if(f!=this.file.getCurrentRevisionId())null!=e&&e();else if(this.isValidState()){var n=!0,p=window.setTimeout(mxUtils.bind(this,
+function(){n=!1;this.reload(e,c,b)}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&from="+encodeURIComponent(f)+"&to="+encodeURIComponent(k)+(null!=l?"&secret="+encodeURIComponent(l):""),mxUtils.bind(this,function(k){this.file.stats.bytesReceived+=k.getText().length;window.clearTimeout(p);if(n&&(null==b||!b()))if(f!=this.file.getCurrentRevisionId())null!=e&&e();else if(this.isValidState()){var l=null,u=[];if(200<=k.getStatus()&&299>=k.getStatus()&&0<k.getText().length)try{var v=
+JSON.parse(k.getText());if(null!=v&&0<v.length)for(var z=0;z<v.length;z++){var y=this.stringToObject(v[z]);if(y.v>DrawioFileSync.PROTOCOL){g=!0;u=[];break}else if(y.v===DrawioFileSync.PROTOCOL&&null!=y.d)l=y.d.checksum,u.push(y.d.patch);else{g=!0;u=[];break}}}catch(B){u=[],null!=window.console&&"1"==urlParams.test&&console.log(B)}try{0<u.length?(this.file.stats.cacheHits++,this.merge(u,l,a,e,c,b)):d<=this.maxCacheReadyRetries-1&&!g&&401!=k.getStatus()?(d++,this.file.stats.cacheMiss++,window.setTimeout(m,
+(d+1)*this.cacheReadyDelay)):(this.file.stats.cacheFail++,this.reload(e,c,b))}catch(B){null!=c&&c(B)}}else null!=c&&c()}))}else null!=c&&c()});window.setTimeout(m,this.cacheReadyDelay)}}else null!=c&&c()}};DrawioFileSync.prototype.reload=function(a,e,c,b){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!=e&&e(a)}),c,b)};
DrawioFileSync.prototype.merge=function(a,e,c,b,k,f){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),d=this.file.getDescriptorRevisionId(c);if(!l){for(f=0;f<a.length;f++)this.file.shadowPages=this.ui.patchPages(this.file.shadowPages,
a[f]);var g=null!=e?this.ui.getHashValueForPages(this.file.shadowPages):null;"1"==urlParams.test&&EditorUi.debug("Sync.merge",[this],"from",this.file.getCurrentRevisionId(),"to",d,"etag",this.file.getDescriptorEtag(c),"backup",this.file.backupPatch,"attempt",this.catchupRetryCount,"patches",a,"checksum",e==g,e);if(null!=e&&e!=g){var m=this.ui.hashValue(this.file.getCurrentRevisionId()),n=this.ui.hashValue(d);this.file.checksumError(k,a,"From: "+m+"\nTo: "+n+"\nChecksum: "+e+"\nCurrent: "+g,d,"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(),c);this.file.backupPatch=null;null!=b&&b()}catch(t){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=k&&k(t);try{if(this.file.errorReportsEnabled)m=this.ui.hashValue(this.file.getCurrentRevisionId()),n=this.ui.hashValue(d),this.file.sendErrorReport("Error in merge",
-"From: "+m+"\nTo: "+n+"\nChecksum: "+e+"\nPatches:\n"+this.file.compressReportData(JSON.stringify(a,null,2)),t);else{var p=this.file.getCurrentUser(),u=null!=p?p.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),u,t)}}catch(q){}}};
+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(),c);this.file.backupPatch=null;null!=b&&b()}catch(q){this.file.inConflictState=!0;this.file.invalidChecksum=!0;this.file.descriptorChanged();null!=k&&k(q);try{if(this.file.errorReportsEnabled)m=this.ui.hashValue(this.file.getCurrentRevisionId()),n=this.ui.hashValue(d),this.file.sendErrorReport("Error in merge",
+"From: "+m+"\nTo: "+n+"\nChecksum: "+e+"\nPatches:\n"+this.file.compressReportData(JSON.stringify(a,null,2)),q);else{var p=this.file.getCurrentUser(),u=null!=p?p.id:"unknown";EditorUi.logError("Error in merge",null,this.file.getMode()+"."+this.file.getId(),u,q)}}catch(t){}}};
DrawioFileSync.prototype.descriptorChanged=function(a){this.lastModified=this.file.getLastModifiedDate();if(null!=this.channelId){var e=this.objectToString(this.createMessage({a:"desc",m:this.lastModified.getTime()})),c=this.file.getCurrentRevisionId(),b=this.objectToString({});mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(a)+"&to="+encodeURIComponent(c)+"&msg="+encodeURIComponent(e)+"&data="+encodeURIComponent(b));this.file.stats.bytesSent+=b.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,e,c,b){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 k=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement);b=this.ui.getHashValueForPages(a);k=this.ui.diffPages(k,a);e=this.file.getDescriptorRevisionId(e);
-var f=this.file.getCurrentRevisionId(),l=this.objectToString(this.createMessage({patch:k,checksum:b})),d=this.objectToString(this.createMessage({m:this.lastModified.getTime()})),g=this.file.getDescriptorSecret(this.file.getDescriptor());this.file.stats.bytesSent+=l.length;this.file.stats.msgSent++;mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(e)+"&to="+encodeURIComponent(f)+"&msg="+encodeURIComponent(d)+(null!=g?"&secret="+encodeURIComponent(g):"")+(l.length<this.maxCacheEntrySize?
-"&data="+encodeURIComponent(l):""),mxUtils.bind(this,function(a){}));"1"==urlParams.test&&EditorUi.debug("Sync.fileSaved",[this],"from",e,"to",f,"etag",this.file.getCurrentEtag(),l.length,"bytes","diff",k,"checksum",b)}this.file.shadowPages=a;null!=c&&c()};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,e,c){this.catchupRetryCount++;this.catchupRetryCount<this.maxCatchupRetries?(this.file.stats.conflicts++,null!=a?this.catchup(a,e,c):this.fileChanged(e,c)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=c&&c({message:mxResources.get("timeout")}))};
+DrawioFileSync.prototype.createToken=function(a,e,c){var b=!0,k=window.setTimeout(mxUtils.bind(this,function(){b=!1;c({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.get(EditorUi.cacheUrl+"?id="+encodeURIComponent(this.channelId)+"&secret="+encodeURIComponent(a),mxUtils.bind(this,function(a){window.clearTimeout(k);b&&(200<=a.getStatus()&&299>=a.getStatus()?e(a.getText()):c({code:a.getStatus(),message:"Token Error "+a.getStatus()}))}))};
+DrawioFileSync.prototype.fileSaved=function(a,e,c,b,k){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 f=this.objectToString(this.createMessage({m:this.lastModified.getTime()})),l=this.file.getDescriptorSecret(this.file.getDescriptor());e=this.file.getDescriptorRevisionId(e);var d=this.file.getCurrentRevisionId();
+if(null==l)this.file.stats.msgSent++,mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&msg="+encodeURIComponent(f),function(){}),null!=c&&c(),"1"==urlParams.test&&EditorUi.debug("Sync.fileSaved",[this],"from",e,"to",d,"etag",this.file.getCurrentEtag(),"notify");else{var g=null!=this.file.shadowPages?this.file.shadowPages:this.ui.getPagesForNode(mxUtils.parseXml(this.file.shadowData).documentElement),m=this.ui.getHashValueForPages(a),g=this.ui.diffPages(g,a),n=this.objectToString(this.createMessage({patch:g,
+checksum:m}));this.file.stats.bytesSent+=n.length;this.file.stats.msgSent++;var p=!0,u=window.setTimeout(mxUtils.bind(this,function(){p=!1;b({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&from="+encodeURIComponent(e)+"&to="+encodeURIComponent(d)+"&msg="+encodeURIComponent(f)+(null!=l?"&secret="+encodeURIComponent(l):"")+(n.length<this.maxCacheEntrySize?"&data="+encodeURIComponent(n):"")+(null!=k?"&token="+encodeURIComponent(k):
+""),mxUtils.bind(this,function(a){window.clearTimeout(u);p&&(200<=a.getStatus()&&299>=a.getStatus()?null!=c&&c():b({code:a.getStatus(),message:a.getStatus()}))}));"1"==urlParams.test&&EditorUi.debug("Sync.fileSaved",[this],"from",e,"to",d,"etag",this.file.getCurrentEtag(),n.length,"bytes","diff",g,"checksum",m)}}this.file.shadowPages=a};
+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,e,c){this.catchupRetryCount++;this.catchupRetryCount<this.maxCatchupRetries?(this.file.stats.conflicts++,null!=a?this.catchup(a,e,c):this.fileChanged(e,c)):(this.file.stats.timeouts++,this.catchupRetryCount=0,null!=c&&c({code:App.ERROR_TIMEOUT,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(),e={a:"leave"};null!=a&&(e.name=encodeURIComponent(a.displayName),e.uid=a.id);mxUtils.post(EditorUi.cacheUrl,this.getIdParameters()+"&msg="+encodeURIComponent(this.objectToString(this.createMessage(e))));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,
@@ -9576,10 +9579,10 @@ c.toUTCString(),localStorage.setItem("."+this.cookieName,e)))}return e};DrawioCl
DriveFile.prototype.isConflict=function(a){return null!=a&&null!=a.error&&412==a.error.code};DriveFile.prototype.getCurrentUser=function(){return null!=this.ui.drive?this.ui.drive.user:null};DriveFile.prototype.getMode=function(){return App.MODE_GOOGLE};
DriveFile.prototype.getPublicUrl=function(a){this.ui.drive.executeRequest({url:"/files/"+this.desc.id+"/permissions?supportsAllDrives=true"},mxUtils.bind(this,function(e){if(null!=e&&null!=e.items)for(var c=0;c<e.items.length;c++)if("anyoneWithLink"===e.items[c].id||"anyone"===e.items[c].id){a(this.desc.webContentLink);return}a(null)}),mxUtils.bind(this,function(){a(null)}))};DriveFile.prototype.isAutosaveOptional=function(){return!0};
DriveFile.prototype.isRenamable=function(){return this.isEditable()&&DrawioFile.prototype.isEditable.apply(this,arguments)};DriveFile.prototype.isMovable=function(){return this.isEditable()};DriveFile.prototype.isTrashed=function(){return this.desc.labels.trashed};DriveFile.prototype.save=function(a,e,c,b,k){DrawioFile.prototype.save.apply(this,[a,mxUtils.bind(this,function(){this.saveFile(null,a,e,c,b,k)}),c,b,k])};
-DriveFile.prototype.saveFile=function(a,e,c,b,k,f){try{if(!this.isEditable())null!=c&&c();else if(!this.savingFile){var l=mxUtils.bind(this,function(a,f){var d=null,g=null;try{d=this.isModified;g=this.isModified();this.setModified(!1);this.savingFileTime=new Date;this.savingFile=!0;this.isModified=function(){return!0};var p=this.desc;this.ui.drive.saveFile(this,f,mxUtils.bind(this,function(a,f){try{this.savingFile=!1,this.isModified=d,0!=a?(e&&(this.lastAutosaveRevision=(new Date).getTime()),this.autosaveDelay=
-Math.min(8E3,Math.max(this.saveDelay+500,DriveFile.prototype.autosaveDelay)),this.desc=a,this.fileSaved(f,p,mxUtils.bind(this,function(){this.contentChanged();null!=c&&c(a)}),b)):(this.setModified(g||this.isModified()),null!=b&&b(a))}catch(q){if(this.setModified(g||this.isModified()),null!=b)b(q);else throw q;}}),mxUtils.bind(this,function(c,e){try{this.savingFile=!1,this.isModified=d,this.setModified(g||this.isModified()),this.isConflict(c)?(this.inConflictState=!0,null!=this.sync?(this.savingFile=
-!0,this.savingFileTime=new Date,this.sync.fileConflict(e,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();l(a,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}))):null!=b&&b()):null!=b&&b(c)}catch(q){if(this.setModified(g||this.isModified()),null!=b)b(q);else throw q;}}),k,k,a)}catch(u){if(this.savingFile=!1,null!=d&&(this.isModified=d),null!=g&&this.setModified(g||this.isModified()),null!=b)b(u);else throw u;
-}});l(f,e)}}catch(d){if(null!=b)b(d);else throw d;}};DriveFile.prototype.copyFile=function(a,e){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,a,e)}catch(c){e(c)}}),e,!0)};
+DriveFile.prototype.saveFile=function(a,e,c,b,k,f){try{this.isEditable()?this.savingFile||(this.savingFile=!0,this.createSecret(mxUtils.bind(this,function(a,d){var g=mxUtils.bind(this,function(f,l){var m=null,n=null;try{m=this.isModified;n=this.isModified();this.setModified(!1);this.savingFileTime=new Date;this.isModified=function(){return!0};var q=this.desc;this.ui.drive.saveFile(this,l,mxUtils.bind(this,function(a,f){try{this.savingFile=!1,this.isModified=m,0!=a?(e&&(this.lastAutosaveRevision=(new Date).getTime()),
+this.autosaveDelay=Math.min(8E3,Math.max(this.saveDelay+500,DriveFile.prototype.autosaveDelay)),this.desc=a,this.fileSaved(f,q,mxUtils.bind(this,function(){this.contentChanged();null!=c&&c(a)}),b,d)):(this.setModified(n||this.isModified()),null!=b&&b(a))}catch(z){if(this.setModified(n||this.isModified()),null!=b)b(z);else throw z;}}),mxUtils.bind(this,function(a,c){try{this.savingFile=!1,this.isModified=m,this.setModified(n||this.isModified()),this.isConflict(a)?(this.inConflictState=!0,null!=this.sync?
+(this.savingFile=!0,this.savingFileTime=new Date,this.sync.fileConflict(c,mxUtils.bind(this,function(){window.setTimeout(mxUtils.bind(this,function(){this.updateFileData();g(f,!0)}),100+500*Math.random())}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}))):null!=b&&b()):null!=b&&b(a)}catch(z){if(this.setModified(n||this.isModified()),null!=b)b(z);else throw z;}}),k,k,f,null,a)}catch(t){if(this.savingFile=!1,null!=m&&(this.isModified=m),null!=n&&this.setModified(n||this.isModified()),
+null!=b)b(t);else throw t;}});g(f,e)}),mxUtils.bind(this,function(a){this.savingFile=!1;if(null!=b)b(a);else throw a;}))):null!=c&&c()}catch(l){if(null!=b)b(l);else throw l;}};DriveFile.prototype.copyFile=function(a,e){this.isRestricted()?DrawioFile.prototype.copyFile.apply(this,arguments):this.makeCopy(mxUtils.bind(this,function(){if(this.ui.spinner.spin(document.body,mxResources.get("saving")))try{this.save(!0,a,e)}catch(c){e(c)}}),e,!0)};
DriveFile.prototype.makeCopy=function(a,e,c){this.ui.spinner.spin(document.body,mxResources.get("saving"))&&this.saveAs(this.ui.getCopyFilename(this,c),mxUtils.bind(this,function(b){this.desc=b;this.ui.spinner.stop();this.setModified(!1);this.backupPatch=null;this.inConflictState=this.invalidChecksum=!1;this.descriptorChanged();a()}),mxUtils.bind(this,function(){this.ui.spinner.stop();null!=e&&e()}))};DriveFile.prototype.saveAs=function(a,e,c){this.ui.drive.copyFile(this.getId(),a,e,c)};
DriveFile.prototype.rename=function(a,e,c){var b=this.getCurrentEtag();this.ui.drive.renameFile(this.getId(),a,mxUtils.bind(this,function(k){this.hasSameExtension(a,this.getTitle())?(this.desc=k,this.descriptorChanged(),null!=this.sync&&this.sync.descriptorChanged(b),null!=e&&e(k)):(this.desc=k,null!=this.sync&&this.sync.descriptorChanged(b),this.save(!0,e,c))}),c)};
DriveFile.prototype.move=function(a,e,c){this.ui.drive.moveFile(this.getId(),a,mxUtils.bind(this,function(a){this.desc=a;this.descriptorChanged();null!=e&&e(a)}),c)};DriveFile.prototype.getTitle=function(){return this.desc.title};DriveFile.prototype.getHash=function(){return"G"+this.getId()};DriveFile.prototype.getId=function(){return this.desc.id};DriveFile.prototype.isEditable=function(){return DrawioFile.prototype.isEditable.apply(this,arguments)&&this.desc.editable};
@@ -9620,25 +9623,26 @@ DriveClient.prototype.getLibrary=function(a,e,c){return this.getFile(a,e,c,!0,!0
DriveClient.prototype.getFile=function(a,e,c,b,k){b=null!=b?b:!1;k=null!=k?k:!1;null!=urlParams.rev?this.executeRequest({url:"/files/"+a+"/revisions/"+urlParams.rev+"?supportsAllDrives=true"},mxUtils.bind(this,function(b){b.title=b.originalFilename;b.headRevisionId=b.id;b.id=a;this.getXmlFile(b,e,c)}),c):this.loadDescriptor(a,mxUtils.bind(this,function(a){try{if(null!=this.user){var f=/\.png$/i.test(a.title);/\.v(dx|sdx?)$/i.test(a.title)||/\.gliffy$/i.test(a.title)||!this.ui.useCanvasForExport&&
f?this.ui.convertFile(a.downloadUrl,a.title,a.mimeType,this.extension,e,c,null,{Authorization:"Bearer "+this.token}):b||k||a.mimeType==this.libraryMimeType||a.mimeType==this.xmlMimeType?this.getXmlFile(a,e,c,!0,k):this.getXmlFile(a,e,c)}else c({message:mxResources.get("loggedOut")})}catch(d){if(null!=c)c(d);else throw d;}}),c)};DriveClient.prototype.isGoogleRealtimeMimeType=function(a){return null!=a&&"application/vnd.jgraph.mxfile."==a.substring(0,30)};
DriveClient.prototype.getXmlFile=function(a,e,c,b,k){try{var f={Authorization:"Bearer "+this.token},l=a.downloadUrl;this.ui.editor.loadUrl(l,mxUtils.bind(this,function(b){try{if(null==b)c({message:mxResources.get("invalidOrMissingFile")});else if(a.mimeType==this.libraryMimeType||k)a.mimeType!=this.libraryMimeType||k?e(new DriveLibrary(this.ui,b,a)):c({message:mxResources.get("notADiagramFile")});else{var d=!1;if(/\.png$/i.test(a.title)){var f=b.lastIndexOf(",");if(0<f){var n=this.ui.extractGraphModelFromPng(b.substring(f+
-1));if(null!=n&&0<n.length)b=n;else try{var n=b.substring(f+1),p=!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(n):atob(n),u=this.ui.editor.extractGraphModel(mxUtils.parseXml(p).documentElement,!0);null==u||0<u.getElementsByTagName("parsererror").length?d=!0:b=p}catch(t){d=!0}}}else/\.pdf$/i.test(a.title)?(n=Editor.extractGraphModelFromPdf(b),null!=n&&0<n.length&&(d=!0,b=n)):"data:image/png;base64,PG14ZmlsZS"==b.substring(0,32)&&(p=b.substring(22),b=window.atob&&!mxClient.IS_SF?atob(p):
-Base64.decode(p));Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(b,l)?this.ui.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(b){try{4==b.readyState&&(200<=b.status&&299>=b.status?e(new LocalFile(this.ui,b.responseText,a.title+this.extension,!0)):null!=c&&c({message:mxResources.get("errorLoadingFile")}))}catch(q){if(null!=c)c(q);else throw q;}}),a.title):e(d?new LocalFile(this.ui,b,a.title,!0):new DriveFile(this.ui,b,a))}}catch(t){if(null!=
-c)c(t);else throw t;}}),c,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)||/\.pdf$/i.test(a.title),null,null,null,f)}catch(d){if(null!=c)c(d);else throw d;}};
-DriveClient.prototype.saveFile=function(a,e,c,b,k,f,l,d){try{var g=0;a.saveLevel=1;var m=mxUtils.bind(this,function(c){if(null!=b)b(c);else throw c;try{if(!a.isConflict(c)){var d="sl_"+a.saveLevel+"-error_"+(a.getErrorMessage(c)||"unknown");null!=c&&null!=c.error&&null!=c.error.code&&(d+="-code_"+c.error.code);EditorUi.logEvent({category:"ERROR-SAVE-FILE-"+a.getHash()+"-rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?"":
-"-nosave")+(a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),action:d,label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}}catch(D){}}),n=mxUtils.bind(this,function(b){m(b);try{EditorUi.logError(b.message,null,null,b),EditorUi.sendReport("Critical error in DriveClient.saveFile "+(new Date).toISOString()+":\n\nUserAgent="+navigator.userAgent+"\nAppVersion="+
-navigator.appVersion+"\nAppName="+navigator.appName+"\nPlatform="+navigator.platform+"\nFile="+a.desc.id+"."+a.desc.headRevisionId+"\nMime="+a.desc.mimeType+"\nUser="+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")+"\nSaveLevel="+a.saveLevel+"\nSaveAsPng="+(this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle()))+"\nRetryCount="+g+"\nError="+b+"\nMessage="+b.message+"\n\nStack:\n"+b.stack)}catch(C){}});if(a.isEditable()&&null!=a.desc){var p=(new Date).getTime(),
-u=a.desc.etag,t=a.desc.modifiedDate,q=a.desc.headRevisionId,v=this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());f=null!=f?f:!1;var z=null,y=!1,A={mimeType:a.desc.mimeType,title:a.getTitle()};if(this.isGoogleRealtimeMimeType(A.mimeType))A.mimeType=this.xmlMimeType,z=a.desc,y=e=!0;else if("application/octet-stream"==A.mimeType||"1"==urlParams["override-mime"]&&A.mimeType!=this.xmlMimeType)A.mimeType=this.xmlMimeType;var x=mxUtils.bind(this,function(b,k,x){try{a.saveLevel=3;a.constructor==DriveFile&&
-(null==d&&(d=[]),null==a.getChannelId()&&d.push({key:"channel",value:Editor.guid(32)}),null==a.getChannelKey()&&d.push({key:"key",value:Editor.guid(32)}),d.push({key:"secret",value:Editor.guid(32)}));x||(null!=b||f||(b=this.placeholderThumbnail,k=this.placeholderMimeType),null!=b&&null!=k&&(A.thumbnail={image:b,mimeType:k}));var B=a.getData(),C=mxUtils.bind(this,function(b){try{if(a.saveDelay=(new Date).getTime()-p,a.saveLevel=11,null==b)m({message:mxResources.get("errorSavingFile")+": Empty response"});
-else{var d=(new Date(b.modifiedDate)).getTime()-(new Date(t)).getTime();if(0>=d||u==b.etag||e&&q==b.headRevisionId){a.saveLevel=12;var f=[];0>=d&&f.push("invalid modified time");u==b.etag&&f.push("stale etag");e&&q==b.headRevisionId&&f.push("stale revision");var g=f.join(", ");m({message:mxResources.get("errorSavingFile")+": "+g},b);try{EditorUi.logError("Critical: Error saving to Google Drive "+a.desc.id,null,"from-"+q+"."+t+"-"+this.ui.hashValue(u)+"-to-"+b.headRevisionId+"."+b.modifiedDate+"-"+
-this.ui.hashValue(b.etag)+(0<g.length?"-errors-"+g:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync"))}catch(I){}}else if(a.saveLevel=null,c(b,B),null!=z){this.executeRequest({url:"/files/"+z.id+"/revisions/"+z.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest({url:"/files/"+z.id+"/revisions/"+z.headRevisionId,method:"PUT",params:a})})));try{EditorUi.logEvent({category:a.convertedFrom+
-"-CONVERT-FILE-"+a.getHash(),action:"from_"+z.id+"."+z.headRevisionId+"-to_"+a.desc.id+"."+a.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=a.sync?"-client_"+a.sync.clientId:"nosync")})}catch(I){}}}}catch(I){n(I)}}),D=mxUtils.bind(this,function(c,f){a.saveLevel=4;try{null!=d&&(A.properties=d);var k=l||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),x=mxUtils.bind(this,function(b){a.saveLevel=5;try{var d=a.desc.mimeType!=
-this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType,l=!0,x=null;try{x=window.setTimeout(mxUtils.bind(this,function(){l=!1;m({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),3*this.ui.timeout)}catch(S){}this.executeRequest(this.createUploadRequest(a.getId(),A,c,e||b||d,f,b?null:k,y),mxUtils.bind(this,function(a){window.clearTimeout(x);l&&C(a)}),mxUtils.bind(this,function(b){window.clearTimeout(x);if(l){a.saveLevel=6;try{a.isConflict(b)?this.executeRequest({url:"/files/"+
-a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(c){a.saveLevel=7;try{if(null!=c&&c.etag==k)if(g<this.staleEtagMaxRetries){g++;var d=2*g*this.coolOff*(1+.1*(Math.random()-.5));window.setTimeout(p,d);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",g,"delay",d)}else{p(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+a.getHash(),action:"rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+
-a.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}catch(Z){}}else"1"==urlParams.test&&c.headRevisionId==q&&EditorUi.debug("DriveClient: Remote Etag Changed","local",k,"remote",c.etag,"rev",a.desc.headRevisionId,"response",[c],"file",[a]),m(b,c)}catch(Z){n(Z)}}),
-mxUtils.bind(this,function(){m(b)})):m(b)}catch(V){n(V)}}}))}catch(S){n(S)}}),p=mxUtils.bind(this,function(b){a.saveLevel=9;if(b)x(b);else{var c=!0,d=null;try{d=window.setTimeout(mxUtils.bind(this,function(){c=!1;m({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),3*this.ui.timeout)}catch(W){}this.executeRequest({url:"/files/"+a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(e){window.clearTimeout(d);if(c){a.saveLevel=10;try{null!=e&&e.headRevisionId==
-q?("1"==urlParams.test&&k!=e.etag&&EditorUi.debug("DriveClient: Preflight Etag Update","from",k,"to",e.etag,"rev",a.desc.headRevisionId,"response",[e],"file",[a]),k=e.etag,x(b)):m({error:{code:412}},e)}catch(S){n(S)}}}),mxUtils.bind(this,function(b){window.clearTimeout(d);c&&(a.saveLevel=11,m(b))}))}});if(v&&null==b){a.saveLevel=8;var B=new Image;B.onload=mxUtils.bind(this,function(){try{var a=this.thumbnailWidth/B.width,b=document.createElement("canvas");b.width=this.thumbnailWidth;b.height=Math.floor(B.height*
-a);b.getContext("2d").drawImage(B,0,0,b.width,b.height);var c=b.toDataURL(),c=c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");A.thumbnail={image:c,mimeType:"image/png"};p(!1)}catch(W){try{p(!1)}catch(S){n(S)}}});B.src="data:image/png;base64,"+c}else p(!1)}catch(T){n(T)}});if(v){var J=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){D(a,!0)}),m,this.ui.getCurrentFile()!=a?B:null,J.scale,J.border)}else D(B,!1)}catch(K){n(K)}});try{a.saveLevel=
-2,(f||v||a.constructor==DriveLibrary||!this.enableThumbnails||"0"==urlParams.thumb||null!=A.mimeType&&"application/vnd.jgraph.mxfile"!=A.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(a){try{var b=null;try{null!=a&&(b=a.toDataURL("image/png")),null!=b&&(b=b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(D){b=null}x(b,"image/png")}catch(D){n(D)}})))&&x(null,null,a.constructor!=DriveLibrary)}catch(B){n(B)}}else this.ui.editor.graph.reset(),
-m({message:mxResources.get("readOnly")})}catch(B){n(B)}};DriveClient.prototype.insertFile=function(a,e,c,b,k,f,l){f=null!=f?f:this.xmlMimeType;a={mimeType:f,title:a};null!=c&&(a.parents=[{kind:"drive#fileLink",id:c}]);this.executeRequest(this.createUploadRequest(null,a,e,!1,l),mxUtils.bind(this,function(a){f==this.libraryMimeType?b(new DriveLibrary(this.ui,e,a)):0==a?null!=k&&k({message:mxResources.get("errorSavingFile")}):b(new DriveFile(this.ui,e,a))}),k)};
+1));if(null!=n&&0<n.length)b=n;else try{var n=b.substring(f+1),p=!window.atob||mxClient.IS_IE||mxClient.IS_IE11?Base64.decode(n):atob(n),u=this.ui.editor.extractGraphModel(mxUtils.parseXml(p).documentElement,!0);null==u||0<u.getElementsByTagName("parsererror").length?d=!0:b=p}catch(q){d=!0}}}else/\.pdf$/i.test(a.title)?(n=Editor.extractGraphModelFromPdf(b),null!=n&&0<n.length&&(d=!0,b=n)):"data:image/png;base64,PG14ZmlsZS"==b.substring(0,32)&&(p=b.substring(22),b=window.atob&&!mxClient.IS_SF?atob(p):
+Base64.decode(p));Graph.fileSupport&&(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(b,l)?this.ui.parseFile(new Blob([b],{type:"application/octet-stream"}),mxUtils.bind(this,function(b){try{4==b.readyState&&(200<=b.status&&299>=b.status?e(new LocalFile(this.ui,b.responseText,a.title+this.extension,!0)):null!=c&&c({message:mxResources.get("errorLoadingFile")}))}catch(t){if(null!=c)c(t);else throw t;}}),a.title):e(d?new LocalFile(this.ui,b,a.title,!0):new DriveFile(this.ui,b,a))}}catch(q){if(null!=
+c)c(q);else throw q;}}),c,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)||/\.pdf$/i.test(a.title),null,null,null,f)}catch(d){if(null!=c)c(d);else throw d;}};
+DriveClient.prototype.saveFile=function(a,e,c,b,k,f,l,d,g){try{var m=0;a.saveLevel=1;var n=mxUtils.bind(this,function(c){if(null!=b)b(c);else throw c;try{if(!a.isConflict(c)){var d="sl_"+a.saveLevel+"-error_"+(a.getErrorMessage(c)||"unknown");null!=c&&null!=c.error&&null!=c.error.code&&(d+="-code_"+c.error.code);EditorUi.logEvent({category:"ERROR-SAVE-FILE-"+a.getHash()+"-rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+a.desc.mimeType+(this.ui.editor.autosave?
+"":"-nosave")+(a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),action:d,label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}}catch(E){}}),p=mxUtils.bind(this,function(b){n(b);try{EditorUi.logError(b.message,null,null,b),EditorUi.sendReport("Critical error in DriveClient.saveFile "+(new Date).toISOString()+":\n\nUserAgent="+navigator.userAgent+"\nAppVersion="+
+navigator.appVersion+"\nAppName="+navigator.appName+"\nPlatform="+navigator.platform+"\nFile="+a.desc.id+"."+a.desc.headRevisionId+"\nMime="+a.desc.mimeType+"\nUser="+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")+"\nSaveLevel="+a.saveLevel+"\nSaveAsPng="+(this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle()))+"\nRetryCount="+m+"\nError="+b+"\nMessage="+b.message+"\n\nStack:\n"+b.stack)}catch(D){}});if(a.isEditable()&&null!=a.desc){var u=(new Date).getTime(),
+q=a.desc.etag,t=a.desc.modifiedDate,v=a.desc.headRevisionId,z=this.ui.useCanvasForExport&&/(\.png)$/i.test(a.getTitle());f=null!=f?f:!1;var y=null,B=!1,x={mimeType:a.desc.mimeType,title:a.getTitle()};if(this.isGoogleRealtimeMimeType(x.mimeType))x.mimeType=this.xmlMimeType,y=a.desc,B=e=!0;else if("application/octet-stream"==x.mimeType||"1"==urlParams["override-mime"]&&x.mimeType!=this.xmlMimeType)x.mimeType=this.xmlMimeType;var A=mxUtils.bind(this,function(b,k,A){try{a.saveLevel=3;a.constructor==DriveFile&&
+(null==d&&(d=[]),null==a.getChannelId()&&d.push({key:"channel",value:Editor.guid(32)}),null==a.getChannelKey()&&d.push({key:"key",value:Editor.guid(32)}),d.push({key:"secret",value:null!=g?g:Editor.guid(32)}));A||(null!=b||f||(b=this.placeholderThumbnail,k=this.placeholderMimeType),null!=b&&null!=k&&(x.thumbnail={image:b,mimeType:k}));var C=a.getData(),D=mxUtils.bind(this,function(b){try{if(a.saveDelay=(new Date).getTime()-u,a.saveLevel=11,null==b)n({message:mxResources.get("errorSavingFile")+": Empty response"});
+else{var d=(new Date(b.modifiedDate)).getTime()-(new Date(t)).getTime();if(0>=d||q==b.etag||e&&v==b.headRevisionId){a.saveLevel=12;var f=[];0>=d&&f.push("invalid modified time");q==b.etag&&f.push("stale etag");e&&v==b.headRevisionId&&f.push("stale revision");var g=f.join(", ");n({message:mxResources.get("errorSavingFile")+": "+g},b);try{EditorUi.logError("Critical: Error saving to Google Drive "+a.desc.id,null,"from-"+v+"."+t+"-"+this.ui.hashValue(q)+"-to-"+b.headRevisionId+"."+b.modifiedDate+"-"+
+this.ui.hashValue(b.etag)+(0<g.length?"-errors-"+g:""),"user-"+(null!=this.user?this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync"))}catch(T){}}else if(a.saveLevel=null,c(b,C),null!=y){this.executeRequest({url:"/files/"+y.id+"/revisions/"+y.headRevisionId+"?supportsAllDrives=true"},mxUtils.bind(this,mxUtils.bind(this,function(a){a.pinned=!0;this.executeRequest({url:"/files/"+y.id+"/revisions/"+y.headRevisionId,method:"PUT",params:a})})));try{EditorUi.logEvent({category:a.convertedFrom+
+"-CONVERT-FILE-"+a.getHash(),action:"from_"+y.id+"."+y.headRevisionId+"-to_"+a.desc.id+"."+a.desc.headRevisionId,label:null!=this.user?"user_"+this.user.id:"nouser"+(null!=a.sync?"-client_"+a.sync.clientId:"nosync")})}catch(T){}}}}catch(T){p(T)}}),E=mxUtils.bind(this,function(c,f){a.saveLevel=4;try{null!=d&&(x.properties=d);var g=l||a.constructor!=DriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:a.getCurrentEtag(),k=mxUtils.bind(this,function(b){a.saveLevel=5;try{var d=a.desc.mimeType!=
+this.xmlMimeType&&a.desc.mimeType!=this.mimeType&&a.desc.mimeType!=this.libraryMimeType,k=!0,l=null;try{l=window.setTimeout(mxUtils.bind(this,function(){k=!1;n({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),3*this.ui.timeout)}catch(S){}this.executeRequest(this.createUploadRequest(a.getId(),x,c,e||b||d,f,b?null:g,B),mxUtils.bind(this,function(a){window.clearTimeout(l);k&&D(a)}),mxUtils.bind(this,function(b){window.clearTimeout(l);if(k){a.saveLevel=6;try{a.isConflict(b)?this.executeRequest({url:"/files/"+
+a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(c){a.saveLevel=7;try{if(null!=c&&c.etag==g)if(m<this.staleEtagMaxRetries){m++;var d=2*m*this.coolOff*(1+.1*(Math.random()-.5));window.setTimeout(A,d);"1"==urlParams.test&&EditorUi.debug("DriveClient: Stale Etag Detected","retry",m,"delay",d)}else{A(!0);try{EditorUi.logEvent({category:"STALE-ETAG-SAVE-FILE-"+a.getHash(),action:"rev_"+a.desc.headRevisionId+"-mod_"+a.desc.modifiedDate+"-size_"+a.getSize()+"-mime_"+
+a.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+(a.changeListenerEnabled?"":"-nolisten")+(a.inConflictState?"-conflict":"")+(a.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=a.sync?"-client_"+a.sync.clientId:"-nosync")})}catch(Y){}}else"1"==urlParams.test&&c.headRevisionId==v&&EditorUi.debug("DriveClient: Remote Etag Changed","local",g,"remote",c.etag,"rev",a.desc.headRevisionId,"response",[c],"file",[a]),n(b,c)}catch(Y){p(Y)}}),
+mxUtils.bind(this,function(){n(b)})):n(b)}catch(W){p(W)}}}))}catch(S){p(S)}}),A=mxUtils.bind(this,function(b){a.saveLevel=9;if(b)k(b);else{var c=!0,d=null;try{d=window.setTimeout(mxUtils.bind(this,function(){c=!1;n({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),3*this.ui.timeout)}catch(U){}this.executeRequest({url:"/files/"+a.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(e){window.clearTimeout(d);if(c){a.saveLevel=10;try{null!=e&&e.headRevisionId==
+v?("1"==urlParams.test&&g!=e.etag&&EditorUi.debug("DriveClient: Preflight Etag Update","from",g,"to",e.etag,"rev",a.desc.headRevisionId,"response",[e],"file",[a]),g=e.etag,k(b)):n({error:{code:412}},e)}catch(S){p(S)}}}),mxUtils.bind(this,function(b){window.clearTimeout(d);c&&(a.saveLevel=11,n(b))}))}});if(z&&null==b){a.saveLevel=8;var q=new Image;q.onload=mxUtils.bind(this,function(){try{var a=this.thumbnailWidth/q.width,b=document.createElement("canvas");b.width=this.thumbnailWidth;b.height=Math.floor(q.height*
+a);b.getContext("2d").drawImage(q,0,0,b.width,b.height);var c=b.toDataURL(),c=c.substring(c.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_");x.thumbnail={image:c,mimeType:"image/png"};A(!1)}catch(U){try{A(!1)}catch(S){p(S)}}});q.src="data:image/png;base64,"+c}else A(!1)}catch(aa){p(aa)}});if(z){var K=this.ui.getPngFileProperties(this.ui.fileNode);this.ui.getEmbeddedPng(mxUtils.bind(this,function(a){E(a,!0)}),n,this.ui.getCurrentFile()!=a?C:null,K.scale,K.border)}else E(C,!1)}catch(G){p(G)}});
+try{a.saveLevel=2,(f||z||a.constructor==DriveLibrary||!this.enableThumbnails||"0"==urlParams.thumb||null!=x.mimeType&&"application/vnd.jgraph.mxfile"!=x.mimeType.substring(0,29)||!this.ui.getThumbnail(this.thumbnailWidth,mxUtils.bind(this,function(a){try{var b=null;try{null!=a&&(b=a.toDataURL("image/png")),null!=b&&(b=b.length>this.maxThumbnailSize?null:b.substring(b.indexOf(",")+1).replace(/\+/g,"-").replace(/\//g,"_"))}catch(E){b=null}A(b,"image/png")}catch(E){p(E)}})))&&A(null,null,a.constructor!=
+DriveLibrary)}catch(C){p(C)}}else this.ui.editor.graph.reset(),n({message:mxResources.get("readOnly")})}catch(C){p(C)}};
+DriveClient.prototype.insertFile=function(a,e,c,b,k,f,l){f=null!=f?f:this.xmlMimeType;a={mimeType:f,title:a};null!=c&&(a.parents=[{kind:"drive#fileLink",id:c}]);this.executeRequest(this.createUploadRequest(null,a,e,!1,l),mxUtils.bind(this,function(a){f==this.libraryMimeType?b(new DriveLibrary(this.ui,e,a)):0==a?null!=k&&k({message:mxResources.get("errorSavingFile")}):b(new DriveFile(this.ui,e,a))}),k)};
DriveClient.prototype.createUploadRequest=function(a,e,c,b,k,f,l){k=null!=k?k:!1;var d={"Content-Type":'multipart/mixed; boundary="-------314159265358979323846"'};null!=f&&(d["If-Match"]=f);a={fullUrl:"https://content.googleapis.com/upload/drive/v2/files"+(null!=a?"/"+a:"")+"?uploadType=multipart&supportsAllDrives=true&enforceSingleParent=true&fields="+this.allFields,method:null!=a?"PUT":"POST",headers:d,params:"\r\n---------314159265358979323846\r\nContent-Type: application/json\r\n\r\n"+JSON.stringify(e)+
"\r\n---------314159265358979323846\r\nContent-Type: application/octect-stream\r\nContent-Transfer-Encoding: base64\r\n\r\n"+(null!=c?k?c:Base64.encode(c):"")+"\r\n---------314159265358979323846--"};b||(a.fullUrl+="&newRevision=false");l&&(a.fullUrl+="&pinned=true");return a};
DriveClient.prototype.pickFile=function(a,e){this.filePickerCallback=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("G"+a)});this.filePicked=mxUtils.bind(this,function(a){a.action==google.picker.Action.PICKED&&this.filePickerCallback(a.docs[0].id)});this.ui.spinner.spin(document.body,mxResources.get("authorizing"))&&this.execute(mxUtils.bind(this,function(){try{this.ui.spinner.stop();var a=e?"genericPicker":"filePicker",b=mxUtils.bind(this,function(c){"picker modal-dialog-bg picker-dialog-bg"==
@@ -9694,8 +9698,7 @@ DropboxClient.prototype.createFile=function(a,e,c){var b=/(\.png)$/i.test(a.name
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,e){this.ui.oneDrive.executeRequest(this.ui.oneDrive.getItemURL(this.getId()),mxUtils.bind(this,function(c){200<=c.getStatus()&&299>=c.getStatus()?a(JSON.parse(c.getText())):null!=e&&e()}),e)};OneDriveFile.prototype.getLatestVersion=function(a,e){this.ui.oneDrive.getFile(this.getId(),a,e)};OneDriveFile.prototype.getDescriptor=function(){return this.meta};OneDriveFile.prototype.setDescriptor=function(a){this.meta=a};
-OneDriveFile.prototype.getDescriptorSecret=function(a){return null!=a.file&&null!=a.file.hashes&&null!=a.file.hashes.quickXorHash?a.file.hashes.quickXorHash:null};OneDriveFile.prototype.getDescriptorEtag=function(a){return a.eTag};OneDriveFile.prototype.setDescriptorEtag=function(a,e){a.eTag=e};
-OneDriveFile.prototype.loadPatchDescriptor=function(a,e){var c=this.ui.oneDrive.getItemURL(this.getId());this.ui.oneDrive.executeRequest(c+"?select=etag,file",mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?a(JSON.parse(b.getText())):e(this.ui.oneDrive.parseRequestText(b))}),e)};
+OneDriveFile.prototype.getDescriptorEtag=function(a){return a.eTag};OneDriveFile.prototype.setDescriptorEtag=function(a,e){a.eTag=e};OneDriveFile.prototype.loadPatchDescriptor=function(a,e){var c=this.ui.oneDrive.getItemURL(this.getId());this.ui.oneDrive.executeRequest(c+"?select=etag,file",mxUtils.bind(this,function(b){200<=b.getStatus()&&299>=b.getStatus()?a(JSON.parse(b.getText())):e(this.ui.oneDrive.parseRequestText(b))}),e)};
OneDriveFile.prototype.getChannelKey=function(){return"undefined"!==typeof CryptoJS?CryptoJS.MD5(this.meta.createdDateTime+(null!=this.meta.createdBy&&null!=this.meta.createdBy.user?this.meta.createdBy.user.id:"")).toString():null};OneDriveFile.prototype.getLastModifiedDate=function(){return new Date(this.meta.lastModifiedDateTime)};OneDriveFile.prototype.save=function(a,e,c,b,k){this.doSave(this.getTitle(),a,e,c,b,k)};OneDriveFile.prototype.saveAs=function(a,e,c){this.doSave(a,!1,e,c)};
OneDriveFile.prototype.doSave=function(a,e,c,b,k,f){var l=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=l;this.saveFile(a,e,c,b,k,f)}),b,k,f])};
OneDriveFile.prototype.saveFile=function(a,e,c,b,k,f){if(!this.isEditable())null!=c&&c();else if(!this.savingFile)if(this.getTitle()==a){var l=mxUtils.bind(this,function(){var a=null,e=null;try{a=this.isModified;e=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return e}}),n=f||this.constructor!=OneDriveFile||"manual"!=DrawioFile.SYNC&&"auto"!=DrawioFile.SYNC?null:this.getCurrentEtag(),p=this.meta;
@@ -9720,7 +9723,7 @@ OneDriveClient.prototype.executeRequest=function(a,e,c){var b=mxUtils.bind(this,
c,k))}),c)});null==this.token||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(function(){b(!0)},c):b(!1)};OneDriveClient.prototype.checkToken=function(a){null==this.token||null==this.tokenRefreshThread||6E4>this.tokenExpiresOn-Date.now()?this.authenticate(a,this.emptyFn):a()};OneDriveClient.prototype.getItemRef=function(a){var e=a.split("/");return 1<e.length?{driveId:e[0],id:e[1]}:{id:a}};
OneDriveClient.prototype.getItemURL=function(a,e){var c=a.split("/");return 1<c.length?(e?"":this.baseUrl)+"/drives/"+c[0]+"/items/"+c[1]:(e?"":this.baseUrl)+"/me/drive/items/"+a};OneDriveClient.prototype.getLibrary=function(a,e,c){this.getFile(a,e,c,!1,!0)};
OneDriveClient.prototype.getFile=function(a,e,c,b,k){k=null!=k?k:!1;this.executeRequest(this.getItemURL(a),mxUtils.bind(this,function(a){if(200<=a.getStatus()&&299>=a.getStatus()){var b=JSON.parse(a.getText()),d=/\.png$/i.test(b.name);if(/\.v(dx|sdx?)$/i.test(b.name)||/\.gliffy$/i.test(b.name)||/\.pdf$/i.test(b.name)||!this.ui.useCanvasForExport&&d)this.ui.convertFile(b["@microsoft.graph.downloadUrl"],b.name,null!=b.file?b.file.mimeType:null,this.extension,e,c);else{var f=!0,m=window.setTimeout(mxUtils.bind(this,
-function(){f=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.editor.loadUrl(b["@microsoft.graph.downloadUrl"],mxUtils.bind(this,function(a){try{if(window.clearTimeout(m),f){var g=d?a.lastIndexOf(","):-1,l=null;if(0<g){var n=this.ui.extractGraphModelFromPng(a.substring(g+1));null!=n&&0<n.length?a=n:l=new LocalFile(this.ui,a,b.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==a.substring(0,32)){var q=a.substring(22);a=window.atob&&!mxClient.IS_SF?atob(q):Base64.decode(q)}Graph.fileSupport&&
+function(){f=!1;c({code:App.ERROR_TIMEOUT})}),this.ui.timeout);this.ui.editor.loadUrl(b["@microsoft.graph.downloadUrl"],mxUtils.bind(this,function(a){try{if(window.clearTimeout(m),f){var g=d?a.lastIndexOf(","):-1,l=null;if(0<g){var n=this.ui.extractGraphModelFromPng(a.substring(g+1));null!=n&&0<n.length?a=n:l=new LocalFile(this.ui,a,b.name,!0)}else if("data:image/png;base64,PG14ZmlsZS"==a.substring(0,32)){var t=a.substring(22);a=window.atob&&!mxClient.IS_SF?atob(t):Base64.decode(t)}Graph.fileSupport&&
(new XMLHttpRequest).upload&&this.ui.isRemoteFileFormat(a,b["@microsoft.graph.downloadUrl"])?this.ui.parseFile(new Blob([a],{type:"application/octet-stream"}),mxUtils.bind(this,function(a){try{4==a.readyState&&(200<=a.status&&299>=a.status?e(new LocalFile(this.ui,a.responseText,b.name+this.extension,!0)):null!=c&&c({message:mxResources.get("errorLoadingFile")}))}catch(z){if(null!=c)c(z);else throw z;}}),b.name):null!=l?e(l):k?e(new OneDriveLibrary(this.ui,a,b)):e(new OneDriveFile(this.ui,a,b))}}catch(v){if(null!=
c)c(v);else throw v;}}),mxUtils.bind(this,function(a){window.clearTimeout(m);f&&c(this.parseRequestText(a))}),d||null!=b.file&&null!=b.file.mimeType&&("image/"==b.file.mimeType.substring(0,6)||"application/pdf"==b.file.mimeType))}}else c(this.parseRequestText(a))}),c)};
OneDriveClient.prototype.renameFile=function(a,e,c,b){null!=a&&null!=e&&(this.isValidFilename(e)?this.checkExists(a.getParentId(),e,!1,mxUtils.bind(this,function(k){k?this.writeFile(this.getItemURL(a.getId()),JSON.stringify({name:e}),"PATCH","application/json",c,b):b()})):b({message:this.invalidFilenameRegExs[0].test(e)?mxResources.get("oneDriveCharsNotAllowed"):mxResources.get("oneDriveInvalidDeviceName")}))};
@@ -9740,14 +9743,14 @@ OneDriveClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,func
GitHubFile.prototype.getPublicUrl=function(a){null!=this.meta.download_url?mxUtils.get(this.meta.download_url,mxUtils.bind(this,function(e){a(200<=e.getStatus()&&299>=e.getStatus()?this.meta.download_url:null)}),mxUtils.bind(this,function(){a(null)})):a(null)};GitHubFile.prototype.isConflict=function(a){return null!=a&&409==a.status};GitHubFile.prototype.getMode=function(){return App.MODE_GITHUB};GitHubFile.prototype.isAutosave=function(){return!1};GitHubFile.prototype.getTitle=function(){return this.meta.name};
GitHubFile.prototype.isRenamable=function(){return!1};GitHubFile.prototype.getLatestVersion=function(a,e){this.peer.getFile(this.getId(),a,e)};GitHubFile.prototype.isCompressedStorage=function(){return!1};GitHubFile.prototype.getDescriptor=function(){return this.meta};GitHubFile.prototype.setDescriptor=function(a){this.meta=a};GitHubFile.prototype.getDescriptorEtag=function(a){return a.sha};GitHubFile.prototype.setDescriptorEtag=function(a,e){a.sha=e};
GitHubFile.prototype.save=function(a,e,c,b,k,f){this.doSave(this.getTitle(),e,c,b,k,f)};GitHubFile.prototype.saveAs=function(a,e,c){this.doSave(a,e,c)};GitHubFile.prototype.doSave=function(a,e,c,b,k,f){var l=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,[null,mxUtils.bind(this,function(){this.meta.name=l;this.saveFile(a,!1,e,c,b,k,f)}),c,b,k])};
-GitHubFile.prototype.saveFile=function(a,e,c,b,k,f,l){if(this.isEditable())if(this.savingFile)null!=b&&b({code:App.ERROR_BUSY});else{var d=mxUtils.bind(this,function(d){if(this.getTitle()==a){var e=null,g=null;try{e=this.isModified;g=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return g}}),l=this.getCurrentEtag(),t=this.data;k();this.peer.saveFile(this,mxUtils.bind(this,function(a){this.savingFile=
-!1;this.isModified=e;this.setDescriptorEtag(this.meta,a);this.fileSaved(t,l,mxUtils.bind(this,function(){this.contentChanged();null!=c&&c()}),b)}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(g||this.isModified());if(this.isConflict(a))this.inConflictState=!0,null!=b&&b({commitMessage:d});else if(null!=b){if(null!=a&&null!=a.retry){var c=a.retry;a.retry=function(){k();c()}}b(a)}}),f,d)}catch(q){if(this.savingFile=!1,null!=e&&(this.isModified=e),null!=g&&this.setModified(g||
-this.isModified()),null!=b)b(q);else throw q;}}else this.savingFile=!0,this.savingFileTime=new Date,this.ui.pickFolder(this.getMode(),mxUtils.bind(this,function(e){this.peer.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=!1;null!=c&&c();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}),!1,e,d)}))});null!=l?d(l):this.peer.showCommitDialog(this.meta.name,null==this.getDescriptorEtag(this.meta)||this.meta.isNew,mxUtils.bind(this,function(a){d(a)}),
+GitHubFile.prototype.saveFile=function(a,e,c,b,k,f,l){if(this.isEditable())if(this.savingFile)null!=b&&b({code:App.ERROR_BUSY});else{var d=mxUtils.bind(this,function(d){if(this.getTitle()==a){var e=null,g=null;try{e=this.isModified;g=this.isModified();this.savingFile=!0;this.savingFileTime=new Date;var k=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return g}}),l=this.getCurrentEtag(),q=this.data;k();this.peer.saveFile(this,mxUtils.bind(this,function(a){this.savingFile=
+!1;this.isModified=e;this.setDescriptorEtag(this.meta,a);this.fileSaved(q,l,mxUtils.bind(this,function(){this.contentChanged();null!=c&&c()}),b)}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=e;this.setModified(g||this.isModified());if(this.isConflict(a))this.inConflictState=!0,null!=b&&b({commitMessage:d});else if(null!=b){if(null!=a&&null!=a.retry){var c=a.retry;a.retry=function(){k();c()}}b(a)}}),f,d)}catch(t){if(this.savingFile=!1,null!=e&&(this.isModified=e),null!=g&&this.setModified(g||
+this.isModified()),null!=b)b(t);else throw t;}}else this.savingFile=!0,this.savingFileTime=new Date,this.ui.pickFolder(this.getMode(),mxUtils.bind(this,function(e){this.peer.insertFile(a,this.getData(),mxUtils.bind(this,function(a){this.savingFile=!1;null!=c&&c();this.ui.fileLoaded(a)}),mxUtils.bind(this,function(){this.savingFile=!1;null!=b&&b()}),!1,e,d)}))});null!=l?d(l):this.peer.showCommitDialog(this.meta.name,null==this.getDescriptorEtag(this.meta)||this.meta.isNew,mxUtils.bind(this,function(a){d(a)}),
b)}else null!=c&&c()};GitHubLibrary=function(a,e,c){GitHubFile.call(this,a,e,c)};mxUtils.extend(GitHubLibrary,GitHubFile);GitHubLibrary.prototype.doSave=function(a,e,c){this.saveFile(a,!1,e,c)};GitHubLibrary.prototype.open=function(){};GitHubClient=function(a,e){DrawioClient.call(this,a,e||"ghauth")};mxUtils.extend(GitHubClient,DrawioClient);GitHubClient.prototype.clientId="test.draw.io"==window.location.hostname?"23bc97120b9035515661":"89c9e4624ca416554489";GitHubClient.prototype.scope="repo";GitHubClient.prototype.extension=".drawio";GitHubClient.prototype.baseUrl="https://api.github.com";GitHubClient.prototype.maxFileSize=1E6;GitHubClient.prototype.authToken="token";
GitHubClient.prototype.updateUser=function(a,e,c){var b=!0,k=window.setTimeout(mxUtils.bind(this,function(){b=!1;e({code:App.ERROR_TIMEOUT,message:mxResources.get("timeout")})}),this.ui.timeout),f=new mxXmlRequest(this.baseUrl+"/user",null,"GET"),l=this.authToken+" "+this.token;f.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization",l)};f.send(mxUtils.bind(this,function(){window.clearTimeout(k);b&&(401===f.getStatus()?c?e({message:mxResources.get("accessDenied")}):(this.logout(),this.authenticate(mxUtils.bind(this,
function(){this.updateUser(a,e,!0)}),e)):200>f.getStatus()||300<=f.getStatus()?e({message:mxResources.get("accessDenied")}):(this.setUser(this.createUser(JSON.parse(f.getText()))),a()))}),e)};GitHubClient.prototype.createUser=function(a){return new DrawioUser(a.id,a.email,a.name)};
GitHubClient.prototype.authenticate=function(a,e){if(null==window.onGitHubCallback){var c=mxUtils.bind(this,function(){var b=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(k,f){null!=window.open("https://github.com/login/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope,"ghauth")?window.onGitHubCallback=mxUtils.bind(this,function(l,d){if(b)if(window.onGitHubCallback=null,b=!1,null==l)e({message:mxResources.get("accessDenied"),retry:c});else{var g=mxUtils.bind(this,function(){var b=
-!0,c=window.setTimeout(mxUtils.bind(this,function(){b=!1;e({code:App.ERROR_TIMEOUT,retry:g})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+l,mxUtils.bind(this,function(g){window.clearTimeout(c);if(b)try{if(200>g.getStatus()||300<=g.getStatus())e({message:mxResources.get("cannotLogin")});else{null!=f&&f();var l=g.getText();this.token=l.substring(l.indexOf("=")+1,l.indexOf("&"));this.setUser(null);k&&this.setPersistentToken(this.token);a()}}catch(t){e(t)}finally{null!=d&&
+!0,c=window.setTimeout(mxUtils.bind(this,function(){b=!1;e({code:App.ERROR_TIMEOUT,retry:g})}),this.ui.timeout);mxUtils.get("/github?client_id="+this.clientId+"&code="+l,mxUtils.bind(this,function(g){window.clearTimeout(c);if(b)try{if(200>g.getStatus()||300<=g.getStatus())e({message:mxResources.get("cannotLogin")});else{null!=f&&f();var l=g.getText();this.token=l.substring(l.indexOf("=")+1,l.indexOf("&"));this.setUser(null);k&&this.setPersistentToken(this.token);a()}}catch(q){e(q)}finally{null!=d&&
d.close()}}))});g()}else null!=d&&d.close()}):e({message:mxResources.get("serviceUnavailableOrBlocked"),retry:c})}),mxUtils.bind(this,function(){b&&(window.onGitHubCallback=null,b=!1,e({message:mxResources.get("accessDenied"),retry:c}))}))});c()}else e({code:App.ERROR_BUSY})};GitHubClient.prototype.getErrorMessage=function(a,e){try{var c=JSON.parse(a.getText());null!=c&&null!=c.message&&(e=c.message)}catch(b){}return e};
GitHubClient.prototype.executeRequest=function(a,e,c,b){var k=mxUtils.bind(this,function(l){var d=!0,g=window.setTimeout(mxUtils.bind(this,function(){d=!1;c({code:App.ERROR_TIMEOUT,retry:f})}),this.ui.timeout),m=this.authToken+" "+this.token;a.setRequestHeaders=function(a,b){a.setRequestHeader("Authorization",m)};a.send(mxUtils.bind(this,function(){window.clearTimeout(g);if(d)if(200<=a.getStatus()&&299>=a.getStatus()||b&&404==a.getStatus())e(a);else if(401===a.getStatus())l?c({code:a.getStatus(),
message:mxResources.get("accessDenied"),retry:mxUtils.bind(this,function(){this.authenticate(function(){f(!0)},c)})}):this.authenticate(function(){k(!0)},c);else if(403===a.getStatus()){var m=!1;try{var p=JSON.parse(a.getText());null!=p&&null!=p.errors&&0<p.errors.length&&(m="too_large"==p.errors[0].code)}catch(u){}c({message:mxResources.get(m?"drawingTooLarge":"forbidden")})}else 404===a.getStatus()?c({code:a.getStatus(),message:this.getErrorMessage(a,mxResources.get("fileNotFound"))}):409===a.getStatus()?
@@ -9766,18 +9769,18 @@ GitHubClient.prototype.saveFile=function(a,e,c,b,k){var f=a.meta.org,l=a.meta.re
b)}),c,this.ui.getCurrentFile()!=a?a.getData():null,b.scale,b.border)}else m(a.meta.sha,Base64.encode(a.getData()))});b?this.getSha(f,l,g,d,mxUtils.bind(this,function(b){a.meta.sha=b;n()}),c):n()};GitHubClient.prototype.pickLibrary=function(a){this.pickFile(a)};GitHubClient.prototype.pickFolder=function(a){this.showGitHubDialog(!1,a)};GitHubClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("H"+encodeURIComponent(a))});this.showGitHubDialog(!0,a)};
GitHubClient.prototype.showGitHubDialog=function(a,e){var c=null,b=null,k=null,f=null,l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.height="304px";var d=document.createElement("h3");mxUtils.write(d,mxResources.get(a?"selectFile":"selectFolder"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(d);var g=document.createElement("div");g.style.whiteSpace="nowrap";g.style.border="1px solid lightgray";g.style.boxSizing=
"border-box";g.style.padding="4px";g.style.overflow="auto";g.style.lineHeight="1.2em";g.style.height="274px";l.appendChild(g);var m=document.createElement("div");m.style.textOverflow="ellipsis";m.style.boxSizing="border-box";m.style.overflow="hidden";m.style.padding="4px";m.style.width="100%";var n=new CustomDialog(this.ui,l,mxUtils.bind(this,function(){e(c+"/"+b+"/"+encodeURIComponent(k)+"/"+f)}));this.ui.showDialog(n.container,420,360,!0,!0);a&&n.okButton.parentNode.removeChild(n.okButton);var p=
-mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("title",a);mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=m.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),u=mxUtils.bind(this,function(a){var d=document.createElement("div");d.style.marginBottom="8px";d.appendChild(p(c+"/"+b,mxUtils.bind(this,function(){f=null;A()})));a||(mxUtils.write(d," / "),d.appendChild(p(decodeURIComponent(k),mxUtils.bind(this,
-function(){f=null;y()}))));if(null!=f&&0<f.length){var e=f.split("/");for(a=0;a<e.length;a++)(function(a){mxUtils.write(d," / ");d.appendChild(p(e[a],mxUtils.bind(this,function(){f=e.slice(0,a+1).join("/");z()})))})(a)}g.appendChild(d)}),t=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=k=b=c=null,A()):this.ui.hideDialog()}))}),q=null,v=null,z=mxUtils.bind(this,function(d){null==d&&(g.innerHTML="",d=1);var l=new mxXmlRequest(this.baseUrl+
-"/repos/"+c+"/"+b+"/contents/"+f+"?ref="+encodeURIComponent(k)+"&per_page=100&page="+d,null,"GET");this.ui.spinner.spin(g,mxResources.get("loading"));n.okButton.removeAttribute("disabled");null!=v&&(mxEvent.removeListener(g,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");mxUtils.write(q,mxResources.get("more")+"...");var x=mxUtils.bind(this,function(){z(d+1)});mxEvent.addListener(q,
-"click",x);this.executeRequest(l,mxUtils.bind(this,function(l){this.ui.spinner.stop();1==d&&(u(),g.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,A();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");z()}}),"4px")));var x=JSON.parse(l.getText());if(null==x||0==x.length)mxUtils.write(g,mxResources.get("noFiles"));else{var n=!0,B=0;l=mxUtils.bind(this,function(d){for(var l=0;l<x.length;l++)mxUtils.bind(this,function(l,x){if(d==("dir"==l.type)){var v=m.cloneNode();v.style.backgroundColor=
-n?"#eeeeee":"";n=!n;var q=document.createElement("img");q.src=IMAGE_PATH+"/"+("dir"==l.type?"folder.png":"file.png");q.setAttribute("align","absmiddle");q.style.marginRight="4px";q.style.marginTop="-4px";q.width=20;v.appendChild(q);v.appendChild(p(l.name+("dir"==l.type?"/":""),mxUtils.bind(this,function(){"dir"==l.type?(f=l.path,z()):a&&"file"==l.type&&(this.ui.hideDialog(),e(c+"/"+b+"/"+encodeURIComponent(k)+"/"+l.path))})));g.appendChild(v);B++}})(x[l],l)});l(!0);a&&l(!1)}}),t,!0)}),y=mxUtils.bind(this,
-function(a){null==a&&(g.innerHTML="",a=1);var d=new mxXmlRequest(this.baseUrl+"/repos/"+c+"/"+b+"/branches?per_page=100&page="+a,null,"GET");n.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(g,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(g,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");mxUtils.write(q,mxResources.get("more")+"...");var e=
-mxUtils.bind(this,function(){y(a+1)});mxEvent.addListener(q,"click",e);this.executeRequest(d,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),g.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;A()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(g,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a,b){var c=m.cloneNode();c.style.backgroundColor=0==b%2?"#eeeeee":"";c.appendChild(p(a.name,mxUtils.bind(this,function(){k=
-a.name;f="";z()})));g.appendChild(c)})(b[c],c);100==b.length&&(g.appendChild(q),v=function(){g.scrollTop>=g.scrollHeight-g.offsetHeight&&e()},mxEvent.addListener(g,"scroll",v))}}),t)}),A=mxUtils.bind(this,function(a){null==a&&(g.innerHTML="",a=1);var d=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");n.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(g,mxResources.get("loading"));null!=v&&mxEvent.removeListener(g,"scroll",v);null!=q&&null!=q.parentNode&&
-q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");mxUtils.write(q,mxResources.get("more")+"...");var e=mxUtils.bind(this,function(){A(a+1)});mxEvent.addListener(q,"click",e);this.executeRequest(d,mxUtils.bind(this,function(d){this.ui.spinner.stop();d=JSON.parse(d.getText());if(null==d||0==d.length)mxUtils.write(g,mxResources.get("noFiles"));else{1==a&&(g.appendChild(p(mxResources.get("enterValue")+"...",mxUtils.bind(this,
+mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("title",a);mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=m.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),u=mxUtils.bind(this,function(a){var d=document.createElement("div");d.style.marginBottom="8px";d.appendChild(p(c+"/"+b,mxUtils.bind(this,function(){f=null;B()})));a||(mxUtils.write(d," / "),d.appendChild(p(decodeURIComponent(k),mxUtils.bind(this,
+function(){f=null;y()}))));if(null!=f&&0<f.length){var e=f.split("/");for(a=0;a<e.length;a++)(function(a){mxUtils.write(d," / ");d.appendChild(p(e[a],mxUtils.bind(this,function(){f=e.slice(0,a+1).join("/");z()})))})(a)}g.appendChild(d)}),q=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=k=b=c=null,B()):this.ui.hideDialog()}))}),t=null,v=null,z=mxUtils.bind(this,function(d){null==d&&(g.innerHTML="",d=1);var l=new mxXmlRequest(this.baseUrl+
+"/repos/"+c+"/"+b+"/contents/"+f+"?ref="+encodeURIComponent(k)+"&per_page=100&page="+d,null,"GET");this.ui.spinner.spin(g,mxResources.get("loading"));n.okButton.removeAttribute("disabled");null!=v&&(mxEvent.removeListener(g,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.setAttribute("href","javascript:void(0);");mxUtils.write(t,mxResources.get("more")+"...");var x=mxUtils.bind(this,function(){z(d+1)});mxEvent.addListener(t,
+"click",x);this.executeRequest(l,mxUtils.bind(this,function(l){this.ui.spinner.stop();1==d&&(u(),g.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,B();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");z()}}),"4px")));var n=JSON.parse(l.getText());if(null==n||0==n.length)mxUtils.write(g,mxResources.get("noFiles"));else{var x=!0,v=0;l=mxUtils.bind(this,function(d){for(var l=0;l<n.length;l++)mxUtils.bind(this,function(l,n){if(d==("dir"==l.type)){var A=m.cloneNode();A.style.backgroundColor=
+x?"#eeeeee":"";x=!x;var q=document.createElement("img");q.src=IMAGE_PATH+"/"+("dir"==l.type?"folder.png":"file.png");q.setAttribute("align","absmiddle");q.style.marginRight="4px";q.style.marginTop="-4px";q.width=20;A.appendChild(q);A.appendChild(p(l.name+("dir"==l.type?"/":""),mxUtils.bind(this,function(){"dir"==l.type?(f=l.path,z()):a&&"file"==l.type&&(this.ui.hideDialog(),e(c+"/"+b+"/"+encodeURIComponent(k)+"/"+l.path))})));g.appendChild(A);v++}})(n[l],l)});l(!0);a&&l(!1)}}),q,!0)}),y=mxUtils.bind(this,
+function(a){null==a&&(g.innerHTML="",a=1);var d=new mxXmlRequest(this.baseUrl+"/repos/"+c+"/"+b+"/branches?per_page=100&page="+a,null,"GET");n.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(g,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(g,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.setAttribute("href","javascript:void(0);");mxUtils.write(t,mxResources.get("more")+"...");var e=
+mxUtils.bind(this,function(){y(a+1)});mxEvent.addListener(t,"click",e);this.executeRequest(d,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),g.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;B()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(g,mxResources.get("noFiles"));else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a,b){var c=m.cloneNode();c.style.backgroundColor=0==b%2?"#eeeeee":"";c.appendChild(p(a.name,mxUtils.bind(this,function(){k=
+a.name;f="";z()})));g.appendChild(c)})(b[c],c);100==b.length&&(g.appendChild(t),v=function(){g.scrollTop>=g.scrollHeight-g.offsetHeight&&e()},mxEvent.addListener(g,"scroll",v))}}),q)}),B=mxUtils.bind(this,function(a){null==a&&(g.innerHTML="",a=1);var d=new mxXmlRequest(this.baseUrl+"/user/repos?per_page=100&page="+a,null,"GET");n.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(g,mxResources.get("loading"));null!=v&&mxEvent.removeListener(g,"scroll",v);null!=t&&null!=t.parentNode&&
+t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.setAttribute("href","javascript:void(0);");mxUtils.write(t,mxResources.get("more")+"...");var e=mxUtils.bind(this,function(){B(a+1)});mxEvent.addListener(t,"click",e);this.executeRequest(d,mxUtils.bind(this,function(d){this.ui.spinner.stop();d=JSON.parse(d.getText());if(null==d||0==d.length)mxUtils.write(g,mxResources.get("noFiles"));else{1==a&&(g.appendChild(p(mxResources.get("enterValue")+"...",mxUtils.bind(this,
function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){if(null!=a){var d=a.split("/");if(1<d.length){a=d[0];var e=d[1];3>d.length?(c=a,b=e,f=k=null,y()):this.ui.spinner.spin(g,mxResources.get("loading"))&&(d=encodeURIComponent(d.slice(2,d.length).join("/")),this.getFile(a+"/"+e+"/"+d,mxUtils.bind(this,function(a){this.ui.spinner.stop();c=a.meta.org;b=a.meta.repo;k=decodeURIComponent(a.meta.ref);f="";z()}),mxUtils.bind(this,function(a){this.ui.spinner.stop();
this.ui.handleError({message:mxResources.get("fileNotFound")})})))}else this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})}}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(g),mxUtils.br(g));for(var l=0;l<d.length;l++)mxUtils.bind(this,function(a,d){var e=m.cloneNode();e.style.backgroundColor=0==d%2?"#eeeeee":"";e.appendChild(p(a.full_name,mxUtils.bind(this,function(){c=a.owner.login;b=a.name;k=a.default_branch;
-f="";z()})));g.appendChild(e)})(d[l],l)}100==d.length&&(g.appendChild(q),v=function(){g.scrollTop>=g.scrollHeight-g.offsetHeight&&e()},mxEvent.addListener(g,"scroll",v))}),t)});A()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,e,c){DrawioFile.call(this,a,e);this.meta=c;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};
+f="";z()})));g.appendChild(e)})(d[l],l)}100==d.length&&(g.appendChild(t),v=function(){g.scrollTop>=g.scrollHeight-g.offsetHeight&&e()},mxEvent.addListener(g,"scroll",v))}),q)});B()};GitHubClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};TrelloFile=function(a,e,c){DrawioFile.call(this,a,e);this.meta=c;this.saveNeededCounter=0};mxUtils.extend(TrelloFile,DrawioFile);TrelloFile.prototype.getHash=function(){return"T"+encodeURIComponent(this.meta.compoundId)};TrelloFile.prototype.getMode=function(){return App.MODE_TRELLO};TrelloFile.prototype.isAutosave=function(){return!0};TrelloFile.prototype.getTitle=function(){return this.meta.name};TrelloFile.prototype.isRenamable=function(){return!1};TrelloFile.prototype.getSize=function(){return this.meta.bytes};
TrelloFile.prototype.save=function(a,e,c){this.doSave(this.getTitle(),e,c)};TrelloFile.prototype.saveAs=function(a,e,c){this.doSave(a,e,c)};TrelloFile.prototype.doSave=function(a,e,c){var b=this.meta.name;this.meta.name=a;DrawioFile.prototype.save.apply(this,arguments);this.meta.name=b;this.saveFile(a,!1,e,c)};
TrelloFile.prototype.saveFile=function(a,e,c,b){if(this.isEditable())if(this.savingFile)null!=b&&(this.saveNeededCounter++,b({code:App.ERROR_BUSY}));else if(this.savingFile=!0,this.savingFileTime=new Date,this.getTitle()==a){var k=this.isModified,f=this.isModified(),l=mxUtils.bind(this,function(){this.setModified(!1);this.isModified=function(){return f}});l();this.ui.trello.saveFile(this,mxUtils.bind(this,function(d){this.savingFile=!1;this.isModified=k;this.meta=d;this.contentChanged();null!=c&&
c();0<this.saveNeededCounter&&(this.saveNeededCounter--,this.saveFile(a,e,c,b))}),mxUtils.bind(this,function(a){this.savingFile=!1;this.isModified=k;this.setModified(f||this.isModified());if(null!=b){if(null!=a&&null!=a.retry){var c=a.retry;a.retry=function(){l();c()}}b(a)}}))}else this.ui.pickFolder(App.MODE_TRELLO,mxUtils.bind(this,function(d){this.ui.trello.insertFile(a,this.getData(),mxUtils.bind(this,function(d){this.savingFile=!1;null!=c&&c();this.ui.fileLoaded(d);0<this.saveNeededCounter&&
@@ -9795,10 +9798,10 @@ TrelloClient.prototype.pickFolder=function(a){this.authenticate(mxUtils.bind(thi
TrelloClient.prototype.showTrelloDialog=function(a,e){var c=null,b="@me",k=0,f=document.createElement("div");f.style.whiteSpace="nowrap";f.style.overflow="hidden";f.style.height="224px";var l=document.createElement("h3");mxUtils.write(l,a?mxResources.get("selectFile"):mxResources.get("selectCard"));l.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";f.appendChild(l);var d=document.createElement("div");d.style.whiteSpace="nowrap";d.style.overflow="auto";d.style.height=
"194px";f.appendChild(d);f=new CustomDialog(this.ui,f);this.ui.showDialog(f.container,340,270,!0,!0);f.okButton.parentNode.removeChild(f.okButton);var g=mxUtils.bind(this,function(a,b,c){k++;var d=document.createElement("div");d.style="width:100%;text-overflow:ellipsis;overflow:hidden;vertical-align:middle;background:"+(0==k%2?"#eee":"#fff");var e=document.createElement("a");e.setAttribute("href","javascript:void(0);");if(null!=c){var f=document.createElement("img");f.src=c.url;f.width=c.width;f.height=
c.height;f.style="border: 1px solid black;margin:5px;vertical-align:middle";e.appendChild(f)}mxUtils.write(e,a);mxEvent.addListener(e,"click",b);d.appendChild(e);return d}),m=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();this.ui.hideDialog()}))}),n=mxUtils.bind(this,function(){k=0;d.innerHTML="";this.ui.spinner.spin(d,mxResources.get("loading"));var a=mxUtils.bind(this,function(){Trello.cards.get(c+"/attachments",{fields:"id,name,previews"},
-mxUtils.bind(this,function(a){this.ui.spinner.stop();d.appendChild(g("../ [Up]",mxUtils.bind(this,function(){t()})));mxUtils.br(d);null==a||0==a.length?mxUtils.write(d,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var b=0;b<a.length;b++)mxUtils.bind(this,function(a){d.appendChild(g(a.name,mxUtils.bind(this,function(){this.ui.hideDialog();e(c+this.SEPARATOR+a.id)}),null!=a.previews?a.previews[0]:null))})(a[b])})()}),mxUtils.bind(this,function(b){401==b.status?this.authenticate(a,m,!0):
-null!=m&&m(b)}))});a()}),p=null,u=null,t=mxUtils.bind(this,function(f){null==f&&(k=0,d.innerHTML="",f=1);this.ui.spinner.spin(d,mxResources.get("loading"));null!=p&&null!=p.parentNode&&p.parentNode.removeChild(p);p=document.createElement("a");p.style.display="block";p.setAttribute("href","javascript:void(0);");mxUtils.write(p,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){mxEvent.removeListener(d,"scroll",u);t(f+1)});mxEvent.addListener(p,"click",l);var q=mxUtils.bind(this,function(){Trello.get("search",
-{query:""==mxUtils.trim(b)?"is:open":b,cards_limit:100,cards_page:f-1},mxUtils.bind(this,function(k){this.ui.spinner.stop();k=null!=k?k.cards:null;if(null==k||0==k.length)mxUtils.write(d,mxResources.get("noFiles"));else{1==f&&(d.appendChild(g(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,b,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(b=a,t())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");
-this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(d));for(var m=0;m<k.length;m++)mxUtils.bind(this,function(b){d.appendChild(g(b.name,mxUtils.bind(this,function(){a?(c=b.id,n()):(this.ui.hideDialog(),e(b.id))})))})(k[m]);100==k.length&&(d.appendChild(p),u=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&l()},mxEvent.addListener(d,"scroll",u))}}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(q,m,!0):null!=m&&m({message:a.responseText})}))});q()});t()};
+mxUtils.bind(this,function(a){this.ui.spinner.stop();d.appendChild(g("../ [Up]",mxUtils.bind(this,function(){q()})));mxUtils.br(d);null==a||0==a.length?mxUtils.write(d,mxResources.get("noFiles")):mxUtils.bind(this,function(){for(var b=0;b<a.length;b++)mxUtils.bind(this,function(a){d.appendChild(g(a.name,mxUtils.bind(this,function(){this.ui.hideDialog();e(c+this.SEPARATOR+a.id)}),null!=a.previews?a.previews[0]:null))})(a[b])})()}),mxUtils.bind(this,function(b){401==b.status?this.authenticate(a,m,!0):
+null!=m&&m(b)}))});a()}),p=null,u=null,q=mxUtils.bind(this,function(f){null==f&&(k=0,d.innerHTML="",f=1);this.ui.spinner.spin(d,mxResources.get("loading"));null!=p&&null!=p.parentNode&&p.parentNode.removeChild(p);p=document.createElement("a");p.style.display="block";p.setAttribute("href","javascript:void(0);");mxUtils.write(p,mxResources.get("more")+"...");var l=mxUtils.bind(this,function(){mxEvent.removeListener(d,"scroll",u);q(f+1)});mxEvent.addListener(p,"click",l);var t=mxUtils.bind(this,function(){Trello.get("search",
+{query:""==mxUtils.trim(b)?"is:open":b,cards_limit:100,cards_page:f-1},mxUtils.bind(this,function(k){this.ui.spinner.stop();k=null!=k?k.cards:null;if(null==k||0==k.length)mxUtils.write(d,mxResources.get("noFiles"));else{1==f&&(d.appendChild(g(mxResources.get("filterCards")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,b,mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(b=a,q())}),mxResources.get("filterCards"),null,null,"http://help.trello.com/article/808-searching-for-cards-all-boards");
+this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(d));for(var m=0;m<k.length;m++)mxUtils.bind(this,function(b){d.appendChild(g(b.name,mxUtils.bind(this,function(){a?(c=b.id,n()):(this.ui.hideDialog(),e(b.id))})))})(k[m]);100==k.length&&(d.appendChild(p),u=function(){d.scrollTop>=d.scrollHeight-d.offsetHeight&&l()},mxEvent.addListener(d,"scroll",u))}}),mxUtils.bind(this,function(a){401==a.status?this.authenticate(t,m,!0):null!=m&&m({message:a.responseText})}))});t()});q()};
TrelloClient.prototype.isAuthorized=function(){try{return null!=localStorage.trello_token}catch(a){}return!1};TrelloClient.prototype.logout=function(){localStorage.removeItem("trello_token");Trello.deauthorize()};GitLabFile=function(a,e,c){GitHubFile.call(this,a,e,c);this.peer=this.ui.gitLab};mxUtils.extend(GitLabFile,GitHubFile);GitLabFile.prototype.getId=function(){return this.meta.org+"/"+(null!=this.meta.repo?encodeURIComponent(this.meta.repo)+"/"+(null!=this.meta.ref?this.meta.ref+(null!=this.meta.path?"/"+this.meta.path:""):""):"")};GitLabFile.prototype.getHash=function(){return encodeURIComponent("A"+this.getId())};GitLabFile.prototype.isConflict=function(a){return null!=a&&400==a.status};
GitLabFile.prototype.getMode=function(){return App.MODE_GITLAB};GitLabFile.prototype.getDescriptorEtag=function(a){return a.last_commit_id};GitLabFile.prototype.setDescriptorEtag=function(a,e){a.last_commit_id=e};GitLabLibrary=function(a,e,c){GitLabFile.call(this,a,e,c)};mxUtils.extend(GitLabLibrary,GitLabFile);GitLabLibrary.prototype.doSave=function(a,e,c){this.saveFile(a,!1,e,c)};GitLabLibrary.prototype.open=function(){};GitLabClient=function(a){GitHubClient.call(this,a,"gitlabauth")};mxUtils.extend(GitLabClient,GitHubClient);GitLabClient.prototype.clientId=DRAWIO_GITLAB_ID;GitLabClient.prototype.scope="api%20read_repository%20write_repository";GitLabClient.prototype.baseUrl=DRAWIO_GITLAB_URL+"/api/v4";GitLabClient.prototype.authToken="Bearer";
GitLabClient.prototype.authenticate=function(a,e){if(null==window.onGitLabCallback){var c=mxUtils.bind(this,function(){var b=!0;this.ui.showAuthDialog(this,!0,mxUtils.bind(this,function(k,f){var l=window.location.href,l=l.substring(0,l.lastIndexOf("/")),l=encodeURIComponent(l+"/gitlab.html");null!=window.open(DRAWIO_GITLAB_URL+"/oauth/authorize?client_id="+this.clientId+"&scope="+this.scope+"&redirect_uri="+l+"&response_type=token&state=123","gitlabauth")?window.onGitLabCallback=mxUtils.bind(this,
@@ -9810,7 +9813,7 @@ GitLabClient.prototype.getRefIndex=function(a,e,c,b,k,f){if(null!=k)c(a,k);else{
mxUtils.bind(this,function(){200==u.getStatus()?c(a,l):b({message:mxResources.get("fileNotFound")})}),mxUtils.bind(this,function(){404==u.getStatus()?(l--,d()):b({message:mxResources.get("fileNotFound")})}))}});d()}};
GitLabClient.prototype.getFile=function(a,e,c,b,k,f){b=null!=b?b:!1;this.getRefIndex(a.split("/"),!1,mxUtils.bind(this,function(f,d){var g=Math.max(d-1,0),l=f.slice(0,g).join("/"),n=f[g],p=f[d];a=f.slice(d+1,f.length).join("/");g=/\.png$/i.test(a);if(!k&&(/\.v(dx|sdx?)$/i.test(a)||/\.gliffy$/i.test(a)||/\.pdf$/i.test(a)||!this.ui.useCanvasForExport&&g))if(null!=this.token){var g="&t="+(new Date).getTime(),u=this.baseUrl+"/projects/"+encodeURIComponent(l+"/"+n)+"/repository/files/"+encodeURIComponent(a)+
"?ref="+p;f=a.split("/");this.ui.convertFile(u+g,0<f.length?f[f.length-1]:a,null,this.extension,e,c,mxUtils.bind(this,function(a,b,c){a=new mxXmlRequest(a,null,"GET");this.executeRequest(a,mxUtils.bind(this,function(a){try{b(this.getFileContent(JSON.parse(a.getText())))}catch(y){c(y)}}),c)}))}else c({message:mxResources.get("accessDenied")});else g="&t="+(new Date).getTime(),u=this.baseUrl+"/projects/"+encodeURIComponent(l+"/"+n)+"/repository/files/"+encodeURIComponent(a)+"?ref="+p,g=new mxXmlRequest(u+
-g,null,"GET"),this.executeRequest(g,mxUtils.bind(this,function(a){try{e(this.createGitLabFile(l,n,p,JSON.parse(a.getText()),b,d))}catch(q){c(q)}}),c)}),c,f)};
+g,null,"GET"),this.executeRequest(g,mxUtils.bind(this,function(a){try{e(this.createGitLabFile(l,n,p,JSON.parse(a.getText()),b,d))}catch(t){c(t)}}),c)}),c,f)};
GitLabClient.prototype.getFileContent=function(a){var e=a.file_name,c=a.content;"base64"===a.encoding&&(/\.jpe?g$/i.test(e)?c="data:image/jpeg;base64,"+c:/\.gif$/i.test(e)?c="data:image/gif;base64,"+c:/\.pdf$/i.test(e)?c="data:application/pdf;base64,"+c:/\.png$/i.test(e)?(a=this.ui.extractGraphModelFromPng(c),c=null!=a&&0<a.length?a:"data:image/png;base64,"+c):c=Base64.decode(c));return c};
GitLabClient.prototype.createGitLabFile=function(a,e,c,b,k,f){var l=DRAWIO_GITLAB_URL+"/";a={org:a,repo:e,ref:c,name:b.file_name,path:b.file_path,html_url:l+a+"/"+e+"/blob/"+c+"/"+b.file_path,download_url:l+a+"/"+e+"/raw/"+c+"/"+b.file_path+"?inline=false",last_commit_id:b.last_commit_id,refPos:f};b=this.getFileContent(b);return k?new GitLabLibrary(this.ui,b,a):new GitLabFile(this.ui,b,a)};
GitLabClient.prototype.insertFile=function(a,e,c,b,k,f,l){k=null!=k?k:!1;f=f.split("/");this.getRefIndex(f,!0,mxUtils.bind(this,function(d,f){var g=Math.max(f-1,0),n=d.slice(0,g).join("/"),p=d[g],u=d[f];path=d.slice(f+1,d.length).join("/");0<path.length&&(path+="/");path+=a;this.checkExists(n+"/"+p+"/"+u+"/"+path,!0,mxUtils.bind(this,function(d,g){if(d)if(k)l||(e=Base64.encode(e)),this.showCommitDialog(a,!0,mxUtils.bind(this,function(a){this.writeFile(n,p,u,path,a,e,g,mxUtils.bind(this,function(a){try{var d=
@@ -9823,20 +9826,20 @@ this.ui.getEmbeddedPng(mxUtils.bind(this,function(b){m(a.meta.last_commit_id,b)}
GitLabClient.prototype.pickFile=function(a){a=null!=a?a:mxUtils.bind(this,function(a){this.ui.loadFile("A"+encodeURIComponent(a))});this.showGitLabDialog(!0,a)};
GitLabClient.prototype.showGitLabDialog=function(a,e){var c=null,b=null,k=null,f=null,l=document.createElement("div");l.style.whiteSpace="nowrap";l.style.overflow="hidden";l.style.height="304px";var d=document.createElement("h3");mxUtils.write(d,mxResources.get(a?"selectFile":"selectFolder"));d.style.cssText="width:100%;text-align:center;margin-top:0px;margin-bottom:12px";l.appendChild(d);var g=document.createElement("div");g.style.whiteSpace="nowrap";g.style.border="1px solid lightgray";g.style.boxSizing=
"border-box";g.style.padding="4px";g.style.overflow="auto";g.style.lineHeight="1.2em";g.style.height="274px";l.appendChild(g);var m=document.createElement("div");m.style.textOverflow="ellipsis";m.style.boxSizing="border-box";m.style.overflow="hidden";m.style.padding="4px";m.style.width="100%";var n=new CustomDialog(this.ui,l,mxUtils.bind(this,function(){e(c+"/"+b+"/"+encodeURIComponent(k)+"/"+f)}));this.ui.showDialog(n.container,420,360,!0,!0);a&&n.okButton.parentNode.removeChild(n.okButton);var p=
-mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("title",a);mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=m.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),u=mxUtils.bind(this,function(a){var d=document.createElement("div");d.style.marginBottom="8px";d.appendChild(p(c+"/"+b,mxUtils.bind(this,function(){f=null;A()})));a||(mxUtils.write(d," / "),d.appendChild(p(decodeURIComponent(k),mxUtils.bind(this,
-function(){f=null;y()}))));if(null!=f&&0<f.length){var e=f.split("/");for(a=0;a<e.length;a++)(function(a){mxUtils.write(d," / ");d.appendChild(p(e[a],mxUtils.bind(this,function(){f=e.slice(0,a+1).join("/");z()})))})(a)}g.appendChild(d)}),t=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=k=b=c=null,A()):this.ui.hideDialog()}))}),q=null,v=null,z=mxUtils.bind(this,function(d){null==d&&(g.innerHTML="",d=1);var l=new mxXmlRequest(this.baseUrl+
-"/projects/"+encodeURIComponent(c+"/"+b)+"/repository/tree?path="+f+"&ref="+k+"&per_page=100&page="+d,null,"GET");this.ui.spinner.spin(g,mxResources.get("loading"));n.okButton.removeAttribute("disabled");null!=v&&(mxEvent.removeListener(g,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");mxUtils.write(q,mxResources.get("more")+"...");var x=mxUtils.bind(this,function(){z(d+
-1)});mxEvent.addListener(q,"click",x);this.executeRequest(l,mxUtils.bind(this,function(l){this.ui.spinner.stop();1==d&&(u(!k),g.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,A();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");z()}}),"4px")));var n=JSON.parse(l.getText());if(null==n||0==n.length)mxUtils.write(g,mxResources.get("noFiles"));else{var B=!0,t=0;l=mxUtils.bind(this,function(d){for(var l=0;l<n.length;l++)mxUtils.bind(this,function(l){if(d==("tree"==l.type)){var n=
-m.cloneNode();n.style.backgroundColor=B?"#eeeeee":"";B=!B;var x=document.createElement("img");x.src=IMAGE_PATH+"/"+("tree"==l.type?"folder.png":"file.png");x.setAttribute("align","absmiddle");x.style.marginRight="4px";x.style.marginTop="-4px";x.width=20;n.appendChild(x);n.appendChild(p(l.name+("tree"==l.type?"/":""),mxUtils.bind(this,function(){"tree"==l.type?(f=l.path,z()):a&&"blob"==l.type&&(this.ui.hideDialog(),e(c+"/"+b+"/"+k+"/"+l.path))})));g.appendChild(n);t++}})(n[l])});l(!0);a&&l(!1);100==
-t&&(g.appendChild(q),v=function(){g.scrollTop>=g.scrollHeight-g.offsetHeight&&x()},mxEvent.addListener(g,"scroll",v))}}),t,!0)}),y=mxUtils.bind(this,function(a){null==a&&(g.innerHTML="",a=1);var d=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(c+"/"+b)+"/repository/branches?per_page=100&page="+a,null,"GET");n.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(g,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(g,"scroll",v),v=null);null!=q&&null!=q.parentNode&&
-q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");mxUtils.write(q,mxResources.get("more")+"...");var e=mxUtils.bind(this,function(){y(a+1)});mxEvent.addListener(q,"click",e);this.executeRequest(d,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),g.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;A()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(g,mxResources.get("noFiles"));
-else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a,b){var c=m.cloneNode();c.style.backgroundColor=0==b%2?"#eeeeee":"";c.appendChild(p(a.name,mxUtils.bind(this,function(){k=encodeURIComponent(a.name);f="";z()})));g.appendChild(c)})(b[c],c);100==b.length&&(g.appendChild(q),v=function(){g.scrollTop>=g.scrollHeight-g.offsetHeight&&e()},mxEvent.addListener(g,"scroll",v))}}),t)});n.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(g,mxResources.get("loading"));var A=mxUtils.bind(this,
-function(a){this.ui.spinner.stop();null==a&&(g.innerHTML="",a=1);null!=v&&(mxEvent.removeListener(g,"scroll",v),v=null);null!=q&&null!=q.parentNode&&q.parentNode.removeChild(q);q=document.createElement("a");q.style.display="block";q.setAttribute("href","javascript:void(0);");mxUtils.write(q,mxResources.get("more")+"...");var d=mxUtils.bind(this,function(){A(a+1)});mxEvent.addListener(q,"click",d);var e=mxUtils.bind(this,function(a){this.ui.spinner.spin(g,mxResources.get("loading"));var b=new mxXmlRequest(this.baseUrl+
-"/groups?per_page=100",null,"GET");this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();a(JSON.parse(b.getText()))}),t)}),l=mxUtils.bind(this,function(a,b){this.ui.spinner.spin(g,mxResources.get("loading"));var c=new mxXmlRequest(this.baseUrl+"/groups/"+a.id+"/projects?per_page=100",null,"GET");this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();b(a,JSON.parse(c.getText()))}),t)});e(mxUtils.bind(this,function(e){var n=new mxXmlRequest(this.baseUrl+"/users/"+
+mxUtils.bind(this,function(a,b,c){var d=document.createElement("a");d.setAttribute("href","javascript:void(0);");d.setAttribute("title",a);mxUtils.write(d,a);mxEvent.addListener(d,"click",b);null!=c&&(a=m.cloneNode(),a.style.padding=c,a.appendChild(d),d=a);return d}),u=mxUtils.bind(this,function(a){var d=document.createElement("div");d.style.marginBottom="8px";d.appendChild(p(c+"/"+b,mxUtils.bind(this,function(){f=null;B()})));a||(mxUtils.write(d," / "),d.appendChild(p(decodeURIComponent(k),mxUtils.bind(this,
+function(){f=null;y()}))));if(null!=f&&0<f.length){var e=f.split("/");for(a=0;a<e.length;a++)(function(a){mxUtils.write(d," / ");d.appendChild(p(e[a],mxUtils.bind(this,function(){f=e.slice(0,a+1).join("/");z()})))})(a)}g.appendChild(d)}),q=mxUtils.bind(this,function(a){this.ui.handleError(a,null,mxUtils.bind(this,function(){this.ui.spinner.stop();null!=this.getUser()?(f=k=b=c=null,B()):this.ui.hideDialog()}))}),t=null,v=null,z=mxUtils.bind(this,function(d){null==d&&(g.innerHTML="",d=1);var l=new mxXmlRequest(this.baseUrl+
+"/projects/"+encodeURIComponent(c+"/"+b)+"/repository/tree?path="+f+"&ref="+k+"&per_page=100&page="+d,null,"GET");this.ui.spinner.spin(g,mxResources.get("loading"));n.okButton.removeAttribute("disabled");null!=v&&(mxEvent.removeListener(g,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.setAttribute("href","javascript:void(0);");mxUtils.write(t,mxResources.get("more")+"...");var x=mxUtils.bind(this,function(){z(d+
+1)});mxEvent.addListener(t,"click",x);this.executeRequest(l,mxUtils.bind(this,function(l){this.ui.spinner.stop();1==d&&(u(!k),g.appendChild(p("../ [Up]",mxUtils.bind(this,function(){if(""==f)f=null,B();else{var a=f.split("/");f=a.slice(0,a.length-1).join("/");z()}}),"4px")));var n=JSON.parse(l.getText());if(null==n||0==n.length)mxUtils.write(g,mxResources.get("noFiles"));else{var A=!0,q=0;l=mxUtils.bind(this,function(d){for(var l=0;l<n.length;l++)mxUtils.bind(this,function(l){if(d==("tree"==l.type)){var n=
+m.cloneNode();n.style.backgroundColor=A?"#eeeeee":"";A=!A;var x=document.createElement("img");x.src=IMAGE_PATH+"/"+("tree"==l.type?"folder.png":"file.png");x.setAttribute("align","absmiddle");x.style.marginRight="4px";x.style.marginTop="-4px";x.width=20;n.appendChild(x);n.appendChild(p(l.name+("tree"==l.type?"/":""),mxUtils.bind(this,function(){"tree"==l.type?(f=l.path,z()):a&&"blob"==l.type&&(this.ui.hideDialog(),e(c+"/"+b+"/"+k+"/"+l.path))})));g.appendChild(n);q++}})(n[l])});l(!0);a&&l(!1);100==
+q&&(g.appendChild(t),v=function(){g.scrollTop>=g.scrollHeight-g.offsetHeight&&x()},mxEvent.addListener(g,"scroll",v))}}),q,!0)}),y=mxUtils.bind(this,function(a){null==a&&(g.innerHTML="",a=1);var d=new mxXmlRequest(this.baseUrl+"/projects/"+encodeURIComponent(c+"/"+b)+"/repository/branches?per_page=100&page="+a,null,"GET");n.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(g,mxResources.get("loading"));null!=v&&(mxEvent.removeListener(g,"scroll",v),v=null);null!=t&&null!=t.parentNode&&
+t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.setAttribute("href","javascript:void(0);");mxUtils.write(t,mxResources.get("more")+"...");var e=mxUtils.bind(this,function(){y(a+1)});mxEvent.addListener(t,"click",e);this.executeRequest(d,mxUtils.bind(this,function(b){this.ui.spinner.stop();1==a&&(u(!0),g.appendChild(p("../ [Up]",mxUtils.bind(this,function(){f=null;B()}),"4px")));b=JSON.parse(b.getText());if(null==b||0==b.length)mxUtils.write(g,mxResources.get("noFiles"));
+else{for(var c=0;c<b.length;c++)mxUtils.bind(this,function(a,b){var c=m.cloneNode();c.style.backgroundColor=0==b%2?"#eeeeee":"";c.appendChild(p(a.name,mxUtils.bind(this,function(){k=encodeURIComponent(a.name);f="";z()})));g.appendChild(c)})(b[c],c);100==b.length&&(g.appendChild(t),v=function(){g.scrollTop>=g.scrollHeight-g.offsetHeight&&e()},mxEvent.addListener(g,"scroll",v))}}),q)});n.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(g,mxResources.get("loading"));var B=mxUtils.bind(this,
+function(a){this.ui.spinner.stop();null==a&&(g.innerHTML="",a=1);null!=v&&(mxEvent.removeListener(g,"scroll",v),v=null);null!=t&&null!=t.parentNode&&t.parentNode.removeChild(t);t=document.createElement("a");t.style.display="block";t.setAttribute("href","javascript:void(0);");mxUtils.write(t,mxResources.get("more")+"...");var d=mxUtils.bind(this,function(){B(a+1)});mxEvent.addListener(t,"click",d);var e=mxUtils.bind(this,function(a){this.ui.spinner.spin(g,mxResources.get("loading"));var b=new mxXmlRequest(this.baseUrl+
+"/groups?per_page=100",null,"GET");this.executeRequest(b,mxUtils.bind(this,function(b){this.ui.spinner.stop();a(JSON.parse(b.getText()))}),q)}),l=mxUtils.bind(this,function(a,b){this.ui.spinner.spin(g,mxResources.get("loading"));var c=new mxXmlRequest(this.baseUrl+"/groups/"+a.id+"/projects?per_page=100",null,"GET");this.executeRequest(c,mxUtils.bind(this,function(c){this.ui.spinner.stop();b(a,JSON.parse(c.getText()))}),q)});e(mxUtils.bind(this,function(e){var n=new mxXmlRequest(this.baseUrl+"/users/"+
this.user.id+"/projects?per_page=100&page="+a,null,"GET");this.ui.spinner.spin(g,mxResources.get("loading"));this.executeRequest(n,mxUtils.bind(this,function(n){this.ui.spinner.stop();n=JSON.parse(n.getText());if(null!=n&&0!=n.length||null!=e&&0!=e.length){1==a&&(g.appendChild(p(mxResources.get("enterValue")+"...",mxUtils.bind(this,function(){var a=new FilenameDialog(this.ui,"org/repo/ref",mxResources.get("ok"),mxUtils.bind(this,function(a){null!=a&&(a=a.split("/"),1<a.length?(c=a[0],b=a[1],k="master",
-f=null,2<a.length&&(f=encodeURIComponent(a.slice(2,a.length).join("/"))),z()):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(g),mxUtils.br(g));for(var x=!0,B=0;B<n.length;B++)mxUtils.bind(this,function(a,d){var e=m.cloneNode();e.style.backgroundColor=x?"#eeeeee":"";x=!x;e.appendChild(p(a.name_with_namespace,mxUtils.bind(this,function(){c=a.owner.username;b=
-a.path;k=a.default_branch||"master";f="";z()})));g.appendChild(e)})(n[B],B);for(B=0;B<e.length;B++)l(e[B],mxUtils.bind(this,function(a,d){for(var e=0;e<d.length;e++){var l=m.cloneNode();l.style.backgroundColor=x?"#eeeeee":"";x=!x;mxUtils.bind(this,function(d){l.appendChild(p(d.name_with_namespace,mxUtils.bind(this,function(){c=a.full_path;b=d.path;k=d.default_branch||"master";f="";z()})));g.appendChild(l)})(d[e])}}))}else mxUtils.write(g,mxResources.get("noFiles"));100==n.length&&(g.appendChild(q),
-v=function(){g.scrollTop>=g.scrollHeight-g.offsetHeight&&d()},mxEvent.addListener(g,"scroll",v))}),t)}))});this.token?this.user?A():this.updateUser(function(){A()},t,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){A()},t,!0)}),t)};GitLabClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};DrawioComment=function(a,e,c,b,k,f,l){this.file=a;this.id=e;this.content=c;this.modifiedDate=b;this.createdDate=k;this.isResolved=f;this.user=l;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(a){null!=a&&this.replies.push(a)};DrawioComment.prototype.addReply=function(a,e,c,b,k){e()};DrawioComment.prototype.editComment=function(a,e,c){e()};DrawioComment.prototype.deleteComment=function(a,e){a()};DriveComment=function(a,e,c,b,k,f,l,d){DrawioComment.call(this,a,e,c,b,k,f,l);this.pCommentId=d};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(a,e,c,b,k){a={content:a.content};b?a.verb="resolve":k&&(a.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:a,method:"POST"},mxUtils.bind(this,function(a){e(a.replyId)}),c)};
+f=null,2<a.length&&(f=encodeURIComponent(a.slice(2,a.length).join("/"))),z()):(this.ui.spinner.stop(),this.ui.handleError({message:mxResources.get("invalidName")})))}),mxResources.get("enterValue"));this.ui.showDialog(a.container,300,80,!0,!1);a.init()}))),mxUtils.br(g),mxUtils.br(g));for(var x=!0,A=0;A<n.length;A++)mxUtils.bind(this,function(a,d){var e=m.cloneNode();e.style.backgroundColor=x?"#eeeeee":"";x=!x;e.appendChild(p(a.name_with_namespace,mxUtils.bind(this,function(){c=a.owner.username;b=
+a.path;k=a.default_branch||"master";f="";z()})));g.appendChild(e)})(n[A],A);for(A=0;A<e.length;A++)l(e[A],mxUtils.bind(this,function(a,d){for(var e=0;e<d.length;e++){var l=m.cloneNode();l.style.backgroundColor=x?"#eeeeee":"";x=!x;mxUtils.bind(this,function(d){l.appendChild(p(d.name_with_namespace,mxUtils.bind(this,function(){c=a.full_path;b=d.path;k=d.default_branch||"master";f="";z()})));g.appendChild(l)})(d[e])}}))}else mxUtils.write(g,mxResources.get("noFiles"));100==n.length&&(g.appendChild(t),
+v=function(){g.scrollTop>=g.scrollHeight-g.offsetHeight&&d()},mxEvent.addListener(g,"scroll",v))}),q)}))});this.token?this.user?B():this.updateUser(function(){B()},q,!0):this.authenticate(mxUtils.bind(this,function(){this.updateUser(function(){B()},q,!0)}),q)};GitLabClient.prototype.logout=function(){this.clearPersistentToken();this.setUser(null);this.token=null};DrawioComment=function(a,e,c,b,k,f,l){this.file=a;this.id=e;this.content=c;this.modifiedDate=b;this.createdDate=k;this.isResolved=f;this.user=l;this.replies=[]};DrawioComment.prototype.addReplyDirect=function(a){null!=a&&this.replies.push(a)};DrawioComment.prototype.addReply=function(a,e,c,b,k){e()};DrawioComment.prototype.editComment=function(a,e,c){e()};DrawioComment.prototype.deleteComment=function(a,e){a()};DriveComment=function(a,e,c,b,k,f,l,d){DrawioComment.call(this,a,e,c,b,k,f,l);this.pCommentId=d};mxUtils.extend(DriveComment,DrawioComment);DriveComment.prototype.addReply=function(a,e,c,b,k){a={content:a.content};b?a.verb="resolve":k&&(a.verb="reopen");this.file.ui.drive.executeRequest({url:"/files/"+this.file.getId()+"/comments/"+this.id+"/replies",params:a,method:"POST"},mxUtils.bind(this,function(a){e(a.replyId)}),c)};
DriveComment.prototype.editComment=function(a,e,c){this.content=a;a={content:a};this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,params:a,method:"PATCH"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,params:a,method:"PATCH"},e,c)};
DriveComment.prototype.deleteComment=function(a,e){this.file.ui.drive.executeRequest(this.pCommentId?{url:"/files/"+this.file.getId()+"/comments/"+this.pCommentId+"/replies/"+this.id,method:"DELETE"}:{url:"/files/"+this.file.getId()+"/comments/"+this.id,method:"DELETE"},a,e)};App=function(a,e,c){EditorUi.call(this,a,e,null!=c?c:"1"==urlParams.lightbox||"min"==uiTheme&&"0"!=urlParams.chrome);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||(window.onunload=mxUtils.bind(this,function(){var a=this.getCurrentFile();if(null!=a&&a.isModified()){var c={category:"DISCARD-FILE-"+a.getHash(),action:(a.savingFile?"saving":"")+(a.savingFile&&null!=a.savingFileTime?"_"+Math.round((Date.now()-a.savingFileTime.getTime())/1E3):"")+(null!=a.saveLevel?"-sl_"+a.saveLevel:"")+"-age_"+(null!=
a.ageStart?Math.round((Date.now()-a.ageStart.getTime())/1E3):"x")+(this.editor.autosave?"":"-nosave")+(a.isAutosave()?"":"-noauto")+"-open_"+(null!=a.opened?Math.round((Date.now()-a.opened.getTime())/1E3):"x")+"-save_"+(null!=a.lastSaved?Math.round((Date.now()-a.lastSaved.getTime())/1E3):"x")+"-change_"+(null!=a.lastChanged?Math.round((Date.now()-a.lastChanged.getTime())/1E3):"x")+"-alive_"+Math.round((Date.now()-App.startTime.getTime())/1E3),label:null!=a.sync?"client_"+a.sync.clientId:"nosync"};
@@ -9887,7 +9890,7 @@ this.fireEvent(new mxEventObject("clientLoaded","client",this.trello))}catch(f){
this.fireEvent(new mxEventObject("clientLoaded","client",this.drive))});null!=window.DrawGapiClientCallback?(gapi.load(("0"!=urlParams.picker?"picker,":"")+App.GOOGLE_APIS,a),window.DrawGapiClientCallback=null):a()}else null==window.DrawGapiClientCallback&&(window.DrawGapiClientCallback=c)});c()}if("1"!=urlParams.embed||"1"==urlParams.db){var b=mxUtils.bind(this,function(){if("function"===typeof Dropbox&&"undefined"!==typeof Dropbox.choose){window.DrawDropboxClientCallback=null;try{this.dropbox=new DropboxClient(this),
this.dropbox.addListener("userChanged",mxUtils.bind(this,function(){this.updateUserElement();this.restoreLibraries()})),this.fireEvent(new mxEventObject("clientLoaded","client",this.dropbox))}catch(f){null!=window.console&&console.error(f)}}else null==window.DrawDropboxClientCallback&&(window.DrawDropboxClientCallback=b)});b()}if("1"!=urlParams.embed){if(this.bg=this.createBackground(),document.body.appendChild(this.bg),this.diagramContainer.style.visibility="hidden",this.formatContainer.style.visibility=
"hidden",this.hsplit.style.display="none",this.sidebarContainer.style.display="none",this.sidebarFooterContainer.style.display="none","1"==urlParams.local?this.setMode(App.MODE_DEVICE):this.mode=App.mode,"serviceWorker"in navigator&&(mxClient.IS_ANDROID||mxClient.IS_IOS)&&window.addEventListener("beforeinstallprompt",mxUtils.bind(this,function(a){this.showBanner("AddToHomeScreenFooter",mxResources.get("installApp"),function(){a.prompt()})})),mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||this.isOffline()||
-mxClient.IS_ANDROID||mxClient.IS_IOS||null!=urlParams.open||this.editor.chromeless&&!this.editor.editable||this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var a=this.getCurrentFile(),a=null!=a?a.getMode():null;a!=App.MODE_DEVICE&&a!=App.MODE_BROWSER||this.showDownloadDesktopBanner()})),!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&"1"!=urlParams.embed&&"auto"==DrawioFile.SYNC&&"1"!=urlParams.local&&"1"!=urlParams.stealth&&this.isOffline()&&(!this.editor.chromeless||this.editor.editable)){var k=
+mxClient.IS_ANDROID||mxClient.IS_IOS||null!=urlParams.open||this.editor.chromeless&&!this.editor.editable||this.editor.addListener("fileLoaded",mxUtils.bind(this,function(){var a=this.getCurrentFile(),a=null!=a?a.getMode():null;a!=App.MODE_DEVICE&&a!=App.MODE_BROWSER||this.showDownloadDesktopBanner()})),!(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||"1"==urlParams.embed||"auto"!=DrawioFile.SYNC||"1"==urlParams.local||"1"==urlParams.stealth||this.isOffline()||this.editor.chromeless&&!this.editor.editable)){var k=
window.setTimeout(mxUtils.bind(this,function(){DrawioFile.SYNC="manual";var a=this.getCurrentFile();null!=a&&null!=a.sync&&(a.sync.destroy(),a.sync=null,a=mxUtils.htmlEntities(mxResources.get("timeout")),this.editor.setStatus('<div title="'+a+'" class="geStatusAlert" style="overflow:hidden;">'+a+"</div>"));EditorUi.logEvent({category:"TIMEOUT-CACHE-CHECK",action:"timeout",label:408})}),Editor.cacheTimeout);(new Date).getTime();mxUtils.get(EditorUi.cacheUrl+"?alive",mxUtils.bind(this,function(a){window.clearTimeout(k)}))}}else null!=
this.menubar&&(this.menubar.container.style.paddingTop="0px");this.updateHeader();null!=this.menubar&&(this.buttonContainer=document.createElement("div"),this.buttonContainer.style.display="inline-block",this.buttonContainer.style.paddingRight="48px",this.buttonContainer.style.position="absolute",this.buttonContainer.style.right="0px",this.menubar.container.appendChild(this.buttonContainer));"atlas"==uiTheme&&null!=this.menubar&&(null!=this.toggleElement&&(this.toggleElement.click(),this.toggleElement.style.display=
"none"),this.icon=document.createElement("img"),this.icon.setAttribute("src",IMAGE_PATH+"/logo-flat-small.png"),this.icon.setAttribute("title",mxResources.get("draw.io")),this.icon.style.padding="6px",this.icon.style.cursor="pointer",mxEvent.addListener(this.icon,"click",mxUtils.bind(this,function(a){this.appIconClicked(a)})),mxClient.IS_QUIRKS&&(this.icon.style.marginTop="12px"),this.menubar.container.insertBefore(this.icon,this.menubar.container.firstChild));this.editor.graph.isViewer()&&this.initializeViewerMode()};
@@ -9907,9 +9910,9 @@ App.prototype.onBeforeUnload=function(){if("1"==urlParams.embed&&this.editor.mod
App.prototype.updateDocumentTitle=function(){if(!this.editor.graph.isLightboxView()){var a=this.editor.appName,e=this.getCurrentFile();this.isOfflineApp()&&(a+=" app");null!=e&&(a=(null!=e.getTitle()?e.getTitle():this.defaultFilename)+" - "+a);document.title!=a&&(document.title=a,a=this.editor.graph,a.invalidateDescendantsWithPlaceholders(a.model.getRoot()),a.view.validate())}};
App.prototype.getThumbnail=function(a,e){var c=!1;try{var b=!0,k=window.setTimeout(mxUtils.bind(this,function(){b=!1;e(null)}),this.timeout),f=mxUtils.bind(this,function(a){window.clearTimeout(k);b&&e(a)});null==this.thumbImageCache&&(this.thumbImageCache={});var l=this.editor.graph,d=null!=l.themes&&"darkTheme"==l.defaultThemeName;if(d||null!=this.pages&&this.currentPage!=this.pages[0]){var g=l.getGlobalVariable,l=this.createTemporaryGraph(d?l.getDefaultStylesheet():l.getStylesheet()),m=this.pages[0];
d&&(l.defaultThemeName="default");l.getGlobalVariable=function(a){return"page"==a?m.getName():"pagenumber"==a?1:g.apply(this,arguments)};l.getGlobalVariable=g;document.body.appendChild(l.container);l.model.setRoot(m.root)}if(mxClient.IS_CHROMEAPP||this.useCanvasForExport)this.editor.exportToCanvas(mxUtils.bind(this,function(a){try{l!=this.editor.graph&&null!=l.container.parentNode&&l.container.parentNode.removeChild(l.container)}catch(C){a=null}f(a)}),a,this.thumbImageCache,"#ffffff",function(){f()},
-null,null,null,null,null,null,l),c=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var n=document.createElement("canvas"),p=l.getGraphBounds(),u=a/p.width,u=Math.min(1,Math.min(3*a/(4*p.height),u)),t=Math.floor(p.x),q=Math.floor(p.y);n.setAttribute("width",Math.ceil(u*(p.width+4)));n.setAttribute("height",Math.ceil(u*(p.height+4)));var v=n.getContext("2d");v.scale(u,u);v.translate(-t,-q);var z=l.background;if(null==z||""==z||z==mxConstants.NONE)z="#ffffff";v.save();v.fillStyle=z;v.fillRect(t,
-q,Math.ceil(p.width+4),Math.ceil(p.height+4));v.restore();var y=new mxJsCanvas(n),A=new mxAsyncCanvas(this.thumbImageCache);y.images=this.thumbImageCache.images;var x=new mxImageExport;x.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};x.drawText=function(a,b){};x.drawState(l.getView().getState(l.model.root),A);A.finish(mxUtils.bind(this,function(){try{x.drawState(l.getView().getState(l.model.root),
-y),l!=this.editor.graph&&null!=l.container.parentNode&&l.container.parentNode.removeChild(l.container)}catch(B){n=null}f(n)}));c=!0}}catch(B){c=!1,null!=l&&l!=this.editor.graph&&null!=l.container.parentNode&&l.container.parentNode.removeChild(l.container)}return c};
+null,null,null,null,null,null,l),c=!0;else if(this.canvasSupported&&null!=this.getCurrentFile()){var n=document.createElement("canvas"),p=l.getGraphBounds(),u=a/p.width,u=Math.min(1,Math.min(3*a/(4*p.height),u)),q=Math.floor(p.x),t=Math.floor(p.y);n.setAttribute("width",Math.ceil(u*(p.width+4)));n.setAttribute("height",Math.ceil(u*(p.height+4)));var v=n.getContext("2d");v.scale(u,u);v.translate(-q,-t);var z=l.background;if(null==z||""==z||z==mxConstants.NONE)z="#ffffff";v.save();v.fillStyle=z;v.fillRect(q,
+t,Math.ceil(p.width+4),Math.ceil(p.height+4));v.restore();var y=new mxJsCanvas(n),B=new mxAsyncCanvas(this.thumbImageCache);y.images=this.thumbImageCache.images;var x=new mxImageExport;x.drawShape=function(a,b){a.shape instanceof mxShape&&a.shape.checkBounds()&&(b.save(),b.translate(.5,.5),a.shape.paint(b),b.translate(-.5,-.5),b.restore())};x.drawText=function(a,b){};x.drawState(l.getView().getState(l.model.root),B);B.finish(mxUtils.bind(this,function(){try{x.drawState(l.getView().getState(l.model.root),
+y),l!=this.editor.graph&&null!=l.container.parentNode&&l.container.parentNode.removeChild(l.container)}catch(A){n=null}f(n)}));c=!0}}catch(A){c=!1,null!=l&&l!=this.editor.graph&&null!=l.container.parentNode&&l.container.parentNode.removeChild(l.container)}return c};
App.prototype.createBackground=function(){var a=this.createDiv("background");a.style.position="absolute";a.style.background="white";a.style.left="0px";a.style.top="0px";a.style.bottom="0px";a.style.right="0px";mxUtils.setOpacity(a,100);mxClient.IS_QUIRKS&&new mxDivResizer(a);return a};
(function(){var a=EditorUi.prototype.setMode;App.prototype.setMode=function(e,c){a.apply(this,arguments);null!=this.mode&&(Editor.useLocalStorage=this.mode==App.MODE_BROWSER);if(null!=this.appIcon){var b=this.getCurrentFile();e=null!=b?b.getMode():e;e==App.MODE_GOOGLE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("googleDrive")])),this.appIcon.style.cursor="pointer"):e==App.MODE_DROPBOX?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("dropbox")])),
this.appIcon.style.cursor="pointer"):e==App.MODE_ONEDRIVE?(this.appIcon.setAttribute("title",mxResources.get("openIt",[mxResources.get("oneDrive")])),this.appIcon.style.cursor="pointer"):(this.appIcon.removeAttribute("title"),this.appIcon.style.cursor=e==App.MODE_DEVICE?"pointer":"default")}if(c)try{if(isLocalStorage)localStorage.setItem(".mode",e);else if("undefined"!=typeof Storage){var k=new Date;k.setYear(k.getFullYear()+1);document.cookie="MODE="+e+"; expires="+k.toUTCString()}}catch(f){}}})();
@@ -9978,7 +9981,7 @@ null!=e&&this.sidebar.showEntries(e);if(null!=k){for(var b=[],d=k.split(";"),f=0
null==a.getMode())),null!=b&&b(),window.openWindow(f,null,l))});a.constructor==LocalFile?p():a.saveFile(a.getTitle(),!1,mxUtils.bind(this,function(){p()}),mxUtils.bind(this,function(a){n();this.handleError(a)}))}};
App.prototype.loadFile=function(a,e,c,b,k){this.hideDialog();var f=mxUtils.bind(this,function(){if(null==a||0==a.length)this.editor.setStatus(""),this.fileLoaded(null);else if(this.spinner.spin(document.body,mxResources.get("loading")))if("L"==a.charAt(0))if(this.spinner.stop(),isLocalStorage){var d=mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}))});a=decodeURIComponent(a.substring(1));
StorageFile.getFileContent(this,a,mxUtils.bind(this,function(c){null!=c?(this.fileLoaded(new StorageFile(this,c,a)),null!=b&&b()):d({message:mxResources.get("fileNotFound")})}),d)}else this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){var a=this.getCurrentFile();window.location.hash=null!=a?a.getHash():""}));else if(null!=c)this.spinner.stop(),this.fileLoaded(c),null!=b&&b();else if("S"==a.charAt(0)){this.spinner.stop();
-try{this.loadDescriptor(JSON.parse(Graph.decompress(a.substring(1))),b,mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))}))}catch(t){this.handleError(t,mxResources.get("errorLoadingFile"))}}else if("R"==a.charAt(0)){this.spinner.stop();var f=decodeURIComponent(a.substring(1));"<"!=f.charAt(0)&&(f=Graph.decompress(f));f=new LocalFile(this,f,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);f.getHash=function(){return a};this.fileLoaded(f);
+try{this.loadDescriptor(JSON.parse(Graph.decompress(a.substring(1))),b,mxUtils.bind(this,function(a){this.handleError(a,mxResources.get("errorLoadingFile"))}))}catch(q){this.handleError(q,mxResources.get("errorLoadingFile"))}}else if("R"==a.charAt(0)){this.spinner.stop();var f=decodeURIComponent(a.substring(1));"<"!=f.charAt(0)&&(f=Graph.decompress(f));f=new LocalFile(this,f,null!=urlParams.title?decodeURIComponent(urlParams.title):this.defaultFilename,!0);f.getHash=function(){return a};this.fileLoaded(f);
null!=b&&b()}else if("U"==a.charAt(0)){var k=decodeURIComponent(a.substring(1)),l=mxUtils.bind(this,function(){if("https://drive.google.com/uc?id="!=k.substring(0,31)||null==this.drive&&"function"!==typeof window.DriveClient)return!1;this.hideDialog();var a=mxUtils.bind(this,function(){this.spinner.stop();if(null!=this.drive){var a=k.substring(31,k.lastIndexOf("&ex"));this.loadFile("G"+a,e,null,mxUtils.bind(this,function(){var c=this.getCurrentFile();null!=c&&this.editor.chromeless&&!this.editor.editable&&
(c.getHash=function(){return"G"+a},window.location.hash="#"+c.getHash());null!=b&&b()}));return!0}return!1});!a()&&this.spinner.spin(document.body,mxResources.get("loading"))&&this.addListener("clientLoaded",a);return!0});this.loadTemplate(k,mxUtils.bind(this,function(b){this.spinner.stop();if(null!=b&&0<b.length){var c=this.defaultFilename;if(null==urlParams.title&&"1"!=urlParams.notitle){var d=k,e=k.lastIndexOf("."),f=d.lastIndexOf("/");e>f&&0<f&&(d=d.substring(f+1,e),e=k.substring(e),this.useCanvasForExport||
".png"!=e||(e=".drawio"),".svg"===e||".xml"===e||".html"===e||".png"===e||".drawio"===e)&&(c=d+e)}b=new LocalFile(this,b,null!=urlParams.title?decodeURIComponent(urlParams.title):c,!0);b.getHash=function(){return a};this.fileLoaded(b,!0)||l()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}else l()||this.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))}),mxUtils.bind(this,function(){l()||(this.spinner.stop(),
@@ -9990,8 +9993,8 @@ App.prototype.getLibraryStorageHint=function(a){var e=a.getTitle();a.constructor
mxResources.get("browser")+")":a.constructor==LocalLibrary&&(e+=" ("+mxResources.get("device")+")");return e};App.prototype.restoreLibraries=function(){this.loadLibraries(mxSettings.getCustomLibraries(),mxUtils.bind(this,function(){this.loadLibraries((urlParams.clibs||"").split(";"))}))};
App.prototype.loadLibraries=function(a,e){if(null!=this.sidebar){null==this.pendingLibraries&&(this.pendingLibraries={});var c=mxUtils.bind(this,function(a,b){b||mxSettings.removeCustomLibrary(a);delete this.pendingLibraries[a]}),b=0,k=[],f=mxUtils.bind(this,function(){if(0==b){if(null!=a)for(var c=a.length-1;0<=c;c--)null!=k[c]&&this.loadLibrary(k[c]);null!=e&&e()}});if(null!=a)for(var l=0;l<a.length;l++){var d=encodeURIComponent(decodeURIComponent(a[l]));mxUtils.bind(this,function(a,d){if(null!=
a&&0<a.length&&null==this.pendingLibraries[a]&&null==this.sidebar.palettes[a]){b++;var e=mxUtils.bind(this,function(c){delete this.pendingLibraries[a];k[d]=c;b--;f()}),g=mxUtils.bind(this,function(d){c(a,d);b--;f()});this.pendingLibraries[a]=!0;var l=a.substring(0,1);if("L"==l)(isLocalStorage||mxClient.IS_CHROMEAPP)&&window.setTimeout(mxUtils.bind(this,function(){try{var b=decodeURIComponent(a.substring(1));StorageFile.getFileContent(this,b,mxUtils.bind(this,function(a){".scratchpad"==b&&null==a&&
-(a=this.emptyLibraryXml);null!=a?e(new StorageLibrary(this,a,b)):g()}),g)}catch(y){g()}}),0);else if("U"==l){var m=decodeURIComponent(a.substring(1));this.isOffline()||this.loadTemplate(m,mxUtils.bind(this,function(a){null!=a&&0<a.length?e(new UrlLibrary(this,a,m)):g()}),g,null,!0)}else if("R"==l){if(l=decodeURIComponent(a.substring(1)),!this.isOffline())try{var l=JSON.parse(l),q={id:l[0],title:l[1],downloadUrl:l[2]};this.remoteInvoke("getFileContent",[q.downloadUrl],null,mxUtils.bind(this,function(a){try{e(new RemoteLibrary(this,
-a,q))}catch(y){g()}}),function(){g()})}catch(z){g()}}else if("S"==l&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(a.substring(1)),function(a){e(a)},g)}catch(z){g()}else{var v=null;"G"==l?null!=this.drive&&null!=this.drive.user&&(v=this.drive):"H"==l?null!=this.gitHub&&null!=this.gitHub.getUser()&&(v=this.gitHub):"T"==l?null!=this.trello&&this.trello.isAuthorized()&&(v=this.trello):"D"==l?null!=this.dropbox&&null!=this.dropbox.getUser()&&(v=this.dropbox):"W"==l&&null!=this.oneDrive&&
+(a=this.emptyLibraryXml);null!=a?e(new StorageLibrary(this,a,b)):g()}),g)}catch(y){g()}}),0);else if("U"==l){var m=decodeURIComponent(a.substring(1));this.isOffline()||this.loadTemplate(m,mxUtils.bind(this,function(a){null!=a&&0<a.length?e(new UrlLibrary(this,a,m)):g()}),g,null,!0)}else if("R"==l){if(l=decodeURIComponent(a.substring(1)),!this.isOffline())try{var l=JSON.parse(l),t={id:l[0],title:l[1],downloadUrl:l[2]};this.remoteInvoke("getFileContent",[t.downloadUrl],null,mxUtils.bind(this,function(a){try{e(new RemoteLibrary(this,
+a,t))}catch(y){g()}}),function(){g()})}catch(z){g()}}else if("S"==l&&null!=this.loadDesktopLib)try{this.loadDesktopLib(decodeURIComponent(a.substring(1)),function(a){e(a)},g)}catch(z){g()}else{var v=null;"G"==l?null!=this.drive&&null!=this.drive.user&&(v=this.drive):"H"==l?null!=this.gitHub&&null!=this.gitHub.getUser()&&(v=this.gitHub):"T"==l?null!=this.trello&&this.trello.isAuthorized()&&(v=this.trello):"D"==l?null!=this.dropbox&&null!=this.dropbox.getUser()&&(v=this.dropbox):"W"==l&&null!=this.oneDrive&&
null!=this.oneDrive.getUser()&&(v=this.oneDrive);null!=v?v.getLibrary(decodeURIComponent(a.substring(1)),mxUtils.bind(this,function(a){try{e(a)}catch(y){g()}}),function(a){g()}):g(!0)}}})(d,l)}f()}};
App.prototype.updateButtonContainer=function(){if(null!=this.buttonContainer){var a=this.getCurrentFile();this.commentsSupported()?null==this.commentButton&&(this.commentButton=document.createElement("a"),this.commentButton.setAttribute("title",mxResources.get("comments")),this.commentButton.className="geToolbarButton",this.commentButton.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;float:left;cursor:pointer;width:24px;height:24px;background-size:24px 24px;background-position:center center;background-repeat:no-repeat;background-image:url("+
Editor.commentImage+");","atlas"==uiTheme?(this.commentButton.style.marginRight="10px",this.commentButton.style.marginTop="-3px"):this.commentButton.style.marginTop="min"==uiTheme?"1px":"-5px",mxEvent.addListener(this.commentButton,"click",mxUtils.bind(this,function(){this.actions.get("comments").funct()})),this.buttonContainer.appendChild(this.commentButton),"dark"==uiTheme||"atlas"==uiTheme)&&(this.commentButton.style.filter="invert(100%)"):null!=this.commentButton&&(this.commentButton.parentNode.removeChild(this.commentButton),
@@ -10088,12 +10091,12 @@ n.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.tagsWindow&
b.fireEvent(new mxEventObject("find"))):this.findWindow.window.setVisible(!this.findWindow.window.isVisible())}));n.setToggleAction(!0);n.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.findWindow&&this.findWindow.window.isVisible()}));b.actions.put("exportVsdx",new Action(mxResources.get("formatVsdx")+" (beta)...",function(){b.exportVisio()}));isLocalStorage&&null!=localStorage&&"1"!=urlParams.embed&&b.actions.addAction("configuration...",function(){var a=localStorage.getItem(".configuration"),
a=new TextareaDialog(b,mxResources.get("configuration")+":",null!=a?JSON.stringify(JSON.parse(a),null,2):"",function(a){if(null!=a)try{if(0<a.length){var c=JSON.parse(a);localStorage.setItem(".configuration",JSON.stringify(c))}else localStorage.removeItem(".configuration");b.hideDialog();b.alert(mxResources.get("restartForChangeRequired"))}catch(D){b.handleError(D)}},null,null,null,null,null,!0,null,null,"https://desk.draw.io/support/solutions/articles/16000058316",EditorUi.isElectronApp?null:[[mxResources.get("reset"),
function(a,c){b.confirm(mxResources.get("areYouSure"),function(){try{localStorage.removeItem(".configuration"),localStorage.removeItem(".drawio-config"),localStorage.removeItem(".mode"),b.hideDialog(),b.alert(mxResources.get("restartForChangeRequired"))}catch(D){b.handleError(D)}})}],[mxResources.get("link"),function(a,c){if(0<c.value.length)try{var d=JSON.parse(c.value),e=window.location.protocol+"//"+window.location.host+"/"+b.getSearch()+"#_CONFIG_"+Graph.compress(JSON.stringify(d)),f=new EmbedDialog(b,
-e);b.showDialog(f.container,440,240,!0);f.init()}catch(E){b.handleError(E)}else b.handleError({message:mxResources.get("invalidInput")})}]]);a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!1);a.init()});if(mxClient.IS_CHROMEAPP||isLocalStorage){this.put("language",new Menu(mxUtils.bind(this,function(a,c){var d=mxUtils.bind(this,function(d){var e=""==d?mxResources.get("automatic"):mxLanguageMap[d],f=null;""!=e&&(f=a.addItem(e,null,mxUtils.bind(this,
-function(){mxSettings.setLanguage(d);mxSettings.save();mxClient.language=d;mxResources.loadDefaultBundle=!1;mxResources.add(RESOURCE_BASE);b.alert(mxResources.get("restartForChangeRequired"))}),c),(d==mxLanguage||""==d&&null==mxLanguage)&&a.addCheckmark(f,Editor.checkmarkImage));return f});d("");a.addSeparator(c);for(var e in mxLanguageMap)d(e)})));var t=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=t.apply(this,arguments);if(null!=b){var c=this.get("language");if(null!=
+e);b.showDialog(f.container,440,240,!0);f.init()}catch(F){b.handleError(F)}else b.handleError({message:mxResources.get("invalidInput")})}]]);a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!1);a.init()});if(mxClient.IS_CHROMEAPP||isLocalStorage){this.put("language",new Menu(mxUtils.bind(this,function(a,c){var d=mxUtils.bind(this,function(d){var e=""==d?mxResources.get("automatic"):mxLanguageMap[d],f=null;""!=e&&(f=a.addItem(e,null,mxUtils.bind(this,
+function(){mxSettings.setLanguage(d);mxSettings.save();mxClient.language=d;mxResources.loadDefaultBundle=!1;mxResources.add(RESOURCE_BASE);b.alert(mxResources.get("restartForChangeRequired"))}),c),(d==mxLanguage||""==d&&null==mxLanguage)&&a.addCheckmark(f,Editor.checkmarkImage));return f});d("");a.addSeparator(c);for(var e in mxLanguageMap)d(e)})));var q=Menus.prototype.createMenubar;Menus.prototype.createMenubar=function(a){var b=q.apply(this,arguments);if(null!=b){var c=this.get("language");if(null!=
c){c=b.addMenu("",c.funct);c.setAttribute("title",mxResources.get("language"));c.style.width="16px";c.style.paddingTop="2px";c.style.paddingLeft="4px";c.style.zIndex="1";c.style.position="absolute";c.style.display="block";c.style.cursor="pointer";c.style.right="17px";"atlas"==uiTheme?(c.style.top="6px",c.style.right="15px"):c.style.top="min"==uiTheme?"2px":"0px";if(mxClient.IS_VML)c.innerHTML='<div class="geIcon geSprite geSprite-globe"/>';else{var d=document.createElement("div");d.style.backgroundImage=
"url("+Editor.globeImage+")";d.style.backgroundPosition="center center";d.style.backgroundRepeat="no-repeat";d.style.backgroundSize="19px 19px";d.style.position="absolute";d.style.height="19px";d.style.width="19px";d.style.marginTop="2px";d.style.zIndex="1";c.appendChild(d);mxUtils.setOpacity(c,40);if("atlas"==uiTheme||"dark"==uiTheme)c.style.opacity="0.85",c.style.filter="invert(100%)"}document.body.appendChild(c)}}return b}}b.customLayoutConfig=[{layout:"mxHierarchicalLayout",config:{orientation:"west",
intraCellSpacing:30,interRankCellSpacing:100,interHierarchySpacing:60,parallelEdgeSpacing:10}}];b.actions.addAction("runLayout",function(){var a=new TextareaDialog(b,"Run Layouts:",JSON.stringify(b.customLayoutConfig,null,2),function(a){if(0<a.length)try{var c=JSON.parse(a);b.executeLayoutList(c);b.customLayoutConfig=c}catch(D){b.handleError(D),null!=window.console&&console.error(D)}});a.textarea.style.width="600px";a.textarea.style.height="380px";b.showDialog(a.container,620,460,!0,!0);a.init()});
-var n=this.get("layout"),q=n.funct;n.funct=function(a,c){q.apply(this,arguments);a.addSeparator(c);a.addItem(mxResources.get("orgChart")+"...",null,function(){var a=null,c=20,d=20,e=!0,f=function(){b.loadingOrgChart=!1;b.spinner.stop();if("undefined"!==typeof mxOrgChartLayout&&null!=a&&e){var f=b.editor.graph;(new mxOrgChartLayout(f,a,c,d)).execute(f.getDefaultParent());e=!1}},g=document.createElement("div"),k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width=
+var n=this.get("layout"),t=n.funct;n.funct=function(a,c){t.apply(this,arguments);a.addSeparator(c);a.addItem(mxResources.get("orgChart")+"...",null,function(){var a=null,c=20,d=20,e=!0,f=function(){b.loadingOrgChart=!1;b.spinner.stop();if("undefined"!==typeof mxOrgChartLayout&&null!=a&&e){var f=b.editor.graph;(new mxOrgChartLayout(f,a,c,d)).execute(f.getDefaultParent());e=!1}},g=document.createElement("div"),k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width=
"140px";mxUtils.write(k,mxResources.get("orgChartType")+": ");g.appendChild(k);var l=document.createElement("select");l.style.width="200px";l.style.boxSizing="border-box";for(var k=[mxResources.get("linear"),mxResources.get("hanger2"),mxResources.get("hanger4"),mxResources.get("fishbone1"),mxResources.get("fishbone2"),mxResources.get("1ColumnLeft"),mxResources.get("1ColumnRight"),mxResources.get("smart")],m=0;m<k.length;m++){var n=document.createElement("option");mxUtils.write(n,k[m]);n.value=m;2==
m&&n.setAttribute("selected","selected");l.appendChild(n)}mxEvent.addListener(l,"change",function(){a=l.value});g.appendChild(l);k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="140px";mxUtils.write(k,mxResources.get("parentChildSpacing")+": ");g.appendChild(k);var x=document.createElement("input");x.type="number";x.value=c;x.style.width="200px";x.style.boxSizing="border-box";g.appendChild(x);mxEvent.addListener(x,"change",function(){c=x.value});
k=document.createElement("div");k.style.marginTop="6px";k.style.display="inline-block";k.style.width="140px";mxUtils.write(k,mxResources.get("siblingSpacing")+": ");g.appendChild(k);var v=document.createElement("input");v.type="number";v.value=d;v.style.width="200px";v.style.boxSizing="border-box";g.appendChild(v);mxEvent.addListener(v,"change",function(){d=v.value});g=new CustomDialog(b,g,function(){null==a&&(a=2);"undefined"!==typeof mxOrgChartLayout||b.loadingOrgChart||b.isOffline(!0)?f():b.spinner.spin(document.body,
@@ -10110,7 +10113,7 @@ null!=window.console&&console.error(J)}});a.textarea.style.width="600px";a.texta
c);var f=0,g=d.save;d.save=function(){f++;g.apply(this,arguments)};var l=d.restore;d.restore=function(){f--;l.apply(this,arguments)};var m=a.drawShape;a.drawShape=function(a){mxLog.debug("entering shape",a,f);m.apply(this,arguments);mxLog.debug("leaving shape",a,f)};a.drawState(k.getView().getState(k.model.root),d);mxLog.show();mxLog.debug(mxUtils.getXml(e));mxLog.debug("stateCounter",f)})),b.actions.addAction("testDownloadRtModel...",mxUtils.bind(this,function(){null==b.drive?b.handleError({message:mxResources.get("serviceUnavailableOrBlocked")}):
b.drive.execute(mxUtils.bind(this,function(){var a=prompt("File ID","");if(null!=a&&0<a.length&&b.spinner.spin(document.body,mxResources.get("export"))){var c=new mxXmlRequest("https://www.googleapis.com/drive/v2/files/"+a+"/realtime?supportsAllDrives=true",null,"GET");c.setRequestHeaders=function(a){mxXmlRequest.prototype.setRequestHeaders.apply(this,arguments);a.setRequestHeader("authorization","Bearer "+b.drive.token)};c.send(function(c){b.spinner.stop();200<=c.getStatus()&&299>=c.getStatus()?
b.saveLocalFile(c.getText(),"json-"+a+".txt","text/plain"):b.handleError({message:mxResources.get("fileNotFound")},mxResources.get("errorLoadingFile"))})}}))})),b.actions.addAction("testShowConsole",function(){mxLog.isVisible()?mxLog.window.fit():mxLog.show();mxLog.window.div.style.zIndex=mxPopupMenu.prototype.zIndex-1}),this.put("testDevelop",new Menu(mxUtils.bind(this,function(a,c){this.addMenuItems(a,"createSidebarEntry showBoundingBox - testCheckFile testDiff - testInspect - testXmlImageExport - testDownloadRtModel".split(" "),
-c);a.addItem(mxResources.get("testImportRtModel")+"...",null,function(){var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,"change",mxUtils.bind(this,function(){if(null!=a.files){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){try{b.openLocalFile(mxUtils.getXml(b.drive.convertJsonToXml(JSON.parse(c.target.result).data)),a.files[0].name,!0)}catch(G){b.handleError(G,mxResources.get("errorLoadingFile"))}});c.readAsText(a.files[0])}}));a.click()},c);
+c);a.addItem(mxResources.get("testImportRtModel")+"...",null,function(){var a=document.createElement("input");a.setAttribute("type","file");mxEvent.addListener(a,"change",mxUtils.bind(this,function(){if(null!=a.files){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){try{b.openLocalFile(mxUtils.getXml(b.drive.convertJsonToXml(JSON.parse(c.target.result).data)),a.files[0].name,!0)}catch(H){b.handleError(H,mxResources.get("errorLoadingFile"))}});c.readAsText(a.files[0])}}));a.click()},c);
this.addMenuItems(a,["-","testShowConsole"],c)}))));b.actions.addAction("shapes...",function(){mxClient.IS_CHROMEAPP||!b.isOffline()?b.showDialog((new MoreShapesDialog(b,!0)).container,640,isLocalStorage?mxClient.IS_IOS?480:460:440,!0,!0):b.showDialog((new MoreShapesDialog(b,!1)).container,360,isLocalStorage?mxClient.IS_IOS?300:280:260,!0,!0)});b.actions.put("createShape",new Action(mxResources.get("shape")+"...",function(a){k.isEnabled()&&(a=new mxCell("",new mxGeometry(0,0,120,120),b.defaultCustomShapeStyle),
a.vertex=!0,a=new EditShapeDialog(b,a,mxResources.get("editShape")+":",630,400),b.showDialog(a.container,640,480,!0,!1),a.init())})).isEnabled=f;b.actions.put("embedHtml",new Action(mxResources.get("html")+"...",function(){b.spinner.spin(document.body,mxResources.get("loading"))&&b.getPublicUrl(b.getCurrentFile(),function(a){b.spinner.stop();b.showHtmlDialog(mxResources.get("create"),"https://desk.draw.io/support/solutions/articles/16000042542",a,function(a,c,d,e,f,g,k,l,m,n){b.createHtml(a,c,d,e,
f,g,k,l,m,n,mxUtils.bind(this,function(a,c){var d=new EmbedDialog(b,a+"\n"+c,null,null,function(){var d=window.open(),e=d.document;if(null!=e){"CSS1Compat"===document.compatMode&&e.writeln("<!DOCTYPE html>");e.writeln("<html>");e.writeln("<head><title>"+encodeURIComponent(mxResources.get("preview"))+'</title><meta charset="utf-8"></head>');e.writeln("<body>");e.writeln(a);var f=mxClient.IS_IE||mxClient.IS_EDGE||null!=document.documentMode;f&&e.writeln(c);e.writeln("</body>");e.writeln("</html>");
@@ -10140,7 +10143,7 @@ mxUtils.bind(this,function(a){this.editorUi.handleError(a,null!=a?mxResources.ge
f.apply(this,arguments)};n.visible="1"!=urlParams.embed;b.actions.addAction("makeCopy...",mxUtils.bind(this,function(){var a=b.getCurrentFile();if(null!=a){var c=b.getCopyFilename(a);a.constructor==DriveFile?(c=new CreateDialog(b,c,mxUtils.bind(this,function(c,d){"download"==d&&(d=App.MODE_GOOGLE);null!=c&&0<c.length&&(d==App.MODE_GOOGLE?b.spinner.spin(document.body,mxResources.get("saving"))&&a.saveAs(c,mxUtils.bind(this,function(c){a.desc=c;a.save(!1,mxUtils.bind(this,function(){b.spinner.stop();
a.setModified(!1);a.addAllSavedStatus()}),mxUtils.bind(this,function(a){b.handleError(a)}))}),mxUtils.bind(this,function(a){b.handleError(a)})):b.createFile(c,b.getFileData(!0),null,d))}),mxUtils.bind(this,function(){b.hideDialog()}),mxResources.get("makeCopy"),mxResources.get("create"),null,null,null,null,!0,null,null,null,null,b.editor.fileExtensions),b.showDialog(c.container,420,380,!0,!0),c.init()):b.editor.editAsNew(this.editorUi.getFileData(!0),c)}}));b.actions.addAction("moveToFolder...",mxUtils.bind(this,
function(){var a=b.getCurrentFile();if(a.getMode()==App.MODE_GOOGLE||a.getMode()==App.MODE_ONEDRIVE){var c=!1;if(a.getMode()==App.MODE_GOOGLE&&null!=a.desc.parents)for(var d=0;d<a.desc.parents.length;d++)if(a.desc.parents[d].isRoot){c=!0;break}b.pickFolder(a.getMode(),mxUtils.bind(this,function(c){b.spinner.spin(document.body,mxResources.get("moving"))&&a.move(c,mxUtils.bind(this,function(a){b.spinner.stop()}),mxUtils.bind(this,function(a){b.handleError(a)}))}),null,!0,c)}}));this.put("publish",new Menu(mxUtils.bind(this,
-function(a,b){this.addMenuItems(a,["publishLink"],b)})));b.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){b.openLink("https://app.draw.io/")}));b.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+"...",function(){b.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var a=b.getCurrentFile();null!=a&&b.drive.showPermissions(a.getId())}catch(B){b.handleError(B)}}));this.put("embed",
+function(a,b){this.addMenuItems(a,["publishLink"],b)})));b.actions.put("useOffline",new Action(mxResources.get("useOffline")+"...",function(){b.openLink("https://app.draw.io/")}));b.actions.put("downloadDesktop",new Action(mxResources.get("downloadDesktop")+"...",function(){b.openLink("https://get.draw.io/")}));this.editorUi.actions.addAction("share...",mxUtils.bind(this,function(){try{var a=b.getCurrentFile();null!=a&&b.drive.showPermissions(a.getId())}catch(A){b.handleError(A)}}));this.put("embed",
new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();null==d||d.getMode()!=App.MODE_GOOGLE&&d.getMode()!=App.MODE_GITHUB||!/(\.png)$/i.test(d.getTitle())||this.addMenuItems(a,["liveImage","-"],c);this.addMenuItems(a,["embedImage","embedSvg","-","embedHtml"],c);navigator.standalone||b.isOffline()||this.addMenuItems(a,["embedIframe"],c);"1"==urlParams.embed||b.isOffline()||this.addMenuItems(a,"- googleDocs googleSlides googleSheets - microsoftOffice".split(" "),c)})));var v=function(a,
c,d,e){("plantUml"!=e||EditorUi.enablePlantUml&&!b.isOffline())&&a.addItem(d,null,mxUtils.bind(this,function(){if("fromText"==e||"formatSql"==e||"plantUml"==e||"mermaid"==e){var a=new ParseDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);b.dialog.container.style.overflow="auto"}else a=new CreateGraphDialog(b,d,e),b.showDialog(a.container,620,420,!0,!1);a.init()}),c,null,f())},z=function(a,c,d,e){var f=k.isMouseInsertPoint()?k.getInsertPoint():k.getFreeInsertPoint(),g=new mxCell(a,new mxGeometry(f.x,
f.y,c,d),e);g.vertex=!0;k.getModel().beginUpdate();try{g=k.addCell(g),k.fireEvent(new mxEventObject("cellsInserted","cells",[g]))}finally{k.getModel().endUpdate()}k.scrollCellToVisible(g);k.setSelectionCell(g);k.container.focus();k.editAfterInsert&&k.startEditing(g);window.setTimeout(function(){null!=b.hoverIcons&&b.hoverIcons.update(k.view.getState(g))},0);return g};b.actions.put("exportSvg",new Action(mxResources.get("formatSvg")+"...",function(){b.showExportDialog(mxResources.get("formatSvg"),
@@ -10160,11 +10163,11 @@ c,null,!1);a.addSeparator(c);null!=b.gitHub&&a.addItem(mxResources.get("github")
"...",null,function(){b.pickLibrary(App.MODE_GOOGLE)},c):l&&"function"===typeof window.DriveClient&&a.addItem(mxResources.get("googleDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1));null!=b.oneDrive?a.addItem(mxResources.get("oneDrive")+"...",null,function(){b.pickLibrary(App.MODE_ONEDRIVE)},c):g&&"function"===typeof window.OneDriveClient&&a.addItem(mxResources.get("oneDrive")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);null!=b.dropbox?a.addItem(mxResources.get("dropbox")+
"...",null,function(){b.pickLibrary(App.MODE_DROPBOX)},c):d&&"function"===typeof window.DropboxClient&&a.addItem(mxResources.get("dropbox")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);a.addSeparator(c);null!=b.gitHub&&a.addItem(mxResources.get("github")+"...",null,function(){b.pickLibrary(App.MODE_GITHUB)},c);null!=b.gitLab&&a.addItem(mxResources.get("gitlab")+"...",null,function(){b.pickLibrary(App.MODE_GITLAB)},c);null!=b.trello?a.addItem(mxResources.get("trello")+"...",
null,function(){b.pickLibrary(App.MODE_TRELLO)},c):m&&"function"===typeof window.TrelloClient&&a.addItem(mxResources.get("trello")+" ("+mxResources.get("loading")+"...)",null,function(){},c,null,!1);a.addSeparator(c);isLocalStorage&&"0"!=urlParams.browser&&a.addItem(mxResources.get("browser")+"...",null,function(){b.pickLibrary(App.MODE_BROWSER)},c);a.addItem(mxResources.get("device")+"...",null,function(){b.pickLibrary(App.MODE_DEVICE)},c);b.isOffline()||(a.addSeparator(c),a.addItem(mxResources.get("url")+
-"...",null,function(){var a=new FilenameDialog(b,"",mxResources.get("open"),function(a){if(null!=a&&0<a.length&&b.spinner.spin(document.body,mxResources.get("loading"))){var c=a;b.editor.isCorsEnabledForUrl(a)||(c=PROXY_URL+"?url="+encodeURIComponent(a));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){b.spinner.stop();try{b.loadLibrary(new UrlLibrary(this,c.getText(),a))}catch(E){b.handleError(E,mxResources.get("errorLoadingFile"))}}else b.spinner.stop(),b.handleError(null,mxResources.get("errorLoadingFile"))},
+"...",null,function(){var a=new FilenameDialog(b,"",mxResources.get("open"),function(a){if(null!=a&&0<a.length&&b.spinner.spin(document.body,mxResources.get("loading"))){var c=a;b.editor.isCorsEnabledForUrl(a)||(c=PROXY_URL+"?url="+encodeURIComponent(a));mxUtils.get(c,function(c){if(200<=c.getStatus()&&299>=c.getStatus()){b.spinner.stop();try{b.loadLibrary(new UrlLibrary(this,c.getText(),a))}catch(F){b.handleError(F,mxResources.get("errorLoadingFile"))}}else b.spinner.stop(),b.handleError(null,mxResources.get("errorLoadingFile"))},
function(){b.spinner.stop();b.handleError(null,mxResources.get("errorLoadingFile"))})}},mxResources.get("url"));b.showDialog(a.container,300,80,!0,!0);a.init()},c));"1"==urlParams.confLib&&(a.addSeparator(c),a.addItem(mxResources.get("confluenceCloud")+"...",null,function(){b.showRemotelyStoredLibrary(mxResources.get("libraries"))},c))})));this.put("edit",new Menu(mxUtils.bind(this,function(a,b){this.addMenuItems(a,["undo","redo","-","cut","copy"]);EditorUi.isElectronApp&&this.addMenuItems(a,["copyAsImage"]);
this.addMenuItems(a,"paste delete - duplicate - find - editData editTooltip - editStyle editGeometry - edit - editLink openLink - selectVertices selectEdges selectAll selectNone - lockUnlock".split(" "))})));n=b.actions.addAction("comments",mxUtils.bind(this,function(){if(null==this.commentsWindow)this.commentsWindow=new CommentsWindow(b,document.body.offsetWidth-380,120,300,350),this.commentsWindow.window.addListener("show",function(){b.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.addListener("hide",
function(){b.fireEvent(new mxEventObject("comments"))}),this.commentsWindow.window.setVisible(!0),b.fireEvent(new mxEventObject("comments"));else{var a=!this.commentsWindow.window.isVisible();this.commentsWindow.window.setVisible(a);this.commentsWindow.refreshCommentsTime();a&&this.commentsWindow.hasError&&this.commentsWindow.refreshComments()}}));n.setToggleAction(!0);n.setSelectedCallback(mxUtils.bind(this,function(){return null!=this.commentsWindow&&this.commentsWindow.window.isVisible()}));b.editor.addListener("fileLoaded",
-mxUtils.bind(this,function(){null!=this.commentsWindow&&(this.commentsWindow.destroy(),this.commentsWindow=null)}));var n=this.get("viewPanels"),A=n.funct;n.funct=function(a,c){A.apply(this,arguments);b.commentsSupported()&&b.menus.addMenuItems(a,["comments"],c)};this.put("view",new Menu(mxUtils.bind(this,function(a,c){this.addMenuItems(a,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers"]).concat(b.commentsSupported()?["comments","-"]:["-"]));this.addMenuItems(a,["-","search"],
+mxUtils.bind(this,function(){null!=this.commentsWindow&&(this.commentsWindow.destroy(),this.commentsWindow=null)}));var n=this.get("viewPanels"),B=n.funct;n.funct=function(a,c){B.apply(this,arguments);b.commentsSupported()&&b.menus.addMenuItems(a,["comments"],c)};this.put("view",new Menu(mxUtils.bind(this,function(a,c){this.addMenuItems(a,(null!=this.editorUi.format?["formatPanel"]:[]).concat(["outline","layers"]).concat(b.commentsSupported()?["comments","-"]:["-"]));this.addMenuItems(a,["-","search"],
c);if(isLocalStorage||mxClient.IS_CHROMEAPP){var d=this.addMenuItem(a,"scratchpad",c);(!b.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000042367")}this.addMenuItems(a,["shapes","-","pageView","pageScale"]);this.addSubmenu("units",a,c);this.addMenuItems(a,"- scrollbars tooltips ruler - grid guides".split(" "),c);mxClient.IS_SVG&&(null==document.documentMode||9<document.documentMode)&&this.addMenuItem(a,"shadowVisible",
c);this.addMenuItems(a,"- connectionArrows connectionPoints - resetView zoomIn zoomOut".split(" "),c)})));this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&(this.addSubmenu("theme",a,c),a.addSeparator(c));if("undefined"!==typeof MathJax){var d=this.addMenuItem(a,"mathematicalTypesetting",c);(!b.isOffline()||mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)&&this.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}this.addMenuItems(a,["copyConnect",
"collapseExpand","-"],c);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&this.addMenuItems(a,["showStartScreen"],c);"1"!=urlParams.embed&&this.addMenuItems(a,["autosave","compressed"],c);a.addSeparator(c);!b.isOfflineApp()&&isLocalStorage&&this.addMenuItem(a,"plugins",c);this.addMenuItems(a,["tags","-","editDiagram","-","configuration"],c);a.addSeparator(c);"1"==urlParams.newTempDlg&&(b.actions.addAction("templates",function(){var a=new TemplatesDialog;b.showDialog(a.container,a.width,
@@ -10246,32 +10249,32 @@ null,null,!0,!0))}),b))})};(function(){var a=EditorUi.prototype.refresh;EditorUi
(function(){var a=new mxObjectCodec(new ChangePage,"ui relatedPage index neverShown page previousPage".split(" ")),e="defaultParent currentRoot scrollLeft scrollTop scale translate lastPasteXml pasteCounter".split(" ");a.afterEncode=function(a,b,k){k.setAttribute("relatedPage",b.relatedPage.getId());null==b.index&&(k.setAttribute("name",b.relatedPage.getName()),null!=b.relatedPage.viewState&&k.setAttribute("viewState",JSON.stringify(b.relatedPage.viewState,function(a,b){return 0>mxUtils.indexOf(e,
a)?b:void 0})),null!=b.relatedPage.root&&a.encodeCell(b.relatedPage.root,k));return k};a.beforeDecode=function(a,b,e){e.ui=a.ui;e.relatedPage=e.ui.getPageById(b.getAttribute("relatedPage"));if(null==e.relatedPage){var c=b.ownerDocument.createElement("diagram");c.setAttribute("id",b.getAttribute("relatedPage"));c.setAttribute("name",b.getAttribute("name"));e.relatedPage=new DiagramPage(c);c=b.getAttribute("viewState");null!=c&&(e.relatedPage.viewState=JSON.parse(c),b.removeAttribute("viewState"));
b=b.cloneNode(!0);c=b.firstChild;if(null!=c)for(e.relatedPage.root=a.decodeCell(c,!1),e=c.nextSibling,c.parentNode.removeChild(c),c=e;null!=c;){e=c.nextSibling;if(c.nodeType==mxConstants.NODETYPE_ELEMENT){var k=c.getAttribute("id");null==a.lookup(k)&&a.decodeCell(c)}c.parentNode.removeChild(c);c=e}}return b};a.afterDecode=function(a,b,e){e.index=e.previousIndex;return e};mxCodecRegistry.register(a)})();(function(){EditorUi.prototype.altShiftActions[68]="selectDescendants";var a=Graph.prototype.foldCells;Graph.prototype.foldCells=function(b,c,e,l,d){c=null!=c?c:!1;null==e&&(e=this.getFoldableCells(this.getSelectionCells(),b));this.stopEditing();this.model.beginUpdate();try{for(var f=e.slice(),k=[],n=0;n<e.length;n++){var p=this.getCurrentCellStyle(e[n]);"1"==mxUtils.getValue(p,"treeFolding","0")&&(this.traverse(e[n],!0,mxUtils.bind(this,function(a,b){null!=b&&k.push(b);a!=e[n]&&k.push(a);return a==
-e[n]||!this.model.isCollapsed(a)})),this.model.setCollapsed(e[n],b))}for(n=0;n<k.length;n++)this.model.setVisible(k[n],!b);e=f;e=a.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 a(a){return v.isVertex(a)&&e(a)}function c(a){var b=!1;null!=a&&(b="1"==q.getCurrentCellStyle(a).treeMoving);
-return b}function e(a){var b=!1;null!=a&&(a=v.getParent(a),b=q.view.getState(a),b="tree"==(null!=b?b.style:q.getCellStyle(a)).containerType);return b}function l(a){var b=!1;null!=a&&(a=v.getParent(a),b=q.view.getState(a),q.view.getState(a),b=null!=(null!=b?b.style:q.getCellStyle(a)).childLayout);return b}function d(a){a=q.view.getState(a);if(null!=a){var b=q.getIncomingEdges(a.cell);if(0<b.length&&(b=q.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 g(a,b){b=null!=b?b:!0;q.model.beginUpdate();try{var c=q.model.getParent(a),e=q.getIncomingEdges(a),f=q.cloneCells([e[0],a]);q.model.setTerminal(f[0],q.model.getTerminal(e[0],!0),!0);var g=d(a),k=c.geometry;g==mxConstants.DIRECTION_SOUTH||
-g==mxConstants.DIRECTION_NORTH?f[1].geometry.x+=b?a.geometry.width+10:-f[1].geometry.width-10:f[1].geometry.y+=b?a.geometry.height+10:-f[1].geometry.height-10;q.view.currentRoot!=c&&(f[1].geometry.x-=k.x,f[1].geometry.y-=k.y);var l=q.view.getState(a),m=q.view.scale;if(null!=l){var n=mxRectangle.fromRectangle(l);g==mxConstants.DIRECTION_SOUTH||g==mxConstants.DIRECTION_NORTH?n.x+=(b?a.geometry.width+10:-f[1].geometry.width-10)*m:n.y+=(b?a.geometry.height+10:-f[1].geometry.height-10)*m;var v=q.getOutgoingEdges(q.model.getTerminal(e[0],
-!0));if(null!=v){for(var p=g==mxConstants.DIRECTION_SOUTH||g==mxConstants.DIRECTION_NORTH,t=k=e=0;t<v.length;t++){var x=q.model.getTerminal(v[t],!1);if(g==d(x)){var u=q.view.getState(x);x!=a&&null!=u&&(p&&b!=u.getCenterX()<l.getCenterX()||!p&&b!=u.getCenterY()<l.getCenterY())&&mxUtils.intersects(n,u)&&(e=10+Math.max(e,(Math.min(n.x+n.width,u.x+u.width)-Math.max(n.x,u.x))/m),k=10+Math.max(k,(Math.min(n.y+n.height,u.y+u.height)-Math.max(n.y,u.y))/m))}}p?k=0:e=0;for(t=0;t<v.length;t++)if(x=q.model.getTerminal(v[t],
-!1),g==d(x)&&(u=q.view.getState(x),x!=a&&null!=u&&(p&&b!=u.getCenterX()<l.getCenterX()||!p&&b!=u.getCenterY()<l.getCenterY()))){var z=[];q.traverse(u.cell,!0,function(a,b){null!=b&&z.push(b);z.push(a);return!0});q.moveCells(z,(b?1:-1)*e,(b?1:-1)*k)}}}return q.addCells(f,c)}finally{q.model.endUpdate()}}function m(a){q.model.beginUpdate();try{var b=d(a),c=q.getIncomingEdges(a),e=q.cloneCells([c[0],a]);q.model.setTerminal(c[0],e[1],!1);q.model.setTerminal(e[0],e[1],!0);q.model.setTerminal(e[0],a,!1);
-var f=q.model.getParent(a),g=f.geometry,k=[];q.view.currentRoot!=f&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);q.traverse(a,!0,function(a,b){null!=b&&k.push(b);k.push(a);return!0});var l=a.geometry.width+40,m=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?l=0:b==mxConstants.DIRECTION_NORTH?(l=0,m=-m):b==mxConstants.DIRECTION_WEST?(l=-l,m=0):b==mxConstants.DIRECTION_EAST&&(m=0);q.moveCells(k,l,m);return q.addCells(e,f)}finally{q.model.endUpdate()}}function n(a,b){q.model.beginUpdate();try{var c=
-q.model.getParent(a),e=q.getIncomingEdges(a),f=d(a);0==e.length&&(e=[q.createEdge(c,null,"",null,null,q.createCurrentEdgeStyle())],f=b);var g=q.cloneCells([e[0],a]);q.model.setTerminal(g[0],a,!0);if(null==q.model.getTerminal(g[0],!1)){q.model.setTerminal(g[0],g[1],!1);var k=q.getCellStyle(g[1]).newEdgeStyle;if(null!=k)try{var l=JSON.parse(k),m;for(m in l)q.setCellStyles(m,l[m],[g[0]]),"edgeStyle"==m&&"elbowEdgeStyle"==l[m]&&q.setCellStyles("elbow",f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NOTH?
-"vertical":"horizontal",[g[0]])}catch(P){}}var e=q.getOutgoingEdges(a),n=c.geometry,k=[];q.view.currentRoot==c&&(n=new mxRectangle);for(l=0;l<e.length;l++){var v=q.model.getTerminal(e[l],!1);null!=v&&k.push(v)}var p=q.view.getBounds(k),t=q.view.translate,x=q.view.scale;f==mxConstants.DIRECTION_SOUTH?(g[1].geometry.x=null==p?a.geometry.x+(a.geometry.width-g[1].geometry.width)/2:(p.x+p.width)/x-t.x-n.x+10,g[1].geometry.y+=g[1].geometry.height-n.y+40):f==mxConstants.DIRECTION_NORTH?(g[1].geometry.x=
-null==p?a.geometry.x+(a.geometry.width-g[1].geometry.width)/2:(p.x+p.width)/x-t.x+-n.x+10,g[1].geometry.y-=g[1].geometry.height+n.y+40):(g[1].geometry.x=f==mxConstants.DIRECTION_WEST?g[1].geometry.x-(g[1].geometry.width+n.x+40):g[1].geometry.x+(g[1].geometry.width-n.x+40),g[1].geometry.y=null==p?a.geometry.y+(a.geometry.height-g[1].geometry.height)/2:(p.y+p.height)/x-t.y+-n.y+10);return q.addCells(g,c)}finally{q.model.endUpdate()}}function p(a,b,c){a=q.getOutgoingEdges(a);c=q.view.getState(c);var d=
-[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=q.view.getState(q.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function u(a,b){var c=d(a),e=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST)==e&&c!=b?t.actions.get("selectParent").funct():
-c==b?(e=q.getOutgoingEdges(a),null!=e&&0<e.length&&q.setSelectionCell(q.model.getTerminal(e[0],!1))):(c=q.getIncomingEdges(a),null!=c&&0<c.length&&(e=p(q.model.getTerminal(c[0],!0),e,a),c=q.view.getState(a),null!=c&&(c=mxUtils.indexOf(e,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=e.length-1&&q.setSelectionCell(e[c].cell)))))}var t=this,q=t.editor.graph,v=q.getModel(),z=t.menus.createPopupMenu;t.menus.createPopupMenu=function(b,c,d){z.apply(this,arguments);
-if(1==q.getSelectionCount()){c=q.getSelectionCell();var e=q.getOutgoingEdges(c);b.addSeparator();0<e.length&&(a(q.getSelectionCell())&&this.addMenuItems(b,["selectChildren"],null,d),this.addMenuItems(b,["selectDescendants"],null,d));a(q.getSelectionCell())&&(b.addSeparator(),0<q.getIncomingEdges(c).length&&this.addMenuItems(b,["selectSiblings","selectParent"],null,d))}};t.actions.addAction("selectChildren",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getOutgoingEdges(a);
-if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+X");t.actions.addAction("selectSiblings",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=q.getOutgoingEdges(q.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(q.model.getTerminal(a[c],!1));q.setSelectionCells(b)}}},null,null,"Alt+Shift+S");t.actions.addAction("selectParent",
-function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),a=q.getIncomingEdges(a);null!=a&&0<a.length&&q.setSelectionCell(q.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");t.actions.addAction("selectDescendants",function(){if(q.isEnabled()&&1==q.getSelectionCount()){var a=q.getSelectionCell(),b=[];q.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});q.setSelectionCells(b)}},null,null,"Alt+Shift+D");var y=q.removeCells;q.removeCells=function(b,c){c=null!=
-c?c:!0;null==b&&(b=this.getDeletableCells(this.getSelectionCells()));c&&(b=this.getDeletableCells(this.addAllEdges(b)));for(var d=[],f=0;f<b.length;f++){var g=b[f];v.isEdge(g)&&e(g)&&(d.push(g),g=v.getTerminal(g,!1));if(a(g)){var k=[];q.traverse(g,!0,function(a,b){null!=b&&k.push(b);k.push(a);return!0});0<k.length&&(d=d.concat(k),g=q.getIncomingEdges(b[f]),b=b.concat(g))}else null!=g&&d.push(b[f])}b=d;return y.apply(this,arguments)};t.hoverIcons.getStateAt=function(b,c,d){return a(b.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,
-d))};var A=q.duplicateCells;q.duplicateCells=function(b,c){b=null!=b?b:this.getSelectionCells();for(var d=b.slice(0),e=0;e<d.length;e++){var f=q.view.getState(d[e]);if(null!=f&&a(f.cell))for(var g=q.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],b)}this.model.beginUpdate();try{var k=A.call(this,b,c);if(k.length==b.length)for(e=0;e<b.length;e++)if(a(b[e])){var l=q.getIncomingEdges(k[e]),g=q.getIncomingEdges(b[e]);if(0==l.length&&0<g.length){var m=this.cloneCell(g[0]);this.addEdge(m,
-q.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var x=q.moveCells;q.moveCells=function(b,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.getCurrentCellStyle(f);if(null!=b&&a(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var v=0;v<b.length;v++)if(a(b[v])||q.model.isEdge(b[v])&&null==q.model.getTerminal(b[v],!0)){f=q.model.getParent(b[v]);break}if(null!=m&&f!=m&&null!=this.view.getState(b[0])){var p=q.getIncomingEdges(b[0]);
-if(0<p.length){var t=q.view.getState(q.model.getTerminal(p[0],!0));if(null!=t){var u=q.view.getState(m);null!=u&&(c=(u.getCenterX()-t.getCenterX())/q.view.scale,d=(u.getCenterY()-t.getCenterY())/q.view.scale)}}}}l=x.apply(this,arguments);if(null!=l&&null!=b&&l.length==b.length)for(v=0;v<l.length;v++)if(this.model.isEdge(l[v]))a(m)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[v],!0))&&this.model.setTerminal(l[v],m,!0);else if(a(b[v])&&(p=q.getIncomingEdges(b[v]),0<p.length))if(!e)a(m)&&0>mxUtils.indexOf(b,
-this.model.getTerminal(p[0],!0))&&this.model.setTerminal(p[0],m,!0);else if(0==q.getIncomingEdges(l[v]).length){n=m;if(null==n||n==q.model.getParent(b[v]))n=q.model.getTerminal(p[0],!0);e=this.cloneCell(p[0]);this.addEdge(e,q.getDefaultParent(),n,l[v])}}finally{this.model.endUpdate()}return l};if(null!=t.sidebar){var B=t.sidebar.dropAndConnect;t.sidebar.dropAndConnect=function(b,c,d,e){var f=q.model,g=null;f.beginUpdate();try{if(g=B.apply(this,arguments),a(b))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&
-null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],b,!0);var l=q.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var C={88:t.actions.get("selectChildren"),84:t.actions.get("selectSubtree"),80:t.actions.get("selectParent"),83:t.actions.get("selectSiblings")},D=t.onKeyDown;t.onKeyDown=function(b){try{if(q.isEnabled()&&!q.isEditing()&&a(q.getSelectionCell())&&1==q.getSelectionCount()){var c=null;0<q.getIncomingEdges(q.getSelectionCell()).length&&
-(9==b.which?c=mxEvent.isShiftDown(b)?m(q.getSelectionCell()):n(q.getSelectionCell()):13==b.which&&(c=g(q.getSelectionCell(),!mxEvent.isShiftDown(b))));if(null!=c&&0<c.length)1==c.length&&q.model.isEdge(c[0])?q.setSelectionCell(q.model.getTerminal(c[0],!1)):q.setSelectionCell(c[c.length-1]),null!=t.hoverIcons&&t.hoverIcons.update(q.view.getState(q.getSelectionCell())),q.startEditingAtCell(q.getSelectionCell()),mxEvent.consume(b);else if(mxEvent.isAltDown(b)&&mxEvent.isShiftDown(b)){var d=C[b.keyCode];
-null!=d&&(d.funct(b),mxEvent.consume(b))}else 37==b.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(b)):38==b.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(b)):39==b.keyCode?(u(q.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(b)):40==b.keyCode&&(u(q.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(b))}}catch(I){t.handleError(I)}mxEvent.isConsumed(b)||D.apply(this,arguments)};var F=q.connectVertex;q.connectVertex=
-function(b,c,e,f,k,l){var v=q.getIncomingEdges(b);return a(b)?(e=d(b),f=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,k=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,e==c||0==v.length?n(b,c):f==k?m(b):g(b,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):F.call(this,b,c,e,f,k,l)};q.getSubtree=function(b){var d=[b];!c(b)&&!a(b)||l(b)||q.traverse(b,!0,function(a,b){null!=b&&0>mxUtils.indexOf(d,b)&&d.push(b);0>mxUtils.indexOf(d,a)&&d.push(a);return!0});return d};
-var G=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){G.apply(this,arguments);(c(this.state.cell)||a(this.state.cell))&&!l(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",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.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;t.hoverIcons.reset();mxEvent.consume(a)})))};var E=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){E.apply(this,arguments);null!=this.moveHandle&&
+e[n]||!this.model.isCollapsed(a)})),this.model.setCollapsed(e[n],b))}for(n=0;n<k.length;n++)this.model.setVisible(k[n],!b);e=f;e=a.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 a(a){return v.isVertex(a)&&e(a)}function c(a){var b=!1;null!=a&&(b="1"==t.getCurrentCellStyle(a).treeMoving);
+return b}function e(a){var b=!1;null!=a&&(a=v.getParent(a),b=t.view.getState(a),b="tree"==(null!=b?b.style:t.getCellStyle(a)).containerType);return b}function l(a){var b=!1;null!=a&&(a=v.getParent(a),b=t.view.getState(a),t.view.getState(a),b=null!=(null!=b?b.style:t.getCellStyle(a)).childLayout);return b}function d(a){a=t.view.getState(a);if(null!=a){var b=t.getIncomingEdges(a.cell);if(0<b.length&&(b=t.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 g(a,b){b=null!=b?b:!0;t.model.beginUpdate();try{var c=t.model.getParent(a),e=t.getIncomingEdges(a),f=t.cloneCells([e[0],a]);t.model.setTerminal(f[0],t.model.getTerminal(e[0],!0),!0);var g=d(a),k=c.geometry;g==mxConstants.DIRECTION_SOUTH||
+g==mxConstants.DIRECTION_NORTH?f[1].geometry.x+=b?a.geometry.width+10:-f[1].geometry.width-10:f[1].geometry.y+=b?a.geometry.height+10:-f[1].geometry.height-10;t.view.currentRoot!=c&&(f[1].geometry.x-=k.x,f[1].geometry.y-=k.y);var l=t.view.getState(a),m=t.view.scale;if(null!=l){var n=mxRectangle.fromRectangle(l);g==mxConstants.DIRECTION_SOUTH||g==mxConstants.DIRECTION_NORTH?n.x+=(b?a.geometry.width+10:-f[1].geometry.width-10)*m:n.y+=(b?a.geometry.height+10:-f[1].geometry.height-10)*m;var v=t.getOutgoingEdges(t.model.getTerminal(e[0],
+!0));if(null!=v){for(var p=g==mxConstants.DIRECTION_SOUTH||g==mxConstants.DIRECTION_NORTH,q=k=e=0;q<v.length;q++){var x=t.model.getTerminal(v[q],!1);if(g==d(x)){var u=t.view.getState(x);x!=a&&null!=u&&(p&&b!=u.getCenterX()<l.getCenterX()||!p&&b!=u.getCenterY()<l.getCenterY())&&mxUtils.intersects(n,u)&&(e=10+Math.max(e,(Math.min(n.x+n.width,u.x+u.width)-Math.max(n.x,u.x))/m),k=10+Math.max(k,(Math.min(n.y+n.height,u.y+u.height)-Math.max(n.y,u.y))/m))}}p?k=0:e=0;for(q=0;q<v.length;q++)if(x=t.model.getTerminal(v[q],
+!1),g==d(x)&&(u=t.view.getState(x),x!=a&&null!=u&&(p&&b!=u.getCenterX()<l.getCenterX()||!p&&b!=u.getCenterY()<l.getCenterY()))){var z=[];t.traverse(u.cell,!0,function(a,b){null!=b&&z.push(b);z.push(a);return!0});t.moveCells(z,(b?1:-1)*e,(b?1:-1)*k)}}}return t.addCells(f,c)}finally{t.model.endUpdate()}}function m(a){t.model.beginUpdate();try{var b=d(a),c=t.getIncomingEdges(a),e=t.cloneCells([c[0],a]);t.model.setTerminal(c[0],e[1],!1);t.model.setTerminal(e[0],e[1],!0);t.model.setTerminal(e[0],a,!1);
+var f=t.model.getParent(a),g=f.geometry,k=[];t.view.currentRoot!=f&&(e[1].geometry.x-=g.x,e[1].geometry.y-=g.y);t.traverse(a,!0,function(a,b){null!=b&&k.push(b);k.push(a);return!0});var l=a.geometry.width+40,m=a.geometry.height+40;b==mxConstants.DIRECTION_SOUTH?l=0:b==mxConstants.DIRECTION_NORTH?(l=0,m=-m):b==mxConstants.DIRECTION_WEST?(l=-l,m=0):b==mxConstants.DIRECTION_EAST&&(m=0);t.moveCells(k,l,m);return t.addCells(e,f)}finally{t.model.endUpdate()}}function n(a,b){t.model.beginUpdate();try{var c=
+t.model.getParent(a),e=t.getIncomingEdges(a),f=d(a);0==e.length&&(e=[t.createEdge(c,null,"",null,null,t.createCurrentEdgeStyle())],f=b);var g=t.cloneCells([e[0],a]);t.model.setTerminal(g[0],a,!0);if(null==t.model.getTerminal(g[0],!1)){t.model.setTerminal(g[0],g[1],!1);var k=t.getCellStyle(g[1]).newEdgeStyle;if(null!=k)try{var l=JSON.parse(k),m;for(m in l)t.setCellStyles(m,l[m],[g[0]]),"edgeStyle"==m&&"elbowEdgeStyle"==l[m]&&t.setCellStyles("elbow",f==mxConstants.DIRECTION_SOUTH||f==mxConstants.DIRECTION_NOTH?
+"vertical":"horizontal",[g[0]])}catch(P){}}var e=t.getOutgoingEdges(a),n=c.geometry,k=[];t.view.currentRoot==c&&(n=new mxRectangle);for(l=0;l<e.length;l++){var v=t.model.getTerminal(e[l],!1);null!=v&&k.push(v)}var p=t.view.getBounds(k),q=t.view.translate,u=t.view.scale;f==mxConstants.DIRECTION_SOUTH?(g[1].geometry.x=null==p?a.geometry.x+(a.geometry.width-g[1].geometry.width)/2:(p.x+p.width)/u-q.x-n.x+10,g[1].geometry.y+=g[1].geometry.height-n.y+40):f==mxConstants.DIRECTION_NORTH?(g[1].geometry.x=
+null==p?a.geometry.x+(a.geometry.width-g[1].geometry.width)/2:(p.x+p.width)/u-q.x+-n.x+10,g[1].geometry.y-=g[1].geometry.height+n.y+40):(g[1].geometry.x=f==mxConstants.DIRECTION_WEST?g[1].geometry.x-(g[1].geometry.width+n.x+40):g[1].geometry.x+(g[1].geometry.width-n.x+40),g[1].geometry.y=null==p?a.geometry.y+(a.geometry.height-g[1].geometry.height)/2:(p.y+p.height)/u-q.y+-n.y+10);return t.addCells(g,c)}finally{t.model.endUpdate()}}function p(a,b,c){a=t.getOutgoingEdges(a);c=t.view.getState(c);var d=
+[];if(null!=c&&null!=a){for(var e=0;e<a.length;e++){var f=t.view.getState(t.model.getTerminal(a[e],!1));null!=f&&(!b&&Math.min(f.x+f.width,c.x+c.width)>=Math.max(f.x,c.x)||b&&Math.min(f.y+f.height,c.y+c.height)>=Math.max(f.y,c.y))&&d.push(f)}d.sort(function(a,c){return b?a.x+a.width-c.x-c.width:a.y+a.height-c.y-c.height})}return d}function u(a,b){var c=d(a),e=b==mxConstants.DIRECTION_EAST||b==mxConstants.DIRECTION_WEST;(c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST)==e&&c!=b?q.actions.get("selectParent").funct():
+c==b?(e=t.getOutgoingEdges(a),null!=e&&0<e.length&&t.setSelectionCell(t.model.getTerminal(e[0],!1))):(c=t.getIncomingEdges(a),null!=c&&0<c.length&&(e=p(t.model.getTerminal(c[0],!0),e,a),c=t.view.getState(a),null!=c&&(c=mxUtils.indexOf(e,c),0<=c&&(c+=b==mxConstants.DIRECTION_NORTH||b==mxConstants.DIRECTION_WEST?-1:1,0<=c&&c<=e.length-1&&t.setSelectionCell(e[c].cell)))))}var q=this,t=q.editor.graph,v=t.getModel(),z=q.menus.createPopupMenu;q.menus.createPopupMenu=function(b,c,d){z.apply(this,arguments);
+if(1==t.getSelectionCount()){c=t.getSelectionCell();var e=t.getOutgoingEdges(c);b.addSeparator();0<e.length&&(a(t.getSelectionCell())&&this.addMenuItems(b,["selectChildren"],null,d),this.addMenuItems(b,["selectDescendants"],null,d));a(t.getSelectionCell())&&(b.addSeparator(),0<t.getIncomingEdges(c).length&&this.addMenuItems(b,["selectSiblings","selectParent"],null,d))}};q.actions.addAction("selectChildren",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getOutgoingEdges(a);
+if(null!=a){for(var b=[],c=0;c<a.length;c++)b.push(t.model.getTerminal(a[c],!1));t.setSelectionCells(b)}}},null,null,"Alt+Shift+X");q.actions.addAction("selectSiblings",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getIncomingEdges(a);if(null!=a&&0<a.length&&(a=t.getOutgoingEdges(t.model.getTerminal(a[0],!0)),null!=a)){for(var b=[],c=0;c<a.length;c++)b.push(t.model.getTerminal(a[c],!1));t.setSelectionCells(b)}}},null,null,"Alt+Shift+S");q.actions.addAction("selectParent",
+function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),a=t.getIncomingEdges(a);null!=a&&0<a.length&&t.setSelectionCell(t.model.getTerminal(a[0],!0))}},null,null,"Alt+Shift+P");q.actions.addAction("selectDescendants",function(){if(t.isEnabled()&&1==t.getSelectionCount()){var a=t.getSelectionCell(),b=[];t.traverse(a,!0,function(a,c){null!=c&&b.push(c);b.push(a);return!0});t.setSelectionCells(b)}},null,null,"Alt+Shift+D");var y=t.removeCells;t.removeCells=function(b,c){c=null!=
+c?c:!0;null==b&&(b=this.getDeletableCells(this.getSelectionCells()));c&&(b=this.getDeletableCells(this.addAllEdges(b)));for(var d=[],f=0;f<b.length;f++){var g=b[f];v.isEdge(g)&&e(g)&&(d.push(g),g=v.getTerminal(g,!1));if(a(g)){var k=[];t.traverse(g,!0,function(a,b){null!=b&&k.push(b);k.push(a);return!0});0<k.length&&(d=d.concat(k),g=t.getIncomingEdges(b[f]),b=b.concat(g))}else null!=g&&d.push(b[f])}b=d;return y.apply(this,arguments)};q.hoverIcons.getStateAt=function(b,c,d){return a(b.cell)?null:this.graph.view.getState(this.graph.getCellAt(c,
+d))};var B=t.duplicateCells;t.duplicateCells=function(b,c){b=null!=b?b:this.getSelectionCells();for(var d=b.slice(0),e=0;e<d.length;e++){var f=t.view.getState(d[e]);if(null!=f&&a(f.cell))for(var g=t.getIncomingEdges(f.cell),f=0;f<g.length;f++)mxUtils.remove(g[f],b)}this.model.beginUpdate();try{var k=B.call(this,b,c);if(k.length==b.length)for(e=0;e<b.length;e++)if(a(b[e])){var l=t.getIncomingEdges(k[e]),g=t.getIncomingEdges(b[e]);if(0==l.length&&0<g.length){var m=this.cloneCell(g[0]);this.addEdge(m,
+t.getDefaultParent(),this.model.getTerminal(g[0],!0),k[e])}}}finally{this.model.endUpdate()}return k};var x=t.moveCells;t.moveCells=function(b,c,d,e,f,g,k){var l=null;this.model.beginUpdate();try{var m=f,n=this.getCurrentCellStyle(f);if(null!=b&&a(f)&&"1"==mxUtils.getValue(n,"treeFolding","0")){for(var v=0;v<b.length;v++)if(a(b[v])||t.model.isEdge(b[v])&&null==t.model.getTerminal(b[v],!0)){f=t.model.getParent(b[v]);break}if(null!=m&&f!=m&&null!=this.view.getState(b[0])){var p=t.getIncomingEdges(b[0]);
+if(0<p.length){var q=t.view.getState(t.model.getTerminal(p[0],!0));if(null!=q){var u=t.view.getState(m);null!=u&&(c=(u.getCenterX()-q.getCenterX())/t.view.scale,d=(u.getCenterY()-q.getCenterY())/t.view.scale)}}}}l=x.apply(this,arguments);if(null!=l&&null!=b&&l.length==b.length)for(v=0;v<l.length;v++)if(this.model.isEdge(l[v]))a(m)&&0>mxUtils.indexOf(l,this.model.getTerminal(l[v],!0))&&this.model.setTerminal(l[v],m,!0);else if(a(b[v])&&(p=t.getIncomingEdges(b[v]),0<p.length))if(!e)a(m)&&0>mxUtils.indexOf(b,
+this.model.getTerminal(p[0],!0))&&this.model.setTerminal(p[0],m,!0);else if(0==t.getIncomingEdges(l[v]).length){n=m;if(null==n||n==t.model.getParent(b[v]))n=t.model.getTerminal(p[0],!0);e=this.cloneCell(p[0]);this.addEdge(e,t.getDefaultParent(),n,l[v])}}finally{this.model.endUpdate()}return l};if(null!=q.sidebar){var A=q.sidebar.dropAndConnect;q.sidebar.dropAndConnect=function(b,c,d,e){var f=t.model,g=null;f.beginUpdate();try{if(g=A.apply(this,arguments),a(b))for(var k=0;k<g.length;k++)if(f.isEdge(g[k])&&
+null==f.getTerminal(g[k],!0)){f.setTerminal(g[k],b,!0);var l=t.getCellGeometry(g[k]);l.points=null;null!=l.getTerminalPoint(!0)&&l.setTerminalPoint(null,!0)}}finally{f.endUpdate()}return g}}var C={88:q.actions.get("selectChildren"),84:q.actions.get("selectSubtree"),80:q.actions.get("selectParent"),83:q.actions.get("selectSiblings")},D=q.onKeyDown;q.onKeyDown=function(b){try{if(t.isEnabled()&&!t.isEditing()&&a(t.getSelectionCell())&&1==t.getSelectionCount()){var c=null;0<t.getIncomingEdges(t.getSelectionCell()).length&&
+(9==b.which?c=mxEvent.isShiftDown(b)?m(t.getSelectionCell()):n(t.getSelectionCell()):13==b.which&&(c=g(t.getSelectionCell(),!mxEvent.isShiftDown(b))));if(null!=c&&0<c.length)1==c.length&&t.model.isEdge(c[0])?t.setSelectionCell(t.model.getTerminal(c[0],!1)):t.setSelectionCell(c[c.length-1]),null!=q.hoverIcons&&q.hoverIcons.update(t.view.getState(t.getSelectionCell())),t.startEditingAtCell(t.getSelectionCell()),mxEvent.consume(b);else if(mxEvent.isAltDown(b)&&mxEvent.isShiftDown(b)){var d=C[b.keyCode];
+null!=d&&(d.funct(b),mxEvent.consume(b))}else 37==b.keyCode?(u(t.getSelectionCell(),mxConstants.DIRECTION_WEST),mxEvent.consume(b)):38==b.keyCode?(u(t.getSelectionCell(),mxConstants.DIRECTION_NORTH),mxEvent.consume(b)):39==b.keyCode?(u(t.getSelectionCell(),mxConstants.DIRECTION_EAST),mxEvent.consume(b)):40==b.keyCode&&(u(t.getSelectionCell(),mxConstants.DIRECTION_SOUTH),mxEvent.consume(b))}}catch(I){q.handleError(I)}mxEvent.isConsumed(b)||D.apply(this,arguments)};var E=t.connectVertex;t.connectVertex=
+function(b,c,e,f,k,l){var v=t.getIncomingEdges(b);return a(b)?(e=d(b),f=e==mxConstants.DIRECTION_EAST||e==mxConstants.DIRECTION_WEST,k=c==mxConstants.DIRECTION_EAST||c==mxConstants.DIRECTION_WEST,e==c||0==v.length?n(b,c):f==k?m(b):g(b,c!=mxConstants.DIRECTION_NORTH&&c!=mxConstants.DIRECTION_WEST)):E.call(this,b,c,e,f,k,l)};t.getSubtree=function(b){var d=[b];!c(b)&&!a(b)||l(b)||t.traverse(b,!0,function(a,b){null!=b&&0>mxUtils.indexOf(d,b)&&d.push(b);0>mxUtils.indexOf(d,a)&&d.push(a);return!0});return d};
+var H=mxVertexHandler.prototype.init;mxVertexHandler.prototype.init=function(){H.apply(this,arguments);(c(this.state.cell)||a(this.state.cell))&&!l(this.state.cell)&&0<this.graph.getOutgoingEdges(this.state.cell).length&&(this.moveHandle=mxUtils.createImage(Editor.moveImage),this.moveHandle.setAttribute("title","Move Subtree"),this.moveHandle.style.position="absolute",this.moveHandle.style.cursor="pointer",this.moveHandle.style.width="24px",this.moveHandle.style.height="24px",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.getSubtree(this.state.cell));this.graph.graphHandler.cellWasClicked=!0;this.graph.isMouseTrigger=mxEvent.isMouseEvent(a);this.graph.isMouseDown=!0;q.hoverIcons.reset();mxEvent.consume(a)})))};var F=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){F.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 J=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(a){J.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.display=a?"":"none")};var K=mxVertexHandler.prototype.destroy;mxVertexHandler.prototype.destroy=function(a,b){K.apply(this,arguments);null!=
this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.moveHandle=null)}};if("undefined"!==typeof Sidebar){var c=Sidebar.prototype.createAdvancedShapes;Sidebar.prototype.createAdvancedShapes=function(){var a=c.apply(this,arguments),e=this.graph;return a.concat([this.addEntry("tree container",function(){var a=new mxCell("Tree Container",new mxGeometry(0,0,400,320),"swimlane;html=1;startSize=20;horizontal=1;containerType=tree;");a.vertex=!0;var b=new mxCell("Parent",new mxGeometry(140,
60,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');b.vertex=!0;var c=new mxCell("Child",new mxGeometry(140,140,120,40),'whiteSpace=wrap;html=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');c.vertex=!0;var e=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=elbowEdgeStyle;elbow=vertical;startArrow=none;endArrow=none;rounded=0;");e.geometry.relative=
@@ -10279,8 +10282,8 @@ this.moveHandle&&(this.moveHandle.parentNode.removeChild(this.moveHandle),this.m
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;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":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 k=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]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');k.vertex=!0;var n=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
n.geometry.relative=!0;n.edge=!0;b.insertEdge(n,!0);k.insertEdge(n,!1);var p=new mxCell("Topic",new mxGeometry(20,40,80,20),'whiteSpace=wrap;html=1;rounded=1;arcSize=50;align=center;verticalAlign=middle;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');p.vertex=!0;var u=new mxCell("",new mxGeometry(0,0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");
-u.geometry.relative=!0;u.edge=!0;b.insertEdge(u,!0);p.insertEdge(u,!1);var t=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]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');t.vertex=!0;var q=new mxCell("",new mxGeometry(0,
-0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");q.geometry.relative=!0;q.edge=!0;b.insertEdge(q,!0);t.insertEdge(q,!1);a.insert(e);a.insert(n);a.insert(u);a.insert(q);a.insert(b);a.insert(c);a.insert(k);a.insert(p);a.insert(t);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};treeFolding=1;treeMoving=1;');
+u.geometry.relative=!0;u.edge=!0;b.insertEdge(u,!0);p.insertEdge(u,!1);var q=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]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};');q.vertex=!0;var t=new mxCell("",new mxGeometry(0,
+0,0,0),"edgeStyle=entityRelationEdgeStyle;startArrow=none;endArrow=none;segment=10;curved=1;");t.geometry.relative=!0;t.edge=!0;b.insertEdge(t,!0);q.insertEdge(t,!1);a.insert(e);a.insert(n);a.insert(u);a.insert(t);a.insert(b);a.insert(c);a.insert(k);a.insert(p);a.insert(q);return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps central idea",function(){var a=new mxCell("Central Idea",new mxGeometry(0,0,100,40),'ellipse;whiteSpace=wrap;html=1;align=center;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":1};treeFolding=1;treeMoving=1;');
a.vertex=!0;return sb.createVertexTemplateFromCells([a],a.geometry.width,a.geometry.height,a.value)}),this.addEntry("tree mindmap mindmaps 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]];fillColor=none;align=center;verticalAlign=bottom;routingCenterY=0.5;snapToPoint=1;recursiveResize=0;autosize=1;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":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 mindmaps 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;strokeWidth=1;autosize=1;spacing=4;treeFolding=1;treeMoving=1;newEdgeStyle={"edgeStyle":"entityRelationEdgeStyle","startArrow":"none","endArrow":"none","segment":10,"curved":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;newEdgeStyle={"edgeStyle":"elbowEdgeStyle","startArrow":"none","endArrow":"none"};');
@@ -10316,7 +10319,7 @@ a.appendChild(b),"1"==urlParams.saveAndExit&&(b=document.createElement("a"),mxUt
this.formatWindow.window.setVisible(b?!1:!this.formatWindow.window.isVisible()):a(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var p=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);p.apply(this,arguments)};var u=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(a){u.apply(this,arguments);a?1E3<=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)&&(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!0),null!=this.formatWindow&&this.formatWindow.window.setVisible(!0)):(null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1))};
-EditorUi.prototype.chromelessWindowResize=function(){};var t=Menus.prototype.init;Menus.prototype.init=function(){t.apply(this,arguments);var b=this.editorUi,c=b.editor.graph;b.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";b.actions.get("createShape").label=mxResources.get("shape")+"...";b.actions.get("outline").label=mxResources.get("outline")+"...";b.actions.get("layers").label=mxResources.get("layers")+"...";b.actions.put("importCsv",new Action(mxResources.get("csv")+"...",
+EditorUi.prototype.chromelessWindowResize=function(){};var q=Menus.prototype.init;Menus.prototype.init=function(){q.apply(this,arguments);var b=this.editorUi,c=b.editor.graph;b.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";b.actions.get("createShape").label=mxResources.get("shape")+"...";b.actions.get("outline").label=mxResources.get("outline")+"...";b.actions.get("layers").label=mxResources.get("layers")+"...";b.actions.put("importCsv",new Action(mxResources.get("csv")+"...",
function(){c.popupMenuHandler.hideMenu();b.showImportCsvDialog()}));b.actions.put("importText",new Action(mxResources.get("text")+"...",function(){var a=new ParseDialog(b,"Insert from Text");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("formatSql",new Action(mxResources.get("formatSql")+"...",function(){var a=new ParseDialog(b,"Insert from Text","formatSql");b.showDialog(a.container,620,420,!0,!1);a.init()}));b.actions.put("toggleShapes",new Action(mxResources.get("shapes")+"...",
function(){e(b)}));b.actions.put("toggleFormat",new Action(mxResources.get("format")+"...",function(){a(b)}));EditorUi.enablePlantUml&&!b.isOffline()&&b.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(b,"Insert from Text","plantUml");b.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,c){var d=b.getCurrentFile();b.menus.addSubmenu("extras",a,c,mxResources.get("preferences"));a.addSeparator(c);
mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?(b.menus.addMenuItems(a,["new","open","-"],c),EditorUi.isElectronApp&&b.menus.addMenuItems(a,["synchronize","-"],c),b.menus.addMenuItems(a,["save","saveAs","-"],c)):"1"==urlParams.embed?(b.menus.addMenuItems(a,["-","save"],c),"1"==urlParams.saveAndExit&&b.menus.addMenuItems(a,["saveAndExit"],c),a.addSeparator(c)):(b.menus.addMenuItems(a,["new"],c),b.menus.addSubmenu("openFrom",a,c),isLocalStorage&&this.addSubmenu("openRecent",a,c),a.addSeparator(c),null!=
@@ -10326,8 +10329,8 @@ null!=d&&d.constructor==DriveFile?b.menus.addMenuItems(a,["save","makeCopy","-",
function(a,c){d.funct(a,c);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||b.menus.addMenuItems(a,["publishLink"],c);a.addSeparator(c);b.menus.addSubmenu("embed",a,c)})));var f=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,c){"1"!=urlParams.embed&&b.menus.addSubmenu("theme",a,c);null!=f&&b.menus.addSubmenu("language",a,c);b.menus.addSubmenu("units",a,c);a.addSeparator(c);b.menus.addMenuItems(a,["scrollbars","tooltips","ruler"],c);"1"!=urlParams.embed&&(isLocalStorage||
mxClient.IS_CHROMEAPP)&&b.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],c);!b.isOfflineApp()&&isLocalStorage&&b.menus.addMenuItem(a,"plugins",c);a.addSeparator(c);b.menus.addMenuItem(a,"drawConfig",c);a.addSeparator(c)})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),c)})));mxUtils.bind(this,function(){var a=this.get("insert"),c=a.funct;a.funct=function(a,
d){c.apply(this,arguments);a.addSeparator(d);b.menus.addMenuItems(a,["-","toggleShapes"],d)}})();var g="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),k=function(a,c,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(b,d,e);b.showDialog(a.container,620,420,!0,!1);a.init()}),c)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<g.length;c++)"-"==g[c]?a.addSeparator(b):k(a,b,mxResources.get(g[c])+
-"...",g[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"grid guides ruler - connectionArrows connectionPoints -".split(" "),c);if("undefined"!==typeof MathJax){var d=b.menus.addMenuItem(a,"mathematicalTypesetting",c);b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}b.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],c)})))};var q=EditorUi.prototype.init;EditorUi.prototype.init=function(){function b(a,
-b,c){var d=l.menus.get(a),e=t.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),p);e.className="geMenuItem";e.style.display="inline-block";e.style.boxSizing="border-box";e.style.top="6px";e.style.marginRight="6px";e.style.height="30px";e.style.paddingTop="6px";e.style.paddingBottom="6px";e.style.cursor="pointer";e.setAttribute("title",mxResources.get(a));l.menus.menuCreated(d,e,"geMenuItem");null!=c?(e.style.backgroundImage="url("+c+")",e.style.backgroundPosition=
+"...",g[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,c){b.menus.addMenuItems(a,"grid guides ruler - connectionArrows connectionPoints -".split(" "),c);if("undefined"!==typeof MathJax){var d=b.menus.addMenuItem(a,"mathematicalTypesetting",c);b.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}b.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],c)})))};var t=EditorUi.prototype.init;EditorUi.prototype.init=function(){function b(a,
+b,c){var d=l.menus.get(a),e=q.addMenu(mxResources.get(a),mxUtils.bind(this,function(){d.funct.apply(this,arguments)}),p);e.className="geMenuItem";e.style.display="inline-block";e.style.boxSizing="border-box";e.style.top="6px";e.style.marginRight="6px";e.style.height="30px";e.style.paddingTop="6px";e.style.paddingBottom="6px";e.style.cursor="pointer";e.setAttribute("title",mxResources.get(a));l.menus.menuCreated(d,e,"geMenuItem");null!=c?(e.style.backgroundImage="url("+c+")",e.style.backgroundPosition=
"center center",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="24px 24px",e.style.width="34px",e.innerHTML=""):b||(e.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",e.style.backgroundPosition="right 6px center",e.style.backgroundRepeat="no-repeat",e.style.paddingRight="22px");return e}function d(a,b,c,d,e,f){var g=document.createElement("a");g.className="geMenuItem";g.style.display="inline-block";g.style.boxSizing="border-box";g.style.height="30px";g.style.padding=
"6px";g.style.position="relative";g.style.verticalAlign="top";g.style.top="0px";null!=l.statusContainer?n.insertBefore(g,l.statusContainer):n.appendChild(g);null!=f?(g.style.backgroundImage="url("+f+")",g.style.backgroundPosition="center center",g.style.backgroundRepeat="no-repeat",g.style.backgroundSize="24px 24px",g.style.width="34px"):mxUtils.write(g,a);mxEvent.addListener(g,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(a){a.preventDefault()}));mxEvent.addListener(g,
"click",function(a){"disabled"!=g.getAttribute("disabled")&&b(a);mxEvent.consume(a)});null==c&&(g.style.marginRight="4px");null!=d&&g.setAttribute("title",d);null!=e&&(a=function(){e.isEnabled()?(g.removeAttribute("disabled"),g.style.cursor="pointer"):(g.setAttribute("disabled","disabled"),g.style.cursor="default")},e.addListener("stateChanged",a),a());return g}function f(a,b){var c=document.createElement("div");c.className="geMenuItem";c.style.display="inline-block";c.style.verticalAlign="top";c.style.marginRight=
@@ -10340,35 +10343,35 @@ a.funct,null,mxResources.get("redo")+" ("+a.shortcut+")",a,"data:image/svg+xml;b
f([d("",function(){m.popupMenuHandler.hideMenu();var a=m.view.scale,b=m.view.translate.x,c=m.view.translate.y;l.actions.get("resetView").funct();1E-5>Math.abs(a-m.view.scale)&&b==m.view.translate.x&&c==m.view.translate.y&&l.actions.get(m.pageVisible?"fitPage":"fitWindow").funct()},!0,mxResources.get("fit")+" ("+Editor.ctrlKey+"+H)",g,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMyA1djRoMlY1aDRWM0g1Yy0xLjEgMC0yIC45LTIgMnptMiAxMEgzdjRjMCAxLjEuOSAyIDIgMmg0di0ySDV2LTR6bTE0IDRoLTR2Mmg0YzEuMSAwIDItLjkgMi0ydi00aC0ydjR6bTAtMTZoLTR2Mmg0djRoMlY1YzAtMS4xLS45LTItMi0yeiIvPjwvc3ZnPg=="),
640<=c?d("",a.funct,!0,mxResources.get("zoomIn")+" ("+Editor.ctrlKey+" +)",a,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHptMi41LTRoLTJ2Mkg5di0ySDdWOWgyVjdoMXYyaDJ2MXoiLz48L3N2Zz4="):
null,640<=c?d("",e.funct,!0,mxResources.get("zoomOut")+" ("+Editor.ctrlKey+" -)",e,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTUuNSAxNGgtLjc5bC0uMjgtLjI3QzE1LjQxIDEyLjU5IDE2IDExLjExIDE2IDkuNSAxNiA1LjkxIDEzLjA5IDMgOS41IDNTMyA1LjkxIDMgOS41IDUuOTEgMTYgOS41IDE2YzEuNjEgMCAzLjA5LS41OSA0LjIzLTEuNTdsLjI3LjI4di43OWw1IDQuOTlMMjAuNDkgMTlsLTQuOTktNXptLTYgMEM3LjAxIDE0IDUgMTEuOTkgNSA5LjVTNy4wMSA1IDkuNSA1IDE0IDcuMDEgMTQgOS41IDExLjk5IDE0IDkuNSAxNHpNNyA5aDV2MUg3eiIvPjwvc3ZnPg=="):
-null],60)}a=l.menus.get("language");null!=a&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&600<=c?(null==M&&(e=t.addMenu("",a.funct),e.setAttribute("title",mxResources.get("language")),e.className="geToolbarButton",e.style.backgroundImage="url("+Editor.globeImage+")",e.style.backgroundPosition="center center",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="24px 24px",e.style.position="absolute",e.style.height="24px",e.style.width="24px",e.style.zIndex="1",e.style.right="8px",e.style.cursor=
-"pointer",e.style.top="1"==urlParams.embed?"12px":"11px",n.appendChild(e),M=e),l.buttonContainer.style.paddingRight="34px"):(l.buttonContainer.style.paddingRight="4px",null!=M&&(M.parentNode.removeChild(M),M=null))}q.apply(this,arguments);var k=document.createElement("div");k.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";k.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?"63px":"32px";this.sidebar=this.createSidebar(k);(1E3<=c||null!=urlParams.clibs||
-null!=urlParams.libs)&&e(this,!0);1E3<=c&&a(this,!0);var l=this,m=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));l.defaultLibraryName=mxResources.get("untitledLibrary");var n=document.createElement("div");n.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var p=null,t=new Menubar(l,n);l.statusContainer=l.createStatusContainer();l.statusContainer.style.position=
+null],60)}a=l.menus.get("language");null!=a&&!mxClient.IS_CHROMEAPP&&!EditorUi.isElectronApp&&600<=c?(null==M&&(e=q.addMenu("",a.funct),e.setAttribute("title",mxResources.get("language")),e.className="geToolbarButton",e.style.backgroundImage="url("+Editor.globeImage+")",e.style.backgroundPosition="center center",e.style.backgroundRepeat="no-repeat",e.style.backgroundSize="24px 24px",e.style.position="absolute",e.style.height="24px",e.style.width="24px",e.style.zIndex="1",e.style.right="8px",e.style.cursor=
+"pointer",e.style.top="1"==urlParams.embed?"12px":"11px",n.appendChild(e),M=e),l.buttonContainer.style.paddingRight="34px"):(l.buttonContainer.style.paddingRight="4px",null!=M&&(M.parentNode.removeChild(M),M=null))}t.apply(this,arguments);var k=document.createElement("div");k.style.cssText="position:absolute;left:0px;right:0px;top:0px;overflow-y:auto;overflow-x:hidden;";k.style.bottom="1"!=urlParams.embed||"1"==urlParams.libraries?"63px":"32px";this.sidebar=this.createSidebar(k);(1E3<=c||null!=urlParams.clibs||
+null!=urlParams.libs)&&e(this,!0);1E3<=c&&a(this,!0);var l=this,m=l.editor.graph;l.toolbar=this.createToolbar(l.createDiv("geToolbar"));l.defaultLibraryName=mxResources.get("untitledLibrary");var n=document.createElement("div");n.style.cssText="position:absolute;left:0px;right:0px;top:0px;height:30px;padding:8px;border-bottom:1px solid lightgray;background-color:#ffffff;text-align:left;white-space:nowrap;";var p=null,q=new Menubar(l,n);l.statusContainer=l.createStatusContainer();l.statusContainer.style.position=
"relative";l.statusContainer.style.maxWidth="";l.statusContainer.style.marginTop="7px";l.statusContainer.style.marginLeft="6px";l.statusContainer.style.color="gray";l.statusContainer.style.cursor="default";l.editor.addListener("statusChanged",mxUtils.bind(this,function(){l.setStatusText(l.editor.getStatus())}));var u=l.descriptorChanged;l.descriptorChanged=function(){u.apply(this,arguments);var a=l.getCurrentFile();if(null!=a&&null!=a.getTitle()){var b=a.getMode();"google"==b?b="googleDrive":"github"==
b?b="gitHub":"gitlab"==b?b="gitLab":"onedrive"==b&&(b="oneDrive");b=mxResources.get(b);n.setAttribute("title",a.getTitle()+(null!=b?" ("+b+")":""))}else n.removeAttribute("title")};l.setStatusText(l.editor.getStatus());n.appendChild(l.statusContainer);l.buttonContainer=document.createElement("div");l.buttonContainer.style.cssText="position:absolute;right:0px;padding-right:34px;top:10px;white-space:nowrap;padding-top:2px;background-color:inherit;";n.appendChild(l.buttonContainer);l.menubarContainer=
l.buttonContainer;l.tabContainer=document.createElement("div");l.tabContainer.style.cssText="position:absolute;left:0px;right:0px;bottom:0px;height:30px;white-space:nowrap;border-bottom:1px solid lightgray;background-color:#ffffff;border-top:1px solid lightgray;margin-bottom:-2px;visibility:hidden;";var k=l.diagramContainer.parentNode,J=document.createElement("div");J.style.cssText="position:absolute;top:0px;left:0px;right:0px;bottom:0px;overflow:hidden;";l.diagramContainer.style.top="47px";var K=
-l.menus.get("viewZoom");if(null!=K){this.tabContainer.style.right="70px";var H=t.addMenu("100%",K.funct);H.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");H.style.whiteSpace="nowrap";H.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";H.style.backgroundPosition="right 6px center";H.style.backgroundRepeat="no-repeat";H.style.backgroundColor="#ffffff";H.style.paddingRight="10px";H.style.display="block";H.style.position="absolute";H.style.textDecoration="none";H.style.textDecoration=
-"none";H.style.right="0px";H.style.bottom="0px";H.style.overflow="hidden";H.style.visibility="hidden";H.style.textAlign="center";H.style.color="#000";H.style.fontSize="12px";H.style.color="#707070";H.style.width="59px";H.style.cursor="pointer";H.style.borderTop="1px solid lightgray";H.style.borderLeft="1px solid lightgray";H.style.height=parseInt(l.tabContainerHeight)-1+"px";H.style.lineHeight=parseInt(l.tabContainerHeight)+1+"px";J.appendChild(H);K=mxUtils.bind(this,function(){H.innerHTML=Math.round(100*
-l.editor.graph.view.scale)+"%"});l.editor.graph.view.addListener(mxEvent.EVENT_SCALE,K);l.editor.addListener("resetGraphView",K);l.editor.addListener("pageSelected",K);var L=l.setGraphEnabled;l.setGraphEnabled=function(){L.apply(this,arguments);null!=this.tabContainer&&(H.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}J.appendChild(l.tabContainer);J.appendChild(n);J.appendChild(l.diagramContainer);
+l.menus.get("viewZoom");if(null!=K){this.tabContainer.style.right="70px";var G=q.addMenu("100%",K.funct);G.setAttribute("title",mxResources.get("zoom")+" (Alt+Mousewheel)");G.style.whiteSpace="nowrap";G.style.backgroundImage="url("+mxWindow.prototype.minimizeImage+")";G.style.backgroundPosition="right 6px center";G.style.backgroundRepeat="no-repeat";G.style.backgroundColor="#ffffff";G.style.paddingRight="10px";G.style.display="block";G.style.position="absolute";G.style.textDecoration="none";G.style.textDecoration=
+"none";G.style.right="0px";G.style.bottom="0px";G.style.overflow="hidden";G.style.visibility="hidden";G.style.textAlign="center";G.style.color="#000";G.style.fontSize="12px";G.style.color="#707070";G.style.width="59px";G.style.cursor="pointer";G.style.borderTop="1px solid lightgray";G.style.borderLeft="1px solid lightgray";G.style.height=parseInt(l.tabContainerHeight)-1+"px";G.style.lineHeight=parseInt(l.tabContainerHeight)+1+"px";J.appendChild(G);K=mxUtils.bind(this,function(){G.innerHTML=Math.round(100*
+l.editor.graph.view.scale)+"%"});l.editor.graph.view.addListener(mxEvent.EVENT_SCALE,K);l.editor.addListener("resetGraphView",K);l.editor.addListener("pageSelected",K);var L=l.setGraphEnabled;l.setGraphEnabled=function(){L.apply(this,arguments);null!=this.tabContainer&&(G.style.visibility=this.tabContainer.style.visibility,this.diagramContainer.style.bottom="hidden"!=this.tabContainer.style.visibility?this.tabContainerHeight+"px":"0px")}}J.appendChild(l.tabContainer);J.appendChild(n);J.appendChild(l.diagramContainer);
k.appendChild(J);l.updateTabContainer();var M=null;g();mxEvent.addListener(window,"resize",function(){g();null!=l.sidebarWindow&&l.sidebarWindow.window.fit();null!=l.formatWindow&&l.formatWindow.window.fit();null!=l.actions.outlineWindow&&l.actions.outlineWindow.window.fit();null!=l.actions.layersWindow&&l.actions.layersWindow.window.fit();null!=l.menus.tagsWindow&&l.menus.tagsWindow.window.fit();null!=l.menus.findWindow&&l.menus.findWindow.window.fit()})}}};
-(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var e=EditorUi.initTheme;EditorUi.initTheme=function(){e.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();(function(){var a=mxGuide.prototype.move;mxGuide.prototype.move=function(b,c,e,l){var d=c.y,f=c.x,k=!1,n=!1;if(null!=this.states&&null!=b&&null!=c){var p=this,u=new mxCellState,t=this.graph.getView().scale,q=Math.max(2,this.getGuideTolerance()/2);u.x=b.x+f;u.y=b.y+d;u.width=b.width;u.height=b.height;for(var v=[],z=[],y=0;y<this.states.length;y++){var A=this.states[y];A instanceof mxCellState&&(l||!this.graph.isCellSelected(A.cell))&&((u.x>=A.x&&u.x<=A.x+A.width||A.x>=u.x&&A.x<=u.x+u.width)&&(u.y>
-A.y+A.height+4||u.y+u.height+4<A.y)?v.push(A):(u.y>=A.y&&u.y<=A.y+A.height||A.y>=u.y&&A.y<=u.y+u.height)&&(u.x>A.x+A.width+4||u.x+u.width+4<A.x)&&z.push(A))}var x=0,B=0,C=A=0,D=0,F=0,G=0,E=0,J=5*t;if(1<v.length){v.push(u);v.sort(function(a,b){return a.y-b.y});var K=!1,y=u==v[0],t=u==v[v.length-1];if(!y&&!t)for(y=1;y<v.length-1;y++)if(u==v[y]){t=v[y-1];y=v[y+1];A=B=C=(y.y-t.y-t.height-u.height)/2;break}for(y=0;y<v.length-1;y++){var t=v[y],H=v[y+1],L=u==t||u==H,H=H.y-t.y-t.height,K=K|u==t;if(0==B&&
-0==x)B=H,x=1;else if(Math.abs(B-H)<=(L||1==y&&K?q:0))x+=1;else if(1<x&&K){v=v.slice(0,y+1);break}else if(3<=v.length-y&&!K)x=0,A=B=0!=C?C:0,v.splice(0,0==y?1:y),y=-1;else break;0!=A||L||(B=A=H)}3==v.length&&v[1]==u&&(A=0)}if(1<z.length){z.push(u);z.sort(function(a,b){return a.x-b.x});K=!1;y=u==z[0];t=u==z[z.length-1];if(!y&&!t)for(y=1;y<z.length-1;y++)if(u==z[y]){t=z[y-1];y=z[y+1];G=F=E=(y.x-t.x-t.width-u.width)/2;break}for(y=0;y<z.length-1;y++){t=z[y];H=z[y+1];L=u==t||u==H;H=H.x-t.x-t.width;K|=u==
-t;if(0==F&&0==D)F=H,D=1;else if(Math.abs(F-H)<=(L||1==y&&K?q:0))D+=1;else if(1<D&&K){z=z.slice(0,y+1);break}else if(3<=z.length-y&&!K)D=0,G=F=0!=E?E:0,z.splice(0,0==y?1:y),y=-1;else break;0!=G||L||(F=G=H)}3==z.length&&z[1]==u&&(G=0)}q=function(a,b,c,d){var e=[],f;d?(d=J,f=0):(d=0,f=J);e.push(new mxPoint(a.x-d,a.y-f));e.push(new mxPoint(a.x+d,a.y+f));e.push(a);e.push(b);e.push(new mxPoint(b.x-d,b.y-f));e.push(new mxPoint(b.x+d,b.y+f));if(null!=c)return c.points=e,c;a=new mxPolyline(e,mxConstants.GUIDE_COLOR,
-mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents=!1;a.init(p.graph.getView().getOverlayPane());return a};F=function(a,b){if(a&&null!=p.guidesArrHor)for(var c=0;c<p.guidesArrHor.length;c++)p.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=p.guidesArrVer)for(c=0;c<p.guidesArrVer.length;c++)p.guidesArrVer[c].node.style.visibility="hidden"};if(1<D&&D==z.length-1){D=[];E=p.guidesArrHor;k=[];f=0;y=z[0]==u?1:0;K=z[y].y+z[y].height;if(0<G)for(y=0;y<z.length-1;y++)t=
-z[y],H=z[y+1],u==t?(f=H.x-t.width-G,k.push(new mxPoint(f+t.width+J,K)),k.push(new mxPoint(H.x-J,K))):u==H?(k.push(new mxPoint(t.x+t.width+J,K)),f=t.x+t.width+G,k.push(new mxPoint(f-J,K))):(k.push(new mxPoint(t.x+t.width+J,K)),k.push(new mxPoint(H.x-J,K)));else t=z[0],y=z[2],f=t.x+t.width+(y.x-t.x-t.width-u.width)/2,k.push(new mxPoint(t.x+t.width+J,K)),k.push(new mxPoint(f-J,K)),k.push(new mxPoint(f+u.width+J,K)),k.push(new mxPoint(y.x-J,K));for(y=0;y<k.length;y+=2)z=k[y],G=k[y+1],z=q(z,G,null!=E?
-E[y/2]:null),z.node.style.visibility="visible",z.redraw(),D.push(z);for(y=k.length/2;null!=E&&y<E.length;y++)E[y].destroy();p.guidesArrHor=D;f-=b.x;k=!0}else F(!0);if(1<x&&x==v.length-1){D=[];E=p.guidesArrVer;n=[];d=0;y=v[0]==u?1:0;x=v[y].x+v[y].width;if(0<A)for(y=0;y<v.length-1;y++)t=v[y],H=v[y+1],u==t?(d=H.y-t.height-A,n.push(new mxPoint(x,d+t.height+J)),n.push(new mxPoint(x,H.y-J))):u==H?(n.push(new mxPoint(x,t.y+t.height+J)),d=t.y+t.height+A,n.push(new mxPoint(x,d-J))):(n.push(new mxPoint(x,t.y+
-t.height+J)),n.push(new mxPoint(x,H.y-J)));else t=v[0],y=v[2],d=t.y+t.height+(y.y-t.y-t.height-u.height)/2,n.push(new mxPoint(x,t.y+t.height+J)),n.push(new mxPoint(x,d-J)),n.push(new mxPoint(x,d+u.height+J)),n.push(new mxPoint(x,y.y-J));for(y=0;y<n.length;y+=2)z=n[y],G=n[y+1],z=q(z,G,null!=E?E[y/2]:null,!0),z.node.style.visibility="visible",z.redraw(),D.push(z);for(y=n.length/2;null!=E&&y<E.length;y++)E[y].destroy();p.guidesArrVer=D;d-=b.y;n=!0}else F(!1,!0)}if(k||n)return u=new mxPoint(f,d),v=a.call(this,
-b,u,e,l),k&&!n?u.y=v.y:n&&!k&&(u.x=v.x),v.y!=u.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),v.x!=u.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),u;F(!0,!0);return a.apply(this,arguments)};var e=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){e.call(this,a);var b=this.guidesArrVer,c=this.guidesArrHor;if(null!=b)for(var l=0;l<b.length;l++)b[l].node.style.visibility=a?"visible":"hidden";if(null!=
+(function(){var a=!1;"min"!=uiTheme||a||mxClient.IS_CHROMEAPP||(EditorUi.initMinimalTheme(),a=!0);var e=EditorUi.initTheme;EditorUi.initTheme=function(){e.apply(this,arguments);"min"!=uiTheme||a||(this.initMinimalTheme(),a=!0)}})();(function(){var a=mxGuide.prototype.move;mxGuide.prototype.move=function(b,c,e,l){var d=c.y,f=c.x,k=!1,n=!1;if(null!=this.states&&null!=b&&null!=c){var p=this,u=new mxCellState,q=this.graph.getView().scale,t=Math.max(2,this.getGuideTolerance()/2);u.x=b.x+f;u.y=b.y+d;u.width=b.width;u.height=b.height;for(var v=[],z=[],y=0;y<this.states.length;y++){var B=this.states[y];B instanceof mxCellState&&(l||!this.graph.isCellSelected(B.cell))&&((u.x>=B.x&&u.x<=B.x+B.width||B.x>=u.x&&B.x<=u.x+u.width)&&(u.y>
+B.y+B.height+4||u.y+u.height+4<B.y)?v.push(B):(u.y>=B.y&&u.y<=B.y+B.height||B.y>=u.y&&B.y<=u.y+u.height)&&(u.x>B.x+B.width+4||u.x+u.width+4<B.x)&&z.push(B))}var x=0,A=0,C=B=0,D=0,E=0,H=0,F=0,J=5*q;if(1<v.length){v.push(u);v.sort(function(a,b){return a.y-b.y});var K=!1,y=u==v[0],q=u==v[v.length-1];if(!y&&!q)for(y=1;y<v.length-1;y++)if(u==v[y]){q=v[y-1];y=v[y+1];B=A=C=(y.y-q.y-q.height-u.height)/2;break}for(y=0;y<v.length-1;y++){var q=v[y],G=v[y+1],L=u==q||u==G,G=G.y-q.y-q.height,K=K|u==q;if(0==A&&
+0==x)A=G,x=1;else if(Math.abs(A-G)<=(L||1==y&&K?t:0))x+=1;else if(1<x&&K){v=v.slice(0,y+1);break}else if(3<=v.length-y&&!K)x=0,B=A=0!=C?C:0,v.splice(0,0==y?1:y),y=-1;else break;0!=B||L||(A=B=G)}3==v.length&&v[1]==u&&(B=0)}if(1<z.length){z.push(u);z.sort(function(a,b){return a.x-b.x});K=!1;y=u==z[0];q=u==z[z.length-1];if(!y&&!q)for(y=1;y<z.length-1;y++)if(u==z[y]){q=z[y-1];y=z[y+1];H=E=F=(y.x-q.x-q.width-u.width)/2;break}for(y=0;y<z.length-1;y++){q=z[y];G=z[y+1];L=u==q||u==G;G=G.x-q.x-q.width;K|=u==
+q;if(0==E&&0==D)E=G,D=1;else if(Math.abs(E-G)<=(L||1==y&&K?t:0))D+=1;else if(1<D&&K){z=z.slice(0,y+1);break}else if(3<=z.length-y&&!K)D=0,H=E=0!=F?F:0,z.splice(0,0==y?1:y),y=-1;else break;0!=H||L||(E=H=G)}3==z.length&&z[1]==u&&(H=0)}t=function(a,b,c,d){var e=[],f;d?(d=J,f=0):(d=0,f=J);e.push(new mxPoint(a.x-d,a.y-f));e.push(new mxPoint(a.x+d,a.y+f));e.push(a);e.push(b);e.push(new mxPoint(b.x-d,b.y-f));e.push(new mxPoint(b.x+d,b.y+f));if(null!=c)return c.points=e,c;a=new mxPolyline(e,mxConstants.GUIDE_COLOR,
+mxConstants.GUIDE_STROKEWIDTH);a.dialect=mxConstants.DIALECT_SVG;a.pointerEvents=!1;a.init(p.graph.getView().getOverlayPane());return a};E=function(a,b){if(a&&null!=p.guidesArrHor)for(var c=0;c<p.guidesArrHor.length;c++)p.guidesArrHor[c].node.style.visibility="hidden";if(b&&null!=p.guidesArrVer)for(c=0;c<p.guidesArrVer.length;c++)p.guidesArrVer[c].node.style.visibility="hidden"};if(1<D&&D==z.length-1){D=[];F=p.guidesArrHor;k=[];f=0;y=z[0]==u?1:0;K=z[y].y+z[y].height;if(0<H)for(y=0;y<z.length-1;y++)q=
+z[y],G=z[y+1],u==q?(f=G.x-q.width-H,k.push(new mxPoint(f+q.width+J,K)),k.push(new mxPoint(G.x-J,K))):u==G?(k.push(new mxPoint(q.x+q.width+J,K)),f=q.x+q.width+H,k.push(new mxPoint(f-J,K))):(k.push(new mxPoint(q.x+q.width+J,K)),k.push(new mxPoint(G.x-J,K)));else q=z[0],y=z[2],f=q.x+q.width+(y.x-q.x-q.width-u.width)/2,k.push(new mxPoint(q.x+q.width+J,K)),k.push(new mxPoint(f-J,K)),k.push(new mxPoint(f+u.width+J,K)),k.push(new mxPoint(y.x-J,K));for(y=0;y<k.length;y+=2)z=k[y],H=k[y+1],z=t(z,H,null!=F?
+F[y/2]:null),z.node.style.visibility="visible",z.redraw(),D.push(z);for(y=k.length/2;null!=F&&y<F.length;y++)F[y].destroy();p.guidesArrHor=D;f-=b.x;k=!0}else E(!0);if(1<x&&x==v.length-1){D=[];F=p.guidesArrVer;n=[];d=0;y=v[0]==u?1:0;x=v[y].x+v[y].width;if(0<B)for(y=0;y<v.length-1;y++)q=v[y],G=v[y+1],u==q?(d=G.y-q.height-B,n.push(new mxPoint(x,d+q.height+J)),n.push(new mxPoint(x,G.y-J))):u==G?(n.push(new mxPoint(x,q.y+q.height+J)),d=q.y+q.height+B,n.push(new mxPoint(x,d-J))):(n.push(new mxPoint(x,q.y+
+q.height+J)),n.push(new mxPoint(x,G.y-J)));else q=v[0],y=v[2],d=q.y+q.height+(y.y-q.y-q.height-u.height)/2,n.push(new mxPoint(x,q.y+q.height+J)),n.push(new mxPoint(x,d-J)),n.push(new mxPoint(x,d+u.height+J)),n.push(new mxPoint(x,y.y-J));for(y=0;y<n.length;y+=2)z=n[y],H=n[y+1],z=t(z,H,null!=F?F[y/2]:null,!0),z.node.style.visibility="visible",z.redraw(),D.push(z);for(y=n.length/2;null!=F&&y<F.length;y++)F[y].destroy();p.guidesArrVer=D;d-=b.y;n=!0}else E(!1,!0)}if(k||n)return u=new mxPoint(f,d),v=a.call(this,
+b,u,e,l),k&&!n?u.y=v.y:n&&!k&&(u.x=v.x),v.y!=u.y&&null!=this.guideY&&null!=this.guideY.node&&(this.guideY.node.style.visibility="hidden"),v.x!=u.x&&null!=this.guideX&&null!=this.guideX.node&&(this.guideX.node.style.visibility="hidden"),u;E(!0,!0);return a.apply(this,arguments)};var e=mxGuide.prototype.setVisible;mxGuide.prototype.setVisible=function(a){e.call(this,a);var b=this.guidesArrVer,c=this.guidesArrHor;if(null!=b)for(var l=0;l<b.length;l++)b[l].node.style.visibility=a?"visible":"hidden";if(null!=
c)for(l=0;l<c.length;l++)c[l].node.style.visibility=a?"visible":"hidden"};var c=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){c.call(this);var a=this.guidesArrVer,e=this.guidesArrHor;if(null!=a){for(var f=0;f<a.length;f++)a[f].destroy();this.guidesArrVer=null}if(null!=e){for(f=0;f<e.length;f++)e[f].destroy();this.guidesArrHor=null}}})();function mxRuler(a,e,c,b){function k(){var b=a.diagramContainer;m.style.top=b.offsetTop-l+"px";m.style.left=b.offsetLeft-l+"px";m.style.width=(c?0:b.offsetWidth)+l+"px";m.style.height=(c?b.offsetHeight:0)+l+"px"}function f(a,b,c){var d;return function(){var e=this,f=arguments,g=c&&!d;clearTimeout(d);d=setTimeout(function(){d=null;c||a.apply(e,f)},b);g&&a.apply(e,f)}}var l=this.RULER_THICKNESS,d=this;this.unit=e;var g="dark"!=window.uiTheme?{bkgClr:"#ffffff",outBkgClr:"#e8e9ed",cornerClr:"#fbfbfb",
strokeClr:"#dadce0",fontClr:"#BBBBBB",guideClr:"#0000BB"}:{bkgClr:"#202020",outBkgClr:"#2a2a2a",cornerClr:"#2a2a2a",strokeClr:"#505759",fontClr:"#BBBBBB",guideClr:"#0088cf"},m=document.createElement("div");m.style.position="absolute";m.style.background=g.bkgClr;m.style[c?"borderRight":"borderBottom"]="0.5px solid "+g.strokeClr;m.style.borderLeft="0.5px solid "+g.strokeClr;document.body.appendChild(m);mxEvent.disableContextMenu(m);this.editorUiRefresh=a.refresh;a.refresh=function(b){d.editorUiRefresh.apply(a,
-arguments);k()};k();var n=document.createElement("canvas");n.width=m.offsetWidth;n.height=m.offsetHeight;m.style.overflow="hidden";n.style.position="relative";m.appendChild(n);var p=n.getContext("2d");this.ui=a;var u=a.editor.graph;this.graph=u;this.container=m;this.canvas=n;var t=function(a,b,d,e,f){a=Math.round(a);b=Math.round(b);d=Math.round(d);e=Math.round(e);p.beginPath();p.moveTo(a+.5,b+.5);p.lineTo(d+.5,e+.5);p.stroke();f&&(c?(p.save(),p.translate(a,b),p.rotate(-Math.PI/2),p.fillText(f,0,0),
-p.restore()):p.fillText(f,a,b))},q=function(){p.clearRect(0,0,n.width,n.height);p.beginPath();p.lineWidth=.7;p.strokeStyle=g.strokeClr;p.setLineDash([]);p.font="9px Arial";p.textAlign="center";var a=u.view.scale,b=u.view.getBackgroundPageBounds(),e=u.view.translate,f=u.view.getGraphBounds(),k=u.pageVisible,m=k?l+(c?b.y-u.container.scrollTop:b.x-u.container.scrollLeft):l+(c?e.y-u.container.scrollTop:e.x-u.container.scrollLeft),q=0;k&&(q=c?Math.floor(((f.y+1)/a-e.y)/u.pageFormat.height)*u.pageFormat.height*
-a:Math.floor(((f.x+1)/a-e.x)/u.pageFormat.width)*u.pageFormat.width*a);var D,F,G;switch(d.unit){case mxConstants.POINTS:D=G=10;F=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:G=10;D=mxConstants.PIXELS_PER_MM;F=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:G=.5>=a||4<=a?8:16,D=mxConstants.PIXELS_PER_INCH/G,F=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}e=D;2<=a?e=D/(2*Math.floor(a/2)):.5>=a&&(e=D*Math.floor(1/a/2)*(d.unit==mxConstants.MILLIMETERS?2:1));D=null;b=k?Math.min(m+(c?b.height:b.width),
-c?n.height:n.width):c?n.height:n.width;k&&(p.fillStyle=g.outBkgClr,c?(p.fillRect(0,l,l,m-l),p.fillRect(0,b,l,n.height)):(p.fillRect(l,0,m-l,l),p.fillRect(b,0,n.width,l)));p.fillStyle=g.fontClr;for(k=k?m:m%(e*a);k<=b;k+=e*a)if(f=Math.round((k-m)/a/e),!(k<l||f==D)){D=f;var E=null;0==f%G&&(E=d.formatText(q+f*e)+"");c?t(l-F[Math.abs(f)%G],k,l,k,E):t(k,l-F[Math.abs(f)%G],k,l,E)}p.lineWidth=1;t(c?0:l,c?l:0,l,l);p.fillStyle=g.cornerClr;p.fillRect(0,0,l,l)};this.drawRuler=q;this.sizeListener=e=f(function(){var a=
-u.container;c?(a=a.offsetHeight+l,n.height!=a&&(n.height=a,m.style.height=a+"px",q())):(a=a.offsetWidth+l,n.width!=a&&(n.width=a,m.style.width=a+"px",q()))},10);this.pageListener=function(){q()};this.scrollListener=b=f(function(){var a=c?u.container.scrollTop:u.container.scrollLeft;d.lastScroll!=a&&(d.lastScroll=a,q())},10);this.unitListener=function(a,b){d.setUnit(b.getProperty("unit"))};u.addListener(mxEvent.SIZE,e);u.container.addEventListener("scroll",b);u.view.addListener("unitChanged",this.unitListener);
-a.addListener("pageViewChanged",this.pageListener);a.addListener("pageScaleChanged",this.pageListener);a.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(a){g=a;m.style.background=g.bkgClr;q()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(a,b,e,f){var k;if(c&&4<a.height||!c&&4<a.width){if(null!=d.guidePart)try{p.putImageData(d.guidePart.imgData1,d.guidePart.x1,d.guidePart.y1),p.putImageData(d.guidePart.imgData2,d.guidePart.x2,d.guidePart.y2),p.putImageData(d.guidePart.imgData3,
-d.guidePart.x3,d.guidePart.y3)}catch(L){}k=d.origGuideMove.apply(this,arguments);try{var m,n,q,u,v,y,z,A,H;p.lineWidth=.5;p.strokeStyle=g.guideClr;p.setLineDash([2]);c?(n=a.y+k.y+l-this.graph.container.scrollTop,m=0,v=n+a.height/2,u=l/2,A=n+a.height,z=0,q=p.getImageData(m,n-1,l,3),t(m,n,l,n),n--,y=p.getImageData(u,v-1,l,3),t(u,v,l,v),v--,H=p.getImageData(z,A-1,l,3),t(z,A,l,A),A--):(n=0,m=a.x+k.x+l-this.graph.container.scrollLeft,v=l/2,u=m+a.width/2,A=0,z=m+a.width,q=p.getImageData(m-1,n,3,l),t(m,
-n,m,l),m--,y=p.getImageData(u-1,v,3,l),t(u,v,u,l),u--,H=p.getImageData(z-1,A,3,l),t(z,A,z,l),z--);if(null==d.guidePart||d.guidePart.x1!=m||d.guidePart.y1!=n)d.guidePart={imgData1:q,x1:m,y1:n,imgData2:y,x2:u,y2:v,imgData3:H,x3:z,y3:A}}catch(L){}}else k=d.origGuideMove.apply(this,arguments);return k};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var a=d.origGuideDestroy.apply(this,arguments);if(null!=d.guidePart)try{p.putImageData(d.guidePart.imgData1,d.guidePart.x1,
+arguments);k()};k();var n=document.createElement("canvas");n.width=m.offsetWidth;n.height=m.offsetHeight;m.style.overflow="hidden";n.style.position="relative";m.appendChild(n);var p=n.getContext("2d");this.ui=a;var u=a.editor.graph;this.graph=u;this.container=m;this.canvas=n;var q=function(a,b,d,e,f){a=Math.round(a);b=Math.round(b);d=Math.round(d);e=Math.round(e);p.beginPath();p.moveTo(a+.5,b+.5);p.lineTo(d+.5,e+.5);p.stroke();f&&(c?(p.save(),p.translate(a,b),p.rotate(-Math.PI/2),p.fillText(f,0,0),
+p.restore()):p.fillText(f,a,b))},t=function(){p.clearRect(0,0,n.width,n.height);p.beginPath();p.lineWidth=.7;p.strokeStyle=g.strokeClr;p.setLineDash([]);p.font="9px Arial";p.textAlign="center";var a=u.view.scale,b=u.view.getBackgroundPageBounds(),e=u.view.translate,f=u.view.getGraphBounds(),k=u.pageVisible,m=k?l+(c?b.y-u.container.scrollTop:b.x-u.container.scrollLeft):l+(c?e.y-u.container.scrollTop:e.x-u.container.scrollLeft),t=0;k&&(t=c?Math.floor(((f.y+1)/a-e.y)/u.pageFormat.height)*u.pageFormat.height*
+a:Math.floor(((f.x+1)/a-e.x)/u.pageFormat.width)*u.pageFormat.width*a);var D,E,H;switch(d.unit){case mxConstants.POINTS:D=H=10;E=[3,5,5,5,5,10,5,5,5,5];break;case mxConstants.MILLIMETERS:H=10;D=mxConstants.PIXELS_PER_MM;E=[5,3,3,3,3,6,3,3,3,3];break;case mxConstants.INCHES:H=.5>=a||4<=a?8:16,D=mxConstants.PIXELS_PER_INCH/H,E=[5,3,5,3,7,3,5,3,7,3,5,3,7,3,5,3]}e=D;2<=a?e=D/(2*Math.floor(a/2)):.5>=a&&(e=D*Math.floor(1/a/2)*(d.unit==mxConstants.MILLIMETERS?2:1));D=null;b=k?Math.min(m+(c?b.height:b.width),
+c?n.height:n.width):c?n.height:n.width;k&&(p.fillStyle=g.outBkgClr,c?(p.fillRect(0,l,l,m-l),p.fillRect(0,b,l,n.height)):(p.fillRect(l,0,m-l,l),p.fillRect(b,0,n.width,l)));p.fillStyle=g.fontClr;for(k=k?m:m%(e*a);k<=b;k+=e*a)if(f=Math.round((k-m)/a/e),!(k<l||f==D)){D=f;var F=null;0==f%H&&(F=d.formatText(t+f*e)+"");c?q(l-E[Math.abs(f)%H],k,l,k,F):q(k,l-E[Math.abs(f)%H],k,l,F)}p.lineWidth=1;q(c?0:l,c?l:0,l,l);p.fillStyle=g.cornerClr;p.fillRect(0,0,l,l)};this.drawRuler=t;this.sizeListener=e=f(function(){var a=
+u.container;c?(a=a.offsetHeight+l,n.height!=a&&(n.height=a,m.style.height=a+"px",t())):(a=a.offsetWidth+l,n.width!=a&&(n.width=a,m.style.width=a+"px",t()))},10);this.pageListener=function(){t()};this.scrollListener=b=f(function(){var a=c?u.container.scrollTop:u.container.scrollLeft;d.lastScroll!=a&&(d.lastScroll=a,t())},10);this.unitListener=function(a,b){d.setUnit(b.getProperty("unit"))};u.addListener(mxEvent.SIZE,e);u.container.addEventListener("scroll",b);u.view.addListener("unitChanged",this.unitListener);
+a.addListener("pageViewChanged",this.pageListener);a.addListener("pageScaleChanged",this.pageListener);a.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(a){g=a;m.style.background=g.bkgClr;t()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(a,b,e,f){var k;if(c&&4<a.height||!c&&4<a.width){if(null!=d.guidePart)try{p.putImageData(d.guidePart.imgData1,d.guidePart.x1,d.guidePart.y1),p.putImageData(d.guidePart.imgData2,d.guidePart.x2,d.guidePart.y2),p.putImageData(d.guidePart.imgData3,
+d.guidePart.x3,d.guidePart.y3)}catch(L){}k=d.origGuideMove.apply(this,arguments);try{var m,n,t,v,u,y,z,B,G;p.lineWidth=.5;p.strokeStyle=g.guideClr;p.setLineDash([2]);c?(n=a.y+k.y+l-this.graph.container.scrollTop,m=0,u=n+a.height/2,v=l/2,B=n+a.height,z=0,t=p.getImageData(m,n-1,l,3),q(m,n,l,n),n--,y=p.getImageData(v,u-1,l,3),q(v,u,l,u),u--,G=p.getImageData(z,B-1,l,3),q(z,B,l,B),B--):(n=0,m=a.x+k.x+l-this.graph.container.scrollLeft,u=l/2,v=m+a.width/2,B=0,z=m+a.width,t=p.getImageData(m-1,n,3,l),q(m,
+n,m,l),m--,y=p.getImageData(v-1,u,3,l),q(v,u,v,l),v--,G=p.getImageData(z-1,B,3,l),q(z,B,z,l),z--);if(null==d.guidePart||d.guidePart.x1!=m||d.guidePart.y1!=n)d.guidePart={imgData1:t,x1:m,y1:n,imgData2:y,x2:v,y2:u,imgData3:G,x3:z,y3:B}}catch(L){}}else k=d.origGuideMove.apply(this,arguments);return k};this.origGuideDestroy=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){var a=d.origGuideDestroy.apply(this,arguments);if(null!=d.guidePart)try{p.putImageData(d.guidePart.imgData1,d.guidePart.x1,
d.guidePart.y1),p.putImageData(d.guidePart.imgData2,d.guidePart.x2,d.guidePart.y2),p.putImageData(d.guidePart.imgData3,d.guidePart.x3,d.guidePart.y3),d.guidePart=null}catch(z){}return a}}mxRuler.prototype.RULER_THICKNESS=14;mxRuler.prototype.unit=mxConstants.POINTS;mxRuler.prototype.setUnit=function(a){this.unit=a;this.drawRuler()};
mxRuler.prototype.formatText=function(a){switch(this.unit){case mxConstants.POINTS:return Math.round(a);case mxConstants.MILLIMETERS:return(a/mxConstants.PIXELS_PER_MM).toFixed(1);case mxConstants.INCHES:return(a/mxConstants.PIXELS_PER_INCH).toFixed(2)}};
mxRuler.prototype.destroy=function(){this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.graph.removeListener(this.sizeListener);this.graph.container.removeEventListener("scroll",this.scrollListener);this.graph.view.removeListener("unitChanged",this.unitListener);this.ui.removeListener("pageViewChanged",this.pageListener);this.ui.removeListener("pageScaleChanged",this.pageListener);this.ui.removeListener("pageFormatChanged",
@@ -10376,10 +10379,10 @@ this.pageListener);null!=this.container&&this.container.parentNode.removeChild(t
function mxDualRuler(a,e){var c=new mxPoint(mxRuler.prototype.RULER_THICKNESS,mxRuler.prototype.RULER_THICKNESS);this.editorUiGetDiagContOffset=a.getDiagramContainerOffset;a.getDiagramContainerOffset=function(){return c};this.editorUiRefresh=a.refresh;this.ui=a;this.origGuideMove=mxGuide.prototype.move;this.origGuideDestroy=mxGuide.prototype.destroy;this.vRuler=new mxRuler(a,e,!0);this.hRuler=new mxRuler(a,e,!1,!0);var b=mxUtils.bind(this,function(b){var c=!1;mxEvent.addGestureListeners(b,mxUtils.bind(this,
function(b){c=null!=a.currentMenu;mxEvent.consume(b)}),null,mxUtils.bind(this,function(e){if(a.editor.graph.isEnabled()&&!a.editor.graph.isMouseDown&&(mxEvent.isTouchEvent(e)||mxEvent.isPopupTrigger(e))){a.editor.graph.popupMenuHandler.hideMenu();a.hideCurrentMenu();if(!mxEvent.isTouchEvent(e)||!c){var d=new mxPopupMenu(mxUtils.bind(this,function(b,c){a.menus.addMenuItems(b,["points","millimeters"],c)}));d.div.className+=" geMenubarMenu";d.smartSeparators=!0;d.showDisabled=!0;d.autoExpand=!0;d.hideMenu=
mxUtils.bind(this,function(){mxPopupMenu.prototype.hideMenu.apply(d,arguments);a.resetCurrentMenu();d.destroy()});var f=mxEvent.getClientX(e),k=mxEvent.getClientY(e);d.popup(f,k,null,e);a.setCurrentMenu(d,b)}mxEvent.consume(e)}}))});b(this.hRuler.container);b(this.vRuler.container);this.vRuler.drawRuler();this.hRuler.drawRuler()}mxDualRuler.prototype.setUnit=function(a){this.vRuler.setUnit(a);this.hRuler.setUnit(a)};mxDualRuler.prototype.setStyle=function(a){this.vRuler.setStyle(a);this.hRuler.setStyle(a)};
-mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(a){var e=null!=a.view&&null!=a.view.canvas?a.view.canvas.ownerSVGElement:null;if(null!=a.container&&null!=e){var c=mxFreehand.prototype.NORMAL_SMOOTHING,b=null,k=[],f,l=[],d,g=!1,m=!0,n=[],p=!1,u=!0;this.setClosedPath=function(a){g=a};this.setAutoClose=function(a){m=a};this.setStopClickEnabled=function(a){u=a};this.setSmoothing=function(a){c=a};var t=function(b){p=b;a.getRubberband().setEnabled(!b);a.graphHandler.setSelectEnabled(!b);a.graphHandler.setMoveEnabled(!b);a.container.style.cursor=
-b?"crosshair":"";a.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){t(!0)};this.isDrawing=function(){return p};var q=mxUtils.bind(this,function(a){if(b){var c=u&&0<l.length&&null!=d&&2>d.length;c||l.push.apply(l,d);d=[];l.push(null);k.push(b);b=null;c&&this.stopDrawing();mxEvent.consume(a)}});this.stopDrawing=function(){if(0<k.length){for(var c=l[0].x,d=l[0].x,e=l[0].y,f=l[0].y,n=1;n<l.length;n++)null!=l[n]&&(c=Math.max(c,l[n].x),d=Math.min(d,l[n].x),e=Math.max(e,
-l[n].y),f=Math.min(f,l[n].y));c-=d;e-=f;if(0<c&&0<e){var p=100/c,q=100/e;l.map(function(a){if(null==a)return a;a.x=(a.x-d)*p;a.y=(a.y-f)*q;return a});for(var u='<shape strokewidth="inherit"><foreground>',v=0,n=0;n<l.length;n++){var y=l[n];if(null==y){var y=!1,v=l[v],z=l[n-1];!g&&m&&(y=v.x-z.x,z=v.y-z.y,y=Math.sqrt(y*y+z*z)<=a.tolerance);if(g||y)u+='<line x="'+v.x.toFixed(2)+'" y="'+v.y.toFixed(2)+'"/>';u+="</path>"+(g||y?"<fillstroke/>":"<stroke/>");v=n+1}else u=n==v?u+('<path><move x="'+y.x.toFixed(2)+
+mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(a){var e=null!=a.view&&null!=a.view.canvas?a.view.canvas.ownerSVGElement:null;if(null!=a.container&&null!=e){var c=mxFreehand.prototype.NORMAL_SMOOTHING,b=null,k=[],f,l=[],d,g=!1,m=!0,n=[],p=!1,u=!0;this.setClosedPath=function(a){g=a};this.setAutoClose=function(a){m=a};this.setStopClickEnabled=function(a){u=a};this.setSmoothing=function(a){c=a};var q=function(b){p=b;a.getRubberband().setEnabled(!b);a.graphHandler.setSelectEnabled(!b);a.graphHandler.setMoveEnabled(!b);a.container.style.cursor=
+b?"crosshair":"";a.fireEvent(new mxEventObject("freehandStateChanged"))};this.startDrawing=function(){q(!0)};this.isDrawing=function(){return p};var t=mxUtils.bind(this,function(a){if(b){var c=u&&0<l.length&&null!=d&&2>d.length;c||l.push.apply(l,d);d=[];l.push(null);k.push(b);b=null;c&&this.stopDrawing();mxEvent.consume(a)}});this.stopDrawing=function(){if(0<k.length){for(var c=l[0].x,d=l[0].x,e=l[0].y,f=l[0].y,n=1;n<l.length;n++)null!=l[n]&&(c=Math.max(c,l[n].x),d=Math.min(d,l[n].x),e=Math.max(e,
+l[n].y),f=Math.min(f,l[n].y));c-=d;e-=f;if(0<c&&0<e){var p=100/c,t=100/e;l.map(function(a){if(null==a)return a;a.x=(a.x-d)*p;a.y=(a.y-f)*t;return a});for(var u='<shape strokewidth="inherit"><foreground>',v=0,n=0;n<l.length;n++){var y=l[n];if(null==y){var y=!1,v=l[v],z=l[n-1];!g&&m&&(y=v.x-z.x,z=v.y-z.y,y=Math.sqrt(y*y+z*z)<=a.tolerance);if(g||y)u+='<line x="'+v.x.toFixed(2)+'" y="'+v.y.toFixed(2)+'"/>';u+="</path>"+(g||y?"<fillstroke/>":"<stroke/>");v=n+1}else u=n==v?u+('<path><move x="'+y.x.toFixed(2)+
'" y="'+y.y.toFixed(2)+'"/>'):u+('<line x="'+y.x.toFixed(2)+'" y="'+y.y.toFixed(2)+'"/>')}var n=mxConstants.STYLE_SHAPE+"=stencil("+Graph.compress(u+"</foreground></shape>")+");fillColor=none;",u=a.view.scale,v=a.view.translate,L=new mxCell("",new mxGeometry(d/u-v.x,f/u-v.y,c/u,e/u),n);L.vertex=1;a.model.beginUpdate();try{L=a.addCell(L)}finally{a.model.endUpdate()}a.fireEvent(new mxEventObject("cellsInserted","cells",[L]));a.fireEvent(new mxEventObject("freehandInserted","cell",L));setTimeout(function(){a.setSelectionCells([L])},
-10)}for(n=0;n<k.length;n++)k[n].parentNode.removeChild(k[n]);b=null;k=[];l=[]}t(!1)};mxEvent.addGestureListeners(e,function(c){if(p){var g=parseFloat(a.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1),g=Math.max(1,g*a.view.scale);b=document.createElementNS("http://www.w3.org/2000/svg","path");b.setAttribute("fill","none");b.setAttribute("stroke",a.currentVertexStyle[mxConstants.STYLE_STROKECOLOR]||"#000");b.setAttribute("stroke-width",g);if("1"==a.currentVertexStyle[mxConstants.STYLE_DASHED]){var k=
-a.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",k=k.split(" ").map(function(a){return parseFloat(a)*g}).join(" ");b.setAttribute("stroke-dasharray",k)}n=[];k=v(c);z(k);f="M"+k.x+" "+k.y;l.push(k);d=[];b.setAttribute("d",f);e.appendChild(b);mxEvent.consume(c)}},function(a){if(b){z(v(a));var c=y(0);if(c){f+=" L"+c.x+" "+c.y;l.push(c);var e="";d=[];for(var g=2;g<n.length;g+=2)c=y(g),e+=" L"+c.x+" "+c.y,d.push(c);b.setAttribute("d",f+e)}mxEvent.consume(a)}},q);var v=function(b){return mxUtils.convertPoint(a.container,
+10)}for(n=0;n<k.length;n++)k[n].parentNode.removeChild(k[n]);b=null;k=[];l=[]}q(!1)};mxEvent.addGestureListeners(e,function(c){if(p){var g=parseFloat(a.currentVertexStyle[mxConstants.STYLE_STROKEWIDTH]||1),g=Math.max(1,g*a.view.scale);b=document.createElementNS("http://www.w3.org/2000/svg","path");b.setAttribute("fill","none");b.setAttribute("stroke",a.currentVertexStyle[mxConstants.STYLE_STROKECOLOR]||"#000");b.setAttribute("stroke-width",g);if("1"==a.currentVertexStyle[mxConstants.STYLE_DASHED]){var k=
+a.currentVertexStyle[mxConstants.STYLE_DASH_PATTERN]||"3 3",k=k.split(" ").map(function(a){return parseFloat(a)*g}).join(" ");b.setAttribute("stroke-dasharray",k)}n=[];k=v(c);z(k);f="M"+k.x+" "+k.y;l.push(k);d=[];b.setAttribute("d",f);e.appendChild(b);mxEvent.consume(c)}},function(a){if(b){z(v(a));var c=y(0);if(c){f+=" L"+c.x+" "+c.y;l.push(c);var e="";d=[];for(var g=2;g<n.length;g+=2)c=y(g),e+=" L"+c.x+" "+c.y,d.push(c);b.setAttribute("d",f+e)}mxEvent.consume(a)}},t);var v=function(b){return mxUtils.convertPoint(a.container,
mxEvent.getClientX(b),mxEvent.getClientY(b))},z=function(a){for(n.push(a);n.length>c;)n.shift()},y=function(a){var b=n.length;if(1===b%2||b>=c){var d=0,e=0,f,g=0;for(f=a;f<b;f++)g++,a=n[f],d+=a.x,e+=a.y;return{x:d/g,y:e/g}}return null}}}mxFreehand.prototype.NO_SMOOTHING=1;mxFreehand.prototype.MILD_SMOOTHING=4;mxFreehand.prototype.NORMAL_SMOOTHING=8;mxFreehand.prototype.VERY_SMOOTH_SMOOTHING=12;mxFreehand.prototype.SUPER_SMOOTH_SMOOTHING=16;mxFreehand.prototype.HYPER_SMOOTH_SMOOTHING=20;
diff --git a/src/main/webapp/js/diagramly/App.js b/src/main/webapp/js/diagramly/App.js
index f6ddb6c9..f8d3cf8b 100644
--- a/src/main/webapp/js/diagramly/App.js
+++ b/src/main/webapp/js/diagramly/App.js
@@ -1464,7 +1464,7 @@ App.prototype.init = function()
}
if (!mxClient.IS_CHROMEAPP && !EditorUi.isElectronApp && urlParams['embed'] != '1' && DrawioFile.SYNC == 'auto' &&
- urlParams['local'] != '1' && urlParams['stealth'] != '1' && this.isOffline() &&
+ urlParams['local'] != '1' && urlParams['stealth'] != '1' && !this.isOffline() &&
(!this.editor.chromeless || this.editor.editable))
{
// Checks if the cache is alive
diff --git a/src/main/webapp/js/diagramly/Dialogs.js b/src/main/webapp/js/diagramly/Dialogs.js
index 785af8f6..eed153b6 100644
--- a/src/main/webapp/js/diagramly/Dialogs.js
+++ b/src/main/webapp/js/diagramly/Dialogs.js
@@ -2671,7 +2671,7 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
var nameInput = document.createElement('input');
nameInput.setAttribute('value', editorUi.defaultFilename + ext);
nameInput.style.marginLeft = '10px';
- nameInput.style.width = (compact) ? '144px' : '284px';
+ nameInput.style.width = (compact) ? '144px' : '244px';
this.init = function()
{
@@ -2699,7 +2699,7 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
{
var typeSelect = FilenameDialog.createFileTypes(editorUi, nameInput, editorUi.editor.diagramFileTypes);
typeSelect.style.marginLeft = '6px';
- typeSelect.style.width = (compact) ? '80px' : '140px';
+ typeSelect.style.width = (compact) ? '80px' : '180px';
header.appendChild(typeSelect);
}
diff --git a/src/main/webapp/js/diagramly/DrawioFile.js b/src/main/webapp/js/diagramly/DrawioFile.js
index d8a7655d..fbe4bf8e 100644
--- a/src/main/webapp/js/diagramly/DrawioFile.js
+++ b/src/main/webapp/js/diagramly/DrawioFile.js
@@ -1331,7 +1331,15 @@ DrawioFile.prototype.getDescriptorEtag = function(desc)
};
/**
- * Returns the secret from the given descriptor.
+ * Returns the secret from the given descriptor. This must be stored
+ * in a custom property and generated by the saving client so that a
+ * token can be obtained from the cache for writing the patch after
+ * saving the file. If this cannot be saved in a custom property then
+ * null must be returned so that no deltas are used for updating the
+ * file (the file is reloaded every time instead). This is needed to
+ * make sure nobody with read-only permissions can write a patch to
+ * the cache before the saving client wrote the patch and inject
+ * data into the file via other clients merging that data.
*/
DrawioFile.prototype.getDescriptorSecret = function(desc)
{
@@ -1935,9 +1943,29 @@ DrawioFile.prototype.fileChanged = function()
};
/**
+ * Creates a secret and token pair for writing a patch to the cache.
+ */
+DrawioFile.prototype.createSecret = function(success, error)
+{
+ var secret = Editor.guid(32);
+
+ if (this.sync != null)
+ {
+ this.sync.createToken(secret, mxUtils.bind(this, function(token)
+ {
+ success(secret, token);
+ }), error);
+ }
+ else
+ {
+ success(secret);
+ }
+};
+
+/**
* Invokes sync and updates shadow document.
*/
-DrawioFile.prototype.fileSaved = function(savedData, lastDesc, success, error)
+DrawioFile.prototype.fileSaved = function(savedData, lastDesc, success, error, token)
{
this.lastSaved = new Date();
this.ageStart = null;
@@ -1962,7 +1990,7 @@ DrawioFile.prototype.fileSaved = function(savedData, lastDesc, success, error)
{
this.sync.fileSaved(this.ui.getPagesForNode(
mxUtils.parseXml(savedData).documentElement),
- lastDesc, success, error, savedData);
+ lastDesc, success, error, token);
}
}
catch (e)
diff --git a/src/main/webapp/js/diagramly/DrawioFileSync.js b/src/main/webapp/js/diagramly/DrawioFileSync.js
index 4c9b4982..f87e554f 100644
--- a/src/main/webapp/js/diagramly/DrawioFileSync.js
+++ b/src/main/webapp/js/diagramly/DrawioFileSync.js
@@ -724,152 +724,159 @@ DrawioFileSync.prototype.catchup = function(desc, success, error, abort)
{
var secret = this.file.getDescriptorSecret(desc);
- // Cache entry may not have been uploaded to cache before new
- // etag is visible to client so retry once after cache miss
- var cacheReadyRetryCount = 0;
- var failed = false;
-
- var doCatchup = mxUtils.bind(this, function()
+ if (secret == null)
{
- if (abort == null || !abort())
+ this.reload(success, error, abort);
+ }
+ else
+ {
+ // Cache entry may not have been uploaded to cache before new
+ // etag is visible to client so retry once after cache miss
+ var cacheReadyRetryCount = 0;
+ var failed = false;
+
+ var doCatchup = mxUtils.bind(this, function()
{
- // Ignores patch if shadow has changed
- if (current != this.file.getCurrentRevisionId())
+ if (abort == null || !abort())
{
- if (success != null)
+ // Ignores patch if shadow has changed
+ if (current != this.file.getCurrentRevisionId())
{
- success();
+ if (success != null)
+ {
+ success();
+ }
}
- }
- else if (!this.isValidState())
- {
- if (error != null)
+ else if (!this.isValidState())
{
- error();
+ if (error != null)
+ {
+ error();
+ }
}
- }
- else
- {
- var acceptResponse = true;
-
- var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
- {
- acceptResponse = false;
- this.reload(success, error, abort);
- }), this.ui.timeout);
-
- mxUtils.get(EditorUi.cacheUrl + '?id=' + encodeURIComponent(this.channelId) +
- '&from=' + encodeURIComponent(current) + '&to=' + encodeURIComponent(etag) +
- ((secret != null) ? '&secret=' + encodeURIComponent(secret) : ''),
- mxUtils.bind(this, function(req)
+ else
{
- this.file.stats.bytesReceived += req.getText().length;
- window.clearTimeout(timeoutThread);
+ var acceptResponse = true;
- if (acceptResponse && (abort == null || !abort()))
+ var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
{
- // Ignores patch if shadow has changed
- if (current != this.file.getCurrentRevisionId())
+ acceptResponse = false;
+ this.reload(success, error, abort);
+ }), this.ui.timeout);
+
+ mxUtils.get(EditorUi.cacheUrl + '?id=' + encodeURIComponent(this.channelId) +
+ '&from=' + encodeURIComponent(current) + '&to=' + encodeURIComponent(etag) +
+ ((secret != null) ? '&secret=' + encodeURIComponent(secret) : ''),
+ mxUtils.bind(this, function(req)
+ {
+ this.file.stats.bytesReceived += req.getText().length;
+ window.clearTimeout(timeoutThread);
+
+ if (acceptResponse && (abort == null || !abort()))
{
- if (success != null)
+ // Ignores patch if shadow has changed
+ if (current != this.file.getCurrentRevisionId())
{
- success();
+ if (success != null)
+ {
+ success();
+ }
}
- }
- else if (!this.isValidState())
- {
- if (error != null)
+ else if (!this.isValidState())
{
- error();
+ if (error != null)
+ {
+ error();
+ }
}
- }
- else
- {
- var checksum = null;
- var temp = [];
-
- if (req.getStatus() >= 200 && req.getStatus() <= 299 &&
- req.getText().length > 0)
+ else
{
- try
+ var checksum = null;
+ var temp = [];
+
+ if (req.getStatus() >= 200 && req.getStatus() <= 299 &&
+ req.getText().length > 0)
{
- var result = JSON.parse(req.getText());
-
- if (result != null && result.length > 0)
+ try
{
- for (var i = 0; i < result.length; i++)
+ var result = JSON.parse(req.getText());
+
+ if (result != null && result.length > 0)
{
- var value = this.stringToObject(result[i]);
-
- if (value.v > DrawioFileSync.PROTOCOL)
- {
- failed = true;
- temp = [];
- break;
- }
- else if (value.v === DrawioFileSync.PROTOCOL &&
- value.d != null)
+ for (var i = 0; i < result.length; i++)
{
- checksum = value.d.checksum;
- temp.push(value.d.patch);
- }
- else
- {
- failed = true;
- temp = [];
- break;
+ var value = this.stringToObject(result[i]);
+
+ if (value.v > DrawioFileSync.PROTOCOL)
+ {
+ failed = true;
+ temp = [];
+ break;
+ }
+ else if (value.v === DrawioFileSync.PROTOCOL &&
+ value.d != null)
+ {
+ checksum = value.d.checksum;
+ temp.push(value.d.patch);
+ }
+ else
+ {
+ failed = true;
+ temp = [];
+ break;
+ }
}
}
}
- }
- catch (e)
- {
- temp = [];
-
- if (window.console != null && urlParams['test'] == '1')
+ catch (e)
{
- console.log(e);
+ temp = [];
+
+ if (window.console != null && urlParams['test'] == '1')
+ {
+ console.log(e);
+ }
}
}
- }
-
- try
- {
- if (temp.length > 0)
- {
- this.file.stats.cacheHits++;
- this.merge(temp, checksum, desc, success, error, abort);
- }
- // Retries if cache entry was not yet there
- else if (cacheReadyRetryCount <= this.maxCacheReadyRetries - 1 &&
- !failed && req.getStatus() != 401)
- {
- cacheReadyRetryCount++;
- this.file.stats.cacheMiss++;
- window.setTimeout(doCatchup, (cacheReadyRetryCount + 1) *
- this.cacheReadyDelay);
- }
- else
+
+ try
{
- this.file.stats.cacheFail++;
- this.reload(success, error, abort);
+ if (temp.length > 0)
+ {
+ this.file.stats.cacheHits++;
+ this.merge(temp, checksum, desc, success, error, abort);
+ }
+ // Retries if cache entry was not yet there
+ else if (cacheReadyRetryCount <= this.maxCacheReadyRetries - 1 &&
+ !failed && req.getStatus() != 401)
+ {
+ cacheReadyRetryCount++;
+ this.file.stats.cacheMiss++;
+ window.setTimeout(doCatchup, (cacheReadyRetryCount + 1) *
+ this.cacheReadyDelay);
+ }
+ else
+ {
+ this.file.stats.cacheFail++;
+ this.reload(success, error, abort);
+ }
}
- }
- catch (e)
- {
- if (error != null)
+ catch (e)
{
- error(e);
+ if (error != null)
+ {
+ error(e);
+ }
}
}
}
- }
- }));
+ }));
+ }
}
- }
- });
-
- window.setTimeout(doCatchup, this.cacheReadyDelay);
+ });
+
+ window.setTimeout(doCatchup, this.cacheReadyDelay);
+ }
}
}
};
@@ -1033,8 +1040,7 @@ DrawioFileSync.prototype.merge = function(patches, checksum, desc, success, erro
};
/**
- * Invokes after a file was saved to add cache entry (which in turn notifies
- * collaborators).
+ * Invokes when the file descriptor was changed.
*/
DrawioFileSync.prototype.descriptorChanged = function(etag)
{
@@ -1058,8 +1064,7 @@ DrawioFileSync.prototype.descriptorChanged = function(etag)
};
/**
- * Invokes after a file was saved to add cache entry (which in turn notifies
- * collaborators).
+ * Converts the given object to an encrypted string.
*/
DrawioFileSync.prototype.objectToString = function(obj)
{
@@ -1074,8 +1079,7 @@ DrawioFileSync.prototype.objectToString = function(obj)
};
/**
- * Invokes after a file was saved to add cache entry (which in turn notifies
- * collaborators).
+ * Converts the given encrypted string to an object.
*/
DrawioFileSync.prototype.stringToObject = function(data)
{
@@ -1088,10 +1092,42 @@ DrawioFileSync.prototype.stringToObject = function(data)
};
/**
- * Invokes after a file was saved to add cache entry (which in turn notifies
+ * Requests a token for the given sec
+ */
+DrawioFileSync.prototype.createToken = function(secret, success, error)
+{
+ var acceptResponse = true;
+
+ var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
+ {
+ acceptResponse = false;
+ error({code: App.ERROR_TIMEOUT, message: mxResources.get('timeout')});
+ }), this.ui.timeout);
+
+ mxUtils.get(EditorUi.cacheUrl + '?id=' + encodeURIComponent(this.channelId) +
+ '&secret=' + encodeURIComponent(secret), mxUtils.bind(this, function(req)
+ {
+ window.clearTimeout(timeoutThread);
+
+ if (acceptResponse)
+ {
+ if (req.getStatus() >= 200 && req.getStatus() <= 299)
+ {
+ success(req.getText());
+ }
+ else
+ {
+ error({code: req.getStatus(), message: 'Token Error ' + req.getStatus()});
+ }
+ }
+ }));
+};
+
+/**
+ * Invoked after a file was saved to add cache entry (which in turn notifies
* collaborators).
*/
-DrawioFileSync.prototype.fileSaved = function(pages, lastDesc, success, error)
+DrawioFileSync.prototype.fileSaved = function(pages, lastDesc, success, error, token)
{
this.lastModified = this.file.getLastModifiedDate();
this.resetUpdateStatusThread();
@@ -1104,37 +1140,85 @@ DrawioFileSync.prototype.fileSaved = function(pages, lastDesc, success, error)
if (this.channelId != null)
{
// Computes diff and checksum
- var shadow = (this.file.shadowPages != null) ?
- this.file.shadowPages : this.ui.getPagesForNode(
- mxUtils.parseXml(this.file.shadowData).documentElement)
- var checksum = this.ui.getHashValueForPages(pages);
- var diff = this.ui.diffPages(shadow, pages);
-
- // Data is stored in cache and message is sent to all listeners
+ var msg = this.objectToString(this.createMessage({m: this.lastModified.getTime()}));
+ var secret = this.file.getDescriptorSecret(this.file.getDescriptor());
var etag = this.file.getDescriptorRevisionId(lastDesc);
var current = this.file.getCurrentRevisionId();
- var data = this.objectToString(this.createMessage({patch: diff, checksum: checksum}));
- var msg = this.objectToString(this.createMessage({m: this.lastModified.getTime()}));
- var secret = this.file.getDescriptorSecret(this.file.getDescriptor());
-
- this.file.stats.bytesSent += data.length;
- this.file.stats.msgSent++;
-
- mxUtils.post(EditorUi.cacheUrl, this.getIdParameters() +
- '&from=' + encodeURIComponent(etag) + '&to=' + encodeURIComponent(current) +
- '&msg=' + encodeURIComponent(msg) + ((secret != null) ? '&secret=' + encodeURIComponent(secret) : '') +
- ((data.length < this.maxCacheEntrySize) ? '&data=' + encodeURIComponent(data) : ''),
- mxUtils.bind(this, function(req)
+ if (secret == null)
{
- // Ignores response
- }));
-
- if (urlParams['test'] == '1')
+ this.file.stats.msgSent++;
+
+ // Notify only
+ mxUtils.post(EditorUi.cacheUrl, this.getIdParameters() +
+ '&msg=' + encodeURIComponent(msg), function()
+ {
+ // Ignore response
+ });
+
+ if (success != null)
+ {
+ success();
+ }
+
+ if (urlParams['test'] == '1')
+ {
+ EditorUi.debug('Sync.fileSaved', [this], 'from', etag, 'to', current,
+ 'etag', this.file.getCurrentEtag(), 'notify');
+ }
+ }
+ else
{
- EditorUi.debug('Sync.fileSaved', [this],
- 'from', etag, 'to', current, 'etag', this.file.getCurrentEtag(),
- data.length, 'bytes', 'diff', diff, 'checksum', checksum);
+ var shadow = (this.file.shadowPages != null) ?
+ this.file.shadowPages : this.ui.getPagesForNode(
+ mxUtils.parseXml(this.file.shadowData).documentElement)
+ var checksum = this.ui.getHashValueForPages(pages);
+ var diff = this.ui.diffPages(shadow, pages);
+
+ // Data is stored in cache and message is sent to all listeners
+ var data = this.objectToString(this.createMessage({patch: diff, checksum: checksum}));
+ this.file.stats.bytesSent += data.length;
+ this.file.stats.msgSent++;
+
+ var acceptResponse = true;
+
+ var timeoutThread = window.setTimeout(mxUtils.bind(this, function()
+ {
+ acceptResponse = false;
+ error({code: App.ERROR_TIMEOUT, message: mxResources.get('timeout')});
+ }), this.ui.timeout);
+
+ mxUtils.post(EditorUi.cacheUrl, this.getIdParameters() +
+ '&from=' + encodeURIComponent(etag) + '&to=' + encodeURIComponent(current) +
+ '&msg=' + encodeURIComponent(msg) + ((secret != null) ? '&secret=' + encodeURIComponent(secret) : '') +
+ ((data.length < this.maxCacheEntrySize) ? '&data=' + encodeURIComponent(data) : '') +
+ ((token != null) ? '&token=' + encodeURIComponent(token) : ''),
+ mxUtils.bind(this, function(req)
+ {
+ window.clearTimeout(timeoutThread);
+
+ if (acceptResponse)
+ {
+ if (req.getStatus() >= 200 && req.getStatus() <= 299)
+ {
+ if (success != null)
+ {
+ success();
+ }
+ }
+ else
+ {
+ error({code: req.getStatus(), message: req.getStatus()});
+ }
+ }
+ }));
+
+ if (urlParams['test'] == '1')
+ {
+ EditorUi.debug('Sync.fileSaved', [this],
+ 'from', etag, 'to', current, 'etag', this.file.getCurrentEtag(),
+ data.length, 'bytes', 'diff', diff, 'checksum', checksum);
+ }
}
// Logs successull diff
@@ -1155,12 +1239,9 @@ DrawioFileSync.prototype.fileSaved = function(pages, lastDesc, success, error)
}
}
+ // Ignores cache response as clients
+ // load file if cache entry failed
this.file.shadowPages = pages;
-
- if (success != null)
- {
- success();
- }
};
/**
@@ -1214,7 +1295,7 @@ DrawioFileSync.prototype.fileConflict = function(desc, success, error)
if (error != null)
{
- error({message: mxResources.get('timeout')});
+ error({code: App.ERROR_TIMEOUT, message: mxResources.get('timeout')});
}
}
};
diff --git a/src/main/webapp/js/diagramly/DriveClient.js b/src/main/webapp/js/diagramly/DriveClient.js
index c3527adf..9703ed77 100644
--- a/src/main/webapp/js/diagramly/DriveClient.js
+++ b/src/main/webapp/js/diagramly/DriveClient.js
@@ -1180,7 +1180,7 @@ DriveClient.prototype.getXmlFile = function(resp, success, error, ignoreMime, re
* @param {number} dx X-coordinate of the translation.
* @param {number} dy Y-coordinate of the translation.
*/
-DriveClient.prototype.saveFile = function(file, revision, success, errFn, noCheck, unloading, overwrite, properties)
+DriveClient.prototype.saveFile = function(file, revision, success, errFn, noCheck, unloading, overwrite, properties, secret)
{
try
{
@@ -1330,7 +1330,7 @@ DriveClient.prototype.saveFile = function(file, revision, success, errFn, noChec
}
// Pass to access cache for each etag
- properties.push({'key': 'secret', 'value': Editor.guid(32)});
+ properties.push({'key': 'secret', 'value': (secret != null) ? secret : Editor.guid(32)});
}
// Specifies that no thumbnail should be uploaded in which case the existing thumbnail is used
diff --git a/src/main/webapp/js/diagramly/DriveFile.js b/src/main/webapp/js/diagramly/DriveFile.js
index 5e5da1c3..f3c766df 100644
--- a/src/main/webapp/js/diagramly/DriveFile.js
+++ b/src/main/webapp/js/diagramly/DriveFile.js
@@ -178,169 +178,187 @@ DriveFile.prototype.saveFile = function(title, revision, success, error, unloadi
}
else if (!this.savingFile)
{
- var doSave = mxUtils.bind(this, function(realOverwrite, realRevision)
+ this.savingFile = true;
+
+ this.createSecret(mxUtils.bind(this, function(secret, token)
{
- var prevModified = null;
- var modified = null;
-
- try
+ var doSave = mxUtils.bind(this, function(realOverwrite, realRevision)
{
- // Makes sure no changes get lost while the file is saved
- prevModified = this.isModified;
- modified = this.isModified();
- this.setModified(false);
- this.savingFileTime = new Date();
- this.savingFile = true;
+ var prevModified = null;
+ var modified = null;
- // Waits for success for modified state to be visible
- this.isModified = function()
- {
- return true;
- };
-
- var lastDesc = this.desc;
-
- this.ui.drive.saveFile(this, realRevision, mxUtils.bind(this, function(resp, savedData)
+ try
{
- try
+ // Makes sure no changes get lost while the file is saved
+ prevModified = this.isModified;
+ modified = this.isModified();
+ this.setModified(false);
+ this.savingFileTime = new Date();
+
+ // Waits for success for modified state to be visible
+ this.isModified = function()
{
- this.savingFile = false;
- this.isModified = prevModified;
-
- // Handles special case where resp is false eg
- // if the old file was converted to realtime
- if (resp != false)
+ return true;
+ };
+
+ var lastDesc = this.desc;
+
+ this.ui.drive.saveFile(this, realRevision, mxUtils.bind(this, function(resp, savedData)
+ {
+ try
{
- if (revision)
+ this.savingFile = false;
+ this.isModified = prevModified;
+
+ // Handles special case where resp is false eg
+ // if the old file was converted to realtime
+ if (resp != false)
{
- this.lastAutosaveRevision = new Date().getTime();
+ if (revision)
+ {
+ this.lastAutosaveRevision = new Date().getTime();
+ }
+
+ // Adaptive autosave delay
+ this.autosaveDelay = Math.min(8000,
+ Math.max(this.saveDelay + 500,
+ DriveFile.prototype.autosaveDelay));
+ this.desc = resp;
+
+ // Shows possible errors but keeps the modified flag as the
+ // file was saved but the cache entry could not be written
+ this.fileSaved(savedData, lastDesc, mxUtils.bind(this, function()
+ {
+ this.contentChanged();
+
+ if (success != null)
+ {
+ success(resp);
+ }
+ }), error, token);
}
-
- // Adaptive autosave delay
- this.autosaveDelay = Math.min(8000,
- Math.max(this.saveDelay + 500,
- DriveFile.prototype.autosaveDelay));
- this.desc = resp;
-
- this.fileSaved(savedData, lastDesc, mxUtils.bind(this, function()
+ else
{
- this.contentChanged();
+ this.setModified(modified || this.isModified());
- if (success != null)
+ if (error != null)
{
- success(resp);
+ error(resp);
}
- }), error);
+ }
}
- else
+ catch (e)
{
this.setModified(modified || this.isModified());
if (error != null)
{
- error(resp);
+ error(e);
+ }
+ else
+ {
+ throw e;
}
}
- }
- catch (e)
+ }), mxUtils.bind(this, function(err, desc)
{
- this.setModified(modified || this.isModified());
-
- if (error != null)
+ try
{
- error(e);
- }
- else
- {
- throw e;
- }
- }
- }), mxUtils.bind(this, function(err, desc)
- {
- try
- {
- this.savingFile = false;
- this.isModified = prevModified;
- this.setModified(modified || this.isModified());
-
- if (this.isConflict(err))
- {
- this.inConflictState = true;
-
- if (this.sync != null)
+ this.savingFile = false;
+ this.isModified = prevModified;
+ this.setModified(modified || this.isModified());
+
+ if (this.isConflict(err))
{
- this.savingFile = true;
- this.savingFileTime = new Date();
+ this.inConflictState = true;
- this.sync.fileConflict(desc, mxUtils.bind(this, function()
- {
- // Adds random cool-off
- window.setTimeout(mxUtils.bind(this, function()
- {
- this.updateFileData();
- doSave(realOverwrite, true);
- }), 100 + Math.random() * 500);
- }), mxUtils.bind(this, function()
+ if (this.sync != null)
{
- this.savingFile = false;
+ this.savingFile = true;
+ this.savingFileTime = new Date();
- if (error != null)
+ this.sync.fileConflict(desc, mxUtils.bind(this, function()
{
- error();
- }
- }));
+ // Adds random cool-off
+ window.setTimeout(mxUtils.bind(this, function()
+ {
+ this.updateFileData();
+ doSave(realOverwrite, true);
+ }), 100 + Math.random() * 500);
+ }), mxUtils.bind(this, function()
+ {
+ this.savingFile = false;
+
+ if (error != null)
+ {
+ error();
+ }
+ }));
+ }
+ else if (error != null)
+ {
+ error();
+ }
}
else if (error != null)
{
- error();
+ error(err);
}
}
- else if (error != null)
+ catch (e)
{
- error(err);
+ this.setModified(modified || this.isModified());
+
+ if (error != null)
+ {
+ error(e);
+ }
+ else
+ {
+ throw e;
+ }
}
+ }), unloading, unloading, realOverwrite, null, secret);
+ }
+ catch (e)
+ {
+ this.savingFile = false;
+
+ if (prevModified != null)
+ {
+ this.isModified = prevModified;
}
- catch (e)
+
+ if (modified != null)
{
this.setModified(modified || this.isModified());
-
- if (error != null)
- {
- error(e);
- }
- else
- {
- throw e;
- }
}
- }), unloading, unloading, realOverwrite);
+
+ if (error != null)
+ {
+ error(e);
+ }
+ else
+ {
+ throw e;
+ }
+ }
+ });
+
+ doSave(overwrite, revision);
+ }), mxUtils.bind(this, function(e)
+ {
+ this.savingFile = false;
+
+ if (error != null)
+ {
+ error(e);
}
- catch (e)
+ else
{
- this.savingFile = false;
-
- if (prevModified != null)
- {
- this.isModified = prevModified;
- }
-
- if (modified != null)
- {
- this.setModified(modified || this.isModified());
- }
-
- if (error != null)
- {
- error(e);
- }
- else
- {
- throw e;
- }
+ throw e;
}
- });
-
- doSave(overwrite, revision);
+ }));
}
}
catch (e)
diff --git a/src/main/webapp/js/diagramly/Editor.js b/src/main/webapp/js/diagramly/Editor.js
index a0e03912..b7cc5be9 100644
--- a/src/main/webapp/js/diagramly/Editor.js
+++ b/src/main/webapp/js/diagramly/Editor.js
@@ -1065,17 +1065,17 @@
Editor.GOOGLE_FONTS = 'https://fonts.googleapis.com/css?family=';
/**
- * Generates a unique ID of the given length
+ * Alphabet for global unique IDs.
*/
Editor.GUID_ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_';
/**
- * Generates a unique ID of the given length
+ * Default length for global unique IDs.
*/
Editor.GUID_LENGTH = 20;
/**
- * Generates a unique ID of the given length
+ * Default length for global unique IDs.
*/
Editor.guid = function(length)
{
diff --git a/src/main/webapp/js/diagramly/OneDriveFile.js b/src/main/webapp/js/diagramly/OneDriveFile.js
index 3a5ee772..aa15c0a1 100644
--- a/src/main/webapp/js/diagramly/OneDriveFile.js
+++ b/src/main/webapp/js/diagramly/OneDriveFile.js
@@ -182,20 +182,6 @@ OneDriveFile.prototype.setDescriptor = function(desc)
};
/**
- * Using the quickXorHash of the content as the access password.
- */
-OneDriveFile.prototype.getDescriptorSecret = function(desc)
-{
- if (desc.file != null && desc.file.hashes != null &&
- desc.file.hashes.quickXorHash != null)
- {
- return desc.file.hashes.quickXorHash;
- }
-
- return null;
-};
-
-/**
* Adds all listeners.
*/
OneDriveFile.prototype.getDescriptorEtag = function(desc)
diff --git a/src/main/webapp/js/diagramly/vsdx/importer.js b/src/main/webapp/js/diagramly/vsdx/importer.js
index 7ac3a32b..6ccfa1fa 100644
--- a/src/main/webapp/js/diagramly/vsdx/importer.js
+++ b/src/main/webapp/js/diagramly/vsdx/importer.js
@@ -151,6 +151,13 @@ var com;
}
};
+ mxVsdxCodec.incorrectXMLReqExp = [
+ {
+ regExp: /(\>[^&<]*)\&([^&<;]*\<)/g,
+ repl: '$1&amp;$2'
+ }
+ ];
+
/**
* Parses the input VSDX format and uses the information to populate
* the specified graph.
@@ -319,6 +326,18 @@ var com;
{
doc = mxVsdxCodec.parseXml(mxVsdxCodec.decodeUTF16LE(str));
}
+ else
+ {
+ for (var r = 0; r < mxVsdxCodec.incorrectXMLReqExp.length; r++)
+ {
+ if (mxVsdxCodec.incorrectXMLReqExp[r].regExp.test(str))
+ {
+ str = str.replace(mxVsdxCodec.incorrectXMLReqExp[r].regExp, mxVsdxCodec.incorrectXMLReqExp[r].repl);
+ }
+ }
+
+ doc = mxVsdxCodec.parseXml(str);
+ }
//TODO add any other non-standard encoding that may be needed
}
@@ -11696,7 +11715,12 @@ var com;
else {
return o1 === o2;
} })(lbkgnd, "")) {
- /* put */ (this.styleMap[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR] = lbkgnd);
+ var isFullyTransparent = this.getValue(this.getCellElement$java_lang_String('TextBkgndTrans'), '0') == '1';
+
+ if (!isFullyTransparent)
+ {
+ /* put */ (this.styleMap[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR] = lbkgnd);
+ }
}
/* put */ (this.styleMap[mxConstants.STYLE_ROUNDED] = this.getRounding() > 0 ? com.mxgraph.io.vsdx.mxVsdxConstants.TRUE : com.mxgraph.io.vsdx.mxVsdxConstants.FALSE);
return this.styleMap;
diff --git a/src/main/webapp/js/extensions.min.js b/src/main/webapp/js/extensions.min.js
index 206ca891..f8560e26 100644
--- a/src/main/webapp/js/extensions.min.js
+++ b/src/main/webapp/js/extensions.min.js
@@ -974,46 +974,46 @@ BmpDecoder.prototype.bit24=function(){var f=3*this.width%4;0!=f&&(f=4-f);for(var
BmpDecoder.prototype.bit32=function(){for(var f=this.height-1;0<=f;f--)for(var g=0;g<this.width;g++){var q=this.buffer[this.pos++],e=this.buffer[this.pos++],l=this.buffer[this.pos++],c=this.buffer[this.pos++],b=f*this.width*4+4*g;this.data[b]=l;this.data[b+1]=e;this.data[b+2]=q;this.data[b+3]=c}};BmpDecoder.prototype.getData=function(){return this.data};var __extends=this&&this.__extends||function(f,g){function q(){this.constructor=f}for(var e in g)g.hasOwnProperty(e)&&(f[e]=g[e]);f.prototype=null===g?Object.create(g):(q.prototype=g.prototype,new q)},com;
(function(f){(function(g){(function(g){var e=function(){function l(c){this.RESPONSE_END="</mxfile>";this.RESPONSE_DIAGRAM_START="";this.RESPONSE_DIAGRAM_END="</diagram>";this.RESPONSE_HEADER='<?xml version="1.0" encoding="UTF-8"?><mxfile>';this.vertexMap={};this.edgeShapeMap={};this.vertexShapeMap={};this.parentsMap={};this.layersMap={};this.debugPaths=!1;this.vsdxModel=null;this.editorUi=c}l.vsdxPlaceholder_$LI$=function(){null==l.vsdxPlaceholder&&(l.vsdxPlaceholder=window.atob?atob("dmlzaW8="):
Base64.decode("dmlzaW8=",!0));return l.vsdxPlaceholder};l.parsererrorNS_$LI$=function(){if(null==l.parsererrorNS&&(l.parsererrorNS="",window.DOMParser)){var c=new DOMParser;try{l.parsererrorNS=c.parseFromString("<","text/xml").getElementsByTagName("parsererror")[0].namespaceURI}catch(b){}}return l.parsererrorNS};l.parseXml=function(c){try{var b=mxUtils.parseXml(c);return 0<b.getElementsByTagNameNS(l.parsererrorNS,"parsererror").length?null:b}catch(a){return null}};l.decodeUTF16LE=function(c){for(var b=
-"",a=0;a<c.length;a+=2)b+=String.fromCharCode(c.charCodeAt(a)|c.charCodeAt(a+1)<<8);return b};l.prototype.scaleGraph=function(c,b){if(1!==b){var a=c.getModel(),d;for(d in a.cells){var k=a.cells[d],n=a.getGeometry(k);if(null!=n&&(this.scaleRect(n,b),this.scaleRect(n.alternateBounds,b),a.isEdge(k)&&(this.scalePoint(n.sourcePoint,b),this.scalePoint(n.targetPoint,b),this.scalePoint(n.offset,b),k=n.points,null!=k)))for(n=0;n<k.length;n++)this.scalePoint(k[n],b)}}};l.prototype.decodeVsdx=function(c,b,a,
-d){var k=this,n={},w={},e=function(){var a;function d(){a=a.concat(k.RESPONSE_END);b&&b(a)}for(var c=l.vsdxPlaceholder+"/document.xml",e=n[c]?n[c]:null,y=e.firstChild;null!=y&&1!=y.nodeType;)y=y.nextSibling;if(null!=y&&1==y.nodeType)k.importNodes(e,y,c,n);else return null;k.vsdxModel=new f.mxgraph.io.vsdx.mxVsdxModel(e,n,w);c=k.vsdxModel.getPages();a=k.RESPONSE_HEADER;var A=function(a){null==a.entries&&(a.entries=[]);return a.entries}(c),g=function(b,d){var n=A[b].getValue(),c=z.createMxGraph();c.getModel().beginUpdate();
-z.importPage(n,c,c.getDefaultParent(),!0);z.scaleGraph(c,n.getPageScale()/n.getDrawingScale());c.getModel().endUpdate();z.postImportPage(n,c,function(){z.sanitiseGraph(c);a=a.concat(k.RESPONSE_DIAGRAM_START);a=a.concat(k.processPage(c,n));a=a.concat(k.RESPONSE_DIAGRAM_END);b<A.length-1?g(b+1,d):d()})},z=k;0<A.length?g(0,d):d()},A=0,g=0,q=function(){if(g==A)try{e()}catch(C){console.log(C),null!=d?d():b("")}};JSZip.loadAsync(c).then(function(a){0==Object.keys(a.files).length?null!=d&&d():a.forEach(function(a,
-b){var d=b.name,c=d.toLowerCase(),f=c.length;c.indexOf(".xml")==f-4||c.indexOf(".xml.rels")==f-9?(A++,b.async("string").then(function(a){if(0!==a.length){65279==a.charCodeAt(0)&&(a=a.substring(1));var b=l.parseXml(a);null==b&&0===a.charCodeAt(1)&&0===a.charCodeAt(3)&&0===a.charCodeAt(5)&&(b=l.parseXml(l.decodeUTF16LE(a)));null!=b&&(b.vsdxFileName=d,n[d]=b)}g++;q()})):0===c.indexOf(l.vsdxPlaceholder+"/media")&&(A++,function(a,b){var d=a.length-b.length,k=a.indexOf(b,d);return-1!==k&&k===d}(c,".emf")?
-JSZip.support.blob&&window.EMF_CONVERT_URL?b.async("blob").then(function(a){var b=new FormData;b.append("img",a,c);b.append("inputformat","emf");b.append("outputformat","png");var n=new XMLHttpRequest;n.open("POST",EMF_CONVERT_URL);n.responseType="blob";k.editorUi.addRemoteServiceSecurityCheck(n);n.onreadystatechange=mxUtils.bind(this,function(){if(4==n.readyState)if(200<=n.status&&299>=n.status)try{var a=new FileReader;a.readAsDataURL(n.response);a.onloadend=function(){var b=a.result.indexOf(",")+
-1;w[d]=a.result.substr(b);g++;q()}}catch(ma){console.log(ma),g++,q()}else g++,q()});n.send(b)}):(g++,q()):function(a,b){var d=a.length-b.length,k=a.indexOf(b,d);return-1!==k&&k===d}(c,".bmp")?JSZip.support.uint8array&&b.async("uint8array").then(function(a){a=new BmpDecoder(a);var b=document.createElement("canvas");b.width=a.width;b.height=a.height;b.getContext("2d").putImageData(a.imageData,0,0);a=b.toDataURL("image/jpeg");w[d]=a.substr(23);g++;q()}):b.async("base64").then(function(a){w[d]=a;g++;
-q()}))})},function(a){null!=d&&d(a)})};l.prototype.createMxGraph=function(){var c=new Graph;c.setExtendParents(!1);c.setExtendParentsOnAdd(!1);c.setConstrainChildren(!1);c.setHtmlLabels(!0);c.getModel().maintainEdgeParent=!1;return c};l.prototype.processPage=function(c,b){var a=(new mxCodec).encode(c.getModel());a.setAttribute("style","default-style2");var a=mxUtils.getXml(a),d="";if(null!=b)var k=mxUtils.htmlEntities(b.getPageName())+(b.isBackground()?" (Background)":""),d=d+('<diagram name="'+k+
-'" id="'+k.replace(/\s/g,"_")+'">');return d+=Graph.compress(a)};l.prototype.scalePoint=function(c,b){null!=c&&(c.x*=b,c.y*=b);return c};l.prototype.scaleRect=function(c,b){null!=c&&(c.x*=b,c.y*=b,c.height*=b,c.width*=b);return c};l.prototype.importNodes=function(c,b,a,d){var k=a.lastIndexOf("/"),n=a,f=a;if(-1!==k&&(n=a.substring(0,k),f=a.substring(k+1,a.length),a=function(a,b){return a[b]?a[b]:null}(d,n+"/_rels/"+f+".rels"),null!=a)){var l=a.getElementsByTagName("Relationship");a={};for(k=0;k<l.length;k++){var f=
-l.item(k),e=f.getAttribute("Id"),f=f.getAttribute("Target");a[e]=f}b=b.getElementsByTagName("Rel");for(k=0;k<b.length;k++)if(l=b.item(k),f=function(a,b){return a[b]?a[b]:null}(a,l.getAttribute("r:id")),f=n+"/"+f,null!=f&&(e=d[f]?d[f]:null,null!=e)){l=l.parentNode;for(e=e.firstChild;null!=e&&1!=e.nodeType;)e=e.nextSibling;if(null!=e&&1==e.nodeType)for(e=e.firstChild;null!=e;){if(null!=e&&1==e.nodeType){var g=l.appendChild(c.importNode(e,!0));this.importNodes(c,g,f,d)}e=e.nextSibling}}}};l.prototype.importPage=
-function(c,b,a,d){var k=c.getBackPage();if(null!=k){b.getModel().setValue(b.getDefaultParent(),c.getPageName());var n=new mxCell(k.getPageName());b.addCell(n,b.getModel().getRoot(),0,null,null);this.importPage(k,b,b.getDefaultParent())}k=c.getLayers();this.layersMap[0]=b.getDefaultParent();for(n=0;n<k.length;n++){var f=k[n];if(0==n)var l=b.getDefaultParent();else l=new mxCell,b.addCell(l,b.model.root,n);l.setVisible(1==f.Visible);1==f.Lock&&l.setStyle("locked=1;");l.setValue(f.Name);this.layersMap[n]=
-l}f=function(a){var b=0;return{next:function(){return b<a.length?a[b++]:null},hasNext:function(){return b<a.length}}}(function(a){null==a.entries&&(a.entries=[]);return a.entries}(c.getShapes()));k=c.getPageDimensions().y;for(n=c.getId();f.hasNext();){var l=f.next(),l=l.getValue(),e=this.layersMap[l.layerMember];this.addShape(b,l,e?e:a,n,k)}for(c=function(a){var b=0;return{next:function(){return b<a.length?a[b++]:null},hasNext:function(){return b<a.length}}}(function(a){null==a.entries&&(a.entries=
-[]);return a.entries}(c.getConnects()));c.hasNext();)l=c.next(),a=this.addConnectedEdge(b,l.getValue(),n,k),null!=a&&function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===b)return a.entries.splice(d,1)[0]}(this.edgeShapeMap,a);for(c=function(a){var b=0;return{next:function(){return b<a.length?a[b++]:null},hasNext:function(){return b<a.length}}}(function(a){null==a.entries&&(a.entries=[]);return a.entries}(this.edgeShapeMap));c.hasNext();)a=
-c.next(),a.getKey().getPageNumber()===n&&this.addUnconnectedEdge(b,function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===b)return a.entries[d].value;return null}(this.parentsMap,a.getKey()),a.getValue(),k);d||this.sanitiseGraph(b);return k};l.prototype.postImportPage=function(c,b,a){try{var d=this,k=[],n=c.getShapes().entries||[];for(b=0;b<n.length;b++){var w=n[b].value||{};w.toBeCroppedImg&&
-k.push(w)}if(0<k.length){var l=function(a,b){function n(){a<k.length-1?l(a+1,b):b()}var w=k[a],e=w.toBeCroppedImg,y=function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===b)return a.entries[d].value;return null}(d.vertexMap,new f.mxgraph.io.vsdx.ShapePageId(c.Id,w.Id)),A=new Image;A.onload=function(){var a=e.iData,b=e.iType;try{var d=A.width/e.imgWidth,k=A.height/e.imgHeight,c=-e.imgOffsetX*
-d,f=(e.imgHeight-e.height+e.imgOffsetY)*k,w=document.createElement("canvas");w.width=e.width*d;w.height=e.height*k;var l=w.getContext("2d");l.fillStyle="#FFFFFF";l.fillRect(0,0,w.width,w.height);l.drawImage(A,c,f,w.width,w.height,0,0,w.width,w.height);a=w.toDataURL("image/jpeg").substr(23);b="jpg"}catch(Z){console.log(Z)}y.style+=";image=data:image/"+b+","+a;n()};A.src="data:image/"+e.iType+";base64,"+e.iData;A.onerror=function(){y.style+=";image=data:image/"+e.iType+","+e.iData;n()}};l(0,a)}else a()}catch(A){console.log(A),
-a()}};l.prototype.addShape=function(c,b,a,d,k){b.parentHeight=k;var n=f.mxgraph.io.vsdx.VsdxShape.getType(b.getShape());if(null!=n&&(function(a,b){return a&&a.equals?a.equals(b):a===b}(n,f.mxgraph.io.vsdx.mxVsdxConstants.TYPE_SHAPE)||function(a,b){return a&&a.equals?a.equals(b):a===b}(n,f.mxgraph.io.vsdx.mxVsdxConstants.TYPE_GROUP)||function(a,b){return a&&a.equals?a.equals(b):a===b}(n,f.mxgraph.io.vsdx.mxVsdxConstants.FOREIGN))){var w=b.getId();if(b.isVertex())return n=null,n=b.isGroup()?this.addGroup(c,
-b,a,d,k):this.addVertex(c,b,a,d,k),function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},getValue:function(){return this.value}})}(this.vertexShapeMap,new f.mxgraph.io.vsdx.ShapePageId(d,w),b),b=b.getHyperlink(),b.extLink?c.setLinkForCell(n,b.extLink):b.pageLink&&c.setLinkForCell(n,"data:page/id,"+
-b.pageLink),n;b.setShapeIndex(c.getModel().getChildCount(a));(function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},getValue:function(){return this.value}})})(this.edgeShapeMap,new f.mxgraph.io.vsdx.ShapePageId(d,w),b);(function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=
-a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},getValue:function(){return this.value}})})(this.parentsMap,new f.mxgraph.io.vsdx.ShapePageId(d,w),a)}return null};l.prototype.addGroup=function(c,b,a,d,k){var n=b.getDimensions(),w=b.getMaster(),l=b.getStyleFromShape(),e=b.getGeomList();e.isNoFill()&&(l[mxConstants.STYLE_FILLCOLOR]="none",l[mxConstants.STYLE_GRADIENTCOLOR]="none");
-e.isNoLine()&&(l[mxConstants.STYLE_STROKECOLOR]="none");l.html="1";l[mxConstants.STYLE_WHITE_SPACE]="wrap";var g=f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(l,"="),l=null,q=b.getChildShapes(),l=null!=q&&0<function(a){null==a.entries&&(a.entries=[]);return a.entries.length}(q),e=b.isDisplacedLabel()||b.isRotatedLabel()||l,l=b.getOriginPoint(k,!0);if(e)l=c.insertVertex(a,null,null,Math.floor(Math.round(100*l.x)/100),Math.floor(Math.round(100*l.y)/100),Math.floor(Math.round(100*n.x)/100),Math.floor(Math.round(100*
-n.y)/100),g);else var C=b.getTextLabel(),l=c.insertVertex(a,null,C,Math.floor(Math.round(100*l.x)/100),Math.floor(Math.round(100*l.y)/100),Math.floor(Math.round(100*n.x)/100),Math.floor(Math.round(100*n.y)/100),g);for(a=function(a){var b=0;return{next:function(){return b<a.length?a[b++]:null},hasNext:function(){return b<a.length}}}(function(a){null==a.entries&&(a.entries=[]);return a.entries}(q));a.hasNext();)g=a.next().getValue(),q=g.getId(),g.isVertex()?(C=f.mxgraph.io.vsdx.VsdxShape.getType(g.getShape()),
-null!=C&&(function(a,b){return a&&a.equals?a.equals(b):a===b}(C,f.mxgraph.io.vsdx.mxVsdxConstants.TYPE_SHAPE)||function(a,b){return a&&a.equals?a.equals(b):a===b}(C,f.mxgraph.io.vsdx.mxVsdxConstants.TYPE_GROUP)||function(a,b){return a&&a.equals?a.equals(b):a===b}(C,f.mxgraph.io.vsdx.mxVsdxConstants.FOREIGN))&&g.isVertex()&&(g.propagateRotation(b.getRotation()),g.isGroup()?this.addGroup(c,g,l,d,n.y):this.addVertex(c,g,l,d,n.y)),null==w&&function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<
-a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},getValue:function(){return this.value}})}(this.vertexShapeMap,new f.mxgraph.io.vsdx.ShapePageId(d,q),g)):null==w?(function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,
-value:d,getKey:function(){return this.key},getValue:function(){return this.value}})}(this.edgeShapeMap,new f.mxgraph.io.vsdx.ShapePageId(d,q),g),function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},getValue:function(){return this.value}})}(this.parentsMap,new f.mxgraph.io.vsdx.ShapePageId(d,q),
-l)):this.addUnconnectedEdge(c,l,g,k);e&&b.createLabelSubShape(c,l);c=b.getRotation();if(0!==c)for(n=l.getGeometry(),k=n.width/2,n=n.height/2,w=0;w<l.getChildCount();w++)e=l.getChildAt(w),f.mxgraph.online.Utils.rotatedGeometry(e.getGeometry(),c,k,n);(function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},
-getValue:function(){return this.value}})})(this.vertexMap,new f.mxgraph.io.vsdx.ShapePageId(d,b.getId()),l);return l};l.rotatedEdgePoint=function(c,b,a,d){b=b*Math.PI/180;var k=Math.cos(b);b=Math.sin(b);var n=c.x-a,f=c.y-d;c.x=Math.round(n*k-f*b+a);c.y=Math.round(f*k+n*b+d)};l.prototype.addVertex=function(c,b,a,d,k){var n="",w=b.isDisplacedLabel()||b.isRotatedLabel();w||(n=b.getTextLabel());var l=b.getDimensions(),e=b.getStyleFromShape();e.html="1";var g=e.hasOwnProperty(mxConstants.STYLE_SHAPE)||
-e.hasOwnProperty("stencil");e.hasOwnProperty(mxConstants.STYLE_FILLCOLOR)&&g||(e[mxConstants.STYLE_FILLCOLOR]="none");g||(e[mxConstants.STYLE_STROKECOLOR]="none");e.hasOwnProperty(mxConstants.STYLE_GRADIENTCOLOR)&&g||(e[mxConstants.STYLE_GRADIENTCOLOR]="none");e[mxConstants.STYLE_WHITE_SPACE]="wrap";k=b.getOriginPoint(k,!0);return g||null!=n?(e=f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(e,"="),g=null,g=w?c.insertVertex(a,null,null,Math.floor(Math.round(100*k.x)/100),Math.floor(Math.round(100*k.y)/
-100),Math.floor(Math.round(100*l.x)/100),Math.floor(Math.round(100*l.y)/100),e):c.insertVertex(a,null,n,Math.floor(Math.round(100*k.x)/100),Math.floor(Math.round(100*k.y)/100),Math.floor(Math.round(100*l.x)/100),Math.floor(Math.round(100*l.y)/100),e),function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},
-getValue:function(){return this.value}})}(this.vertexMap,new f.mxgraph.io.vsdx.ShapePageId(d,b.getId()),g),b.setLabelOffset(g,e),w&&b.createLabelSubShape(c,g),g):null};l.calculateAbsolutePoint=function(c){for(var b=0,a=0;null!=c;){var d=c.geometry;null!=d&&(b+=d.x,a+=d.y);c=c.parent}return new mxPoint(b,a)};l.prototype.addConnectedEdge=function(c,b,a,d){var k=b.getFromSheet(),k=new f.mxgraph.io.vsdx.ShapePageId(a,k),n=function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=
-a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===b)return a.entries[d].value;return null}(this.edgeShapeMap,k);if(null==n)return null;var w=function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===b)return a.entries[d].value;return null}(this.parentsMap,new f.mxgraph.io.vsdx.ShapePageId(a,n.getId()));if(null!=w){var e=c.getModel().getGeometry(w);null!=e&&(d=e.height)}var g=
-n.getStartXY(d),z=n.getEndXY(d),e=n.getRoutingPoints(d,g,n.getRotation());this.rotateChildEdge(c.getModel(),w,g,z,e);var q=null,C=b.getSourceToSheet(),C=null!=C?function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===b)return a.entries[d].value;return null}(this.vertexMap,new f.mxgraph.io.vsdx.ShapePageId(a,C)):null,E=!0;if(null==C)C=c.insertVertex(w,null,null,Math.floor(Math.round(100*g.x)/100),
-Math.floor(Math.round(100*g.y)/100),0,0);else if(C.style&&-1==C.style.indexOf(";rotation="))var q=l.calculateAbsolutePoint(C),D=l.calculateAbsolutePoint(w),G=C.geometry,q=new mxPoint((D.x+g.x-q.x)/G.width,(D.y+g.y-q.y)/G.height);else E=!1;g=null;b=b.getTargetToSheet();b=null!=b?function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===b)return a.entries[d].value;return null}(this.vertexMap,new f.mxgraph.io.vsdx.ShapePageId(a,
-b)):null;D=!0;null==b?b=c.insertVertex(w,null,null,Math.floor(Math.round(100*z.x)/100),Math.floor(Math.round(100*z.y)/100),0,0):b.style&&-1==b.style.indexOf(";rotation=")?(a=l.calculateAbsolutePoint(b),g=l.calculateAbsolutePoint(w),G=b.geometry,g=new mxPoint((g.x+z.x-a.x)/G.width,(g.y+z.y-a.y)/G.height)):D=!1;z=n.getStyleFromEdgeShape(d);G=n.getRotation();0!==G?(a=c.insertEdge(w,null,null,C,b,f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(z,"=")),E=n.createLabelSubShape(c,a),null!=E&&(E.setStyle(E.getStyle()+
-";rotation="+(60<G&&240>G?(G+180)%360:G)),E=E.getGeometry(),E.x=0,E.y=0,E.relative=!0,E.offset=new mxPoint(-E.width/2,-E.height/2))):(a=c.insertEdge(w,null,n.getTextLabel(),C,b,f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(z,"=")),G=n.getLblEdgeOffset(c.getView(),e),a.getGeometry().offset=G,null!=q&&c.setConnectionConstraint(a,C,!0,new mxConnectionConstraint(q,!1)),E&&e.shift(),null!=g&&c.setConnectionConstraint(a,b,!1,new mxConnectionConstraint(g,!1)),D&&e.pop());E=c.getModel().getGeometry(a);if(C.parent!=
-b.parent&&null!=w&&1!=w.id&&1==C.parent.id){b=q=0;do g=w.geometry,null!=g&&(q+=g.x,b+=g.y),w=w.parent;while(null!=w);a.parent=C.parent;for(w=0;w<e.length;w++)e[w].x+=q,e[w].y+=b}E.points=e;z.hasOwnProperty("curved")&&function(a,b){return a&&a.equals?a.equals(b):a===b}(function(a,b){return a[b]?a[b]:null}(z,"curved"),"1")&&(E=c.getModel().getGeometry(a),c=n.getControlPoints(d),E.points=c);return k};l.prototype.addUnconnectedEdge=function(c,b,a,d){if(null!=b){var k=c.getModel().getGeometry(b);null!=
-k&&(d=k.height)}var n=a.getStartXY(d),w=a.getEndXY(d),l=a.getStyleFromEdgeShape(d),e=a.getRoutingPoints(d,n,a.getRotation()),g=a.getRotation();if(0!==g){0===a.getShapeIndex()?k=c.insertEdge(b,null,null,null,null,f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(l,"=")):(k=c.createEdge(b,null,null,null,null,f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(l,"=")),k=c.addEdge(k,b,null,null,a.getShapeIndex()));var q=a.createLabelSubShape(c,k);null!=q&&(q.setStyle(q.getStyle()+";rotation="+(60<g&&240>g?(g+180)%
-360:g)),g=q.getGeometry(),g.x=0,g.y=0,g.relative=!0,g.offset=new mxPoint(-g.width/2,-g.height/2))}else 0===a.getShapeIndex()?k=c.insertEdge(b,null,a.getTextLabel(),null,null,f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(l,"=")):(k=c.createEdge(b,null,a.getTextLabel(),null,null,f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(l,"=")),k=c.addEdge(k,b,null,null,a.getShapeIndex())),g=a.getLblEdgeOffset(c.getView(),e),k.getGeometry().offset=g;this.rotateChildEdge(c.getModel(),b,n,w,e);b=c.getModel().getGeometry(k);
-e.pop();e.shift();b.points=e;b.setTerminalPoint(n,!0);b.setTerminalPoint(w,!1);l.hasOwnProperty("curved")&&function(a,b){return a&&a.equals?a.equals(b):a===b}(function(a,b){return a[b]?a[b]:null}(l,"curved"),"1")&&(b=c.getModel().getGeometry(k),c=a.getControlPoints(d),b.points=c);return k};l.prototype.rotateChildEdge=function(c,b,a,d,k){if(null!=b){var n=c.getGeometry(b);c=c.getStyle(b);if(null!=n&&null!=c&&(b=c.indexOf("rotation="),-1<b))for(c=parseFloat(c.substring(b+9,c.indexOf(";",b))),b=n.width/
-2,n=n.height/2,l.rotatedEdgePoint(a,c,b,n),l.rotatedEdgePoint(d,c,b,n),a=0;a<k.length;a++)l.rotatedEdgePoint(k[a],c,b,n)}};l.prototype.sanitiseGraph=function(c){var b=c.getModel().getRoot();this.sanitiseCell(c,b)};l.prototype.sanitiseCell=function(c,b){for(var a=c.getModel(),d=a.getChildCount(b),k=[],n=0;n<d;n++){var f=a.getChildAt(b,n);this.sanitiseCell(c,f)&&0<k.push(f)}for(n=0;n<k.length;n++)a.remove(k[n]);0<d&&(d=a.getChildCount(b));k=(new String(a.getValue(b))).toString();n=a.getStyle(b);return 0!==
-d||!a.isVertex(b)||null!=a.getValue(b)&&0!==k.length||null==n||-1==n.indexOf(mxConstants.STYLE_FILLCOLOR+"=none")||-1==n.indexOf(mxConstants.STYLE_STROKECOLOR+"=none")||-1!=n.indexOf("image=")?!1:!0};return l}();g.mxVsdxCodec=e;e.__class="com.mxgraph.io.mxVsdxCodec"})(g.io||(g.io={}))})(f.mxgraph||(f.mxgraph={}))})(com||(com={}));
+"",a=0;a<c.length;a+=2)b+=String.fromCharCode(c.charCodeAt(a)|c.charCodeAt(a+1)<<8);return b};l.prototype.scaleGraph=function(c,b){if(1!==b){var a=c.getModel(),d;for(d in a.cells){var k=a.cells[d],n=a.getGeometry(k);if(null!=n&&(this.scaleRect(n,b),this.scaleRect(n.alternateBounds,b),a.isEdge(k)&&(this.scalePoint(n.sourcePoint,b),this.scalePoint(n.targetPoint,b),this.scalePoint(n.offset,b),k=n.points,null!=k)))for(n=0;n<k.length;n++)this.scalePoint(k[n],b)}}};l.incorrectXMLReqExp=[{regExp:/(\>[^&<]*)\&([^&<;]*\<)/g,
+repl:"$1&amp;$2"}];l.prototype.decodeVsdx=function(c,b,a,d){var k=this,n={},w={},e=function(){var a;function d(){a=a.concat(k.RESPONSE_END);b&&b(a)}for(var c=l.vsdxPlaceholder+"/document.xml",e=n[c]?n[c]:null,y=e.firstChild;null!=y&&1!=y.nodeType;)y=y.nextSibling;if(null!=y&&1==y.nodeType)k.importNodes(e,y,c,n);else return null;k.vsdxModel=new f.mxgraph.io.vsdx.mxVsdxModel(e,n,w);c=k.vsdxModel.getPages();a=k.RESPONSE_HEADER;var A=function(a){null==a.entries&&(a.entries=[]);return a.entries}(c),g=
+function(b,d){var n=A[b].getValue(),c=z.createMxGraph();c.getModel().beginUpdate();z.importPage(n,c,c.getDefaultParent(),!0);z.scaleGraph(c,n.getPageScale()/n.getDrawingScale());c.getModel().endUpdate();z.postImportPage(n,c,function(){z.sanitiseGraph(c);a=a.concat(k.RESPONSE_DIAGRAM_START);a=a.concat(k.processPage(c,n));a=a.concat(k.RESPONSE_DIAGRAM_END);b<A.length-1?g(b+1,d):d()})},z=k;0<A.length?g(0,d):d()},A=0,g=0,q=function(){if(g==A)try{e()}catch(C){console.log(C),null!=d?d():b("")}};JSZip.loadAsync(c).then(function(a){0==
+Object.keys(a.files).length?null!=d&&d():a.forEach(function(a,b){var d=b.name,c=d.toLowerCase(),f=c.length;c.indexOf(".xml")==f-4||c.indexOf(".xml.rels")==f-9?(A++,b.async("string").then(function(a){if(0!==a.length){65279==a.charCodeAt(0)&&(a=a.substring(1));var b=l.parseXml(a);if(null==b)if(0===a.charCodeAt(1)&&0===a.charCodeAt(3)&&0===a.charCodeAt(5))b=l.parseXml(l.decodeUTF16LE(a));else{for(b=0;b<l.incorrectXMLReqExp.length;b++)l.incorrectXMLReqExp[b].regExp.test(a)&&(a=a.replace(l.incorrectXMLReqExp[b].regExp,
+l.incorrectXMLReqExp[b].repl));b=l.parseXml(a)}null!=b&&(b.vsdxFileName=d,n[d]=b)}g++;q()})):0===c.indexOf(l.vsdxPlaceholder+"/media")&&(A++,function(a,b){var d=a.length-b.length,k=a.indexOf(b,d);return-1!==k&&k===d}(c,".emf")?JSZip.support.blob&&window.EMF_CONVERT_URL?b.async("blob").then(function(a){var b=new FormData;b.append("img",a,c);b.append("inputformat","emf");b.append("outputformat","png");var n=new XMLHttpRequest;n.open("POST",EMF_CONVERT_URL);n.responseType="blob";k.editorUi.addRemoteServiceSecurityCheck(n);
+n.onreadystatechange=mxUtils.bind(this,function(){if(4==n.readyState)if(200<=n.status&&299>=n.status)try{var a=new FileReader;a.readAsDataURL(n.response);a.onloadend=function(){var b=a.result.indexOf(",")+1;w[d]=a.result.substr(b);g++;q()}}catch(ma){console.log(ma),g++,q()}else g++,q()});n.send(b)}):(g++,q()):function(a,b){var d=a.length-b.length,k=a.indexOf(b,d);return-1!==k&&k===d}(c,".bmp")?JSZip.support.uint8array&&b.async("uint8array").then(function(a){a=new BmpDecoder(a);var b=document.createElement("canvas");
+b.width=a.width;b.height=a.height;b.getContext("2d").putImageData(a.imageData,0,0);a=b.toDataURL("image/jpeg");w[d]=a.substr(23);g++;q()}):b.async("base64").then(function(a){w[d]=a;g++;q()}))})},function(a){null!=d&&d(a)})};l.prototype.createMxGraph=function(){var c=new Graph;c.setExtendParents(!1);c.setExtendParentsOnAdd(!1);c.setConstrainChildren(!1);c.setHtmlLabels(!0);c.getModel().maintainEdgeParent=!1;return c};l.prototype.processPage=function(c,b){var a=(new mxCodec).encode(c.getModel());a.setAttribute("style",
+"default-style2");var a=mxUtils.getXml(a),d="";if(null!=b)var k=mxUtils.htmlEntities(b.getPageName())+(b.isBackground()?" (Background)":""),d=d+('<diagram name="'+k+'" id="'+k.replace(/\s/g,"_")+'">');return d+=Graph.compress(a)};l.prototype.scalePoint=function(c,b){null!=c&&(c.x*=b,c.y*=b);return c};l.prototype.scaleRect=function(c,b){null!=c&&(c.x*=b,c.y*=b,c.height*=b,c.width*=b);return c};l.prototype.importNodes=function(c,b,a,d){var k=a.lastIndexOf("/"),n=a,f=a;if(-1!==k&&(n=a.substring(0,k),
+f=a.substring(k+1,a.length),a=function(a,b){return a[b]?a[b]:null}(d,n+"/_rels/"+f+".rels"),null!=a)){var l=a.getElementsByTagName("Relationship");a={};for(k=0;k<l.length;k++){var f=l.item(k),e=f.getAttribute("Id"),f=f.getAttribute("Target");a[e]=f}b=b.getElementsByTagName("Rel");for(k=0;k<b.length;k++)if(l=b.item(k),f=function(a,b){return a[b]?a[b]:null}(a,l.getAttribute("r:id")),f=n+"/"+f,null!=f&&(e=d[f]?d[f]:null,null!=e)){l=l.parentNode;for(e=e.firstChild;null!=e&&1!=e.nodeType;)e=e.nextSibling;
+if(null!=e&&1==e.nodeType)for(e=e.firstChild;null!=e;){if(null!=e&&1==e.nodeType){var g=l.appendChild(c.importNode(e,!0));this.importNodes(c,g,f,d)}e=e.nextSibling}}}};l.prototype.importPage=function(c,b,a,d){var k=c.getBackPage();if(null!=k){b.getModel().setValue(b.getDefaultParent(),c.getPageName());var n=new mxCell(k.getPageName());b.addCell(n,b.getModel().getRoot(),0,null,null);this.importPage(k,b,b.getDefaultParent())}k=c.getLayers();this.layersMap[0]=b.getDefaultParent();for(n=0;n<k.length;n++){var f=
+k[n];if(0==n)var l=b.getDefaultParent();else l=new mxCell,b.addCell(l,b.model.root,n);l.setVisible(1==f.Visible);1==f.Lock&&l.setStyle("locked=1;");l.setValue(f.Name);this.layersMap[n]=l}f=function(a){var b=0;return{next:function(){return b<a.length?a[b++]:null},hasNext:function(){return b<a.length}}}(function(a){null==a.entries&&(a.entries=[]);return a.entries}(c.getShapes()));k=c.getPageDimensions().y;for(n=c.getId();f.hasNext();){var l=f.next(),l=l.getValue(),e=this.layersMap[l.layerMember];this.addShape(b,
+l,e?e:a,n,k)}for(c=function(a){var b=0;return{next:function(){return b<a.length?a[b++]:null},hasNext:function(){return b<a.length}}}(function(a){null==a.entries&&(a.entries=[]);return a.entries}(c.getConnects()));c.hasNext();)l=c.next(),a=this.addConnectedEdge(b,l.getValue(),n,k),null!=a&&function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===b)return a.entries.splice(d,1)[0]}(this.edgeShapeMap,
+a);for(c=function(a){var b=0;return{next:function(){return b<a.length?a[b++]:null},hasNext:function(){return b<a.length}}}(function(a){null==a.entries&&(a.entries=[]);return a.entries}(this.edgeShapeMap));c.hasNext();)a=c.next(),a.getKey().getPageNumber()===n&&this.addUnconnectedEdge(b,function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===b)return a.entries[d].value;return null}(this.parentsMap,
+a.getKey()),a.getValue(),k);d||this.sanitiseGraph(b);return k};l.prototype.postImportPage=function(c,b,a){try{var d=this,k=[],n=c.getShapes().entries||[];for(b=0;b<n.length;b++){var w=n[b].value||{};w.toBeCroppedImg&&k.push(w)}if(0<k.length){var l=function(a,b){function n(){a<k.length-1?l(a+1,b):b()}var w=k[a],e=w.toBeCroppedImg,y=function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===b)return a.entries[d].value;
+return null}(d.vertexMap,new f.mxgraph.io.vsdx.ShapePageId(c.Id,w.Id)),A=new Image;A.onload=function(){var a=e.iData,b=e.iType;try{var d=A.width/e.imgWidth,k=A.height/e.imgHeight,c=-e.imgOffsetX*d,f=(e.imgHeight-e.height+e.imgOffsetY)*k,w=document.createElement("canvas");w.width=e.width*d;w.height=e.height*k;var l=w.getContext("2d");l.fillStyle="#FFFFFF";l.fillRect(0,0,w.width,w.height);l.drawImage(A,c,f,w.width,w.height,0,0,w.width,w.height);a=w.toDataURL("image/jpeg").substr(23);b="jpg"}catch(Z){console.log(Z)}y.style+=
+";image=data:image/"+b+","+a;n()};A.src="data:image/"+e.iType+";base64,"+e.iData;A.onerror=function(){y.style+=";image=data:image/"+e.iType+","+e.iData;n()}};l(0,a)}else a()}catch(A){console.log(A),a()}};l.prototype.addShape=function(c,b,a,d,k){b.parentHeight=k;var n=f.mxgraph.io.vsdx.VsdxShape.getType(b.getShape());if(null!=n&&(function(a,b){return a&&a.equals?a.equals(b):a===b}(n,f.mxgraph.io.vsdx.mxVsdxConstants.TYPE_SHAPE)||function(a,b){return a&&a.equals?a.equals(b):a===b}(n,f.mxgraph.io.vsdx.mxVsdxConstants.TYPE_GROUP)||
+function(a,b){return a&&a.equals?a.equals(b):a===b}(n,f.mxgraph.io.vsdx.mxVsdxConstants.FOREIGN))){var w=b.getId();if(b.isVertex())return n=null,n=b.isGroup()?this.addGroup(c,b,a,d,k):this.addVertex(c,b,a,d,k),function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},getValue:function(){return this.value}})}(this.vertexShapeMap,
+new f.mxgraph.io.vsdx.ShapePageId(d,w),b),b=b.getHyperlink(),b.extLink?c.setLinkForCell(n,b.extLink):b.pageLink&&c.setLinkForCell(n,"data:page/id,"+b.pageLink),n;b.setShapeIndex(c.getModel().getChildCount(a));(function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},getValue:function(){return this.value}})})(this.edgeShapeMap,
+new f.mxgraph.io.vsdx.ShapePageId(d,w),b);(function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},getValue:function(){return this.value}})})(this.parentsMap,new f.mxgraph.io.vsdx.ShapePageId(d,w),a)}return null};l.prototype.addGroup=function(c,b,a,d,k){var n=b.getDimensions(),w=b.getMaster(),l=b.getStyleFromShape(),
+e=b.getGeomList();e.isNoFill()&&(l[mxConstants.STYLE_FILLCOLOR]="none",l[mxConstants.STYLE_GRADIENTCOLOR]="none");e.isNoLine()&&(l[mxConstants.STYLE_STROKECOLOR]="none");l.html="1";l[mxConstants.STYLE_WHITE_SPACE]="wrap";var g=f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(l,"="),l=null,q=b.getChildShapes(),l=null!=q&&0<function(a){null==a.entries&&(a.entries=[]);return a.entries.length}(q),e=b.isDisplacedLabel()||b.isRotatedLabel()||l,l=b.getOriginPoint(k,!0);if(e)l=c.insertVertex(a,null,null,Math.floor(Math.round(100*
+l.x)/100),Math.floor(Math.round(100*l.y)/100),Math.floor(Math.round(100*n.x)/100),Math.floor(Math.round(100*n.y)/100),g);else var C=b.getTextLabel(),l=c.insertVertex(a,null,C,Math.floor(Math.round(100*l.x)/100),Math.floor(Math.round(100*l.y)/100),Math.floor(Math.round(100*n.x)/100),Math.floor(Math.round(100*n.y)/100),g);for(a=function(a){var b=0;return{next:function(){return b<a.length?a[b++]:null},hasNext:function(){return b<a.length}}}(function(a){null==a.entries&&(a.entries=[]);return a.entries}(q));a.hasNext();)g=
+a.next().getValue(),q=g.getId(),g.isVertex()?(C=f.mxgraph.io.vsdx.VsdxShape.getType(g.getShape()),null!=C&&(function(a,b){return a&&a.equals?a.equals(b):a===b}(C,f.mxgraph.io.vsdx.mxVsdxConstants.TYPE_SHAPE)||function(a,b){return a&&a.equals?a.equals(b):a===b}(C,f.mxgraph.io.vsdx.mxVsdxConstants.TYPE_GROUP)||function(a,b){return a&&a.equals?a.equals(b):a===b}(C,f.mxgraph.io.vsdx.mxVsdxConstants.FOREIGN))&&g.isVertex()&&(g.propagateRotation(b.getRotation()),g.isGroup()?this.addGroup(c,g,l,d,n.y):this.addVertex(c,
+g,l,d,n.y)),null==w&&function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},getValue:function(){return this.value}})}(this.vertexShapeMap,new f.mxgraph.io.vsdx.ShapePageId(d,q),g)):null==w?(function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&
+a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},getValue:function(){return this.value}})}(this.edgeShapeMap,new f.mxgraph.io.vsdx.ShapePageId(d,q),g),function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},
+getValue:function(){return this.value}})}(this.parentsMap,new f.mxgraph.io.vsdx.ShapePageId(d,q),l)):this.addUnconnectedEdge(c,l,g,k);e&&b.createLabelSubShape(c,l);c=b.getRotation();if(0!==c)for(n=l.getGeometry(),k=n.width/2,n=n.height/2,w=0;w<l.getChildCount();w++)e=l.getChildAt(w),f.mxgraph.online.Utils.rotatedGeometry(e.getGeometry(),c,k,n);(function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===
+b){a.entries[k].value=d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},getValue:function(){return this.value}})})(this.vertexMap,new f.mxgraph.io.vsdx.ShapePageId(d,b.getId()),l);return l};l.rotatedEdgePoint=function(c,b,a,d){b=b*Math.PI/180;var k=Math.cos(b);b=Math.sin(b);var n=c.x-a,f=c.y-d;c.x=Math.round(n*k-f*b+a);c.y=Math.round(f*k+n*b+d)};l.prototype.addVertex=function(c,b,a,d,k){var n="",w=b.isDisplacedLabel()||b.isRotatedLabel();w||(n=b.getTextLabel());var l=b.getDimensions(),
+e=b.getStyleFromShape();e.html="1";var g=e.hasOwnProperty(mxConstants.STYLE_SHAPE)||e.hasOwnProperty("stencil");e.hasOwnProperty(mxConstants.STYLE_FILLCOLOR)&&g||(e[mxConstants.STYLE_FILLCOLOR]="none");g||(e[mxConstants.STYLE_STROKECOLOR]="none");e.hasOwnProperty(mxConstants.STYLE_GRADIENTCOLOR)&&g||(e[mxConstants.STYLE_GRADIENTCOLOR]="none");e[mxConstants.STYLE_WHITE_SPACE]="wrap";k=b.getOriginPoint(k,!0);return g||null!=n?(e=f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(e,"="),g=null,g=w?c.insertVertex(a,
+null,null,Math.floor(Math.round(100*k.x)/100),Math.floor(Math.round(100*k.y)/100),Math.floor(Math.round(100*l.x)/100),Math.floor(Math.round(100*l.y)/100),e):c.insertVertex(a,null,n,Math.floor(Math.round(100*k.x)/100),Math.floor(Math.round(100*k.y)/100),Math.floor(Math.round(100*l.x)/100),Math.floor(Math.round(100*l.y)/100),e),function(a,b,d){null==a.entries&&(a.entries=[]);for(var k=0;k<a.entries.length;k++)if(null!=a.entries[k].key.equals&&a.entries[k].key.equals(b)||a.entries[k].key===b){a.entries[k].value=
+d;return}a.entries.push({key:b,value:d,getKey:function(){return this.key},getValue:function(){return this.value}})}(this.vertexMap,new f.mxgraph.io.vsdx.ShapePageId(d,b.getId()),g),b.setLabelOffset(g,e),w&&b.createLabelSubShape(c,g),g):null};l.calculateAbsolutePoint=function(c){for(var b=0,a=0;null!=c;){var d=c.geometry;null!=d&&(b+=d.x,a+=d.y);c=c.parent}return new mxPoint(b,a)};l.prototype.addConnectedEdge=function(c,b,a,d){var k=b.getFromSheet(),k=new f.mxgraph.io.vsdx.ShapePageId(a,k),n=function(a,
+b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===b)return a.entries[d].value;return null}(this.edgeShapeMap,k);if(null==n)return null;var w=function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===b)return a.entries[d].value;return null}(this.parentsMap,new f.mxgraph.io.vsdx.ShapePageId(a,n.getId()));
+if(null!=w){var e=c.getModel().getGeometry(w);null!=e&&(d=e.height)}var g=n.getStartXY(d),z=n.getEndXY(d),e=n.getRoutingPoints(d,g,n.getRotation());this.rotateChildEdge(c.getModel(),w,g,z,e);var q=null,C=b.getSourceToSheet(),C=null!=C?function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===b)return a.entries[d].value;return null}(this.vertexMap,new f.mxgraph.io.vsdx.ShapePageId(a,C)):null,E=!0;
+if(null==C)C=c.insertVertex(w,null,null,Math.floor(Math.round(100*g.x)/100),Math.floor(Math.round(100*g.y)/100),0,0);else if(C.style&&-1==C.style.indexOf(";rotation="))var q=l.calculateAbsolutePoint(C),D=l.calculateAbsolutePoint(w),G=C.geometry,q=new mxPoint((D.x+g.x-q.x)/G.width,(D.y+g.y-q.y)/G.height);else E=!1;g=null;b=b.getTargetToSheet();b=null!=b?function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=a.entries[d].key.equals&&a.entries[d].key.equals(b)||a.entries[d].key===
+b)return a.entries[d].value;return null}(this.vertexMap,new f.mxgraph.io.vsdx.ShapePageId(a,b)):null;D=!0;null==b?b=c.insertVertex(w,null,null,Math.floor(Math.round(100*z.x)/100),Math.floor(Math.round(100*z.y)/100),0,0):b.style&&-1==b.style.indexOf(";rotation=")?(a=l.calculateAbsolutePoint(b),g=l.calculateAbsolutePoint(w),G=b.geometry,g=new mxPoint((g.x+z.x-a.x)/G.width,(g.y+z.y-a.y)/G.height)):D=!1;z=n.getStyleFromEdgeShape(d);G=n.getRotation();0!==G?(a=c.insertEdge(w,null,null,C,b,f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(z,
+"=")),E=n.createLabelSubShape(c,a),null!=E&&(E.setStyle(E.getStyle()+";rotation="+(60<G&&240>G?(G+180)%360:G)),E=E.getGeometry(),E.x=0,E.y=0,E.relative=!0,E.offset=new mxPoint(-E.width/2,-E.height/2))):(a=c.insertEdge(w,null,n.getTextLabel(),C,b,f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(z,"=")),G=n.getLblEdgeOffset(c.getView(),e),a.getGeometry().offset=G,null!=q&&c.setConnectionConstraint(a,C,!0,new mxConnectionConstraint(q,!1)),E&&e.shift(),null!=g&&c.setConnectionConstraint(a,b,!1,new mxConnectionConstraint(g,
+!1)),D&&e.pop());E=c.getModel().getGeometry(a);if(C.parent!=b.parent&&null!=w&&1!=w.id&&1==C.parent.id){b=q=0;do g=w.geometry,null!=g&&(q+=g.x,b+=g.y),w=w.parent;while(null!=w);a.parent=C.parent;for(w=0;w<e.length;w++)e[w].x+=q,e[w].y+=b}E.points=e;z.hasOwnProperty("curved")&&function(a,b){return a&&a.equals?a.equals(b):a===b}(function(a,b){return a[b]?a[b]:null}(z,"curved"),"1")&&(E=c.getModel().getGeometry(a),c=n.getControlPoints(d),E.points=c);return k};l.prototype.addUnconnectedEdge=function(c,
+b,a,d){if(null!=b){var k=c.getModel().getGeometry(b);null!=k&&(d=k.height)}var n=a.getStartXY(d),w=a.getEndXY(d),l=a.getStyleFromEdgeShape(d),e=a.getRoutingPoints(d,n,a.getRotation()),g=a.getRotation();if(0!==g){0===a.getShapeIndex()?k=c.insertEdge(b,null,null,null,null,f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(l,"=")):(k=c.createEdge(b,null,null,null,null,f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(l,"=")),k=c.addEdge(k,b,null,null,a.getShapeIndex()));var q=a.createLabelSubShape(c,k);null!=q&&
+(q.setStyle(q.getStyle()+";rotation="+(60<g&&240>g?(g+180)%360:g)),g=q.getGeometry(),g.x=0,g.y=0,g.relative=!0,g.offset=new mxPoint(-g.width/2,-g.height/2))}else 0===a.getShapeIndex()?k=c.insertEdge(b,null,a.getTextLabel(),null,null,f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(l,"=")):(k=c.createEdge(b,null,a.getTextLabel(),null,null,f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(l,"=")),k=c.addEdge(k,b,null,null,a.getShapeIndex())),g=a.getLblEdgeOffset(c.getView(),e),k.getGeometry().offset=g;this.rotateChildEdge(c.getModel(),
+b,n,w,e);b=c.getModel().getGeometry(k);e.pop();e.shift();b.points=e;b.setTerminalPoint(n,!0);b.setTerminalPoint(w,!1);l.hasOwnProperty("curved")&&function(a,b){return a&&a.equals?a.equals(b):a===b}(function(a,b){return a[b]?a[b]:null}(l,"curved"),"1")&&(b=c.getModel().getGeometry(k),c=a.getControlPoints(d),b.points=c);return k};l.prototype.rotateChildEdge=function(c,b,a,d,k){if(null!=b){var n=c.getGeometry(b);c=c.getStyle(b);if(null!=n&&null!=c&&(b=c.indexOf("rotation="),-1<b))for(c=parseFloat(c.substring(b+
+9,c.indexOf(";",b))),b=n.width/2,n=n.height/2,l.rotatedEdgePoint(a,c,b,n),l.rotatedEdgePoint(d,c,b,n),a=0;a<k.length;a++)l.rotatedEdgePoint(k[a],c,b,n)}};l.prototype.sanitiseGraph=function(c){var b=c.getModel().getRoot();this.sanitiseCell(c,b)};l.prototype.sanitiseCell=function(c,b){for(var a=c.getModel(),d=a.getChildCount(b),k=[],n=0;n<d;n++){var f=a.getChildAt(b,n);this.sanitiseCell(c,f)&&0<k.push(f)}for(n=0;n<k.length;n++)a.remove(k[n]);0<d&&(d=a.getChildCount(b));k=(new String(a.getValue(b))).toString();
+n=a.getStyle(b);return 0!==d||!a.isVertex(b)||null!=a.getValue(b)&&0!==k.length||null==n||-1==n.indexOf(mxConstants.STYLE_FILLCOLOR+"=none")||-1==n.indexOf(mxConstants.STYLE_STROKECOLOR+"=none")||-1!=n.indexOf("image=")?!1:!0};return l}();g.mxVsdxCodec=e;e.__class="com.mxgraph.io.mxVsdxCodec"})(g.io||(g.io={}))})(f.mxgraph||(f.mxgraph={}))})(com||(com={}));
(function(f){(function(g){(function(g){var e=function(l){function c(b){var a=l.call(this)||this;a.RESPONSE_END="";a.RESPONSE_DIAGRAM_START="";a.RESPONSE_DIAGRAM_END="";a.RESPONSE_HEADER="";a.editorUi=b;return a}__extends(c,l);c.prototype.decodeVssx=function(b,a,d,k){var n=this,c="<mxlibrary>[";this.decodeVsdx(b,function(b){c=c.concat(b);var d=n.vsdxModel.getMasterShapes(),w=function(a){var b=0;return{next:function(){return b<a.length?a[b++]:null},hasNext:function(){return b<a.length}}}(function(a){var b=
[];null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)b.push(a.entries[d].value);return b}(n.vsdxModel.getPages())).next();if(null!=d){var e={str:"",toString:function(){return this.str}},g=0===b.length?"":",",y=function(a){return Object.keys(a).map(function(b){return a[b]})}(d);b=function(a){a=y[a];var b=q.createMxGraph(),k=1;if(null!=a.pageSheet){var n=k=1,c=a.pageSheet.DrawingScale;null!=c&&(k=parseFloat(c.getAttribute("V"))||1);c=a.pageSheet.PageScale;null!=c&&(n=parseFloat(c.getAttribute("V"))||
1);k=n/k}n=!1;for(c=0;null!=a.firstLevelShapes&&c<a.firstLevelShapes.length;c++){var A=a.firstLevelShapes[c].getShape(),z=new f.mxgraph.io.vsdx.VsdxShape(w,A,!w.isEdge(A),d,null,q.vsdxModel),A=null;if(z.isVertex()){q.edgeShapeMap.entries=[];q.parentsMap.entries=[];for(var A=q.addShape(b,z,b.getDefaultParent(),0,1169),z=function(a){null==a.entries&&(a.entries=[]);return a.entries}(q.edgeShapeMap),C=0;C<z.length;C++){var B=z[C],E=function(a,b){null==a.entries&&(a.entries=[]);for(var d=0;d<a.entries.length;d++)if(null!=
@@ -1415,18 +1415,18 @@ Math.min(100,Math.abs(a.x-b.x))*l[g+2]))/100);q.y=Math.floor(Math.round(100*(b.y
c));c=this.getEdgeMarker(!0);null!=c&&(function(a,b,c){void 0===c&&(c=0);return a.substr(c,b.length)===b}(c,b.ARROW_NO_FILL_MARKER)&&(c=c.substring(b.ARROW_NO_FILL_MARKER.length),this.styleMap[mxConstants.STYLE_STARTFILL]="0"),this.styleMap[mxConstants.STYLE_STARTARROW]=c);c=this.getEdgeMarker(!1);null!=c&&(function(a,b,c){void 0===c&&(c=0);return a.substr(c,b.length)===b}(c,b.ARROW_NO_FILL_MARKER)&&(c=c.substring(b.ARROW_NO_FILL_MARKER.length),this.styleMap[mxConstants.STYLE_ENDFILL]="0"),this.styleMap[mxConstants.STYLE_ENDARROW]=
c);c=Math.round(this.getStartArrowSize())|0;6!==c&&(this.styleMap[mxConstants.STYLE_STARTSIZE]=""+c);c=Math.round(this.getFinalArrowSize())|0;6!==c&&(this.styleMap[mxConstants.STYLE_ENDSIZE]=""+c);c=Math.round(this.getLineWidth())|0;1!==c&&(this.styleMap[mxConstants.STYLE_STROKEWIDTH]=""+c);c=this.getStrokeColor();(function(a,b){return a&&a.equals?a.equals(b):a===b})(c,"")||(this.styleMap[mxConstants.STYLE_STROKECOLOR]=c);this.isShadow()&&(this.styleMap[mxConstants.STYLE_SHADOW]=f.mxgraph.io.vsdx.mxVsdxConstants.TRUE);
this.isConnectorBigNameU(this.getNameU())&&(this.styleMap[mxConstants.STYLE_SHAPE]=mxConstants.SHAPE_ARROW,c=this.getFillColor(),function(a,b){return a&&a.equals?a.equals(b):a===b}(c,"")||(this.styleMap[mxConstants.STYLE_FILLCOLOR]=c));c=Math.round(this.getTopSpacing())|0;this.styleMap[mxConstants.STYLE_SPACING_TOP]=""+c;c=Math.round(this.getBottomSpacing())|0;this.styleMap[mxConstants.STYLE_SPACING_BOTTOM]=""+c;c=Math.round(this.getLeftSpacing())|0;this.styleMap[mxConstants.STYLE_SPACING_LEFT]=""+
-c;c=Math.round(this.getRightSpacing())|0;this.styleMap[mxConstants.STYLE_SPACING_RIGHT]=""+c;c=this.getAlignVertical();this.styleMap[mxConstants.STYLE_VERTICAL_ALIGN]=c;this.styleMap.html="1";this.resolveCommonStyles();return this.styleMap};b.prototype.resolveCommonStyles=function(){var a=this.getTextBkgndColor(this.getCellElement$java_lang_String(f.mxgraph.io.vsdx.mxVsdxConstants.TEXT_BKGND)),b;b=a&&a.equals?a.equals(""):""===a;b||(this.styleMap[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]=a);this.styleMap[mxConstants.STYLE_ROUNDED]=
-0<this.getRounding()?f.mxgraph.io.vsdx.mxVsdxConstants.TRUE:f.mxgraph.io.vsdx.mxVsdxConstants.FALSE;return this.styleMap};b.prototype.getEdgeMarker=function(a){var c=this.getValue(this.getCellElement$java_lang_String(a?f.mxgraph.io.vsdx.mxVsdxConstants.BEGIN_ARROW:f.mxgraph.io.vsdx.mxVsdxConstants.END_ARROW),"0"),e=0;try{if(function(a,b){return a&&a.equals?a.equals(b):a===b}(c,"Themed")){var g=this.getTheme();null!=g&&(e=this.isVertex()?g.getEdgeMarker(a,this.getQuickStyleVals()):g.getConnEdgeMarker(a,
-this.getQuickStyleVals()))}else e=parseInt(c)}catch(w){}a=function(a,b){null==a.entries&&(a.entries=[]);for(var c=0;c<a.entries.length;c++)if(null!=a.entries[c].key.equals&&a.entries[c].key.equals(b)||a.entries[c].key===b)return a.entries[c].value;return null}(b.arrowTypes_$LI$(),e);0<e&&null==a&&(a=function(a,b){null==a.entries&&(a.entries=[]);for(var c=0;c<a.entries.length;c++)if(null!=a.entries[c].key.equals&&a.entries[c].key.equals(b)||a.entries[c].key===b)return a.entries[c].value;return null}(b.arrowTypes_$LI$(),
-1));return a};b.prototype.getCellElement$java_lang_String=function(a){var b=c.prototype.getCellElement$java_lang_String.call(this,a);return null==b&&null!=this.masterShape?this.masterShape.getCellElement$java_lang_String(a):b};b.prototype.getCellElement$java_lang_String$java_lang_String$java_lang_String=function(a,b,e){var d=c.prototype.getCellElement$java_lang_String$java_lang_String$java_lang_String.call(this,a,b,e);return null==d&&null!=this.masterShape?this.masterShape.getCellElement$java_lang_String$java_lang_String$java_lang_String(a,
-b,e):d};b.prototype.getCellElement=function(a,b,c){if("string"!==typeof a&&null!==a||"string"!==typeof b&&null!==b||"string"!==typeof c&&null!==c){if("string"!==typeof a&&null!==a||void 0!==b||void 0!==c)throw Error("invalid overload");return this.getCellElement$java_lang_String(a)}return this.getCellElement$java_lang_String$java_lang_String$java_lang_String(a,b,c)};b.prototype.createLabelSubShape=function(a,b){var c=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_WIDTH),
-this.getWidth()),d=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_HEIGHT),this.getHeight()),e=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_LOC_PIN_X),c/2),g=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_LOC_PIN_Y),d/2),l=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_PIN_X),
-e),q=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_PIN_Y),g),B=this.getValueAsDouble(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_ANGLE),0),C=this.getTextLabel();if(null!=C&&0!==C.length){var E=mxUtils.clone(this.getStyleMap())||{};E[mxConstants.STYLE_FILLCOLOR]=mxConstants.NONE;E[mxConstants.STYLE_STROKECOLOR]=mxConstants.NONE;E[mxConstants.STYLE_GRADIENTCOLOR]=mxConstants.NONE;E.hasOwnProperty("align")||(E.align="center");
-E.hasOwnProperty("verticalAlign")||(E.verticalAlign="middle");E.hasOwnProperty("whiteSpace")||(E.whiteSpace="wrap");delete E.shape;delete E.image;this.isVerticalLabel()&&(B+=Math.PI+.01,E.horizontal="0");var D=this.getRotation();0!==B&&(B=360-180*B/Math.PI,B=Math.round((B+D)%360*100)/100,0!==B&&(E.rotation=""+B));E="text;"+f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(E,"=");g=b.getGeometry().height-(q+d-g);e=l-e;0<D&&(l=new mxGeometry(e,g,c,d),e=b.getGeometry(),f.mxgraph.online.Utils.rotatedGeometry(l,
-D,e.width/2,e.height/2),e=l.x,g=l.y);return a.insertVertex(b,null,C,Math.round(100*e)/100,Math.round(100*g)/100,Math.round(100*c)/100,Math.round(100*d)/100,E+";html=1;")}return null};b.prototype.getLblEdgeOffset=function(a,b){if(null!=b&&1<b.length){var c=new mxCellState;c.absolutePoints=b;a.updateEdgeBounds(c);var c=a.getPoint(c),d=b[0],e=b[b.length-1],g=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_WIDTH),this.getWidth()),l=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_HEIGHT),
-this.getHeight()),q=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_LOC_PIN_X),0),B=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_LOC_PIN_Y),0),C=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_PIN_X),0),E=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_PIN_Y),
-0),e=(this.getHeight()-(d.y-e.y))/2+d.y-c.y-(E-B+l/2),c=C-q+g/2+(d.x-c.x);return 1E11<Math.abs(c)?null:new mxPoint(Math.floor(Math.round(100*c)/100),Math.floor(Math.round(100*e)/100))}return null};b.prototype.getShapeIndex=function(){return this.shapeIndex};b.prototype.setShapeIndex=function(a){this.shapeIndex=a};return b}(f.mxgraph.io.vsdx.Shape);g.__static_initialized=!1;g.ARROW_NO_FILL_MARKER="0";g.maxDp=2;g.USE_SHAPE_MATCH=!1;g.stencilTemplate='<shape h="htemplate" w="wtemplate" aspect="variable" strokewidth="inherit"><connections></connections><background></background><foreground></foreground></shape>';
-e.VsdxShape=g;g.__class="com.mxgraph.io.vsdx.VsdxShape"})(g.vsdx||(g.vsdx={}))})(g.io||(g.io={}))})(f.mxgraph||(f.mxgraph={}))})(com||(com={}));
+c;c=Math.round(this.getRightSpacing())|0;this.styleMap[mxConstants.STYLE_SPACING_RIGHT]=""+c;c=this.getAlignVertical();this.styleMap[mxConstants.STYLE_VERTICAL_ALIGN]=c;this.styleMap.html="1";this.resolveCommonStyles();return this.styleMap};b.prototype.resolveCommonStyles=function(){var a=this.getTextBkgndColor(this.getCellElement$java_lang_String(f.mxgraph.io.vsdx.mxVsdxConstants.TEXT_BKGND)),b;b=a&&a.equals?a.equals(""):""===a;b||"1"!=this.getValue(this.getCellElement$java_lang_String("TextBkgndTrans"),
+"0")&&(this.styleMap[mxConstants.STYLE_LABEL_BACKGROUNDCOLOR]=a);this.styleMap[mxConstants.STYLE_ROUNDED]=0<this.getRounding()?f.mxgraph.io.vsdx.mxVsdxConstants.TRUE:f.mxgraph.io.vsdx.mxVsdxConstants.FALSE;return this.styleMap};b.prototype.getEdgeMarker=function(a){var c=this.getValue(this.getCellElement$java_lang_String(a?f.mxgraph.io.vsdx.mxVsdxConstants.BEGIN_ARROW:f.mxgraph.io.vsdx.mxVsdxConstants.END_ARROW),"0"),e=0;try{if(function(a,b){return a&&a.equals?a.equals(b):a===b}(c,"Themed")){var g=
+this.getTheme();null!=g&&(e=this.isVertex()?g.getEdgeMarker(a,this.getQuickStyleVals()):g.getConnEdgeMarker(a,this.getQuickStyleVals()))}else e=parseInt(c)}catch(w){}a=function(a,b){null==a.entries&&(a.entries=[]);for(var c=0;c<a.entries.length;c++)if(null!=a.entries[c].key.equals&&a.entries[c].key.equals(b)||a.entries[c].key===b)return a.entries[c].value;return null}(b.arrowTypes_$LI$(),e);0<e&&null==a&&(a=function(a,b){null==a.entries&&(a.entries=[]);for(var c=0;c<a.entries.length;c++)if(null!=
+a.entries[c].key.equals&&a.entries[c].key.equals(b)||a.entries[c].key===b)return a.entries[c].value;return null}(b.arrowTypes_$LI$(),1));return a};b.prototype.getCellElement$java_lang_String=function(a){var b=c.prototype.getCellElement$java_lang_String.call(this,a);return null==b&&null!=this.masterShape?this.masterShape.getCellElement$java_lang_String(a):b};b.prototype.getCellElement$java_lang_String$java_lang_String$java_lang_String=function(a,b,e){var d=c.prototype.getCellElement$java_lang_String$java_lang_String$java_lang_String.call(this,
+a,b,e);return null==d&&null!=this.masterShape?this.masterShape.getCellElement$java_lang_String$java_lang_String$java_lang_String(a,b,e):d};b.prototype.getCellElement=function(a,b,c){if("string"!==typeof a&&null!==a||"string"!==typeof b&&null!==b||"string"!==typeof c&&null!==c){if("string"!==typeof a&&null!==a||void 0!==b||void 0!==c)throw Error("invalid overload");return this.getCellElement$java_lang_String(a)}return this.getCellElement$java_lang_String$java_lang_String$java_lang_String(a,b,c)};b.prototype.createLabelSubShape=
+function(a,b){var c=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_WIDTH),this.getWidth()),d=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_HEIGHT),this.getHeight()),e=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_LOC_PIN_X),c/2),g=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_LOC_PIN_Y),
+d/2),l=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_PIN_X),e),q=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_PIN_Y),g),B=this.getValueAsDouble(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_ANGLE),0),C=this.getTextLabel();if(null!=C&&0!==C.length){var E=mxUtils.clone(this.getStyleMap())||{};E[mxConstants.STYLE_FILLCOLOR]=mxConstants.NONE;E[mxConstants.STYLE_STROKECOLOR]=
+mxConstants.NONE;E[mxConstants.STYLE_GRADIENTCOLOR]=mxConstants.NONE;E.hasOwnProperty("align")||(E.align="center");E.hasOwnProperty("verticalAlign")||(E.verticalAlign="middle");E.hasOwnProperty("whiteSpace")||(E.whiteSpace="wrap");delete E.shape;delete E.image;this.isVerticalLabel()&&(B+=Math.PI+.01,E.horizontal="0");var D=this.getRotation();0!==B&&(B=360-180*B/Math.PI,B=Math.round((B+D)%360*100)/100,0!==B&&(E.rotation=""+B));E="text;"+f.mxgraph.io.vsdx.mxVsdxUtils.getStyleString(E,"=");g=b.getGeometry().height-
+(q+d-g);e=l-e;0<D&&(l=new mxGeometry(e,g,c,d),e=b.getGeometry(),f.mxgraph.online.Utils.rotatedGeometry(l,D,e.width/2,e.height/2),e=l.x,g=l.y);return a.insertVertex(b,null,C,Math.round(100*e)/100,Math.round(100*g)/100,Math.round(100*c)/100,Math.round(100*d)/100,E+";html=1;")}return null};b.prototype.getLblEdgeOffset=function(a,b){if(null!=b&&1<b.length){var c=new mxCellState;c.absolutePoints=b;a.updateEdgeBounds(c);var c=a.getPoint(c),d=b[0],e=b[b.length-1],g=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_WIDTH),
+this.getWidth()),l=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_HEIGHT),this.getHeight()),q=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_LOC_PIN_X),0),B=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_LOC_PIN_Y),0),C=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_PIN_X),
+0),E=this.getScreenNumericalValue$org_w3c_dom_Element$double(this.getShapeNode(f.mxgraph.io.vsdx.mxVsdxConstants.TXT_PIN_Y),0),e=(this.getHeight()-(d.y-e.y))/2+d.y-c.y-(E-B+l/2),c=C-q+g/2+(d.x-c.x);return 1E11<Math.abs(c)?null:new mxPoint(Math.floor(Math.round(100*c)/100),Math.floor(Math.round(100*e)/100))}return null};b.prototype.getShapeIndex=function(){return this.shapeIndex};b.prototype.setShapeIndex=function(a){this.shapeIndex=a};return b}(f.mxgraph.io.vsdx.Shape);g.__static_initialized=!1;g.ARROW_NO_FILL_MARKER=
+"0";g.maxDp=2;g.USE_SHAPE_MATCH=!1;g.stencilTemplate='<shape h="htemplate" w="wtemplate" aspect="variable" strokewidth="inherit"><connections></connections><background></background><foreground></foreground></shape>';e.VsdxShape=g;g.__class="com.mxgraph.io.vsdx.VsdxShape"})(g.vsdx||(g.vsdx={}))})(g.io||(g.io={}))})(f.mxgraph||(f.mxgraph={}))})(com||(com={}));
(function(f){(function(g){(function(g){var e=function(){function e(){}e.__static_initialize=function(){e.__static_initialized||(e.__static_initialized=!0,e.__static_initializer_0())};e.CA_$LI$=function(){e.__static_initialize();null==e.CA&&(e.CA="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""));return e.CA};e.IA_$LI$=function(){e.__static_initialize();if(null==e.IA){for(var c=256,b=[];0<c--;)b.push(0);e.IA=b}return e.IA};e.__static_initializer_0=function(){for(var c=e.IA_$LI$(),
b=0;b<c.length;b++)c[b]=-1;c=0;for(b=e.CA_$LI$().length;c<b;c++)e.IA_$LI$()[e.CA_$LI$()[c].charCodeAt(0)]=c;e.IA_$LI$()[61]=0};e.encodeToChar=function(c,b,a){var d=null!=c?c.length-b:0;if(0===d)return[];for(var f=3*(d/3|0),g=((d-1)/3|0)+1<<2,g=g+(a?((g-1)/76|0)<<1:0),l=Array(g),q=b,A=0,z=0;q<f+b;){var B=(c[q++]&255)<<16|(c[q++]&255)<<8|c[q++]&255;l[A++]=e.CA_$LI$()[B>>>18&63];l[A++]=e.CA_$LI$()[B>>>12&63];l[A++]=e.CA_$LI$()[B>>>6&63];l[A++]=e.CA_$LI$()[B&63];a&&19===++z&&A<g-2&&(l[A++]="\r",l[A++]=
"\n",z=0)}a=d-f;0<a&&(B=(c[f+b]&255)<<10|(2===a?(c[d+b-1]&255)<<2:0),l[g-4]=e.CA_$LI$()[B>>12],l[g-3]=e.CA_$LI$()[B>>>6&63],l[g-2]=2===a?e.CA_$LI$()[B&63]:"=",l[g-1]="=");return l};e.decode$char_A=function(c){var b=null!=c?c.length:0;if(0===b)return[];for(var a=0,d=0;d<b;d++)0>e.IA_$LI$()[c[d].charCodeAt(0)]&&a++;if(0!==(b-a)%4)return null;for(var f=0,d=b;1<d&&0>=e.IA_$LI$()[c[--d].charCodeAt(0)];)61==function(a){return null==a.charCodeAt?a:a.charCodeAt(0)}(c[d])&&f++;for(var b=(6*(b-a)>>3)-f,a=function(a){for(var b=
diff --git a/src/main/webapp/js/viewer.min.js b/src/main/webapp/js/viewer.min.js
index 95762869..e17d6abf 100644
--- a/src/main/webapp/js/viewer.min.js
+++ b/src/main/webapp/js/viewer.min.js
@@ -2135,7 +2135,7 @@ a.clone();f.style="";var b=d.getCellStyle(f);a=[];var f=[],g;for(g in c.style)b[
this.clearDefaultStyle=function(){d.currentEdgeStyle=mxUtils.clone(d.defaultEdgeStyle);d.currentVertexStyle=mxUtils.clone(d.defaultVertexStyle);this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]))};var E=["fontFamily","fontSize","fontColor"],G="edgeStyle startArrow startFill startSize endArrow endFill endSize".split(" "),D=["startArrow startFill startSize sourcePerimeterSpacing endArrow endFill endSize targetPerimeterSpacing".split(" "),["strokeColor","strokeWidth"],
["fillColor","gradientColor"],E,["opacity"],["align"],["html"]];for(a=0;a<D.length;a++)for(b=0;b<D[a].length;b++)A.push(D[a][b]);for(a=0;a<x.length;a++)0>mxUtils.indexOf(A,x[a])&&A.push(x[a]);var J=function(a,c){var f=d.getModel();f.beginUpdate();try{for(var b=0;b<a.length;b++){var g=a[b],e;if(c)e=["fontSize","fontFamily","fontColor"];else{var m=f.getStyle(g),p=null!=m?m.split(";"):[];e=A.slice();for(var n=0;n<p.length;n++){var u=p[n],t=u.indexOf("=");if(0<=t){var y=u.substring(0,t),v=mxUtils.indexOf(e,
y);0<=v&&e.splice(v,1);for(var l=0;l<D.length;l++){var k=D[l];if(0<=mxUtils.indexOf(k,y))for(var B=0;B<k.length;B++){var q=mxUtils.indexOf(e,k[B]);0<=q&&e.splice(q,1)}}}}}for(var F=f.isEdge(g),C=F?d.currentEdgeStyle:d.currentVertexStyle,E=f.getStyle(g),n=0;n<e.length;n++){var y=e[n],G=C[y];null==G||"shape"==y&&!F||F&&!(0>mxUtils.indexOf(x,y))||(E=mxUtils.setStyle(E,y,G))}f.setStyle(g,E)}}finally{f.endUpdate()}};d.addListener("cellsInserted",function(a,c){J(c.getProperty("cells"))});d.addListener("textInserted",
-function(a,c){J(c.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(a,c){var f=[c.getProperty("cell")];c.getProperty("terminalInserted")&&f.push(c.getProperty("terminal"));J(f)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var f=c.getProperty("cells"),b=!1,g=!1;if(0<f.length)for(var e=0;e<f.length&&(b=d.getModel().isVertex(f[e])||b,!(g=d.getModel().isEdge(f[e])||g)||!b);e++);else g=b=!0;for(var f=c.getProperty("keys"),m=c.getProperty("values"),
+function(a,c){J(c.getProperty("cells"),!0)});d.connectionHandler.addListener(mxEvent.CONNECT,function(a,c){var d=[c.getProperty("cell")];c.getProperty("terminalInserted")&&d.push(c.getProperty("terminal"));J(d)});this.addListener("styleChanged",mxUtils.bind(this,function(a,c){var f=c.getProperty("cells"),b=!1,g=!1;if(0<f.length)for(var e=0;e<f.length&&(b=d.getModel().isVertex(f[e])||b,!(g=d.getModel().isEdge(f[e])||g)||!b);e++);else g=b=!0;for(var f=c.getProperty("keys"),m=c.getProperty("values"),
e=0;e<f.length;e++){var p=0<=mxUtils.indexOf(E,f[e]);if("strokeColor"!=f[e]||null!=m[e]&&"none"!=m[e])if(0<=mxUtils.indexOf(x,f[e]))g||0<=mxUtils.indexOf(G,f[e])?null==m[e]?delete d.currentEdgeStyle[f[e]]:d.currentEdgeStyle[f[e]]=m[e]:b&&0<=mxUtils.indexOf(A,f[e])&&(null==m[e]?delete d.currentVertexStyle[f[e]]:d.currentVertexStyle[f[e]]=m[e]);else if(0<=mxUtils.indexOf(A,f[e])){if(b||p)null==m[e]?delete d.currentVertexStyle[f[e]]:d.currentVertexStyle[f[e]]=m[e];if(g||p||0<=mxUtils.indexOf(G,f[e]))null==
m[e]?delete d.currentEdgeStyle[f[e]]:d.currentEdgeStyle[f[e]]=m[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"),
@@ -2406,8 +2406,8 @@ this.graph.getCellGeometry(n[k]),F=g.width-p.x-p.width,u=u.clone();u.width=u.wid
(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){c=null!=c?c:!0;var f=this.getState(a);null!=f&&c&&this.graph.model.isEdge(f.cell)&&null!=f.style&&1!=f.style[mxConstants.STYLE_CURVED]&&!f.invalid&&this.updateLineJumps(f)&&this.graph.cellRenderer.redraw(f,!1,this.isRendering());f=b.apply(this,
arguments);null!=f&&c&&this.graph.model.isEdge(f.cell)&&null!=f.style&&1!=f.style[mxConstants.STYLE_CURVED]&&this.validEdges.push(f);return f};var e=mxCellRenderer.prototype.isShapeInvalid;mxCellRenderer.prototype.isShapeInvalid=function(a,c){return e.apply(this,arguments)||null!=a.routedPoints&&null!=c.routedPoints&&!mxUtils.equalPoints(c.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 c=a.absolutePoints;if(Graph.lineJumpsEnabled){var f=null!=a.routedPoints,d=null;if(null!=c&&null!=this.validEdges&&"none"!==mxUtils.getValue(a.style,"jumpStyle","none")){for(var b=function(c,f,b){var e=new mxPoint(f,b);e.type=c;d.push(e);e=null!=a.routedPoints?a.routedPoints[d.length-1]:null;return null==e||e.type!=c||e.x!=f||e.y!=b},e=.5*this.scale,f=!1,d=[],t=0;t<c.length-1;t++){for(var u=
-c[t+1],k=c[t],l=[],q=c[t+2];t<c.length-2&&mxUtils.ptSegDistSq(k.x,k.y,q.x,q.y,u.x,u.y)<1*this.scale*this.scale;)u=q,t++,q=c[t+2];for(var f=b(0,k.x,k.y)||f,A=0;A<this.validEdges.length;A++){var x=this.validEdges[A],E=x.absolutePoints;if(null!=E&&mxUtils.intersects(a,x)&&"1"!=x.style.noJump)for(x=0;x<E.length-1;x++){for(var G=E[x+1],D=E[x],q=E[x+2];x<E.length-2&&mxUtils.ptSegDistSq(D.x,D.y,q.x,q.y,G.x,G.y)<1*this.scale*this.scale;)G=q,x++,q=E[x+2];q=mxUtils.intersection(k.x,k.y,u.x,u.y,D.x,D.y,G.x,
-G.y);if(null!=q&&(Math.abs(q.x-k.x)>e||Math.abs(q.y-k.y)>e)&&(Math.abs(q.x-u.x)>e||Math.abs(q.y-u.y)>e)&&(Math.abs(q.x-D.x)>e||Math.abs(q.y-D.y)>e)&&(Math.abs(q.x-G.x)>e||Math.abs(q.y-G.y)>e)){G=q.x-k.x;D=q.y-k.y;q={distSq:G*G+D*D,x:q.x,y:q.y};for(G=0;G<l.length;G++)if(l[G].distSq>q.distSq){l.splice(G,0,q);q=null;break}null==q||0!=l.length&&l[l.length-1].x===q.x&&l[l.length-1].y===q.y||l.push(q)}}}for(x=0;x<l.length;x++)f=b(1,l[x].x,l[x].y)||f}q=c[c.length-1];f=b(0,q.x,q.y)||f}a.routedPoints=d;return f}return!1};
+c[t+1],l=c[t],k=[],q=c[t+2];t<c.length-2&&mxUtils.ptSegDistSq(l.x,l.y,q.x,q.y,u.x,u.y)<1*this.scale*this.scale;)u=q,t++,q=c[t+2];for(var f=b(0,l.x,l.y)||f,A=0;A<this.validEdges.length;A++){var x=this.validEdges[A],E=x.absolutePoints;if(null!=E&&mxUtils.intersects(a,x)&&"1"!=x.style.noJump)for(x=0;x<E.length-1;x++){for(var G=E[x+1],D=E[x],q=E[x+2];x<E.length-2&&mxUtils.ptSegDistSq(D.x,D.y,q.x,q.y,G.x,G.y)<1*this.scale*this.scale;)G=q,x++,q=E[x+2];q=mxUtils.intersection(l.x,l.y,u.x,u.y,D.x,D.y,G.x,
+G.y);if(null!=q&&(Math.abs(q.x-l.x)>e||Math.abs(q.y-l.y)>e)&&(Math.abs(q.x-u.x)>e||Math.abs(q.y-u.y)>e)&&(Math.abs(q.x-D.x)>e||Math.abs(q.y-D.y)>e)&&(Math.abs(q.x-G.x)>e||Math.abs(q.y-G.y)>e)){G=q.x-l.x;D=q.y-l.y;q={distSq:G*G+D*D,x:q.x,y:q.y};for(G=0;G<k.length;G++)if(k[G].distSq>q.distSq){k.splice(G,0,q);q=null;break}null==q||0!=k.length&&k[k.length-1].x===q.x&&k[k.length-1].y===q.y||k.push(q)}}}for(x=0;x<k.length;x++)f=b(1,k[x].x,k[x].y)||f}q=c[c.length-1];f=b(0,q.x,q.y)||f}a.routedPoints=d;return f}return!1};
var k=mxConnector.prototype.paintLine;mxConnector.prototype.paintLine=function(a,c,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,b=(parseInt(mxUtils.getValue(this.style,"jumpSize",Graph.defaultJumpSize))-2)/2+this.strokewidth,e=mxUtils.getValue(this.style,
"jumpStyle","none"),g=!0,p=null,l=null,q=[],C=null;a.begin();for(var A=0;A<this.state.routedPoints.length;A++){var x=this.state.routedPoints[A],E=new mxPoint(x.x/this.scale,x.y/this.scale);0==A?E=c[0]:A==this.state.routedPoints.length-1&&(E=c[c.length-1]);var G=!1;if(null!=p&&1==x.type){var D=this.state.routedPoints[A+1],x=D.x/this.scale-E.x,D=D.y/this.scale-E.y,x=x*x+D*D;null==C&&(C=new mxPoint(E.x-p.x,E.y-p.y),l=Math.sqrt(C.x*C.x+C.y*C.y),0<l?(C.x=C.x*b/l,C.y=C.y*b/l):C=null);x>b*b&&0<l&&(x=p.x-
E.x,D=p.y-E.y,x=x*x+D*D,x>b*b&&(G=new mxPoint(E.x-C.x,E.y-C.y),x=new mxPoint(E.x+C.x,E.y+C.y),q.push(G),this.addPoints(a,q,d,f,!1,null,g),q=0>Math.round(C.x)||0==Math.round(C.x)&&0>=Math.round(C.y)?1:-1,g=!1,"sharp"==e?(a.lineTo(G.x-C.y*q,G.y+C.x*q),a.lineTo(x.x-C.y*q,x.y+C.x*q),a.lineTo(x.x,x.y)):"arc"==e?(q*=1.3,a.curveTo(G.x-C.y*q,G.y+C.x*q,x.x-C.y*q,x.y+C.x*q,x.x,x.y)):(a.moveTo(x.x,x.y),g=!0),q=[x],G=!0))}else C=null;G||(q.push(E),p=E)}this.addPoints(a,q,d,f,!1,null,g);a.stroke()}};var l=mxGraphView.prototype.updateFloatingTerminalPoint;
@@ -2472,8 +2472,8 @@ c.x-f.x:c.y-f.y});g=this.view.translate;m=this.view.scale;d=d/m-(a?g.x:g.y);b=b/
function(a){return mxClient.IS_MAC&&mxEvent.isMetaDown(a)||mxEvent.isControlDown(a)};Graph.prototype.createSvgImageExport=function(){var a=new mxImageExport;a.getLinkForCellState=mxUtils.bind(this,function(a,c){return this.getLinkForCell(a.cell)});return a};Graph.prototype.getSvg=function(a,c,f,b,d,e,g,m,p,n){var u=this.useCssTransforms;u&&(this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange());try{c=null!=c?c:1;f=null!=f?f:0;d=null!=d?d:!0;e=null!=e?e:!0;g=null!=g?g:!0;var y=e||b?
this.getGraphBounds():this.getBoundingBox(this.getSelectionCells());if(null==y)throw Error(mxResources.get("drawingEmpty"));var t=this.view.scale,z=mxUtils.createXmlDocument(),l=null!=z.createElementNS?z.createElementNS(mxConstants.NS_SVG,"svg"):z.createElement("svg");null!=a&&(null!=l.style?l.style.backgroundColor=a:l.setAttribute("style","background-color:"+a));null==z.createElementNS?(l.setAttribute("xmlns",mxConstants.NS_SVG),l.setAttribute("xmlns:xlink",mxConstants.NS_XLINK)):l.setAttributeNS("http://www.w3.org/2000/xmlns/",
"xmlns:xlink",mxConstants.NS_XLINK);a=c/t;var v=Math.max(1,Math.ceil(y.width*a)+2*f)+(n?5:0),k=Math.max(1,Math.ceil(y.height*a)+2*f)+(n?5:0);l.setAttribute("version","1.1");l.setAttribute("width",v+"px");l.setAttribute("height",k+"px");l.setAttribute("viewBox",(d?"-0.5 -0.5":"0 0")+" "+v+" "+k);z.appendChild(l);var K=null!=z.createElementNS?z.createElementNS(mxConstants.NS_SVG,"g"):z.createElement("g");l.appendChild(K);var L=this.createSvgCanvas(K);L.foOffset=d?-.5:0;L.textOffset=d?-.5:0;L.imageOffset=
-d?-.5:0;L.translate(Math.floor((f/c-y.x)/t),Math.floor((f/c-y.y)/t));var q=document.createElement("div"),x=L.getAlternateText;L.getAlternateText=function(a,c,f,b,d,e,g,m,p,n,u,y,ia){if(null!=e&&0<this.state.fontSize)try{mxUtils.isNode(e)?e=e.innerText:(q.innerHTML=e,e=mxUtils.extractTextWithWhitespace(q.childNodes));for(var Na=Math.ceil(2*b/this.state.fontSize),t=[],La=0,z=0;(0==Na||La<Na)&&z<e.length;){var l=e.charCodeAt(z);if(10==l||13==l){if(0<La)break}else t.push(e.charAt(z)),255>l&&La++;z++}t.length<
-e.length&&1<e.length-t.length&&(e=mxUtils.trim(t.join(""))+"...");return e}catch(Ua){return x.apply(this,arguments)}else return x.apply(this,arguments)};var P=this.backgroundImage;if(null!=P){c=t/c;var H=this.view.translate,B=new mxRectangle(H.x*c,H.y*c,P.width*c,P.height*c);mxUtils.intersects(y,B)&&L.image(H.x,H.y,P.width,P.height,P.src,!0)}L.scale(a);L.textEnabled=g;m=null!=m?m:this.createSvgImageExport();var M=m.drawCellState,F=m.getLinkForCellState;m.getLinkForCellState=function(a,c){var f=F.apply(this,
+d?-.5:0;L.translate(Math.floor((f/c-y.x)/t),Math.floor((f/c-y.y)/t));var x=document.createElement("div"),q=L.getAlternateText;L.getAlternateText=function(a,c,f,b,d,e,g,m,p,n,u,y,ia){if(null!=e&&0<this.state.fontSize)try{mxUtils.isNode(e)?e=e.innerText:(x.innerHTML=e,e=mxUtils.extractTextWithWhitespace(x.childNodes));for(var Na=Math.ceil(2*b/this.state.fontSize),t=[],La=0,z=0;(0==Na||La<Na)&&z<e.length;){var l=e.charCodeAt(z);if(10==l||13==l){if(0<La)break}else t.push(e.charAt(z)),255>l&&La++;z++}t.length<
+e.length&&1<e.length-t.length&&(e=mxUtils.trim(t.join(""))+"...");return e}catch(Ua){return q.apply(this,arguments)}else return q.apply(this,arguments)};var P=this.backgroundImage;if(null!=P){c=t/c;var H=this.view.translate,B=new mxRectangle(H.x*c,H.y*c,P.width*c,P.height*c);mxUtils.intersects(y,B)&&L.image(H.x,H.y,P.width,P.height,P.src,!0)}L.scale(a);L.textEnabled=g;m=null!=m?m:this.createSvgImageExport();var M=m.drawCellState,F=m.getLinkForCellState;m.getLinkForCellState=function(a,c){var f=F.apply(this,
arguments);return null==f||a.view.graph.isCustomLink(f)?null:f};m.drawCellState=function(a,c){for(var f=a.view.graph,b=f.isCellSelected(a.cell),d=f.model.getParent(a.cell);!e&&!b&&null!=d;)b=f.isCellSelected(d),d=f.model.getParent(d);(e||b)&&M.apply(this,arguments)};m.drawState(this.getView().getState(this.model.root),L);this.updateSvgLinks(l,p,!0);this.addForeignObjectWarning(L,l);return l}finally{u&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=
function(a,c){if(0<c.getElementsByTagName("foreignObject").length){var f=a.createElement("switch"),b=a.createElement("g");b.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var d=a.createElement("a");d.setAttribute("transform","translate(0,-5)");null==d.setAttributeNS||c.ownerDocument!=document&&null==document.documentMode?(d.setAttribute("xlink:href",Graph.foreignObjectWarningLink),d.setAttribute("target","_blank")):(d.setAttributeNS(mxConstants.NS_XLINK,"xlink:href",
Graph.foreignObjectWarningLink),d.setAttributeNS(mxConstants.NS_XLINK,"target","_blank"));var e=a.createElement("text");e.setAttribute("text-anchor","middle");e.setAttribute("font-size","10px");e.setAttribute("x","50%");e.setAttribute("y","100%");mxUtils.write(e,Graph.foreignObjectWarningText);f.appendChild(b);d.appendChild(e);f.appendChild(d);c.appendChild(f)}};Graph.prototype.updateSvgLinks=function(a,c,f){a=a.getElementsByTagName("a");for(var b=0;b<a.length;b++){var d=a[b].getAttribute("href");
@@ -2793,10 +2793,10 @@ b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_DASHED,mx
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(),f=d.getCurrentCellStyle(a[0]),e="1"==mxUtils.getValue(f,mxConstants.STYLE_ROUNDED,"0")?"0":"1";d.setCellStyles(mxConstants.STYLE_ROUNDED,
e);d.setCellStyles(mxConstants.STYLE_CURVED,null);b.fireEvent(new mxEventObject("styleChanged","keys",[mxConstants.STYLE_ROUNDED,mxConstants.STYLE_CURVED],"values",[e,"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()),f="1";null!=a&&null!=d.getFoldingImage(a)&&(f="0");d.setCellStyles("collapsible",f);b.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[f],"cells",d.getSelectionCells()))});this.addAction("editStyle...",mxUtils.bind(this,function(){var a=d.getSelectionCells();if(null!=a&&0<a.length){var f=d.getModel(),f=
-new TextareaDialog(this.editorUi,mxResources.get("editStyle")+":",f.getStyle(a[0])||"",function(c){null!=c&&d.setCellStyle(mxUtils.trim(c),a)},null,null,400,220);this.editorUi.showDialog(f.container,420,300,!0,!0);f.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 f=e.graph.selectionCellsHandler.getHandler(a);if(f instanceof mxEdgeHandler){for(var b=d.view.translate,p=d.view.scale,m=b.x,b=b.y,a=d.getModel().getParent(a),n=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=n;)m+=n.x,b+=n.y,a=d.getModel().getParent(a),n=d.getCellGeometry(a);m=Math.round(d.snap(d.popupMenuHandler.triggerX/p-m));p=Math.round(d.snap(d.popupMenuHandler.triggerY/
-p-b));f.addPointAt(f.state,m,p)}}});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 p=d.getCellGeometry(e);null!=p&&(p=p.clone(),p.points=null,d.getModel().setGeometry(e,p))}}}finally{d.getModel().endUpdate()}}},
+"values",["0","1"],"cells",d.getSelectionCells()))}finally{d.getModel().endUpdate()}});this.addAction("collapsible",function(){var a=d.view.getState(d.getSelectionCell()),f="1";null!=a&&null!=d.getFoldingImage(a)&&(f="0");d.setCellStyles("collapsible",f);b.fireEvent(new mxEventObject("styleChanged","keys",["collapsible"],"values",[f],"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(c){null!=c&&d.setCellStyle(mxUtils.trim(c),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 g=d.view.translate,p=d.view.scale,m=g.x,g=g.y,a=d.getModel().getParent(a),n=d.getCellGeometry(a);d.getModel().isVertex(a)&&null!=n;)m+=n.x,g+=n.y,a=d.getModel().getParent(a),n=d.getCellGeometry(a);m=Math.round(d.snap(d.popupMenuHandler.triggerX/p-m));p=Math.round(d.snap(d.popupMenuHandler.triggerY/
+p-g));b.addPointAt(b.state,m,p)}}});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 p=d.getCellGeometry(e);null!=p&&(p=p.clone(),p.points=null,d.getModel().setGeometry(e,p))}}}finally{d.getModel().endUpdate()}}},
null,null,"Alt+Shift+C");l=this.addAction("subscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("subscript",!1,null)}),null,null,Editor.ctrlKey+"+,");l=this.addAction("superscript",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("superscript",!1,null)}),null,null,Editor.ctrlKey+"+.");l=this.addAction("indent",mxUtils.bind(this,function(){d.cellEditor.isContentEditing()&&document.execCommand("indent",!1,null)}),null,null,"Shift+Tab");
this.addAction("image...",function(){if(d.isEnabled()&&!d.isCellLocked(d.getDefaultParent())){var a=mxResources.get("image")+" ("+mxResources.get("url")+"):",f=d.getView().getState(d.getSelectionCell()),e="";null!=f&&(e=f.style[mxConstants.STYLE_IMAGE]||e);var p=d.cellEditor.saveSelection();b.showImageDialog(a,e,function(a,c,b){if(d.cellEditor.isContentEditing())d.cellEditor.restoreSelection(p),d.insertImage(a,c,b);else{var f=d.getSelectionCells();if(null!=a&&(0<a.length||0<f.length)){var e=null;
d.getModel().beginUpdate();try{if(0==f.length){var g=d.getFreeInsertPoint(),e=f=[d.insertVertex(d.getDefaultParent(),null,"",g.x,g.y,c,b,"shape=image;imageAspect=0;aspect=fixed;verticalLabelPosition=bottom;verticalAlign=top;")];d.fireEvent(new mxEventObject("cellsInserted","cells",e))}d.setCellStyles(mxConstants.STYLE_IMAGE,0<a.length?a:null,f);var m=d.getCurrentCellStyle(f[0]);"image"!=m[mxConstants.STYLE_SHAPE]&&"label"!=m[mxConstants.STYLE_SHAPE]?d.setCellStyles(mxConstants.STYLE_SHAPE,"image",
@@ -2863,9 +2863,9 @@ DrawioFile.prototype.handleConflictError=function(a,b){var e=mxUtils.bind(this,f
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&&this.constructor!=GitLabFile||null==a?null:a.commitMessage)}),d)});"none"==DrawioFile.SYNC?this.showCopyDialog(e,d,k):this.invalidChecksum?this.showRefreshDialog(e,d,this.getErrorMessage(a)):b?this.showConflictDialog(k,l):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.isOverdue=function(){return null!=this.ageStart&&Date.now()-this.ageStart.getTime()>=this.ui.warnInterval};
DrawioFile.prototype.fileChanged=function(){this.lastChanged=new Date;this.setModified(!0);this.isAutosave()?(this.addAllSavedStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.ui.scheduleSanityCheck(),null==this.ageStart&&(this.ageStart=new Date),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){this.ui.stopSanityCheck();null==this.autosaveThread?(this.handleFileSuccess(!0),this.ageStart=null):this.isModified()&&(this.ui.scheduleSanityCheck(),this.ageStart=
-this.lastChanged)}),mxUtils.bind(this,function(a){this.handleFileError(a)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus())};
-DrawioFile.prototype.fileSaved=function(a,b,e,d){this.lastSaved=new Date;this.ageStart=null;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(),l=null!=k?k.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),l,q)}}catch(c){}}};
+this.lastChanged)}),mxUtils.bind(this,function(a){this.handleFileError(a)}))):(this.ageStart=null,this.isAutosaveOptional()&&this.ui.editor.autosave||this.inConflictState||this.addUnsavedStatus())};DrawioFile.prototype.createSecret=function(a,b){var e=Editor.guid(32);null!=this.sync?this.sync.createToken(e,mxUtils.bind(this,function(b){a(e,b)}),b):a(e)};
+DrawioFile.prototype.fileSaved=function(a,b,e,d,k){this.lastSaved=new Date;this.ageStart=null;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,k)}catch(c){this.invalidChecksum=this.inConflictState=!0;this.descriptorChanged();null!=d&&d(c);try{if(this.errorReportsEnabled)this.sendErrorReport("Error in fileSaved",null,c);else{var l=
+this.getCurrentUser(),q=null!=l?l.id:"unknown";EditorUi.logError("Error in fileSaved",null,this.getMode()+"."+this.getId(),q,c)}}catch(f){}}};
DrawioFile.prototype.autosave=function(a,b,e,d){null==this.lastAutosave&&(this.lastAutosave=Date.now());a=Date.now()-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.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"))};
diff --git a/src/main/webapp/service-worker.js b/src/main/webapp/service-worker.js
index 9f1a0a3e..0c1e9dec 100644
--- a/src/main/webapp/service-worker.js
+++ b/src/main/webapp/service-worker.js
@@ -6,11 +6,11 @@ if (workbox)
workbox.precaching.precacheAndRoute([
{
"url": "js/app.min.js",
- "revision": "1c47a0b7a4f9754e6cbc99c43bee74ce"
+ "revision": "893a2614b11aec42f563c307818eac5c"
},
{
"url": "js/extensions.min.js",
- "revision": "bb9d0447bf1eaeac1791a8ac4097e3ca"
+ "revision": "befa93c9f4f16312a26fb8d5450061cd"
},
{
"url": "js/stencils.min.js",