9.4.1 release

This commit is contained in:
Gaudenz Alder 2018-11-09 13:05:55 +01:00
parent 6fbf5bc048
commit ae98ad5856
19 changed files with 2053 additions and 2026 deletions

View file

@ -1,3 +1,13 @@
09-NOV-2018: 9.4.1
- Fixes links to revision history from status
- Hides static page text in embed mode
- Enables import from device on iOS
08-NOV-2018: 9.4.0
- Disables Google realtime on 11/12/2018 at 9:00am (UTC)
06-NOV-2018: 9.3.4
- Improves sanity check for Google Drive files

View file

@ -1 +1 @@
9.3.4
9.4.1

View file

@ -1,7 +1,7 @@
CACHE MANIFEST
# THIS FILE WAS GENERATED. DO NOT MODIFY!
# 11/06/2018 04:33 PM
# 11/09/2018 01:00 PM
app.html
index.html?offline=1

View file

@ -410,119 +410,7 @@
/**
* Main
*/
App.main(function (ui)
{
// **************************************************
// TESTING JSON TO XML CONVERTER FOR EOL OF GOOGLE RT
// **************************************************
// ui.JSON_CHECK = 'JSON-CHECK7';
// DriveFile.prototype.runCheck = function(json, fileNode, fileData)
// {
// try
// {
// this.debug('JSON Check', this.desc, json);
// if (this.ui.getCurrentFile() == this && !this.isModified())
// {
// // Gets comparable XML structures
// var convert = (json != null) ? this.getComparableFile(this.ui.drive.convertJsonToXml(json, true)) : null;
// var remote = (fileNode != null) ? this.getComparableFile(fileNode) : null;
// var local = this.getComparableFile(this.ui.getXmlFileData());
// // Uses the newer of the two
// var age = this.ui.drive.getRealtimeAge(this.desc, json);
// var relevant = (age < 0 && convert != null) ? convert : remote;
// if (local == null || relevant == null || !local.isEqualNode(relevant))
// {
// this.log('FAIL-REPORT');
// var summary = ((relevant == convert) ? 'Source: Convert' : 'Source: Remote') +
// '\nFile modified: ' + new Date(this.desc.modifiedDate).toUTCString();
// if (json != null)
// {
// var mod = (json.value != null && json.value.modifiedDate != null) ? json.value.modifiedDate.json : null;
// if (mod != null)
// {
// summary += '\nJson modified: ' + new Date(mod).toUTCString();
// }
// var bak = (json.value != null && json.value.backupDate != null) ? json.value.backupDate.json : null;
// if (bak != null)
// {
// summary += '\nJson backedup: ' + new Date(bak).toUTCString();
// }
// }
// if (local != null)
// {
// if (convert != null)
// {
// summary += '\nConvert-Equals-Local: ' + convert.isEqualNode(local);
// }
// if (remote != null)
// {
// summary += '\nRemote-Equals-Local: ' + remote.isEqualNode(local);
// }
// }
// this.report('Realtime Error Report ' + new Date() +
// '\n\nDescription: ' + JSON.stringify({version: this.ui.JSON_CHECK,
// realtimeAge: age, title: this.desc.title, editable: this.desc.editable,
// copyable: this.desc.copyable, labels: this.desc.labels, id: this.desc.id,
// userPermission: this.desc.userPermission, fileSize: this.desc.fileSize,
// fileExtension: this.desc.fileExtension, modifiedDate: this.desc.modifiedDate,
// mimeType: this.desc.mimeType}) +
// '\n\nSummary:\n' + summary +
// '\n\nLocal:\n' + this.getAnonymizedXml(local) +
// '\n\nRemote:\n' + this.getAnonymizedXml(remote) +
// ((remote == null) ? ('\n\nData:\n' + fileData) : '') +
// '\n\nConvert:\n' + this.getAnonymizedXml(convert) +
// '\n\nJSON:\n' + this.getAnonymizedJson(json));
// }
// else
// {
// this.log('OK-age.' + age + '.');
// }
// }
// }
// catch (e)
// {
// this.log('CATCH-RUNCHECK-' + e.stack, true);
// this.debug(e);
// }
// };
// ui.editor.addListener('fileLoaded', mxUtils.bind(this, function()
// {
// try
// {
// var file = ui.getCurrentFile();
// if (file != null && file.constructor == DriveFile && file.realtime != null)
// {
// // With a 30% probability
// if (urlParams['json-check'] != '0' && (urlParams['json-check'] == '1' ||
// (Math.random() > 0.3 && urlParams['dev'] != '1')))
// {
// file.checkConvert();
// }
// }
// }
// catch (e)
// {
// // ignore
// }
// }));
// ***********
// END OF TEST
// ***********
});
App.main();
</script>
</body>
</html>

File diff suppressed because it is too large Load diff

View file

@ -2647,8 +2647,7 @@ DrawioFile.prototype.move=function(a,b,e){};DrawioFile.prototype.getHash=functio
DrawioFile.prototype.open=function(){var a=this.getData();null!=a&&this.ui.setFileData(a);this.changeListener=mxUtils.bind(this,function(a,e){var b=null!=e?e.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=b&&b.ignoreEdit||this.fileChanged()});this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener);this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener);this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener);this.ui.addListener("pageFormatChanged",
this.changeListener);this.ui.addListener("pageScaleChanged",this.changeListener);this.ui.addListener("backgroundColorChanged",this.changeListener);this.ui.addListener("backgroundImageChanged",this.changeListener);this.ui.addListener("foldingEnabledChanged",this.changeListener);this.ui.addListener("mathEnabledChanged",this.changeListener);this.ui.addListener("gridEnabledChanged",this.changeListener);this.ui.addListener("guidesEnabledChanged",this.changeListener);this.ui.addListener("pageViewChanged",
this.changeListener)};
DrawioFile.prototype.addAllSavedStatus=function(){var a=this.ui.getCurrentFile();null==a||a.constructor!=DriveFile&&a.constructor!=DropboxFile?this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):(this.ui.editor.setStatus('<div title="'+mxUtils.htmlEntities(mxResources.get("revisionHistory"))+'" style="text-decoration:underline;cursor:pointer;">'+mxUtils.htmlEntities(mxResources.get("allChangesSaved"))+"</div>"),a=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):null,
0<a.length&&mxEvent.addListener(a[0],"click",mxUtils.bind(this,function(){this.ui.actions.get("revisionHistory").funct()})))};
DrawioFile.prototype.addAllSavedStatus=function(){if(this.constructor==DriveFile||this.constructor==DropboxFile){this.ui.editor.setStatus('<div title="'+mxUtils.htmlEntities(mxResources.get("revisionHistory"))+'" style="text-decoration:underline;cursor:pointer;">'+mxUtils.htmlEntities(mxResources.get("allChangesSaved"))+"</div>");var a=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):null;0<a.length&&mxEvent.addListener(a[0],"click",mxUtils.bind(this,function(){this.ui.actions.get("revisionHistory").funct()}))}else this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")))};
DrawioFile.prototype.fileChanged=function(){this.setModified(!0);this.isAutosave()?(this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){null!=this.autosaveThread||this.ui.getCurrentFile()!=this||this.isModified()||this.addAllSavedStatus()}),mxUtils.bind(this,function(a){this.ui.getCurrentFile()==this&&this.addUnsavedStatus(a)}))):this.addUnsavedStatus()};
DrawioFile.prototype.addUnsavedStatus=function(a){a instanceof Error&&null!=a.message?this.ui.editor.setStatus('<div class="geStatusAlert" style="overflow:hidden;">'+mxUtils.htmlEntities(mxResources.get("unsavedChanges"))+" ("+mxUtils.htmlEntities(a.message)+")</div>"):(this.ui.editor.setStatus('<div class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+mxUtils.htmlEntities(mxResources.get("unsavedChangesClickHereToSave"))+"</div>"),a=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):
null,null!=a&&0<a.length?mxEvent.addListener(a[0],"click",mxUtils.bind(this,function(){this.ui.actions.get(null==this.ui.mode?"saveAs":"save").funct()})):this.ui.editor.setStatus('<div class="geStatusAlert" style="overflow:hidden;">'+mxUtils.htmlEntities(mxResources.get("unsavedChanges"))+"</div>"))};
@ -2834,40 +2833,41 @@ null!=a&&"updates"==a.nodeName)){var d=this.editor.graph,e=d.getModel();e.beginU
window.console&&console.log("Error in value for "+m.id+": "+x)}try{var t=a.getAttribute("style");null!=t&&d.model.setStyle(m,t)}catch(x){null!=window.console&&console.log("Error in style for "+m.id+": "+x)}try{var q=a.getAttribute("icon");if(null!=q){var u=0<q.length?JSON.parse(q):null;null!=u&&u.append||d.removeCellOverlays(m);null!=u&&d.addCellOverlay(m,c(u))}}catch(x){null!=window.console&&console.log("Error in icon for "+m.id+": "+x)}try{var G=a.getAttribute("geometry");if(null!=G){var G=JSON.parse(G),
B=d.getCellGeometry(m);if(null!=B){B=B.clone();for(key in G){var J=parseFloat(G[key]);"dx"==key?B.x+=J:"dy"==key?B.y+=J:"dw"==key?B.width+=J:"dh"==key?B.height+=J:B[key]=parseFloat(G[key])}d.model.setGeometry(m,B)}}}catch(x){null!=window.console&&console.log("Error in icon for "+m.id+": "+x)}}}else if("model"==a.nodeName){for(var K=a.firstChild;null!=K&&K.nodeType!=mxConstants.NODETYPE_ELEMENT;)K=K.nextSibling;null!=K&&(new mxCodec(a.firstChild)).decode(K,e)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&
(d.view.scale=parseFloat(a.getAttribute("scale"))),a.hasAttribute("dx")||a.hasAttribute("dy"))d.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(h=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=h&&this.chromelessResize&&this.chromelessResize(!0,h)}return b};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,
d="",f=c.lastIndexOf(".");0<=f&&(d=c.substring(f),c=c.substring(0,f));if(b)var e=new Date,f=e.getFullYear(),m=e.getMonth()+1,k=e.getDate(),v=e.getHours(),l=e.getMinutes(),e=e.getSeconds(),c=c+("-"+(f+"-"+m+"-"+k+"-"+v+"-"+l+"-"+e));return c=mxResources.get("copyOf",[c])+d};EditorUi.prototype.fileLoaded=function(a){var c=!1;this.hideDialog();var b=this.getCurrentFile();this.setCurrentFile(null);null!=b&&(b.removeListener(this.descriptorChangedListener),b.close());this.editor.graph.model.clear();this.editor.undoManager.clear();
d="",f=c.lastIndexOf(".");0<=f&&(d=c.substring(f),c=c.substring(0,f));if(b)var e=new Date,f=e.getFullYear(),m=e.getMonth()+1,k=e.getDate(),v=e.getHours(),l=e.getMinutes(),e=e.getSeconds(),c=c+(" "+(f+"-"+m+"-"+k+"-"+v+"-"+l+"-"+e));return c=mxResources.get("copyOf",[c])+d};EditorUi.prototype.fileLoaded=function(a){var c=!1;this.hideDialog();var b=this.getCurrentFile();this.setCurrentFile(null);null!=b&&(b.removeListener(this.descriptorChangedListener),b.close());this.editor.graph.model.clear();this.editor.undoManager.clear();
var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=b&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);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();this.showSplash()});
if(null!=a)try{this.setCurrentFile(a);a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();null==a.realtime&&(a.isEditable()?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()||this.logEvent({category:"File",action:"open",label:a.getMode()});if(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(r){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(r){}}catch(r){null!=window.console&&console.log("error in fileLoaded:",a,r);if(EditorUi.enableLogging&&!this.isOffline())try{(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+(null!=r&&null!=r.message?":err:"+encodeURIComponent(r.message):
"")+(null!=r&&null!=r.stack?"&stack="+encodeURIComponent(r.stack):"")}catch(h){}this.handleError(r,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=b?b.constructor==DriveFile?this.loadFile(b.getHash()):this.fileLoaded(b):d()}))}else d();return c};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var c=
null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(g){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,d,e,r,h,m){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?
this.getLocalData(".scratchpad",mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var c=mxUtils.createXmlDocument(),b=c.createElement("mxlibrary");mxUtils.setTextContent(b,JSON.stringify(a));c.appendChild(b);return mxUtils.getXml(c)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=
LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var c=this.sidebar.palettes[a];if(null!=c){for(var b=0;b<c.length;b++)c[b].parentNode.removeChild(c[b]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var c=this.sidebar.container;if(null==a){var b=this.sidebar.palettes["L.scratchpad"];null==b&&(b=this.sidebar.palettes.search);null!=b&&(a=b[b.length-1].nextSibling)}a=
null!=a?a:c.firstChild.nextSibling.nextSibling;var b=c.lastChild,d=b.previousSibling;c.insertBefore(b,a);c.insertBefore(d,b)};EditorUi.prototype.loadLibrary=function(a){var c=mxUtils.parseXml(a.getData());if("mxlibrary"==c.documentElement.nodeName){var b=JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=
function(a,b,d){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(c,b){0==c.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style,"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign=
"center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f)):this.addLibraryEntries(c,b)});if(null!=this.sidebar&&null!=b)for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+
"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var v=k.parentNode.previousSibling;d=v.getAttribute("title");null!=
d&&0<d.length&&".scratchpad"!=a.title&&v.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var l=document.createElement("div");l.style.position="absolute";l.style.right="0px";l.style.top="0px";l.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(l.style.backgroundColor="inherit");v.style.position="relative";var p=document.createElement("img");p.setAttribute("src",Dialog.prototype.closeImage);p.setAttribute("title",mxResources.get("close"));p.setAttribute("valign","absmiddle");
p.setAttribute("border","0");p.style.margin="0 3px";var t=null;if(".scratchpad"!=a.title||this.closableScratchpad)l.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=t?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var q=this.editor.graph,u=null,G=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),
k,b,a,a.getMode());mxEvent.consume(c)}),B=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=u&&null!=u.parentNode&&u.parentNode.removeChild(u),u=p.cloneNode(!1),u.setAttribute("src",Editor.spinImage),u.setAttribute("title",mxResources.get("saving")),u.style.cursor="default",u.style.marginRight="2px",u.style.marginTop="-2px",l.insertBefore(u,l.firstChild),v.style.paddingRight=18*l.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=u&&null!=
u.parentNode&&(u.parentNode.removeChild(u),v.style.paddingRight=18*l.childNodes.length+"px")})):null==t&&(t=p.cloneNode(!1),t.setAttribute("src",IMAGE_PATH+"/download.png"),t.setAttribute("title",mxResources.get("save")),l.insertBefore(t,l.firstChild),mxEvent.addListener(t,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==t||a.isModified()||(v.style.paddingRight=18*l.childNodes.length+"px",t.parentNode.removeChild(t),
t=null)});mxEvent.consume(c)})),v.style.paddingRight=18*l.childNodes.length+"px")}),J=mxUtils.bind(this,function(a,c,d,e){a=q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var h=q.getCellGeometry(a[g]);null!=h&&h.translate(-c.x,-c.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);
B(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),K=mxUtils.bind(this,function(a){if(q.isSelectionEmpty())q.getRubberband().isActive()?(q.getRubberband().execute(a),q.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=q.getSelectionCells(),b=q.view.getBounds(c),d=q.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=q.view.translate.x;b.y-=q.view.translate.y;J(c,b)}mxEvent.consume(a)});
k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility=
"hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),k.style.cursor="default",this.sidebar.showTooltips=!0,q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,q.autoScroll=!0,K(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility=
"visible",k.style.border="3px solid transparent",k.style.cursor="",q.autoScroll=!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";k.style.cursor=
"copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.border="3px solid transparent";k.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,h,m,n,r,t,v){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),
c=[new mxCell("",new mxGeometry(0,0,m,n),c)],c[0].vertex=!0,J(c,new mxRectangle(0,0,m,n),a,mxEvent.isAltDown(a)?null:r.substring(0,r.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var l=!1,w=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var h=JSON.parse(mxUtils.getTextContent(g.documentElement));e(h,k);b=b.concat(h);B(a);this.spinner.stop();
l=!0}catch(Q){}else if("mxfile"==g.documentElement.nodeName)try{for(var m=g.documentElement.getElementsByTagName("diagram"),g=0;g<m.length;g++){var h=mxUtils.getTextContent(m[g]),n=this.stringToCells(this.editor.graph.decompress(h)),r=this.editor.graph.getBoundingBoxFromGeometry(n);J(n,new mxRectangle(0,0,r.width,r.height),a)}l=!0}catch(Q){null!=window.console&&console.log("error in drop handler:",Q)}}l||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&
null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=v&&null!=r&&(/(\.v(dx|sdx?))($|\?)/i.test(r)||/(\.vs(x|sx?))($|\?)/i.test(r))?this.importVisio(v,function(a){w(a,"text/xml")},null,r):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,r)&&null!=v?this.parseFile(v,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?w(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":
"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):w(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border="3px solid transparent",k.style.cursor="");a.stopPropagation();a.preventDefault()}));p=p.cloneNode(!1);p.setAttribute("src",Editor.editImage);p.setAttribute("title",mxResources.get("edit"));l.insertBefore(p,l.firstChild);mxEvent.addListener(p,"click",G);mxEvent.addListener(k,
"dblclick",function(a){mxEvent.getSource(a)==k&&G(a)});d=p.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));l.insertBefore(d,l.firstChild);mxEvent.addListener(d,"click",K);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",mxResources.get("help")),d.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d,
mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),l.insertBefore(d,l.firstChild))}v.appendChild(l);v.style.paddingRight=18*l.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var c=0;c<a.length;c++){var d=a[c],f=d.data;if(null!=f){var f=this.convertDataUri(f),e="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==d.aspect&&(e+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(e+
"image="+f,d.w,d.h,"",d.title||"",!1,!1,!0))}else null!=d.xml&&(f=this.stringToCells(this.editor.graph.decompress(d.xml)),0<f.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(f,d.w,d.h,d.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=function(a){return null!=a?a[mxLanguage]||a.main:null};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=
760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,
"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});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,EditorUi.prototype.hsplitPosition=
188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity=
"0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",
"")+(null!=r&&null!=r.stack?"&stack="+encodeURIComponent(r.stack):"")}catch(h){}this.handleError(r,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=b?b.constructor==DriveFile&&null!=b.realtime?this.loadFile(b.getHash()):this.fileLoaded(b):d()}))}else d();return c};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var c=
null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(g){}};EditorUi.prototype.sendReport=function(a,b){b=null!=b?b:3E6;try{a.length>b&&(a=a.substring(0,b)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(a))}catch(g){}};EditorUi.prototype.restoreLibraries=
function(){};EditorUi.prototype.saveLibrary=function(a,b,d,e,r,h,m){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=
function(a){var c=mxUtils.createXmlDocument(),b=c.createElement("mxlibrary");mxUtils.setTextContent(b,JSON.stringify(a));c.appendChild(b);return mxUtils.getXml(c)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var c=this.sidebar.palettes[a];if(null!=c){for(var b=0;b<c.length;b++)c[b].parentNode.removeChild(c[b]);
delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var c=this.sidebar.container;if(null==a){var b=this.sidebar.palettes["L.scratchpad"];null==b&&(b=this.sidebar.palettes.search);null!=b&&(a=b[b.length-1].nextSibling)}a=null!=a?a:c.firstChild.nextSibling.nextSibling;var b=c.lastChild,d=b.previousSibling;c.insertBefore(b,a);c.insertBefore(d,b)};EditorUi.prototype.loadLibrary=function(a){var c=mxUtils.parseXml(a.getData());if("mxlibrary"==c.documentElement.nodeName){var b=
JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,d){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:
null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(c,b){0==c.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style,"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f)):this.addLibraryEntries(c,b)});if(null!=this.sidebar&&null!=b)for(var g=0;g<b.length;g++)mxUtils.bind(this,
function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,
a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var v=k.parentNode.previousSibling;d=v.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&v.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var l=document.createElement("div");l.style.position="absolute";l.style.right="0px";l.style.top="0px";l.style.padding="8px";mxClient.IS_QUIRKS||
8==document.documentMode||(l.style.backgroundColor="inherit");v.style.position="relative";var p=document.createElement("img");p.setAttribute("src",Dialog.prototype.closeImage);p.setAttribute("title",mxResources.get("close"));p.setAttribute("valign","absmiddle");p.setAttribute("border","0");p.style.margin="0 3px";var t=null;if(".scratchpad"!=a.title||this.closableScratchpad)l.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,
function(){this.closeLibrary(a)});null!=t?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var q=this.editor.graph,u=null,G=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(c)}),B=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=u&&null!=u.parentNode&&u.parentNode.removeChild(u),u=p.cloneNode(!1),u.setAttribute("src",
Editor.spinImage),u.setAttribute("title",mxResources.get("saving")),u.style.cursor="default",u.style.marginRight="2px",u.style.marginTop="-2px",l.insertBefore(u,l.firstChild),v.style.paddingRight=18*l.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=u&&null!=u.parentNode&&(u.parentNode.removeChild(u),v.style.paddingRight=18*l.childNodes.length+"px")})):null==t&&(t=p.cloneNode(!1),t.setAttribute("src",IMAGE_PATH+"/download.png"),t.setAttribute("title",mxResources.get("save")),
l.insertBefore(t,l.firstChild),mxEvent.addListener(t,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==t||a.isModified()||(v.style.paddingRight=18*l.childNodes.length+"px",t.parentNode.removeChild(t),t=null)});mxEvent.consume(c)})),v.style.paddingRight=18*l.childNodes.length+"px")}),J=mxUtils.bind(this,function(a,c,d,e){a=q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var h=q.getCellGeometry(a[g]);
null!=h&&h.translate(-c.x,-c.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);B(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),K=mxUtils.bind(this,function(a){if(q.isSelectionEmpty())q.getRubberband().isActive()?(q.getRubberband().execute(a),q.getRubberband().reset()):this.showError(mxResources.get("error"),
mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=q.getSelectionCells(),b=q.view.getBounds(c),d=q.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=q.view.translate.x;b.y-=q.view.translate.y;J(c,b)}mxEvent.consume(a)});k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":
k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),k.style.cursor="default",this.sidebar.showTooltips=!0,
q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,q.autoScroll=!0,K(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="visible",k.style.border="3px solid transparent",k.style.cursor="",q.autoScroll=!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border=
"3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";k.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.border="3px solid transparent";k.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<
a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,h,m,n,r,t,v){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,m,n),c)],c[0].vertex=!0,J(c,new mxRectangle(0,0,m,n),a,mxEvent.isAltDown(a)?null:r.substring(0,r.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),
f=null);else{var l=!1,w=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var h=JSON.parse(mxUtils.getTextContent(g.documentElement));e(h,k);b=b.concat(h);B(a);this.spinner.stop();l=!0}catch(Q){}else if("mxfile"==g.documentElement.nodeName)try{for(var m=g.documentElement.getElementsByTagName("diagram"),g=0;g<m.length;g++){var h=mxUtils.getTextContent(m[g]),n=this.stringToCells(this.editor.graph.decompress(h)),r=this.editor.graph.getBoundingBoxFromGeometry(n);
J(n,new mxRectangle(0,0,r.width,r.height),a)}l=!0}catch(Q){null!=window.console&&console.log("error in drop handler:",Q)}}l||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=v&&null!=r&&(/(\.v(dx|sdx?))($|\?)/i.test(r)||/(\.vs(x|sx?))($|\?)/i.test(r))?this.importVisio(v,function(a){w(a,"text/xml")},null,r):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,
r)&&null!=v?this.parseFile(v,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?w(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):w(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border="3px solid transparent",k.style.cursor="");a.stopPropagation();
a.preventDefault()}));p=p.cloneNode(!1);p.setAttribute("src",Editor.editImage);p.setAttribute("title",mxResources.get("edit"));l.insertBefore(p,l.firstChild);mxEvent.addListener(p,"click",G);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&G(a)});d=p.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));l.insertBefore(d,l.firstChild);mxEvent.addListener(d,"click",K);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||
(d=document.createElement("span"),d.setAttribute("title",mxResources.get("help")),d.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),l.insertBefore(d,l.firstChild))}v.appendChild(l);v.style.paddingRight=18*l.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var c=0;c<a.length;c++){var d=a[c],f=d.data;if(null!=
f){var f=this.convertDataUri(f),e="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==d.aspect&&(e+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(e+"image="+f,d.w,d.h,"",d.title||"",!1,!1,!0))}else null!=d.xml&&(f=this.stringToCells(this.editor.graph.decompress(d.xml)),0<f.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(f,d.w,d.h,d.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=function(a){return null!=a?a[mxLanguage]||a.main:
null};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",
mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});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,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",
Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor=
"#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",
Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))};EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display=
"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var c=document.getElementById("geFooter");null!=c&&(this.footerHeight=a,c.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,d,e,k){a=new ImageDialog(this,a,b,d,e,k);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=
!0;this.editor.graph.model.execute(a)});var c=new BackgroundImageDialog(this,mxUtils.bind(this,function(c){a(c)}));this.showDialog(c.container,360,200,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(a,b,d,e,k){a=new LibraryDialog(this,a,b,d,e,k);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer");
@ -3011,19 +3011,19 @@ f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxE
null!=d&&1==d.length?(k=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(m=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(k=c[0].getAttribute("href")));var n=!0,l=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(k,f,g,!0,m,null,n))});m&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){n=a;l()},mxEvent.isControlDown(a)):l()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,
function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",f,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+h+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(h,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),
f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(a){var c=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==a.substring(0,13)){var b=a.indexOf(",");0<b&&(c=this.getPageById(a.substring(b+1)),c=null!=c?c.getName():mxResources.get("pageNotFound"))}else"data:"==a.substring(0,5)&&(c=mxResources.get("action"));return c};EditorUi.prototype.handleCustomLink=
function(a){if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");if(a=this.getPageById(a.substring(c+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();
function(a){if("data:page/id,"==a.substring(0,13)){var b=a.indexOf(",");if(a=this.getPageById(a.substring(b+1)))this.selectPage(a);else throw Error(mxResources.get("pageNotFound")||"Page not found");}else this.editor.graph.handleCustomLink(a)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();
this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,
function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=
mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML=
"";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=
c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.convertLucidChart(d,mxUtils.bind(this,function(a){this.editor.graph.setSelectionCells(this.importXml(a,0,0))}),mxUtils.bind(this,function(a){this.handleError(a)})),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var k=e.lastIndexOf("%3E");0<=k&&k<e.length-3&&(e=e.substring(0,k+3))}catch(v){}try{var c=b.getElementsByTagName("span"),
l=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(l)&&(f=!0,e=l)}catch(v){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),
!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(v){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var c=null,b=0;b<a.length;b++)mxEvent.addListener(a[b],"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[b],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||
"1"!=urlParams.embed)&&null==c&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(c=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[b],"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=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 b=this.extractGraphModelFromEvent(a);if(null==b){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?b=d.getData("Text"):(b=null,b=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=b&&0<b.length?(d=document.createElement("div"),d.innerHTML=b,d=d.getElementsByTagName("img"),
0<d.length&&(b=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(b=d.getData("text/plain"))),null!=b&&("data:image/png;base64,"==b.substring(0,22)?(b=this.extractGraphModelFromPng(b),null!=b&&0<b.length&&this.openLocalFile(b,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(b)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(b))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(b)&&
(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))))}else this.openLocalFile(b,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var h=document.documentElement;d=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-
3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=b+"px";h.style.left=c+"px";h.style.width=Math.max(0,d-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=
!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(v){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||
"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&
!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),
0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&
(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var c=0,b=0,d,e;if(null==a){e=document.body;var h=document.documentElement;d=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-
3}else c=a.offsetTop,b=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=c+"px";h.style.left=b+"px";h.style.width=Math.max(0,d-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=
function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=
c.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(y){this.handleError(y,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(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,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")))}));
@ -3215,19 +3215,19 @@ c.showImportCsvDialog()}));c.actions.put("importText",new Action(mxResources.get
new Action(mxResources.get("format")+"...",function(){a(c)}));EditorUi.enablePlantUml&&!c.isOffline()&&c.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(c,"Insert from Text","plantUml");c.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();c.menus.addSubmenu("extras",a,b,mxResources.get("preferences"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?
c.menus.addMenuItems(a,"new open - save saveAs -".split(" "),b):"1"==urlParams.embed?(c.menus.addMenuItems(a,["-","save"],b),"1"==urlParams.saveAndExit&&c.menus.addMenuItems(a,["saveAndExit"],b),a.addSeparator(b)):(c.menus.addMenuItems(a,["new"],b),c.menus.addSubmenu("openFrom",a,b),a.addSeparator(b),c.menus.addSubmenu("save",a,b));c.menus.addSubmenu("exportAs",a,b);null!=d&&d.constructor==DriveFile&&(c.menus.addMenuItems(a,["-","share"],b),null!=d.realtime?c.menus.addMenuItems(a,["chatWindowTitle"],
b):c.menus.addMenuItems(a,["-","refresh"],b),a.addSeparator(b));c.menus.addMenuItems(a,"- outline layers - find tags".split(" "),b);mxClient.IS_IOS&&navigator.standalone||c.menus.addMenuItems(a,["-","print","-"],b);c.menus.addSubmenu("help",a,b);"1"==urlParams.embed?c.menus.addMenuItems(a,["-","exit"],b):c.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a,b){f.apply(this,arguments);a.addSeparator(b);c.menus.addSubmenu("openRecent",a,
b)}}this.put("save",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile?c.menus.addMenuItems(a,["createRevision","makeCopy","-","rename","moveToFolder"],b):(c.menus.addMenuItems(a,["save","saveAs","-","rename"],b),c.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&this.addMenuItems(a,["upload"],b):c.menus.addMenuItems(a,["makeCopy"],b));null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||c.menus.addMenuItems(a,["-","revisionHistory"],
b);c.menus.addMenuItems(a,["-","autosave"],b)})));var g=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){g.funct(a,b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||c.menus.addMenuItems(a,["publishLink"],b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",a,b);null!=h&&c.menus.addSubmenu("language",a,b);a.addSeparator(b);c.menus.addMenuItems(a,
["scrollbars","tooltips"],b);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],b);!c.isOfflineApp()&&isLocalStorage&&(a.addSeparator(b),c.menus.addMenuItem(a,"plugins",b))})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),b)})));mxResources.parse("insertLayout="+mxResources.get("layout"));
mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,["import"],b):c.menus.addSubmenu("importFrom",a,b);a.addSeparator(b);c.menus.addSubmenu("insertLayout",a,b);c.menus.addSubmenu("insertAdvanced",a,b)})));var k="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),
l=function(a,b,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(c,d,e);c.showDialog(a.container,620,420,!0,!1);a.init()}),b)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<k.length;c++)"-"==k[c]?a.addSeparator(b):l(a,b,mxResources.get(k[c])+"...",k[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints -".split(" "),b);if("undefined"!==typeof MathJax){var d=
c.menus.addMenuItem(a,"mathematicalTypesetting",b);c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}c.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],b)})))};var h=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var e=g.menus.get(a),f=p.addMenu(mxResources.get(a),mxUtils.bind(this,function(){e.funct.apply(this,arguments)}),n);f.className="geMenuItem";f.style.display="inline-block";f.style.boxSizing="border-box";
f.style.top="6px";f.style.marginRight="6px";f.style.height="30px";f.style.paddingTop="6px";f.style.paddingBottom="6px";f.setAttribute("title",mxResources.get(a));g.menus.menuCreated(e,f,"geMenuItem");null!=c?(f.style.backgroundImage="url("+c+")",f.style.backgroundPosition="center center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="24px 24px",f.style.width="34px",f.innerHTML="",mxUtils.setOpacity(f,d||40)):b||(f.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",f.style.backgroundPosition=
"right 6px center",f.style.backgroundRepeat="no-repeat",f.style.paddingRight="22px");return f}function b(a,b,c,d,e,f){var h=document.createElement("a");h.setAttribute("href","javascript:void(0)");h.className="geMenuItem";h.style.display="inline-block";h.style.boxSizing="border-box";h.style.height="30px";h.style.padding="6px";h.style.position="relative";h.style.verticalAlign="top";h.style.top="0px";null!=g.statusContainer?l.insertBefore(h,g.statusContainer):l.appendChild(h);null!=f?(h.style.backgroundImage=
"url("+f+")",h.style.backgroundPosition="center center",h.style.backgroundRepeat="no-repeat",h.style.backgroundSize="24px 24px",h.style.width="34px"):mxUtils.write(h,a);mxEvent.addListener(h,"click",function(a){"disabled"!=h.getAttribute("disabled")&&b(a);mxEvent.consume(a)});null==c&&(h.style.marginRight="4px");null!=d&&h.setAttribute("title",d);mxUtils.setOpacity(h,null!=f?40:100);null!=e&&(a=function(){e.isEnabled()?(h.removeAttribute("disabled"),mxUtils.setOpacity(h,null!=f?40:100),h.style.cursor=
""):(h.setAttribute("disabled","disabled"),mxUtils.setOpacity(h,null!=f?10:20),h.style.cursor="default")},e.addListener("stateChanged",a),a());return h}function c(a){var b=document.createElement("div");b.className="geMenuItem";b.style.display="inline-block";b.style.verticalAlign="top";b.style.marginRight="6px";b.style.padding="0 4px 0 4px";b.style.height="30px";b.style.position="relative";b.style.top="0px";for(var c=0;c<a.length;c++)null!=a[c]&&(a[c].style.margin="0px",a[c].style.boxShadow="none",
b.appendChild(a[c]));null!=g.statusContainer?l.insertBefore(b,g.statusContainer):l.appendChild(b);return b}function d(){for(var d=l.firstChild;null!=d;){var f=d.nextSibling;"geMenuItem"!=d.className&&"geItem"!=d.className||d.parentNode.removeChild(d);d=f}n=l.firstChild;e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;(d=900>e)||a("diagram");c([d?a("diagram",null,IMAGE_PATH+"/drawlogo-gray.svg",100):null,b(mxResources.get("shapes"),g.actions.get("toggleShapes").funct,
null,mxResources.get("shapes"),g.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),b(mxResources.get("format"),g.actions.get("toggleFormat").funct,null,mxResources.get("format")+" ("+g.actions.get("formatPanel").shortcut+")",g.actions.get("image"),
d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==":
b)}}this.put("save",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile?(null==d.realtime?c.menus.addMenuItems(a,["save"],b):c.menus.addMenuItems(a,["createRevision"],b),c.menus.addMenuItems(a,["makeCopy","-","rename","moveToFolder"],b)):(c.menus.addMenuItems(a,["save","saveAs","-","rename"],b),c.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&this.addMenuItems(a,["upload"],b):c.menus.addMenuItems(a,["makeCopy"],b));c.menus.addMenuItems(a,["-",
"autosave"],b);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||c.menus.addMenuItems(a,["-","revisionHistory"],b)})));var g=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){g.funct(a,b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||c.menus.addMenuItems(a,["publishLink"],b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",
a,b);null!=h&&c.menus.addSubmenu("language",a,b);a.addSeparator(b);c.menus.addMenuItems(a,["scrollbars","tooltips"],b);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],b);!c.isOfflineApp()&&isLocalStorage&&(a.addSeparator(b),c.menus.addMenuItem(a,"plugins",b))})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),
b)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,["import"],b):c.menus.addSubmenu("importFrom",a,b);a.addSeparator(b);c.menus.addSubmenu("insertLayout",a,b);c.menus.addSubmenu("insertAdvanced",
a,b)})));var k="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),l=function(a,b,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(c,d,e);c.showDialog(a.container,620,420,!0,!1);a.init()}),b)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<k.length;c++)"-"==k[c]?a.addSeparator(b):l(a,b,mxResources.get(k[c])+"...",k[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,
"grid guides - connectionArrows connectionPoints -".split(" "),b);if("undefined"!==typeof MathJax){var d=c.menus.addMenuItem(a,"mathematicalTypesetting",b);c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}c.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],b)})))};var h=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var e=g.menus.get(a),f=p.addMenu(mxResources.get(a),mxUtils.bind(this,function(){e.funct.apply(this,
arguments)}),n);f.className="geMenuItem";f.style.display="inline-block";f.style.boxSizing="border-box";f.style.top="6px";f.style.marginRight="6px";f.style.height="30px";f.style.paddingTop="6px";f.style.paddingBottom="6px";f.setAttribute("title",mxResources.get(a));g.menus.menuCreated(e,f,"geMenuItem");null!=c?(f.style.backgroundImage="url("+c+")",f.style.backgroundPosition="center center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="24px 24px",f.style.width="34px",f.innerHTML="",mxUtils.setOpacity(f,
d||40)):b||(f.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",f.style.backgroundPosition="right 6px center",f.style.backgroundRepeat="no-repeat",f.style.paddingRight="22px");return f}function b(a,b,c,d,e,f){var h=document.createElement("a");h.setAttribute("href","javascript:void(0)");h.className="geMenuItem";h.style.display="inline-block";h.style.boxSizing="border-box";h.style.height="30px";h.style.padding="6px";h.style.position="relative";h.style.verticalAlign="top";h.style.top=
"0px";null!=g.statusContainer?l.insertBefore(h,g.statusContainer):l.appendChild(h);null!=f?(h.style.backgroundImage="url("+f+")",h.style.backgroundPosition="center center",h.style.backgroundRepeat="no-repeat",h.style.backgroundSize="24px 24px",h.style.width="34px"):mxUtils.write(h,a);mxEvent.addListener(h,"click",function(a){"disabled"!=h.getAttribute("disabled")&&b(a);mxEvent.consume(a)});null==c&&(h.style.marginRight="4px");null!=d&&h.setAttribute("title",d);mxUtils.setOpacity(h,null!=f?40:100);
null!=e&&(a=function(){e.isEnabled()?(h.removeAttribute("disabled"),mxUtils.setOpacity(h,null!=f?40:100),h.style.cursor=""):(h.setAttribute("disabled","disabled"),mxUtils.setOpacity(h,null!=f?10:20),h.style.cursor="default")},e.addListener("stateChanged",a),a());return h}function c(a){var b=document.createElement("div");b.className="geMenuItem";b.style.display="inline-block";b.style.verticalAlign="top";b.style.marginRight="6px";b.style.padding="0 4px 0 4px";b.style.height="30px";b.style.position=
"relative";b.style.top="0px";for(var c=0;c<a.length;c++)null!=a[c]&&(a[c].style.margin="0px",a[c].style.boxShadow="none",b.appendChild(a[c]));null!=g.statusContainer?l.insertBefore(b,g.statusContainer):l.appendChild(b);return b}function d(){for(var d=l.firstChild;null!=d;){var f=d.nextSibling;"geMenuItem"!=d.className&&"geItem"!=d.className||d.parentNode.removeChild(d);d=f}n=l.firstChild;e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;(d=900>e)||a("diagram");c([d?
a("diagram",null,IMAGE_PATH+"/drawlogo-gray.svg",100):null,b(mxResources.get("shapes"),g.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),g.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),b(mxResources.get("format"),
g.actions.get("toggleFormat").funct,null,mxResources.get("format")+" ("+g.actions.get("formatPanel").shortcut+")",g.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==":
null)]);f=a("insert",!0,d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==":null,40);c([f,b(mxResources.get("delete"),g.actions.get("delete").funct,null,mxResources.get("delete"),g.actions.get("delete"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiAxOWMwIDEuMS45IDIgMiAyaDhjMS4xIDAgMi0uOSAyLTJWN0g2djEyek0xOSA0aC0zLjVsLTEtMWgtNWwtMSAxSDV2MmgxNFY0eiIvPjwvc3ZnPg==":
null)]);if(411<=e&&(f=g.actions.get("undo"),d=g.actions.get("redo"),f=b("",f.funct,null,mxResources.get("undo")+" ("+f.shortcut+")",f,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIuNSA4Yy0yLjY1IDAtNS4wNS45OS02LjkgMi42TDIgN3Y5aDlsLTMuNjItMy42MmMxLjM5LTEuMTYgMy4xNi0xLjg4IDUuMTItMS44OCAzLjU0IDAgNi41NSAyLjMxIDcuNiA1LjVsMi4zNy0uNzhDMjEuMDggMTEuMDMgMTcuMTUgOCAxMi41IDh6Ii8+PC9zdmc+"),d=b("",d.funct,
null,mxResources.get("redo")+" ("+d.shortcut+")",d,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTguNCAxMC42QzE2LjU1IDguOTkgMTQuMTUgOCAxMS41IDhjLTQuNjUgMC04LjU4IDMuMDMtOS45NiA3LjIyTDMuOSAxNmMxLjA1LTMuMTkgNC4wNS01LjUgNy42LTUuNSAxLjk1IDAgMy43My43MiA1LjEyIDEuODhMMTMgMTZoOVY3bC0zLjYgMy42eiIvPjwvc3ZnPg=="),c([f,d]),480<=e)){var d=g.actions.get("zoomIn"),f=g.actions.get("zoomOut"),h=g.actions.get("resetView");

File diff suppressed because one or more lines are too long

View file

@ -187,14 +187,16 @@ App.TRELLO_JQUERY_URL = 'https://code.jquery.com/jquery-1.7.1.min.js';
App.FOOTER_PLUGIN_URL = 'https://www.jgraph.com/drawio-footer.js';
/**
* Switch to disable Google realtime. If true this will convert existing realtime files.
* Switch to disable Google realtime starting on 11/12/2018 at 9:00am (UTC).
*/
App.GOOGLE_REALTIME = urlParams['google-realtime'] != '0';
App.GOOGLE_REALTIME = urlParams['google-realtime'] != '0' && new Date().getTime() < 1542013200000;
/**
* Switch to disable Google realtime. If true this will convert existing realtime files.
* Google APIs to load. The realtime API is needed to notify collaborators of conversion
* of the realtime files, but after Dec 11 it's read-only and hence no longer needed.
*/
App.GOOGLE_APIS = 'client,drive-share' + ((App.GOOGLE_REALTIME) ? ',drive-realtime' : '');
App.GOOGLE_APIS = 'client,drive-share,drive-realtime';
//App.GOOGLE_APIS = 'client,drive-share' + ((App.GOOGLE_REALTIME) ? ',drive-realtime' : '');
/**
* Defines plugin IDs for loading via p URL parameter. Update the table at
@ -453,6 +455,19 @@ App.main = function(callback, createUi)
};
}
/**
* Removes info text in embed mode
*/
if (urlParams['embed'] == '1')
{
var geInfo = document.getElementById('geInfo');
if (geInfo != null)
{
geInfo.parentNode.removeChild(geInfo);
}
}
if (window.mxscript != null)
{
/**
@ -1158,40 +1173,44 @@ App.prototype.checkLicense = function()
domain = email.substring(at + 1);
email = this.crc32(email.substring(0, at)) + '@' + domain;
}
// Timestamp is workaround for cached response in certain environments
mxUtils.post('/license', 'domain=' + encodeURIComponent(domain) + '&email=' + encodeURIComponent(email) +
'&ds=' + encodeURIComponent(driveUser.displayName) + '&lc=' + encodeURIComponent(driveUser.locale) +
'&ts=' + new Date().getTime(),
mxUtils.bind(this, function(req)
{
var registered = false;
var exp = null;
try
{
if (req.getStatus() >= 200 && req.getStatus() <= 299)
{
var value = req.getText();
registered = true;
if (value.length > 0)
{
var lic = JSON.parse(value);
if (lic != null)
{
exp = this.handleLicense(lic, domain);
}
}
}
}
catch (e)
{
// ignore
}
// NOTE: RESPONSE IS IGNORED TO SHOW TEMPORARY WARNING NOTICE BELOW!
// var registered = false;
// var exp = null;
//
// try
// {
// if (req.getStatus() >= 200 && req.getStatus() <= 299)
// {
// var value = req.getText();
// registered = true;
//
// if (value.length > 0)
// {
// var lic = JSON.parse(value);
//
// if (lic != null)
// {
// exp = this.handleLicense(lic, domain);
// }
// }
// }
// }
// catch (e)
// {
// // ignore
// }
}));
}
// NOTE: RESPONSE ABOVE IS IGNORED TO SHOW TEMPORARY WARNING NOTICE!
this.showFooterRealtimeNotice();
};
/**
@ -1252,6 +1271,50 @@ App.prototype.handleLicense = function(lic, domain)
return expiry;
};
/**
* Returns true if the current domain is for the new drive app.
*/
App.prototype.showFooterRealtimeNotice = function()
{
var footer = document.getElementById('geFooter');
if (footer != null)
{
var alert = this.createRealtimeNotice();
alert.style.zIndex = '1';
alert.style.padding = '18px 0 14px 0';
alert.style.width = 'auto';
alert.style.top = '0px';
alert.style.left = '0px';
alert.style.right = '170px';
footer.appendChild(alert);
}
};
/**
* Returns true if the current domain is for the new drive app.
*/
App.prototype.createRealtimeNotice = function()
{
var alert = document.createElement('a');
alert.className = 'geStatusAlert';
alert.style.display = 'block';
alert.style.position = 'absolute';
alert.style.overflow = 'hidden';
alert.style.cursor = 'pointer';
alert.style.bottom = '0';
alert.style.textAlign = 'center';
alert.style.textDecoration = 'none';
alert.style.fontWeight = 'bold';
alert.setAttribute('href', 'https://desk.draw.io/support/solutions/articles/16000087215');
alert.setAttribute('target', '_blank');
mxUtils.write(alert, mxResources.get('collaborativeEditingNotice'));
return alert;
};
/**
*
*/
@ -2024,14 +2087,29 @@ App.prototype.showRefreshDialog = function(title, message)
{
this.showingRefreshDialog = true;
this.showError(title || mxResources.get('error'),
this.showError(title || mxResources.get('externalChanges'),
message || mxResources.get('redirectToNewApp'),
mxResources.get('refresh'), mxUtils.bind(this, function()
{
this.spinner.spin(document.body, mxResources.get('connecting'));
this.editor.graph.setEnabled(false);
window.location.reload();
}));
}), null, null, null, null, null, 340, 180);
// Adds important notice to dialog
if (this.dialog != null && this.dialog.container != null)
{
var alert = this.createRealtimeNotice();
alert.style.left = '0';
alert.style.right = '0';
alert.style.borderRadius = '0';
alert.style.borderLeftStyle = 'none';
alert.style.borderRightStyle = 'none';
alert.style.marginBottom = '26px';
alert.style.padding = '8px 0 8px 0';
this.dialog.container.appendChild(alert);
}
}
};
@ -2968,7 +3046,7 @@ App.prototype.saveLibrary = function(name, images, file, mode, noSpin, noReload,
/**
* Adds the label menu items to the given menu and parent.
*/
App.prototype.saveFile = function(forceDialog)
App.prototype.saveFile = function(forceDialog, success)
{
var file = this.getCurrentFile();
@ -2979,15 +3057,23 @@ App.prototype.saveFile = function(forceDialog)
{
this.removeDraft();
// Workaround for possible status update while save as dialog is showing
// is to show no saved status for device files
if (file.getMode() != App.MODE_DEVICE)
if (this.getCurrentFile() != file && !file.isModified())
{
this.editor.setStatus(mxUtils.htmlEntities(mxResources.get('allChangesSaved')));
// Workaround for possible status update while save as dialog is showing
// is to show no saved status for device files
if (file.getMode() != App.MODE_DEVICE)
{
this.editor.setStatus(mxUtils.htmlEntities(mxResources.get('allChangesSaved')));
}
else
{
this.editor.setStatus('');
}
}
else
if (success != null)
{
this.editor.setStatus('');
success();
}
});
@ -3351,7 +3437,7 @@ App.prototype.fileCreated = function(file, libs, replace, done)
if (replace)
{
this.editor.setStatus(mxUtils.htmlEntities(mxResources.get('allChangesSaved')));
file.addAllSavedStatus();
}
if (libs != null)
@ -3407,7 +3493,8 @@ App.prototype.fileCreated = function(file, libs, replace, done)
// Updates data in memory for local files and save is implicit
// via start of realtime for DriveFiles
if (file.constructor == LocalFile || file.constructor == DriveFile)
if (file.constructor == LocalFile || (file.constructor == DriveFile &&
file.realtime != null))
{
fn();
}
@ -4097,7 +4184,7 @@ App.prototype.save = function(name, done)
var file = this.getCurrentFile();
var msg = mxResources.get('saving');
if (file != null && file.constructor == DriveFile)
if (file != null && file.constructor == DriveFile && file.realtime != null)
{
msg = mxResources.get('createRevision');
}
@ -4126,7 +4213,7 @@ App.prototype.save = function(name, done)
}
else
{
this.editor.setStatus(mxUtils.htmlEntities(mxResources.get('allChangesSaved')));
file.addAllSavedStatus();
}
}

View file

@ -2413,6 +2413,10 @@ var ParseDialog = function(editorUi, title, defaultType)
layout.disableEdgeStyle = false;
layout.forceConstant = 120;
layout.execute(graph.getDefaultParent());
var edgeLayout = new mxParallelEdgeLayout(graph);
edgeLayout.spacing = 20;
edgeLayout.execute(graph.getDefaultParent());
}
finally
{
@ -3104,8 +3108,8 @@ var NewDialog = function(editorUi, compact, showName, callback, createOnly, canc
}
else
{
elt.innerHTML = '<table width="100%" height="100%"><tr><td align="center" valign="middle">' +
mxResources.get(title) + '</td></tr></table>';
elt.innerHTML = '<table width="100%" height="100%" style="line-height:1em;"><tr>' +
'<td align="center" valign="middle">' + mxResources.get(title) + '</td></tr></table>';
if (select)
{
@ -5255,7 +5259,7 @@ var RevisionDialog = function(editorUi, revs, restoreFn)
}
});
var newBtn = mxUtils.button(mxResources.get('openInNewWindow'), function()
var newBtn = mxUtils.button(mxResources.get('open'), function()
{
if (currentDoc != null)
{
@ -5468,9 +5472,18 @@ var RevisionDialog = function(editorUi, revs, restoreFn)
parseGraphModel(node);
}
var shortUser = item.lastModifyingUserName;
if (shortUser != null && shortUser.length > 20)
{
shortUser = shortUser.substring(0, 20) + '...';
}
fileInfo.innerHTML = '';
mxUtils.write(fileInfo, ts.toLocaleDateString() + ' ' +
ts.toLocaleTimeString());
mxUtils.write(fileInfo, ((shortUser != null) ?
(shortUser + ' ') : '') + ts.toLocaleDateString() +
' ' + ts.toLocaleTimeString());
fileInfo.setAttribute('title', row.getAttribute('title'));
zoomInBtn.removeAttribute('disabled');
zoomOutBtn.removeAttribute('disabled');

View file

@ -337,9 +337,7 @@ DrawioFile.prototype.open = function()
*/
DrawioFile.prototype.addAllSavedStatus = function()
{
var file = this.ui.getCurrentFile();
if (file != null && (file.constructor == DriveFile || file.constructor == DropboxFile))
if (this.constructor == DriveFile || this.constructor == DropboxFile)
{
this.ui.editor.setStatus('<div title="'+ mxUtils.htmlEntities(mxResources.get('revisionHistory')) +
'" style="text-decoration:underline;cursor:pointer;">' +

View file

@ -572,7 +572,7 @@ DriveClient.prototype.copyFile = function(id, title, success, error)
{
this.executeRequest(gapi.client.drive.files.copy({'fileId': id,
'fields': this.allFields, 'supportsTeamDrives': true,
'resource': {'title' : title}}), success, error);
'resource': {'title': title}}), success, error);
}
};
@ -713,11 +713,7 @@ DriveClient.prototype.getFile = function(id, success, error, readXml, readLibrar
{
if (this.isGoogleRealtimeMimeType(resp.mimeType))
{
this.convertRealtimeFile(resp, mxUtils.bind(this, function(file)
{
this.notifyRealtimeConverted(file);
success(file);
}), error);
this.convertRealtimeFile(resp, success, error);
}
else
{
@ -735,12 +731,20 @@ DriveClient.prototype.getFile = function(id, success, error, readXml, readLibrar
doc.getModel().getRoot().isEmpty() || (doc.getModel().getRoot().has('cells') &&
!doc.getModel().getRoot().has(DriveRealtime.prototype.diagramsKey)))
{
this.getXmlFile(resp, doc, success, error);
this.getXmlFile(resp, doc, success, error);
}
else
{
// XML not required here since the realtime model is not empty
success(new DriveFile(this.ui, null, resp, doc));
// Uses JSON or XML data if flagged
if (doc.getModel().getRoot().has('realtimeConverted'))
{
doc.close();
this.convertRealtimeFile(resp, success, error);
}
else
{
success(new DriveFile(this.ui, null, resp, doc));
}
}
}
catch (e)
@ -784,7 +788,7 @@ DriveClient.prototype.getRealtimeData = function(id, success, error, retryCount)
}
else if (error != null)
{
error();
error({message: 'realtime.get returned invalid data for ' + id});
}
}), mxUtils.bind(this, function(resp)
{
@ -795,11 +799,14 @@ DriveClient.prototype.getRealtimeData = function(id, success, error, retryCount)
if (retryCount < 3)
{
this.getRealtimeData(id, success, error, retryCount + 1);
window.setTimeout(mxUtils.bind(this, function()
{
this.getRealtimeData(id, success, error, retryCount + 1);
}), (retryCount + 1) * 100);
}
else if (error != null)
{
error();
error({message: 'realtime.get failed for ' + id});
}
}));
};
@ -895,7 +902,28 @@ DriveClient.prototype.getXmlFile = function(resp, doc, success, error, ignoreMim
}
else
{
// TODO: Import PNG
// Checks if the file contains XML data which can happen when we insert
// the file and then don't post-process it when loaded into the UI which
// is required for creating the images for .PNG and .SVG files.
try
{
var temp = atob(data.substring(index + 1));
if (temp != null && (temp.substring(0, 8) === '<mxfile ' ||
temp.substring(0, 14) === '<mxGraphModel ' ||
temp.substring(0, 14) === '<mxGraphModel>'))
{
data = temp;
}
else
{
// TODO: Import as PNG
}
}
catch (e)
{
// ignore
}
}
}
}
@ -904,7 +932,7 @@ DriveClient.prototype.getXmlFile = function(resp, doc, success, error, ignoreMim
// Checks if mime-type needs to be updated if the file is editable and no viewer app
if (App.GOOGLE_REALTIME && !ignoreMime && this.appId != '850530949725' && file.isEditable() &&
resp.mimeType != this.mimeType)
resp.mimeType != this.mimeType && resp.mimeType != this.xmlMimeType)
{
// Overwrites mime-type (only mutable on update when uploading new content)
this.saveFile(file, true, mxUtils.bind(this, function(resp)
@ -949,6 +977,8 @@ DriveClient.prototype.saveFile = function(file, revision, success, error, noChec
// Adds optional thumbnail to upload request
var doSave = mxUtils.bind(this, function(thumb, thumbMime, keepExisting)
{
var prevDesc = null;
var pinned = false;
var meta =
{
'mimeType': file.desc.mimeType,
@ -956,11 +986,12 @@ DriveClient.prototype.saveFile = function(file, revision, success, error, noChec
};
// Overrides old mime type and creates a revision
if (!App.GOOGLE_REALTIME && file.realtime == null &&
this.isGoogleRealtimeMimeType(file.desc.mimeType))
if (file.realtime == null && this.isGoogleRealtimeMimeType(file.desc.mimeType))
{
prevDesc = file.desc;
meta.mimeType = this.xmlMimeType;
revision = true;
pinned = true;
}
// Inserts a channel ID
@ -998,13 +1029,42 @@ DriveClient.prototype.saveFile = function(file, revision, success, error, noChec
}
// Updates saveDelay on drive file
var wrapper = function()
var wrapper = mxUtils.bind(this, function()
{
file.saveDelay = new Date().getTime() - t0;
success.apply(this, arguments);
};
if (prevDesc != null)
{
// Pins previous revision
this.executeRequest(gapi.client.drive.revisions.get(
{
'fileId': prevDesc.id,
'revisionId': prevDesc.headRevisionId,
'supportsTeamDrives': true
}), mxUtils.bind(this, mxUtils.bind(this, function(resp)
{
resp.pinned = true;
this.executeRequest(gapi.client.drive.revisions.update(
{
'fileId': prevDesc.id,
'revisionId': prevDesc.headRevisionId,
'resource': resp
}));
})));
// Logs conversion
this.ui.logEvent({category: 'RT-CONVERT',
action: 'from-' + prevDesc.id + '.' +
prevDesc.headRevisionId + '-to-' +
file.desc.id + '.' + file.desc.headRevisionId + '-' +
file.convertedFrom,
label: (this.user != null) ? this.user.id : 'unknown-user'});
}
});
var fn = mxUtils.bind(this, function(data, binary)
var doExecuteRequest = mxUtils.bind(this, function(data, binary)
{
if (properties != null)
{
@ -1016,21 +1076,21 @@ DriveClient.prototype.saveFile = function(file, revision, success, error, noChec
file.realtime == null) ? file.desc.etag : null;
this.executeRequest(this.createUploadRequest(file.getId(), meta,
data, revision || (file.desc.mimeType != this.mimeType &&
file.desc.mimeType != this.libraryMimeType), binary, etag),
wrapper, error);
data, revision || (file.desc.mimeType != this.xmlMimeType &&
file.desc.mimeType != this.mimeType && file.desc.mimeType !=
this.libraryMimeType), binary, etag, pinned), wrapper, error);
});
if (this.ui.useCanvasForExport && /(\.png)$/i.test(file.getTitle()))
{
this.ui.getEmbeddedPng(mxUtils.bind(this, function(data)
{
fn(data, true);
doExecuteRequest(data, true);
}), error, (this.ui.getCurrentFile() != file) ? file.getData() : null);
}
else
{
fn(file.getData(), false);
doExecuteRequest(file.getData(), false);
}
});
@ -1107,13 +1167,13 @@ DriveClient.prototype.saveFile = function(file, revision, success, error, noChec
/**
* Sends a message to all collaborators and stores the head revision ID.
*/
DriveClient.prototype.notifyRealtimeConverted = function(file)
DriveClient.prototype.notifyRealtimeConverted = function(desc)
{
try
{
if (gapi.drive.realtime != null)
{
gapi.drive.realtime.load(file.getId(), mxUtils.bind(this, function(doc)
gapi.drive.realtime.load(desc.id, mxUtils.bind(this, function(doc)
{
try
{
@ -1121,7 +1181,7 @@ DriveClient.prototype.notifyRealtimeConverted = function(file)
doc.getModel().getRoot() != null)
{
doc.getModel().getRoot().set('realtimeConverted',
file.desc.headRevisionId);
desc.headRevisionId);
}
}
catch (e)
@ -1186,7 +1246,7 @@ DriveClient.prototype.redirectToNewApp = function(error, fileId)
this.redirectDialogShowing = true;
var url = window.location.protocol + '//' + this.newAppHostname + '/' + this.ui.getSearch(
['create', 'title', 'mode', 'url', 'drive', 'splash']) + '#G' + fileId;
['create', 'title', 'mode', 'url', 'drive', 'splash', 'state']) + '#G' + fileId;
if (error != null)
{
@ -1284,7 +1344,7 @@ DriveClient.prototype.insertFile = function(title, data, folderId, success, erro
* @param {number} dx X-coordinate of the translation.
* @param {number} dy Y-coordinate of the translation.
*/
DriveClient.prototype.createUploadRequest = function(id, metadata, data, revision, binary, etag)
DriveClient.prototype.createUploadRequest = function(id, metadata, data, revision, binary, etag, pinned)
{
binary = (binary != null) ? binary : false;
var bd = '-------314159265358979323846';
@ -1315,6 +1375,11 @@ DriveClient.prototype.createUploadRequest = function(id, metadata, data, revisio
reqObj.params['newRevision'] = false;
}
if (pinned)
{
reqObj.params['pinned'] = true;
}
reqObj.params['supportsTeamDrives'] = true;
reqObj.params['fields'] = this.allFields;
@ -1685,26 +1750,55 @@ DriveClient.prototype.getRealtimeAge = function(desc, json)
*/
DriveClient.prototype.convertRealtimeFile = function(desc, success, error)
{
var xmlSuccess = mxUtils.bind(this, function(file)
{
file.convertedFrom = 'xml';
success(file);
});
var jsonSuccess = mxUtils.bind(this, function(file)
{
file.convertedFrom = 'json';
success(file);
});
this.getRealtimeData(desc.id, mxUtils.bind(this, function(json)
{
var age = this.getRealtimeAge(desc, json);
// Uses the newer of the two
if (age < 0)
try
{
var node = this.convertJsonToXml(json);
console.log('converted realtime model', age, json, node);
success(new DriveFile(this.ui, mxUtils.getXml(node), desc));
var age = this.getRealtimeAge(desc, json);
this.notifyRealtimeConverted(desc);
// Uses realtime if newer or less than 5 minutes old
if (age < 300000)
{
jsonSuccess(new DriveFile(this.ui, mxUtils.getXml(
this.convertJsonToXml(json)), desc));
}
else
{
this.getXmlFile(desc, null, xmlSuccess, mxUtils.bind(this, function()
{
try
{
jsonSuccess(new DriveFile(this.ui, mxUtils.getXml(
this.convertJsonToXml(json)), desc));
}
catch (e)
{
this.getXmlFile(desc, null, xmlSuccess, error);
}
}));
}
}
else
catch (e)
{
console.log('using newer XML file', age, json);
this.getXmlFile(desc, null, success, error);
this.getXmlFile(desc, null, xmlSuccess, error);
}
}), mxUtils.bind(this, function()
{
console.log('no realtime data, using XML file');
this.getXmlFile(desc, null, success, error);
this.getXmlFile(desc, null, xmlSuccess, error);
}));
};
@ -1791,7 +1885,7 @@ DriveClient.prototype.decodeJsonPage = function(json, node, uncompressed)
else
{
// Workaround for missing page ID in JSON
this.node.setAttribute('id', Editor.guid());
node.setAttribute('id', Editor.guid());
}
if (json.name != null)

View file

@ -84,7 +84,7 @@ DriveFile.prototype.getPublicUrl = function(fn)
*/
DriveFile.prototype.isAutosaveOptional = function()
{
return true;
return this.realtime == null;
};
/**
@ -453,7 +453,17 @@ DriveFile.prototype.showConflictDialog = function(retry, error)
{
this.showingConflictDialog = false;
this.changeListenerEnabled = prev;
this.makeCopy(retry, error, true);
if (this.isRestricted())
{
this.ui.editor.editAsNew(this.ui.getFileData(true));
resume();
error();
}
else
{
this.makeCopy(retry, error, true);
}
}), null, mxResources.get('overwrite'), mxUtils.bind(this, function()
{
this.showingConflictDialog = false;
@ -472,94 +482,20 @@ DriveFile.prototype.showConflictDialog = function(retry, error)
// Adds important notice to dialog
if (this.ui.dialog != null && this.ui.dialog.container != null)
{
var alert = document.createElement('a');
alert.className = 'geStatusAlert';
alert.style.display = 'block';
alert.style.position = 'absolute';
alert.style.cursor = 'pointer';
alert.style.bottom = '0';
alert.style.padding = '8px 0 8px 0';
alert.style.marginBottom = '26px';
var alert = this.ui.createRealtimeNotice();
alert.style.left = '0';
alert.style.right = '0';
alert.style.textAlign = 'center';
alert.style.borderRadius = '0';
alert.style.borderLeftStyle = 'none';
alert.style.borderRightStyle = 'none';
alert.style.textDecoration = 'none';
alert.style.fontWeight = 'bold';
alert.setAttribute('href', 'https://desk.draw.io/support/solutions/articles/16000087215');
alert.setAttribute('target', '_blank');
mxUtils.write(alert, mxResources.get('collaborativeEditingNotice'));
alert.style.marginBottom = '26px';
alert.style.padding = '8px 0 8px 0';
this.ui.dialog.container.appendChild(alert);
}
}
};
/**
* Checks the conversion of the realtime model for this file.
*/
DriveFile.prototype.checkConvert = function()
{
var doCheck = mxUtils.bind(this, function(json)
{
try
{
if (this.ui.getCurrentFile() == this && !this.isModified())
{
this.ui.drive.getXmlFile(this.desc, null, mxUtils.bind(this, function(file)
{
try
{
var data = file.getData();
var node = (data != null) ? mxUtils.parseXml(data).documentElement : null;
if (node != null)
{
var tmp = this.ui.editor.extractGraphModel(node, true);
if (tmp != null)
{
node = tmp;
}
}
if (this.runCheck != null)
{
this.runCheck(json, node, data);
}
}
catch (e)
{
this.log('CATCH-PARSEFILE-' + e.stack);
this.runCheck(json, null, 'CATCH-PARSEFILE-' + e.stack);
}
}), mxUtils.bind(this, function(err)
{
this.log('ERROR-GETFILE');
this.runCheck(json, null, 'ERROR-GETFILE');
}), true);
}
}
catch (e)
{
this.log('CATCH-GETFILE-' + e.stack);
this.runCheck(json, null, 'CATCH-GETFILE-' + e.stack);
}
});
try
{
this.ui.drive.getRealtimeData(this.desc.id, doCheck, doCheck);
}
catch (e)
{
this.log('CATCH-GETJSON-' + e.stack, true);
}
};
/**
* Removes all attributes that are irrelevant for structural diff.
*/
@ -708,7 +644,7 @@ DriveFile.prototype.log = function(msg, sendReport)
if (sendReport)
{
this.report('Realtime Log Report ' + new Date() +
this.ui.sendReport('Realtime Log Report ' + new Date() +
'\n\nDescription: ' + JSON.stringify({version: this.ui.JSON_CHECK,
title: this.desc.title, editable: this.desc.editable,
copyable: this.desc.copyable, labels: this.desc.labels, id: this.desc.id,
@ -723,35 +659,3 @@ DriveFile.prototype.log = function(msg, sendReport)
// ignore
}
};
/**
* Debug output.
*/
DriveFile.prototype.report = function(data)
{
try
{
if (data.length > 3000000)
{
data = data.substring(0, 3000000) + '\n...[REPORT SHORTENED]'
}
this.debug(data);
mxUtils.post('/email', 'version=' + encodeURIComponent(EditorUi.VERSION) +
'&url=' + encodeURIComponent(window.location.href) +
'&data=' + encodeURIComponent(data),
mxUtils.bind(this, function(req)
{
this.debug('report sent');
}),
mxUtils.bind(this, function()
{
this.debug('report failed');
}));
}
catch (e)
{
// ignore
}
};

View file

@ -1664,7 +1664,7 @@
}
var ts = new Date();
title += '-' + getFormattedTime();
title += ' ' + getFormattedTime();
}
title = mxResources.get('copyOf', [title]) + extension;
@ -1848,7 +1848,7 @@
else if (oldFile != null)
{
// Workaround for close realtime model is to reload the file from scratch
if (oldFile.constructor == DriveFile)
if (oldFile.constructor == DriveFile && oldFile.realtime != null)
{
this.loadFile(oldFile.getHash());
}
@ -1902,6 +1902,30 @@
}
};
/**
* Debug output.
*/
EditorUi.prototype.sendReport = function(data, maxLength)
{
maxLength = (maxLength != null) ? maxLength : 3000000;
try
{
if (data.length > maxLength)
{
data = data.substring(0, maxLength) + '\n...[SHORTENED]'
}
mxUtils.post('/email', 'version=' + encodeURIComponent(EditorUi.VERSION) +
'&url=' + encodeURIComponent(window.location.href) +
'&data=' + encodeURIComponent(data));
}
catch (e)
{
// ignore
}
};
/**
* Updates action states depending on the selection.
*/
@ -3119,7 +3143,7 @@
// Checks if output is invalid or empty
if (data.length <= 6 || data == canvas.cloneNode(false).toDataURL('image/' + format))
{
throw {message: 'Invalid image'};
throw {message: 'Invalid image'};
}
if (xml != null)

View file

@ -344,11 +344,11 @@
{
item.getXml = function(success, error)
{
// Workaround for vanished head revision is to use current head revision from descriptor
// TODO: Allow team drives
editorUi.drive.executeRequest(gapi.client.drive.revisions.get({'fileId': file.getId(),
'revisionId': (resp.items[resp.items.length - 1] === item) ?
file.desc.headRevisionId : item.id}), function(resp)
editorUi.drive.executeRequest(gapi.client.drive.revisions.get(
{
'fileId': file.getId(),
'revisionId': item.id
}), function(resp)
{
editorUi.drive.getXmlFile(resp, null, function(file2)
{
@ -1695,13 +1695,10 @@
}, parent);
}
if (!mxClient.IS_IOS)
menu.addItem(mxResources.get('device') + '...', null, function()
{
menu.addItem(mxResources.get('device') + '...', null, function()
{
editorUi.importLocalFile(true);
}, parent);
}
editorUi.importLocalFile(true);
}, parent);
if (!editorUi.isOffline())
{
@ -2724,7 +2721,7 @@
this.addMenuItems(menu, ['-', 'revisionHistory'], parent);
}
if (file != null && file.constructor == DriveFile)
if (file != null && file.constructor == DriveFile && file.realtime != null)
{
this.addMenuItems(menu, ['createRevision'], parent);
}

View file

@ -779,7 +779,16 @@ EditorUi.initMinimalTheme = function()
if (file != null && file.constructor == DriveFile)
{
ui.menus.addMenuItems(menu, ['createRevision', 'makeCopy', '-', 'rename', 'moveToFolder'], parent);
if (file.realtime == null)
{
ui.menus.addMenuItems(menu, ['save'], parent);
}
else
{
ui.menus.addMenuItems(menu, ['createRevision'], parent);
}
ui.menus.addMenuItems(menu, ['makeCopy', '-', 'rename', 'moveToFolder'], parent);
}
else
{
@ -798,12 +807,12 @@ EditorUi.initMinimalTheme = function()
}
}
ui.menus.addMenuItems(menu, ['-', 'autosave'], parent);
if (file != null && (file.constructor == DriveFile || file.constructor == DropboxFile))
{
ui.menus.addMenuItems(menu, ['-', 'revisionHistory'], parent);
}
ui.menus.addMenuItems(menu, ['-', 'autosave'], parent);
})));
// Augments the existing export menu

View file

@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"9.3.4",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"9.4.1",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||

View file

@ -184,7 +184,7 @@ f)+"\n"+t+"}":"{"+z.join(",")+"}";f=t;return l}}"function"!==typeof Date.prototy
e=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,f,g,h={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;"function"!==typeof JSON.stringify&&(JSON.stringify=function(a,b,d){var e;g=f="";if("number"===typeof d)for(e=0;e<d;e+=1)g+=" ";else"string"===typeof d&&(g=d);if((k=b)&&"function"!==typeof b&&("object"!==typeof b||"number"!==typeof b.length))throw Error("JSON.stringify");return c("",{"":a})});
"function"!==typeof JSON.parse&&(JSON.parse=function(a,b){function c(a,d){var e,f,g=a[d];if(g&&"object"===typeof g)for(e in g)Object.prototype.hasOwnProperty.call(g,e)&&(f=c(g,e),void 0!==f?g[e]=f:delete g[e]);return b.call(a,d,g)}var e;a=""+a;d.lastIndex=0;d.test(a)&&(a=a.replace(d,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return e=eval("("+a+")"),"function"===typeof b?c({"":e},""):e;throw new SyntaxError("JSON.parse");})})();"undefined"===typeof window.mxBasePath&&(window.mxBasePath="https://www.draw.io/mxgraph/");window.mxLoadStylesheets=window.mxLoadStylesheets||!1;window.mxLoadResources=window.mxLoadResources||!1;window.mxLanguage=window.mxLanguage||"en";window.urlParams=window.urlParams||{};window.MAX_REQUEST_SIZE=window.MAX_REQUEST_SIZE||10485760;window.MAX_AREA=window.MAX_AREA||225E6;window.EXPORT_URL=window.EXPORT_URL||"/export";window.SAVE_URL=window.SAVE_URL||"/save";window.OPEN_URL=window.OPEN_URL||"/open";window.RESOURCES_PATH=window.RESOURCES_PATH||"resources";window.RESOURCE_BASE=window.RESOURCE_BASE||window.RESOURCES_PATH+"/grapheditor";window.STENCIL_PATH=window.STENCIL_PATH||"stencils";window.IMAGE_PATH=window.IMAGE_PATH||"images";
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"9.3.4",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
window.STYLE_PATH=window.STYLE_PATH||"styles";window.CSS_PATH=window.CSS_PATH||"styles";window.OPEN_FORM=window.OPEN_FORM||"open.html";window.mxBasePath=window.mxBasePath||"../../../src";window.mxLanguage=window.mxLanguage||urlParams.lang;window.mxLanguages=window.mxLanguages||["de"];var mxClient={VERSION:"9.4.1",IS_IE:0<=navigator.userAgent.indexOf("MSIE"),IS_IE6:0<=navigator.userAgent.indexOf("MSIE 6"),IS_IE11:!!navigator.userAgent.match(/Trident\/7\./),IS_EDGE:!!navigator.userAgent.match(/Edge\//),IS_QUIRKS:0<=navigator.userAgent.indexOf("MSIE")&&(null==document.documentMode||5==document.documentMode),IS_EM:"spellcheck"in document.createElement("textarea")&&8==document.documentMode,VML_PREFIX:"v",OFFICE_PREFIX:"o",IS_NS:0<=navigator.userAgent.indexOf("Mozilla/")&&0>navigator.userAgent.indexOf("MSIE")&&
0>navigator.userAgent.indexOf("Edge/"),IS_OP:0<=navigator.userAgent.indexOf("Opera/")||0<=navigator.userAgent.indexOf("OPR/"),IS_OT:0<=navigator.userAgent.indexOf("Presto/")&&0>navigator.userAgent.indexOf("Presto/2.4.")&&0>navigator.userAgent.indexOf("Presto/2.3.")&&0>navigator.userAgent.indexOf("Presto/2.2.")&&0>navigator.userAgent.indexOf("Presto/2.1.")&&0>navigator.userAgent.indexOf("Presto/2.0.")&&0>navigator.userAgent.indexOf("Presto/1."),IS_SF:0<=navigator.userAgent.indexOf("AppleWebKit/")&&
0>navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_IOS:navigator.userAgent.match(/(iPad|iPhone|iPod)/g)?!0:!1,IS_GC:0<=navigator.userAgent.indexOf("Chrome/")&&0>navigator.userAgent.indexOf("Edge/"),IS_CHROMEAPP:null!=window.chrome&&null!=chrome.app&&null!=chrome.app.runtime,IS_FF:0<=navigator.userAgent.indexOf("Firefox/"),IS_MT:0<=navigator.userAgent.indexOf("Firefox/")&&0>navigator.userAgent.indexOf("Firefox/1.")&&0>navigator.userAgent.indexOf("Firefox/2.")||0<=navigator.userAgent.indexOf("Iceweasel/")&&
0>navigator.userAgent.indexOf("Iceweasel/1.")&&0>navigator.userAgent.indexOf("Iceweasel/2.")||0<=navigator.userAgent.indexOf("SeaMonkey/")&&0>navigator.userAgent.indexOf("SeaMonkey/1.")||0<=navigator.userAgent.indexOf("Iceape/")&&0>navigator.userAgent.indexOf("Iceape/1."),IS_SVG:0<=navigator.userAgent.indexOf("Firefox/")||0<=navigator.userAgent.indexOf("Iceweasel/")||0<=navigator.userAgent.indexOf("Seamonkey/")||0<=navigator.userAgent.indexOf("Iceape/")||0<=navigator.userAgent.indexOf("Galeon/")||

View file

@ -2647,8 +2647,7 @@ DrawioFile.prototype.move=function(a,b,e){};DrawioFile.prototype.getHash=functio
DrawioFile.prototype.open=function(){var a=this.getData();null!=a&&this.ui.setFileData(a);this.changeListener=mxUtils.bind(this,function(a,e){var b=null!=e?e.getProperty("edit"):null;!this.changeListenerEnabled||!this.isEditable()||null!=b&&b.ignoreEdit||this.fileChanged()});this.ui.editor.graph.model.addListener(mxEvent.CHANGE,this.changeListener);this.ui.editor.graph.addListener("gridSizeChanged",this.changeListener);this.ui.editor.graph.addListener("shadowVisibleChanged",this.changeListener);this.ui.addListener("pageFormatChanged",
this.changeListener);this.ui.addListener("pageScaleChanged",this.changeListener);this.ui.addListener("backgroundColorChanged",this.changeListener);this.ui.addListener("backgroundImageChanged",this.changeListener);this.ui.addListener("foldingEnabledChanged",this.changeListener);this.ui.addListener("mathEnabledChanged",this.changeListener);this.ui.addListener("gridEnabledChanged",this.changeListener);this.ui.addListener("guidesEnabledChanged",this.changeListener);this.ui.addListener("pageViewChanged",
this.changeListener)};
DrawioFile.prototype.addAllSavedStatus=function(){var a=this.ui.getCurrentFile();null==a||a.constructor!=DriveFile&&a.constructor!=DropboxFile?this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved"))):(this.ui.editor.setStatus('<div title="'+mxUtils.htmlEntities(mxResources.get("revisionHistory"))+'" style="text-decoration:underline;cursor:pointer;">'+mxUtils.htmlEntities(mxResources.get("allChangesSaved"))+"</div>"),a=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):null,
0<a.length&&mxEvent.addListener(a[0],"click",mxUtils.bind(this,function(){this.ui.actions.get("revisionHistory").funct()})))};
DrawioFile.prototype.addAllSavedStatus=function(){if(this.constructor==DriveFile||this.constructor==DropboxFile){this.ui.editor.setStatus('<div title="'+mxUtils.htmlEntities(mxResources.get("revisionHistory"))+'" style="text-decoration:underline;cursor:pointer;">'+mxUtils.htmlEntities(mxResources.get("allChangesSaved"))+"</div>");var a=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):null;0<a.length&&mxEvent.addListener(a[0],"click",mxUtils.bind(this,function(){this.ui.actions.get("revisionHistory").funct()}))}else this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("allChangesSaved")))};
DrawioFile.prototype.fileChanged=function(){this.setModified(!0);this.isAutosave()?(this.ui.editor.setStatus(mxUtils.htmlEntities(mxResources.get("saving"))+"..."),this.autosave(this.autosaveDelay,this.maxAutosaveDelay,mxUtils.bind(this,function(a){null!=this.autosaveThread||this.ui.getCurrentFile()!=this||this.isModified()||this.addAllSavedStatus()}),mxUtils.bind(this,function(a){this.ui.getCurrentFile()==this&&this.addUnsavedStatus(a)}))):this.addUnsavedStatus()};
DrawioFile.prototype.addUnsavedStatus=function(a){a instanceof Error&&null!=a.message?this.ui.editor.setStatus('<div class="geStatusAlert" style="overflow:hidden;">'+mxUtils.htmlEntities(mxResources.get("unsavedChanges"))+" ("+mxUtils.htmlEntities(a.message)+")</div>"):(this.ui.editor.setStatus('<div class="geStatusAlert" style="cursor:pointer;overflow:hidden;">'+mxUtils.htmlEntities(mxResources.get("unsavedChangesClickHereToSave"))+"</div>"),a=null!=this.ui.statusContainer?this.ui.statusContainer.getElementsByTagName("div"):
null,null!=a&&0<a.length?mxEvent.addListener(a[0],"click",mxUtils.bind(this,function(){this.ui.actions.get(null==this.ui.mode?"saveAs":"save").funct()})):this.ui.editor.setStatus('<div class="geStatusAlert" style="overflow:hidden;">'+mxUtils.htmlEntities(mxResources.get("unsavedChanges"))+"</div>"))};
@ -2834,40 +2833,41 @@ null!=a&&"updates"==a.nodeName)){var d=this.editor.graph,e=d.getModel();e.beginU
window.console&&console.log("Error in value for "+m.id+": "+x)}try{var t=a.getAttribute("style");null!=t&&d.model.setStyle(m,t)}catch(x){null!=window.console&&console.log("Error in style for "+m.id+": "+x)}try{var q=a.getAttribute("icon");if(null!=q){var u=0<q.length?JSON.parse(q):null;null!=u&&u.append||d.removeCellOverlays(m);null!=u&&d.addCellOverlay(m,c(u))}}catch(x){null!=window.console&&console.log("Error in icon for "+m.id+": "+x)}try{var G=a.getAttribute("geometry");if(null!=G){var G=JSON.parse(G),
B=d.getCellGeometry(m);if(null!=B){B=B.clone();for(key in G){var J=parseFloat(G[key]);"dx"==key?B.x+=J:"dy"==key?B.y+=J:"dw"==key?B.width+=J:"dh"==key?B.height+=J:B[key]=parseFloat(G[key])}d.model.setGeometry(m,B)}}}catch(x){null!=window.console&&console.log("Error in icon for "+m.id+": "+x)}}}else if("model"==a.nodeName){for(var K=a.firstChild;null!=K&&K.nodeType!=mxConstants.NODETYPE_ELEMENT;)K=K.nextSibling;null!=K&&(new mxCodec(a.firstChild)).decode(K,e)}else if("view"==a.nodeName){if(a.hasAttribute("scale")&&
(d.view.scale=parseFloat(a.getAttribute("scale"))),a.hasAttribute("dx")||a.hasAttribute("dy"))d.view.translate=new mxPoint(parseFloat(a.getAttribute("dx")||0),parseFloat(a.getAttribute("dy")||0))}else"fit"==a.nodeName&&(h=a.hasAttribute("max-scale")?parseFloat(a.getAttribute("max-scale")):1);a=a.nextSibling}}finally{e.endUpdate()}null!=h&&this.chromelessResize&&this.chromelessResize(!0,h)}return b};EditorUi.prototype.getCopyFilename=function(a,b){var c=null!=a&&null!=a.getTitle()?a.getTitle():this.defaultFilename,
d="",f=c.lastIndexOf(".");0<=f&&(d=c.substring(f),c=c.substring(0,f));if(b)var e=new Date,f=e.getFullYear(),m=e.getMonth()+1,k=e.getDate(),v=e.getHours(),l=e.getMinutes(),e=e.getSeconds(),c=c+("-"+(f+"-"+m+"-"+k+"-"+v+"-"+l+"-"+e));return c=mxResources.get("copyOf",[c])+d};EditorUi.prototype.fileLoaded=function(a){var c=!1;this.hideDialog();var b=this.getCurrentFile();this.setCurrentFile(null);null!=b&&(b.removeListener(this.descriptorChangedListener),b.close());this.editor.graph.model.clear();this.editor.undoManager.clear();
d="",f=c.lastIndexOf(".");0<=f&&(d=c.substring(f),c=c.substring(0,f));if(b)var e=new Date,f=e.getFullYear(),m=e.getMonth()+1,k=e.getDate(),v=e.getHours(),l=e.getMinutes(),e=e.getSeconds(),c=c+(" "+(f+"-"+m+"-"+k+"-"+v+"-"+l+"-"+e));return c=mxResources.get("copyOf",[c])+d};EditorUi.prototype.fileLoaded=function(a){var c=!1;this.hideDialog();var b=this.getCurrentFile();this.setCurrentFile(null);null!=b&&(b.removeListener(this.descriptorChangedListener),b.close());this.editor.graph.model.clear();this.editor.undoManager.clear();
var d=mxUtils.bind(this,function(){this.setGraphEnabled(!1);this.setCurrentFile(null);null!=b&&this.updateDocumentTitle();this.editor.graph.model.clear();this.editor.undoManager.clear();this.setBackgroundImage(null);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();this.showSplash()});
if(null!=a)try{this.setCurrentFile(a);a.addListener("descriptorChanged",this.descriptorChangedListener);a.addListener("contentChanged",this.descriptorChangedListener);a.open();this.setGraphEnabled(!0);this.setMode(a.getMode());this.editor.undoManager.clear();this.descriptorChanged();this.updateUi();null==a.realtime&&(a.isEditable()?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()||this.logEvent({category:"File",action:"open",label:a.getMode()});if(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(r){}try{mxSettings.setOpenCounter(mxSettings.getOpenCounter()+1),mxSettings.save()}catch(r){}}catch(r){null!=window.console&&console.log("error in fileLoaded:",a,r);if(EditorUi.enableLogging&&!this.isOffline())try{(new Image).src=(null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"")+"/log?v="+encodeURIComponent(EditorUi.VERSION)+"&msg=errorInFileLoaded:url:"+encodeURIComponent(window.location.href)+(null!=r&&null!=r.message?":err:"+encodeURIComponent(r.message):
"")+(null!=r&&null!=r.stack?"&stack="+encodeURIComponent(r.stack):"")}catch(h){}this.handleError(r,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=b?b.constructor==DriveFile?this.loadFile(b.getHash()):this.fileLoaded(b):d()}))}else d();return c};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var c=
null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(g){}};EditorUi.prototype.restoreLibraries=function(){};EditorUi.prototype.saveLibrary=function(a,b,d,e,r,h,m){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?
this.getLocalData(".scratchpad",mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=function(a){var c=mxUtils.createXmlDocument(),b=c.createElement("mxlibrary");mxUtils.setTextContent(b,JSON.stringify(a));c.appendChild(b);return mxUtils.getXml(c)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=
LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var c=this.sidebar.palettes[a];if(null!=c){for(var b=0;b<c.length;b++)c[b].parentNode.removeChild(c[b]);delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var c=this.sidebar.container;if(null==a){var b=this.sidebar.palettes["L.scratchpad"];null==b&&(b=this.sidebar.palettes.search);null!=b&&(a=b[b.length-1].nextSibling)}a=
null!=a?a:c.firstChild.nextSibling.nextSibling;var b=c.lastChild,d=b.previousSibling;c.insertBefore(b,a);c.insertBefore(d,b)};EditorUi.prototype.loadLibrary=function(a){var c=mxUtils.parseXml(a.getData());if("mxlibrary"==c.documentElement.nodeName){var b=JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=
function(a,b,d){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(c,b){0==c.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style,"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign=
"center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f)):this.addLibraryEntries(c,b)});if(null!=this.sidebar&&null!=b)for(var g=0;g<b.length;g++)mxUtils.bind(this,function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+
"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var v=k.parentNode.previousSibling;d=v.getAttribute("title");null!=
d&&0<d.length&&".scratchpad"!=a.title&&v.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var l=document.createElement("div");l.style.position="absolute";l.style.right="0px";l.style.top="0px";l.style.padding="8px";mxClient.IS_QUIRKS||8==document.documentMode||(l.style.backgroundColor="inherit");v.style.position="relative";var p=document.createElement("img");p.setAttribute("src",Dialog.prototype.closeImage);p.setAttribute("title",mxResources.get("close"));p.setAttribute("valign","absmiddle");
p.setAttribute("border","0");p.style.margin="0 3px";var t=null;if(".scratchpad"!=a.title||this.closableScratchpad)l.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,function(){this.closeLibrary(a)});null!=t?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var q=this.editor.graph,u=null,G=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),
k,b,a,a.getMode());mxEvent.consume(c)}),B=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=u&&null!=u.parentNode&&u.parentNode.removeChild(u),u=p.cloneNode(!1),u.setAttribute("src",Editor.spinImage),u.setAttribute("title",mxResources.get("saving")),u.style.cursor="default",u.style.marginRight="2px",u.style.marginTop="-2px",l.insertBefore(u,l.firstChild),v.style.paddingRight=18*l.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=u&&null!=
u.parentNode&&(u.parentNode.removeChild(u),v.style.paddingRight=18*l.childNodes.length+"px")})):null==t&&(t=p.cloneNode(!1),t.setAttribute("src",IMAGE_PATH+"/download.png"),t.setAttribute("title",mxResources.get("save")),l.insertBefore(t,l.firstChild),mxEvent.addListener(t,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==t||a.isModified()||(v.style.paddingRight=18*l.childNodes.length+"px",t.parentNode.removeChild(t),
t=null)});mxEvent.consume(c)})),v.style.paddingRight=18*l.childNodes.length+"px")}),J=mxUtils.bind(this,function(a,c,d,e){a=q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var h=q.getCellGeometry(a[g]);null!=h&&h.translate(-c.x,-c.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);
B(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),K=mxUtils.bind(this,function(a){if(q.isSelectionEmpty())q.getRubberband().isActive()?(q.getRubberband().execute(a),q.getRubberband().reset()):this.showError(mxResources.get("error"),mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=q.getSelectionCells(),b=q.view.getBounds(c),d=q.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=q.view.translate.x;b.y-=q.view.translate.y;J(c,b)}mxEvent.consume(a)});
k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility=
"hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),k.style.cursor="default",this.sidebar.showTooltips=!0,q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,q.autoScroll=!0,K(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility=
"visible",k.style.border="3px solid transparent",k.style.cursor="",q.autoScroll=!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border="3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";k.style.cursor=
"copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.border="3px solid transparent";k.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,h,m,n,r,t,v){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),
c=[new mxCell("",new mxGeometry(0,0,m,n),c)],c[0].vertex=!0,J(c,new mxRectangle(0,0,m,n),a,mxEvent.isAltDown(a)?null:r.substring(0,r.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null);else{var l=!1,w=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var h=JSON.parse(mxUtils.getTextContent(g.documentElement));e(h,k);b=b.concat(h);B(a);this.spinner.stop();
l=!0}catch(Q){}else if("mxfile"==g.documentElement.nodeName)try{for(var m=g.documentElement.getElementsByTagName("diagram"),g=0;g<m.length;g++){var h=mxUtils.getTextContent(m[g]),n=this.stringToCells(this.editor.graph.decompress(h)),r=this.editor.graph.getBoundingBoxFromGeometry(n);J(n,new mxRectangle(0,0,r.width,r.height),a)}l=!0}catch(Q){null!=window.console&&console.log("error in drop handler:",Q)}}l||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&
null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=v&&null!=r&&(/(\.v(dx|sdx?))($|\?)/i.test(r)||/(\.vs(x|sx?))($|\?)/i.test(r))?this.importVisio(v,function(a){w(a,"text/xml")},null,r):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,r)&&null!=v?this.parseFile(v,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?w(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":
"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):w(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border="3px solid transparent",k.style.cursor="");a.stopPropagation();a.preventDefault()}));p=p.cloneNode(!1);p.setAttribute("src",Editor.editImage);p.setAttribute("title",mxResources.get("edit"));l.insertBefore(p,l.firstChild);mxEvent.addListener(p,"click",G);mxEvent.addListener(k,
"dblclick",function(a){mxEvent.getSource(a)==k&&G(a)});d=p.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));l.insertBefore(d,l.firstChild);mxEvent.addListener(d,"click",K);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||(d=document.createElement("span"),d.setAttribute("title",mxResources.get("help")),d.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d,
mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),l.insertBefore(d,l.firstChild))}v.appendChild(l);v.style.paddingRight=18*l.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var c=0;c<a.length;c++){var d=a[c],f=d.data;if(null!=f){var f=this.convertDataUri(f),e="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==d.aspect&&(e+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(e+
"image="+f,d.w,d.h,"",d.title||"",!1,!1,!0))}else null!=d.xml&&(f=this.stringToCells(this.editor.graph.decompress(d.xml)),0<f.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(f,d.w,d.h,d.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=function(a){return null!=a?a[mxLanguage]||a.main:null};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=
760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,
"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});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,EditorUi.prototype.hsplitPosition=
188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity=
"0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor="#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",
"")+(null!=r&&null!=r.stack?"&stack="+encodeURIComponent(r.stack):"")}catch(h){}this.handleError(r,mxResources.get("errorLoadingFile"),mxUtils.bind(this,function(){null!=urlParams.url&&this.spinner.spin(document.body,mxResources.get("reconnecting"))?window.location.search=this.getSearch(["url"]):null!=b?b.constructor==DriveFile&&null!=b.realtime?this.loadFile(b.getHash()):this.fileLoaded(b):d()}))}else d();return c};EditorUi.prototype.descriptorChanged=function(){};EditorUi.prototype.logEvent=function(a){if(EditorUi.enableLogging)try{var c=
null!=window.DRAWIO_LOG_URL?window.DRAWIO_LOG_URL:"";(new Image).src=c+"/images/1x1.png?v="+encodeURIComponent(EditorUi.VERSION)+(null!=a?"&data="+encodeURIComponent(JSON.stringify(a)):"")}catch(g){}};EditorUi.prototype.sendReport=function(a,b){b=null!=b?b:3E6;try{a.length>b&&(a=a.substring(0,b)+"\n...[SHORTENED]"),mxUtils.post("/email","version="+encodeURIComponent(EditorUi.VERSION)+"&url="+encodeURIComponent(window.location.href)+"&data="+encodeURIComponent(a))}catch(g){}};EditorUi.prototype.restoreLibraries=
function(){};EditorUi.prototype.saveLibrary=function(a,b,d,e,r,h,m){};EditorUi.prototype.isScratchpadEnabled=function(){return isLocalStorage||mxClient.IS_CHROMEAPP};EditorUi.prototype.toggleScratchpad=function(){this.isScratchpadEnabled()&&(null==this.scratchpad?this.getLocalData(".scratchpad",mxUtils.bind(this,function(a){null==a&&(a=this.emptyLibraryXml);this.loadLibrary(new StorageLibrary(this,a,".scratchpad"))})):this.closeLibrary(this.scratchpad))};EditorUi.prototype.createLibraryDataFromImages=
function(a){var c=mxUtils.createXmlDocument(),b=c.createElement("mxlibrary");mxUtils.setTextContent(b,JSON.stringify(a));c.appendChild(b);return mxUtils.getXml(c)};EditorUi.prototype.closeLibrary=function(a){null!=a&&(this.removeLibrarySidebar(a.getHash()),a.constructor!=LocalLibrary&&mxSettings.removeCustomLibrary(a.getHash()),".scratchpad"==a.title&&(this.scratchpad=null))};EditorUi.prototype.removeLibrarySidebar=function(a){var c=this.sidebar.palettes[a];if(null!=c){for(var b=0;b<c.length;b++)c[b].parentNode.removeChild(c[b]);
delete this.sidebar.palettes[a]}};EditorUi.prototype.repositionLibrary=function(a){var c=this.sidebar.container;if(null==a){var b=this.sidebar.palettes["L.scratchpad"];null==b&&(b=this.sidebar.palettes.search);null!=b&&(a=b[b.length-1].nextSibling)}a=null!=a?a:c.firstChild.nextSibling.nextSibling;var b=c.lastChild,d=b.previousSibling;c.insertBefore(b,a);c.insertBefore(d,b)};EditorUi.prototype.loadLibrary=function(a){var c=mxUtils.parseXml(a.getData());if("mxlibrary"==c.documentElement.nodeName){var b=
JSON.parse(mxUtils.getTextContent(c.documentElement));this.libraryLoaded(a,b,c.documentElement.getAttribute("title"))}else throw{message:mxResources.get("notALibraryFile")};};EditorUi.prototype.getLibraryStorageHint=function(a){return""};EditorUi.prototype.libraryLoaded=function(a,b,d){if(null!=this.sidebar){a.constructor!=LocalLibrary&&mxSettings.addCustomLibrary(a.getHash());".scratchpad"==a.title&&(this.scratchpad=a);var c=this.sidebar.palettes[a.getHash()],c=null!=c?c[c.length-1].nextSibling:
null;this.removeLibrarySidebar(a.getHash());var f=null,e=mxUtils.bind(this,function(c,b){0==c.length&&a.isEditable()?(null==f&&(f=document.createElement("div"),mxUtils.setPrefixedStyle(f.style,"borderRadius","6px"),f.style.border="3px dotted lightGray",f.style.textAlign="center",f.style.padding="8px",f.style.color="#B3B3B3",mxUtils.write(f,mxResources.get("dragElementsHere"))),b.appendChild(f)):this.addLibraryEntries(c,b)});if(null!=this.sidebar&&null!=b)for(var g=0;g<b.length;g++)mxUtils.bind(this,
function(a){var c=a.data;null!=c&&null!=a.title?this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){c=this.convertDataUri(c);var b="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==a.aspect&&(b+="aspect=fixed;");return this.sidebar.createVertexTemplate(b+"image="+c,a.w,a.h,"",a.title||"",!1,!1,!0)})):null!=a.xml&&null!=a.title&&this.sidebar.addEntry(a.title,mxUtils.bind(this,function(){var c=this.stringToCells(this.editor.graph.decompress(a.xml));return this.sidebar.createVertexTemplateFromCells(c,
a.w,a.h,a.title||"",!0,!1,!0)}))})(b[g]);d=null!=d&&0<d.length?d:a.getTitle();var k=this.sidebar.addPalette(a.getHash(),d,!0,mxUtils.bind(this,function(a){e(b,a)}));this.repositionLibrary(c);var v=k.parentNode.previousSibling;d=v.getAttribute("title");null!=d&&0<d.length&&".scratchpad"!=a.title&&v.setAttribute("title",this.getLibraryStorageHint(a)+"\n"+d);var l=document.createElement("div");l.style.position="absolute";l.style.right="0px";l.style.top="0px";l.style.padding="8px";mxClient.IS_QUIRKS||
8==document.documentMode||(l.style.backgroundColor="inherit");v.style.position="relative";var p=document.createElement("img");p.setAttribute("src",Dialog.prototype.closeImage);p.setAttribute("title",mxResources.get("close"));p.setAttribute("valign","absmiddle");p.setAttribute("border","0");p.style.margin="0 3px";var t=null;if(".scratchpad"!=a.title||this.closableScratchpad)l.appendChild(p),mxEvent.addListener(p,"click",mxUtils.bind(this,function(c){if(!mxEvent.isConsumed(c)){var b=mxUtils.bind(this,
function(){this.closeLibrary(a)});null!=t?this.confirm(mxResources.get("allChangesLost"),null,b,mxResources.get("cancel"),mxResources.get("discardChanges")):b();mxEvent.consume(c)}}));if(a.isEditable()){var q=this.editor.graph,u=null,G=mxUtils.bind(this,function(c){this.showLibraryDialog(a.getTitle(),k,b,a,a.getMode());mxEvent.consume(c)}),B=mxUtils.bind(this,function(c){a.setModified(!0);a.isAutosave()?(null!=u&&null!=u.parentNode&&u.parentNode.removeChild(u),u=p.cloneNode(!1),u.setAttribute("src",
Editor.spinImage),u.setAttribute("title",mxResources.get("saving")),u.style.cursor="default",u.style.marginRight="2px",u.style.marginTop="-2px",l.insertBefore(u,l.firstChild),v.style.paddingRight=18*l.childNodes.length+"px",this.saveLibrary(a.getTitle(),b,a,a.getMode(),!0,!0,function(){null!=u&&null!=u.parentNode&&(u.parentNode.removeChild(u),v.style.paddingRight=18*l.childNodes.length+"px")})):null==t&&(t=p.cloneNode(!1),t.setAttribute("src",IMAGE_PATH+"/download.png"),t.setAttribute("title",mxResources.get("save")),
l.insertBefore(t,l.firstChild),mxEvent.addListener(t,"click",mxUtils.bind(this,function(c){this.saveLibrary(a.getTitle(),b,a,a.getMode(),a.constructor==LocalLibrary,!0,function(){null==t||a.isModified()||(v.style.paddingRight=18*l.childNodes.length+"px",t.parentNode.removeChild(t),t=null)});mxEvent.consume(c)})),v.style.paddingRight=18*l.childNodes.length+"px")}),J=mxUtils.bind(this,function(a,c,d,e){a=q.cloneCells(mxUtils.sortCells(q.model.getTopmostCells(a)));for(var g=0;g<a.length;g++){var h=q.getCellGeometry(a[g]);
null!=h&&h.translate(-c.x,-c.y)}k.appendChild(this.sidebar.createVertexTemplateFromCells(a,c.width,c.height,e||"",!0,!1,!1));a={xml:this.editor.graph.compress(mxUtils.getXml(this.editor.graph.encodeCells(a))),w:c.width,h:c.height};null!=e&&(a.title=e);b.push(a);B(d);null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)}),K=mxUtils.bind(this,function(a){if(q.isSelectionEmpty())q.getRubberband().isActive()?(q.getRubberband().execute(a),q.getRubberband().reset()):this.showError(mxResources.get("error"),
mxResources.get("nothingIsSelected"),mxResources.get("ok"));else{var c=q.getSelectionCells(),b=q.view.getBounds(c),d=q.view.scale;b.x/=d;b.y/=d;b.width/=d;b.height/=d;b.x-=q.view.translate.x;b.y-=q.view.translate.y;J(c,b)}mxEvent.consume(a)});k.style.border="3px solid transparent";mxEvent.addGestureListeners(k,function(){},mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="hidden",null!=f?f.style.border="3px dotted rgb(254, 137, 12)":
k.style.border="3px dotted rgb(254, 137, 12)",k.style.cursor="copy",q.panningManager.stop(),q.autoScroll=!1,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!1),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="hidden"),mxEvent.consume(a))}),mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.panningManager&&null!=q.graphHandler&&(k.style.border="3px solid transparent",null!=f&&(f.style.border="3px dotted lightGray"),k.style.cursor="default",this.sidebar.showTooltips=!0,
q.panningManager.stop(),q.graphHandler.reset(),q.isMouseDown=!1,q.autoScroll=!0,K(a),mxEvent.consume(a))}));mxEvent.addListener(k,"mouseleave",mxUtils.bind(this,function(a){q.isMouseDown&&null!=q.graphHandler.shape&&(q.graphHandler.shape.node.style.visibility="visible",k.style.border="3px solid transparent",k.style.cursor="",q.autoScroll=!0,null!=q.graphHandler.guide&&q.graphHandler.guide.setVisible(!0),null!=q.graphHandler.hint&&(q.graphHandler.hint.style.visibility="visible"),null!=f&&(f.style.border=
"3px dotted lightGray"))}));Graph.fileSupport&&(mxEvent.addListener(k,"dragover",mxUtils.bind(this,function(a){null!=f?f.style.border="3px dotted rgb(254, 137, 12)":k.style.border="3px dotted rgb(254, 137, 12)";a.dataTransfer.dropEffect="copy";k.style.cursor="copy";this.sidebar.hideTooltip();a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"drop",mxUtils.bind(this,function(a){k.style.border="3px solid transparent";k.style.cursor="";null!=f&&(f.style.border="3px dotted lightGray");0<
a.dataTransfer.files.length&&this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,mxUtils.bind(this,function(c,d,g,h,m,n,r,t,v){if(null!=c&&"image/"==d.substring(0,6))c="shape=image;verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;image="+this.convertDataUri(c),c=[new mxCell("",new mxGeometry(0,0,m,n),c)],c[0].vertex=!0,J(c,new mxRectangle(0,0,m,n),a,mxEvent.isAltDown(a)?null:r.substring(0,r.lastIndexOf(".")).replace(/_/g," ")),null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),
f=null);else{var l=!1,w=mxUtils.bind(this,function(c,d){if(null!=c&&"text/xml"==d){var g=mxUtils.parseXml(c);if("mxlibrary"==g.documentElement.nodeName)try{var h=JSON.parse(mxUtils.getTextContent(g.documentElement));e(h,k);b=b.concat(h);B(a);this.spinner.stop();l=!0}catch(Q){}else if("mxfile"==g.documentElement.nodeName)try{for(var m=g.documentElement.getElementsByTagName("diagram"),g=0;g<m.length;g++){var h=mxUtils.getTextContent(m[g]),n=this.stringToCells(this.editor.graph.decompress(h)),r=this.editor.graph.getBoundingBoxFromGeometry(n);
J(n,new mxRectangle(0,0,r.width,r.height),a)}l=!0}catch(Q){null!=window.console&&console.log("error in drop handler:",Q)}}l||(this.spinner.stop(),this.handleError({message:mxResources.get("errorLoadingFile")}));null!=f&&null!=f.parentNode&&0<b.length&&(f.parentNode.removeChild(f),f=null)});null!=v&&null!=r&&(/(\.v(dx|sdx?))($|\?)/i.test(r)||/(\.vs(x|sx?))($|\?)/i.test(r))?this.importVisio(v,function(a){w(a,"text/xml")},null,r):!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(c,
r)&&null!=v?this.parseFile(v,mxUtils.bind(this,function(a){4==a.readyState&&(this.spinner.stop(),200<=a.status&&299>=a.status?w(a.responseText,"text/xml"):this.handleError({message:mxResources.get(413==a.status?"drawingTooLarge":"invalidOrMissingFile")},mxResources.get("errorLoadingFile")))})):w(c,d)}}));a.stopPropagation();a.preventDefault()})),mxEvent.addListener(k,"dragleave",function(a){null!=f?f.style.border="3px dotted lightGray":(k.style.border="3px solid transparent",k.style.cursor="");a.stopPropagation();
a.preventDefault()}));p=p.cloneNode(!1);p.setAttribute("src",Editor.editImage);p.setAttribute("title",mxResources.get("edit"));l.insertBefore(p,l.firstChild);mxEvent.addListener(p,"click",G);mxEvent.addListener(k,"dblclick",function(a){mxEvent.getSource(a)==k&&G(a)});d=p.cloneNode(!1);d.setAttribute("src",Editor.plusImage);d.setAttribute("title",mxResources.get("add"));l.insertBefore(d,l.firstChild);mxEvent.addListener(d,"click",K);this.isOffline()||".scratchpad"!=a.title||null==EditorUi.scratchpadHelpLink||
(d=document.createElement("span"),d.setAttribute("title",mxResources.get("help")),d.style.cssText="color:#a3a3a3;text-decoration:none;margin-right:2px;",mxUtils.write(d,"?"),mxEvent.addGestureListeners(d,mxUtils.bind(this,function(a){this.openLink(EditorUi.scratchpadHelpLink);mxEvent.consume(a)})),l.insertBefore(d,l.firstChild))}v.appendChild(l);v.style.paddingRight=18*l.childNodes.length+"px"}};EditorUi.prototype.addLibraryEntries=function(a,b){for(var c=0;c<a.length;c++){var d=a[c],f=d.data;if(null!=
f){var f=this.convertDataUri(f),e="shape=image;verticalLabelPosition=bottom;verticalAlign=top;imageAspect=0;";"fixed"==d.aspect&&(e+="aspect=fixed;");b.appendChild(this.sidebar.createVertexTemplate(e+"image="+f,d.w,d.h,"",d.title||"",!1,!1,!0))}else null!=d.xml&&(f=this.stringToCells(this.editor.graph.decompress(d.xml)),0<f.length&&b.appendChild(this.sidebar.createVertexTemplateFromCells(f,d.w,d.h,d.title||"",!0,!1,!0)))}};EditorUi.prototype.getResource=function(a){return null!=a?a[mxLanguage]||a.main:
null};"1"==urlParams.offline||EditorUi.isElectronApp?EditorUi.prototype.footerHeight=4:("1"==urlParams.savesidebar&&(Sidebar.prototype.thumbWidth=64,Sidebar.prototype.thumbHeight=64),EditorUi.prototype.footerHeight=760<=screen.width&&240<=screen.height?46:0,EditorUi.prototype.createFooter=function(){var a=document.getElementById("geFooter");if(null!=a){a.style.visibility="visible";var b=document.createElement("img");b.setAttribute("border","0");b.setAttribute("src",Dialog.prototype.closeImage);b.setAttribute("title",
mxResources.get("hide"));a.appendChild(b);mxClient.IS_QUIRKS&&(b.style.position="relative",b.style.styleFloat="right",b.style.top="-30px",b.style.left="164px",b.style.cursor="pointer");mxEvent.addListener(b,"click",mxUtils.bind(this,function(){this.hideFooter()}))}return a});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,EditorUi.prototype.hsplitPosition=188,Sidebar.prototype.thumbWidth=46,Sidebar.prototype.thumbHeight=46,Sidebar.prototype.thumbPadding=5<=document.documentMode?0:1,Sidebar.prototype.thumbBorder=2):"dark"==uiTheme&&(mxClient.link("stylesheet",STYLE_PATH+"/dark.css"),Dialog.backdropColor="#2a2a2a",Graph.prototype.defaultThemeName="darkTheme",
Graph.prototype.defaultPageBackgroundColor="#2a2a2a",Graph.prototype.defaultGraphBackground=null,Graph.prototype.defaultPageBorderColor="#505759",Graph.prototype.svgShadowColor="#e0e0e0",Graph.prototype.svgShadowOpacity="0.6",Graph.prototype.svgShadowSize="0.8",Graph.prototype.svgShadowBlur="1.4",Format.prototype.inactiveTabBackgroundColor="black",BaseFormatPanel.prototype.buttonBackgroundColor="#2a2a2a",Sidebar.prototype.dragPreviewBorder="1px dashed #cccccc",mxGraphHandler.prototype.previewColor=
"#cccccc",StyleFormatPanel.prototype.defaultStrokeColor="#cccccc",mxClient.IS_SVG&&(Editor.helpImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAP1BMVEUAAAD///////////////////////////////////////////////////////////////////////////////9Du/pqAAAAFXRSTlMAT30qCJRBboyDZyCgRzUUdF46MJlgXETgAAAAeklEQVQY022O2w4DIQhEQUURda/9/28tUO2+7CQS5sgQ4F1RapX78YUwRqQjTU8ILqQfKerTKTvACJ4nLX3krt+8aS82oI8aQC4KavRgtvEW/mDvsICgA03PSGRr79MqX1YPNIxzjyqtw8ZnnRo4t5a5undtJYRywau+ds4Cyza3E6YAAAAASUVORK5CYII=",
Editor.checkmarkImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAMAAACeyVWkAAAARVBMVEUAAACZmZkICAgEBASNjY2Dg4MYGBiTk5N5eXl1dXVmZmZQUFBCQkI3NzceHh4MDAykpKSJiYl+fn5sbGxaWlo/Pz8SEhK96uPlAAAAAXRSTlMAQObYZgAAAE5JREFUGNPFzTcSgDAQQ1HJGUfy/Y9K7V1qeOUfzQifCQZai1XHaz11LFysbDbzgDSSWMZiETz3+b8yNUc/MMsktxuC8XQBSncdLwz+8gCCggGXzBcozAAAAABJRU5ErkJggg=="))};EditorUi.initTheme();EditorUi.prototype.hideFooter=function(){var a=document.getElementById("geFooter");null!=a&&(this.footerHeight=0,a.style.display=
"none",this.refresh())};EditorUi.prototype.showFooter=function(a){var c=document.getElementById("geFooter");null!=c&&(this.footerHeight=a,c.style.display="inline",this.refresh())};EditorUi.prototype.showImageDialog=function(a,b,d,e,k){a=new ImageDialog(this,a,b,d,e,k);this.showDialog(a.container,Graph.fileSupport?440:360,Graph.fileSupport?200:90,!0,!0);a.init()};EditorUi.prototype.showBackgroundImageDialog=function(a){a=null!=a?a:mxUtils.bind(this,function(a){a=new ChangePageSetup(this,null,a);a.ignoreColor=
!0;this.editor.graph.model.execute(a)});var c=new BackgroundImageDialog(this,mxUtils.bind(this,function(c){a(c)}));this.showDialog(c.container,360,200,!0,!0);c.init()};EditorUi.prototype.showLibraryDialog=function(a,b,d,e,k){a=new LibraryDialog(this,a,b,d,e,k);this.showDialog(a.container,620,440,!0,!1,mxUtils.bind(this,function(a){a&&null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.showSplash()}));a.init()};EditorUi.prototype.createSidebarFooterContainer=function(){var a=this.createDiv("geSidebarContainer");
@ -3011,19 +3011,19 @@ f,g,this.maxImageSize,null,null,null,null,mxEvent.isControlDown(a),null,null,mxE
null!=d&&1==d.length?(k=d[0].getAttribute("src"),/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(k)||(m=!0)):(c=c.getElementsByTagName("a"),null!=c&&1==c.length&&(k=c[0].getAttribute("href")));var n=!0,l=mxUtils.bind(this,function(){b.setSelectionCells(this.insertTextAt(k,f,g,!0,m,null,n))});m&&k.length>this.resampleThreshold?this.confirmImageResize(function(a){n=a;l()},mxEvent.isControlDown(a)):l()}else null!=h&&/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(h)?this.loadImage(decodeURIComponent(h),mxUtils.bind(this,
function(a){var c=Math.max(1,a.width);a=Math.max(1,a.height);var d=this.maxImageSize,d=Math.min(1,Math.min(d/Math.max(1,c)),d/Math.max(1,a));b.setSelectionCell(b.insertVertex(null,null,"",f,g,c*d,a*d,"shape=image;verticalLabelPosition=bottom;labelBackgroundColor=#ffffff;verticalAlign=top;aspect=fixed;imageAspect=0;image="+h+";"))}),mxUtils.bind(this,function(a){b.setSelectionCells(this.insertTextAt(h,f,g,!0))})):0<=mxUtils.indexOf(a.dataTransfer.types,"text/plain")&&b.setSelectionCells(this.insertTextAt(a.dataTransfer.getData("text/plain"),
f,g,!0))}}a.stopPropagation();a.preventDefault()}),!1)}this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.getLinkTitle=function(a){var c=Graph.prototype.getLinkTitle.apply(this,arguments);if("data:page/id,"==a.substring(0,13)){var b=a.indexOf(",");0<b&&(c=this.getPageById(a.substring(b+1)),c=null!=c?c.getName():mxResources.get("pageNotFound"))}else"data:"==a.substring(0,5)&&(c=mxResources.get("action"));return c};EditorUi.prototype.handleCustomLink=
function(a){if("data:page/id,"==a.substring(0,13)){var c=a.indexOf(",");if(a=this.getPageById(a.substring(c+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();
function(a){if("data:page/id,"==a.substring(0,13)){var b=a.indexOf(",");if(a=this.getPageById(a.substring(b+1)))this.selectPage(a);else throw Error(mxResources.get("pageNotFound")||"Page not found");}else this.editor.graph.handleCustomLink(a)};EditorUi.prototype.isSettingsEnabled=function(){return"undefined"!==typeof window.mxSettings&&(isLocalStorage||mxClient.IS_CHROMEAPP)};EditorUi.prototype.installSettings=function(){if(this.isSettingsEnabled()){ColorDialog.recentColors=mxSettings.getRecentColors();
this.fireEvent(new mxEventObject("styleChanged","keys",[],"values",[],"cells",[]));this.editor.graph.connectionHandler.setCreateTarget(mxSettings.isCreateTarget());this.fireEvent(new mxEventObject("copyConnectChanged"));this.addListener("copyConnectChanged",mxUtils.bind(this,function(a,b){mxSettings.setCreateTarget(this.editor.graph.connectionHandler.isCreateTarget());mxSettings.save()}));this.editor.graph.pageFormat=mxSettings.getPageFormat();this.addListener("pageFormatChanged",mxUtils.bind(this,
function(a,b){mxSettings.setPageFormat(this.editor.graph.pageFormat);mxSettings.save()}));this.editor.graph.view.gridColor=mxSettings.getGridColor();this.addListener("gridColorChanged",mxUtils.bind(this,function(a,b){mxSettings.setGridColor(this.editor.graph.view.gridColor);mxSettings.save()}));if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp)this.editor.addListener("autosaveChanged",mxUtils.bind(this,function(a,b){mxSettings.setAutosave(this.editor.autosave);mxSettings.save()})),this.editor.autosave=
mxSettings.getAutosave();null!=this.sidebar&&this.sidebar.showPalette("search",mxSettings.settings.search);this.editor.chromeless&&!this.editor.editable||null==this.sidebar||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save());this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyCells=function(a,b){var c=this.editor.graph;if(c.isSelectionEmpty())a.innerHTML=
"";else{var d=mxUtils.sortCells(c.model.getTopmostCells(c.getSelectionCells())),e=mxUtils.getXml(this.editor.graph.encodeCells(d));mxUtils.setTextContent(a,encodeURIComponent(e));b?(c.removeCells(d,!1),c.lastPasteXml=null):(c.lastPasteXml=e,c.pasteCounter=0);a.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.pasteCells=function(a,b){if(!mxEvent.isConsumed(a)){var c=b.getElementsByTagName("span");if(null!=c&&0<c.length&&"application/vnd.lucid.chart.objects"===c[0].getAttribute("data-lucid-type")){var d=
c[0].getAttribute("data-lucid-content");null!=d&&0<d.length&&(this.convertLucidChart(d,mxUtils.bind(this,function(a){this.editor.graph.setSelectionCells(this.importXml(a,0,0))}),mxUtils.bind(this,function(a){this.handleError(a)})),mxEvent.consume(a))}else{var d=this.editor.graph,e=mxUtils.trim(mxClient.IS_QUIRKS||8==document.documentMode?mxUtils.getTextContent(b):b.textContent),f=!1;try{var k=e.lastIndexOf("%3E");0<=k&&k<e.length-3&&(e=e.substring(0,k+3))}catch(v){}try{var c=b.getElementsByTagName("span"),
l=null!=c&&0<c.length?mxUtils.trim(decodeURIComponent(c[0].textContent)):decodeURIComponent(e);this.isCompatibleString(l)&&(f=!0,e=l)}catch(v){}d.lastPasteXml==e?d.pasteCounter++:(d.lastPasteXml=e,d.pasteCounter=0);c=d.pasteCounter*d.gridSize;if(null!=e&&0<e.length&&(f||this.isCompatibleString(e)?d.setSelectionCells(this.importXml(e,c,c)):(f=d.getInsertPoint(),d.isMouseInsertPoint()&&(c=0,d.lastPasteXml==e&&0<d.pasteCounter&&d.pasteCounter--),d.setSelectionCells(this.insertTextAt(e,f.x+c,f.y+c,!0))),
!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(v){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var c=null,b=0;b<a.length;b++)mxEvent.addListener(a[b],"dragleave",function(a){null!=c&&(c.parentNode.removeChild(c),c=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[b],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||
"1"!=urlParams.embed)&&null==c&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(c=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[b],"drop",mxUtils.bind(this,function(a){null!=c&&(c.parentNode.removeChild(c),c=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 b=this.extractGraphModelFromEvent(a);if(null==b){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?b=d.getData("Text"):(b=null,b=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=b&&0<b.length?(d=document.createElement("div"),d.innerHTML=b,d=d.getElementsByTagName("img"),
0<d.length&&(b=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(b=d.getData("text/plain"))),null!=b&&("data:image/png;base64,"==b.substring(0,22)?(b=this.extractGraphModelFromPng(b),null!=b&&0<b.length&&this.openLocalFile(b,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(b)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(b))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(b)&&
(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(b):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(b)))))}else this.openLocalFile(b,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var b=0,c=0,d,e;if(null==a){e=document.body;var h=document.documentElement;d=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-
3}else b=a.offsetTop,c=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=b+"px";h.style.left=c+"px";h.style.width=Math.max(0,d-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=
!d.isSelectionEmpty())){d.scrollCellToVisible(d.getSelectionCell());null!=this.hoverIcons&&this.hoverIcons.update(d.view.getState(d.getSelectionCell()));try{mxEvent.consume(a)}catch(v){}}}}};EditorUi.prototype.addFileDropHandler=function(a){if(Graph.fileSupport)for(var b=null,c=0;c<a.length;c++)mxEvent.addListener(a[c],"dragleave",function(a){null!=b&&(b.parentNode.removeChild(b),b=null);a.stopPropagation();a.preventDefault()}),mxEvent.addListener(a[c],"dragover",mxUtils.bind(this,function(a){(this.editor.graph.isEnabled()||
"1"!=urlParams.embed)&&null==b&&(!mxClient.IS_IE||10<document.documentMode&&12>document.documentMode)&&(b=this.highlightElement());a.stopPropagation();a.preventDefault()})),mxEvent.addListener(a[c],"drop",mxUtils.bind(this,function(a){null!=b&&(b.parentNode.removeChild(b),b=null);if(this.editor.graph.isEnabled()||"1"!=urlParams.embed)if(0<a.dataTransfer.files.length)this.hideDialog(),"1"==urlParams.embed?this.importFiles(a.dataTransfer.files,0,0,this.maxImageSize,null,null,null,null,!mxEvent.isControlDown(a)&&
!mxEvent.isShiftDown(a)):this.openFiles(a.dataTransfer.files,!0);else{var c=this.extractGraphModelFromEvent(a);if(null==c){var d=null!=a.dataTransfer?a.dataTransfer:a.clipboardData;null!=d&&(10==document.documentMode||11==document.documentMode?c=d.getData("Text"):(c=null,c=0<=mxUtils.indexOf(d.types,"text/uri-list")?a.dataTransfer.getData("text/uri-list"):0<=mxUtils.indexOf(d.types,"text/html")?d.getData("text/html"):null,null!=c&&0<c.length?(d=document.createElement("div"),d.innerHTML=c,d=d.getElementsByTagName("img"),
0<d.length&&(c=d[0].getAttribute("src"))):0<=mxUtils.indexOf(d.types,"text/plain")&&(c=d.getData("text/plain"))),null!=c&&("data:image/png;base64,"==c.substring(0,22)?(c=this.extractGraphModelFromPng(c),null!=c&&0<c.length&&this.openLocalFile(c,null,!0)):!this.isOffline()&&this.isRemoteFileFormat(c)?(new mxXmlRequest(OPEN_URL,"format=xml&data="+encodeURIComponent(c))).send(mxUtils.bind(this,function(a){200<=a.getStatus()&&299>=a.getStatus()&&this.openLocalFile(a.getText(),null,!0)})):/^https?:\/\//.test(c)&&
(null==this.getCurrentFile()?window.location.hash="#U"+encodeURIComponent(c):window.openWindow((mxClient.IS_CHROMEAPP?"https://www.draw.io/":"https://"+location.host+"/")+window.location.search+"#U"+encodeURIComponent(c)))))}else this.openLocalFile(c,null,!0)}a.stopPropagation();a.preventDefault()}))};EditorUi.prototype.highlightElement=function(a){var c=0,b=0,d,e;if(null==a){e=document.body;var h=document.documentElement;d=(e.clientWidth||h.clientWidth)-3;e=Math.max(e.clientHeight||0,h.clientHeight)-
3}else c=a.offsetTop,b=a.offsetLeft,d=a.clientWidth,e=a.clientHeight;h=document.createElement("div");h.style.zIndex=mxPopupMenu.prototype.zIndex+2;h.style.border="3px dotted rgb(254, 137, 12)";h.style.pointerEvents="none";h.style.position="absolute";h.style.top=c+"px";h.style.left=b+"px";h.style.width=Math.max(0,d-3)+"px";h.style.height=Math.max(0,e-3)+"px";null!=a&&a.parentNode==this.editor.graph.container?this.editor.graph.container.appendChild(h):document.body.appendChild(h);return h};EditorUi.prototype.stringToCells=
function(a){a=mxUtils.parseXml(a);var b=this.editor.extractGraphModel(a.documentElement);a=[];if(null!=b){var c=new mxCodec(b.ownerDocument),d=new mxGraphModel;c.decode(b,d);b=d.getChildAt(d.getRoot(),0);for(c=0;c<d.getChildCount(b);c++)a.push(d.getChildAt(b,c))}return a};EditorUi.prototype.openFiles=function(a,b){if(this.spinner.spin(document.body,mxResources.get("loading")))for(var c=0;c<a.length;c++)mxUtils.bind(this,function(a){var c=new FileReader;c.onload=mxUtils.bind(this,function(c){var d=
c.target.result,e=a.name;if(null!=e&&0<e.length){!this.useCanvasForExport&&/(\.png)$/i.test(e)&&(e=e.substring(0,e.length-4)+".xml");var f=mxUtils.bind(this,function(a){e=0<=e.lastIndexOf(".")?e.substring(0,e.lastIndexOf("."))+".xml":e+".xml";if("<mxlibrary"==a.substring(0,10)){null==this.getCurrentFile()&&"1"!=urlParams.embed&&this.openLocalFile(this.emptyDiagramXml,this.defaultFilename,b);try{this.loadLibrary(new LocalLibrary(this,a,e))}catch(y){this.handleError(y,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(Graph.fileSupport&&!this.isOffline()&&(new XMLHttpRequest).upload&&this.isRemoteFileFormat(d,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")))}));
@ -3215,19 +3215,19 @@ c.showImportCsvDialog()}));c.actions.put("importText",new Action(mxResources.get
new Action(mxResources.get("format")+"...",function(){a(c)}));EditorUi.enablePlantUml&&!c.isOffline()&&c.actions.put("plantUml",new Action(mxResources.get("plantUml")+"...",function(){var a=new ParseDialog(c,"Insert from Text","plantUml");c.showDialog(a.container,620,420,!0,!1);a.init()}));this.put("diagram",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();c.menus.addSubmenu("extras",a,b,mxResources.get("preferences"));a.addSeparator(b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?
c.menus.addMenuItems(a,"new open - save saveAs -".split(" "),b):"1"==urlParams.embed?(c.menus.addMenuItems(a,["-","save"],b),"1"==urlParams.saveAndExit&&c.menus.addMenuItems(a,["saveAndExit"],b),a.addSeparator(b)):(c.menus.addMenuItems(a,["new"],b),c.menus.addSubmenu("openFrom",a,b),a.addSeparator(b),c.menus.addSubmenu("save",a,b));c.menus.addSubmenu("exportAs",a,b);null!=d&&d.constructor==DriveFile&&(c.menus.addMenuItems(a,["-","share"],b),null!=d.realtime?c.menus.addMenuItems(a,["chatWindowTitle"],
b):c.menus.addMenuItems(a,["-","refresh"],b),a.addSeparator(b));c.menus.addMenuItems(a,"- outline layers - find tags".split(" "),b);mxClient.IS_IOS&&navigator.standalone||c.menus.addMenuItems(a,["-","print","-"],b);c.menus.addSubmenu("help",a,b);"1"==urlParams.embed?c.menus.addMenuItems(a,["-","exit"],b):c.menus.addMenuItems(a,["-","close"])})));if(isLocalStorage){var e=this.get("openFrom"),f=e.funct;e.funct=function(a,b){f.apply(this,arguments);a.addSeparator(b);c.menus.addSubmenu("openRecent",a,
b)}}this.put("save",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile?c.menus.addMenuItems(a,["createRevision","makeCopy","-","rename","moveToFolder"],b):(c.menus.addMenuItems(a,["save","saveAs","-","rename"],b),c.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&this.addMenuItems(a,["upload"],b):c.menus.addMenuItems(a,["makeCopy"],b));null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||c.menus.addMenuItems(a,["-","revisionHistory"],
b);c.menus.addMenuItems(a,["-","autosave"],b)})));var g=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){g.funct(a,b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||c.menus.addMenuItems(a,["publishLink"],b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",a,b);null!=h&&c.menus.addSubmenu("language",a,b);a.addSeparator(b);c.menus.addMenuItems(a,
["scrollbars","tooltips"],b);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],b);!c.isOfflineApp()&&isLocalStorage&&(a.addSeparator(b),c.menus.addMenuItem(a,"plugins",b))})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),b)})));mxResources.parse("insertLayout="+mxResources.get("layout"));
mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,["import"],b):c.menus.addSubmenu("importFrom",a,b);a.addSeparator(b);c.menus.addSubmenu("insertLayout",a,b);c.menus.addSubmenu("insertAdvanced",a,b)})));var k="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),
l=function(a,b,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(c,d,e);c.showDialog(a.container,620,420,!0,!1);a.init()}),b)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<k.length;c++)"-"==k[c]?a.addSeparator(b):l(a,b,mxResources.get(k[c])+"...",k[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"grid guides - connectionArrows connectionPoints -".split(" "),b);if("undefined"!==typeof MathJax){var d=
c.menus.addMenuItem(a,"mathematicalTypesetting",b);c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}c.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],b)})))};var h=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var e=g.menus.get(a),f=p.addMenu(mxResources.get(a),mxUtils.bind(this,function(){e.funct.apply(this,arguments)}),n);f.className="geMenuItem";f.style.display="inline-block";f.style.boxSizing="border-box";
f.style.top="6px";f.style.marginRight="6px";f.style.height="30px";f.style.paddingTop="6px";f.style.paddingBottom="6px";f.setAttribute("title",mxResources.get(a));g.menus.menuCreated(e,f,"geMenuItem");null!=c?(f.style.backgroundImage="url("+c+")",f.style.backgroundPosition="center center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="24px 24px",f.style.width="34px",f.innerHTML="",mxUtils.setOpacity(f,d||40)):b||(f.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",f.style.backgroundPosition=
"right 6px center",f.style.backgroundRepeat="no-repeat",f.style.paddingRight="22px");return f}function b(a,b,c,d,e,f){var h=document.createElement("a");h.setAttribute("href","javascript:void(0)");h.className="geMenuItem";h.style.display="inline-block";h.style.boxSizing="border-box";h.style.height="30px";h.style.padding="6px";h.style.position="relative";h.style.verticalAlign="top";h.style.top="0px";null!=g.statusContainer?l.insertBefore(h,g.statusContainer):l.appendChild(h);null!=f?(h.style.backgroundImage=
"url("+f+")",h.style.backgroundPosition="center center",h.style.backgroundRepeat="no-repeat",h.style.backgroundSize="24px 24px",h.style.width="34px"):mxUtils.write(h,a);mxEvent.addListener(h,"click",function(a){"disabled"!=h.getAttribute("disabled")&&b(a);mxEvent.consume(a)});null==c&&(h.style.marginRight="4px");null!=d&&h.setAttribute("title",d);mxUtils.setOpacity(h,null!=f?40:100);null!=e&&(a=function(){e.isEnabled()?(h.removeAttribute("disabled"),mxUtils.setOpacity(h,null!=f?40:100),h.style.cursor=
""):(h.setAttribute("disabled","disabled"),mxUtils.setOpacity(h,null!=f?10:20),h.style.cursor="default")},e.addListener("stateChanged",a),a());return h}function c(a){var b=document.createElement("div");b.className="geMenuItem";b.style.display="inline-block";b.style.verticalAlign="top";b.style.marginRight="6px";b.style.padding="0 4px 0 4px";b.style.height="30px";b.style.position="relative";b.style.top="0px";for(var c=0;c<a.length;c++)null!=a[c]&&(a[c].style.margin="0px",a[c].style.boxShadow="none",
b.appendChild(a[c]));null!=g.statusContainer?l.insertBefore(b,g.statusContainer):l.appendChild(b);return b}function d(){for(var d=l.firstChild;null!=d;){var f=d.nextSibling;"geMenuItem"!=d.className&&"geItem"!=d.className||d.parentNode.removeChild(d);d=f}n=l.firstChild;e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;(d=900>e)||a("diagram");c([d?a("diagram",null,IMAGE_PATH+"/drawlogo-gray.svg",100):null,b(mxResources.get("shapes"),g.actions.get("toggleShapes").funct,
null,mxResources.get("shapes"),g.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),b(mxResources.get("format"),g.actions.get("toggleFormat").funct,null,mxResources.get("format")+" ("+g.actions.get("formatPanel").shortcut+")",g.actions.get("image"),
d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==":
b)}}this.put("save",new Menu(mxUtils.bind(this,function(a,b){var d=c.getCurrentFile();null!=d&&d.constructor==DriveFile?(null==d.realtime?c.menus.addMenuItems(a,["save"],b):c.menus.addMenuItems(a,["createRevision"],b),c.menus.addMenuItems(a,["makeCopy","-","rename","moveToFolder"],b)):(c.menus.addMenuItems(a,["save","saveAs","-","rename"],b),c.isOfflineApp()?navigator.onLine&&"1"!=urlParams.stealth&&this.addMenuItems(a,["upload"],b):c.menus.addMenuItems(a,["makeCopy"],b));c.menus.addMenuItems(a,["-",
"autosave"],b);null==d||d.constructor!=DriveFile&&d.constructor!=DropboxFile||c.menus.addMenuItems(a,["-","revisionHistory"],b)})));var g=this.get("exportAs");this.put("exportAs",new Menu(mxUtils.bind(this,function(a,b){g.funct(a,b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||c.menus.addMenuItems(a,["publishLink"],b);a.addSeparator(b);c.menus.addSubmenu("embed",a,b)})));var h=this.get("language");this.put("extras",new Menu(mxUtils.bind(this,function(a,b){"1"!=urlParams.embed&&c.menus.addSubmenu("theme",
a,b);null!=h&&c.menus.addSubmenu("language",a,b);a.addSeparator(b);c.menus.addMenuItems(a,["scrollbars","tooltips"],b);"1"!=urlParams.embed&&(isLocalStorage||mxClient.IS_CHROMEAPP)&&c.menus.addMenuItems(a,["-","search","scratchpad","-","showStartScreen"],b);!c.isOfflineApp()&&isLocalStorage&&(a.addSeparator(b),c.menus.addMenuItem(a,"plugins",b))})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"importText plantUml - formatSql importCsv - createShape editDiagram".split(" "),
b)})));mxResources.parse("insertLayout="+mxResources.get("layout"));mxResources.parse("insertAdvanced="+mxResources.get("advanced"));this.put("insert",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,"insertRectangle insertEllipse insertRhombus - insertText insertLink - insertImage".split(" "),b);mxClient.IS_CHROMEAPP||EditorUi.isElectronApp?c.menus.addMenuItems(a,["import"],b):c.menus.addSubmenu("importFrom",a,b);a.addSeparator(b);c.menus.addSubmenu("insertLayout",a,b);c.menus.addSubmenu("insertAdvanced",
a,b)})));var k="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),l=function(a,b,d,e){a.addItem(d,null,mxUtils.bind(this,function(){var a=new CreateGraphDialog(c,d,e);c.showDialog(a.container,620,420,!0,!1);a.init()}),b)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(a,b){for(var c=0;c<k.length;c++)"-"==k[c]?a.addSeparator(b):l(a,b,mxResources.get(k[c])+"...",k[c])})));this.put("view",new Menu(mxUtils.bind(this,function(a,b){c.menus.addMenuItems(a,
"grid guides - connectionArrows connectionPoints -".split(" "),b);if("undefined"!==typeof MathJax){var d=c.menus.addMenuItem(a,"mathematicalTypesetting",b);c.menus.addLinkToItem(d,"https://desk.draw.io/support/solutions/articles/16000032875")}c.menus.addMenuItems(a,["copyConnect","collapseExpand","-","pageScale"],b)})))};var h=EditorUi.prototype.init;EditorUi.prototype.init=function(){function a(a,b,c,d){var e=g.menus.get(a),f=p.addMenu(mxResources.get(a),mxUtils.bind(this,function(){e.funct.apply(this,
arguments)}),n);f.className="geMenuItem";f.style.display="inline-block";f.style.boxSizing="border-box";f.style.top="6px";f.style.marginRight="6px";f.style.height="30px";f.style.paddingTop="6px";f.style.paddingBottom="6px";f.setAttribute("title",mxResources.get(a));g.menus.menuCreated(e,f,"geMenuItem");null!=c?(f.style.backgroundImage="url("+c+")",f.style.backgroundPosition="center center",f.style.backgroundRepeat="no-repeat",f.style.backgroundSize="24px 24px",f.style.width="34px",f.innerHTML="",mxUtils.setOpacity(f,
d||40)):b||(f.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",f.style.backgroundPosition="right 6px center",f.style.backgroundRepeat="no-repeat",f.style.paddingRight="22px");return f}function b(a,b,c,d,e,f){var h=document.createElement("a");h.setAttribute("href","javascript:void(0)");h.className="geMenuItem";h.style.display="inline-block";h.style.boxSizing="border-box";h.style.height="30px";h.style.padding="6px";h.style.position="relative";h.style.verticalAlign="top";h.style.top=
"0px";null!=g.statusContainer?l.insertBefore(h,g.statusContainer):l.appendChild(h);null!=f?(h.style.backgroundImage="url("+f+")",h.style.backgroundPosition="center center",h.style.backgroundRepeat="no-repeat",h.style.backgroundSize="24px 24px",h.style.width="34px"):mxUtils.write(h,a);mxEvent.addListener(h,"click",function(a){"disabled"!=h.getAttribute("disabled")&&b(a);mxEvent.consume(a)});null==c&&(h.style.marginRight="4px");null!=d&&h.setAttribute("title",d);mxUtils.setOpacity(h,null!=f?40:100);
null!=e&&(a=function(){e.isEnabled()?(h.removeAttribute("disabled"),mxUtils.setOpacity(h,null!=f?40:100),h.style.cursor=""):(h.setAttribute("disabled","disabled"),mxUtils.setOpacity(h,null!=f?10:20),h.style.cursor="default")},e.addListener("stateChanged",a),a());return h}function c(a){var b=document.createElement("div");b.className="geMenuItem";b.style.display="inline-block";b.style.verticalAlign="top";b.style.marginRight="6px";b.style.padding="0 4px 0 4px";b.style.height="30px";b.style.position=
"relative";b.style.top="0px";for(var c=0;c<a.length;c++)null!=a[c]&&(a[c].style.margin="0px",a[c].style.boxShadow="none",b.appendChild(a[c]));null!=g.statusContainer?l.insertBefore(b,g.statusContainer):l.appendChild(b);return b}function d(){for(var d=l.firstChild;null!=d;){var f=d.nextSibling;"geMenuItem"!=d.className&&"geItem"!=d.className||d.parentNode.removeChild(d);d=f}n=l.firstChild;e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;(d=900>e)||a("diagram");c([d?
a("diagram",null,IMAGE_PATH+"/drawlogo-gray.svg",100):null,b(mxResources.get("shapes"),g.actions.get("toggleShapes").funct,null,mxResources.get("shapes"),g.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTMgMTN2OGg4di04aC04ek0zIDIxaDh2LThIM3Y4ek0zIDN2OGg4VjNIM3ptMTMuNjYtMS4zMUwxMSA3LjM0IDE2LjY2IDEzbDUuNjYtNS42Ni01LjY2LTUuNjV6Ii8+PC9zdmc+":null),b(mxResources.get("format"),
g.actions.get("toggleFormat").funct,null,mxResources.get("format")+" ("+g.actions.get("formatPanel").shortcut+")",g.actions.get("image"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIgM2MtNC45NyAwLTkgNC4wMy05IDlzNC4wMyA5IDkgOWMuODMgMCAxLjUtLjY3IDEuNS0xLjUgMC0uMzktLjE1LS43NC0uMzktMS4wMS0uMjMtLjI2LS4zOC0uNjEtLjM4LS45OSAwLS44My42Ny0xLjUgMS41LTEuNUgxNmMyLjc2IDAgNS0yLjI0IDUtNSAwLTQuNDItNC4wMy04LTktOHptLTUuNSA5Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTNS42NyA5IDYuNSA5IDggOS42NyA4IDEwLjUgNy4zMyAxMiA2LjUgMTJ6bTMtNEM4LjY3IDggOCA3LjMzIDggNi41UzguNjcgNSA5LjUgNXMxLjUuNjcgMS41IDEuNVMxMC4zMyA4IDkuNSA4em01IDBjLS44MyAwLTEuNS0uNjctMS41LTEuNVMxMy42NyA1IDE0LjUgNXMxLjUuNjcgMS41IDEuNVMxNS4zMyA4IDE0LjUgOHptMyA0Yy0uODMgMC0xLjUtLjY3LTEuNS0xLjVTMTYuNjcgOSAxNy41IDlzMS41LjY3IDEuNSAxLjUtLjY3IDEuNS0xLjUgMS41eiIvPjwvc3ZnPg==":
null)]);f=a("insert",!0,d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTkgMTNoLTZ2NmgtMnYtNkg1di0yaDZWNWgydjZoNnYyeiIvPjwvc3ZnPg==":null,40);c([f,b(mxResources.get("delete"),g.actions.get("delete").funct,null,mxResources.get("delete"),g.actions.get("delete"),d?"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNiAxOWMwIDEuMS45IDIgMiAyaDhjMS4xIDAgMi0uOSAyLTJWN0g2djEyek0xOSA0aC0zLjVsLTEtMWgtNWwtMSAxSDV2MmgxNFY0eiIvPjwvc3ZnPg==":
null)]);if(411<=e&&(f=g.actions.get("undo"),d=g.actions.get("redo"),f=b("",f.funct,null,mxResources.get("undo")+" ("+f.shortcut+")",f,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTIuNSA4Yy0yLjY1IDAtNS4wNS45OS02LjkgMi42TDIgN3Y5aDlsLTMuNjItMy42MmMxLjM5LTEuMTYgMy4xNi0xLjg4IDUuMTItMS44OCAzLjU0IDAgNi41NSAyLjMxIDcuNiA1LjVsMi4zNy0uNzhDMjEuMDggMTEuMDMgMTcuMTUgOCAxMi41IDh6Ii8+PC9zdmc+"),d=b("",d.funct,
null,mxResources.get("redo")+" ("+d.shortcut+")",d,"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTguNCAxMC42QzE2LjU1IDguOTkgMTQuMTUgOCAxMS41IDhjLTQuNjUgMC04LjU4IDMuMDMtOS45NiA3LjIyTDMuOSAxNmMxLjA1LTMuMTkgNC4wNS01LjUgNy42LTUuNSAxLjk1IDAgMy43My43MiA1LjEyIDEuODhMMTMgMTZoOVY3bC0zLjYgMy42eiIvPjwvc3ZnPg=="),c([f,d]),480<=e)){var d=g.actions.get("zoomIn"),f=g.actions.get("zoomOut"),h=g.actions.get("resetView");

View file

@ -90,7 +90,7 @@ chatLeft={1} hat den Chat verlassen
chatWindowTitle=Chat
chooseAnOption=Wählen Sie eine Option
chromeApp=Chrome app
collaborativeEditingNotice=Wichtige Mitteilung für gemeinesames Bearbeiten
collaborativeEditingNotice=Wichtige Mitteilung für gemeinsames Bearbeiten
compressed=Komprimiert
commitMessage=Commit-Nachricht
csv=CSV